32 using Integer::Integer;
33 [[nodiscard]] int32_t getMinValue()
const override {
return 0; }
34 [[nodiscard]] int32_t getMaxValue()
const override {
return 16; }
36 int32_t value = soundEditor.currentSound->outputMidiChannel;
37 if (value == MIDI_CHANNEL_NONE) {
43 this->setValue(value);
46 void writeCurrentValue()
override {
47 int32_t value = this->getValue();
49 value = MIDI_CHANNEL_NONE;
55 if (currentUIMode == UI_MODE_HOLDING_AFFECT_ENTIRE_IN_SOUND_EDITOR && soundEditor.editingKitRow()) {
57 Kit* kit = getCurrentKit();
59 for (
Drum* thisDrum = kit->firstDrum; thisDrum !=
nullptr; thisDrum = thisDrum->next) {
60 if (thisDrum->type == DrumType::SOUND) {
61 auto* soundDrum =
static_cast<SoundDrum*
>(thisDrum);
62 soundDrum->outputMidiChannel = value;
68 soundEditor.currentSound->outputMidiChannel = value;
72 void drawValue()
override {
73 int32_t value = this->getValue();
75 display->setScrollingText(l10n::get(l10n::String::STRING_FOR_OFF));
79 snprintf(
name,
sizeof(
name),
"%d", value);
80 display->setScrollingText(
name);
84 void drawInteger(int32_t textWidth, int32_t textHeight, int32_t yPixel)
override {
85 deluge::hid::display::oled_canvas::Canvas& canvas = hid::display::OLED::main;
86 int32_t value = this->getValue();
88 canvas.
drawStringCentred(l10n::get(l10n::String::STRING_FOR_OFF), yPixel + OLED_MAIN_TOPMOST_PIXEL,
89 textWidth, textHeight);
93 snprintf(
name,
sizeof(
name),
"%d", value);
void drawStringCentred(char const *string, int32_t pixelY, int32_t textWidth, int32_t textHeight, int32_t centrePos=OLED_MAIN_WIDTH_PIXELS/2)
Definition canvas.cpp:189