diff options
author | nick_m <mainsbridge@gmail.com> | 2016-10-30 23:21:42 +1100 |
---|---|---|
committer | nick_m <mainsbridge@gmail.com> | 2016-11-11 03:37:08 +1100 |
commit | 0e867b544b6d1b5f82f46cec7171998b2f2ca3bc (patch) | |
tree | cc9605fbd8ed505aedb3e1d04cfa301a84ad8b33 /gtk2_ardour/tempo_curve.cc | |
parent | ae63243bf3af8ab4dad8535ac2811df399c9a34a (diff) |
Refactor tempo api, include quarter-note distance in frames method.
- moves frame rounding up to TempoMap, which is needed
in order to calculate pulse distance without frame rounding.
- the time unit for tempo is still minute, but this now also
applies to meter sections. (new audio locked meter sections no
longer require a frame position).
- there is no longer a discontinuity
in the pulse for audio-locked meter/tempi.
- temporarily add debugging output in Region::set_position()
to test for region beat not matching region frame.
Diffstat (limited to 'gtk2_ardour/tempo_curve.cc')
-rw-r--r-- | gtk2_ardour/tempo_curve.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gtk2_ardour/tempo_curve.cc b/gtk2_ardour/tempo_curve.cc index 358457e505..7330e8c129 100644 --- a/gtk2_ardour/tempo_curve.cc +++ b/gtk2_ardour/tempo_curve.cc @@ -131,7 +131,7 @@ TempoCurve::set_position (framepos_t frame, framepos_t end_frame) framepos_t current_frame = frame; while (current_frame < (end_frame - frame_step)) { - const double tempo_at = _tempo.tempo_at_frame (current_frame, editor.session()->frame_rate()); + const double tempo_at = _tempo.tempo_at_minute (_tempo.minute_at_frame (current_frame)); const double y_pos = max ((curve_height) - (((tempo_at - _min_tempo) / (_max_tempo - _min_tempo)) * curve_height), 0.0); points->push_back (ArdourCanvas::Duple (editor.sample_to_pixel (current_frame - frame), min (y_pos, curve_height))); @@ -139,7 +139,7 @@ TempoCurve::set_position (framepos_t frame, framepos_t end_frame) current_frame += frame_step; } - const double tempo_at = _tempo.tempo_at_frame (end_frame, editor.session()->frame_rate()); + const double tempo_at = _tempo.tempo_at_minute (_tempo.minute_at_frame (end_frame)); const double y_pos = max ((curve_height) - (((tempo_at - _min_tempo) / (_max_tempo - _min_tempo)) * curve_height), 0.0); points->push_back (ArdourCanvas::Duple (editor.sample_to_pixel ((end_frame - 1) - frame), min (y_pos, curve_height))); |