diff options
author | nick_m <mainsbridge@gmail.com> | 2016-05-24 06:49:52 +1000 |
---|---|---|
committer | nick_m <mainsbridge@gmail.com> | 2016-05-27 23:38:17 +1000 |
commit | 1927a707c560cfe2a9963fb0fb75d65f5720256d (patch) | |
tree | 834295054ebc43309731dc1d779cb971849c5270 /gtk2_ardour | |
parent | 5d5fba0cfbec28eec710aabba6f55f1dcdb75d5a (diff) |
Tempo ramps - fix huge marker height mark, remove unused var.
Diffstat (limited to 'gtk2_ardour')
-rw-r--r-- | gtk2_ardour/editor_tempodisplay.cc | 2 | ||||
-rw-r--r-- | gtk2_ardour/tempo_curve.cc | 8 |
2 files changed, 4 insertions, 6 deletions
diff --git a/gtk2_ardour/editor_tempodisplay.cc b/gtk2_ardour/editor_tempodisplay.cc index e0af960d40..c100fbd4c7 100644 --- a/gtk2_ardour/editor_tempodisplay.cc +++ b/gtk2_ardour/editor_tempodisplay.cc @@ -129,7 +129,7 @@ Editor::draw_metric_marks (const Metrics& metrics) TempoMarker* tempo_marker; if ((tempo_marker = dynamic_cast<TempoMarker*> (*x)) != 0) { - tempo_marker->update_height_mark ((tempo_marker->tempo().beats_per_minute() - min_tempo) / (max_tempo - min_tempo)); + tempo_marker->update_height_mark ((tempo_marker->tempo().beats_per_minute() - min_tempo) / max (10.0, max_tempo - min_tempo)); } } } diff --git a/gtk2_ardour/tempo_curve.cc b/gtk2_ardour/tempo_curve.cc index 9e09690569..b3968e33aa 100644 --- a/gtk2_ardour/tempo_curve.cc +++ b/gtk2_ardour/tempo_curve.cc @@ -110,13 +110,13 @@ TempoCurve::the_item() const void TempoCurve::set_position (framepos_t frame, framepos_t end_frame) { + const double tempo_delta = max (10.0, _max_tempo - _min_tempo); + unit_position = editor.sample_to_pixel (frame); group->set_x_position (unit_position); frame_position = frame; _end_frame = end_frame; - const double tempo_delta = max (10.0, _max_tempo - _min_tempo); - double max_y = 0.0; points->clear(); @@ -127,8 +127,6 @@ TempoCurve::set_position (framepos_t frame, framepos_t end_frame) const double tempo_at = _tempo.tempo_at_frame (frame, editor.session()->frame_rate()) * _tempo.note_type(); const double y_pos = (curve_height) - (((tempo_at - _min_tempo) / (tempo_delta)) * curve_height); - max_y = y_pos; - points->push_back (ArdourCanvas::Duple (0.0, y_pos)); points->push_back (ArdourCanvas::Duple (ArdourCanvas::COORD_MAX - 5.0, y_pos)); @@ -142,9 +140,9 @@ TempoCurve::set_position (framepos_t frame, framepos_t end_frame) points->push_back (ArdourCanvas::Duple (editor.sample_to_pixel (current_frame - frame), y_pos)); - max_y = max (y_pos, max_y); current_frame += frame_step; } + 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); |