more set_state() tweaks to get a 2.X session to load without aborting

git-svn-id: svn://localhost/ardour2/branches/3.0@5788 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis 2009-10-15 19:36:48 +00:00
parent 8713667ec1
commit 1aca200a6a
2 changed files with 13 additions and 5 deletions

View file

@ -133,9 +133,9 @@ boost::shared_ptr<Region>
RegionFactory::create (Session& session, XMLNode& node, bool yn)
{
boost::shared_ptr<Region> r = session.XMLRegionFactory (node, yn);
r->unlock_property_changes ();
if (r) {
r->unlock_property_changes ();
CheckNewRegion (r);
}

View file

@ -550,9 +550,16 @@ Session::when_engine_running ()
if (state_tree && (child = find_named_node (*state_tree->root(), "Click")) != 0) {
/* existing state for Click */
int c;
if (_click_io->set_state (*child->children().front(), Stateful::loading_state_version) == 0) {
if (Stateful::loading_state_version < 3000) {
c = _click_io->set_state_2X (*child->children().front(), Stateful::loading_state_version, false);
} else {
c = _click_io->set_state (*child->children().front(), Stateful::loading_state_version);
}
if (c == 0) {
_clicking = Config->get_clicking ();
} else {
@ -561,6 +568,7 @@ Session::when_engine_running ()
_clicking = false;
}
} else {
/* default state for Click: dual-mono to first 2 physical outputs */