Add ARDOUR::ladspa_search_path function to get LADSPA module directories
[ardour.git] / libs / ardour / ardour / plugin_manager.h
index 779e26e9157f1ee612d2fa29ad6ad3b454c9c3be..a7a57036905a110d722cea3ee8c4359a8e652843 100644 (file)
 #include "ardour/types.h"
 #include "ardour/plugin.h"
 
-#ifdef HAVE_SLV2
-#include "ardour/lv2_plugin.h"
-#endif
-
 namespace ARDOUR {
 
 class Plugin;
 
 class PluginManager : public boost::noncopyable {
   public:
-       PluginManager ();
+       static PluginManager& instance();
+
        ~PluginManager ();
 
-       ARDOUR::PluginInfoList &vst_plugin_info ();
+       ARDOUR::PluginInfoList &windows_vst_plugin_info ();
+       ARDOUR::PluginInfoList &lxvst_plugin_info ();
        ARDOUR::PluginInfoList &ladspa_plugin_info ();
        ARDOUR::PluginInfoList &lv2_plugin_info ();
        ARDOUR::PluginInfoList &au_plugin_info ();
@@ -54,9 +52,8 @@ class PluginManager : public boost::noncopyable {
        void refresh ();
 
        int add_ladspa_directory (std::string dirpath);
-       int add_vst_directory (std::string dirpath);
-
-       static PluginManager* the_manager() { return _manager; }
+       int add_windows_vst_directory (std::string dirpath);
+       int add_lxvst_directory (std::string dirpath);
 
        enum PluginStatusType {
                Normal = 0,
@@ -69,6 +66,9 @@ class PluginManager : public boost::noncopyable {
        void set_status (ARDOUR::PluginType type, std::string unique_id, PluginStatusType status);
        PluginStatusType get_status (const PluginInfoPtr&);
 
+       /** plugins were added to or removed from one of the PluginInfoLists */
+       PBD::Signal0<void> PluginListChanged;
+
   private:
        struct PluginStatus {
            ARDOUR::PluginType type;
@@ -83,41 +83,49 @@ class PluginManager : public boost::noncopyable {
            }
 
            bool operator<(const PluginStatus& other) const {
-                   return other.type < type || other.unique_id < unique_id;
+                   if (other.type < type) {
+                           return true;
+                   } else if (other.type == type && other.unique_id < unique_id) {
+                           return true;
+                   }
+                   return false;
            }
        };
        typedef std::set<PluginStatus> PluginStatusList;
        PluginStatusList statuses;
 
        ARDOUR::PluginInfoList  _empty_plugin_info;
-       ARDOUR::PluginInfoList* _vst_plugin_info;
+       ARDOUR::PluginInfoList* _windows_vst_plugin_info;
+       ARDOUR::PluginInfoList* _lxvst_plugin_info;
        ARDOUR::PluginInfoList* _ladspa_plugin_info;
        ARDOUR::PluginInfoList* _lv2_plugin_info;
        ARDOUR::PluginInfoList* _au_plugin_info;
 
-#ifdef HAVE_SLV2
-       LV2World* _lv2_world;
-#endif
-
        std::map<uint32_t, std::string> rdf_type;
 
        std::string ladspa_path;
-       std::string vst_path;
+       std::string windows_vst_path;
+       std::string lxvst_path;
 
        void ladspa_refresh ();
-       void vst_refresh ();
+       void windows_vst_refresh ();
+       void lxvst_refresh ();
 
        void add_lrdf_data (const std::string &path);
        void add_ladspa_presets ();
-       void add_vst_presets ();
+       void add_windows_vst_presets ();
+       void add_lxvst_presets ();
        void add_presets (std::string domain);
 
        void au_refresh ();
 
        void lv2_refresh ();
 
-       int vst_discover_from_path (std::string path);
-       int vst_discover (std::string path);
+       int windows_vst_discover_from_path (std::string path);
+       int windows_vst_discover (std::string path);
+       
+       int lxvst_discover_from_path (std::string path);
+       int lxvst_discover (std::string path);
 
        int ladspa_discover_from_path (std::string path);
        int ladspa_discover (std::string path);
@@ -125,7 +133,8 @@ class PluginManager : public boost::noncopyable {
        std::string get_ladspa_category (uint32_t id);
        std::vector<uint32_t> ladspa_plugin_whitelist;
 
-       static PluginManager* _manager; // singleton
+       static PluginManager* _instance; // singleton
+       PluginManager ();
 };
 
 } /* namespace ARDOUR */