diff options
author | nick_m <mainsbridge@gmail.com> | 2016-05-19 01:01:08 +1000 |
---|---|---|
committer | nick_m <mainsbridge@gmail.com> | 2016-05-27 23:38:16 +1000 |
commit | 2d3d7a53556a0b724c91db0dbf991e3d7a78b4fe (patch) | |
tree | 5b95d1e2e4389d835f4a7033994fb9c62e97344b /gtk2_ardour/tempo_curve.cc | |
parent | e5ba2bc34c400a533b3578ebe722eef0183a3d68 (diff) |
Tempo ramps - fix ambiguous api, fix flickering tempo curves.
Diffstat (limited to 'gtk2_ardour/tempo_curve.cc')
-rw-r--r-- | gtk2_ardour/tempo_curve.cc | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/gtk2_ardour/tempo_curve.cc b/gtk2_ardour/tempo_curve.cc index 8f19001357..9e09690569 100644 --- a/gtk2_ardour/tempo_curve.cc +++ b/gtk2_ardour/tempo_curve.cc @@ -133,10 +133,10 @@ TempoCurve::set_position (framepos_t frame, framepos_t end_frame) points->push_back (ArdourCanvas::Duple (ArdourCanvas::COORD_MAX - 5.0, y_pos)); } else { - const framepos_t frame_step = (end_frame - frame) / 31; + const framepos_t frame_step = ((end_frame - 1) - frame) / 29; framepos_t current_frame = frame; - while (current_frame < end_frame) { + while (current_frame < (end_frame - frame_step)) { const double tempo_at = _tempo.tempo_at_frame (current_frame, editor.session()->frame_rate()) * _tempo.note_type(); const double y_pos = (curve_height) - (((tempo_at - _min_tempo) / (tempo_delta)) * curve_height); @@ -145,12 +145,10 @@ TempoCurve::set_position (framepos_t frame, framepos_t end_frame) max_y = max (y_pos, max_y); current_frame += frame_step; } - if (current_frame != end_frame) { - const double tempo_at = _tempo.tempo_at_frame (end_frame, editor.session()->frame_rate()) * _tempo.note_type(); - const double y_pos = (curve_height) - (((tempo_at - _min_tempo) / (tempo_delta)) * curve_height); + const double tempo_at = _tempo.tempo_at_frame (end_frame, editor.session()->frame_rate()) * _tempo.note_type(); + const double y_pos = (curve_height) - (((tempo_at - _min_tempo) / (tempo_delta)) * curve_height); - points->push_back (ArdourCanvas::Duple (editor.sample_to_pixel (end_frame - frame), y_pos)); - } + points->push_back (ArdourCanvas::Duple (editor.sample_to_pixel ((end_frame - 1) - frame), y_pos)); } _curve->set (*points); |