summaryrefslogtreecommitdiff
path: root/libs/ardour/session_command.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2010-02-08 19:39:17 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2010-02-08 19:39:17 +0000
commite2baff4f7d00c97dc4192c5ac573aeee8950b2ae (patch)
treed099f62d821f86980b062d2fc93aa6e8c9203ba2 /libs/ardour/session_command.cc
parent1afb1cfea4f2ea66962faef01d729014bdc9eb56 (diff)
new RegionCommand object; remove unused string argument from Region::thaw(); add map<ID,Region> in RegionFactory so that we can look up regions by ID
git-svn-id: svn://localhost/ardour2/branches/3.0@6652 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/session_command.cc')
-rw-r--r--libs/ardour/session_command.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/libs/ardour/session_command.cc b/libs/ardour/session_command.cc
index 828af69901..19253cc725 100644
--- a/libs/ardour/session_command.cc
+++ b/libs/ardour/session_command.cc
@@ -83,32 +83,40 @@ Session::memento_command_factory(XMLNode *n)
/* create command */
string obj_T = n->property ("type-name")->value();
+
if (obj_T == typeid (AudioRegion).name() || obj_T == typeid (MidiRegion).name() || obj_T == typeid (Region).name()) {
if (regions.count(id)) {
return new MementoCommand<Region>(*regions[id], before, after);
}
+
} else if (obj_T == typeid (AudioSource).name() || obj_T == typeid (MidiSource).name()) {
if (sources.count(id))
return new MementoCommand<Source>(*sources[id], before, after);
+
} else if (obj_T == typeid (Location).name()) {
Location* loc = _locations.get_location_by_id(id);
if (loc) {
return new MementoCommand<Location>(*loc, before, after);
}
+
} else if (obj_T == typeid (Locations).name()) {
return new MementoCommand<Locations>(_locations, before, after);
+
} else if (obj_T == typeid (TempoMap).name()) {
return new MementoCommand<TempoMap>(*_tempo_map, before, after);
+
} else if (obj_T == typeid (Playlist).name() || obj_T == typeid (AudioPlaylist).name() || obj_T == typeid (MidiPlaylist).name()) {
if (boost::shared_ptr<Playlist> pl = playlists->by_name(child->property("name")->value())) {
return new MementoCommand<Playlist>(*(pl.get()), before, after);
}
+
} else if (obj_T == typeid (Route).name() || obj_T == typeid (AudioTrack).name() || obj_T == typeid(MidiTrack).name()) {
if (boost::shared_ptr<Route> r = route_by_id(id)) {
return new MementoCommand<Route>(*r, before, after);
} else {
error << string_compose (X_("Route %1 not found in session"), id) << endmsg;
}
+
} else if (obj_T == typeid (Evoral::Curve).name() || obj_T == typeid (AutomationList).name()) {
std::map<PBD::ID, AutomationList*>::iterator i = automation_lists.find(id);
if (i != automation_lists.end()) {