Skip to content

Commit

Permalink
Additional name change for KS devices
Browse files Browse the repository at this point in the history
  • Loading branch information
Psychlist1972 committed Feb 17, 2025
1 parent cc02912 commit e327470
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
9 changes: 8 additions & 1 deletion src/api/Inc/midi_naming.h
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,14 @@ namespace WindowsMidiServicesInternal::Midi1PortNaming

std::wstring name;

name = parentDeviceName;
if (blockName != parentDeviceName)
{
name = parentDeviceName + L" " + blockName;
}
else
{
name = parentDeviceName;
}

return truncateToWinMMLimit ? name.substr(0, MAXPNAMELEN - 1) : name;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -621,8 +621,9 @@ CMidi2KSMidiEndpointManager::OnDeviceAdded(
else if (MidiPin->NativeDataFormat == KSDATAFORMAT_SUBTYPE_MIDI)
{
// for a native MIDI 1 device, the driver provides a MIDI 1 port name in the GTB
// but it's just the pin (iJack) name, so we still set this to false. Change in behavior.
interfaceDevProperties.push_back({ { PKEY_MIDI_UseGroupTerminalBlocksForExactMidi1PortNames, DEVPROP_STORE_SYSTEM, nullptr },
DEVPROP_TYPE_BOOLEAN, static_cast<ULONG>(sizeof(devPropTrue)), (PVOID) & (devPropTrue) });
DEVPROP_TYPE_BOOLEAN, static_cast<ULONG>(sizeof(devPropFalse)), (PVOID) & (devPropFalse) });
}
}
else
Expand Down

0 comments on commit e327470

Please sign in to comment.