From 1aca200a6ac28599e68fd86cb5cc62a60f867af3 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Thu, 15 Oct 2009 19:36:48 +0000 Subject: [PATCH] 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 --- libs/ardour/region_factory.cc | 2 +- libs/ardour/session.cc | 16 ++++++++++++---- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/libs/ardour/region_factory.cc b/libs/ardour/region_factory.cc index 6ff4ae2dc1..8b2d30d511 100644 --- a/libs/ardour/region_factory.cc +++ b/libs/ardour/region_factory.cc @@ -133,9 +133,9 @@ boost::shared_ptr RegionFactory::create (Session& session, XMLNode& node, bool yn) { boost::shared_ptr r = session.XMLRegionFactory (node, yn); - r->unlock_property_changes (); if (r) { + r->unlock_property_changes (); CheckNewRegion (r); } diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc index d8c5639902..641155869d 100644 --- a/libs/ardour/session.cc +++ b/libs/ardour/session.cc @@ -550,17 +550,25 @@ 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) { - - _clicking = Config->get_clicking (); - + 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 { + error << _("could not setup Click I/O") << endmsg; _clicking = false; } + } else { /* default state for Click: dual-mono to first 2 physical outputs */