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.
This commit is contained in:
Robin Gareus 2017-01-20 21:46:47 +01:00
parent b25cd7683b
commit b588be2dea
2 changed files with 19 additions and 11 deletions

View File

@ -655,7 +655,7 @@ class LIBARDOUR_API Session : public PBD::StatefulDestructible, public PBD::Scop
);
std::list<boost::shared_ptr<MidiTrack> > new_midi_track (
const ChanCount& input, const ChanCount& output,
const ChanCount& input, const ChanCount& output, bool strict_io,
boost::shared_ptr<PluginInfo> 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<PluginInfo> 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<PluginInfo> instrument, Plugin::PresetRecord*, PresentationInfo::Flag, PresentationInfo::order_t);
void remove_routes (boost::shared_ptr<RouteList>);
void remove_route (boost::shared_ptr<Route>);

View File

@ -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<boost::shared_ptr<MidiTrack> >
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<PluginInfo> 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<Processor> p (new PluginInsert (*this, plugin));
(*r)->add_processor (p, PreFader);
boost::shared_ptr<PluginInsert> 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<PluginInfo> instrument, Plugin::PresetRecord* pset,
Session::new_midi_route (RouteGroup* route_group, uint32_t how_many, string name_template, bool strict_io,
boost::shared_ptr<PluginInfo> 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<Processor> p (new PluginInsert (*this, plugin));
(*r)->add_processor (p, PreFader);
boost::shared_ptr<PluginInsert> pi (new PluginInsert (*this, plugin));
if (strict_io) {
pi->set_strict_io (true);
}
(*r)->add_processor (pi, PreFader);
}
}
}