Zrythm
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
mixer_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 __GUI_BACKEND_MIXER_SELECTIONS_H__
11#define __GUI_BACKEND_MIXER_SELECTIONS_H__
12
14#include "dsp/channel.h"
15#include "dsp/midi_region.h"
16#include "dsp/region.h"
17
18typedef struct Plugin Plugin;
19
26#define MIXER_SELECTIONS_SCHEMA_VERSION 1
27
28#define MIXER_SELECTIONS (PROJECT->mixer_selections)
29
30#define MIXER_SELECTIONS_MAX_SLOTS 60
31
36typedef struct MixerSelections
37{
38 int schema_version;
39
40 ZPluginSlotType type;
41
43 int slots[MIXER_SELECTIONS_MAX_SLOTS];
44
46 Plugin * plugins[MIXER_SELECTIONS_MAX_SLOTS];
47
48 int num_slots;
49
51 unsigned int track_name_hash;
52
56
57void
58mixer_selections_init_loaded (MixerSelections * ms, bool is_project);
59
61mixer_selections_new (void);
62
63void
64mixer_selections_init (MixerSelections * self);
65
73mixer_selections_clone (const MixerSelections * src, bool src_is_project);
74
78int
80
84int
86
90int
92
93void
94mixer_selections_post_deserialize (MixerSelections * self);
95
100NONNULL bool
102 MixerSelections * self,
103 Channel * ch,
104 ZPluginSlotType type,
105 int slot);
106
111NONNULL void
113 MixerSelections * ms,
114 Channel * ch,
115 ZPluginSlotType type,
116 int slot);
117
121Track *
123
127bool
129 MixerSelections * ms,
130 ZPluginSlotType type,
131 int slot);
132
136bool
138
139bool
140mixer_selections_contains_uninstantiated_plugin (
141 const MixerSelections * const self);
142
154void
156 MixerSelections * ms,
157 Track * track,
158 ZPluginSlotType type,
159 int slot,
160 bool clone_pl,
161 const bool fire_events);
162
169NONNULL void
171 MixerSelections * ms,
172 int slot,
173 ZPluginSlotType type,
174 bool publish_events);
175
181NONNULL void
183
188NONNULL Plugin *
190
196int
198 const MixerSelections * const self,
199 GPtrArray * arr,
200 bool from_cache);
201
202NONNULL bool
203mixer_selections_validate (MixerSelections * self);
204
208NONNULL void
209mixer_selections_clear (MixerSelections * ms, const int pub_events);
210
211NONNULL void
212mixer_selections_free (MixerSelections * self);
213
218#endif
Automation point API.
API for Channel, representing a channel strip on the mixer.
A region in the timeline.
Track * mixer_selections_get_track(const MixerSelections *const self)
Get current Track.
NONNULL Plugin * mixer_selections_get_first_plugin(MixerSelections *self)
Returns the first selected plugin if any is selected, otherwise NULL.
int mixer_selections_get_lowest_slot(MixerSelections *ms)
Gets lowest slot in the selections.
MixerSelections * mixer_selections_clone(const MixerSelections *src, bool src_is_project)
Clone the struct for copying, undoing, etc.
NONNULL void mixer_selections_paste_to_slot(MixerSelections *ms, Channel *ch, ZPluginSlotType type, int slot)
Paste the selections starting at the slot in the given channel.
NONNULL void mixer_selections_sort(MixerSelections *self, bool asc)
Sorts the selections by slot index.
int mixer_selections_has_any(MixerSelections *ms)
Returns if there are any selections.
bool mixer_selections_contains_plugin(MixerSelections *ms, Plugin *pl)
Returns if the plugin is selected or not.
NONNULL bool mixer_selections_can_be_pasted(MixerSelections *self, Channel *ch, ZPluginSlotType type, int slot)
Returns whether the selections can be pasted to MixerWidget.paste_slot.
bool mixer_selections_contains_slot(MixerSelections *ms, ZPluginSlotType type, int slot)
Returns if the slot is selected or not.
NONNULL void mixer_selections_clear(MixerSelections *ms, const int pub_events)
Clears selections.
void mixer_selections_add_slot(MixerSelections *ms, Track *track, ZPluginSlotType type, int slot, bool clone_pl, const bool fire_events)
Adds a slot to the selections.
NONNULL void mixer_selections_remove_slot(MixerSelections *ms, int slot, ZPluginSlotType type, bool publish_events)
Removes a slot from the selections.
int mixer_selections_get_plugins(const MixerSelections *const self, GPtrArray *arr, bool from_cache)
Fills in the array with the plugins in the selections.
int mixer_selections_get_highest_slot(MixerSelections *ms)
Gets highest slot in the selections.
ZPluginSlotType
API for Region's specific to instrument Track's.
A Channel is part of a Track (excluding Tracks that don't have Channels) and contains information rel...
Definition channel.h:57
Selections to be used for the timeline's current selections, copying, undoing, etc.
int slots[MIXER_SELECTIONS_MAX_SLOTS]
Slots selected.
Plugin * plugins[MIXER_SELECTIONS_MAX_SLOTS]
Cache, used in actions.
int has_any
Whether any slot is selected.
unsigned int track_name_hash
Channel selected.
The base plugin Inheriting plugins must have this as a child.
Definition plugin.h:74
Track to be inserted into the Project's Tracklist.
Definition track.h:177