From e2baff4f7d00c97dc4192c5ac573aeee8950b2ae Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Mon, 8 Feb 2010 19:39:17 +0000 Subject: new RegionCommand object; remove unused string argument from Region::thaw(); add map 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 --- libs/ardour/session_command.cc | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'libs/ardour/session_command.cc') 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(*regions[id], before, after); } + } else if (obj_T == typeid (AudioSource).name() || obj_T == typeid (MidiSource).name()) { if (sources.count(id)) return new MementoCommand(*sources[id], before, after); + } else if (obj_T == typeid (Location).name()) { Location* loc = _locations.get_location_by_id(id); if (loc) { return new MementoCommand(*loc, before, after); } + } else if (obj_T == typeid (Locations).name()) { return new MementoCommand(_locations, before, after); + } else if (obj_T == typeid (TempoMap).name()) { return new MementoCommand(*_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 pl = playlists->by_name(child->property("name")->value())) { return new MementoCommand(*(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 r = route_by_id(id)) { return new MementoCommand(*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::iterator i = automation_lists.find(id); if (i != automation_lists.end()) { -- cgit v1.2.3