diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2009-02-18 09:35:06 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2009-02-18 09:35:06 +0000 |
commit | 56033fe65854ce6360288269a84ec55820c6f548 (patch) | |
tree | 4d1799d4f954a0f1a742b7a65d5c22613962071a /libs | |
parent | 45302a85874693e6844a690bb4404994ddefc181 (diff) |
creating routes from templates now properly chooses between track & bus; fix up glitches with add route dialog not displaying the template selection widgets; must remember to re-indent this stuff
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@4620 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs')
-rw-r--r-- | libs/ardour/session.cc | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc index 72a0b16c14..94d02b4cc8 100644 --- a/libs/ardour/session.cc +++ b/libs/ardour/session.cc @@ -2070,14 +2070,24 @@ Session::new_route_from_template (uint32_t how_many, const std::string& template break; } - } while (number < (UINT_MAX-1)); + } while (number < UINT_MAX); + + if (number == UINT_MAX) { + fatal << _("Session: UINT_MAX routes? impossible!") << endmsg; + /*NOTREACHED*/ + } IO::set_name_in_state (node_copy, name); } try { - shared_ptr<Route> route (new Route (*this, node_copy, DataType::AUDIO)); + shared_ptr<Route> route (XMLRouteFactory (node_copy)); + if (route == 0) { + error << _("Session: cannot create track/bus from template description") << endmsg; + goto out; + } + route->set_remote_control_id (control_id); ++control_id; @@ -2086,18 +2096,18 @@ Session::new_route_from_template (uint32_t how_many, const std::string& template catch (failed_constructor &err) { error << _("Session: could not create new route from template") << endmsg; - goto failure; + goto out; } catch (AudioEngine::PortRegistrationFailure& pfe) { error << _("No more JACK ports are available. You will need to stop Ardour and restart JACK with ports if you need this many tracks.") << endmsg; - goto failure; + goto out; } --how_many; } - failure: + out: if (!ret.empty()) { add_routes (ret, true); } |