diff options
author | nick_m <mainsbridge@gmail.com> | 2016-05-25 04:10:22 +1000 |
---|---|---|
committer | nick_m <mainsbridge@gmail.com> | 2016-05-27 23:38:17 +1000 |
commit | a9921c10eb7d498946c756c184ae67422bff76c0 (patch) | |
tree | 9dc9166a8e71e44ecd2ef9414d5102b37cff6cdd /gtk2_ardour/editor_tempodisplay.cc | |
parent | 533e5c40697e34af467b309849119596992f0f69 (diff) |
Gd Lk ramps - rework auto scaling. change colour.
Diffstat (limited to 'gtk2_ardour/editor_tempodisplay.cc')
-rw-r--r-- | gtk2_ardour/editor_tempodisplay.cc | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/gtk2_ardour/editor_tempodisplay.cc b/gtk2_ardour/editor_tempodisplay.cc index c100fbd4c7..ef04f84b76 100644 --- a/gtk2_ardour/editor_tempodisplay.cc +++ b/gtk2_ardour/editor_tempodisplay.cc @@ -103,7 +103,7 @@ Editor::draw_metric_marks (const Metrics& metrics) max_tempo = max (max_tempo, ts->beats_per_minute()); min_tempo = min (min_tempo, ts->beats_per_minute()); - tempo_curves.push_back (new TempoCurve (*this, *tempo_group, UIConfiguration::instance().color ("range drag rect"), + tempo_curves.push_back (new TempoCurve (*this, *tempo_group, UIConfiguration::instance().color ("color 62"), *(const_cast<TempoSection*>(ts)), ts->frame(), false)); metric_marks.push_back (new TempoMarker (*this, *tempo_group, UIConfiguration::instance().color ("tempo marker"), buf, *(const_cast<TempoSection*>(ts)))); @@ -112,6 +112,14 @@ Editor::draw_metric_marks (const Metrics& metrics) } + const double min_tempo_range = 5.0; + const double tempo_delta = fabs (max_tempo - min_tempo); + + if (tempo_delta < min_tempo_range) { + max_tempo += min_tempo_range - tempo_delta; + min_tempo += tempo_delta - min_tempo_range; + } + for (Curves::iterator x = tempo_curves.begin(); x != tempo_curves.end(); ) { Curves::iterator tmp = x; (*x)->set_max_tempo (max_tempo); @@ -203,6 +211,14 @@ Editor::marker_position_changed () tempo_curves.sort (CurveComparator()); + const double min_tempo_range = 5.0; + const double tempo_delta = fabs (max_tempo - min_tempo); + + if (tempo_delta < min_tempo_range) { + max_tempo += min_tempo_range - tempo_delta; + min_tempo += tempo_delta - min_tempo_range; + } + for (Curves::iterator x = tempo_curves.begin(); x != tempo_curves.end(); ) { Curves::iterator tmp = x; (*x)->set_max_tempo (max_tempo); |