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.cc | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'libs/ardour/session.cc') 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 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 () { -- cgit v1.2.3