Zrythm
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
undoable_action.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: © 2018-2022 Alexandros Theodotou <alex@zrythm.org>
2// SPDX-License-Identifier: LicenseRef-ZrythmLicense
3
10#ifndef __UNDO_UNDOABLE_ACTION_H__
11#define __UNDO_UNDOABLE_ACTION_H__
12
13#include "utils/types.h"
14#include "utils/yaml.h"
15
16typedef struct AudioClip AudioClip;
18
29{
30 /* ---- Track/Channel ---- */
31 UA_TRACKLIST_SELECTIONS,
32
33 UA_CHANNEL_SEND,
34
35 /* ---- end ---- */
36
37 UA_MIXER_SELECTIONS,
38 UA_ARRANGER_SELECTIONS,
39
40 /* ---- connections ---- */
41
42 UA_MIDI_MAPPING,
43 UA_PORT_CONNECTION,
44 UA_PORT,
45
46 /* ---- end ---- */
47
48 /* ---- range ---- */
49
50 UA_RANGE,
51
52 /* ---- end ---- */
53
54 UA_TRANSPORT,
55
56 UA_CHORD,
57};
58
98
99NONNULL void
100undoable_action_init_loaded (UndoableAction * self);
101
105NONNULL void
107
112NONNULL bool
114
123NONNULL bool
125
130NONNULL bool
132
133NONNULL void
134undoable_action_get_plugins (UndoableAction * self, GPtrArray * arr);
135
142NONNULL void
144
154NONNULL_ARGS (1)
156 UndoableAction * self,
157 bool _do,
158 PortConnectionsManager ** before,
159 PortConnectionsManager ** after);
160
168NONNULL_ARGS (1)
169int undoable_action_do (UndoableAction * self, GError ** error);
170
176NONNULL_ARGS (1)
177int undoable_action_undo (UndoableAction * self, GError ** error);
178
179void
180undoable_action_free (UndoableAction * self);
181
188NONNULL char *
190
195#endif
int undoable_action_undo(UndoableAction *self, GError **error)
Undoes the action.
NONNULL char * undoable_action_to_string(UndoableAction *ua)
Stringizes the action to be used in Undo/Redo buttons.
NONNULL void undoable_action_set_num_actions(UndoableAction *self, int num_actions)
Sets the number of actions for this action.
void undoable_action_save_or_load_port_connections(UndoableAction *self, bool _do, PortConnectionsManager **before, PortConnectionsManager **after)
To be used by actions that save/load port connections.
NONNULL bool undoable_action_needs_pause(UndoableAction *self)
Returns whether the action requires pausing the engine.
UndoableActionType
Type of UndoableAction.
NONNULL void undoable_action_init(UndoableAction *self, UndoableActionType type)
Initializer to be used by implementing actions.
NONNULL bool undoable_action_contains_clip(UndoableAction *self, AudioClip *clip)
Checks whether the action actually contains or refers to the given audio clip.
NONNULL bool undoable_action_can_contain_clip(UndoableAction *self)
Checks whether the action can contain an audio clip.
int undoable_action_do(UndoableAction *self, GError **error)
Performs the action.
NONNULL_ARGS(1) int undo_manager_undo(UndoManager *self
Undo last action.
uint32_t sample_rate_t
Sample rate.
Definition types.h:42
Audio clips for the pool.
Definition clip.h:31
Port connections manager.
Base struct to be inherited by implementing undoable actions.
int num_actions
Number of actions to perform.
UndoableActionType type
Undoable action type.
int stack_idx
Index in the stack.
double frames_per_tick
A snapshot of AudioEngine.frames_per_tick when the action is executed.
sample_rate_t sample_rate
Sample rate of this action.
Custom types.
YAML utils.