Skip to content

Commit 84bb626

Browse files
committed
External - spmidi - bring inline with cbef063
This address two issues. Firstly an issue with incorrect MIDI out ports and secondly rtmidi virtual ports are now correctly filtered on Linux again. Fixes #2658
1 parent d3eca5b commit 84bb626

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

app/external/sp_midi/src/midicommon.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,15 +81,13 @@ std::vector<MidiPortInfo> MidiCommon::getPortInfo(RtMidi& ports)
8181

8282
for (int i = 0; i < nPorts; i++) {
8383
auto name = ports.getPortName(i);
84+
auto normalizedPortName = name;
85+
local_utils::safeOscString(normalizedPortName);
8486

85-
if (name.rfind("rtmidi_", 0) == 0) {
87+
if (normalizedPortName.rfind("rtmidi_", 0) == 0) {
8688
// The fact that the port name starts with rtmidi tells us that
8789
// this is a virtual midi port name created by RtMidi - ignore it
8890
} else {
89-
90-
auto normalizedPortName = name;
91-
local_utils::safeOscString(normalizedPortName);
92-
9391
// Now we need to check for duplicate port names and if they exist,
9492
// append an integer count to subsequent port names to ensure that
9593
// they are all unique. So if there were three devices

app/external/sp_midi/src/sp_midi.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ static atomic<bool> g_already_initialized { false };
5858
void prepareMidiSendProcessorOutputs(unique_ptr<MidiSendProcessor>& midiSendProcessor)
5959
{
6060
// Open all MIDI devices. This is what Sonic Pi does
61-
vector<MidiPortInfo> connectedOutputPortsInfo = MidiIn::getInputPortInfo();
61+
vector<MidiPortInfo> connectedOutputPortsInfo = MidiOut::getOutputPortInfo();
6262
{
6363
midiSendProcessor->prepareOutputs(connectedOutputPortsInfo);
6464
}

0 commit comments

Comments
 (0)