From e730349d97fa606ad3a4dd5da3c7092373ceb361 Mon Sep 17 00:00:00 2001 From: Johannes Schultz Date: Mon, 11 Sep 2023 15:02:47 +0200 Subject: [PATCH] Also fix names of UWP output devices when there's two or more of the same kind attached. --- RtMidi.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/RtMidi.cpp b/RtMidi.cpp index 0c3dcbe..dd22b30 100644 --- a/RtMidi.cpp +++ b/RtMidi.cpp @@ -3447,8 +3447,9 @@ void UWPMidiClass::fix_display_name(const std::vector& in_ports, { for (auto& outp : out_ports) { - if (outp.hex_id.empty() || - std::string_view{ outp.name }.substr(0, 4) != "MIDI") + if (outp.hex_id.empty()) + continue; + if (std::string_view{ outp.name }.substr(0, 4) != "MIDI" && std::string_view{ outp.name }.substr(1, 7) != " - MIDI") continue; for (const auto& inp : in_ports)