class LIBARDOUR_API AUPluginInfo : public PluginInfo {
public:
AUPluginInfo (boost::shared_ptr<CAComponentDescription>);
- ~AUPluginInfo ();
+ ~AUPluginInfo () {}
PluginPtr load (Session& session);
AUPluginCachedInfo cache;
bool reconfigurable_io() const { return true; }
+ uint32_t max_configurable_ouputs () const { return max_outputs; }
static void clear_cache ();
static PluginInfoList* discover (bool scan_only);
private:
boost::shared_ptr<CAComponentDescription> descriptor;
UInt32 version;
+ uint32_t max_outputs;
static FILE * _crashlog_fd;
static bool _scan_only;
std::vector<Plugin::PresetRecord> get_presets (bool user_only) const;
bool reconfigurable_io() const { return true; }
+ uint32_t max_configurable_ouputs () const {
+ return _max_outputs;
+ }
+
+ private:
+ uint32_t _max_outputs;
};
typedef boost::shared_ptr<LuaPluginInfo> LuaPluginInfoPtr;
/* @return true if the plugin can change its inputs or outputs on demand. */
virtual bool reconfigurable_io () const { return false; }
+ /* max [re]configurable outputs (if finite, 0 otherwise) */
+ virtual uint32_t max_configurable_ouputs () const
+ {
+ return n_outputs.n_audio();
+ }
+
protected:
friend class PluginManager;
uint32_t index; //< used for LADSPA, index in module
AUPluginInfo::AUPluginInfo (boost::shared_ptr<CAComponentDescription> d)
: descriptor (d)
, version (0)
-{
- type = ARDOUR::AudioUnit;
-}
-
-AUPluginInfo::~AUPluginInfo ()
+ , max_outputs (0)
{
type = ARDOUR::AudioUnit;
}
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
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);
n_outputs.set (DataType::AUDIO, 1);
type = Lua;
+ // TODO, parse script, get 'dsp_ioconfig', see can_support_io_configuration()
+ _max_outputs = 0;
}
PluginPtr
* by listing number of audio outputs.
* This is used in the instrument selector.
*/
- bool r = p->n_outputs.n_audio() != (*i)->n_outputs.n_audio();
+ bool r = p->max_configurable_ouputs () != (*i)->max_configurable_ouputs ();
p->multichannel_name_ambiguity = r;
(*i)->multichannel_name_ambiguity = r;
}