Skip to content

Commit

Permalink
When changing midi channel on a Midi Preset, show it as popup (#1547)
Browse files Browse the repository at this point in the history
  • Loading branch information
soymonitus authored and m-m-adams committed Mar 23, 2024
1 parent 38b3b2d commit 357c65b
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/deluge/gui/views/view.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2294,6 +2294,22 @@ void View::navigateThroughPresetsForInstrumentClip(int32_t offset, ModelStackWit
if (display->haveOLED()) {
deluge::hid::display::OLED::sendMainImage();
}

// Special case: when it is a saved MIDI preset (with a name), then we need to show the channel in a popup, as
// the name will print over the midi channel and we can't see it while changing it
if (outputType == OutputType::MIDI_OUT && newInstrument->name.getLength() > 0) {
char buffer[12];
if (newChannel < 16) {
slotToString(newChannel + 1, newChannelSuffix, buffer, 1);
}
else if (newChannel == MIDI_CHANNEL_MPE_LOWER_ZONE || newChannel == MIDI_CHANNEL_MPE_UPPER_ZONE) {
strcpy(buffer, (newChannel == MIDI_CHANNEL_MPE_LOWER_ZONE) ? "Lower" : "Upper");
}
else {
strcpy(buffer, "Transpose");
}
display->popupTextTemporary(buffer);
}
}

// Or if we're on a Kit or Synth...
Expand Down

0 comments on commit 357c65b

Please sign in to comment.