+#ifdef LXVST_SUPPORT
+
+void
+PluginManager::lxvst_refresh ()
+{
+ if (_lxvst_plugin_info) {
+ _lxvst_plugin_info->clear ();
+ } else {
+ _lxvst_plugin_info = new ARDOUR::PluginInfoList();
+ }
+
+ if (lxvst_path.length() == 0) {
+ lxvst_path = "/usr/local/lib64/lxvst:/usr/local/lib/lxvst:/usr/lib64/lxvst:/usr/lib/lxvst";
+ }
+
+ lxvst_discover_from_path (lxvst_path);
+}
+
+int
+PluginManager::add_lxvst_directory (string path)
+{
+ if (lxvst_discover_from_path (path) == 0) {
+ lxvst_path += ':';
+ lxvst_path += path;
+ return 0;
+ }
+ return -1;
+}
+
+static bool lxvst_filter (const string& str, void *)
+{
+ /* Not a dotfile, has a prefix before a period, suffix is "so" */
+
+ return str[0] != '.' && (str.length() > 3 && str.find (".so") == (str.length() - 3));
+}
+
+int
+PluginManager::lxvst_discover_from_path (string path)
+{
+ PathScanner scanner;
+ vector<string *> *plugin_objects;
+ vector<string *>::iterator x;
+ int ret = 0;
+
+ info << "Discovering linuxVST plugins along " << path << endmsg;
+
+ plugin_objects = scanner (lxvst_path, lxvst_filter, 0, true, true);
+
+ if (plugin_objects) {
+ for (x = plugin_objects->begin(); x != plugin_objects->end (); ++x) {
+ lxvst_discover (**x);
+ }
+ }
+
+ info << "Done linuxVST discover" << endmsg;
+
+ vector_delete (plugin_objects);
+ return ret;
+}
+
+int
+PluginManager::lxvst_discover (string path)
+{
+ VSTFXInfo* finfo;
+ char buf[32];
+
+ if ((finfo = vstfx_get_info (const_cast<char *> (path.c_str()))) == 0) {
+ warning << "Cannot get linuxVST information from " << path << endmsg;
+ return -1;
+ }
+
+ if (!finfo->canProcessReplacing) {
+ warning << string_compose (_("linuxVST plugin %1 does not support processReplacing, and so cannot be used in ardour at this time"),
+ finfo->name)
+ << endl;
+ }
+
+ PluginInfoPtr info(new LXVSTPluginInfo);
+
+ 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;
+ info->category = "linuxVSTs";
+ 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 : 0);
+ info->type = ARDOUR::LXVST;
+
+ _lxvst_plugin_info->push_back (info);
+ vstfx_free_info (finfo);
+
+ return 0;
+}
+
+#endif // LXVST_SUPPORT
+
+
+PluginManager::PluginStatusType
+PluginManager::get_status (const PluginInfoPtr& pi)