summaryrefslogtreecommitdiff
path: root/gtk2_ardour/editor_tempodisplay.cc
diff options
context:
space:
mode:
authornick_m <mainsbridge@gmail.com>2015-12-23 23:32:16 +1100
committernick_m <mainsbridge@gmail.com>2016-05-27 23:38:09 +1000
commitba0cfe81a4fef09aa67824e6cd81e6d82fe224e7 (patch)
tree22054dd064e17dcd4c5f08099bb9f4040036b0ab /gtk2_ardour/editor_tempodisplay.cc
parentdb77ca99a12147b89385745d6f96d208f05c6681 (diff)
Tempo ramps - massively speed up dragging of tempo marks.
Diffstat (limited to 'gtk2_ardour/editor_tempodisplay.cc')
-rw-r--r--gtk2_ardour/editor_tempodisplay.cc20
1 files changed, 18 insertions, 2 deletions
diff --git a/gtk2_ardour/editor_tempodisplay.cc b/gtk2_ardour/editor_tempodisplay.cc
index 2794051265..3dad29ef51 100644
--- a/gtk2_ardour/editor_tempodisplay.cc
+++ b/gtk2_ardour/editor_tempodisplay.cc
@@ -126,7 +126,6 @@ Editor::tempo_map_changed (const PropertyChange& /*ignored*/)
void
Editor::marker_position_changed ()
{
-// yes its identical...
if (!_session) {
return;
}
@@ -136,10 +135,27 @@ Editor::marker_position_changed ()
if (tempo_lines) {
tempo_lines->tempo_map_changed();
}
+ TempoMarker* tempo_marker;
+ MeterMarker* meter_marker;
+ const TempoSection *ts;
+ const MeterSection *ms;
+ for (Marks::iterator x = metric_marks.begin(); x != metric_marks.end(); ++x) {
+ if ((tempo_marker = dynamic_cast<TempoMarker*> (*x)) != 0) {
+ if ((ts = &tempo_marker->tempo()) != 0) {
+ cerr << "tempo section found for tempo marker " << endl;
+ tempo_marker->set_position (ts->frame ());
+ }
+ }
+ if ((meter_marker = dynamic_cast<MeterMarker*> (*x)) != 0) {
+ if ((ms = &meter_marker->meter()) != 0) {
+ cerr << "meter section found for meter marker " << endl;
+ meter_marker->set_position (ms->frame ());
+ }
+ }
+ }
std::vector<TempoMap::BBTPoint> grid;
compute_current_bbt_points (grid, leftmost_frame, leftmost_frame + current_page_samples());
- _session->tempo_map().apply_with_metrics (*this, &Editor::draw_metric_marks); // redraw metric markers
draw_measures (grid);
update_tempo_based_rulers (grid);
}