Deluge Firmware 1.3.0
Build date: 2026.08.29
Loading...
Searching...
No Matches
hide_unlabeled.h
1/*
2 * Copyright (c) 2024 Sean Ditny
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/menu_item/toggle.h"
21#include "gui/ui/sound_editor.h"
22#include "model/instrument/midi_instrument.h"
23#include "model/output.h"
24#include "model/song/song.h"
25
26namespace deluge::gui::menu_item::midi::device_definition {
27
28class HideUnlabeled : public Toggle {
29public:
30 using Toggle::Toggle;
31
32 void readCurrentValue() override {
33 MIDIInstrument* midiInstrument = (MIDIInstrument*)getCurrentOutput();
34 this->setValue(midiInstrument->hideUnlabeledCC);
35 }
36 void writeCurrentValue() override {
37 t = this->getValue();
38
39 MIDIInstrument* midiInstrument = (MIDIInstrument*)getCurrentOutput();
40 midiInstrument->hideUnlabeledCC = t;
41 }
42
43 bool isRelevant(ModControllableAudio* modControllable, int32_t whichThing) {
44 Output* output = getCurrentOutput();
45 return (output && output->type == OutputType::MIDI_OUT);
46 }
47
48 void renderSubmenuItemTypeForOled(int32_t yPixel) final {
49 deluge::hid::display::oled_canvas::Canvas& image = deluge::hid::display::OLED::main;
50
51 int32_t startX = getSubmenuItemTypeRenderIconStart();
52
53 if (getToggleValue()) {
54 image.drawGraphicMultiLine(deluge::hid::display::OLED::checkedBoxIcon, startX, yPixel,
55 kSubmenuIconSpacingX);
56 }
57 else {
58 image.drawGraphicMultiLine(deluge::hid::display::OLED::uncheckedBoxIcon, startX, yPixel,
59 kSubmenuIconSpacingX);
60 }
61 }
62
63 bool t;
64};
65
66} // namespace deluge::gui::menu_item::midi::device_definition
Definition midi_instrument.h:38
Definition mod_controllable_audio.h:47
Definition output.h:81
Definition toggle.h:8
void readCurrentValue() override
Like readValueAgain, but does not redraw.
Definition hide_unlabeled.h:32
bool isRelevant(ModControllableAudio *modControllable, int32_t whichThing)
Check if this MenuItem should show up in a containing deluge::gui::menu_item::Submenu.
Definition hide_unlabeled.h:43