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"
37 #include "ardour/lv2_plugin.h"
44 class PluginManager : public boost::noncopyable {
49 ARDOUR::PluginInfoList &vst_plugin_info ();
50 ARDOUR::PluginInfoList &ladspa_plugin_info ();
51 ARDOUR::PluginInfoList &lv2_plugin_info ();
52 ARDOUR::PluginInfoList &au_plugin_info ();
56 int add_ladspa_directory (std::string dirpath);
57 int add_vst_directory (std::string dirpath);
59 static PluginManager* the_manager() { return _manager; }
61 void load_favorites ();
62 void save_favorites ();
63 void add_favorite (ARDOUR::PluginType type, std::string unique_id);
64 void remove_favorite (ARDOUR::PluginType type, std::string unique_id);
65 bool is_a_favorite_plugin (const PluginInfoPtr&);
68 struct FavoritePlugin {
69 ARDOUR::PluginType type;
70 std::string unique_id;
72 FavoritePlugin (ARDOUR::PluginType t, std::string id)
73 : type (t), unique_id (id) {}
75 bool operator==(const FavoritePlugin& other) const {
76 return other.type == type && other.unique_id == unique_id;
79 bool operator<(const FavoritePlugin& other) const {
80 return other.type < type || other.unique_id < unique_id;
83 typedef std::set<FavoritePlugin> FavoritePluginList;
84 FavoritePluginList favorites;
86 ARDOUR::PluginInfoList _empty_plugin_info;
87 ARDOUR::PluginInfoList* _vst_plugin_info;
88 ARDOUR::PluginInfoList* _ladspa_plugin_info;
89 ARDOUR::PluginInfoList* _lv2_plugin_info;
90 ARDOUR::PluginInfoList* _au_plugin_info;
96 std::map<uint32_t, std::string> rdf_type;
98 std::string ladspa_path;
101 void ladspa_refresh ();
104 void add_lrdf_data (const std::string &path);
105 void add_ladspa_presets ();
106 void add_vst_presets ();
107 void add_presets (std::string domain);
113 int vst_discover_from_path (std::string path);
114 int vst_discover (std::string path);
116 int ladspa_discover_from_path (std::string path);
117 int ladspa_discover (std::string path);
119 std::string get_ladspa_category (uint32_t id);
120 std::vector<uint32_t> ladspa_plugin_whitelist;
122 static PluginManager* _manager; // singleton
125 } /* namespace ARDOUR */
127 #endif /* __ardour_plugin_manager_h__ */