Deluge Firmware
1.3.0
Build date: 2026.08.29
Toggle main menu visibility
Loading...
Searching...
No Matches
action_logger.h
1
/*
2
* Copyright © 2017-2023 Synthstrom Audible Limited
3
*
4
* This file is part of The Synthstrom Audible Deluge Firmware.
5
*
6
* The Synthstrom Audible Deluge Firmware is free software: you can redistribute it and/or modify it under the
7
* terms of the GNU General Public License as published by the Free Software Foundation,
8
* either version 3 of the License, or (at your option) any later version.
9
*
10
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
11
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12
* See the GNU General Public License for more details.
13
*
14
* You should have received a copy of the GNU General Public License along with this program.
15
* If not, see <https://www.gnu.org/licenses/>.
16
*/
17
18
#pragma once
19
20
#include "definitions_cxx.hpp"
21
#include "gui/views/performance_view.h"
22
#include "model/action/action.h"
23
#include <cstdint>
24
25
class
ParamCollection
;
26
class
Sound
;
27
class
ModelStack
;
28
29
enum class
ActionAddition {
30
NOT_ALLOWED,
31
ALLOWED,
32
ALLOWED_ONLY_IF_NO_TIME_PASSED,
33
};
34
35
class
ActionLogger {
36
public
:
37
ActionLogger();
38
39
// warning - super not thread safe
40
Action
* getNewAction(ActionType newActionType,
41
ActionAddition addToExistingIfPossible = ActionAddition::NOT_ALLOWED);
42
void
recordUnautomatedParamChange(
ModelStackWithAutoParam
const
* modelStack,
43
ActionType actionType = ActionType::PARAM_UNAUTOMATED_VALUE_CHANGE);
44
void
recordSwingChange(int8_t swingBefore, int8_t swingAfter);
45
void
recordTempoChange(uint64_t timePerBigBefore, uint64_t timePerBigAfter);
46
void
recordPerformanceViewPress
(
FXColumnPress
fxPressBefore[kDisplayWidth],
47
FXColumnPress
fxPressAfter[kDisplayWidth], int32_t xDisplay);
48
void
closeAction(ActionType actionType);
49
void
closeActionUnlessCreatedJustNow(ActionType actionType);
50
void
deleteAllLogs();
51
void
deleteLog(int32_t time);
52
bool
revert(TimeType time,
bool
updateVisually =
true
,
bool
doNavigation =
true
);
53
void
updateAction(
Action
* newAction);
54
void
undo();
55
void
redo();
56
bool
undoJustOneConsequencePerNoteRow(
ModelStack
* modelStack);
57
bool
allowedToDoReversion();
58
void
notifyClipRecordingAborted(
Clip
* clip);
59
60
Action
* firstAction[2];
61
62
private
:
63
void
revertAction(
Action
* action,
bool
updateVisually,
bool
doNavigation, TimeType time);
64
void
deleteLastActionIfEmpty();
65
void
deleteLastAction();
66
};
67
68
extern
ActionLogger
actionLogger;
ActionLogger
Definition
action_logger.h:35
ActionLogger::recordPerformanceViewPress
void recordPerformanceViewPress(FXColumnPress fxPressBefore[kDisplayWidth], FXColumnPress fxPressAfter[kDisplayWidth], int32_t xDisplay)
Record Performance View Hold Press.
Definition
action_logger.cpp:302
Action
Definition
action.h:79
Clip
Definition
clip.h:46
ModelStackWithAutoParam
Definition
model_stack.h:269
ModelStack
Definition
model_stack.h:123
ParamCollection
Definition
param_collection.h:39
Sound
Definition
sound.h:71
FXColumnPress
Definition
performance_view.h:41