diff --git a/libs/temporal/tempo.cc b/libs/temporal/tempo.cc index 87e43b1950..afe6fcb9ca 100644 --- a/libs/temporal/tempo.cc +++ b/libs/temporal/tempo.cc @@ -817,7 +817,7 @@ TempoMap::change_tempo (TempoPoint & p, Tempo const & t) void TempoMap::replace_tempo (TempoPoint const & old, Tempo const & t, timepos_t const & time) { - remove_tempo (old); + remove_tempo (old, false); set_tempo (t, time); } @@ -983,7 +983,7 @@ TempoMap::add_tempo (TempoPoint * tp) } void -TempoMap::remove_tempo (TempoPoint const & tp) +TempoMap::remove_tempo (TempoPoint const & tp, bool with_reset) { if (_tempos.size() < 2) { return; @@ -1040,7 +1040,9 @@ TempoMap::remove_tempo (TempoPoint const & tp) if (prev != _tempos.end() && was_end) { prev->set_end_npm (prev->note_types_per_minute()); /* remove any ramp */ } else { - reset_starting_at (sc); + if (with_reset) { + reset_starting_at (sc); + } } } @@ -1077,7 +1079,7 @@ TempoMap::add_or_replace_bartime (MusicTimePoint* mtp) } void -TempoMap::remove_bartime (MusicTimePoint const & tp) +TempoMap::remove_bartime (MusicTimePoint const & tp, bool with_reset) { superclock_t sc (tp.sclock()); MusicTimes::iterator m; @@ -1106,7 +1108,9 @@ TempoMap::remove_bartime (MusicTimePoint const & tp) _bartimes.erase (m); remove_point (*m); - reset_starting_at (sc); + if (with_reset) { + reset_starting_at (sc); + } } void @@ -1616,7 +1620,7 @@ TempoMap::set_meter (Meter const & t, BBT_Time const & bbt) } void -TempoMap::remove_meter (MeterPoint const & mp) +TempoMap::remove_meter (MeterPoint const & mp, bool with_reset) { if (_meters.size() < 2) { return; @@ -1654,7 +1658,9 @@ TempoMap::remove_meter (MeterPoint const & mp) _meters.erase (m); remove_point (*m); - reset_starting_at (sc); + if (with_reset) { + reset_starting_at (sc); + } } Temporal::BBT_Time diff --git a/libs/temporal/temporal/tempo.h b/libs/temporal/temporal/tempo.h index aacc2449c6..1aad36079f 100644 --- a/libs/temporal/temporal/tempo.h +++ b/libs/temporal/temporal/tempo.h @@ -734,7 +734,7 @@ class /*LIBTEMPORAL_API*/ TempoMap : public PBD::StatefulDestructible LIBTEMPORAL_API void change_tempo (TempoPoint&, Tempo const&); LIBTEMPORAL_API void set_bartime (BBT_Time const &, timepos_t const &, std::string name = std::string()); - LIBTEMPORAL_API void remove_bartime (MusicTimePoint const & tp); + LIBTEMPORAL_API void remove_bartime (MusicTimePoint const & tp, bool with_reset = true); LIBTEMPORAL_API TempoPoint& set_tempo (Tempo const &, BBT_Time const &); LIBTEMPORAL_API TempoPoint& set_tempo (Tempo const &, timepos_t const &); @@ -744,8 +744,8 @@ class /*LIBTEMPORAL_API*/ TempoMap : public PBD::StatefulDestructible LIBTEMPORAL_API MeterPoint& set_meter (Meter const &, BBT_Time const &); LIBTEMPORAL_API MeterPoint& set_meter (Meter const &, timepos_t const &); - LIBTEMPORAL_API void remove_tempo (TempoPoint const &); - LIBTEMPORAL_API void remove_meter (MeterPoint const &); + LIBTEMPORAL_API void remove_tempo (TempoPoint const &, bool with_reset = true); + LIBTEMPORAL_API void remove_meter (MeterPoint const &, bool with_reset = true); /* these are a convenience method that just wrap some odd semantics */ LIBTEMPORAL_API bool move_tempo (TempoPoint const & point, timepos_t const & destination, bool push = false);