From b588be2deada445b60f3f74a240835f74773e0ea Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Fri, 20 Jan 2017 21:46:47 +0100 Subject: [PATCH] Instrument channel option when adding track By setting strict-io on the Instrument plugin early during track creation, adding the plugin will trigger a PluginSetup Dialog for multi-out instruments in a strict i/o track. --- libs/ardour/ardour/session.h | 4 ++-- libs/ardour/session.cc | 26 +++++++++++++++++--------- 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/libs/ardour/ardour/session.h b/libs/ardour/ardour/session.h index 562b8a94c2..aad16aa44c 100644 --- a/libs/ardour/ardour/session.h +++ b/libs/ardour/ardour/session.h @@ -655,7 +655,7 @@ class LIBARDOUR_API Session : public PBD::StatefulDestructible, public PBD::Scop ); std::list > new_midi_track ( - const ChanCount& input, const ChanCount& output, + const ChanCount& input, const ChanCount& output, bool strict_io, boost::shared_ptr instrument, Plugin::PresetRecord* pset, RouteGroup* route_group, uint32_t how_many, std::string name_template, @@ -664,7 +664,7 @@ class LIBARDOUR_API Session : public PBD::StatefulDestructible, public PBD::Scop ); RouteList new_audio_route (int input_channels, int output_channels, RouteGroup* route_group, uint32_t how_many, std::string name_template, PresentationInfo::Flag, PresentationInfo::order_t); - RouteList new_midi_route (RouteGroup* route_group, uint32_t how_many, std::string name_template, boost::shared_ptr instrument, Plugin::PresetRecord*, PresentationInfo::Flag, PresentationInfo::order_t); + RouteList new_midi_route (RouteGroup* route_group, uint32_t how_many, std::string name_template, bool strict_io, boost::shared_ptr instrument, Plugin::PresetRecord*, PresentationInfo::Flag, PresentationInfo::order_t); void remove_routes (boost::shared_ptr); void remove_route (boost::shared_ptr); diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc index b17b859490..256100aab4 100644 --- a/libs/ardour/session.cc +++ b/libs/ardour/session.cc @@ -2474,9 +2474,10 @@ Session::default_track_name_pattern (DataType t) * @param instrument plugin info for the instrument to insert pre-fader, if any */ list > -Session::new_midi_track (const ChanCount& input, const ChanCount& output, +Session::new_midi_track (const ChanCount& input, const ChanCount& output, bool strict_io, boost::shared_ptr instrument, Plugin::PresetRecord* pset, - RouteGroup* route_group, uint32_t how_many, string name_template, PresentationInfo::order_t order, + RouteGroup* route_group, uint32_t how_many, + string name_template, PresentationInfo::order_t order, TrackMode mode) { string track_name; @@ -2503,7 +2504,7 @@ Session::new_midi_track (const ChanCount& input, const ChanCount& output, goto failed; } - if (Profile->get_mixbus ()) { + if (strict_io) { track->set_strict_io (true); } @@ -2569,8 +2570,11 @@ Session::new_midi_track (const ChanCount& input, const ChanCount& output, if (pset) { plugin->load_preset (*pset); } - boost::shared_ptr p (new PluginInsert (*this, plugin)); - (*r)->add_processor (p, PreFader); + boost::shared_ptr pi (new PluginInsert (*this, plugin)); + if (strict_io) { + pi->set_strict_io (true); + } + (*r)->add_processor (pi, PreFader); } } } @@ -2579,7 +2583,8 @@ Session::new_midi_track (const ChanCount& input, const ChanCount& output, } RouteList -Session::new_midi_route (RouteGroup* route_group, uint32_t how_many, string name_template, boost::shared_ptr instrument, Plugin::PresetRecord* pset, +Session::new_midi_route (RouteGroup* route_group, uint32_t how_many, string name_template, bool strict_io, + boost::shared_ptr instrument, Plugin::PresetRecord* pset, PresentationInfo::Flag flag, PresentationInfo::order_t order) { string bus_name; @@ -2602,7 +2607,7 @@ Session::new_midi_route (RouteGroup* route_group, uint32_t how_many, string name goto failure; } - if (Profile->get_mixbus ()) { + if (strict_io) { bus->set_strict_io (true); } @@ -2660,8 +2665,11 @@ Session::new_midi_route (RouteGroup* route_group, uint32_t how_many, string name if (pset) { plugin->load_preset (*pset); } - boost::shared_ptr p (new PluginInsert (*this, plugin)); - (*r)->add_processor (p, PreFader); + boost::shared_ptr pi (new PluginInsert (*this, plugin)); + if (strict_io) { + pi->set_strict_io (true); + } + (*r)->add_processor (pi, PreFader); } } } -- 2.30.2