summaryrefslogtreecommitdiff
path: root/gtk2_ardour/editor_tempodisplay.cc
diff options
context:
space:
mode:
authornick_m <mainsbridge@gmail.com>2017-02-27 17:53:31 +1100
committerRobin Gareus <robin@gareus.org>2017-02-27 20:16:10 +0100
commit4496babc8f00169130bde964961e368d332cc66b (patch)
treee977b422beba972f835ad5675a39a800450e1bc3 /gtk2_ardour/editor_tempodisplay.cc
parentf4575442634bcecf3caa633b849502491ed19ae7 (diff)
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?
Diffstat (limited to 'gtk2_ardour/editor_tempodisplay.cc')
-rw-r--r--gtk2_ardour/editor_tempodisplay.cc35
1 files changed, 3 insertions, 32 deletions
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<TempoSection*>(*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<TempoSection*>(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<TempoSection*>(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<TempoSection*>(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());