Skip to content

Commit 6108983

Browse files
committed
Fix MIDI output duplication bug
1 parent a8db016 commit 6108983

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Source/Utility/MidiDeviceManager.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,7 @@ class MidiDeviceManager final : public ChangeListener
368368
if (!port.enabled)
369369
continue;
370370
for (auto const* device : port.devices) {
371+
if(midiOutputsTree.getChildWithProperty("Name", device->getName()).isValid()) continue;
371372
ValueTree midiOutputPort("MidiPort");
372373
midiOutputPort.setProperty("Name", device->getName(), nullptr);
373374
midiOutputPort.setProperty("Port", outputPorts.index_of_address(port) - 1, nullptr);
@@ -381,6 +382,7 @@ class MidiDeviceManager final : public ChangeListener
381382
if (!port.enabled)
382383
continue;
383384
for (auto const* device : port.devices) {
385+
if(midiInputsTree.getChildWithProperty("Name", device->getName()).isValid()) continue;
384386
ValueTree midiInputPort("MidiPort");
385387
midiInputPort.setProperty("Name", device->getName(), nullptr);
386388
midiInputPort.setProperty("Port", inputPorts.index_of_address(port) - 1, nullptr);

0 commit comments

Comments
 (0)