diff options
author | Robin Gareus <robin@gareus.org> | 2017-08-15 23:17:08 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2017-08-16 00:51:20 +0200 |
commit | 6ec133ebde064dc528d8e448cbce40f0d401a7d1 (patch) | |
tree | 5ba4717d1fc6ecc353a93cf9cfbf367bcaeed5e0 /libs/ardour/session.cc | |
parent | 1d8c7ef37a1f020d1448208cb6c3b9f667ee1602 (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.cc')
-rw-r--r-- | libs/ardour/session.cc | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc index 19ca9ceea9..37d987d547 100644 --- a/libs/ardour/session.cc +++ b/libs/ardour/session.cc @@ -1495,6 +1495,33 @@ Session::reset_monitor_section () } } +int +Session::add_master_bus (ChanCount const& count) +{ + if (master_out ()) { + return -1; + } + + RouteList rl; + + boost::shared_ptr<Route> r (new Route (*this, _("Master"), PresentationInfo::MasterOut, DataType::AUDIO)); + if (r->init ()) { + return -1; + } + + 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); + add_routes (rl, false, false, false, PresentationInfo::max_order); + return 0; +} + void Session::hookup_io () { |