Deluge Firmware
1.3.0
Build date: 2025.04.16
Loading...
Searching...
No Matches
cartridge.h
1
2
/*
3
* Copyright © 2015-2023 Synthstrom Audible Limited
4
*
5
* This file is part of The Synthstrom Audible Deluge Firmware.
6
*
7
* The Synthstrom Audible Deluge Firmware is free software: you can redistribute it and/or modify it under the
8
* terms of the GNU General Public License as published by the Free Software Foundation,
9
* either version 3 of the License, or (at your option) any later version.
10
*
11
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
12
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13
* See the GNU General Public License for more details.
14
*
15
* You should have received a copy of the GNU General Public License along with this program.
16
* If not, see <https://www.gnu.org/licenses/>.
17
*/
18
19
#pragma once
20
21
#include "gui/menu_item/menu_item.h"
22
#include <string_view>
23
24
class
DX7Cartridge
;
25
26
namespace
deluge::gui::menu_item {
27
28
class
DxCartridge final :
public
MenuItem {
29
public
:
30
using
MenuItem::MenuItem;
31
DxCartridge(l10n::String newName) : MenuItem(newName), pd(
nullptr
) {}
32
void
beginSession
(MenuItem* navigatedBackwardFrom)
override
;
33
bool
tryLoad(std::string_view path);
34
void
drawPixelsForOled
()
override
;
35
void
readValueAgain
()
final
;
36
void
selectEncoderAction
(int32_t offset)
final
;
37
MenuItem*
selectButtonPress
()
final
;
38
void
drawValue();
39
40
// this thing is big. allocate external mem on demand
41
DX7Cartridge
* pd;
42
43
int32_t currentValue = 0;
44
int
scrollPos = 0;
// Each instance needs to store this separately
45
};
46
47
extern
DxCartridge
dxCartridge;
48
}
// namespace deluge::gui::menu_item
DX7Cartridge
Definition
DX7Cartridge.h:37
deluge::gui::menu_item::DxCartridge
Definition
cartridge.h:28
deluge::gui::menu_item::DxCartridge::drawPixelsForOled
void drawPixelsForOled() override
Paints the pixels below the standard title block.
Definition
cartridge.cpp:112
deluge::gui::menu_item::DxCartridge::selectEncoderAction
void selectEncoderAction(int32_t offset) final
Handle select encoder movement.
Definition
cartridge.cpp:143
deluge::gui::menu_item::DxCartridge::beginSession
void beginSession(MenuItem *navigatedBackwardFrom) override
Begin an editing session with this menu item.
Definition
cartridge.cpp:84
deluge::gui::menu_item::DxCartridge::selectButtonPress
MenuItem * selectButtonPress() final
Handle a select button press.
Definition
cartridge.cpp:175
deluge::gui::menu_item::DxCartridge::readValueAgain
void readValueAgain() final
Re-read the value from the system and redraw the display to match.
Definition
cartridge.cpp:88