Skip to content

Commit fc45ac7

Browse files
committed
Move WinMM session name to resource
1 parent 50b79cc commit fc45ac7

File tree

4 files changed

+14
-3
lines changed

4 files changed

+14
-3
lines changed

src/api/Client/WinMM/MidiSrvPorts.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,11 @@ CMidiPorts::RuntimeClassInitialize()
5555

5656
RETURN_IF_FAILED(UuidCreate(&m_SessionId));
5757

58+
59+
WCHAR sessionName[MIDI_MAX_SESSION_NAME_LENGTH];
60+
::LoadStringW(HINST_WDMAUD2, IDS_MIDI_DEFAULT_WINMM_SESSION_NAME, sessionName, MIDI_MAX_SESSION_NAME_LENGTH);
61+
m_SessionName = sessionName;
62+
5863
std::unique_ptr<CMidi2MidiSrv> midiSrv(new (std::nothrow) CMidi2MidiSrv());
5964
RETURN_IF_NULL_ALLOC(midiSrv);
6065

src/api/Client/WinMM/MidiSrvPorts.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ typedef struct _PORT_INFO
1717
MIDIOUTCAPSW MidiOutCaps {0};
1818
} PORT_INFO;
1919

20+
21+
#define MIDI_MAX_SESSION_NAME_LENGTH 50
22+
2023
// global singleton created on dll load, cleaned up on dllunload
2124
class CMidiPorts :
2225
public Microsoft::WRL::RuntimeClass<
@@ -49,7 +52,7 @@ class CMidiPorts :
4952
// The session guid created for all ports opened by this client, a single guid is used for all sessions.
5053
GUID m_SessionId {0};
5154
// Default session name for winmm clients.
52-
std::wstring m_SessionName { L"Winmm client session" };
55+
std::wstring m_SessionName { };
5356

5457
// map of midi port information ordered by the port number.
5558
// For each flow, the port number must be unique, but the port numbers

src/api/Client/WinMM/resource.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@
1818
#define IDS_SUBMIXER_CDLINE_SHORT 111
1919
#define IDS_SUBMIXER_CDLINE_LONG 112
2020

21-
#define IDS_MIDI_UNAVAILABLE_ENDPOINT 200
21+
#define IDS_MIDI_UNAVAILABLE_ENDPOINT 200
22+
23+
#define IDS_MIDI_DEFAULT_WINMM_SESSION_NAME 300
2224

2325
// Next default values for new objects
2426
//

src/api/Client/WinMM/winmmdrv.rc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ BEGIN
3030
IDS_SUBMIXER_MUTE_SHORT "Mute"
3131
IDS_SUBMIXER_MUTE_LONG "Mute"
3232

33-
IDS_MIDI_UNAVAILABLE_ENDPOINT "(unavailable)"
33+
IDS_MIDI_UNAVAILABLE_ENDPOINT "(unavailable)"
34+
IDS_MIDI_DEFAULT_WINMM_SESSION_NAME "WinMM client"
3435
END
3536

0 commit comments

Comments
 (0)