Zrythm
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
chord_preset_pack.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: © 2022 Alexandros Theodotou <alex@zrythm.org>
3 *
4 * SPDX-License-Identifier: LicenseRef-ZrythmLicense
5 */
6
13#ifndef __SETTINGS_CHORD_PRESET_PACK_H__
14#define __SETTINGS_CHORD_PRESET_PACK_H__
15
16#include "zrythm-config.h"
17
18#include <stdbool.h>
19
21#include "utils/yaml.h"
22
29#define CHORD_PRESET_PACK_SCHEMA_VERSION 1
30
34typedef struct ChordPresetPack
35{
36 int schema_version;
37
39 char * name;
40
43 int num_presets;
44 size_t presets_size;
45
50
51static const cyaml_schema_field_t chord_preset_pack_fields_schema[] = {
52 YAML_FIELD_INT (ChordPresetPack, schema_version),
53 YAML_FIELD_STRING_PTR (ChordPresetPack, name),
56 presets,
57 chord_preset_schema),
58
59 CYAML_FIELD_END
60};
61
62static const cyaml_schema_value_t chord_preset_pack_schema = {
63 YAML_VALUE_PTR (ChordPresetPack, chord_preset_pack_fields_schema),
64};
65
67chord_preset_pack_new (const char * name, bool is_standard);
68
69bool
70chord_preset_pack_contains_name (const ChordPresetPack * self, const char * name);
71
72bool
73chord_preset_pack_contains_preset (
74 const ChordPresetPack * self,
75 const ChordPreset * pset);
76
81void
83
84void
85chord_preset_pack_delete_preset (ChordPresetPack * self, ChordPreset * pset);
86
87const char *
88chord_preset_pack_get_name (const ChordPresetPack * self);
89
90void
91chord_preset_pack_set_name (ChordPresetPack * self, const char * name);
92
94chord_preset_pack_clone (const ChordPresetPack * src);
95
96GMenuModel *
97chord_preset_pack_generate_context_menu (const ChordPresetPack * self);
98
99void
100chord_preset_pack_free (ChordPresetPack * self);
101
102void
103chord_preset_pack_destroy_cb (void * self);
104
109#endif
Chord preset.
void chord_preset_pack_add_preset(ChordPresetPack *self, const ChordPreset *pset)
#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
Chord preset pack.
ChordPreset ** presets
Presets.
bool is_standard
Whether this is a standard preset pack (not user-defined).
char * name
Pack name.
A preset of chord descriptors.
YAML utils.