Zrythm
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
collection.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: © 2020-2021 Alexandros Theodotou <alex@zrythm.org>
2// SPDX-License-Identifier: LicenseRef-ZrythmLicense
3
10#ifndef __PLUGINS_PLUGIN_COLLECTION_H__
11#define __PLUGINS_PLUGIN_COLLECTION_H__
12
14#include "utils/yaml.h"
15
22#define PLUGIN_COLLECTION_SCHEMA_VERSION 1
23
27typedef struct PluginCollection
28{
29 int schema_version;
30
32 char * name;
33
36
39 int num_descriptors;
40 size_t descriptors_size;
42
43static const cyaml_schema_field_t plugin_collection_fields_schema[] = {
44 YAML_FIELD_INT (PluginCollection, schema_version),
45 YAML_FIELD_STRING_PTR (PluginCollection, name),
46 YAML_FIELD_STRING_PTR_OPTIONAL (PluginCollection, description),
49 descriptors,
50 plugin_descriptor_schema),
51
52 CYAML_FIELD_END
53};
54
55static const cyaml_schema_value_t plugin_collection_schema = {
56 YAML_VALUE_PTR (PluginCollection, plugin_collection_fields_schema),
57};
58
59void
60plugin_collection_init_loaded (PluginCollection * self);
61
67
73
74char *
75plugin_collection_get_name (PluginCollection * self);
76
77void
78plugin_collection_set_name (PluginCollection * self, const char * name);
79
87NONNULL bool
89 PluginCollection * self,
90 const PluginDescriptor * descr,
91 bool match_pointer);
92
96void
98 PluginCollection * self,
99 const PluginDescriptor * descr);
100
105void
107 PluginCollection * self,
108 const PluginDescriptor * descr);
109
113GMenuModel *
114plugin_collection_generate_context_menu (const PluginCollection * self);
115
119void
121
122void
123plugin_collection_free (PluginCollection * self);
124
129#endif
void plugin_collection_add_descriptor(PluginCollection *self, const PluginDescriptor *descr)
Appends a descriptor to the collection.
PluginCollection * plugin_collection_clone(const PluginCollection *self)
Clones a plugin collection.
NONNULL bool plugin_collection_contains_descriptor(PluginCollection *self, const PluginDescriptor *descr, bool match_pointer)
Returns whether the collection contains the given descriptor.
void plugin_collection_clear(PluginCollection *self)
Removes all the descriptors.
void plugin_collection_remove_descriptor(PluginCollection *self, const PluginDescriptor *descr)
Removes the descriptor matching the given one from the collection.
PluginCollection * plugin_collection_new(void)
Creates a new plugin collection.
#define YAML_VALUE_PTR(cc, fields_schema)
Schema to be used as a pointer.
Definition yaml.h:202
#define YAML_FIELD_DYN_PTR_ARRAY_VAR_COUNT(owner, member, schema)
Dynamic-width (reallocated) array of pointers with variable count.
Definition yaml.h:81
Plugin collection used in the plugin browser.
Definition collection.h:28
char * description
Description of the collection (optional).
Definition collection.h:35
PluginDescriptor ** descriptors
Plugin descriptors.
Definition collection.h:38
char * name
Name of the collection.
Definition collection.h:32
YAML utils.