Deluge Firmware 1.3.0
Build date: 2025.06.05
Loading...
Searching...
No Matches
source_selection.h
1/*
2 * Copyright © 2014-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#include "definitions_cxx.hpp"
20#include "value.h"
21
22class ParamDescriptor;
23
24namespace deluge::gui::menu_item {
25class SourceSelection : public Value<int32_t> {
26public:
27 using Value::Value;
28 void beginSession(MenuItem* navigatedBackwardFrom = nullptr) override;
29 void selectEncoderAction(int32_t offset) final;
30 virtual ParamDescriptor getDestinationDescriptor() = 0;
31 uint8_t getIndexOfPatchedParamToBlink() final;
32 uint8_t shouldBlinkPatchingSourceShortcut(PatchSource s, uint8_t* colour) final;
33 void readValueAgain() final;
34
35 void drawPixelsForOled();
36 static int32_t selectedRowOnScreen;
37 int32_t scrollPos; // Each instance needs to store this separately
38
39 // 7seg only
40 void drawValue() override;
41
42 PatchSource s;
43
44protected:
45 bool sourceIsAllowed(PatchSource source);
46 uint8_t shouldDrawDotOnValue();
47};
48} // namespace deluge::gui::menu_item
Definition param_descriptor.h:27
Definition source_selection.h:25
void beginSession(MenuItem *navigatedBackwardFrom=nullptr) override
Begin an editing session with this menu item.
Definition source_selection.cpp:167
void readValueAgain() final
Re-read the value from the system and redraw the display to match.
Definition source_selection.cpp:213
uint8_t shouldBlinkPatchingSourceShortcut(PatchSource s, uint8_t *colour) final
Definition source_selection.cpp:301
void selectEncoderAction(int32_t offset) final
Handle select encoder movement.
Definition source_selection.cpp:222
void drawPixelsForOled()
Paints the pixels below the standard title block.
Definition source_selection.cpp:57
uint8_t getIndexOfPatchedParamToBlink() final
Definition source_selection.cpp:297
Definition value.h:27