Deluge Firmware
Loading...
Searching...
No Matches
uitimermanager.h
Go to the documentation of this file.
1/*
2 * Copyright © 2014-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#ifndef UITIMERMANAGER_H
19#define UITIMERMANAGER_H
20
21#include "definitions.h"
22
23#define TIMER_DISPLAY 0
24#define TIMER_MIDI_LEARN_FLASH 1
25#define TIMER_DEFAULT_ROOT_NOTE 2
26#define TIMER_TAP_TEMPO_SWITCH_OFF 3
27#define TIMER_PLAY_ENABLE_FLASH 4
28#define TIMER_LED_BLINK 5
29#define TIMER_LED_BLINK_TYPE_1 6
30#define TIMER_LEVEL_INDICATOR_BLINK 7
31#define TIMER_SHORTCUT_BLINK 8
32#define TIMER_MATRIX_DRIVER 9
33#define TIMER_UI_SPECIFIC 10
34#define TIMER_DISPLAY_AUTOMATION 11
35#define TIMER_READ_INPUTS 12
36#define TIMER_BATT_LED_BLINK 13
37#define TIMER_GRAPHICS_ROUTINE 14
38
39#if HAVE_OLED
40#define TIMER_OLED_LOW_LEVEL 15
41#define TIMER_OLED_CONSOLE 16
42#define TIMER_OLED_SCROLLING_AND_BLINKING 17
43#define NUM_TIMERS 18
44
45#else
46#define NUM_TIMERS 15
47#endif
48
49
50struct Timer {
51 bool active;
52 uint32_t triggerTime;
53};
54
55
57{
58public:
60
61 void routine();
62 void setTimer(int i, int ms);
63 void setTimerSamples(int i, int samples);
64 void unsetTimer(int i);
65
66 bool isTimerSet(int i);
67 void setTimerByOtherTimer(int i, int j);
68
70private:
71
72 uint32_t timeNextEvent;
73 void workOutNextEventTime();
74};
75
77
78#endif // UITIMERMANAGER_H
Definition: uitimermanager.h:57
void setTimerByOtherTimer(int i, int j)
Definition: uitimermanager.cpp:178
void setTimerSamples(int i, int samples)
Definition: uitimermanager.cpp:168
void setTimer(int i, int ms)
Definition: uitimermanager.cpp:164
UITimerManager()
Definition: uitimermanager.cpp:46
Timer timers[NUM_TIMERS]
Definition: uitimermanager.h:69
void routine()
Definition: uitimermanager.cpp:55
bool isTimerSet(int i)
Definition: uitimermanager.cpp:188
void unsetTimer(int i)
Definition: uitimermanager.cpp:183
Definition: uitimermanager.h:50
bool active
Definition: uitimermanager.h:51
uint32_t triggerTime
Definition: uitimermanager.h:52
#define NUM_TIMERS
Definition: uitimermanager.h:46
UITimerManager uiTimerManager
Definition: uitimermanager.cpp:42