Zrythm
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
transport_action.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: © 2020-2021 Alexandros Theodotou <alex@zrythm.org>
2// SPDX-License-Identifier: LicenseRef-ZrythmLicense
3
10#ifndef __ACTIONS_TRANSPORT_ACTION_H__
11#define __ACTIONS_TRANSPORT_ACTION_H__
12
14#include "dsp/transport.h"
15#include "utils/types.h"
16#include "utils/yaml.h"
17
24enum class TransportActionType
25{
26 TRANSPORT_ACTION_BPM_CHANGE,
27 TRANSPORT_ACTION_BEATS_PER_BAR_CHANGE,
28 TRANSPORT_ACTION_BEAT_UNIT_CHANGE,
29};
30
34typedef struct TransportAction
35{
36 UndoableAction parent_instance;
37
38 TransportActionType type;
39
40 bpm_t bpm_before;
41 bpm_t bpm_after;
42
43 int int_before;
44 int int_after;
45
49
54
55void
56transport_action_init_loaded (TransportAction * self);
57
58WARN_UNUSED_RESULT UndoableAction *
59transport_action_new_bpm_change (
60 bpm_t bpm_before,
61 bpm_t bpm_after,
62 bool already_done,
63 GError ** error);
64
65WARN_UNUSED_RESULT UndoableAction *
66transport_action_new_time_sig_change (
67 TransportActionType type,
68 int before,
69 int after,
70 bool already_done,
71 GError ** error);
72
73NONNULL TransportAction *
74transport_action_clone (const TransportAction * src);
75
76bool
77transport_action_perform_bpm_change (
78 bpm_t bpm_before,
79 bpm_t bpm_after,
80 bool already_done,
81 GError ** error);
82
83bool
84transport_action_perform_time_sig_change (
85 TransportActionType type,
86 int before,
87 int after,
88 bool already_done,
89 GError ** error);
90
91int
92transport_action_do (TransportAction * self, GError ** error);
93
94int
95transport_action_undo (TransportAction * self, GError ** error);
96
97char *
98transport_action_stringize (TransportAction * self);
99
100void
101transport_action_free (TransportAction * self);
102
107#endif
float bpm_t
The BPM type.
Definition types.h:54
Transport action.
bool musical_mode
Whether musical mode was enabled when this action was made.
bool already_done
Flag whether the action was already performed the first time.
Base struct to be inherited by implementing undoable actions.
Transport API.
Custom types.
Undoable actions.
YAML utils.