diff options
author | Robin Gareus <robin@gareus.org> | 2019-10-15 14:47:11 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2019-10-15 14:48:32 +0200 |
commit | bcd1391bf745f69f3689b9885f1b99dda9649587 (patch) | |
tree | 403ca0c4f319295366b26c01f955de34146fc455 /libs/ardour/audio_unit.cc | |
parent | cbb116026dad699b7e06a07918c82484c16fb2b6 (diff) |
API to count max multi-channel plugin outputs
Diffstat (limited to 'libs/ardour/audio_unit.cc')
-rw-r--r-- | libs/ardour/audio_unit.cc | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/libs/ardour/audio_unit.cc b/libs/ardour/audio_unit.cc index cf268a0403..bf9ea888ab 100644 --- a/libs/ardour/audio_unit.cc +++ b/libs/ardour/audio_unit.cc @@ -2549,11 +2549,7 @@ AUPlugin::has_editor () const AUPluginInfo::AUPluginInfo (boost::shared_ptr<CAComponentDescription> d) : descriptor (d) , version (0) -{ - type = ARDOUR::AudioUnit; -} - -AUPluginInfo::~AUPluginInfo () + , max_outputs (0) { type = ARDOUR::AudioUnit; } @@ -2922,6 +2918,8 @@ AUPluginInfo::discover_by_description (PluginInfoList& plugs, CAComponentDescrip const int rv = cached_io_configuration (info->unique_id, info->version, cacomp, info->cache, info->name); + info.max_outputs = 0; + if (rv == 0) { /* here we have to map apple's wildcard system to a simple pair of values. in ::can_do() we use the whole system, but here @@ -2936,8 +2934,18 @@ AUPluginInfo::discover_by_description (PluginInfoList& plugs, CAComponentDescrip info to the user, which should perhaps be revisited. */ - int32_t possible_in = info->cache.io_configs.front().first; - int32_t possible_out = info->cache.io_configs.front().second; + const vector<pair<int,int> >& ioc (info->cache.io_configs); + for (vector<pair<int,int> >::const_iterator i = ioc.begin(); i != ioc.end(); ++i) { + int32_t possible_out = i->second; + if (possible_out < 0) { + continue; + } else if (possible_out > info.max_outputs) { + info.max_outputs = possible_out; + } + } + + int32_t possible_in = ioc.front().first; + int32_t possible_out = ioc.font().second; if (possible_in > 0) { info->n_inputs.set (DataType::AUDIO, possible_in); |