From 6ec133ebde064dc528d8e448cbce40f0d401a7d1 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Tue, 15 Aug 2017 23:17:08 +0200 Subject: Separate "add master bus" (and add Lua bindings) This is in preparation for "advanced session setup" allow a SessionSetup Lua script to create the master-bus. --- libs/ardour/session_state.cc | 29 ++++++----------------------- 1 file changed, 6 insertions(+), 23 deletions(-) (limited to 'libs/ardour/session_state.cc') diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc index b0b8a46a4b..051eca4b68 100644 --- a/libs/ardour/session_state.cc +++ b/libs/ardour/session_state.cc @@ -659,33 +659,16 @@ Session::create (const string& session_template, BusProfile* bus_profile) if (bus_profile) { RouteList rl; ChanCount count(DataType::AUDIO, bus_profile->master_out_channels); + if (bus_profile->master_out_channels) { + int rv = add_master_bus (count); - // Waves Tracks: always create master bus for Tracks - if (ARDOUR::Profile->get_trx() || bus_profile->master_out_channels) { - boost::shared_ptr r (new Route (*this, _("Master"), PresentationInfo::MasterOut, DataType::AUDIO)); - if (r->init ()) { - return -1; + if (rv) { + return rv; } - BOOST_MARK_ROUTE(r); - - { - Glib::Threads::Mutex::Lock lm (AudioEngine::instance()->process_lock ()); - r->input()->ensure_io (count, false, this); - r->output()->ensure_io (count, false, this); - } - - rl.push_back (r); - + if (Config->get_use_monitor_bus()) + add_monitor_section (); } - - if (!rl.empty()) { - add_routes (rl, false, false, false, PresentationInfo::max_order); - } - } - - if (Config->get_use_monitor_bus() && bus_profile) { - add_monitor_section (); } return 0; -- cgit v1.2.3