summaryrefslogtreecommitdiff
path: root/libs/ardour/session_state.cc
diff options
context:
space:
mode:
authorHans Baier <hansfbaier@googlemail.com>2008-04-09 15:33:01 +0000
committerHans Baier <hansfbaier@googlemail.com>2008-04-09 15:33:01 +0000
commit1a0044b35d2cca7e7316d6afbb8e4955b6d7a627 (patch)
tree43fe8bf5cfc170f6aa4a5ec2f821a909965f572e /libs/ardour/session_state.cc
parentf39606f985223d211d218799c9e0de1e7c0e7f0c (diff)
* implemented persistent undo for MidiModel::DeltaCommand. Deserializing works, but weirdly has no effect when undo/redo is applied in the editor
git-svn-id: svn://localhost/ardour2/branches/3.0@3240 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/session_state.cc')
-rw-r--r--libs/ardour/session_state.cc10
1 files changed, 9 insertions, 1 deletions
diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc
index 41261fdfbc..a2575caadd 100644
--- a/libs/ardour/session_state.cc
+++ b/libs/ardour/session_state.cc
@@ -2989,8 +2989,16 @@ Session::restore_history (string snapshot_name)
ut->add_command (c);
}
+ } else if (n->name() == "DeltaCommand") {
+ PBD::ID id(n->property("midi_source")->value());
+ boost::shared_ptr<MidiSource> midi_source =
+ boost::dynamic_pointer_cast<MidiSource, Source>(source_by_id(id));
+ if(midi_source) {
+ ut->add_command(new MidiModel::DeltaCommand(*(midi_source->model()), *n));
+ } else {
+ error << "FIXME: Failed to downcast MidiSource for DeltaCommand" << endmsg;
+ }
} else {
-
error << string_compose(_("Couldn't figure out how to make a Command out of a %1 XMLNode."), n->name()) << endmsg;
}
}