mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-06 06:44:57 +01:00
Implement playlist switch undo/redo
This commit is contained in:
parent
3a60de5d54
commit
6ac0aae35f
2 changed files with 52 additions and 14 deletions
|
|
@ -397,9 +397,11 @@ PlaylistSelector::selection_changed ()
|
|||
return;
|
||||
}
|
||||
|
||||
XMLNode* before = &_rui->track ()->playlist_state ();
|
||||
switch (_mode) {
|
||||
/* @Robin: I dont see a way to undo these playlist actions
|
||||
* @Ben: me neither :)
|
||||
* @Robin: Now I do.
|
||||
*/
|
||||
case plCopy:
|
||||
{
|
||||
|
|
@ -426,6 +428,15 @@ PlaylistSelector::selection_changed ()
|
|||
}
|
||||
break;
|
||||
}
|
||||
|
||||
XMLNode* after = &_rui->track ()->playlist_state ();
|
||||
if (*before != *after) {
|
||||
_session->begin_reversible_command (string_compose (_("Switch Playlist for track %1"), _rui->track ()->name ()));
|
||||
_session->commit_reversible_command (new MementoCommand<Track>(*_rui->track (), before, after));
|
||||
} else {
|
||||
delete before;
|
||||
delete after;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue