Deluge Firmware 1.3.0
Build date: 2025.04.16
Loading...
Searching...
No Matches
qwerty_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 "gui/ui/ui.h"
21#include "model/favourite/favourite_manager.h"
22#include "util/d_string.h"
23#include <cstdint>
24
25class QwertyUI : public UI {
26public:
27 QwertyUI() = default;
28 ActionResult padAction(int32_t x, int32_t y, int32_t velocity) override;
29 ActionResult horizontalEncoderAction(int32_t offset) override;
30 ActionResult timerCallback() override;
31 bool renderMainPads(uint32_t whichRows, RGB image[][kDisplayWidth + kSideBarWidth] = nullptr,
32 uint8_t occupancyMask[][kDisplayWidth + kSideBarWidth] = nullptr,
33 bool drawUndefinedArea = true) override {
34 return true;
35 }
36
37 static bool predictionInterrupted;
38 static String enteredText;
39
40protected:
41 bool opened() override;
42 virtual bool predictExtendedText() { return true; } // Returns whether we're allowed that new character.
43 void drawKeys();
44 virtual void processBackspace(); // May be called in card routine
45 virtual void enterKeyPress() = 0;
46
47 // This may be called in card routine so long as either !currentFileExists (which is always the case in a
48 // processBackspace()), or we are not LoadSongUI
49
50 char const* title;
51 void drawTextForOLEDEditing(int32_t textStartX, int32_t xPixelMax, int32_t yPixel, int32_t maxChars,
53
54 // 7SEG only
55 virtual void displayText(bool blinkImmediately = false);
56
57 // Favourites
58 void renderFavourites();
59
60 static uint8_t favouriteRow;
61 static constexpr uint8_t favouriteBankRow = 7;
62
63 static int16_t enteredTextEditPos;
64 static int32_t scrollPosHorizontal;
65 static bool favouritesVisible;
66 static bool banksVisible;
67
68private:
69 static uint8_t currentBank;
70 static std::optional<uint8_t> currentFavourite;
71 static FavouritesDefaultLayout favouritesLayoutSelected;
72};
This class represents the colour format most used by the Deluge globally.
Definition rgb.h:14
Definition d_string.h:46