summaryrefslogtreecommitdiff
path: root/gtk2_ardour/editor_tempodisplay.cc
diff options
context:
space:
mode:
authornick_m <mainsbridge@gmail.com>2017-02-27 11:59:16 +1100
committerRobin Gareus <robin@gareus.org>2017-02-27 20:16:10 +0100
commitf69f5467177e214a1f9808152c29848ce5eb1b8d (patch)
tree9e300bd6cc73c2217dc68be15bae6643d935416b /gtk2_ardour/editor_tempodisplay.cc
parentf3ada6f89347d1230cb2ce3a10582ab769c321af (diff)
poor man's display of end tempo for ramps.
Diffstat (limited to 'gtk2_ardour/editor_tempodisplay.cc')
-rw-r--r--gtk2_ardour/editor_tempodisplay.cc29
1 files changed, 22 insertions, 7 deletions
diff --git a/gtk2_ardour/editor_tempodisplay.cc b/gtk2_ardour/editor_tempodisplay.cc
index fbe58b8eae..611feb2af8 100644
--- a/gtk2_ardour/editor_tempodisplay.cc
+++ b/gtk2_ardour/editor_tempodisplay.cc
@@ -105,12 +105,19 @@ Editor::draw_metric_marks (const Metrics& metrics)
}
} else if ((ts = dynamic_cast<TempoSection*>(*i)) != 0) {
- if (ts->note_type() != 4.0) {
- snprintf (buf, sizeof (buf), "%.3f/%.0f", ts->note_types_per_minute(), ts->note_type());
+ 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 {
- snprintf (buf, sizeof (buf), "%.3f", ts->note_types_per_minute());
+ 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());
@@ -234,10 +241,18 @@ Editor::tempometric_position_changed (const PropertyChange& /*ignored*/)
tempo_marker->set_points_color (UIConfiguration::instance().color ("tempo marker"));
}
- if (ts->note_type() != 4.0) {
- snprintf (buf, sizeof (buf), "%.3f/%.0f", ts->note_types_per_minute(), ts->note_type());
+ 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 {
- snprintf (buf, sizeof (buf), "%.3f", ts->note_types_per_minute());
+ 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);