summaryrefslogtreecommitdiff
path: root/gtk2_ardour/tempo_curve.cc
diff options
context:
space:
mode:
authornick_m <mainsbridge@gmail.com>2016-09-04 03:18:12 +1000
committernick_m <mainsbridge@gmail.com>2016-09-04 03:18:12 +1000
commita4d67279e0086258d7cfd4eab12746e07bdaadc9 (patch)
treef8d11a27ece0ca3ddec6774fddc632294711ecc1 /gtk2_ardour/tempo_curve.cc
parentcbd310ef650c88e61d65defdfc3e785aa9dc7326 (diff)
Fix graphical issues in tempo curve.
Diffstat (limited to 'gtk2_ardour/tempo_curve.cc')
-rw-r--r--gtk2_ardour/tempo_curve.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/gtk2_ardour/tempo_curve.cc b/gtk2_ardour/tempo_curve.cc
index db675c9c5f..7f13e17d24 100644
--- a/gtk2_ardour/tempo_curve.cc
+++ b/gtk2_ardour/tempo_curve.cc
@@ -121,18 +121,19 @@ TempoCurve::set_position (framepos_t frame, framepos_t end_frame)
points->push_back (ArdourCanvas::Duple (0.0, curve_height));
if (end_frame == UINT32_MAX) {
- const double tempo_at = _tempo.tempo_at_frame (frame, editor.session()->frame_rate()) * _tempo.note_type();
+ const double tempo_at = _tempo.tempo_at_frame (frame, editor.session()->frame_rate()) * 4.0;
const double y_pos = (curve_height) - (((tempo_at - _min_tempo) / (_max_tempo - _min_tempo)) * curve_height);
points->push_back (ArdourCanvas::Duple (0.0, y_pos));
points->push_back (ArdourCanvas::Duple (ArdourCanvas::COORD_MAX - 5.0, y_pos));
} else {
+
const framepos_t frame_step = max ((end_frame - frame) / 5, (framepos_t) 1);
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()) * _tempo.note_type();
+ const double tempo_at = _tempo.tempo_at_frame (current_frame, editor.session()->frame_rate()) * 4.0;
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)));
@@ -140,7 +141,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()) * _tempo.note_type();
+ const double tempo_at = _tempo.tempo_at_frame (end_frame, editor.session()->frame_rate()) * 4.0;
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)));