Zrythm
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
port_action.h
1// SPDX-FileCopyrightText: © 2020-2021 Alexandros Theodotou <alex@zrythm.org>
2// SPDX-License-Identifier: LicenseRef-ZrythmLicense
3
4#ifndef __ACTION_PORT_ACTION_H__
5#define __ACTION_PORT_ACTION_H__
6
9
21
22typedef struct PortAction
23{
24 UndoableAction parent_instance;
25
26 PortActionType type;
27
28 PortIdentifier port_id;
29
36 float val;
38
39void
40port_action_init_loaded (PortAction * self);
41
45WARN_UNUSED_RESULT UndoableAction *
47 PortActionType type,
48 PortIdentifier * port_id,
49 float val,
50 bool is_normalized,
51 GError ** error);
52
56WARN_UNUSED_RESULT UndoableAction *
57port_action_new_reset_control (PortIdentifier * port_id, GError ** error);
58
59NONNULL PortAction *
60port_action_clone (const PortAction * src);
61
62bool
63port_action_perform (
64 PortActionType type,
65 PortIdentifier * port_id,
66 float val,
67 bool is_normalized,
68 GError ** error);
69
70bool
71port_action_perform_reset_control (PortIdentifier * port_id, GError ** error);
72
73int
74port_action_do (PortAction * self, GError ** error);
75
76int
77port_action_undo (PortAction * self, GError ** error);
78
79char *
80port_action_stringize (PortAction * self);
81
82void
83port_action_free (PortAction * self);
84
89#endif
PortActionType
Definition port_action.h:17
WARN_UNUSED_RESULT UndoableAction * port_action_new(PortActionType type, PortIdentifier *port_id, float val, bool is_normalized, GError **error)
Create a new action.
WARN_UNUSED_RESULT UndoableAction * port_action_new_reset_control(PortIdentifier *port_id, GError **error)
Create a new action.
@ PORT_ACTION_SET_CONTROL_VAL
Set control port value.
Definition port_action.h:19
Port identifier.
float val
Real (not normalized) value before/after the change.
Definition port_action.h:36
Struct used to identify Ports in the project.
Base struct to be inherited by implementing undoable actions.
Undoable actions.