mirror of
https://github.com/Ardour/ardour.git
synced 2026-01-08 14:45:43 +01:00
Fix undo of layer-changing region drags
Move clear_changes() of the playlist on which a region has been dragged before calling set_layer() on that playlist, so that undo of region drags in layered mode undoes any layer changes too. Should fix #5904
This commit is contained in:
parent
83a6d2a4dc
commit
fca8443d4b
1 changed files with 12 additions and 13 deletions
|
|
@ -1077,6 +1077,17 @@ RegionMoveDrag::finished_no_copy (
|
|||
|
||||
} else {
|
||||
|
||||
boost::shared_ptr<Playlist> playlist = dest_rtv->playlist();
|
||||
|
||||
/* this movement may result in a crossfade being modified, or a layering change,
|
||||
so we need to get undo data from the playlist as well as the region.
|
||||
*/
|
||||
|
||||
pair<PlaylistSet::iterator, bool> r = modified_playlists.insert (playlist);
|
||||
if (r.second) {
|
||||
playlist->clear_changes ();
|
||||
}
|
||||
|
||||
rv->region()->clear_changes ();
|
||||
|
||||
/*
|
||||
|
|
@ -1090,30 +1101,18 @@ RegionMoveDrag::finished_no_copy (
|
|||
rv->drag_end ();
|
||||
|
||||
/* just change the model */
|
||||
|
||||
boost::shared_ptr<Playlist> playlist = dest_rtv->playlist();
|
||||
|
||||
if (dest_rtv->view()->layer_display() == Stacked || dest_rtv->view()->layer_display() == Expanded) {
|
||||
playlist->set_layer (rv->region(), dest_layer);
|
||||
}
|
||||
|
||||
/* freeze playlist to avoid lots of relayering in the case of a multi-region drag */
|
||||
|
||||
pair<PlaylistSet::iterator, bool> r = frozen_playlists.insert (playlist);
|
||||
r = frozen_playlists.insert (playlist);
|
||||
|
||||
if (r.second) {
|
||||
playlist->freeze ();
|
||||
}
|
||||
|
||||
/* this movement may result in a crossfade being modified, so we need to get undo
|
||||
data from the playlist as well as the region.
|
||||
*/
|
||||
|
||||
r = modified_playlists.insert (playlist);
|
||||
if (r.second) {
|
||||
playlist->clear_changes ();
|
||||
}
|
||||
|
||||
rv->region()->set_position (where);
|
||||
|
||||
_editor->session()->add_command (new StatefulDiffCommand (rv->region()));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue