Zrythm
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
chord_action.h
1// SPDX-FileCopyrightText: © 2022 Alexandros Theodotou <alex@zrythm.org>
2// SPDX-License-Identifier: LicenseRef-ZrythmLicense
3
4#ifndef __UNDO_CHORD_ACTION_H__
5#define __UNDO_CHORD_ACTION_H__
6
10
30
34typedef struct ChordAction
35{
36 UndoableAction parent_instance;
37
38 ChordActionType type;
39
40 ChordDescriptor * chord_before;
41 ChordDescriptor * chord_after;
42 int chord_idx;
43
46
49
51
52void
53chord_action_init_loaded (ChordAction * self);
54
62WARN_UNUSED_RESULT UndoableAction *
64 const ChordDescriptor ** chords_before,
65 const ChordDescriptor ** chords_after,
66 const ChordDescriptor * chord,
67 const int chord_idx,
68 GError ** error);
69
70NONNULL ChordAction *
71chord_action_clone (const ChordAction * src);
72
76bool
78 const ChordDescriptor ** chords_before,
79 const ChordDescriptor ** chords_after,
80 const ChordDescriptor * chord,
81 const int chord_idx,
82 GError ** error);
83
84int
85chord_action_do (ChordAction * self, GError ** error);
86
87int
88chord_action_undo (ChordAction * self, GError ** error);
89
90char *
91chord_action_stringize (ChordAction * self);
92
93void
94chord_action_free (ChordAction * self);
95
100#endif
Descriptors for chords.
Chord editor backend.
WARN_UNUSED_RESULT UndoableAction * chord_action_new(const ChordDescriptor **chords_before, const ChordDescriptor **chords_after, const ChordDescriptor *chord, const int chord_idx, GError **error)
Creates a new action.
bool chord_action_perform(const ChordDescriptor **chords_before, const ChordDescriptor **chords_after, const ChordDescriptor *chord, const int chord_idx, GError **error)
Wrapper to create action and perform it.
ChordActionType
Type of chord action.
@ CHORD_ACTION_ALL
Change all chords.
@ CHORD_ACTION_SINGLE
Change single chord.
Action for chord pad changes.
ChordDescriptor ** chords_after
Chords after the change.
ChordDescriptor ** chords_before
Chords before the change.
A ChordDescriptor describes a chord and is not linked to any specific object by itself.
Base struct to be inherited by implementing undoable actions.
Undoable actions.