Deluge Firmware 1.3.0
Build date: 2025.04.16
Loading...
Searching...
No Matches
active_scales.h
1#pragma once
2
3#include "definitions_cxx.hpp"
4#include "gui/menu_item/menu_item.h"
5#include "model/scale/preset_scales.h"
6#include "model/song/song.h"
7#include "storage/flash_storage.h"
8
9#include <cstdint>
10
11namespace deluge::gui::menu_item {
12
13class ActiveScaleMenu : public MenuItem {
14public:
15 enum Kind { SONG, DEFAULT };
16 ActiveScaleMenu(deluge::l10n::String newName, Kind kind_) : MenuItem(newName), currentPos(0), kind(kind_) {}
17 void beginSession(MenuItem* navigatedBackwardFrom = nullptr) final;
18 void drawPixelsForOled() final;
19 void readValueAgain() final;
20 void selectEncoderAction(int32_t offset) final;
21 MenuItem* selectButtonPress() final;
22 void drawName() final;
23
24private:
25 void drawSubmenuItemsForOled(std::span<uint8_t> scales, const uint8_t selected);
26 bool isDisabled(uint8_t scaleIndex);
27 void setDisabled(uint8_t scaleIndex, bool value);
28 uint8_t currentPos;
29 Kind kind;
30};
31
32} // namespace deluge::gui::menu_item
void drawPixelsForOled() final
Paints the pixels below the standard title block.
Definition active_scales.cpp:36
void readValueAgain() final
Re-read the value from the system and redraw the display to match.
Definition active_scales.cpp:21
void beginSession(MenuItem *navigatedBackwardFrom=nullptr) final
Begin an editing session with this menu item.
Definition active_scales.cpp:17
void drawName() final
Draw the name we want to use when selecting this in a deluge::gui::menu_item::Submenu to the 7SEG.
Definition active_scales.cpp:32
MenuItem * selectButtonPress() final
Handle a select button press.
Definition active_scales.cpp:116
void selectEncoderAction(int32_t offset) final
Handle select encoder movement.
Definition active_scales.cpp:109