Deluge Firmware
1.3.0
Build date: 2026.08.29
Toggle main menu visibility
Loading...
Searching...
No Matches
load_pattern_ui.h
1
/*
2
* Copyright © 2018-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/ui/load/load_ui.h"
22
#include "hid/button.h"
23
24
class
LoadPatternUI final :
public
LoadUI {
25
public
:
26
LoadPatternUI() =
default
;
27
28
bool
getGreyoutColsAndRows(uint32_t* cols, uint32_t* rows)
override
;
29
bool
opened()
override
;
30
31
ActionResult buttonAction(deluge::hid::Button b,
bool
on,
bool
inCardRoutine)
override
;
32
ActionResult padAction(int32_t x, int32_t y, int32_t velocity)
override
;
33
void
selectEncoderAction(int8_t offset)
override
;
34
35
bool
renderMainPads(uint32_t whichRows,
RGB
image[][kDisplayWidth + kSideBarWidth] =
nullptr
,
36
uint8_t occupancyMask[][kDisplayWidth + kSideBarWidth] =
nullptr
,
bool
drawUndefinedArea =
true
,
37
int32_t navSys = -1) {
38
return
true
;
39
}
40
bool
renderSidebar(uint32_t whichRows,
RGB
image[][kDisplayWidth + kSideBarWidth],
41
uint8_t occupancyMask[][kDisplayWidth + kSideBarWidth])
override
{
42
return
true
;
43
}
44
45
Error performLoad();
46
47
void
setupLoadPatternUI(
bool
overwriteOnLoad =
true
,
bool
noScaling =
false
);
48
49
// ui
50
UIType
getUIType
()
override
{
return
UIType::LOAD_PATTERN; }
51
bool
canDisplayFavourites()
override
{
return
true
; }
52
53
protected
:
54
void
folderContentsReady(int32_t entryDirection)
override
;
55
void
currentFileChanged(int32_t movementDirection)
override
;
56
void
enterKeyPress()
override
;
57
58
private
:
59
bool
selectedDrumOnly;
60
bool
previewOnly;
61
bool
overwriteExisting;
62
bool
noScaling;
63
std::string defaultDir;
64
Error setupForLoadingPattern();
65
Error currentLabelLoadError = Error::NONE;
66
};
67
68
extern
LoadPatternUI
loadPatternUI;
LoadPatternUI
Definition
load_pattern_ui.h:24
LoadPatternUI::getUIType
UIType getUIType() override
What type of UI is this? e.g. UIType::ARRANGER.
Definition
load_pattern_ui.h:50
RGB
This class represents the colour format most used by the Deluge globally.
Definition
rgb.h:14