13
0

AU tempo API updates

This commit is contained in:
Robin Gareus 2016-05-27 18:28:23 +02:00
parent b9f70334b6
commit 46709de8ab

View File

@ -1760,9 +1760,8 @@ AUPlugin::get_beat_and_tempo_callback (Float64* outCurrentBeat,
return kAudioUnitErr_CannotDoInCurrentContext;
}
Timecode::BBT_Time bbt;
TempoMetric metric = tmap.metric_at (_session.transport_frame() + input_offset);
tmap.bbt_time (_session.transport_frame() + input_offset, bbt);
Timecode::BBT_Time bbt = _session.tempo_map().bbt_at_frame (_session.transport_frame() + input_offset);
if (outCurrentBeat) {
const double ppq_scaling = metric.meter().note_divisor() / 4.0;
@ -1800,9 +1799,8 @@ AUPlugin::get_musical_time_location_callback (UInt32* outDeltaSampleOffsetToNe
return kAudioUnitErr_CannotDoInCurrentContext;
}
Timecode::BBT_Time bbt;
TempoMetric metric = tmap.metric_at (_session.transport_frame() + input_offset);
tmap.bbt_time (_session.transport_frame() + input_offset, bbt);
Timecode::BBT_Time bbt = _session.tempo_map().bbt_at_frame (_session.transport_frame() + input_offset);
if (outDeltaSampleOffsetToNextBeat) {
if (bbt.ticks == 0) {
@ -1896,7 +1894,7 @@ AUPlugin::get_transport_state_callback (Boolean* outIsPlaying,
if (outCycleStartBeat) {
TempoMetric metric = tmap.metric_at (loc->start() + input_offset);
_session.tempo_map().bbt_time (loc->start(), bbt);
bbt = _session.tempo_map().bbt_at_frame (loc->start() + input_offset);
float beat;
beat = metric.meter().divisions_per_bar() * bbt.bars;
@ -1908,7 +1906,7 @@ AUPlugin::get_transport_state_callback (Boolean* outIsPlaying,
if (outCycleEndBeat) {
TempoMetric metric = tmap.metric_at (loc->end() + input_offset);
_session.tempo_map().bbt_time (loc->end(), bbt);
bbt = _session.tempo_map().bbt_at_frame (loc->end() + input_offset);
float beat;
beat = metric.meter().divisions_per_bar() * bbt.bars;