summaryrefslogtreecommitdiff
path: root/gtk2_ardour
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2011-12-27 18:33:49 +0000
committerCarl Hetherington <carl@carlh.net>2011-12-27 18:33:49 +0000
commit2db69318cef5bc7b49a3c6e00b3ca3f0f2023374 (patch)
tree1b23d3fe9cca5fea9e5599a8d63ae77ebdc05c2f /gtk2_ardour
parent8f462004494e9d2eb8f716984770515d802a659f (diff)
Fix up confusion with relayering after movement drags in
overlaid mode. git-svn-id: svn://localhost/ardour2/branches/3.0@11092 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour')
-rw-r--r--gtk2_ardour/editor_drag.cc28
1 files changed, 17 insertions, 11 deletions
diff --git a/gtk2_ardour/editor_drag.cc b/gtk2_ardour/editor_drag.cc
index 06f602d5a0..bb59a4ad24 100644
--- a/gtk2_ardour/editor_drag.cc
+++ b/gtk2_ardour/editor_drag.cc
@@ -961,9 +961,9 @@ RegionMoveDrag::finished_no_copy (
RegionSelection new_views;
PlaylistSet modified_playlists;
PlaylistSet frozen_playlists;
- PlaylistSet relayer_suspended_playlists;
- list<pair<boost::shared_ptr<Region>, double> > pending_relayers;
+ list<pair<boost::shared_ptr<Region>, double> > pending_explicit_relayers;
+ Playlist::RegionList pending_implicit_relayers;
if (_brushing) {
/* all changes were made during motion event handlers */
@@ -1045,7 +1045,9 @@ RegionMoveDrag::finished_no_copy (
bool const explicit_relayer = dest_rtv->view()->layer_display() == Stacked || dest_rtv->view()->layer_display() == Expanded;
if (explicit_relayer) {
- pending_relayers.push_back (make_pair (rv->region (), dest_layer));
+ pending_explicit_relayers.push_back (make_pair (rv->region (), dest_layer));
+ } else {
+ pending_implicit_relayers.push_back (rv->region ());
}
/* freeze playlist to avoid lots of relayering in the case of a multi-region drag */
@@ -1054,6 +1056,7 @@ RegionMoveDrag::finished_no_copy (
if (r.second) {
playlist->freeze ();
+ playlist->suspend_relayer ();
}
/* this movement may result in a crossfade being modified, so we need to get undo
@@ -1065,9 +1068,6 @@ RegionMoveDrag::finished_no_copy (
playlist->clear_changes ();
}
- relayer_suspended_playlists.insert (playlist);
- playlist->suspend_relayer ();
-
rv->region()->set_position (where);
_editor->session()->add_command (new StatefulDiffCommand (rv->region()));
@@ -1112,18 +1112,24 @@ RegionMoveDrag::finished_no_copy (
_editor->selection->set (new_views);
}
+ /* We can't use the normal mechanism for relayering, as some regions may require an explicit relayer
+ rather than an implicit one. So we thaw before resuming relayering, then do the relayers
+ that we require.
+ */
+
for (PlaylistSet::iterator p = frozen_playlists.begin(); p != frozen_playlists.end(); ++p) {
(*p)->thaw();
- }
-
- for (PlaylistSet::iterator p = relayer_suspended_playlists.begin(); p != relayer_suspended_playlists.end(); ++p) {
(*p)->resume_relayer ();
}
-
- for (list<pair<boost::shared_ptr<Region>, double> >::iterator i = pending_relayers.begin(); i != pending_relayers.end(); ++i) {
+
+ for (list<pair<boost::shared_ptr<Region>, double> >::iterator i = pending_explicit_relayers.begin(); i != pending_explicit_relayers.end(); ++i) {
i->first->playlist()->relayer (i->first, i->second);
}
+ for (Playlist::RegionList::iterator i = pending_implicit_relayers.begin(); i != pending_implicit_relayers.end(); ++i) {
+ (*i)->playlist()->relayer (*i);
+ }
+
/* write commands for the accumulated diffs for all our modified playlists */
add_stateful_diff_commands_for_playlists (modified_playlists);