diff options
author | Robin Gareus <robin@gareus.org> | 2018-01-30 00:33:44 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2018-01-30 01:34:14 +0100 |
commit | 3eb6a40ce40757e2e36b856d0d80e78a667b7046 (patch) | |
tree | 7d3f600371ddf287bc291766b539175eb12c2f83 /libs/ardour/ardour/plugin_manager.h | |
parent | 8488dceeed7daa83588da6b2f669d10192bf9492 (diff) |
Update PluginManager: implement plugin tags
* move plugin-meta-data (status, tag) into dedicated sub-dir
* load/save space separated tags
* pre-seed tags with plugin-category (if unset)
* breaking API change: PluginStatusesChanged() signal includes change
Diffstat (limited to 'libs/ardour/ardour/plugin_manager.h')
-rw-r--r-- | libs/ardour/ardour/plugin_manager.h | 49 |
1 files changed, 46 insertions, 3 deletions
diff --git a/libs/ardour/ardour/plugin_manager.h b/libs/ardour/ardour/plugin_manager.h index 70b49d3eac..b10c1a1f21 100644 --- a/libs/ardour/ardour/plugin_manager.h +++ b/libs/ardour/ardour/plugin_manager.h @@ -39,7 +39,7 @@ namespace ARDOUR { class Plugin; class LIBARDOUR_API PluginManager : public boost::noncopyable { - public: +public: static PluginManager& instance(); static std::string scanner_bin_path; @@ -64,6 +64,9 @@ class LIBARDOUR_API PluginManager : public boost::noncopyable { const std::string get_default_windows_vst_path() const { return windows_vst_path; } const std::string get_default_lxvst_path() const { return lxvst_path; } + /* always return LXVST for any VST subtype */ + static PluginType to_generic_vst (PluginType); + bool cancelled () { return _cancel_scan; } bool no_timeout () { return _cancel_timeout; } @@ -79,12 +82,52 @@ class LIBARDOUR_API PluginManager : public boost::noncopyable { void set_status (ARDOUR::PluginType type, std::string unique_id, PluginStatusType status); PluginStatusType get_status (const PluginInfoPtr&) const; + void load_tags (); + void save_tags (); + + void set_tags (ARDOUR::PluginType type, std::string unique_id, std::string tags, bool factory, bool force = false); + std::string get_tags_as_string (PluginInfoPtr const&) const; + std::vector<std::string> get_tags (PluginInfoPtr const&) const; + std::vector<std::string> get_all_tags (bool favorites_only) const; + /** plugins were added to or removed from one of the PluginInfoLists */ PBD::Signal0<void> PluginListChanged; + /** Plugin Hidden/Favorite status changed */ - PBD::Signal0<void> PluginStatusesChanged; + PBD::Signal3<void, ARDOUR::PluginType, std::string, PluginStatusType> PluginStatusesChanged; //PluginType t, string id, string tag + + PBD::Signal3<void, ARDOUR::PluginType, std::string, std::string> PluginTagsChanged; //PluginType t, string id, string tag + +private: + + struct PluginTag { + ARDOUR::PluginType type; + std::string unique_id; + std::string tags; + bool user_set; + + PluginTag (ARDOUR::PluginType t, std::string id, std::string s, bool user_set) + : type (t), unique_id (id), tags (s), user_set (user_set) {} + + bool operator== (PluginTag const& other) const { + return other.type == type && other.unique_id == unique_id; + } + + bool operator< (PluginTag const& 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<PluginTag> PluginTagList; + PluginTagList ptags; + + std::string sanitize_tag (const std::string) const; - private: struct PluginStatus { ARDOUR::PluginType type; std::string unique_id; |