Zrythm
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
audio_selections.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: © 2020-2023 Alexandros Theodotou <alex@zrythm.org>
2// SPDX-License-Identifier: LicenseRef-ZrythmLicense
3
10#ifndef __GUI_BACKEND_AUDIO_SELECTIONS_H__
11#define __GUI_BACKEND_AUDIO_SELECTIONS_H__
12
13#include "dsp/position.h"
16#include "utils/yaml.h"
17
18typedef struct ZRegion ZRegion;
19
26#define AUDIO_SELECTIONS_SCHEMA_VERSION 1
27
28#define AUDIO_SELECTIONS (PROJECT->audio_selections)
29
36typedef struct AudioSelections
37{
39
40 int schema_version;
41
44
58 Position sel_end;
59
67
75
77
78static const cyaml_schema_field_t audio_selections_fields_schema[] = {
81 base,
82 arranger_selections_fields_schema),
83 YAML_FIELD_INT (AudioSelections, schema_version),
84 YAML_FIELD_INT (AudioSelections, has_selection),
87 sel_start,
88 position_fields_schema),
91 sel_end,
92 position_fields_schema),
93 YAML_FIELD_INT (AudioSelections, pool_id),
96 region_id,
97 region_identifier_fields_schema),
98
99 CYAML_FIELD_END
100};
101
102static const cyaml_schema_value_t audio_selections_schema = {
105 audio_selections_fields_schema),
106};
107
114void
116 AudioSelections * self,
117 bool has_range);
118
125bool
127 AudioSelections * ts,
128 Position * pos,
129 ZRegion * r);
130
135#endif
void audio_selections_set_has_range(AudioSelections *self, bool has_range)
Sets whether a range selection exists and sends events to update the UI.
bool audio_selections_can_be_pasted(AudioSelections *ts, Position *pos, ZRegion *r)
Returns if the selections can be pasted.
#define YAML_FIELD_MAPPING_EMBEDDED(owner, member, schema)
Mapping embedded inside the struct.
Definition yaml.h:32
#define YAML_VALUE_PTR(cc, fields_schema)
Schema to be used as a pointer.
Definition yaml.h:221
Common data structures and functions for *ArrangerSelections.
Position struct and API.
Region identifier.
Selections to be used for the AudioArrangerWidget's current selections, copying, undoing,...
RegionIdentifier region_id
Identifier of the current region.
bool has_selection
Whether or not a selection exists.
int pool_id
Audio pool ID of the associated audio file, used during serialization.
Position sel_start
Selected range.
A Position is made up of bars.beats.sixteenths.ticks.
Definition position.h:137
Index/identifier for a Region, so we can get Region objects quickly with it without searching by name...
A region (clip) is an object on the timeline that contains either MidiNote's or AudioClip's.
Definition region.h:78
YAML utils.