diff --git a/build/staging/version/BundleInfo.wxi b/build/staging/version/BundleInfo.wxi index b9a8f4aa..78121137 100644 --- a/build/staging/version/BundleInfo.wxi +++ b/build/staging/version/BundleInfo.wxi @@ -1,4 +1,4 @@ - + diff --git a/build/staging/version/WindowsMidiServicesVersion.cs b/build/staging/version/WindowsMidiServicesVersion.cs index 573187ca..e7115934 100644 --- a/build/staging/version/WindowsMidiServicesVersion.cs +++ b/build/staging/version/WindowsMidiServicesVersion.cs @@ -6,12 +6,12 @@ public static class MidiBuildInformation { public const string Source = "GitHub Preview"; public const string Name = "Customer Preview 2"; - public const string BuildFullVersion = "1.0.3-preview-11.250209-214"; + public const string BuildFullVersion = "1.0.3-preview-11.250209-429"; public const string VersionMajor = "1"; public const string VersionMinor = "0"; public const string VersionRevision = "3"; public const string VersionDateNumber = "250209"; - public const string VersionTimeNumber = "214"; + public const string VersionTimeNumber = "429"; } } diff --git a/build/staging/version/WindowsMidiServicesVersion.h b/build/staging/version/WindowsMidiServicesVersion.h index f57f7fe0..cf1a4154 100644 --- a/build/staging/version/WindowsMidiServicesVersion.h +++ b/build/staging/version/WindowsMidiServicesVersion.h @@ -5,12 +5,12 @@ #define WINDOWS_MIDI_SERVICES_BUILD_SOURCE L"GitHub Preview" #define WINDOWS_MIDI_SERVICES_BUILD_VERSION_NAME L"Customer Preview 2" -#define WINDOWS_MIDI_SERVICES_BUILD_VERSION_FULL L"1.0.3-preview-11.250209-214" +#define WINDOWS_MIDI_SERVICES_BUILD_VERSION_FULL L"1.0.3-preview-11.250209-429" #define WINDOWS_MIDI_SERVICES_BUILD_VERSION_MAJOR L"1" #define WINDOWS_MIDI_SERVICES_BUILD_VERSION_MINOR L"0" #define WINDOWS_MIDI_SERVICES_BUILD_VERSION_REVISION L"3" #define WINDOWS_MIDI_SERVICES_BUILD_VERSION_DATE_NUMBER L"250209" -#define WINDOWS_MIDI_SERVICES_BUILD_VERSION_TIME_NUMBER L"214" +#define WINDOWS_MIDI_SERVICES_BUILD_VERSION_TIME_NUMBER L"429" #endif diff --git a/samples/cpp-winrt/basics/client-basics-cpp.vcxproj b/samples/cpp-winrt/basics/client-basics-cpp.vcxproj index 9ccc8313..5521a969 100644 --- a/samples/cpp-winrt/basics/client-basics-cpp.vcxproj +++ b/samples/cpp-winrt/basics/client-basics-cpp.vcxproj @@ -2,7 +2,7 @@ - Microsoft.Windows.Devices.Midi2.1.0.3-preview-11.250209-214 + Microsoft.Windows.Devices.Midi2.1.0.3-preview-11.250209-429 true true false diff --git a/samples/cpp-winrt/basics/packages.config b/samples/cpp-winrt/basics/packages.config index 20dff53e..8cd2fd68 100644 --- a/samples/cpp-winrt/basics/packages.config +++ b/samples/cpp-winrt/basics/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file diff --git a/samples/cpp-winrt/loopback-endpoints/loopback-endpoints-cpp.vcxproj b/samples/cpp-winrt/loopback-endpoints/loopback-endpoints-cpp.vcxproj index f8c94f6f..f453ff5f 100644 --- a/samples/cpp-winrt/loopback-endpoints/loopback-endpoints-cpp.vcxproj +++ b/samples/cpp-winrt/loopback-endpoints/loopback-endpoints-cpp.vcxproj @@ -2,7 +2,7 @@ - Microsoft.Windows.Devices.Midi2.1.0.3-preview-11.250209-214 + Microsoft.Windows.Devices.Midi2.1.0.3-preview-11.250209-429 true true true diff --git a/samples/cpp-winrt/loopback-endpoints/packages.config b/samples/cpp-winrt/loopback-endpoints/packages.config index 20dff53e..8cd2fd68 100644 --- a/samples/cpp-winrt/loopback-endpoints/packages.config +++ b/samples/cpp-winrt/loopback-endpoints/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file diff --git a/samples/cpp-winrt/send-speed/packages.config b/samples/cpp-winrt/send-speed/packages.config index 20dff53e..8cd2fd68 100644 --- a/samples/cpp-winrt/send-speed/packages.config +++ b/samples/cpp-winrt/send-speed/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file diff --git a/samples/cpp-winrt/send-speed/send-speed-cpp.vcxproj b/samples/cpp-winrt/send-speed/send-speed-cpp.vcxproj index 0cb8cc7f..8fa76522 100644 --- a/samples/cpp-winrt/send-speed/send-speed-cpp.vcxproj +++ b/samples/cpp-winrt/send-speed/send-speed-cpp.vcxproj @@ -2,7 +2,7 @@ - Microsoft.Windows.Devices.Midi2.1.0.3-preview-11.250209-214 + Microsoft.Windows.Devices.Midi2.1.0.3-preview-11.250209-429 true true true diff --git a/samples/cpp-winrt/simple-app-to-app-midi/packages.config b/samples/cpp-winrt/simple-app-to-app-midi/packages.config index 20dff53e..8cd2fd68 100644 --- a/samples/cpp-winrt/simple-app-to-app-midi/packages.config +++ b/samples/cpp-winrt/simple-app-to-app-midi/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file diff --git a/samples/cpp-winrt/simple-app-to-app-midi/simple-app-to-app-cpp.vcxproj b/samples/cpp-winrt/simple-app-to-app-midi/simple-app-to-app-cpp.vcxproj index ab5e4231..8176f9b6 100644 --- a/samples/cpp-winrt/simple-app-to-app-midi/simple-app-to-app-cpp.vcxproj +++ b/samples/cpp-winrt/simple-app-to-app-midi/simple-app-to-app-cpp.vcxproj @@ -2,7 +2,7 @@ - Microsoft.Windows.Devices.Midi2.1.0.3-preview-11.250209-214 + Microsoft.Windows.Devices.Midi2.1.0.3-preview-11.250209-429 true true true diff --git a/samples/cpp-winrt/static-enum-endpoints/packages.config b/samples/cpp-winrt/static-enum-endpoints/packages.config index 20dff53e..8cd2fd68 100644 --- a/samples/cpp-winrt/static-enum-endpoints/packages.config +++ b/samples/cpp-winrt/static-enum-endpoints/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file diff --git a/samples/cpp-winrt/static-enum-endpoints/static-enum-endpoints-cpp.vcxproj b/samples/cpp-winrt/static-enum-endpoints/static-enum-endpoints-cpp.vcxproj index bb0a3dc2..7e36d41c 100644 --- a/samples/cpp-winrt/static-enum-endpoints/static-enum-endpoints-cpp.vcxproj +++ b/samples/cpp-winrt/static-enum-endpoints/static-enum-endpoints-cpp.vcxproj @@ -2,7 +2,7 @@ - Microsoft.Windows.Devices.Midi2.1.0.3-preview-11.250209-214 + Microsoft.Windows.Devices.Midi2.1.0.3-preview-11.250209-429 true true true diff --git a/samples/cpp-winrt/watch-endpoints/packages.config b/samples/cpp-winrt/watch-endpoints/packages.config index 20dff53e..8cd2fd68 100644 --- a/samples/cpp-winrt/watch-endpoints/packages.config +++ b/samples/cpp-winrt/watch-endpoints/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file diff --git a/samples/cpp-winrt/watch-endpoints/watch-endpoints-cpp.vcxproj b/samples/cpp-winrt/watch-endpoints/watch-endpoints-cpp.vcxproj index 30e26d54..b35d1956 100644 --- a/samples/cpp-winrt/watch-endpoints/watch-endpoints-cpp.vcxproj +++ b/samples/cpp-winrt/watch-endpoints/watch-endpoints-cpp.vcxproj @@ -2,7 +2,7 @@ - Microsoft.Windows.Devices.Midi2.1.0.3-preview-11.250209-214 + Microsoft.Windows.Devices.Midi2.1.0.3-preview-11.250209-429 true true true diff --git a/src/api/Client/WinMM/MidiSrvPorts.cpp b/src/api/Client/WinMM/MidiSrvPorts.cpp index 45c172a6..a20e21c6 100644 --- a/src/api/Client/WinMM/MidiSrvPorts.cpp +++ b/src/api/Client/WinMM/MidiSrvPorts.cpp @@ -55,6 +55,11 @@ CMidiPorts::RuntimeClassInitialize() RETURN_IF_FAILED(UuidCreate(&m_SessionId)); + + WCHAR sessionName[MIDI_MAX_SESSION_NAME_LENGTH]; + ::LoadStringW(HINST_WDMAUD2, IDS_MIDI_DEFAULT_WINMM_SESSION_NAME, sessionName, MIDI_MAX_SESSION_NAME_LENGTH); + m_SessionName = sessionName; + std::unique_ptr midiSrv(new (std::nothrow) CMidi2MidiSrv()); RETURN_IF_NULL_ALLOC(midiSrv); diff --git a/src/api/Client/WinMM/MidiSrvPorts.h b/src/api/Client/WinMM/MidiSrvPorts.h index c0724897..7b903789 100644 --- a/src/api/Client/WinMM/MidiSrvPorts.h +++ b/src/api/Client/WinMM/MidiSrvPorts.h @@ -17,6 +17,9 @@ typedef struct _PORT_INFO MIDIOUTCAPSW MidiOutCaps {0}; } PORT_INFO; + +#define MIDI_MAX_SESSION_NAME_LENGTH 50 + // global singleton created on dll load, cleaned up on dllunload class CMidiPorts : public Microsoft::WRL::RuntimeClass< @@ -49,7 +52,7 @@ class CMidiPorts : // The session guid created for all ports opened by this client, a single guid is used for all sessions. GUID m_SessionId {0}; // Default session name for winmm clients. - std::wstring m_SessionName { L"Winmm client session" }; + std::wstring m_SessionName { }; // map of midi port information ordered by the port number. // For each flow, the port number must be unique, but the port numbers diff --git a/src/api/Client/WinMM/resource.h b/src/api/Client/WinMM/resource.h index 648bca5d..2875f014 100644 --- a/src/api/Client/WinMM/resource.h +++ b/src/api/Client/WinMM/resource.h @@ -18,7 +18,9 @@ #define IDS_SUBMIXER_CDLINE_SHORT 111 #define IDS_SUBMIXER_CDLINE_LONG 112 -#define IDS_MIDI_UNAVAILABLE_ENDPOINT 200 +#define IDS_MIDI_UNAVAILABLE_ENDPOINT 200 + +#define IDS_MIDI_DEFAULT_WINMM_SESSION_NAME 300 // Next default values for new objects // diff --git a/src/api/Client/WinMM/winmmdrv.rc b/src/api/Client/WinMM/winmmdrv.rc index 5c75e8e7..b89f1487 100644 --- a/src/api/Client/WinMM/winmmdrv.rc +++ b/src/api/Client/WinMM/winmmdrv.rc @@ -30,6 +30,7 @@ BEGIN IDS_SUBMIXER_MUTE_SHORT "Mute" IDS_SUBMIXER_MUTE_LONG "Mute" - IDS_MIDI_UNAVAILABLE_ENDPOINT "(unavailable)" + IDS_MIDI_UNAVAILABLE_ENDPOINT "(unavailable)" + IDS_MIDI_DEFAULT_WINMM_SESSION_NAME "WinMM client" END diff --git a/src/api/Transport/LoopbackMidiTransport/Midi2.LoopbackMidiEndpointManager.cpp b/src/api/Transport/LoopbackMidiTransport/Midi2.LoopbackMidiEndpointManager.cpp index 214ffcb3..d7c4ab84 100644 --- a/src/api/Transport/LoopbackMidiTransport/Midi2.LoopbackMidiEndpointManager.cpp +++ b/src/api/Transport/LoopbackMidiTransport/Midi2.LoopbackMidiEndpointManager.cpp @@ -197,7 +197,7 @@ CMidi2LoopbackMidiEndpointManager::DeleteSingleEndpoint( TraceLoggingWideString(definition.EndpointDescription.c_str(), "description") ); - return m_MidiDeviceManager->DeactivateEndpoint(definition.CreatedShortClientInstanceId.c_str()); + return m_MidiDeviceManager->RemoveEndpoint(definition.CreatedShortClientInstanceId.c_str()); } diff --git a/src/app-sdk/mididiag/mididiag.vcxproj b/src/app-sdk/mididiag/mididiag.vcxproj index f2024011..0d43feeb 100644 --- a/src/app-sdk/mididiag/mididiag.vcxproj +++ b/src/app-sdk/mididiag/mididiag.vcxproj @@ -2,7 +2,7 @@ - Microsoft.Windows.Devices.Midi2.1.0.3-preview-11.250209-214 + Microsoft.Windows.Devices.Midi2.1.0.3-preview-11.250209-429 true true true diff --git a/src/app-sdk/mididiag/packages.config b/src/app-sdk/mididiag/packages.config index 18315221..9596ff16 100644 --- a/src/app-sdk/mididiag/packages.config +++ b/src/app-sdk/mididiag/packages.config @@ -1,6 +1,6 @@  - + \ No newline at end of file diff --git a/src/app-sdk/midimdnsinfo/midimdnsinfo.vcxproj b/src/app-sdk/midimdnsinfo/midimdnsinfo.vcxproj index 15a7dd98..ea4fd8f4 100644 --- a/src/app-sdk/midimdnsinfo/midimdnsinfo.vcxproj +++ b/src/app-sdk/midimdnsinfo/midimdnsinfo.vcxproj @@ -2,7 +2,7 @@ - Microsoft.Windows.Devices.Midi2.1.0.3-preview-11.250209-214 + Microsoft.Windows.Devices.Midi2.1.0.3-preview-11.250209-429 true true true diff --git a/src/app-sdk/midimdnsinfo/packages.config b/src/app-sdk/midimdnsinfo/packages.config index 18315221..9596ff16 100644 --- a/src/app-sdk/midimdnsinfo/packages.config +++ b/src/app-sdk/midimdnsinfo/packages.config @@ -1,6 +1,6 @@  - + \ No newline at end of file diff --git a/src/app-sdk/midiusbinfo/midiusbinfo.vcxproj b/src/app-sdk/midiusbinfo/midiusbinfo.vcxproj index d793411f..95e31f4c 100644 --- a/src/app-sdk/midiusbinfo/midiusbinfo.vcxproj +++ b/src/app-sdk/midiusbinfo/midiusbinfo.vcxproj @@ -2,7 +2,7 @@ - Microsoft.Windows.Devices.Midi2.1.0.3-preview-11.250209-214 + Microsoft.Windows.Devices.Midi2.1.0.3-preview-11.250209-429 true true true diff --git a/src/app-sdk/midiusbinfo/packages.config b/src/app-sdk/midiusbinfo/packages.config index 18315221..9596ff16 100644 --- a/src/app-sdk/midiusbinfo/packages.config +++ b/src/app-sdk/midiusbinfo/packages.config @@ -1,6 +1,6 @@  - + \ No newline at end of file diff --git a/src/user-tools/midi-console/Midi/Commands/Endpoint/EndpointMonitorCommand.cs b/src/user-tools/midi-console/Midi/Commands/Endpoint/EndpointMonitorCommand.cs index f4da7946..fbb8b598 100644 --- a/src/user-tools/midi-console/Midi/Commands/Endpoint/EndpointMonitorCommand.cs +++ b/src/user-tools/midi-console/Midi/Commands/Endpoint/EndpointMonitorCommand.cs @@ -34,8 +34,8 @@ internal class EndpointMonitorCommand : Command { // we have this struct so we can separate the relatively fast received processing // and its calculations from the comparatively slow displays processing - private Queue m_receivedMessagesQueue = new Queue(2000); - private Queue m_displayMessageQueue = new Queue(1000); + private Queue m_receivedMessagesQueue = new Queue(4000); + private Queue m_displayMessageQueue = new Queue(2000); private Queue m_fileWriterMessagesQueue = new Queue(1000); diff --git a/src/user-tools/midi-console/Midi/Commands/Endpoint/EndpointPlayNotesCommand.cs b/src/user-tools/midi-console/Midi/Commands/Endpoint/EndpointPlayNotesCommand.cs index 876ea414..d2b1b9a9 100644 --- a/src/user-tools/midi-console/Midi/Commands/Endpoint/EndpointPlayNotesCommand.cs +++ b/src/user-tools/midi-console/Midi/Commands/Endpoint/EndpointPlayNotesCommand.cs @@ -187,21 +187,22 @@ public override int Execute(CommandContext context, Settings settings) if (settings.Midi2) { - UInt32 velocity = (UInt32)(settings.Velocity / 100.0) * UInt32.MaxValue; + UInt32 velocity = (UInt32)(((float)settings.Velocity / 100.0) * UInt16.MaxValue) << 16; + UInt16 note = (UInt16)((UInt16)settings.NoteIndexes![noteArrayIndex] << 8); var noteOnMessage = MidiMessageBuilder.BuildMidi2ChannelVoiceMessage( MidiClock.TimestampConstantSendImmediately, group, Midi2ChannelVoiceMessageStatus.NoteOn, channel, - (ushort)settings.NoteIndexes![noteArrayIndex], + note, velocity); noteOnSendResult = connection.SendSingleMessagePacket(noteOnMessage); } else { - byte velocity = (byte)settings.Velocity; + byte velocity = (byte)((float)(settings.Velocity / 100.0) * 127); var noteOnMessage = MidiMessageBuilder.BuildMidi1ChannelVoiceMessage( MidiClock.TimestampConstantSendImmediately, @@ -231,21 +232,22 @@ public override int Execute(CommandContext context, Settings settings) if (settings.Midi2) { - UInt32 velocity = (UInt32)(settings.Velocity / 100.0) * UInt32.MaxValue; + UInt32 velocity = (UInt32)((float)(settings.Velocity / 100.0) * UInt16.MaxValue) << 16; + UInt16 note = (UInt16)((UInt16)settings.NoteIndexes![noteArrayIndex] << 8); var noteOffMessage = MidiMessageBuilder.BuildMidi2ChannelVoiceMessage( MidiClock.TimestampConstantSendImmediately, group, Midi2ChannelVoiceMessageStatus.NoteOff, channel, - (ushort)settings.NoteIndexes![noteArrayIndex], + note, velocity); noteOffSendResult = connection.SendSingleMessagePacket(noteOffMessage); } else { - byte velocity = (byte)settings.Velocity; + byte velocity = (byte)((float)(settings.Velocity / 100.0) * 127); var noteOffMessage = MidiMessageBuilder.BuildMidi1ChannelVoiceMessage( MidiClock.TimestampConstantSendImmediately,