diff options
-rw-r--r-- | libs/ardour/ardour/playlist.h | 1 | ||||
-rw-r--r-- | libs/ardour/disk_reader.cc | 14 | ||||
-rw-r--r-- | libs/ardour/playlist.cc | 5 |
3 files changed, 14 insertions, 6 deletions
diff --git a/libs/ardour/ardour/playlist.h b/libs/ardour/ardour/playlist.h index 22e8e67552..0c5439f54c 100644 --- a/libs/ardour/ardour/playlist.h +++ b/libs/ardour/ardour/playlist.h @@ -421,6 +421,7 @@ private: boost::shared_ptr<RegionList> find_regions_at (samplepos_t); samplepos_t _end_space; //this is used when we are pasting a range with extra space at the end + bool _playlist_shift_active; }; } /* namespace ARDOUR */ diff --git a/libs/ardour/disk_reader.cc b/libs/ardour/disk_reader.cc index ed3e612cf2..41b0dd2dea 100644 --- a/libs/ardour/disk_reader.cc +++ b/libs/ardour/disk_reader.cc @@ -1127,14 +1127,18 @@ DiskReader::refill_audio (Sample* mixdown_buffer, float* gain_buffer, samplecnt_ } void -DiskReader::playlist_ranges_moved (list< Evoral::RangeMove<samplepos_t> > const & movements_samples, bool from_undo) +DiskReader::playlist_ranges_moved (list< Evoral::RangeMove<samplepos_t> > const & movements_samples, bool from_undo_or_shift) { /* If we're coming from an undo, it will have handled - automation undo (it must, since automation-follows-regions - can lose automation data). Hence we can do nothing here. - */ + * automation undo (it must, since automation-follows-regions + * can lose automation data). Hence we can do nothing here. + * + * Likewise when shifting regions (insert/remove time) + * automation is taken care of separately (busses with + * automation have no disk-reader). + */ - if (from_undo) { + if (from_undo_or_shift) { return; } 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; |