summaryrefslogtreecommitdiff
path: root/gtk2_ardour/editor_tempodisplay.cc
diff options
context:
space:
mode:
authornick_m <mainsbridge@gmail.com>2017-02-25 05:09:16 +1100
committerRobin Gareus <robin@gareus.org>2017-02-27 20:16:10 +0100
commitccb51a8ddbecd2fe3d6847d85b3a4ba1f55d3ef1 (patch)
tree0dad2071b3da73ced18cfb75cc1ea0e40e1fc838 /gtk2_ardour/editor_tempodisplay.cc
parentdd72d2bf6584571b88fb383752dcb0dd892a034a (diff)
rework tempo editing.
most changes are due to a new design where tempo discontinuities at the beginning of a ramped section may be set. this allows easier mapping of live performance, especially in the common case of a ramped ritard before the beginning of a new section. feature summary: holding constraint modifier (shift) while dragging the BBT ruler area drags the tempo lines by changing the start tempo (as before) holding copy modifier (control) while dragging the BBT ruler area drags the tempo lines by changing the end tempo (ahem. not quite there) dragging a tempo mark while holding constraint (shift) will change the previous end tempo to match the marker position *worth trying*. holding constraint and copy modifier (control + shift) while dragging the BBT ruler area attempts to'pinch' or twist the surrounding tempi sp that later ones are not repositioned (currently suffereng from rounding errors)
Diffstat (limited to 'gtk2_ardour/editor_tempodisplay.cc')
-rw-r--r--gtk2_ardour/editor_tempodisplay.cc20
1 files changed, 19 insertions, 1 deletions
diff --git a/gtk2_ardour/editor_tempodisplay.cc b/gtk2_ardour/editor_tempodisplay.cc
index b863cb9901..162179a7b9 100644
--- a/gtk2_ardour/editor_tempodisplay.cc
+++ b/gtk2_ardour/editor_tempodisplay.cc
@@ -86,6 +86,7 @@ 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
@@ -110,10 +111,18 @@ Editor::draw_metric_marks (const Metrics& metrics)
}
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());
+ min_tempo = min (min_tempo, ts->end_note_types_per_minute());
+ uint32_t tc_color = UIConfiguration::instance().color ("tempo curve");
- tempo_curves.push_back (new TempoCurve (*this, *tempo_group, 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");
+ }
+
+ tempo_curves.push_back (new TempoCurve (*this, *tempo_group, tc_color,
*(const_cast<TempoSection*>(ts)), ts->frame(), false));
+
if (ts->position_lock_style() == MusicTime) {
metric_marks.push_back (new TempoMarker (*this, *tempo_group, UIConfiguration::instance().color ("tempo marker music"), buf,
*(const_cast<TempoSection*>(ts))));
@@ -122,6 +131,8 @@ Editor::draw_metric_marks (const Metrics& metrics)
*(const_cast<TempoSection*>(ts))));
}
+ prev_ts = ts;
+
}
}
@@ -224,7 +235,9 @@ Editor::tempometric_position_changed (const PropertyChange& /*ignored*/)
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());
+ min_tempo = min (min_tempo, ts->end_note_types_per_minute());
}
}
if ((meter_marker = dynamic_cast<MeterMarker*> (*x)) != 0) {
@@ -250,6 +263,11 @@ 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);