Zrythm
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
clip_editor.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: © 2019-2021 Alexandros Theodotou <alex@zrythm.org>
2// SPDX-License-Identifier: LicenseRef-ZrythmLicense
3
10#ifndef __GUI_BACKEND_CLIP_EDITOR_H__
11#define __GUI_BACKEND_CLIP_EDITOR_H__
12
13#include <stdbool.h>
14
20
21typedef struct ZRegion ZRegion;
23
30#define CLIP_EDITOR_SCHEMA_VERSION 1
31
32#define CLIP_EDITOR (PROJECT->clip_editor)
33
40typedef struct ClipEditor
41{
42 int schema_version;
43
47
50
51 PianoRoll * piano_roll;
52 AudioClipEditor * audio_clip_editor;
53 AutomationEditor * automation_editor;
54 ChordEditor * chord_editor;
55
59
60 /* --- caches --- */
61 ZRegion * region;
62
63 Track * track;
65
66static const cyaml_schema_field_t clip_editor_fields_schema[] = {
67 YAML_FIELD_INT (ClipEditor, schema_version),
70 region_id,
71 region_identifier_fields_schema),
72 YAML_FIELD_INT (ClipEditor, has_region),
75 piano_roll,
76 piano_roll_fields_schema),
79 automation_editor,
80 automation_editor_fields_schema),
83 chord_editor,
84 chord_editor_fields_schema),
87 audio_clip_editor,
88 audio_clip_editor_fields_schema),
89
90 CYAML_FIELD_END
91};
92
93static const cyaml_schema_value_t clip_editor_schema = {
94 YAML_VALUE_PTR (ClipEditor, clip_editor_fields_schema),
95};
96
100void
102
106void
108
114
121void
123 ClipEditor * self,
124 ZRegion * region,
125 bool fire_events);
126
127ZRegion *
128clip_editor_get_region (ClipEditor * self);
129
131clip_editor_get_arranger_selections (ClipEditor * self);
132
133#if 0
138ZRegion *
139clip_editor_get_region_for_widgets (
140 ClipEditor * self);
141#endif
142
143Track *
144clip_editor_get_track (ClipEditor * self);
145
149void
151
153clip_editor_clone (const ClipEditor * src);
154
155void
156clip_editor_free (ClipEditor * self);
157
162#endif
Audio clip editor backend.
Automation editor backend.
Chord editor backend.
void clip_editor_set_caches(ClipEditor *self)
To be called when recalculating the graph.
ClipEditor * clip_editor_new(void)
Creates a new clip editor.
void clip_editor_set_region(ClipEditor *self, ZRegion *region, bool fire_events)
Sets the track and refreshes the piano roll widgets.
void clip_editor_init_loaded(ClipEditor *self)
Inits the ClipEditor after a Project is loaded.
void clip_editor_init(ClipEditor *self)
Inits the clip editor.
#define YAML_FIELD_MAPPING_EMBEDDED(owner, member, schema)
Mapping embedded inside the struct.
Definition yaml.h:32
#define YAML_FIELD_MAPPING_PTR(owner, member, schema)
Mapping pointer to a struct.
Definition yaml.h:39
#define YAML_VALUE_PTR(cc, fields_schema)
Schema to be used as a pointer.
Definition yaml.h:221
Piano roll backend.
Region identifier.
Audio clip editor serializable backend.
Backend for the automation editor.
Backend for the chord editor.
Clip editor serializable backend.
Definition clip_editor.h:41
int region_changed
Flag used by rulers when region first changes.
Definition clip_editor.h:58
bool has_region
Whether region_id is a valid region.
Definition clip_editor.h:49
RegionIdentifier region_id
ZRegion currently attached to the clip editor.
Definition clip_editor.h:46
Piano roll serializable backend.
Definition piano_roll.h:166
Index/identifier for a Region, so we can get Region objects quickly with it without searching by name...
Track to be inserted into the Project's Tracklist.
Definition track.h:193
A region (clip) is an object on the timeline that contains either MidiNote's or AudioClip's.
Definition region.h:78