From 4496babc8f00169130bde964961e368d332cc66b Mon Sep 17 00:00:00 2001 From: nick_m Date: Mon, 27 Feb 2017 17:53:31 +1100 Subject: initial rework of tempo text display (numbers are curve items) - move tempo numbers to a layer above the curve. - the offset of the text box in Marker is horrible here. what to do? --- gtk2_ardour/editor_tempodisplay.cc | 35 +++-------------------------------- 1 file changed, 3 insertions(+), 32 deletions(-) (limited to 'gtk2_ardour/editor_tempodisplay.cc') diff --git a/gtk2_ardour/editor_tempodisplay.cc b/gtk2_ardour/editor_tempodisplay.cc index 767d84d918..752373db6e 100644 --- a/gtk2_ardour/editor_tempodisplay.cc +++ b/gtk2_ardour/editor_tempodisplay.cc @@ -105,19 +105,6 @@ Editor::draw_metric_marks (const Metrics& metrics) } } else if ((ts = dynamic_cast(*i)) != 0) { - if (ts->type() == TempoSection::Constant) { - if (ts->note_type() != 4.0) { - snprintf (buf, sizeof (buf), "%.3f/%.0f", ts->note_types_per_minute(), ts->note_type()); - } else { - snprintf (buf, sizeof (buf), "%.3f", ts->note_types_per_minute()); - } - } else { - if (ts->note_type() != 4.0) { - snprintf (buf, sizeof (buf), "%.3f/%.0f>%.3f", ts->note_types_per_minute(), ts->note_type(), ts->end_note_types_per_minute()); - } else { - snprintf (buf, sizeof (buf), "%.3f>%.3f", ts->note_types_per_minute(), ts->end_note_types_per_minute()); - } - } max_tempo = max (max_tempo, ts->note_types_per_minute()); max_tempo = max (max_tempo, ts->end_note_types_per_minute()); min_tempo = min (min_tempo, ts->note_types_per_minute()); @@ -127,11 +114,12 @@ Editor::draw_metric_marks (const Metrics& metrics) tempo_curves.push_back (new TempoCurve (*this, *tempo_group, tc_color, *(const_cast(ts)), ts->frame(), false)); + const std::string tname (X_("")); if (ts->position_lock_style() == MusicTime) { - metric_marks.push_back (new TempoMarker (*this, *tempo_group, UIConfiguration::instance().color ("tempo marker music"), buf, + metric_marks.push_back (new TempoMarker (*this, *tempo_group, UIConfiguration::instance().color ("tempo marker music"), tname, *(const_cast(ts)))); } else { - metric_marks.push_back (new TempoMarker (*this, *tempo_group, UIConfiguration::instance().color ("tempo marker"), buf, + metric_marks.push_back (new TempoMarker (*this, *tempo_group, UIConfiguration::instance().color ("tempo marker"), tname, *(const_cast(ts)))); } if (prev_ts && abs (prev_ts->end_note_types_per_minute() - ts->note_types_per_minute()) < 1.0) { @@ -233,7 +221,6 @@ Editor::tempometric_position_changed (const PropertyChange& /*ignored*/) if ((ts = &tempo_marker->tempo()) != 0) { tempo_marker->set_position (ts->frame ()); - char buf[64]; if (prev_ts && abs (prev_ts->end_note_types_per_minute() - ts->note_types_per_minute()) < 1.0) { tempo_marker->set_points_color (UIConfiguration::instance().color ("tempo marker music")); @@ -241,22 +228,6 @@ Editor::tempometric_position_changed (const PropertyChange& /*ignored*/) tempo_marker->set_points_color (UIConfiguration::instance().color ("tempo marker")); } - if (ts->type() == TempoSection::Constant) { - if (ts->note_type() != 4.0) { - snprintf (buf, sizeof (buf), "%.3f/%.0f", ts->note_types_per_minute(), ts->note_type()); - } else { - snprintf (buf, sizeof (buf), "%.3f", ts->note_types_per_minute()); - } - } else { - if (ts->note_type() != 4.0) { - snprintf (buf, sizeof (buf), "%.3f/%.0f>%.3f", ts->note_types_per_minute(), ts->note_type(), ts->end_note_types_per_minute()); - } else { - snprintf (buf, sizeof (buf), "%.3f>%.3f", ts->note_types_per_minute(), ts->end_note_types_per_minute()); - } - } - - tempo_marker->set_name (buf); - max_tempo = max (max_tempo, ts->note_types_per_minute()); max_tempo = max (max_tempo, ts->end_note_types_per_minute()); min_tempo = min (min_tempo, ts->note_types_per_minute()); -- cgit v1.2.3