Zrythm
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
plugin_preset.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_PRESET_H__
11#define __PLUGINS_PLUGIN_PRESET_H__
12
14#include "utils/yaml.h"
15
22#define PLUGIN_BANK_SCHEMA_VERSION 1
23#define PLUGIN_PRESET_IDENTIFIER_SCHEMA_VERSION 1
24#define PLUGIN_PRESET_SCHEMA_VERSION 1
25
30{
31 int schema_version;
32
35 int idx;
36
39
43
44static const cyaml_schema_field_t plugin_preset_identifier_fields_schema[] = {
45 YAML_FIELD_INT (PluginPresetIdentifier, schema_version),
46 YAML_FIELD_INT (PluginPresetIdentifier, idx),
47 YAML_FIELD_INT (PluginPresetIdentifier, bank_idx),
50 plugin_id,
51 plugin_identifier_fields_schema),
52
53 CYAML_FIELD_END
54};
55
56static const cyaml_schema_value_t plugin_preset_identifier_schema = {
57 YAML_VALUE_PTR (PluginPresetIdentifier, plugin_preset_identifier_fields_schema),
58};
59
63typedef struct PluginPreset
64{
65 int schema_version;
66
68 char * name;
69
71 char * uri;
72
75
78
79static const cyaml_schema_field_t plugin_preset_fields_schema[] = {
80 YAML_FIELD_INT (PluginPreset, schema_version),
81 YAML_FIELD_STRING_PTR (PluginPreset, name),
82 YAML_FIELD_STRING_PTR_OPTIONAL (PluginPreset, uri),
83 YAML_FIELD_INT (PluginPreset, carla_program),
86 id,
87 plugin_preset_identifier_fields_schema),
88
89 CYAML_FIELD_END
90};
91
92static const cyaml_schema_value_t plugin_preset_schema = {
93 YAML_VALUE_PTR (PluginPreset, plugin_preset_fields_schema),
94};
95
102typedef struct PluginBank
103{
104 int schema_version;
105
108 int num_presets;
109 size_t presets_size;
110
112 char * uri;
113
115 char * name;
116
118} PluginBank;
119
120static const cyaml_schema_field_t plugin_bank_fields_schema[] = {
121 YAML_FIELD_INT (PluginBank, schema_version),
122 YAML_FIELD_DYN_PTR_ARRAY_VAR_COUNT_OPT (PluginBank, presets, plugin_preset_schema),
123 YAML_FIELD_STRING_PTR (PluginBank, name),
124 YAML_FIELD_STRING_PTR_OPTIONAL (PluginBank, uri),
127 id,
128 plugin_preset_identifier_fields_schema),
129
130 CYAML_FIELD_END
131};
132
133static const cyaml_schema_value_t plugin_bank_schema = {
134 YAML_VALUE_PTR (PluginBank, plugin_bank_fields_schema),
135};
136
138plugin_bank_new (void);
139
141plugin_preset_new (void);
142
143NONNULL void
144plugin_preset_identifier_init (PluginPresetIdentifier * id);
145
150#endif
#define YAML_FIELD_MAPPING_EMBEDDED(owner, member, schema)
Mapping embedded inside the struct.
Definition yaml.h:31
#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_OPT(owner, member, schema)
Dynamic-width (reallocated) array of pointers with variable count, nullable.
Definition yaml.h:127
Plugin identifier.
A plugin bank containing presets.
char * uri
URI if LV2.
char * name
Human readable name.
PluginPreset ** presets
Presets in this bank.
Plugin identifier.
Preset identifier.
int idx
Index in bank, or -1 if this is used for a bank.
PluginIdentifier plugin_id
Plugin identifier.
int bank_idx
Bank index in plugin.
Plugin preset.
char * uri
URI if LV2.
char * name
Human readable name.
int carla_program
Carla program index.
YAML utils.