X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fardour%2Fplugin.cc;h=2d1ffbed7491a60f6791e2b885d337e63be829c0;hb=a5e8a69dec467cc7d938cc3d92acb218b04486a9;hp=e0ba0f00f7fabc31a9e2dcd8c7c20fd1b726ac68;hpb=30b087ab3d28f1585987fa3f6ae006562ae192e3;p=ardour.git diff --git a/libs/ardour/plugin.cc b/libs/ardour/plugin.cc index e0ba0f00f7..2d1ffbed74 100644 --- a/libs/ardour/plugin.cc +++ b/libs/ardour/plugin.cc @@ -87,12 +87,6 @@ PluginInfo::needs_midi_input () const return (n_inputs.n_midi() != 0); } -bool -PluginInfo::is_instrument () const -{ - return (n_inputs.n_midi() != 0) && (n_outputs.n_audio() > 0) && (n_inputs.n_audio() == 0); -} - Plugin::Plugin (AudioEngine& e, Session& s) : _engine (e) , _session (s) @@ -526,3 +520,33 @@ Plugin::parameter_label (uint32_t which) const get_parameter_descriptor (which, pd); return pd.label; } + +bool +PluginInfo::is_effect () const +{ + return (!is_instrument () && !is_utility () && !is_analyzer ()); +} + +bool +PluginInfo::is_instrument () const +{ + if (category == "Instrument") { + return true; + } + + // second check: if we have midi input and audio output, we're likely an instrument + return (n_inputs.n_midi() != 0) && (n_outputs.n_audio() > 0) && (n_inputs.n_audio() == 0); +} + +bool +PluginInfo::is_utility () const +{ + /* XXX beware of translations, e.g. LV2 categories */ + return (category == "Utility" || category == "MIDI" || category == "Generator"); +} + +bool +PluginInfo::is_analyzer () const +{ + return (category == "Analyser" || category == "Anaylsis" || category == "Analyzer"); +}