X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fardour%2Fardour%2Fplugin_manager.h;h=a7a57036905a110d722cea3ee8c4359a8e652843;hb=452672f78f5f0f9195bfd48398e29b18a8fb1df7;hp=cc9a04738e6d704f3478e8cdfd0aa8184432726d;hpb=cc2767caf32486365a33814149e75c6e588e8603;p=ardour.git diff --git a/libs/ardour/ardour/plugin_manager.h b/libs/ardour/ardour/plugin_manager.h index cc9a04738e..a7a5703690 100644 --- a/libs/ardour/ardour/plugin_manager.h +++ b/libs/ardour/ardour/plugin_manager.h @@ -1,65 +1,143 @@ +/* + Copyright (C) 2000-2007 Paul Davis + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +*/ + #ifndef __ardour_plugin_manager_h__ #define __ardour_plugin_manager_h__ +#ifdef WAF_BUILD +#include "libardour-config.h" +#endif + #include #include #include +#include +#include -#include - -#include +#include "ardour/types.h" +#include "ardour/plugin.h" namespace ARDOUR { -class PluginInfo; class Plugin; -class Session; -class AudioEngine; -class PluginManager { +class PluginManager : public boost::noncopyable { public: - PluginManager (ARDOUR::AudioEngine&); + static PluginManager& instance(); + ~PluginManager (); - std::list &vst_plugin_info () { return _vst_plugin_info; } - std::list &ladspa_plugin_info () { return _ladspa_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 (); + void refresh (); int add_ladspa_directory (std::string dirpath); - int add_vst_directory (std::string dirpath); + int add_windows_vst_directory (std::string dirpath); + int add_lxvst_directory (std::string dirpath); - boost::shared_ptr load (ARDOUR::Session& s, PluginInfo* info); + enum PluginStatusType { + Normal = 0, + Favorite, + Hidden + }; - static PluginManager* the_manager() { return _manager; } + void load_statuses (); + void save_statuses (); + 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 PluginListChanged; private: - ARDOUR::AudioEngine& _engine; - std::list _vst_plugin_info; - std::list _ladspa_plugin_info; + struct PluginStatus { + ARDOUR::PluginType type; + std::string unique_id; + PluginStatusType status; + + PluginStatus (ARDOUR::PluginType t, std::string id, PluginStatusType s = Normal) + : type (t), unique_id (id), status (s) {} + + bool operator==(const PluginStatus& other) const { + return other.type == type && other.unique_id == unique_id; + } + + bool operator<(const PluginStatus& other) const { + if (other.type < type) { + return true; + } else if (other.type == type && other.unique_id < unique_id) { + return true; + } + return false; + } + }; + typedef std::set PluginStatusList; + PluginStatusList statuses; + + ARDOUR::PluginInfoList _empty_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; + std::map 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); - int vst_discover_from_path (std::string path); - int vst_discover (std::string path); + void au_refresh (); + + void lv2_refresh (); + + 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); std::string get_ladspa_category (uint32_t id); + std::vector ladspa_plugin_whitelist; - static PluginManager* _manager; // singleton + static PluginManager* _instance; // singleton + PluginManager (); }; } /* namespace ARDOUR */ #endif /* __ardour_plugin_manager_h__ */ +