2 Copyright (C) 2000-2006 Paul Davis
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 #include "libardour-config.h"
26 #include <sys/types.h>
35 #ifdef WINDOWS_VST_SUPPORT
36 #include "ardour/vst_info_file.h"
38 #include "pbd/basename.h"
40 #endif // WINDOWS_VST_SUPPORT
43 #include "ardour/vst_info_file.h"
44 #include "ardour/linux_vst_support.h"
45 #include "pbd/basename.h"
47 #endif //LXVST_SUPPORT
49 #include <glib/gstdio.h>
50 #include <glibmm/miscutils.h>
51 #include <glibmm/pattern.h>
53 #include "pbd/pathscanner.h"
54 #include "pbd/whitespace.h"
55 #include "pbd/file_utils.h"
57 #include "ardour/debug.h"
58 #include "ardour/filesystem_paths.h"
59 #include "ardour/ladspa.h"
60 #include "ardour/ladspa_plugin.h"
61 #include "ardour/plugin.h"
62 #include "ardour/plugin_manager.h"
63 #include "ardour/rc_configuration.h"
65 #include "ardour/ladspa_search_path.h"
68 #include "ardour/lv2_plugin.h"
71 #ifdef WINDOWS_VST_SUPPORT
72 #include "ardour/windows_vst_plugin.h"
76 #include "ardour/lxvst_plugin.h"
79 #ifdef AUDIOUNIT_SUPPORT
80 #include "ardour/audio_unit.h"
81 #include <Carbon/Carbon.h>
84 #include "pbd/error.h"
85 #include "pbd/stl_delete.h"
86 #include "pbd/fallback_folders.h"
90 #include "ardour/debug.h"
92 using namespace ARDOUR;
96 PluginManager* PluginManager::_instance = 0;
97 std::string PluginManager::scanner_bin_path = "";
100 PluginManager::instance()
103 _instance = new PluginManager;
108 PluginManager::PluginManager ()
109 : _windows_vst_plugin_info(0)
110 , _lxvst_plugin_info(0)
111 , _ladspa_plugin_info(0)
112 , _lv2_plugin_info(0)
119 if (!PBD::find_file_in_search_path (
120 PBD::Searchpath(Glib::build_filename(ARDOUR::ardour_dll_directory(), "fst")),
121 "ardour-vst-scanner", scanner_bin_path)) {
122 PBD::warning << "VST scanner app not found.'" << endmsg;
127 if ((s = getenv ("LADSPA_RDF_PATH"))){
131 if (lrdf_path.length() == 0) {
132 lrdf_path = "/usr/local/share/ladspa/rdf:/usr/share/ladspa/rdf";
135 add_lrdf_data(lrdf_path);
136 add_ladspa_presets();
137 #ifdef WINDOWS_VST_SUPPORT
138 if (Config->get_use_windows_vst ()) {
139 add_windows_vst_presets ();
141 #endif /* WINDOWS_VST_SUPPORT */
144 if (Config->get_use_lxvst()) {
147 #endif /* Native LinuxVST support*/
149 if ((s = getenv ("VST_PATH"))) {
150 windows_vst_path = s;
151 } else if ((s = getenv ("VST_PLUGINS"))) {
152 windows_vst_path = s;
155 if (windows_vst_path.length() == 0) {
156 #ifdef PLATFORM_WINDOWS
157 windows_vst_path = PBD::get_platform_fallback_folder (PBD::FOLDER_VST);
159 windows_vst_path = "/usr/local/lib/vst:/usr/lib/vst";
163 if ((s = getenv ("LXVST_PATH"))) {
165 } else if ((s = getenv ("LXVST_PLUGINS"))) {
169 if (lxvst_path.length() == 0) {
170 lxvst_path = "/usr/local/lib64/lxvst:/usr/local/lib/lxvst:/usr/lib64/lxvst:/usr/lib/lxvst:"
171 "/usr/local/lib64/linux_vst:/usr/local/lib/linux_vst:/usr/lib64/linux_vst:/usr/lib/linux_vst:"
172 "/usr/lib/vst:/usr/local/lib/vst";
175 if (_instance == 0) {
179 BootMessage (_("Discovering Plugins"));
183 PluginManager::~PluginManager()
188 PluginManager::lxvst_search_path() const
190 std::string searchpath = lxvst_path;
191 if (!Config->get_plugin_path_lxvst().empty()) {
192 searchpath += G_SEARCHPATH_SEPARATOR;
193 searchpath += Config->get_plugin_path_lxvst();
199 PluginManager::windows_vst_search_path() const
201 std::string searchpath = windows_vst_path;
202 if (!Config->get_plugin_path_vst().empty()) {
203 searchpath += G_SEARCHPATH_SEPARATOR;
204 searchpath += Config->get_plugin_path_vst();
210 PluginManager::refresh (bool cache_only)
212 DEBUG_TRACE (DEBUG::PluginManager, "PluginManager::refresh\n");
213 BootMessage (_("Discovering Plugins"));
220 #ifdef WINDOWS_VST_SUPPORT
221 if (Config->get_use_windows_vst()) {
222 windows_vst_refresh (cache_only);
224 #endif // WINDOWS_VST_SUPPORT
227 if(Config->get_use_lxvst()) {
228 lxvst_refresh(cache_only);
230 #endif //Native linuxVST SUPPORT
232 #ifdef AUDIOUNIT_SUPPORT
236 PluginListChanged (); /* EMIT SIGNAL */
237 PluginScanMessage(X_("closeme"), "", false);
242 PluginManager::cancel_plugin_scan ()
248 PluginManager::clear_vst_cache ()
250 // see also libs/ardour/vst_info_file.cc - vstfx_infofile_path()
251 #ifdef WINDOWS_VST_SUPPORT
254 vector<string *> *fsi_files;
256 fsi_files = scanner (windows_vst_search_path(), "\\.fsi$", true, true, -1, false);
258 for (vector<string *>::iterator i = fsi_files->begin(); i != fsi_files->end (); ++i) {
259 ::g_unlink((*i)->c_str());
262 vector_delete(fsi_files);
269 vector<string *> *fsi_files;
270 fsi_files = scanner (lxvst_search_path(), "\\.fsi$", true, true, -1, false);
272 for (vector<string *>::iterator i = fsi_files->begin(); i != fsi_files->end (); ++i) {
273 ::g_unlink((*i)->c_str());
276 vector_delete(fsi_files);
280 #if (defined WINDOWS_VST_SUPPORT || defined LXVST_SUPPORT)
282 string personal = get_personal_vst_info_cache_dir();
284 vector<string *> *fsi_files;
285 fsi_files = scanner (personal, "\\.fsi$", true, true, -1, false);
287 for (vector<string *>::iterator i = fsi_files->begin(); i != fsi_files->end (); ++i) {
288 ::g_unlink((*i)->c_str());
291 vector_delete(fsi_files);
297 PluginManager::clear_vst_blacklist ()
299 #ifdef WINDOWS_VST_SUPPORT
302 vector<string *> *fsi_files;
304 fsi_files = scanner (windows_vst_search_path(), "\\.fsb$", true, true, -1, false);
306 for (vector<string *>::iterator i = fsi_files->begin(); i != fsi_files->end (); ++i) {
307 ::g_unlink((*i)->c_str());
310 vector_delete(fsi_files);
317 vector<string *> *fsi_files;
318 fsi_files = scanner (lxvst_search_path(), "\\.fsb$", true, true, -1, false);
320 for (vector<string *>::iterator i = fsi_files->begin(); i != fsi_files->end (); ++i) {
321 ::g_unlink((*i)->c_str());
324 vector_delete(fsi_files);
328 #if (defined WINDOWS_VST_SUPPORT || defined LXVST_SUPPORT)
330 string personal = get_personal_vst_blacklist_dir();
333 vector<string *> *fsi_files;
334 fsi_files = scanner (personal, "\\.fsb$", true, true, -1, false);
336 for (vector<string *>::iterator i = fsi_files->begin(); i != fsi_files->end (); ++i) {
337 ::g_unlink((*i)->c_str());
340 vector_delete(fsi_files);
346 PluginManager::ladspa_refresh ()
348 if (_ladspa_plugin_info) {
349 _ladspa_plugin_info->clear ();
351 _ladspa_plugin_info = new ARDOUR::PluginInfoList ();
354 /* allow LADSPA_PATH to augment, not override standard locations */
356 /* Only add standard locations to ladspa_path if it doesn't
357 * already contain them. Check for trailing G_DIR_SEPARATOR too.
360 vector<string> ladspa_modules;
362 DEBUG_TRACE (DEBUG::PluginManager, string_compose ("LADSPA: search along: [%1]\n", ladspa_search_path().to_string()));
364 Glib::PatternSpec so_extension_pattern("*.so");
365 Glib::PatternSpec dylib_extension_pattern("*.dylib");
366 Glib::PatternSpec dll_extension_pattern("*.dll");
368 find_matching_files_in_search_path (ladspa_search_path (),
369 so_extension_pattern, ladspa_modules);
371 find_matching_files_in_search_path (ladspa_search_path (),
372 dylib_extension_pattern, ladspa_modules);
374 find_matching_files_in_search_path (ladspa_search_path (),
375 dll_extension_pattern, ladspa_modules);
377 for (vector<std::string>::iterator i = ladspa_modules.begin(); i != ladspa_modules.end(); ++i) {
378 ARDOUR::PluginScanMessage(_("LADSPA"), *i, false);
379 ladspa_discover (*i);
383 static bool rdf_filter (const string &str, void* /*arg*/)
385 return str[0] != '.' &&
386 ((str.find(".rdf") == (str.length() - 4)) ||
387 (str.find(".rdfs") == (str.length() - 5)) ||
388 (str.find(".n3") == (str.length() - 3)) ||
389 (str.find(".ttl") == (str.length() - 4)));
393 PluginManager::add_ladspa_presets()
395 add_presets ("ladspa");
399 PluginManager::add_windows_vst_presets()
401 add_presets ("windows-vst");
405 PluginManager::add_lxvst_presets()
407 add_presets ("lxvst");
411 PluginManager::add_presets(string domain)
415 vector<string *> *presets;
416 vector<string *>::iterator x;
419 if ((envvar = getenv ("HOME")) == 0) {
423 string path = string_compose("%1/.%2/rdf", envvar, domain);
424 presets = scanner (path, rdf_filter, 0, false, true);
427 for (x = presets->begin(); x != presets->end (); ++x) {
428 string file = "file:" + **x;
429 if (lrdf_read_file(file.c_str())) {
430 warning << string_compose(_("Could not parse rdf file: %1"), *x) << endmsg;
434 vector_delete (presets);
440 PluginManager::add_lrdf_data (const string &path)
444 vector<string *>* rdf_files;
445 vector<string *>::iterator x;
447 rdf_files = scanner (path, rdf_filter, 0, false, true);
450 for (x = rdf_files->begin(); x != rdf_files->end (); ++x) {
451 const string uri(string("file://") + **x);
453 if (lrdf_read_file(uri.c_str())) {
454 warning << "Could not parse rdf file: " << uri << endmsg;
458 vector_delete (rdf_files);
464 PluginManager::ladspa_discover (string path)
466 DEBUG_TRACE (DEBUG::PluginManager, string_compose ("Checking for LADSPA plugin at %1\n", path));
468 Glib::Module module(path);
469 const LADSPA_Descriptor *descriptor;
470 LADSPA_Descriptor_Function dfunc;
474 error << string_compose(_("LADSPA: cannot load module \"%1\" (%2)"),
475 path, Glib::Module::get_last_error()) << endmsg;
480 if (!module.get_symbol("ladspa_descriptor", func)) {
481 error << string_compose(_("LADSPA: module \"%1\" has no descriptor function."), path) << endmsg;
482 error << Glib::Module::get_last_error() << endmsg;
486 dfunc = (LADSPA_Descriptor_Function)func;
488 DEBUG_TRACE (DEBUG::PluginManager, string_compose ("LADSPA plugin found at %1\n", path));
490 for (uint32_t i = 0; ; ++i) {
491 if ((descriptor = dfunc (i)) == 0) {
495 if (!ladspa_plugin_whitelist.empty()) {
496 if (find (ladspa_plugin_whitelist.begin(), ladspa_plugin_whitelist.end(), descriptor->UniqueID) == ladspa_plugin_whitelist.end()) {
501 PluginInfoPtr info(new LadspaPluginInfo);
502 info->name = descriptor->Name;
503 info->category = get_ladspa_category(descriptor->UniqueID);
504 info->creator = descriptor->Maker;
507 info->n_inputs = ChanCount();
508 info->n_outputs = ChanCount();
509 info->type = ARDOUR::LADSPA;
512 snprintf (buf, sizeof (buf), "%lu", descriptor->UniqueID);
513 info->unique_id = buf;
515 for (uint32_t n=0; n < descriptor->PortCount; ++n) {
516 if ( LADSPA_IS_PORT_AUDIO (descriptor->PortDescriptors[n]) ) {
517 if ( LADSPA_IS_PORT_INPUT (descriptor->PortDescriptors[n]) ) {
518 info->n_inputs.set_audio(info->n_inputs.n_audio() + 1);
520 else if ( LADSPA_IS_PORT_OUTPUT (descriptor->PortDescriptors[n]) ) {
521 info->n_outputs.set_audio(info->n_outputs.n_audio() + 1);
526 if(_ladspa_plugin_info->empty()){
527 _ladspa_plugin_info->push_back (info);
530 //Ensure that the plugin is not already in the plugin list.
534 for (PluginInfoList::const_iterator i = _ladspa_plugin_info->begin(); i != _ladspa_plugin_info->end(); ++i) {
535 if(0 == info->unique_id.compare((*i)->unique_id)){
541 _ladspa_plugin_info->push_back (info);
544 DEBUG_TRACE (DEBUG::PluginManager, string_compose ("Found LADSPA plugin, name: %1, Inputs: %2, Outputs: %3\n", info->name, info->n_inputs, info->n_outputs));
547 // GDB WILL NOT LIKE YOU IF YOU DO THIS
554 PluginManager::get_ladspa_category (uint32_t plugin_id)
558 lrdf_statement pattern;
560 snprintf(buf, sizeof(buf), "%s%" PRIu32, LADSPA_BASE, plugin_id);
561 pattern.subject = buf;
562 pattern.predicate = const_cast<char*>(RDF_TYPE);
564 pattern.object_type = lrdf_uri;
566 lrdf_statement* matches1 = lrdf_matches (&pattern);
572 pattern.subject = matches1->object;
573 pattern.predicate = const_cast<char*>(LADSPA_BASE "hasLabel");
575 pattern.object_type = lrdf_literal;
577 lrdf_statement* matches2 = lrdf_matches (&pattern);
578 lrdf_free_statements(matches1);
584 string label = matches2->object;
585 lrdf_free_statements(matches2);
587 /* Kludge LADSPA class names to be singular and match LV2 class names.
588 This avoids duplicate plugin menus for every class, which is necessary
589 to make the plugin category menu at all usable, but is obviously a
592 In the short term, lrdf could be updated so the labels match and a new
593 release made. To support both specs, we should probably be mapping the
594 URIs to the same category in code and perhaps tweaking that hierarchy
595 dynamically to suit the user. Personally, I (drobilla) think that time
596 is better spent replacing the little-used LRDF.
598 In the longer term, we will abandon LRDF entirely in favour of LV2 and
599 use that class hierarchy. Aside from fixing this problem properly, that
600 will also allow for translated labels. SWH plugins have been LV2 for
601 ages; TAP needs porting. I don't know of anything else with LRDF data.
603 if (label == "Utilities") {
605 } else if (label == "Pitch shifters") {
606 return "Pitch Shifter";
607 } else if (label != "Dynamics" && label != "Chorus"
608 &&label[label.length() - 1] == 's'
609 && label[label.length() - 2] != 's') {
610 return label.substr(0, label.length() - 1);
621 PluginManager::lv2_refresh ()
623 DEBUG_TRACE (DEBUG::PluginManager, "LV2: refresh\n");
624 delete _lv2_plugin_info;
625 _lv2_plugin_info = LV2PluginInfo::discover();
629 #ifdef AUDIOUNIT_SUPPORT
631 PluginManager::au_refresh ()
633 DEBUG_TRACE (DEBUG::PluginManager, "AU: refresh\n");
634 delete _au_plugin_info;
635 _au_plugin_info = AUPluginInfo::discover();
640 #ifdef WINDOWS_VST_SUPPORT
643 PluginManager::windows_vst_refresh (bool cache_only)
645 if (_windows_vst_plugin_info) {
646 _windows_vst_plugin_info->clear ();
648 _windows_vst_plugin_info = new ARDOUR::PluginInfoList();
651 windows_vst_discover_from_path (windows_vst_search_path(), cache_only);
654 static bool windows_vst_filter (const string& str, void * /*arg*/)
656 /* Not a dotfile, has a prefix before a period, suffix is "dll" */
658 return str[0] != '.' && (str.length() > 4 && str.find (".dll") == (str.length() - 4));
662 PluginManager::windows_vst_discover_from_path (string path, bool cache_only)
665 vector<string *> *plugin_objects;
666 vector<string *>::iterator x;
669 DEBUG_TRACE (DEBUG::PluginManager, string_compose ("detecting Windows VST plugins along %1\n", path));
671 plugin_objects = scanner (windows_vst_search_path(), windows_vst_filter, 0, false, true);
673 if (plugin_objects) {
674 for (x = plugin_objects->begin(); x != plugin_objects->end (); ++x) {
675 if (cancelled()) break;
676 ARDOUR::PluginScanMessage(_("VST"), **x, !cache_only);
677 windows_vst_discover (**x, cache_only);
680 vector_delete (plugin_objects);
687 PluginManager::windows_vst_discover (string path, bool cache_only)
689 DEBUG_TRACE (DEBUG::PluginManager, string_compose ("windows_vst_discover '%1'\n", path));
691 vector<VSTInfo*> * finfos = vstfx_get_info_fst (const_cast<char *> (path.c_str()),
692 cache_only ? VST_SCAN_CACHE_ONLY : VST_SCAN_USE_APP);
694 if (finfos->empty()) {
695 DEBUG_TRACE (DEBUG::PluginManager, string_compose ("Cannot get Windows VST information from '%1'\n", path));
699 uint32_t discovered = 0;
700 for (vector<VSTInfo *>::iterator x = finfos->begin(); x != finfos->end(); ++x) {
704 if (!finfo->canProcessReplacing) {
705 warning << string_compose (_("VST plugin %1 does not support processReplacing, and so cannot be used in %2 at this time"),
706 finfo->name, PROGRAM_NAME)
711 PluginInfoPtr info (new WindowsVSTPluginInfo);
713 /* what a joke freeware VST is */
715 if (!strcasecmp ("The Unnamed plugin", finfo->name)) {
716 info->name = PBD::basename_nosuffix (path);
718 info->name = finfo->name;
722 snprintf (buf, sizeof (buf), "%d", finfo->UniqueID);
723 info->unique_id = buf;
724 info->category = "VST";
726 info->creator = finfo->creator;
728 info->n_inputs.set_audio (finfo->numInputs);
729 info->n_outputs.set_audio (finfo->numOutputs);
730 info->n_inputs.set_midi (finfo->wantMidi ? 1 : 0);
731 info->type = ARDOUR::Windows_VST;
733 // TODO: check dup-IDs (lxvst AND windows vst)
734 bool duplicate = false;
736 if (!_windows_vst_plugin_info->empty()) {
737 for (PluginInfoList::iterator i =_windows_vst_plugin_info->begin(); i != _windows_vst_plugin_info->end(); ++i) {
738 if ((info->type == (*i)->type)&&(info->unique_id == (*i)->unique_id)) {
739 warning << "Ignoring duplicate Windows VST plugin " << info->name << "\n";
747 DEBUG_TRACE (DEBUG::PluginManager, string_compose ("Windows VST plugin ID '%1'\n", info->unique_id));
748 _windows_vst_plugin_info->push_back (info);
753 vstfx_free_info_list (finfos);
754 return discovered > 0 ? 0 : -1;
757 #endif // WINDOWS_VST_SUPPORT
762 PluginManager::lxvst_refresh (bool cache_only)
764 if (_lxvst_plugin_info) {
765 _lxvst_plugin_info->clear ();
767 _lxvst_plugin_info = new ARDOUR::PluginInfoList();
770 lxvst_discover_from_path (lxvst_search_path(), cache_only);
773 static bool lxvst_filter (const string& str, void *)
775 /* Not a dotfile, has a prefix before a period, suffix is "so" */
777 return str[0] != '.' && (str.length() > 3 && str.find (".so") == (str.length() - 3));
781 PluginManager::lxvst_discover_from_path (string path, bool cache_only)
784 vector<string *> *plugin_objects;
785 vector<string *>::iterator x;
792 DEBUG_TRACE (DEBUG::PluginManager, string_compose ("Discovering linuxVST plugins along %1\n", path));
794 plugin_objects = scanner (lxvst_search_path(), lxvst_filter, 0, false, true);
796 if (plugin_objects) {
797 for (x = plugin_objects->begin(); x != plugin_objects->end (); ++x) {
798 if (cancelled()) break;
799 ARDOUR::PluginScanMessage(_("LXVST"), **x, !cache_only);
800 lxvst_discover (**x, cache_only);
803 vector_delete (plugin_objects);
810 PluginManager::lxvst_discover (string path, bool cache_only)
812 DEBUG_TRACE (DEBUG::PluginManager, string_compose ("checking apparent LXVST plugin at %1\n", path));
814 vector<VSTInfo*> * finfos = vstfx_get_info_lx (const_cast<char *> (path.c_str()),
815 cache_only ? VST_SCAN_CACHE_ONLY : VST_SCAN_USE_APP);
817 if (finfos->empty()) {
818 DEBUG_TRACE (DEBUG::PluginManager, string_compose ("Cannot get Linux VST information from '%1'\n", path));
822 uint32_t discovered = 0;
823 for (vector<VSTInfo *>::iterator x = finfos->begin(); x != finfos->end(); ++x) {
827 if (!finfo->canProcessReplacing) {
828 warning << string_compose (_("linuxVST plugin %1 does not support processReplacing, and so cannot be used in %2 at this time"),
829 finfo->name, PROGRAM_NAME)
834 PluginInfoPtr info(new LXVSTPluginInfo);
836 if (!strcasecmp ("The Unnamed plugin", finfo->name)) {
837 info->name = PBD::basename_nosuffix (path);
839 info->name = finfo->name;
843 snprintf (buf, sizeof (buf), "%d", finfo->UniqueID);
844 info->unique_id = buf;
845 info->category = "linuxVSTs";
847 info->creator = finfo->creator;
849 info->n_inputs.set_audio (finfo->numInputs);
850 info->n_outputs.set_audio (finfo->numOutputs);
851 info->n_inputs.set_midi (finfo->wantMidi ? 1 : 0);
852 info->type = ARDOUR::LXVST;
854 /* Make sure we don't find the same plugin in more than one place along
855 the LXVST_PATH We can't use a simple 'find' because the path is included
856 in the PluginInfo, and that is the one thing we can be sure MUST be
857 different if a duplicate instance is found. So we just compare the type
858 and unique ID (which for some VSTs isn't actually unique...)
861 // TODO: check dup-IDs with windowsVST, too
862 bool duplicate = false;
863 if (!_lxvst_plugin_info->empty()) {
864 for (PluginInfoList::iterator i =_lxvst_plugin_info->begin(); i != _lxvst_plugin_info->end(); ++i) {
865 if ((info->type == (*i)->type)&&(info->unique_id == (*i)->unique_id)) {
866 warning << "Ignoring duplicate Linux VST plugin " << info->name << "\n";
874 _lxvst_plugin_info->push_back (info);
879 vstfx_free_info_list (finfos);
880 return discovered > 0 ? 0 : -1;
883 #endif // LXVST_SUPPORT
886 PluginManager::PluginStatusType
887 PluginManager::get_status (const PluginInfoPtr& pi)
889 PluginStatus ps (pi->type, pi->unique_id);
890 PluginStatusList::const_iterator i = find (statuses.begin(), statuses.end(), ps);
891 if (i == statuses.end() ) {
899 PluginManager::save_statuses ()
902 std::string path = Glib::build_filename (user_config_directory(), "plugin_statuses");
904 ofs.open (path.c_str(), ios_base::openmode (ios::out|ios::trunc));
910 for (PluginStatusList::iterator i = statuses.begin(); i != statuses.end(); ++i) {
922 ofs << "Windows-VST";
931 switch ((*i).status) {
944 ofs << (*i).unique_id;;
952 PluginManager::load_statuses ()
954 std::string path = Glib::build_filename (user_config_directory(), "plugin_statuses");
955 ifstream ifs (path.c_str());
965 PluginStatusType status;
982 /* rest of the line is the plugin ID */
984 ifs.getline (buf, sizeof (buf), '\n');
989 if (sstatus == "Normal") {
991 } else if (sstatus == "Favorite") {
993 } else if (sstatus == "Hidden") {
996 error << string_compose (_("unknown plugin status type \"%1\" - all entries ignored"), sstatus)
1002 if (stype == "LADSPA") {
1004 } else if (stype == "AudioUnit") {
1006 } else if (stype == "LV2") {
1008 } else if (stype == "Windows-VST") {
1010 } else if (stype == "LXVST") {
1013 error << string_compose (_("unknown plugin type \"%1\" - ignored"), stype)
1019 strip_whitespace_edges (id);
1020 set_status (type, id, status);
1027 PluginManager::set_status (PluginType t, string id, PluginStatusType status)
1029 PluginStatus ps (t, id, status);
1030 statuses.erase (ps);
1032 if (status == Normal) {
1036 statuses.insert (ps);
1039 ARDOUR::PluginInfoList&
1040 PluginManager::windows_vst_plugin_info ()
1042 #ifdef WINDOWS_VST_SUPPORT
1043 if (!_windows_vst_plugin_info) {
1044 windows_vst_refresh ();
1046 return *_windows_vst_plugin_info;
1048 return _empty_plugin_info;
1052 ARDOUR::PluginInfoList&
1053 PluginManager::lxvst_plugin_info ()
1055 #ifdef LXVST_SUPPORT
1056 if (!_lxvst_plugin_info)
1058 return *_lxvst_plugin_info;
1060 return _empty_plugin_info;
1064 ARDOUR::PluginInfoList&
1065 PluginManager::ladspa_plugin_info ()
1067 if (!_ladspa_plugin_info)
1069 return *_ladspa_plugin_info;
1072 ARDOUR::PluginInfoList&
1073 PluginManager::lv2_plugin_info ()
1076 if (!_lv2_plugin_info)
1078 return *_lv2_plugin_info;
1080 return _empty_plugin_info;
1084 ARDOUR::PluginInfoList&
1085 PluginManager::au_plugin_info ()
1087 #ifdef AUDIOUNIT_SUPPORT
1088 if (!_au_plugin_info)
1090 return *_au_plugin_info;
1092 return _empty_plugin_info;