summaryrefslogtreecommitdiff
path: root/libs/ardour/playlist.cc
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2018-12-21 17:15:38 +0100
committerRobin Gareus <robin@gareus.org>2018-12-21 17:33:59 +0100
commitdf666326f70e7a167e06f7fd4de3a518a28f2445 (patch)
treef23f73d57dba11ce5af87df01ff9c257e2ceb9de /libs/ardour/playlist.cc
parent19a2d384fc11348aaa17a0e398bf05750d9f8edd (diff)
Fix insert/remove time duplicate automation move -- #7712
Editor::insert_time(), Editor::remove_time() handle automation directly because time may be inserted to Routes without playlists and combined undo-operation with marker, and tempo-changes. However when the preference "automation_follows_regions" is enabled, the playlist already moves the automation of region under any region (possibly overriding future automation). This resulted in possibly lossy, duplicate automation moves.
Diffstat (limited to 'libs/ardour/playlist.cc')
-rw-r--r--libs/ardour/playlist.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/libs/ardour/playlist.cc b/libs/ardour/playlist.cc
index 6a5332c344..3dce9123a9 100644
--- a/libs/ardour/playlist.cc
+++ b/libs/ardour/playlist.cc
@@ -25,6 +25,7 @@
#include "pbd/types_convert.h"
#include "pbd/stateful_diff_command.h"
#include "pbd/strsplit.h"
+#include "pbd/unwind.h"
#include "pbd/xml++.h"
#include "ardour/debug.h"
@@ -322,6 +323,7 @@ Playlist::init (bool hide)
_capture_insertion_underway = false;
_combine_ops = 0;
_end_space = 0;
+ _playlist_shift_active = false;
_session.history().BeginUndoRedo.connect_same_thread (*this, boost::bind (&Playlist::begin_undo, this));
_session.history().EndUndoRedo.connect_same_thread (*this, boost::bind (&Playlist::end_undo, this));
@@ -633,7 +635,7 @@ Playlist::flush_notifications (bool from_undo)
/* We don't need to check crossfades for these as pending_bounds has
already covered it.
*/
- RangesMoved (pending_range_moves, from_undo);
+ RangesMoved (pending_range_moves, from_undo || _playlist_shift_active);
}
if (!pending_region_extensions.empty ()) {
@@ -1396,6 +1398,7 @@ Playlist::duplicate_ranges (std::list<AudioRange>& ranges, float times)
void
Playlist::shift (samplepos_t at, sampleoffset_t distance, bool move_intersected, bool ignore_music_glue)
{
+ PBD::Unwinder<bool> uw (_playlist_shift_active, true);
RegionWriteLock rlock (this);
RegionList copy (regions.rlist());
RegionList fixup;