Skip to content

Commit

Permalink
Merge pull request #10 from AbletonAppDev/fix-ABLLinkForceBeatAtTime-…
Browse files Browse the repository at this point in the history
…linking

Fix ABLLinkForceBeatAtTime liker error
  • Loading branch information
brs-ableton authored Jun 28, 2016
2 parents 815d9d1 + 42203e8 commit 146d51e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
4 changes: 2 additions & 2 deletions LinkHut/LinkHut/AudioEngine.m
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ static void renderMetronomeIntoBuffer(
const UInt64 hostTime = beginHostTime + llround(i * hostTicksPerSample);
// Only make sound for positive beat magnitudes. Negative beat
// magnitudes are count-in beats.
if (ABLLinkBeatTimeAtHostTime(timeline, hostTime, quantum) >= 0.) {
if (ABLLinkBeatAtTime(timeline, hostTime, quantum) >= 0.) {
// Get the phase of this sample. The phase is a beat value in
// the range [0, quantum).
const Float64 phase = ABLLinkPhaseAtTime(timeline, hostTime, quantum);
Expand Down Expand Up @@ -239,7 +239,7 @@ - (void)setBpm:(Float64)bpm {
}

- (Float64)beatTime {
return ABLLinkBeatTimeAtHostTime(
return ABLLinkBeatAtTime(
ABLLinkCaptureAppTimeline(_linkData.ablLink),
mach_absolute_time(),
self.quantum);
Expand Down
11 changes: 5 additions & 6 deletions LinkKit/ABLLink.h
Original file line number Diff line number Diff line change
Expand Up @@ -209,24 +209,23 @@ extern "C"
* unique to this Link instance, but its phase with respect to
* the provided quantum is shared among all session
* peers. For non-negative beat values, the following
* property holds: fmod(ABLLinkBeatTimeAtHostTime(tl, ht, q), q) ==
* property holds: fmod(ABLLinkBeatAtTime(tl, ht, q), q) ==
* ABLLinkPhaseAtTime(tl, ht, q).
*/
double ABLLinkBeatTimeAtHostTime(
double ABLLinkBeatAtTime(
ABLLinkTimelineRef,
uint64_t hostTimeAtOutput,
double quantum);

/*! @brief Get the host time at which the sound corresponding to the
* given beat time and quantum reaches the device's audio output.
*
* @discussion: The inverse of ABLLinkBeatTimeAtHostTime, assuming
* @discussion: The inverse of ABLLinkBeatAtTime, assuming
* a constant tempo.
*
* ABLLinkBeatTimeAtHostTime(tl,
* ABLLinkHostTimeAtBeatTime(tl, b, q), q) == b.
* ABLLinkBeatAtTime(tl, ABLLinkTimeAtBeat(tl, b, q), q) == b.
*/
uint64_t ABLLinkHostTimeAtBeatTime(
uint64_t ABLLinkTimeAtBeat(
ABLLinkTimelineRef,
double beatTime,
double quantum);
Expand Down
6 changes: 3 additions & 3 deletions LinkKit/ABLLink.mm
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ void ABLLinkSetTempo(
timeline->impl.setTempo(bpm, micros);
}

double ABLLinkBeatTimeAtHostTime(
double ABLLinkBeatAtTime(
ABLLinkTimelineRef timeline,
const uint64_t hostTime,
const double quantum)
Expand All @@ -189,7 +189,7 @@ void ABLLinkSetTempo(
return timeline->impl.phaseAtTime(micros, quantum);
}

uint64_t ABLLinkHostTimeAtBeatTime(
uint64_t ABLLinkTimeAtBeat(
ABLLinkTimelineRef timeline,
const double beatTime,
const double quantum)
Expand All @@ -208,7 +208,7 @@ void ABLLinkRequestBeatAtTime(
timeline->impl.requestBeatAtTime(beatTime, micros, quantum);
}

void ABLLinkForceBeatTime(
void ABLLinkForceBeatAtTime(
ABLLinkTimelineRef timeline,
const double beatTime,
const std::uint64_t hostTime,
Expand Down

0 comments on commit 146d51e

Please sign in to comment.