The first (idx=0) MIDI-in adapter on my PC is EMU 0404 | USB and MiniInWinMM::getPortName returns it as EMU 0404 | USB<space>0.
The original code uses QString::remove which removes all the occurrences of 0 from the adapter name. The result is EMU 44 | USB and its mismatch with the real adapter name causes the firmware update to fail.
The proposed change removes the final idx only if the adapter name given by RtMidi ends with it. It's a little bit better but just enough to perform the firmware update.
The first (
idx
=0) MIDI-in adapter on my PC isEMU 0404 | USB
andMiniInWinMM::getPortName
returns it asEMU 0404 | USB<space>0
.The original code uses
QString::remove
which removes all the occurrences of0
from the adapter name. The result isEMU 44 | USB
and its mismatch with the real adapter name causes the firmware update to fail.The proposed change removes the final
idx
only if the adapter name given byRtMidi
ends with it. It's a little bit better but just enough to perform the firmware update.