fix potential absorption of music-locked tempo into meter-locked one.
authornick_m <mainsbridge@gmail.com>
Sat, 4 Feb 2017 13:30:13 +0000 (00:30 +1100)
committernick_m <mainsbridge@gmail.com>
Sat, 4 Feb 2017 13:30:13 +0000 (00:30 +1100)
libs/ardour/tempo.cc

index 9d8633f19f6ae0bfefd64248c457d63ed2ae807f..dde84fe1378e5a47c91629434f42400b91d83725 100644 (file)
@@ -1091,7 +1091,7 @@ TempoMap::replace_tempo (TempoSection& ts, const Tempo& tempo, const double& pul
                Glib::Threads::RWLock::WriterLock lm (lock);
                TempoSection& first (first_tempo());
                if (!ts.initial()) {
-                       if (ts.locked_to_meter()) {
+                       if (locked_to_meter) {
                                ts.set_type (type);
                                {
                                        /* cannot move a meter-locked tempo section */
@@ -1107,6 +1107,7 @@ TempoMap::replace_tempo (TempoSection& ts, const Tempo& tempo, const double& pul
                        first.set_pulse (0.0);
                        first.set_minute (minute_at_frame (frame));
                        first.set_position_lock_style (AudioTime);
+                       first.set_locked_to_meter (true);
                        {
                                /* cannot move the first tempo section */
                                *static_cast<Tempo*>(&first) = tempo;
@@ -1185,6 +1186,7 @@ TempoMap::replace_meter (const MeterSection& ms, const Meter& meter, const BBT_T
                        pair<double, BBT_Time> beat = make_pair (0.0, BBT_Time (1, 1, 0));
                        first.set_beat (beat);
                        first_t.set_minute (first.minute());
+                       first_t.set_locked_to_meter (true);
                        first_t.set_pulse (0.0);
                        first_t.set_position_lock_style (AudioTime);
                        recompute_map (_metrics);