Deluge Firmware 1.3.0
Build date: 2025.04.16
Loading...
Searching...
No Matches
operator_params.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/formatted_title.h"
22#include "gui/menu_item/menu_item.h"
23
24namespace deluge::gui::menu_item {
25
26class DxOperatorParams final : public MenuItem, public FormattedTitle {
27public:
28 using MenuItem::MenuItem;
29 DxOperatorParams(l10n::String newName, l10n::String title_format_str)
30 : MenuItem(newName), FormattedTitle(title_format_str) {}
31 [[nodiscard]] std::string_view getTitle() const override { return FormattedTitle::title(); }
32
33 void beginSession(MenuItem* navigatedBackwardFrom) override;
34 bool tryLoad(const char* path);
35 void drawPixelsForOled() override;
36 void readValueAgain() final;
37 void selectEncoderAction(int32_t offset) final;
39 void drawValue();
40
41 int op = 0;
42
43 int32_t currentValue = 0;
44 int scrollPos = 0; // Each instance needs to store this separately
45};
46
47extern DxOperatorParams dxOperatorParams;
48} // namespace deluge::gui::menu_item
Base class for all menu items.
Definition menu_item.h:39
Definition operator_params.h:26
void selectEncoderAction(int32_t offset) final
Handle select encoder movement.
Definition operator_params.cpp:74
void readValueAgain() final
Re-read the value from the system and redraw the display to match.
Definition operator_params.cpp:37
std::string_view getTitle() const override
Get the title to be used when rendering on OLED, both as a deluge::gui::menu_item::Submenu and when d...
Definition operator_params.h:31
MenuItem * selectButtonPress() final
Handle a select button press.
Definition operator_params.cpp:105
void drawPixelsForOled() override
Paints the pixels below the standard title block.
Definition operator_params.cpp:62
void beginSession(MenuItem *navigatedBackwardFrom) override
Begin an editing session with this menu item.
Definition operator_params.cpp:33