Deluge Firmware 1.3.0
Build date: 2025.04.16
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
24class LoadPatternUI final : public LoadUI {
25public:
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
52protected:
53 void folderContentsReady(int32_t entryDirection) override;
54 void currentFileChanged(int32_t movementDirection) override;
55 void enterKeyPress() override;
56
57private:
58 bool selectedDrumOnly;
59 bool previewOnly;
60 bool overwriteExisting;
61 bool noScaling;
62 std::string defaultDir;
63 Error setupForLoadingPattern();
64 Error currentLabelLoadError = Error::NONE;
65};
66
67extern LoadPatternUI loadPatternUI;
Definition load_pattern_ui.h:24
This class represents the colour format most used by the Deluge globally.
Definition rgb.h:14