diff options
author | Robin Gareus <robin@gareus.org> | 2016-05-19 01:46:11 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2016-05-19 01:46:11 +0200 |
commit | f0fd7890a1bcdf9142816615d396e0e393016048 (patch) | |
tree | daad00b1b9a482c3c12b05b59ce9e23d248f0200 /libs/ardour/plugin_insert.cc | |
parent | 7e463bab6eb5a733c507c90cd4cb554b1ca1c34f (diff) |
move "needs output port selector" (from pin-dialog) to backend
Diffstat (limited to 'libs/ardour/plugin_insert.cc')
-rw-r--r-- | libs/ardour/plugin_insert.cc | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/libs/ardour/plugin_insert.cc b/libs/ardour/plugin_insert.cc index 79c4c5de61..f6f620e883 100644 --- a/libs/ardour/plugin_insert.cc +++ b/libs/ardour/plugin_insert.cc @@ -375,6 +375,35 @@ PluginInsert::needs_midi_input() const return pip->n_inputs.n_midi() != 0 && pip->n_outputs.n_audio() != 0; } +bool +PluginInsert::has_output_presets (ChanCount in, ChanCount out) +{ + if (!_configured && _plugins[0]->get_info ()->reconfigurable_io ()) { + // collect possible configurations, prefer given in/out + _plugins[0]->can_support_io_configuration (in, out); + } + + PluginOutputConfiguration ppc (_plugins[0]->possible_output ()); + + if (ppc.size () == 0) { + return false; + } + if (!strict_io () && ppc.size () == 1) { + return false; + } + + if (strict_io () && ppc.size () == 1) { + // "stereo" is currently preferred default for instruments + if (ppc.find (2) != ppc.end ()) { + return false; + } + } + if (!needs_midi_input ()) { + return false; + } + return true; +} + void PluginInsert::create_automatable_parameters () { |