mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-16 19:56:31 +01:00
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.
This commit is contained in:
parent
1d8c7ef37a
commit
6ec133ebde
4 changed files with 39 additions and 23 deletions
|
|
@ -866,6 +866,7 @@ class LIBARDOUR_API Session : public PBD::StatefulDestructible, public PBD::Scop
|
||||||
PBD::Signal0<void> session_routes_reconnected;
|
PBD::Signal0<void> session_routes_reconnected;
|
||||||
|
|
||||||
/* monitor/master out */
|
/* monitor/master out */
|
||||||
|
int add_master_bus (ChanCount const&);
|
||||||
|
|
||||||
void add_monitor_section ();
|
void add_monitor_section ();
|
||||||
void reset_monitor_section ();
|
void reset_monitor_section ();
|
||||||
|
|
|
||||||
|
|
@ -1970,6 +1970,11 @@ LuaBindings::common (lua_State* L)
|
||||||
.addFunction ("new_audio_route", &Session::new_audio_route)
|
.addFunction ("new_audio_route", &Session::new_audio_route)
|
||||||
.addFunction ("new_midi_track", &Session::new_midi_track)
|
.addFunction ("new_midi_track", &Session::new_midi_track)
|
||||||
.addFunction ("new_midi_route", &Session::new_midi_route)
|
.addFunction ("new_midi_route", &Session::new_midi_route)
|
||||||
|
|
||||||
|
.addFunction ("add_master_bus", &Session::add_master_bus)
|
||||||
|
.addFunction ("add_monitor_section", &Session::add_monitor_section)
|
||||||
|
.addFunction ("remove_monitor_section", &Session::remove_monitor_section)
|
||||||
|
|
||||||
.addFunction ("get_routes", &Session::get_routes)
|
.addFunction ("get_routes", &Session::get_routes)
|
||||||
.addFunction ("get_tracks", &Session::get_tracks)
|
.addFunction ("get_tracks", &Session::get_tracks)
|
||||||
.addFunction ("get_stripables", (StripableList (Session::*)() const)&Session::get_stripables)
|
.addFunction ("get_stripables", (StripableList (Session::*)() const)&Session::get_stripables)
|
||||||
|
|
|
||||||
|
|
@ -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
|
void
|
||||||
Session::hookup_io ()
|
Session::hookup_io ()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -659,33 +659,16 @@ Session::create (const string& session_template, BusProfile* bus_profile)
|
||||||
if (bus_profile) {
|
if (bus_profile) {
|
||||||
RouteList rl;
|
RouteList rl;
|
||||||
ChanCount count(DataType::AUDIO, bus_profile->master_out_channels);
|
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 (rv) {
|
||||||
if (ARDOUR::Profile->get_trx() || bus_profile->master_out_channels) {
|
return rv;
|
||||||
boost::shared_ptr<Route> r (new Route (*this, _("Master"), PresentationInfo::MasterOut, DataType::AUDIO));
|
|
||||||
if (r->init ()) {
|
|
||||||
return -1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOST_MARK_ROUTE(r);
|
if (Config->get_use_monitor_bus())
|
||||||
|
add_monitor_section ();
|
||||||
{
|
|
||||||
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 (!rl.empty()) {
|
|
||||||
add_routes (rl, false, false, false, PresentationInfo::max_order);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Config->get_use_monitor_bus() && bus_profile) {
|
|
||||||
add_monitor_section ();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue