add dedicated API to check plugin class

This commit is contained in:
Robin Gareus 2015-11-18 18:11:19 +01:00
parent acc36e0053
commit 9d867cfd87
3 changed files with 13 additions and 0 deletions

View File

@ -277,6 +277,7 @@ public:
static PluginInfoList* discover ();
PluginPtr load (Session& session);
virtual bool in_category (const std::string &c) const;
char * _plugin_uri;
};

View File

@ -68,6 +68,7 @@ class LIBARDOUR_API PluginInfo {
virtual PluginPtr load (Session& session) = 0;
virtual bool is_instrument() const;
virtual bool in_category (const std::string &) const { return false; }
/* NOTE: this block of virtual methods looks like the interface
to a Processor, but Plugin does not inherit from Processor.

View File

@ -2561,6 +2561,17 @@ LV2PluginInfo::load(Session& session)
return PluginPtr();
}
bool
LV2PluginInfo::in_category (const std::string &c) const
{
// TODO use untranslated lilv_plugin_get_class()
// match gtk2_ardour/plugin_selector.cc
if (category == c) {
return true;
}
return false;
}
PluginInfoList*
LV2PluginInfo::discover()
{