summaryrefslogtreecommitdiff
path: root/libs/ardour/session_state.cc
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2017-08-15 23:17:08 +0200
committerRobin Gareus <robin@gareus.org>2017-08-16 00:51:20 +0200
commit6ec133ebde064dc528d8e448cbce40f0d401a7d1 (patch)
tree5ba4717d1fc6ecc353a93cf9cfbf367bcaeed5e0 /libs/ardour/session_state.cc
parent1d8c7ef37a1f020d1448208cb6c3b9f667ee1602 (diff)
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.
Diffstat (limited to 'libs/ardour/session_state.cc')
-rw-r--r--libs/ardour/session_state.cc29
1 files changed, 6 insertions, 23 deletions
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<Route> 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;