8#include "plugins/plugin_descriptor.h"
16using namespace std::string_view_literals;
18namespace zrythm::gui::old_dsp::plugins
29 std::string get_name ()
const {
return name_; }
31 void set_name (std::string_view name) {
name_ = name; }
61 static constexpr auto kNameKey =
"name"sv;
62 static constexpr auto kDescriptionKey =
"description"sv;
63 static constexpr auto kDescriptorsKey =
"descriptors"sv;
105 std::string get_document_type ()
const {
return "Zrythm Plugin Collections"; }
106 int get_format_major_version ()
const {
return 3; }
107 int get_format_minor_version ()
const {
return 0; }
131 static constexpr auto kCollectionsKey =
"collections"sv;
140 static void delete_file ();
142 static std::filesystem::path get_file_path ();
Plugin collection used in the plugin browser.
friend void init_from(PluginCollection &obj, const PluginCollection &other, utils::ObjectCloneType clone_type)
Generates a context menu for the collection.
void remove_descriptor(const PluginDescriptor &descr)
Removes the descriptor matching the given one from the collection.
std::vector< std::unique_ptr< PluginDescriptor > > descriptors_
Plugin descriptors.
std::string description_
Description of the collection (optional).
void add_descriptor(const PluginDescriptor &descr)
Appends a descriptor to the collection.
std::string name_
Name of the collection.
bool contains_descriptor(const PluginDescriptor &descr) const
Returns whether the collection contains the given descriptor.
Serializable plugin collections.
static std::unique_ptr< PluginCollections > read_or_new()
Returns a new instance with the cache pre-filled from the cache file, or an empty instance if there i...
std::vector< std::unique_ptr< PluginCollection > > collections_
Plugin collections.
void serialize_to_file() const
Serializes the cached descriptors to the standard file.
void add(const PluginCollection &collection, bool serialize)
Appends a collection.
void remove(PluginCollection &collection, bool serialize)
Removes the given collection.
const PluginCollection * find_from_name(std::string_view name) const
Finds a collection by name.
void serialize_to_file_no_throw() const
Wrapper over serialize_to_file that ignores exceptions.
The PluginDescriptor class provides a set of static utility functions and member functions to work wi...