summaryrefslogtreecommitdiff
path: root/libs/ardour/session_command.cc
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2011-09-21 15:54:19 +0000
committerCarl Hetherington <carl@carlh.net>2011-09-21 15:54:19 +0000
commit185b58f259d558651bc33b0b560c27fa613f4b3b (patch)
treeacc62312a83f941db7c5f9a584f9d564a9d9d432 /libs/ardour/session_command.cc
parent2e59536dd8f5d65c26fa19fc643831418efca876 (diff)
Use a MementoCommandBinder for Crossfades so that the undo record can contain details for crossfades that are subsequently deleted (#4325).
git-svn-id: svn://localhost/ardour2/branches/3.0@10104 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/session_command.cc')
-rw-r--r--libs/ardour/session_command.cc14
1 files changed, 10 insertions, 4 deletions
diff --git a/libs/ardour/session_command.cc b/libs/ardour/session_command.cc
index c240a4aa94..e5ddd0a097 100644
--- a/libs/ardour/session_command.cc
+++ b/libs/ardour/session_command.cc
@@ -34,6 +34,7 @@
#include "ardour/session_playlists.h"
#include "ardour/region_factory.h"
#include "ardour/midi_automation_list_binder.h"
+#include "ardour/crossfade_binder.h"
#include "ardour/crossfade.h"
#include "pbd/error.h"
#include "pbd/id.h"
@@ -143,11 +144,16 @@ Session::memento_command_factory(XMLNode *n)
cerr << "Alist " << id << " not found\n";
} else if (obj_T == "ARDOUR::Crossfade") {
- boost::shared_ptr<Crossfade> c = playlists->find_crossfade (id);
- if (c) {
- return new MementoCommand<Crossfade> (*c.get(), before, after);
+ if (have_id) {
+ boost::shared_ptr<Crossfade> c = playlists->find_crossfade (id);
+ if (c) {
+ return new MementoCommand<Crossfade> (*c.get(), before, after);
+ }
} else {
- error << string_compose (X_("Crossfade %1 not found in session"), id) << endmsg;
+ return new MementoCommand<Crossfade> (
+ new CrossfadeBinder (n, playlists),
+ before, after
+ );
}
} else if (registry.count(id)) { // For Editor and AutomationLine which are off-limits herea