Zrythm
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
tracklist_selections.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: © 2019-2023 Alexandros Theodotou <alex@zrythm.org>
2// SPDX-License-Identifier: LicenseRef-ZrythmLicense
3
10#ifndef __ACTIONS_TRACKLIST_SELECTIONS_H__
11#define __ACTIONS_TRACKLIST_SELECTIONS_H__
12
13#include "dsp/track.h"
14#include "utils/yaml.h"
15
16typedef enum TracklistSelectionsActionType
17 TracklistSelectionsActionType;
19
26#define TRACKLIST_SELECTIONS_SCHEMA_VERSION 2
27
28#define TRACKLIST_SELECTIONS (PROJECT->tracklist_selections)
29
38typedef struct TracklistSelections
39{
40 int schema_version;
41
43 Track * tracks[600];
44 int num_tracks;
45
48
56
57static const cyaml_schema_field_t
58 tracklist_selections_fields_schema[] = {
59 YAML_FIELD_INT (TracklistSelections, schema_version),
62 tracks,
63 track_schema),
64 YAML_FIELD_INT (TracklistSelections, is_project),
65
66 CYAML_FIELD_END
67 };
68
69static const cyaml_schema_value_t tracklist_selections_schema = {
72 tracklist_selections_fields_schema),
73};
74
75void
76tracklist_selections_init_loaded (TracklistSelections * ts);
77
83tracklist_selections_new (bool is_project);
84
91 GError ** error);
92
99Track *
101 TracklistSelections * self);
102
109Track *
111 TracklistSelections * self);
112
113void
114tracklist_selections_add_track (
115 TracklistSelections * self,
116 Track * track,
117 bool fire_events);
118
119void
120tracklist_selections_add_tracks_in_range (
121 TracklistSelections * self,
122 int min_pos,
123 int max_pos,
124 bool fire_events);
125
129void
131 TracklistSelections * self,
132 const bool fire_events);
133
138void
140 TracklistSelections * self);
141
145void
147 Track * track,
148 bool ctrl,
149 bool shift,
150 bool dragged);
151
152bool
153tracklist_selections_contains_uninstantiated_plugin (
154 const TracklistSelections * self);
155
156bool
157tracklist_selections_contains_undeletable_track (
158 const TracklistSelections * self);
159
160bool
161tracklist_selections_contains_uncopyable_track (
162 const TracklistSelections * self);
163
168bool
170 const TracklistSelections * self);
171
180bool
182 TracklistSelections * self,
183 bool soloed);
184
193bool
195 TracklistSelections * self,
196 bool listened);
197
206bool
208 TracklistSelections * self,
209 bool muted);
210
211bool
212tracklist_selections_contains_enabled_track (
213 TracklistSelections * self,
214 bool enabled);
215
219bool
221 TracklistSelections * self,
222 Track * track);
223
224bool
225tracklist_selections_contains_track_index (
226 TracklistSelections * self,
227 int track_idx);
228
229void
230tracklist_selections_remove_track (
232 Track * track,
233 int fire_events);
234
239void
242 Track * track,
243 bool fire_events);
244
250void
253 int visible_only);
254
259void
262
266void
269
273void
275
279void
281
286void
288 TracklistSelections * self);
289
290void
291tracklist_selections_paste_to_pos (
293 int pos);
294
300void
302 TracklistSelections * self,
303 bool asc);
304
305NONNULL void
306tracklist_selections_get_plugins (
307 TracklistSelections * self,
308 GPtrArray * arr);
309
319void
322 bool with_parents,
323 bool mark_master);
324
325void
326tracklist_selections_free (TracklistSelections * self);
327
332#endif
The backend for a timeline track.
EditTracksActionType
Action type.
COLD NONNULL_ARGS(1) void automation_track_init_loaded(AutomationTrack *self
Inits a loaded AutomationTracklist.
void tracklist_selections_clear(TracklistSelections *self, const bool fire_events)
Clears the selections.
void tracklist_selections_select_all(TracklistSelections *ts, int visible_only)
Selects all Track's.
Track * tracklist_selections_get_lowest_track(TracklistSelections *self)
Gets lowest track in the selections.
bool tracklist_selections_contains_non_automatable_track(const TracklistSelections *self)
Returns whether the tracklist selections contains a track that cannot have automation lanes.
void tracklist_selections_select_foldable_children(TracklistSelections *self)
Make sure all children of foldable tracks in the selection are also selected.
void tracklist_selections_print(TracklistSelections *self)
For debugging.
bool tracklist_selections_contains_muted_track(TracklistSelections *self, bool muted)
Returns whether the selections contain a muted track if muted is true or an unmuted track if muted is...
bool tracklist_selections_contains_listened_track(TracklistSelections *self, bool listened)
Returns whether the selections contain a listened track if listened is true or an unlistened track if...
void tracklist_selections_select_last_visible(TracklistSelections *ts)
Selects the last visible track after clearing the selections.
void tracklist_selections_select_single(TracklistSelections *ts, Track *track, bool fire_events)
Selects a single track after clearing the selections.
void tracklist_selections_handle_click(Track *track, bool ctrl, bool shift, bool dragged)
Handle a click selection.
void tracklist_selections_mark_for_bounce(TracklistSelections *ts, bool with_parents, bool mark_master)
Marks the tracks to be bounced.
TracklistSelections * tracklist_selections_new(bool is_project)
bool tracklist_selections_contains_soloed_track(TracklistSelections *self, bool soloed)
Returns whether the selections contain a soloed track if soloed is true or an unsoloed track if soloe...
void tracklist_selections_sort(TracklistSelections *self, bool asc)
Sorts the tracks by position.
Track * tracklist_selections_get_highest_track(TracklistSelections *self)
Gets highest track in the selections.
void tracklist_selections_toggle_visibility(TracklistSelections *ts)
Toggle visibility of the selected tracks.
bool tracklist_selections_contains_track(TracklistSelections *self, Track *track)
Returns if the Track is selected or not.
TracklistSelections * tracklist_selections_clone(TracklistSelections *src, GError **error)
Clone the struct for copying, undoing, etc.
void tracklist_selections_toggle_pinned(TracklistSelections *ts)
Toggle pin/unpin of the selected tracks.
void tracklist_selections_post_deserialize(TracklistSelections *self)
To be called after receiving tracklist selections from the clipboard.
#define YAML_VALUE_PTR(cc, fields_schema)
Schema to be used as a pointer.
Definition yaml.h:221
#define YAML_FIELD_FIXED_SIZE_PTR_ARRAY_VAR_COUNT(owner, member, schema)
Fixed-width array of pointers with variable count.
Definition yaml.h:60
Track to be inserted into the Project's Tracklist.
Definition track.h:193
Selections to be used for the tracklist's current selections, copying, undoing, etc.
bool free_tracks
Flag to free tracks even if these are the project selections (e.g.
Track * tracks[600]
Selected Tracks.
bool is_project
Whether these are the project selections.
YAML utils.