From 8e944953c6c0ef210c36fd9a2e9d60f3e5a6766a Mon Sep 17 00:00:00 2001 From: nick_m Date: Sun, 26 Feb 2017 07:03:02 +1100 Subject: highlight the tempo curve that is to be altered, modify text to suit. --- gtk2_ardour/editor_tempodisplay.cc | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'gtk2_ardour/editor_tempodisplay.cc') diff --git a/gtk2_ardour/editor_tempodisplay.cc b/gtk2_ardour/editor_tempodisplay.cc index 35b4783f20..86b1b8d65a 100644 --- a/gtk2_ardour/editor_tempodisplay.cc +++ b/gtk2_ardour/editor_tempodisplay.cc @@ -86,7 +86,6 @@ Editor::draw_metric_marks (const Metrics& metrics) char buf[64]; double max_tempo = 0.0; double min_tempo = DBL_MAX; - const TempoSection *prev_ts = 0; remove_metric_marks (); // also clears tempo curves @@ -114,11 +113,7 @@ Editor::draw_metric_marks (const Metrics& metrics) max_tempo = max (max_tempo, ts->end_note_types_per_minute()); min_tempo = min (min_tempo, ts->note_types_per_minute()); min_tempo = min (min_tempo, ts->end_note_types_per_minute()); - uint32_t tc_color = UIConfiguration::instance().color ("tempo curve"); - - if (prev_ts && abs (prev_ts->end_note_types_per_minute() - ts->note_types_per_minute()) < 2) { - tc_color = UIConfiguration::instance().color ("location loop"); - } + uint32_t const tc_color = UIConfiguration::instance().color ("tempo curve"); tempo_curves.push_back (new TempoCurve (*this, *tempo_group, tc_color, *(const_cast(ts)), ts->frame(), false)); @@ -130,9 +125,6 @@ Editor::draw_metric_marks (const Metrics& metrics) metric_marks.push_back (new TempoMarker (*this, *tempo_group, UIConfiguration::instance().color ("tempo marker"), buf, *(const_cast(ts)))); } - - prev_ts = ts; - } } @@ -263,11 +255,6 @@ Editor::tempometric_position_changed (const PropertyChange& /*ignored*/) (*x)->set_min_tempo (min_tempo); ++tmp; if (tmp != tempo_curves.end()) { - if (abs ((*tmp)->tempo().note_types_per_minute() - (*x)->tempo().end_note_types_per_minute()) < 2) { - (*tmp)->set_color_rgba (UIConfiguration::instance().color ("location loop")); - } else { - (*tmp)->set_color_rgba (UIConfiguration::instance().color ("tempo curve")); - } (*x)->set_position ((*x)->tempo().frame(), (*tmp)->tempo().frame()); } else { (*x)->set_position ((*x)->tempo().frame(), UINT32_MAX); @@ -322,6 +309,19 @@ Editor::redisplay_tempo (bool immediate_redraw) Glib::signal_idle().connect (sigc::bind_return (sigc::bind (sigc::mem_fun (*this, &Editor::redisplay_tempo), true), false)); } } +void +Editor::tempo_curve_selected (TempoSection* ts, bool yn) +{ + for (Curves::iterator x = tempo_curves.begin(); x != tempo_curves.end(); ++x) { + if (&(*x)->tempo() == ts && yn) { + (*x)->set_color_rgba (UIConfiguration::instance().color ("location marker")); + break; + } else if (&(*x)->tempo() == ts) { + (*x)->set_color_rgba (UIConfiguration::instance().color ("tempo curve")); + break; + } + } +} /* computes a grid starting a beat before and ending a beat after leftmost and rightmost respectively */ void -- cgit v1.2.3