2 Copyright (C) 2000-2007 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.
20 #ifndef __ardour_plugin_manager_h__
21 #define __ardour_plugin_manager_h__
24 #include "libardour-config.h"
31 #include <boost/utility.hpp>
33 #include "ardour/types.h"
34 #include "ardour/plugin.h"
40 class PluginManager : public boost::noncopyable {
45 ARDOUR::PluginInfoList &vst_plugin_info ();
46 ARDOUR::PluginInfoList &lxvst_plugin_info ();
47 ARDOUR::PluginInfoList &ladspa_plugin_info ();
48 ARDOUR::PluginInfoList &lv2_plugin_info ();
49 ARDOUR::PluginInfoList &au_plugin_info ();
53 int add_ladspa_directory (std::string dirpath);
54 int add_vst_directory (std::string dirpath);
55 int add_lxvst_directory (std::string dirpath);
57 static PluginManager* the_manager() { return _manager; }
59 enum PluginStatusType {
65 void load_statuses ();
66 void save_statuses ();
67 void set_status (ARDOUR::PluginType type, std::string unique_id, PluginStatusType status);
68 PluginStatusType get_status (const PluginInfoPtr&);
70 /** plugins were added to or removed from one of the PluginInfoLists */
71 PBD::Signal0<void> PluginListChanged;
75 ARDOUR::PluginType type;
76 std::string unique_id;
77 PluginStatusType status;
79 PluginStatus (ARDOUR::PluginType t, std::string id, PluginStatusType s = Normal)
80 : type (t), unique_id (id), status (s) {}
82 bool operator==(const PluginStatus& other) const {
83 return other.type == type && other.unique_id == unique_id;
86 bool operator<(const PluginStatus& other) const {
87 if (other.type < type) {
89 } else if (other.type == type && other.unique_id < unique_id) {
95 typedef std::set<PluginStatus> PluginStatusList;
96 PluginStatusList statuses;
98 ARDOUR::PluginInfoList _empty_plugin_info;
99 ARDOUR::PluginInfoList* _vst_plugin_info;
100 ARDOUR::PluginInfoList* _lxvst_plugin_info;
101 ARDOUR::PluginInfoList* _ladspa_plugin_info;
102 ARDOUR::PluginInfoList* _lv2_plugin_info;
103 ARDOUR::PluginInfoList* _au_plugin_info;
105 std::map<uint32_t, std::string> rdf_type;
107 std::string ladspa_path;
108 std::string vst_path;
109 std::string lxvst_path;
111 void ladspa_refresh ();
113 void lxvst_refresh ();
115 void add_lrdf_data (const std::string &path);
116 void add_ladspa_presets ();
117 void add_vst_presets ();
118 void add_lxvst_presets ();
119 void add_presets (std::string domain);
125 int vst_discover_from_path (std::string path);
126 int vst_discover (std::string path);
128 int lxvst_discover_from_path (std::string path);
129 int lxvst_discover (std::string path);
131 int ladspa_discover_from_path (std::string path);
132 int ladspa_discover (std::string path);
134 std::string get_ladspa_category (uint32_t id);
135 std::vector<uint32_t> ladspa_plugin_whitelist;
137 static PluginManager* _manager; // singleton
140 } /* namespace ARDOUR */
142 #endif /* __ardour_plugin_manager_h__ */