summaryrefslogtreecommitdiff
path: root/libs/ardour/plugin_manager.cc
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2018-11-07 23:37:10 +0100
committerRobin Gareus <robin@gareus.org>2018-11-07 23:37:10 +0100
commit41abf75077921766f25aae45c87aca927244e520 (patch)
treeaa16ca6d967b706e5c03479d25bc70910cc9b138 /libs/ardour/plugin_manager.cc
parentbc83e6f75334e3493d70635ff1060a1798430456 (diff)
Consolidate VST Plugin Info
This unifies common PluginManager VST code to construct *VSTPluginInfo and also provides a dedicated is_instrument() method for VST plugins.
Diffstat (limited to 'libs/ardour/plugin_manager.cc')
-rw-r--r--libs/ardour/plugin_manager.cc67
1 files changed, 5 insertions, 62 deletions
diff --git a/libs/ardour/plugin_manager.cc b/libs/ardour/plugin_manager.cc
index aa151aa975..06a7e0ee77 100644
--- a/libs/ardour/plugin_manager.cc
+++ b/libs/ardour/plugin_manager.cc
@@ -993,7 +993,6 @@ PluginManager::windows_vst_discover (string path, bool cache_only)
uint32_t discovered = 0;
for (vector<VSTInfo *>::iterator x = finfos->begin(); x != finfos->end(); ++x) {
VSTInfo* finfo = *x;
- char buf[32];
if (!finfo->canProcessReplacing) {
warning << string_compose (_("VST plugin %1 does not support processReplacing, and cannot be used in %2 at this time"),
@@ -1002,33 +1001,14 @@ PluginManager::windows_vst_discover (string path, bool cache_only)
continue;
}
- PluginInfoPtr info (new WindowsVSTPluginInfo);
+ PluginInfoPtr info (new WindowsVSTPluginInfo (finfo));
+ info->path = path;
/* what a joke freeware VST is */
-
if (!strcasecmp ("The Unnamed plugin", finfo->name)) {
info->name = PBD::basename_nosuffix (path);
- } else {
- info->name = finfo->name;
}
-
- snprintf (buf, sizeof (buf), "%d", finfo->UniqueID);
- info->unique_id = buf;
- if (finfo->isInstrument) {
- info->category = X_("Instrument");
- } else {
- info->category = finfo->Category;
- }
- info->path = path;
- info->creator = finfo->creator;
- info->index = 0;
- info->n_inputs.set_audio (finfo->numInputs);
- info->n_outputs.set_audio (finfo->numOutputs);
- info->n_inputs.set_midi ((finfo->wantMidi&1) ? 1 : 0);
- info->n_outputs.set_midi ((finfo->wantMidi&2) ? 1 : 0);
- info->type = ARDOUR::Windows_VST;
-
/* if we don't have any tags for this plugin, make some up. */
set_tags (info->type, info->unique_id, info->category, info->name, FromPlug);
@@ -1144,7 +1124,6 @@ PluginManager::mac_vst_discover (string path, bool cache_only)
uint32_t discovered = 0;
for (vector<VSTInfo *>::iterator x = finfos->begin(); x != finfos->end(); ++x) {
VSTInfo* finfo = *x;
- char buf[32];
if (!finfo->canProcessReplacing) {
warning << string_compose (_("Mac VST plugin %1 does not support processReplacing, and so cannot be used in %2 at this time"),
@@ -1153,25 +1132,8 @@ PluginManager::mac_vst_discover (string path, bool cache_only)
continue;
}
- PluginInfoPtr info (new MacVSTPluginInfo);
-
- info->name = finfo->name;
-
- snprintf (buf, sizeof (buf), "%d", finfo->UniqueID);
- info->unique_id = buf;
- if (finfo->isInstrument) {
- info->category = X_("Instrument");
- } else {
- info->category = finfo->Category;
- }
+ PluginInfoPtr info (new MacVSTPluginInfo (finfo));
info->path = path;
- info->creator = finfo->creator;
- info->index = 0;
- info->n_inputs.set_audio (finfo->numInputs);
- info->n_outputs.set_audio (finfo->numOutputs);
- info->n_inputs.set_midi ((finfo->wantMidi&1) ? 1 : 0);
- info->n_outputs.set_midi ((finfo->wantMidi&2) ? 1 : 0);
- info->type = ARDOUR::MacVST;
/* if we don't have any tags for this plugin, make some up. */
set_tags (info->type, info->unique_id, info->category, info->name, FromPlug);
@@ -1265,7 +1227,6 @@ PluginManager::lxvst_discover (string path, bool cache_only)
uint32_t discovered = 0;
for (vector<VSTInfo *>::iterator x = finfos->begin(); x != finfos->end(); ++x) {
VSTInfo* finfo = *x;
- char buf[32];
if (!finfo->canProcessReplacing) {
warning << string_compose (_("linuxVST plugin %1 does not support processReplacing, and so cannot be used in %2 at this time"),
@@ -1274,31 +1235,13 @@ PluginManager::lxvst_discover (string path, bool cache_only)
continue;
}
- PluginInfoPtr info(new LXVSTPluginInfo);
+ PluginInfoPtr info(new LXVSTPluginInfo (finfo));
+ info->path = path;
if (!strcasecmp ("The Unnamed plugin", finfo->name)) {
info->name = PBD::basename_nosuffix (path);
- } else {
- info->name = finfo->name;
}
-
- snprintf (buf, sizeof (buf), "%d", finfo->UniqueID);
- info->unique_id = buf;
- if (finfo->isInstrument) {
- info->category = X_("Instrument");
- } else {
- info->category = finfo->Category;
- }
- info->path = path;
- info->creator = finfo->creator;
- info->index = 0;
- info->n_inputs.set_audio (finfo->numInputs);
- info->n_outputs.set_audio (finfo->numOutputs);
- info->n_inputs.set_midi ((finfo->wantMidi&1) ? 1 : 0);
- info->n_outputs.set_midi ((finfo->wantMidi&2) ? 1 : 0);
- info->type = ARDOUR::LXVST;
-
set_tags (info->type, info->unique_id, info->category, info->name, FromPlug);
/* Make sure we don't find the same plugin in more than one place along