10#ifndef __UNDO_UNDO_MANAGER_H__
11#define __UNDO_UNDO_MANAGER_H__
25#define UNDO_MANAGER_SCHEMA_VERSION 1
27#define UNDO_MANAGER (PROJECT->undo_manager)
51static const cyaml_schema_field_t undo_manager_fields_schema[] = {
56 undo_stack_fields_schema),
60 undo_stack_fields_schema),
65static const cyaml_schema_value_t undo_manager_schema = {
111#define UNDO_MANAGER_PERFORM_AND_PROPAGATE_ERR( \
114 g_return_val_if_fail ( \
115 router_is_processing_thread (ROUTER) == false, false); \
116 UndoableAction * ua = action (__VA_ARGS__); \
120 undo_manager_perform (UNDO_MANAGER, ua, err); \
NONNULL void undo_manager_get_plugins(UndoManager *self, GPtrArray *arr)
Returns all plugins in the undo stacks.
NONNULL bool undo_manager_contains_clip(UndoManager *self, AudioClip *clip)
Returns whether the given clip is used by any stack.
int undo_manager_redo(UndoManager *self, GError **error)
Redo last undone action.
int undo_manager_perform(UndoManager *self, UndoableAction *action, GError **error)
Performs the action and pushes it to the undo stack.
WARN_UNUSED_RESULT UndoManager * undo_manager_new(void)
Inits the undo manager by creating the undo/redo stacks.
NONNULL void undo_manager_clear_stacks(UndoManager *self, bool free)
Clears the undo and redo stacks.
NONNULL UndoableAction * undo_manager_get_last_action(UndoManager *self)
Returns the last performed action, or NULL if the stack is empty.
int undo_manager_undo(UndoManager *self, GError **error)
Undo last action.
NONNULL void undo_manager_init_loaded(UndoManager *self)
Inits the undo manager by populating the undo/redo stacks.
COLD NONNULL_ARGS(1) void automation_track_init_loaded(AutomationTrack *self
Inits a loaded AutomationTracklist.
#define YAML_FIELD_MAPPING_PTR(owner, member, schema)
Mapping pointer to a struct.
#define YAML_VALUE_PTR(cc, fields_schema)
Schema to be used as a pointer.
Audio clips for the pool.
bool redo_stack_locked
Whether the redo stack is currently locked.
ZixSem action_sem
Semaphore for performing actions.
Serializable stack for undoable actions.
Base struct to be inherited by implementing undoable actions.