From 563b2448612a98125a6042d0a3c3e587d9263864 Mon Sep 17 00:00:00 2001 From: Pete Brown Date: Wed, 21 Feb 2024 13:27:23 -0500 Subject: [PATCH 1/3] Update select projects to C++ 20 and Remove C++ 20 error --- .../Midi2Client/MidiEndpointDeviceWatcher.cpp | 4 ++- src/api/Client/Midi2Client/MidiService.h | 4 ++- .../Midi2Client/Windows.Devices.Midi2.vcxproj | 36 +++++++++---------- 3 files changed, 24 insertions(+), 20 deletions(-) diff --git a/src/api/Client/Midi2Client/MidiEndpointDeviceWatcher.cpp b/src/api/Client/Midi2Client/MidiEndpointDeviceWatcher.cpp index 01f650f3..debf392c 100644 --- a/src/api/Client/Midi2Client/MidiEndpointDeviceWatcher.cpp +++ b/src/api/Client/Midi2Client/MidiEndpointDeviceWatcher.cpp @@ -122,7 +122,6 @@ namespace winrt::Windows::Devices::Midi2::implementation bool updatedUserMetadata{ false }; bool updatedAdditionalCapabilities{ false }; - // TODO: check changed properties and set the flags here if (args.Properties().HasKey(STRING_PKEY_MIDI_TransportSuppliedEndpointName) || args.Properties().HasKey(L"System.ItemNameDisplay") || @@ -186,6 +185,9 @@ namespace winrt::Windows::Devices::Midi2::implementation } + + + newArgs->InternalInitialize( args.Id(), args, diff --git a/src/api/Client/Midi2Client/MidiService.h b/src/api/Client/Midi2Client/MidiService.h index a7055ab2..755ad54f 100644 --- a/src/api/Client/Midi2Client/MidiService.h +++ b/src/api/Client/Midi2Client/MidiService.h @@ -47,7 +47,9 @@ namespace winrt::Windows::Devices::Midi2::implementation - static json::JsonObject MidiService::InternalSendConfigurationJsonAndGetResponse(_In_ winrt::guid const& abstractionId, _In_ json::JsonObject const& configObject) noexcept; + static json::JsonObject InternalSendConfigurationJsonAndGetResponse( + _In_ winrt::guid const& abstractionId, + _In_ json::JsonObject const& configObject) noexcept; private: diff --git a/src/api/Client/Midi2Client/Windows.Devices.Midi2.vcxproj b/src/api/Client/Midi2Client/Windows.Devices.Midi2.vcxproj index 986dd8c9..3724aa5f 100644 --- a/src/api/Client/Midi2Client/Windows.Devices.Midi2.vcxproj +++ b/src/api/Client/Midi2Client/Windows.Devices.Midi2.vcxproj @@ -165,7 +165,7 @@ _DEBUG;%(PreprocessorDefinitions);WINAPI_FAMILY=WINAPI_FAMILY_DESKTOP_APP - stdcpp17 + stdcpp20 false true true @@ -173,8 +173,8 @@ $(ProjectDir);$(GeneratedFilesDir);$(IntDir);$(SolutionDir)inc;$(SolutionDir)VSFiles\intermediate\idl\$(Platform)\$(Configuration);$(SolutionDir)VSFiles\intermediate\midi2.midisrvabstraction\$(Platform)\$(Configuration);$(SolutionDir)Libs\AbstractionUtilities\inc;%(AdditionalIncludeDirectories) $(ProjectDir);$(GeneratedFilesDir);$(IntDir);$(SolutionDir)inc;$(SolutionDir)VSFiles\intermediate\idl\$(Platform)\$(Configuration);$(SolutionDir)VSFiles\intermediate\midi2.midisrvabstraction\$(Platform)\$(Configuration);$(SolutionDir)Libs\AbstractionUtilities\inc;%(AdditionalIncludeDirectories) $(ProjectDir);$(GeneratedFilesDir);$(IntDir);$(SolutionDir)inc;$(SolutionDir)VSFiles\intermediate\idl\$(Platform)\$(Configuration);$(SolutionDir)VSFiles\intermediate\midi2.midisrvabstraction\$(Platform)\$(Configuration);$(SolutionDir)Libs\AbstractionUtilities\inc;%(AdditionalIncludeDirectories) - stdcpp17 - stdcpp17 + stdcpp20 + stdcpp20 false @@ -222,9 +222,9 @@ true true true - stdcpp17 - stdcpp17 - stdcpp17 + stdcpp20 + stdcpp20 + stdcpp20 true @@ -385,18 +385,18 @@ MidiEndpointConnection.idl - - MidiEndpointConnection.idl - - - MidiEndpointConnection.idl - - - MidiEndpointConnection.idl - - - MidiEndpointConnection.idl - + + MidiEndpointConnection.idl + + + MidiEndpointConnection.idl + + + MidiEndpointConnection.idl + + + MidiEndpointConnection.idl + MidiEndpointDeviceInformation.idl From 8b28e51f07f9b863abb17bf2eacb69acb84f2b03 Mon Sep 17 00:00:00 2001 From: Pete Brown Date: Fri, 23 Feb 2024 01:43:34 -0500 Subject: [PATCH 2/3] Move to C++ 20 for most things and deal with a world of hurt --- build/staging/version/BundleInfo.wxi | 2 +- .../Midi2.BluetoothMidiAbstraction.vcxproj | 30 +- .../BleMidiAbstraction/packages.config | 2 +- src/api/Abstraction/BleMidiAbstraction/pch.h | 11 +- .../Midi2.DiagnosticsAbstraction.vcxproj | 30 +- .../Midi2.DiagnosticsEndpointManager.cpp | 9 +- .../DiagnosticsAbstraction/packages.config | 2 +- .../Abstraction/DiagnosticsAbstraction/pch.h | 13 +- .../KSAbstraction/Midi2.KSAbstraction.vcxproj | 30 +- .../Abstraction/KSAbstraction/packages.config | 2 +- src/api/Abstraction/KSAbstraction/pch.h | 16 +- .../Midi2.LoopbackMidiAbstraction.vcxproj | 30 +- ...Midi2.LoopbackMidiConfigurationManager.cpp | 26 +- .../LoopbackMidiAbstraction/packages.config | 2 +- .../Abstraction/LoopbackMidiAbstraction/pch.h | 16 +- .../Midi2.MidiSrvAbstraction.cpp | 12 +- .../Midi2.MidiSrvAbstraction.vcxproj | 18 +- .../MidiSrvAbstraction/packages.config | 2 +- .../Midi2.NetworkMidiAbstraction.vcxproj | 30 +- .../NetworkMidiAbstraction/packages.config | 2 +- .../Abstraction/NetworkMidiAbstraction/pch.h | 11 +- .../Midi2.SampleAbstraction.vcxproj | 30 +- .../SampleAbstraction/packages.config | 2 +- src/api/Abstraction/SampleAbstraction/pch.h | 9 +- .../Midi2.VirtualMidiAbstraction.vcxproj | 30 +- .../Midi2.VirtualMidiConfigurationManager.cpp | 31 +- .../VirtualMidiAbstraction/packages.config | 2 +- .../Abstraction/VirtualMidiAbstraction/pch.h | 14 +- .../Midi2.VirtualPatchBayAbstraction.vcxproj | 30 +- .../packages.config | 2 +- .../VirtualPatchBayAbstraction/pch.h | 9 +- .../Windows.Devices.Midi2.NET.csproj | 2 +- .../nuget/Windows.Devices.Midi2.nuspec | 2 +- src/api/Client/Midi2Client/MidiService.cpp | 83 ++- src/api/Client/Midi2Client/MidiSession.cpp | 27 +- .../Midi2Client/Windows.Devices.Midi2.vcxproj | 14 +- src/api/Client/Midi2Client/pch.h | 16 +- src/api/Drivers/MinMidi/Driver/Driver.vcxproj | 4 +- .../Drivers/MinMidi/Driver/packages.config | 2 +- .../Drivers/MinMidi2/Driver/MinMidi2.vcxproj | 4 +- .../Drivers/MinMidi2/Driver/packages.config | 2 +- .../Drivers/USBMIDI2/Driver/USBMidi2.vcxproj | 4 +- .../Drivers/USBMIDI2/Driver/packages.config | 2 +- src/api/InBoxApps/mididmp/mididmp.vcxproj | 10 +- src/api/InBoxApps/mididmp/packages.config | 2 +- src/api/Inc/MidiDefs.h | 2 +- src/api/Inc/json_defs.h | 101 ++++ src/api/Inc/json_helpers.h | 217 ++++++++ src/api/Inc/midi_config_json.h | 15 - src/api/Inc/swd_helpers.h | 125 +++++ src/api/Libs/AM_MIDI2/src/AM_MIDI2.vcxproj | 14 +- .../AbstractionUtilities.vcxproj | 30 +- .../AbstractionUtilities.vcxproj.filters | 21 +- .../inc/endpoint_data_helpers.h | 35 -- .../AbstractionUtilities/inc/json_helpers.h | 154 ------ .../inc/swd_property_builders.h | 25 - .../AbstractionUtilities/inc/swd_shared.h | 24 - .../Libs/AbstractionUtilities/packages.config | 4 + .../src/endpoint_data_helpers.cpp | 69 --- .../AbstractionUtilities/src/json_helpers.cpp | 503 ------------------ src/api/Libs/AbstractionUtilities/src/pch.cpp | 13 - src/api/Libs/AbstractionUtilities/src/pch.h | 4 +- .../src/property_builders.cpp | 0 .../src/swd_property_builders.cpp | 20 - .../src/swd_property_helpers.cpp | 71 --- .../AbstractionUtilities/src/swd_shared.cpp | 66 --- src/api/Libs/MidiKs/MidiKS.vcxproj | 18 +- src/api/Libs/MidiKs/packages.config | 2 +- .../Libs/MidiKsCommon/MidiKSCommon.vcxproj | 18 +- src/api/Libs/MidiKsCommon/packages.config | 2 +- src/api/Libs/MidiXProc/MidiXProc.vcxproj | 18 +- src/api/Libs/MidiXProc/packages.config | 2 +- src/api/Midi2.sln | 35 -- .../Service/Exe/MidiConfigurationManager.cpp | 2 +- src/api/Service/Exe/MidiService.cpp | 2 +- src/api/Service/Exe/MidiSessionTracker.cpp | 14 +- src/api/Service/Exe/MidiSrv.cpp | 15 +- src/api/Service/Exe/MidiSrv.vcxproj | 28 +- src/api/Service/Exe/packages.config | 2 +- src/api/Service/Exe/stdafx.h | 16 +- src/api/Service/Inc/MidiClientManager.h | 12 +- .../Test/Libs/MidiKSEnum/MidiKSEnum.vcxproj | 18 +- src/api/Test/Libs/MidiKSEnum/packages.config | 2 +- .../Test/Libs/MidiSWEnum/MidiSWEnum.vcxproj | 16 +- src/api/Test/Libs/MidiSWEnum/packages.config | 2 +- .../MidiTestCommon/MidiTestCommon.vcxproj | 12 +- .../Test/Libs/MidiTestCommon/packages.config | 2 +- .../Midi2.Abstraction.unittests.vcxproj | 10 +- .../packages.config | 2 +- .../Test/Midi2.Abstraction.unittests/stdafx.h | 6 + .../Midi2.Client.benchmarks.vcxproj | 14 +- .../Midi2.Client.benchmarks/packages.config | 3 +- src/api/Test/Midi2.Client.benchmarks/stdafx.h | 6 + .../Midi2.Client.unittests.vcxproj | 14 +- .../Midi2.Client.unittests/MidiClockTests.cpp | 3 - .../MidiEndpointConnectionBufferTests.cpp | 5 - .../MidiEndpointConnectionTests.cpp | 5 - .../MidiEndpointCreationThreadTests.cpp | 3 - .../MidiEndpointDeviceWatcherTests.cpp | 2 - .../MidiEndpointListenerTests.cpp | 2 - .../MidiFunctionBlockMessageBuilderTests.cpp | 2 - .../MidiMessageBuilderTests.cpp | 4 - .../MidiMessagePacketTests.cpp | 3 - .../MidiMessageSchedulerTests.cpp | 2 - .../MidiSessionTests.cpp | 2 - .../MidiStreamMessageBuilderTests.cpp | 3 - .../Midi2.Client.unittests/packages.config | 3 +- src/api/Test/Midi2.Client.unittests/stdafx.h | 18 + .../Midi2.Driver.unittests.vcxproj | 6 +- .../Midi2.Driver.unittests/packages.config | 2 +- src/api/Test/Midi2.Driver.unittests/stdafx.h | 5 + .../Midi2.Service.unittests.vcxproj | 12 +- .../Midi2ServiceTests.cpp | 6 +- .../Midi2.Service.unittests/packages.config | 2 +- src/api/Test/Midi2.Service.unittests/stdafx.h | 4 + .../Midi2.Transform.unittests.vcxproj | 4 +- .../Midi2.Transform.unittests/packages.config | 2 +- src/api/Test/inc/MidiTestCommon.h | 6 + .../Midi2.BS2UMPTransform.vcxproj | 18 +- .../Transform/ByteStreamToUMP/packages.config | 2 +- ....EndpointMetadataListenerTransform.vcxproj | 18 +- .../packages.config | 2 +- ....JitterReductionGeneratorTransform.vcxproj | 18 +- .../packages.config | 2 +- ...2.JitterReductionListenerTransform.vcxproj | 18 +- .../packages.config | 2 +- .../Midi2.SampleTransform.vcxproj | 18 +- .../Transform/SampleTransform/packages.config | 2 +- .../Midi2.SchedulerTransform.vcxproj | 18 +- .../SchedulerTransform/packages.config | 2 +- .../Midi2.UMP2BSTransform.vcxproj | 24 +- .../Transform/UMPToByteStream/packages.config | 2 +- src/api/idl/IDL.vcxproj | 18 +- src/api/idl/packages.config | 2 +- .../Microsoft.Midi.Settings/App.xaml.cs | 4 + .../MidiEndpointDevicePurposeConverter.cs | 59 ++ .../MidiEndpointNativeDataFormatConverter.cs | 51 ++ .../MidiFunctionBlockMidi10Converter.cs | 53 ++ .../MidiFunctionBlockSysEx8FormatConverter.cs | 46 ++ .../Helpers/MidiGroupIndexConverter.cs | 38 ++ .../Microsoft.Midi.Settings.csproj | 32 +- .../Models/AppState.cs | 36 +- .../Services/PageService.cs | 3 + .../Strings/en-us/Resources.resw | 3 + .../Styles/FontSizes.xaml | 7 + .../Styles/TextBlock.xaml | 36 +- .../Microsoft.Midi.Settings/Usings.cs | 2 + .../ViewModels/DeviceDetailViewModel.cs | 34 ++ .../ViewModels/DevicesViewModel.cs | 150 +++++- .../ViewModels/SettingsViewModel.cs | 5 +- .../Views/DeviceDetailPage.xaml | 347 ++++++++++++ .../Views/DeviceDetailPage.xaml.cs | 43 ++ .../Views/DevicesPage.xaml | 67 +-- .../Views/DevicesPage.xaml.cs | 32 +- .../Views/SettingsPage.xaml | 2 +- 155 files changed, 2005 insertions(+), 1752 deletions(-) create mode 100644 src/api/Inc/json_defs.h create mode 100644 src/api/Inc/json_helpers.h delete mode 100644 src/api/Inc/midi_config_json.h create mode 100644 src/api/Inc/swd_helpers.h delete mode 100644 src/api/Libs/AbstractionUtilities/inc/endpoint_data_helpers.h delete mode 100644 src/api/Libs/AbstractionUtilities/inc/json_helpers.h delete mode 100644 src/api/Libs/AbstractionUtilities/inc/swd_property_builders.h delete mode 100644 src/api/Libs/AbstractionUtilities/inc/swd_shared.h create mode 100644 src/api/Libs/AbstractionUtilities/packages.config delete mode 100644 src/api/Libs/AbstractionUtilities/src/endpoint_data_helpers.cpp delete mode 100644 src/api/Libs/AbstractionUtilities/src/json_helpers.cpp delete mode 100644 src/api/Libs/AbstractionUtilities/src/pch.cpp delete mode 100644 src/api/Libs/AbstractionUtilities/src/property_builders.cpp delete mode 100644 src/api/Libs/AbstractionUtilities/src/swd_property_builders.cpp delete mode 100644 src/api/Libs/AbstractionUtilities/src/swd_property_helpers.cpp delete mode 100644 src/api/Libs/AbstractionUtilities/src/swd_shared.cpp create mode 100644 src/user-tools/midi-settings/Microsoft.Midi.Settings/Helpers/MidiEndpointDevicePurposeConverter.cs create mode 100644 src/user-tools/midi-settings/Microsoft.Midi.Settings/Helpers/MidiEndpointNativeDataFormatConverter.cs create mode 100644 src/user-tools/midi-settings/Microsoft.Midi.Settings/Helpers/MidiFunctionBlockMidi10Converter.cs create mode 100644 src/user-tools/midi-settings/Microsoft.Midi.Settings/Helpers/MidiFunctionBlockSysEx8FormatConverter.cs create mode 100644 src/user-tools/midi-settings/Microsoft.Midi.Settings/Helpers/MidiGroupIndexConverter.cs create mode 100644 src/user-tools/midi-settings/Microsoft.Midi.Settings/ViewModels/DeviceDetailViewModel.cs create mode 100644 src/user-tools/midi-settings/Microsoft.Midi.Settings/Views/DeviceDetailPage.xaml create mode 100644 src/user-tools/midi-settings/Microsoft.Midi.Settings/Views/DeviceDetailPage.xaml.cs diff --git a/build/staging/version/BundleInfo.wxi b/build/staging/version/BundleInfo.wxi index b32045fb..7ad29dab 100644 --- a/build/staging/version/BundleInfo.wxi +++ b/build/staging/version/BundleInfo.wxi @@ -1,4 +1,4 @@ - + diff --git a/src/api/Abstraction/BleMidiAbstraction/Midi2.BluetoothMidiAbstraction.vcxproj b/src/api/Abstraction/BleMidiAbstraction/Midi2.BluetoothMidiAbstraction.vcxproj index 23f17559..f38ac476 100644 --- a/src/api/Abstraction/BleMidiAbstraction/Midi2.BluetoothMidiAbstraction.vcxproj +++ b/src/api/Abstraction/BleMidiAbstraction/Midi2.BluetoothMidiAbstraction.vcxproj @@ -30,7 +30,7 @@ 17.0 {8795821B-541D-4B9B-BF7F-50CA976FC54E} Win32Proj - 10.0.20348.0 + 10.0 @@ -144,10 +144,10 @@ %(AdditionalIncludeDirectories);$(SolutionDir)inc;$(SolutionDir)VSFiles\intermediate\idl\$(Platform)\$(Configuration);$(IntDir);$(SolutionDir)Libs\AbstractionUtilities\inc Create pch.h - stdcpp17 + stdcpp20 - %(AdditionalDependencies);onecoreuap.lib;avrt.lib;$(CoreLibraryDependencies);AbstractionUtilities.lib + %(AdditionalDependencies);onecoreuap.lib;avrt.lib;$(CoreLibraryDependencies); Midi2.BluetoothMidiAbstraction.def @@ -162,10 +162,10 @@ %(AdditionalIncludeDirectories);$(SolutionDir)inc;$(SolutionDir)VSFiles\intermediate\idl\$(Platform)\$(Configuration);$(IntDir);$(SolutionDir)Libs\AbstractionUtilities\inc Create pch.h - stdcpp17 + stdcpp20 - %(AdditionalDependencies);onecoreuap.lib;avrt.lib;$(CoreLibraryDependencies);AbstractionUtilities.lib + %(AdditionalDependencies);onecoreuap.lib;avrt.lib;$(CoreLibraryDependencies); Midi2.BluetoothMidiAbstraction.def @@ -180,10 +180,10 @@ %(AdditionalIncludeDirectories);$(SolutionDir)inc;$(SolutionDir)VSFiles\intermediate\idl\$(Platform)\$(Configuration);$(IntDir);$(SolutionDir)Libs\AbstractionUtilities\inc Create pch.h - stdcpp17 + stdcpp20 - %(AdditionalDependencies);onecoreuap.lib;avrt.lib;$(CoreLibraryDependencies);AbstractionUtilities.lib + %(AdditionalDependencies);onecoreuap.lib;avrt.lib;$(CoreLibraryDependencies); Midi2.BluetoothMidiAbstraction.def @@ -217,10 +217,10 @@ true Create pch.h - stdcpp17 + stdcpp20 - %(AdditionalDependencies);onecoreuap.lib;avrt.lib;$(CoreLibraryDependencies);AbstractionUtilities.lib + %(AdditionalDependencies);onecoreuap.lib;avrt.lib;$(CoreLibraryDependencies); Midi2.BluetoothMidiAbstraction.def @@ -234,10 +234,10 @@ true Create pch.h - stdcpp17 + stdcpp20 - %(AdditionalDependencies);onecoreuap.lib;avrt.lib;$(CoreLibraryDependencies);AbstractionUtilities.lib + %(AdditionalDependencies);onecoreuap.lib;avrt.lib;$(CoreLibraryDependencies); Midi2.BluetoothMidiAbstraction.def @@ -261,10 +261,10 @@ true Create pch.h - stdcpp17 + stdcpp20 - %(AdditionalDependencies);onecoreuap.lib;avrt.lib;$(CoreLibraryDependencies);AbstractionUtilities.lib + %(AdditionalDependencies);onecoreuap.lib;avrt.lib;$(CoreLibraryDependencies); Midi2.BluetoothMidiAbstraction.def @@ -311,12 +311,12 @@ - + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - + \ No newline at end of file diff --git a/src/api/Abstraction/BleMidiAbstraction/packages.config b/src/api/Abstraction/BleMidiAbstraction/packages.config index 2884a839..09be25d9 100644 --- a/src/api/Abstraction/BleMidiAbstraction/packages.config +++ b/src/api/Abstraction/BleMidiAbstraction/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/src/api/Abstraction/BleMidiAbstraction/pch.h b/src/api/Abstraction/BleMidiAbstraction/pch.h index 09c1ce36..f7713b9b 100644 --- a/src/api/Abstraction/BleMidiAbstraction/pch.h +++ b/src/api/Abstraction/BleMidiAbstraction/pch.h @@ -69,19 +69,20 @@ namespace bt = ::winrt::Windows::Devices::Bluetooth; #include "setupapi.h" //#include "Devpkey.h" -// AbstractionUtilities -#include "endpoint_data_helpers.h" -#include "swd_property_builders.h" -#include "json_helpers.h" +#include "wstring_util.h" +namespace internal = ::Windows::Devices::Midi2::Internal; #include "MidiDefs.h" #include "MidiDataFormat.h" #include "MidiFlow.h" #include "MidiAbstraction.h" +#include "json_defs.h" +#include "json_helpers.h" +#include "swd_helpers.h" + #include "MidiXProc.h" -namespace internal = ::Windows::Devices::Midi2::Internal; class CMidi2BluetoothMidiConfigurationManager; class CMidi2BluetoothMidiEndpointManager; diff --git a/src/api/Abstraction/DiagnosticsAbstraction/Midi2.DiagnosticsAbstraction.vcxproj b/src/api/Abstraction/DiagnosticsAbstraction/Midi2.DiagnosticsAbstraction.vcxproj index 3277b24a..f7520afe 100644 --- a/src/api/Abstraction/DiagnosticsAbstraction/Midi2.DiagnosticsAbstraction.vcxproj +++ b/src/api/Abstraction/DiagnosticsAbstraction/Midi2.DiagnosticsAbstraction.vcxproj @@ -30,7 +30,7 @@ 17.0 {093852BE-32B8-4EB8-814E-91410FFDB4F6} Win32Proj - 10.0.20348.0 + 10.0 Midi2.DiagnosticsAbstraction @@ -151,10 +151,10 @@ %(AdditionalIncludeDirectories);$(SolutionDir)inc;$(SolutionDir)VSFiles\intermediate\idl\$(Platform)\$(Configuration);$(IntDir);$(SolutionDir)Libs\AbstractionUtilities\inc Create pch.h - stdcpp17 + stdcpp20 - %(AdditionalDependencies);onecoreuap.lib;avrt.lib;$(CoreLibraryDependencies);AbstractionUtilities.lib + %(AdditionalDependencies);onecoreuap.lib;avrt.lib;$(CoreLibraryDependencies); Midi2.DiagnosticsAbstraction.def @@ -169,10 +169,10 @@ %(AdditionalIncludeDirectories);$(SolutionDir)inc;$(SolutionDir)VSFiles\intermediate\idl\$(Platform)\$(Configuration);$(IntDir);$(SolutionDir)Libs\AbstractionUtilities\inc Create pch.h - stdcpp17 + stdcpp20 - %(AdditionalDependencies);onecoreuap.lib;avrt.lib;$(CoreLibraryDependencies);AbstractionUtilities.lib + %(AdditionalDependencies);onecoreuap.lib;avrt.lib;$(CoreLibraryDependencies); Midi2.DiagnosticsAbstraction.def @@ -187,10 +187,10 @@ %(AdditionalIncludeDirectories);$(SolutionDir)inc;$(SolutionDir)VSFiles\intermediate\idl\$(Platform)\$(Configuration);$(IntDir);$(SolutionDir)Libs\AbstractionUtilities\inc Create pch.h - stdcpp17 + stdcpp20 - %(AdditionalDependencies);onecoreuap.lib;avrt.lib;$(CoreLibraryDependencies);AbstractionUtilities.lib + %(AdditionalDependencies);onecoreuap.lib;avrt.lib;$(CoreLibraryDependencies); Midi2.DiagnosticsAbstraction.def @@ -224,10 +224,10 @@ true Create pch.h - stdcpp17 + stdcpp20 - %(AdditionalDependencies);onecoreuap.lib;avrt.lib;$(CoreLibraryDependencies);AbstractionUtilities.lib + %(AdditionalDependencies);onecoreuap.lib;avrt.lib;$(CoreLibraryDependencies); Midi2.DiagnosticsAbstraction.def @@ -241,10 +241,10 @@ true Create pch.h - stdcpp17 + stdcpp20 - %(AdditionalDependencies);onecoreuap.lib;avrt.lib;$(CoreLibraryDependencies);AbstractionUtilities.lib + %(AdditionalDependencies);onecoreuap.lib;avrt.lib;$(CoreLibraryDependencies); Midi2.DiagnosticsAbstractionn.def @@ -268,10 +268,10 @@ true Create pch.h - stdcpp17 + stdcpp20 - %(AdditionalDependencies);onecoreuap.lib;avrt.lib;$(CoreLibraryDependencies);AbstractionUtilities.lib + %(AdditionalDependencies);onecoreuap.lib;avrt.lib;$(CoreLibraryDependencies); Midi2.DiagnosticsAbstraction.def @@ -317,12 +317,12 @@ - + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - + \ No newline at end of file diff --git a/src/api/Abstraction/DiagnosticsAbstraction/Midi2.DiagnosticsEndpointManager.cpp b/src/api/Abstraction/DiagnosticsAbstraction/Midi2.DiagnosticsEndpointManager.cpp index deaeaede..e953639e 100644 --- a/src/api/Abstraction/DiagnosticsAbstraction/Midi2.DiagnosticsEndpointManager.cpp +++ b/src/api/Abstraction/DiagnosticsAbstraction/Midi2.DiagnosticsEndpointManager.cpp @@ -26,8 +26,6 @@ CMidi2DiagnosticsEndpointManager::Initialize( ) { - OutputDebugString(L"" __FUNCTION__ " Enter"); - TraceLoggingWrite( MidiDiagnosticsAbstractionTelemetryProvider::Provider(), __FUNCTION__, @@ -56,7 +54,12 @@ CMidi2DiagnosticsEndpointManager::Initialize( HRESULT CMidi2DiagnosticsEndpointManager::CreateParentDevice() { - OutputDebugString(L"" __FUNCTION__); + TraceLoggingWrite( + MidiDiagnosticsAbstractionTelemetryProvider::Provider(), + __FUNCTION__, + TraceLoggingLevel(WINEVENT_LEVEL_INFO), + TraceLoggingPointer(this, "this") + ); // the parent device parameters are set by the transport (this) std::wstring parentDeviceName{ TRANSPORT_PARENT_DEVICE_NAME }; diff --git a/src/api/Abstraction/DiagnosticsAbstraction/packages.config b/src/api/Abstraction/DiagnosticsAbstraction/packages.config index 14c63219..a6e30b6e 100644 --- a/src/api/Abstraction/DiagnosticsAbstraction/packages.config +++ b/src/api/Abstraction/DiagnosticsAbstraction/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/src/api/Abstraction/DiagnosticsAbstraction/pch.h b/src/api/Abstraction/DiagnosticsAbstraction/pch.h index b717611c..4592f4d2 100644 --- a/src/api/Abstraction/DiagnosticsAbstraction/pch.h +++ b/src/api/Abstraction/DiagnosticsAbstraction/pch.h @@ -47,25 +47,26 @@ #include "SWDevice.h" #include #include "setupapi.h" -//#include "Devpkey.h" +#include "Devpkey.h" #include "strsafe.h" #include "wstring_util.h" // AbstractionUtilities -#include "endpoint_data_helpers.h" -#include "swd_property_builders.h" -#include "json_helpers.h" +#include "wstring_util.h" +namespace internal = ::Windows::Devices::Midi2::Internal; #include "MidiDefs.h" #include "MidiDataFormat.h" #include "MidiFlow.h" #include "MidiAbstraction.h" -#include "MidiXProc.h" +#include "json_defs.h" +#include "json_helpers.h" +#include "swd_helpers.h" -namespace internal = ::Windows::Devices::Midi2::Internal; +#include "MidiXProc.h" #include "abstraction_defs.h" diff --git a/src/api/Abstraction/KSAbstraction/Midi2.KSAbstraction.vcxproj b/src/api/Abstraction/KSAbstraction/Midi2.KSAbstraction.vcxproj index a0fa44b3..fae00ce3 100644 --- a/src/api/Abstraction/KSAbstraction/Midi2.KSAbstraction.vcxproj +++ b/src/api/Abstraction/KSAbstraction/Midi2.KSAbstraction.vcxproj @@ -30,7 +30,7 @@ 17.0 {22ABB513-5E77-474D-AA11-E56B8071EB4C} Win32Proj - 10.0.20348.0 + 10.0 @@ -138,10 +138,10 @@ Create pch.h true - stdcpp17 + stdcpp20 - %(AdditionalDependencies);onecoreuap.lib;ksuser.lib;avrt.lib;midixproc.lib;midiks.lib;midikscommon.lib;midiksenum.lib;AbstractionUtilities.lib;$(CoreLibraryDependencies) + %(AdditionalDependencies);onecoreuap.lib;ksuser.lib;avrt.lib;midixproc.lib;midiks.lib;midikscommon.lib;midiksenum.lib;$(CoreLibraryDependencies) Midi2.KSAbstraction.def @@ -158,10 +158,10 @@ Create pch.h true - stdcpp17 + stdcpp20 - %(AdditionalDependencies);onecoreuap.lib;ksuser.lib;avrt.lib;midixproc.lib;midiks.lib;midikscommon.lib;midiksenum.lib;AbstractionUtilities.lib;$(CoreLibraryDependencies) + %(AdditionalDependencies);onecoreuap.lib;ksuser.lib;avrt.lib;midixproc.lib;midiks.lib;midikscommon.lib;midiksenum.lib;$(CoreLibraryDependencies) Midi2.KSAbstraction.def @@ -178,10 +178,10 @@ Create pch.h true - stdcpp17 + stdcpp20 - %(AdditionalDependencies);onecoreuap.lib;ksuser.lib;avrt.lib;midixproc.lib;midiks.lib;midikscommon.lib;midiksenum.lib;AbstractionUtilities.lib;$(CoreLibraryDependencies) + %(AdditionalDependencies);onecoreuap.lib;ksuser.lib;avrt.lib;midixproc.lib;midiks.lib;midikscommon.lib;midiksenum.lib;$(CoreLibraryDependencies) Midi2.KSAbstraction.def @@ -198,10 +198,10 @@ Create pch.h true - stdcpp17 + stdcpp20 - %(AdditionalDependencies);onecoreuap.lib;ksuser.lib;avrt.lib;midixproc.lib;midiks.lib;midikscommon.lib;midiksenum.lib;AbstractionUtilities.lib;$(CoreLibraryDependencies) + %(AdditionalDependencies);onecoreuap.lib;ksuser.lib;avrt.lib;midixproc.lib;midiks.lib;midikscommon.lib;midiksenum.lib;$(CoreLibraryDependencies) Midi2.KSAbstraction.def @@ -213,7 +213,7 @@ $(IntDir)$(ProjectName).tlb - %(AdditionalDependencies);onecoreuap.lib;ksuser.lib;avrt.lib;midixproc.lib;midiks.lib;midikscommon.lib;midiksenum.lib;AbstractionUtilities.lib;$(CoreLibraryDependencies) + %(AdditionalDependencies);onecoreuap.lib;ksuser.lib;avrt.lib;midixproc.lib;midiks.lib;midikscommon.lib;midiksenum.lib;$(CoreLibraryDependencies) Midi2.KSAbstraction.def @@ -222,12 +222,12 @@ Create pch.h true - stdcpp17 + stdcpp20 - %(AdditionalDependencies);onecoreuap.lib;ksuser.lib;avrt.lib;midixproc.lib;midiks.lib;midikscommon.lib;midiksenum.lib;AbstractionUtilities.lib;$(CoreLibraryDependencies) + %(AdditionalDependencies);onecoreuap.lib;ksuser.lib;avrt.lib;midixproc.lib;midiks.lib;midikscommon.lib;midiksenum.lib;$(CoreLibraryDependencies) Midi2.KSAbstraction.def @@ -236,7 +236,7 @@ Create pch.h true - stdcpp17 + stdcpp20 MaxSpeed @@ -283,12 +283,12 @@ - + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - + \ No newline at end of file diff --git a/src/api/Abstraction/KSAbstraction/packages.config b/src/api/Abstraction/KSAbstraction/packages.config index 14c63219..a6e30b6e 100644 --- a/src/api/Abstraction/KSAbstraction/packages.config +++ b/src/api/Abstraction/KSAbstraction/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/src/api/Abstraction/KSAbstraction/pch.h b/src/api/Abstraction/KSAbstraction/pch.h index bb80cd83..427498e6 100644 --- a/src/api/Abstraction/KSAbstraction/pch.h +++ b/src/api/Abstraction/KSAbstraction/pch.h @@ -54,10 +54,24 @@ namespace json = winrt::Windows::Data::Json; #include "Devpkey.h" #include +#include "wstring_util.h" +namespace internal = ::Windows::Devices::Midi2::Internal; + +#include "MidiDefs.h" +#include "MidiDataFormat.h" +#include "MidiFlow.h" +#include "MidiAbstraction.h" + +#include "json_defs.h" +#include "json_helpers.h" +#include "swd_helpers.h" + +#include "MidiXProc.h" + + #include "strsafe.h" #include "abstraction_defs.h" -#include "midi_config_json.h" #include "midiabstraction_i.c" #include "midiabstraction.h" diff --git a/src/api/Abstraction/LoopbackMidiAbstraction/Midi2.LoopbackMidiAbstraction.vcxproj b/src/api/Abstraction/LoopbackMidiAbstraction/Midi2.LoopbackMidiAbstraction.vcxproj index 7d1e693c..65ca5646 100644 --- a/src/api/Abstraction/LoopbackMidiAbstraction/Midi2.LoopbackMidiAbstraction.vcxproj +++ b/src/api/Abstraction/LoopbackMidiAbstraction/Midi2.LoopbackMidiAbstraction.vcxproj @@ -30,7 +30,7 @@ 17.0 {0F94A751-9159-4A88-8A71-347151124548} Win32Proj - 10.0.20348.0 + 10.0 @@ -144,10 +144,10 @@ %(AdditionalIncludeDirectories);$(SolutionDir)inc;$(SolutionDir)VSFiles\intermediate\idl\$(Platform)\$(Configuration);$(IntDir);$(SolutionDir)Libs\AbstractionUtilities\inc Create pch.h - stdcpp17 + stdcpp20 - %(AdditionalDependencies);onecoreuap.lib;avrt.lib;$(CoreLibraryDependencies);AbstractionUtilities.lib + %(AdditionalDependencies);onecoreuap.lib;avrt.lib;$(CoreLibraryDependencies); Midi2.LoopbackMidiAbstraction.def @@ -162,10 +162,10 @@ %(AdditionalIncludeDirectories);$(SolutionDir)inc;$(SolutionDir)VSFiles\intermediate\idl\$(Platform)\$(Configuration);$(IntDir);$(SolutionDir)Libs\AbstractionUtilities\inc Create pch.h - stdcpp17 + stdcpp20 - %(AdditionalDependencies);onecoreuap.lib;avrt.lib;$(CoreLibraryDependencies);AbstractionUtilities.lib + %(AdditionalDependencies);onecoreuap.lib;avrt.lib;$(CoreLibraryDependencies); Midi2.LoopbackMidiAbstraction.def @@ -180,10 +180,10 @@ %(AdditionalIncludeDirectories);$(SolutionDir)inc;$(SolutionDir)VSFiles\intermediate\idl\$(Platform)\$(Configuration);$(IntDir);$(SolutionDir)Libs\AbstractionUtilities\inc Create pch.h - stdcpp17 + stdcpp20 - %(AdditionalDependencies);onecoreuap.lib;avrt.lib;$(CoreLibraryDependencies);AbstractionUtilities.lib + %(AdditionalDependencies);onecoreuap.lib;avrt.lib;$(CoreLibraryDependencies); Midi2.LoopbackMidiAbstraction.def @@ -217,10 +217,10 @@ true Create pch.h - stdcpp17 + stdcpp20 - %(AdditionalDependencies);onecoreuap.lib;avrt.lib;$(CoreLibraryDependencies);AbstractionUtilities.lib + %(AdditionalDependencies);onecoreuap.lib;avrt.lib;$(CoreLibraryDependencies); Midi2.LoopbackMidiAbstraction.def @@ -234,10 +234,10 @@ true Create pch.h - stdcpp17 + stdcpp20 - %(AdditionalDependencies);onecoreuap.lib;avrt.lib;$(CoreLibraryDependencies);AbstractionUtilities.lib + %(AdditionalDependencies);onecoreuap.lib;avrt.lib;$(CoreLibraryDependencies); Midi2.LoopbackMidiAbstraction.def @@ -261,10 +261,10 @@ true Create pch.h - stdcpp17 + stdcpp20 - %(AdditionalDependencies);onecoreuap.lib;avrt.lib;$(CoreLibraryDependencies);AbstractionUtilities.lib + %(AdditionalDependencies);onecoreuap.lib;avrt.lib;$(CoreLibraryDependencies); Midi2.LoopbackMidiAbstraction.def @@ -309,12 +309,12 @@ - + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - + \ No newline at end of file diff --git a/src/api/Abstraction/LoopbackMidiAbstraction/Midi2.LoopbackMidiConfigurationManager.cpp b/src/api/Abstraction/LoopbackMidiAbstraction/Midi2.LoopbackMidiConfigurationManager.cpp index c11f4ce5..fed39864 100644 --- a/src/api/Abstraction/LoopbackMidiAbstraction/Midi2.LoopbackMidiConfigurationManager.cpp +++ b/src/api/Abstraction/LoopbackMidiAbstraction/Midi2.LoopbackMidiConfigurationManager.cpp @@ -167,22 +167,22 @@ CMidi2LoopbackMidiConfigurationManager::UpdateConfiguration( // all good - internal::JsonSetBoolProperty( - responseObject, + auto successVal = json::JsonValue::CreateBooleanValue(true); + responseObject.SetNamedValue( MIDI_CONFIG_JSON_CONFIGURATION_RESPONSE_SUCCESS_PROPERTY_KEY, - true); + successVal); // update the return json with the new Ids - - internal::JsonSetWStringProperty( - responseObject, + auto endpointIdAVal = json::JsonValue::CreateStringValue(definitionA->CreatedEndpointInterfaceId); + responseObject.SetNamedValue( MIDI_CONFIG_JSON_ENDPOINT_LOOPBACK_DEVICE_RESPONSE_CREATED_ENDPOINT_A_ID_KEY, - definitionA->CreatedEndpointInterfaceId); + endpointIdAVal); - internal::JsonSetWStringProperty( - responseObject, + auto endpointIdBVal = json::JsonValue::CreateStringValue(definitionB->CreatedEndpointInterfaceId); + responseObject.SetNamedValue( MIDI_CONFIG_JSON_ENDPOINT_LOOPBACK_DEVICE_RESPONSE_CREATED_ENDPOINT_B_ID_KEY, - definitionB->CreatedEndpointInterfaceId); + endpointIdAVal); + } else { @@ -277,10 +277,10 @@ CMidi2LoopbackMidiConfigurationManager::UpdateConfiguration( { AbstractionState::Current().GetEndpointTable()->RemoveDevice(associationId.c_str()); - internal::JsonSetBoolProperty( - responseObject, + auto removeSuccessVal = json::JsonValue::CreateBooleanValue(true); + responseObject.SetNamedValue( MIDI_CONFIG_JSON_CONFIGURATION_RESPONSE_SUCCESS_PROPERTY_KEY, - true); + removeSuccessVal); } else { diff --git a/src/api/Abstraction/LoopbackMidiAbstraction/packages.config b/src/api/Abstraction/LoopbackMidiAbstraction/packages.config index 2884a839..09be25d9 100644 --- a/src/api/Abstraction/LoopbackMidiAbstraction/packages.config +++ b/src/api/Abstraction/LoopbackMidiAbstraction/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/src/api/Abstraction/LoopbackMidiAbstraction/pch.h b/src/api/Abstraction/LoopbackMidiAbstraction/pch.h index 94f64b1f..1aaa10fc 100644 --- a/src/api/Abstraction/LoopbackMidiAbstraction/pch.h +++ b/src/api/Abstraction/LoopbackMidiAbstraction/pch.h @@ -59,10 +59,10 @@ #include "SWDevice.h" #include #include "setupapi.h" -//#include "Devpkey.h" +#include "Devpkey.h" #include "strsafe.h" -#include "wstring_util.h" + //#pragma push_macro("GetObject") #undef GetObject @@ -73,19 +73,19 @@ namespace json = ::winrt::Windows::Data::Json; // AbstractionUtilities -#include "endpoint_data_helpers.h" -#include "swd_property_builders.h" -#include "json_helpers.h" -#include "swd_shared.h" +#include "wstring_util.h" +namespace internal = ::Windows::Devices::Midi2::Internal; #include "MidiDefs.h" #include "MidiDataFormat.h" #include "MidiFlow.h" #include "MidiAbstraction.h" -#include "MidiXProc.h" +#include "json_defs.h" +#include "json_helpers.h" +#include "swd_helpers.h" -namespace internal = ::Windows::Devices::Midi2::Internal; +#include "MidiXProc.h" #include "abstraction_defs.h" diff --git a/src/api/Abstraction/MidiSrvAbstraction/Midi2.MidiSrvAbstraction.cpp b/src/api/Abstraction/MidiSrvAbstraction/Midi2.MidiSrvAbstraction.cpp index 2a740327..ad3ad0d1 100644 --- a/src/api/Abstraction/MidiSrvAbstraction/Midi2.MidiSrvAbstraction.cpp +++ b/src/api/Abstraction/MidiSrvAbstraction/Midi2.MidiSrvAbstraction.cpp @@ -131,12 +131,20 @@ GetMidiSrvBindingHandle(handle_t* BindingHandle RETURN_IF_WIN32_ERROR(RpcStringBindingCompose( nullptr, - reinterpret_cast(MIDISRV_LRPC_PROTOCOL), + (RPC_WSTR)MIDISRV_LRPC_PROTOCOL, nullptr, - reinterpret_cast(MIDISRV_ENDPOINT), + (RPC_WSTR)MIDISRV_ENDPOINT, nullptr, &stringBinding)); + //RETURN_IF_WIN32_ERROR(RpcStringBindingCompose( + // nullptr, + // reinterpret_cast(MIDISRV_LRPC_PROTOCOL), + // nullptr, + // reinterpret_cast(MIDISRV_ENDPOINT), + // nullptr, + // &stringBinding)); + RETURN_IF_WIN32_ERROR(RpcBindingFromStringBinding( stringBinding, BindingHandle)); diff --git a/src/api/Abstraction/MidiSrvAbstraction/Midi2.MidiSrvAbstraction.vcxproj b/src/api/Abstraction/MidiSrvAbstraction/Midi2.MidiSrvAbstraction.vcxproj index 28dfb3dc..8d5b1200 100644 --- a/src/api/Abstraction/MidiSrvAbstraction/Midi2.MidiSrvAbstraction.vcxproj +++ b/src/api/Abstraction/MidiSrvAbstraction/Midi2.MidiSrvAbstraction.vcxproj @@ -30,7 +30,7 @@ 17.0 {9991FF5B-E0F0-4373-A7C2-20B1EFDE5F70} Win32Proj - 10.0.20348.0 + 10.0 @@ -144,7 +144,7 @@ %(AdditionalIncludeDirectories);$(SolutionDir)inc;$(SolutionDir)VSFiles\intermediate\idl\$(Platform)\$(Configuration);$(IntDir);$(SolutionDir)VSFiles\intermediate\midisrv\$(Platform)\$(Configuration) Create pch.h - stdcpp17 + stdcpp20 %(AdditionalDependencies);onecoreuap.lib;ksuser.lib;avrt.lib;midiks.lib;midixproc.lib;midikscommon.lib;midiksenum.lib;$(CoreLibraryDependencies) @@ -162,7 +162,7 @@ %(AdditionalIncludeDirectories);$(SolutionDir)inc;$(SolutionDir)VSFiles\intermediate\idl\$(Platform)\$(Configuration);$(IntDir);$(SolutionDir)VSFiles\intermediate\midisrv\$(Platform)\$(Configuration) Create pch.h - stdcpp17 + stdcpp20 %(AdditionalDependencies);onecoreuap.lib;ksuser.lib;avrt.lib;midiks.lib;midixproc.lib;midikscommon.lib;midiksenum.lib;$(CoreLibraryDependencies) @@ -180,7 +180,7 @@ %(AdditionalIncludeDirectories);$(SolutionDir)inc;$(SolutionDir)VSFiles\intermediate\idl\$(Platform)\$(Configuration);$(IntDir);$(SolutionDir)VSFiles\intermediate\midisrv\$(Platform)\$(Configuration) Create pch.h - stdcpp17 + stdcpp20 %(AdditionalDependencies);onecoreuap.lib;ksuser.lib;avrt.lib;midiks.lib;midixproc.lib;midikscommon.lib;midiksenum.lib;$(CoreLibraryDependencies) @@ -213,7 +213,7 @@ %(AdditionalIncludeDirectories);$(SolutionDir)inc;$(SolutionDir)VSFiles\intermediate\idl\$(Platform)\$(Configuration);$(IntDir);$(SolutionDir)VSFiles\intermediate\midisrv\$(Platform)\$(Configuration) Create pch.h - stdcpp17 + stdcpp20 %(AdditionalDependencies);onecoreuap.lib;ksuser.lib;avrt.lib;midiks.lib;midixproc.lib;midikscommon.lib;midiksenum.lib;$(CoreLibraryDependencies) @@ -231,7 +231,7 @@ %(AdditionalIncludeDirectories);$(SolutionDir)inc;$(SolutionDir)VSFiles\intermediate\idl\$(Platform)\$(Configuration);$(IntDir);$(SolutionDir)VSFiles\intermediate\midisrv\$(Platform)\$(Configuration) Create pch.h - stdcpp17 + stdcpp20 %(AdditionalDependencies);onecoreuap.lib;ksuser.lib;avrt.lib;midiks.lib;midixproc.lib;midikscommon.lib;midiksenum.lib;$(CoreLibraryDependencies) @@ -249,7 +249,7 @@ %(AdditionalIncludeDirectories);$(SolutionDir)inc;$(SolutionDir)VSFiles\intermediate\idl\$(Platform)\$(Configuration);$(IntDir);$(SolutionDir)VSFiles\intermediate\midisrv\$(Platform)\$(Configuration) Create pch.h - stdcpp17 + stdcpp20 %(AdditionalDependencies);onecoreuap.lib;ksuser.lib;avrt.lib;midiks.lib;midixproc.lib;midikscommon.lib;midiksenum.lib;$(CoreLibraryDependencies) @@ -298,12 +298,12 @@ - + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - + \ No newline at end of file diff --git a/src/api/Abstraction/MidiSrvAbstraction/packages.config b/src/api/Abstraction/MidiSrvAbstraction/packages.config index 14c63219..a6e30b6e 100644 --- a/src/api/Abstraction/MidiSrvAbstraction/packages.config +++ b/src/api/Abstraction/MidiSrvAbstraction/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/src/api/Abstraction/NetworkMidiAbstraction/Midi2.NetworkMidiAbstraction.vcxproj b/src/api/Abstraction/NetworkMidiAbstraction/Midi2.NetworkMidiAbstraction.vcxproj index b1e46bb7..0058ea9a 100644 --- a/src/api/Abstraction/NetworkMidiAbstraction/Midi2.NetworkMidiAbstraction.vcxproj +++ b/src/api/Abstraction/NetworkMidiAbstraction/Midi2.NetworkMidiAbstraction.vcxproj @@ -30,7 +30,7 @@ 17.0 {7E618284-6AA0-4FCE-9E4A-D895A5EE8E3C} Win32Proj - 10.0.20348.0 + 10.0 @@ -144,10 +144,10 @@ %(AdditionalIncludeDirectories);$(SolutionDir)inc;$(SolutionDir)VSFiles\intermediate\idl\$(Platform)\$(Configuration);$(IntDir);$(SolutionDir)Libs\AbstractionUtilities\inc Create pch.h - stdcpp17 + stdcpp20 - %(AdditionalDependencies);onecoreuap.lib;avrt.lib;$(CoreLibraryDependencies);AbstractionUtilities.lib + %(AdditionalDependencies);onecoreuap.lib;avrt.lib;$(CoreLibraryDependencies); Midi2.NetworkMidiAbstraction.def @@ -162,10 +162,10 @@ %(AdditionalIncludeDirectories);$(SolutionDir)inc;$(SolutionDir)VSFiles\intermediate\idl\$(Platform)\$(Configuration);$(IntDir);$(SolutionDir)Libs\AbstractionUtilities\inc Create pch.h - stdcpp17 + stdcpp20 - %(AdditionalDependencies);onecoreuap.lib;avrt.lib;$(CoreLibraryDependencies);AbstractionUtilities.lib + %(AdditionalDependencies);onecoreuap.lib;avrt.lib;$(CoreLibraryDependencies); Midi2.NetworkMidiAbstraction.def @@ -180,10 +180,10 @@ %(AdditionalIncludeDirectories);$(SolutionDir)inc;$(SolutionDir)VSFiles\intermediate\idl\$(Platform)\$(Configuration);$(IntDir);$(SolutionDir)Libs\AbstractionUtilities\inc Create pch.h - stdcpp17 + stdcpp20 - %(AdditionalDependencies);onecoreuap.lib;avrt.lib;$(CoreLibraryDependencies);AbstractionUtilities.lib + %(AdditionalDependencies);onecoreuap.lib;avrt.lib;$(CoreLibraryDependencies); Midi2.NetworkMidiAbstraction.def @@ -217,10 +217,10 @@ true Create pch.h - stdcpp17 + stdcpp20 - %(AdditionalDependencies);onecoreuap.lib;avrt.lib;$(CoreLibraryDependencies);AbstractionUtilities.lib + %(AdditionalDependencies);onecoreuap.lib;avrt.lib;$(CoreLibraryDependencies); Midi2.NetworkMidiAbstraction.def @@ -234,10 +234,10 @@ true Create pch.h - stdcpp17 + stdcpp20 - %(AdditionalDependencies);onecoreuap.lib;avrt.lib;$(CoreLibraryDependencies);AbstractionUtilities.lib + %(AdditionalDependencies);onecoreuap.lib;avrt.lib;$(CoreLibraryDependencies); Midi2.NetworkMidiAbstraction.def @@ -261,10 +261,10 @@ true Create pch.h - stdcpp17 + stdcpp20 - %(AdditionalDependencies);onecoreuap.lib;avrt.lib;$(CoreLibraryDependencies);AbstractionUtilities.lib + %(AdditionalDependencies);onecoreuap.lib;avrt.lib;$(CoreLibraryDependencies); Midi2.NetworkMidiAbstraction.def @@ -313,12 +313,12 @@ - + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - + \ No newline at end of file diff --git a/src/api/Abstraction/NetworkMidiAbstraction/packages.config b/src/api/Abstraction/NetworkMidiAbstraction/packages.config index 14c63219..a6e30b6e 100644 --- a/src/api/Abstraction/NetworkMidiAbstraction/packages.config +++ b/src/api/Abstraction/NetworkMidiAbstraction/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/src/api/Abstraction/NetworkMidiAbstraction/pch.h b/src/api/Abstraction/NetworkMidiAbstraction/pch.h index 593f54f2..a602981d 100644 --- a/src/api/Abstraction/NetworkMidiAbstraction/pch.h +++ b/src/api/Abstraction/NetworkMidiAbstraction/pch.h @@ -62,18 +62,19 @@ namespace json = ::winrt::Windows::Data::Json; // AbstractionUtilities -#include "endpoint_data_helpers.h" -#include "swd_property_builders.h" -#include "json_helpers.h" +#include "wstring_util.h" +namespace internal = ::Windows::Devices::Midi2::Internal; #include "MidiDefs.h" #include "MidiDataFormat.h" #include "MidiFlow.h" #include "MidiAbstraction.h" -#include "MidiXProc.h" +#include "json_defs.h" +#include "json_helpers.h" +#include "swd_helpers.h" -namespace internal = ::Windows::Devices::Midi2::Internal; +#include "MidiXProc.h" #include "Midi2NetworkMidiAbstraction_i.c" #include "Midi2NetworkMidiAbstraction.h" diff --git a/src/api/Abstraction/SampleAbstraction/Midi2.SampleAbstraction.vcxproj b/src/api/Abstraction/SampleAbstraction/Midi2.SampleAbstraction.vcxproj index 07de8143..01130e41 100644 --- a/src/api/Abstraction/SampleAbstraction/Midi2.SampleAbstraction.vcxproj +++ b/src/api/Abstraction/SampleAbstraction/Midi2.SampleAbstraction.vcxproj @@ -30,7 +30,7 @@ 17.0 {3D391727-2A65-4BA6-A730-EC10406AF543} Win32Proj - 10.0.20348.0 + 10.0 @@ -144,10 +144,10 @@ %(AdditionalIncludeDirectories);$(SolutionDir)inc;$(SolutionDir)VSFiles\intermediate\idl\$(Platform)\$(Configuration);$(IntDir);$(SolutionDir)Libs\AbstractionUtilities\inc Create pch.h - stdcpp17 + stdcpp20 - %(AdditionalDependencies);onecoreuap.lib;avrt.lib;$(CoreLibraryDependencies);AbstractionUtilities.lib + %(AdditionalDependencies);onecoreuap.lib;avrt.lib;$(CoreLibraryDependencies); Midi2.SampleAbstraction.def @@ -162,10 +162,10 @@ %(AdditionalIncludeDirectories);$(SolutionDir)inc;$(SolutionDir)VSFiles\intermediate\idl\$(Platform)\$(Configuration);$(IntDir);$(SolutionDir)Libs\AbstractionUtilities\inc Create pch.h - stdcpp17 + stdcpp20 - %(AdditionalDependencies);onecoreuap.lib;avrt.lib;$(CoreLibraryDependencies);AbstractionUtilities.lib + %(AdditionalDependencies);onecoreuap.lib;avrt.lib;$(CoreLibraryDependencies); Midi2.SampleAbstraction.def @@ -180,10 +180,10 @@ %(AdditionalIncludeDirectories);$(SolutionDir)inc;$(SolutionDir)VSFiles\intermediate\idl\$(Platform)\$(Configuration);$(IntDir);$(SolutionDir)Libs\AbstractionUtilities\inc Create pch.h - stdcpp17 + stdcpp20 - %(AdditionalDependencies);onecoreuap.lib;avrt.lib;$(CoreLibraryDependencies);AbstractionUtilities.lib + %(AdditionalDependencies);onecoreuap.lib;avrt.lib;$(CoreLibraryDependencies); Midi2.SampleAbstraction.def @@ -217,10 +217,10 @@ true Create pch.h - stdcpp17 + stdcpp20 - %(AdditionalDependencies);onecoreuap.lib;avrt.lib;$(CoreLibraryDependencies);AbstractionUtilities.lib + %(AdditionalDependencies);onecoreuap.lib;avrt.lib;$(CoreLibraryDependencies); Midi2.SampleAbstraction.def @@ -234,10 +234,10 @@ true Create pch.h - stdcpp17 + stdcpp20 - %(AdditionalDependencies);onecoreuap.lib;avrt.lib;$(CoreLibraryDependencies);AbstractionUtilities.lib + %(AdditionalDependencies);onecoreuap.lib;avrt.lib;$(CoreLibraryDependencies); Midi2.SampleAbstraction.def @@ -261,10 +261,10 @@ true Create pch.h - stdcpp17 + stdcpp20 - %(AdditionalDependencies);onecoreuap.lib;avrt.lib;$(CoreLibraryDependencies);AbstractionUtilities.lib + %(AdditionalDependencies);onecoreuap.lib;avrt.lib;$(CoreLibraryDependencies); Midi2.SampleAbstraction.def @@ -303,12 +303,12 @@ - + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - + \ No newline at end of file diff --git a/src/api/Abstraction/SampleAbstraction/packages.config b/src/api/Abstraction/SampleAbstraction/packages.config index 14c63219..a6e30b6e 100644 --- a/src/api/Abstraction/SampleAbstraction/packages.config +++ b/src/api/Abstraction/SampleAbstraction/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/src/api/Abstraction/SampleAbstraction/pch.h b/src/api/Abstraction/SampleAbstraction/pch.h index 9f95eac3..118b86b6 100644 --- a/src/api/Abstraction/SampleAbstraction/pch.h +++ b/src/api/Abstraction/SampleAbstraction/pch.h @@ -39,15 +39,18 @@ #include // AbstractionUtilities -#include "endpoint_data_helpers.h" -#include "swd_property_builders.h" -#include "json_helpers.h" +#include "wstring_util.h" +namespace internal = ::Windows::Devices::Midi2::Internal; #include "MidiDefs.h" #include "MidiDataFormat.h" #include "MidiFlow.h" #include "MidiAbstraction.h" +#include "json_defs.h" +#include "json_helpers.h" +#include "swd_helpers.h" + #include "MidiXProc.h" namespace internal = ::Windows::Devices::Midi2::Internal; diff --git a/src/api/Abstraction/VirtualMidiAbstraction/Midi2.VirtualMidiAbstraction.vcxproj b/src/api/Abstraction/VirtualMidiAbstraction/Midi2.VirtualMidiAbstraction.vcxproj index 7fef3cb1..d6745e27 100644 --- a/src/api/Abstraction/VirtualMidiAbstraction/Midi2.VirtualMidiAbstraction.vcxproj +++ b/src/api/Abstraction/VirtualMidiAbstraction/Midi2.VirtualMidiAbstraction.vcxproj @@ -30,7 +30,7 @@ 17.0 {03009B2B-E3E8-49DC-A0D6-0FA90AE3B15B} Win32Proj - 10.0.20348.0 + 10.0 @@ -144,10 +144,10 @@ %(AdditionalIncludeDirectories);$(SolutionDir)inc;$(SolutionDir)VSFiles\intermediate\idl\$(Platform)\$(Configuration);$(IntDir);$(SolutionDir)Libs\AbstractionUtilities\inc Create pch.h - stdcpp17 + stdcpp20 - %(AdditionalDependencies);onecoreuap.lib;avrt.lib;$(CoreLibraryDependencies);AbstractionUtilities.lib + %(AdditionalDependencies);onecoreuap.lib;avrt.lib;$(CoreLibraryDependencies); Midi2.VirtualMidiAbstraction.def @@ -162,10 +162,10 @@ %(AdditionalIncludeDirectories);$(SolutionDir)inc;$(SolutionDir)VSFiles\intermediate\idl\$(Platform)\$(Configuration);$(IntDir);$(SolutionDir)Libs\AbstractionUtilities\inc Create pch.h - stdcpp17 + stdcpp20 - %(AdditionalDependencies);onecoreuap.lib;avrt.lib;$(CoreLibraryDependencies);AbstractionUtilities.lib + %(AdditionalDependencies);onecoreuap.lib;avrt.lib;$(CoreLibraryDependencies); Midi2.VirtualMidiAbstraction.def @@ -180,10 +180,10 @@ %(AdditionalIncludeDirectories);$(SolutionDir)inc;$(SolutionDir)VSFiles\intermediate\idl\$(Platform)\$(Configuration);$(IntDir);$(SolutionDir)Libs\AbstractionUtilities\inc Create pch.h - stdcpp17 + stdcpp20 - %(AdditionalDependencies);onecoreuap.lib;avrt.lib;$(CoreLibraryDependencies);AbstractionUtilities.lib + %(AdditionalDependencies);onecoreuap.lib;avrt.lib;$(CoreLibraryDependencies); Midi2.VirtualMidiAbstraction.def @@ -217,10 +217,10 @@ true Create pch.h - stdcpp17 + stdcpp20 - %(AdditionalDependencies);onecoreuap.lib;avrt.lib;$(CoreLibraryDependencies);AbstractionUtilities.lib + %(AdditionalDependencies);onecoreuap.lib;avrt.lib;$(CoreLibraryDependencies); Midi2.VirtualMidiAbstraction.def @@ -234,10 +234,10 @@ true Create pch.h - stdcpp17 + stdcpp20 - %(AdditionalDependencies);onecoreuap.lib;avrt.lib;$(CoreLibraryDependencies);AbstractionUtilities.lib + %(AdditionalDependencies);onecoreuap.lib;avrt.lib;$(CoreLibraryDependencies); Midi2.VirtualMidiAbstraction.def @@ -261,10 +261,10 @@ true Create pch.h - stdcpp17 + stdcpp20 - %(AdditionalDependencies);onecoreuap.lib;avrt.lib;$(CoreLibraryDependencies);AbstractionUtilities.lib + %(AdditionalDependencies);onecoreuap.lib;avrt.lib;$(CoreLibraryDependencies); Midi2.VirtualMidiAbstraction.def @@ -308,12 +308,12 @@ - + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - + \ No newline at end of file diff --git a/src/api/Abstraction/VirtualMidiAbstraction/Midi2.VirtualMidiConfigurationManager.cpp b/src/api/Abstraction/VirtualMidiAbstraction/Midi2.VirtualMidiConfigurationManager.cpp index ea66e93f..cfb97557 100644 --- a/src/api/Abstraction/VirtualMidiAbstraction/Midi2.VirtualMidiConfigurationManager.cpp +++ b/src/api/Abstraction/VirtualMidiAbstraction/Midi2.VirtualMidiConfigurationManager.cpp @@ -86,7 +86,7 @@ CMidi2VirtualMidiConfigurationManager::UpdateConfiguration( return E_FAIL; } - auto createArray = internal::JsonGetArrayProperty(jsonObject, MIDI_CONFIG_JSON_ENDPOINT_VIRTUAL_DEVICES_CREATE_ARRAY_KEY); + auto createArray = jsonObject.GetNamedArray(MIDI_CONFIG_JSON_ENDPOINT_VIRTUAL_DEVICES_CREATE_ARRAY_KEY, nullptr); if (createArray == nullptr || createArray.Size() == 0) { @@ -107,25 +107,10 @@ CMidi2VirtualMidiConfigurationManager::UpdateConfiguration( { MidiVirtualDeviceEndpointEntry deviceEntry; - deviceEntry.VirtualEndpointAssociationId = internal::JsonGetWStringProperty( - jsonEntry, - MIDI_CONFIG_JSON_ENDPOINT_VIRTUAL_DEVICE_ASSOCIATION_ID_PROPERTY_KEY, - L""); - - deviceEntry.ShortUniqueId = internal::JsonGetWStringProperty( - jsonEntry, - MIDI_CONFIG_JSON_ENDPOINT_COMMON_UNIQUE_ID_PROPERTY, - L""); - - deviceEntry.BaseEndpointName = internal::JsonGetWStringProperty( - jsonEntry, - MIDI_CONFIG_JSON_ENDPOINT_COMMON_NAME_PROPERTY, - L""); - - deviceEntry.Description = internal::JsonGetWStringProperty( - jsonEntry, - MIDI_CONFIG_JSON_ENDPOINT_COMMON_DESCRIPTION_PROPERTY, - L""); + deviceEntry.VirtualEndpointAssociationId = jsonEntry.GetNamedString(MIDI_CONFIG_JSON_ENDPOINT_VIRTUAL_DEVICE_ASSOCIATION_ID_PROPERTY_KEY, L""); + deviceEntry.ShortUniqueId = jsonEntry.GetNamedString(MIDI_CONFIG_JSON_ENDPOINT_COMMON_UNIQUE_ID_PROPERTY, L""); + deviceEntry.BaseEndpointName = jsonEntry.GetNamedString(MIDI_CONFIG_JSON_ENDPOINT_COMMON_NAME_PROPERTY, L""); + deviceEntry.Description = jsonEntry.GetNamedString(MIDI_CONFIG_JSON_ENDPOINT_COMMON_DESCRIPTION_PROPERTY, L""); // TODO: if no association id, or it already exists in the table, bail @@ -154,10 +139,10 @@ CMidi2VirtualMidiConfigurationManager::UpdateConfiguration( // TODO: Actual Success or fail response - internal::JsonSetBoolProperty( - responseObject, + auto responseVal = json::JsonValue::CreateBooleanValue(true); + responseObject.SetNamedValue( MIDI_CONFIG_JSON_CONFIGURATION_RESPONSE_SUCCESS_PROPERTY_KEY, - true); + responseVal); TraceLoggingWrite( MidiVirtualMidiAbstractionTelemetryProvider::Provider(), diff --git a/src/api/Abstraction/VirtualMidiAbstraction/packages.config b/src/api/Abstraction/VirtualMidiAbstraction/packages.config index 14c63219..a6e30b6e 100644 --- a/src/api/Abstraction/VirtualMidiAbstraction/packages.config +++ b/src/api/Abstraction/VirtualMidiAbstraction/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/src/api/Abstraction/VirtualMidiAbstraction/pch.h b/src/api/Abstraction/VirtualMidiAbstraction/pch.h index 5f908c1f..70a4315f 100644 --- a/src/api/Abstraction/VirtualMidiAbstraction/pch.h +++ b/src/api/Abstraction/VirtualMidiAbstraction/pch.h @@ -62,24 +62,23 @@ #include "SWDevice.h" #include #include "setupapi.h" -//#include "Devpkey.h" +#include "Devpkey.h" #include "strsafe.h" #include "wstring_util.h" // AbstractionUtilities -#include "endpoint_data_helpers.h" -#include "swd_property_builders.h" -#include "json_helpers.h" +#include "wstring_util.h" +namespace internal = ::Windows::Devices::Midi2::Internal; #include "MidiDefs.h" #include "MidiDataFormat.h" #include "MidiFlow.h" #include "MidiAbstraction.h" -#include "MidiXProc.h" - -namespace internal = ::Windows::Devices::Midi2::Internal; +#include "json_defs.h" +#include "json_helpers.h" +#include "swd_helpers.h" #include "abstraction_defs.h" @@ -95,7 +94,6 @@ namespace internal = ::Windows::Devices::Midi2::Internal; #include "dllmain.h" -#include "swd_shared.h" class CMidi2VirtualMidiEndpointManager; class CMidi2VirtualMidiBiDi; diff --git a/src/api/Abstraction/VirtualPatchBayAbstraction/Midi2.VirtualPatchBayAbstraction.vcxproj b/src/api/Abstraction/VirtualPatchBayAbstraction/Midi2.VirtualPatchBayAbstraction.vcxproj index 4fb3129a..f5e55f1b 100644 --- a/src/api/Abstraction/VirtualPatchBayAbstraction/Midi2.VirtualPatchBayAbstraction.vcxproj +++ b/src/api/Abstraction/VirtualPatchBayAbstraction/Midi2.VirtualPatchBayAbstraction.vcxproj @@ -30,7 +30,7 @@ 17.0 {7427BC7A-4247-42B0-AC9B-7DA10418AA9D} Win32Proj - 10.0.20348.0 + 10.0 @@ -144,10 +144,10 @@ %(AdditionalIncludeDirectories);$(SolutionDir)inc;$(SolutionDir)VSFiles\intermediate\idl\$(Platform)\$(Configuration);$(IntDir);$(SolutionDir)Libs\AbstractionUtilities\inc Create pch.h - stdcpp17 + stdcpp20 - %(AdditionalDependencies);onecoreuap.lib;avrt.lib;$(CoreLibraryDependencies);AbstractionUtilities.lib + %(AdditionalDependencies);onecoreuap.lib;avrt.lib;$(CoreLibraryDependencies); Midi2.VirtualPatchBayAbstraction.def @@ -162,10 +162,10 @@ %(AdditionalIncludeDirectories);$(SolutionDir)inc;$(SolutionDir)VSFiles\intermediate\idl\$(Platform)\$(Configuration);$(IntDir);$(SolutionDir)Libs\AbstractionUtilities\inc Create pch.h - stdcpp17 + stdcpp20 - %(AdditionalDependencies);onecoreuap.lib;avrt.lib;$(CoreLibraryDependencies);AbstractionUtilities.lib + %(AdditionalDependencies);onecoreuap.lib;avrt.lib;$(CoreLibraryDependencies); Midi2.VirtualPatchBayAbstraction.def @@ -180,10 +180,10 @@ %(AdditionalIncludeDirectories);$(SolutionDir)inc;$(SolutionDir)VSFiles\intermediate\idl\$(Platform)\$(Configuration);$(IntDir);$(SolutionDir)Libs\AbstractionUtilities\inc Create pch.h - stdcpp17 + stdcpp20 - %(AdditionalDependencies);onecoreuap.lib;avrt.lib;$(CoreLibraryDependencies);AbstractionUtilities.lib + %(AdditionalDependencies);onecoreuap.lib;avrt.lib;$(CoreLibraryDependencies); Midi2.VirtualPatchBayAbstraction.def @@ -217,10 +217,10 @@ true Create pch.h - stdcpp17 + stdcpp20 - %(AdditionalDependencies);onecoreuap.lib;avrt.lib;$(CoreLibraryDependencies);AbstractionUtilities.lib + %(AdditionalDependencies);onecoreuap.lib;avrt.lib;$(CoreLibraryDependencies); Midi2.VirtualPatchBayAbstraction.def @@ -234,10 +234,10 @@ true Create pch.h - stdcpp17 + stdcpp20 - %(AdditionalDependencies);onecoreuap.lib;avrt.lib;$(CoreLibraryDependencies);AbstractionUtilities.lib + %(AdditionalDependencies);onecoreuap.lib;avrt.lib;$(CoreLibraryDependencies); Midi2.VirtualPatchBayAbstraction.def @@ -261,10 +261,10 @@ true Create pch.h - stdcpp17 + stdcpp20 - %(AdditionalDependencies);onecoreuap.lib;avrt.lib;$(CoreLibraryDependencies);AbstractionUtilities.lib + %(AdditionalDependencies);onecoreuap.lib;avrt.lib;$(CoreLibraryDependencies); Midi2.VirtualPatchBayAbstraction.def @@ -305,12 +305,12 @@ - + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - + \ No newline at end of file diff --git a/src/api/Abstraction/VirtualPatchBayAbstraction/packages.config b/src/api/Abstraction/VirtualPatchBayAbstraction/packages.config index 2884a839..09be25d9 100644 --- a/src/api/Abstraction/VirtualPatchBayAbstraction/packages.config +++ b/src/api/Abstraction/VirtualPatchBayAbstraction/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/src/api/Abstraction/VirtualPatchBayAbstraction/pch.h b/src/api/Abstraction/VirtualPatchBayAbstraction/pch.h index c159d2d1..3ac61112 100644 --- a/src/api/Abstraction/VirtualPatchBayAbstraction/pch.h +++ b/src/api/Abstraction/VirtualPatchBayAbstraction/pch.h @@ -65,15 +65,18 @@ namespace json = ::winrt::Windows::Data::Json; //#include "Devpkey.h" // AbstractionUtilities -#include "endpoint_data_helpers.h" -#include "swd_property_builders.h" -#include "json_helpers.h" +#include "wstring_util.h" +namespace internal = ::Windows::Devices::Midi2::Internal; #include "MidiDefs.h" #include "MidiDataFormat.h" #include "MidiFlow.h" #include "MidiAbstraction.h" +#include "json_defs.h" +#include "json_helpers.h" +#include "swd_helpers.h" + #include "MidiXProc.h" namespace internal = ::Windows::Devices::Midi2::Internal; diff --git a/src/api/Client/Midi2Client-Projection/Windows.Devices.Midi2.NET.csproj b/src/api/Client/Midi2Client-Projection/Windows.Devices.Midi2.NET.csproj index 31ec0f9a..534e21d2 100644 --- a/src/api/Client/Midi2Client-Projection/Windows.Devices.Midi2.NET.csproj +++ b/src/api/Client/Midi2Client-Projection/Windows.Devices.Midi2.NET.csproj @@ -26,7 +26,7 @@ - + diff --git a/src/api/Client/Midi2Client-Projection/nuget/Windows.Devices.Midi2.nuspec b/src/api/Client/Midi2Client-Projection/nuget/Windows.Devices.Midi2.nuspec index 57b51dc0..5c79ffb3 100644 --- a/src/api/Client/Midi2Client-Projection/nuget/Windows.Devices.Midi2.nuspec +++ b/src/api/Client/Midi2Client-Projection/nuget/Windows.Devices.Midi2.nuspec @@ -2,7 +2,7 @@ Windows.Devices.Midi2 - 1.0.0-preview.5-0172 + 1.0.0-preview.5-0173 Microsoft Corporation Windows MIDI Services API. Minimum package necessary to use Windows MIDI Services from an app on a PC that has Windows MIDI Services installed. MIT diff --git a/src/api/Client/Midi2Client/MidiService.cpp b/src/api/Client/Midi2Client/MidiService.cpp index 89e91a39..085c41db 100644 --- a/src/api/Client/Midi2Client/MidiService.cpp +++ b/src/api/Client/Midi2Client/MidiService.cpp @@ -263,7 +263,7 @@ namespace winrt::Windows::Devices::Midi2::implementation if (jsonObject != nullptr) { - auto sessionJsonArray = internal::JsonGetArrayProperty(jsonObject, MIDI_SESSION_TRACKER_JSON_RESULT_SESSION_ARRAY_PROPERTY_KEY); + auto sessionJsonArray = jsonObject.GetNamedArray(MIDI_SESSION_TRACKER_JSON_RESULT_SESSION_ARRAY_PROPERTY_KEY); GUID defaultGuid{}; std::chrono::time_point noTime; @@ -279,18 +279,18 @@ namespace winrt::Windows::Devices::Midi2::implementation sessionObject->InternalInitialize( internal::JsonGetGuidProperty(sessionJson, MIDI_SESSION_TRACKER_JSON_RESULT_SESSION_ID_PROPERTY_KEY, defaultGuid), - internal::JsonGetWStringProperty(sessionJson, MIDI_SESSION_TRACKER_JSON_RESULT_SESSION_NAME_PROPERTY_KEY, L"").c_str(), - std::stol(internal::JsonGetWStringProperty(sessionJson, MIDI_SESSION_TRACKER_JSON_RESULT_PROCESS_ID_PROPERTY_KEY, L"0")), - internal::JsonGetWStringProperty(sessionJson, MIDI_SESSION_TRACKER_JSON_RESULT_PROCESS_NAME_PROPERTY_KEY, L"").c_str(), + sessionJson.GetNamedString(MIDI_SESSION_TRACKER_JSON_RESULT_SESSION_NAME_PROPERTY_KEY, L"").c_str(), + std::stol(sessionJson.GetNamedString(MIDI_SESSION_TRACKER_JSON_RESULT_PROCESS_ID_PROPERTY_KEY, L"0").c_str()), + sessionJson.GetNamedString(MIDI_SESSION_TRACKER_JSON_RESULT_PROCESS_NAME_PROPERTY_KEY, L"").c_str(), winrt::clock::from_sys(startTime) ); // Add connections - auto connectionsJsonArray = internal::JsonGetArrayProperty(sessionJson, MIDI_SESSION_TRACKER_JSON_RESULT_CONNECTION_ARRAY_PROPERTY_KEY); + auto connectionsJsonArray = sessionJson.GetNamedArray(MIDI_SESSION_TRACKER_JSON_RESULT_CONNECTION_ARRAY_PROPERTY_KEY, nullptr); - if (connectionsJsonArray.Size() > 0) + if (connectionsJsonArray != nullptr && connectionsJsonArray.Size() > 0) { for (uint32_t j = 0; j < connectionsJsonArray.Size(); j++) { @@ -300,8 +300,8 @@ namespace winrt::Windows::Devices::Midi2::implementation auto earliestConnectionTime = internal::JsonGetDateTimeProperty(connectionJson, MIDI_SESSION_TRACKER_JSON_RESULT_CONNECTION_TIME_PROPERTY_KEY, noTime); connectionObject->InternalInitialize( - internal::JsonGetWStringProperty(connectionJson, MIDI_SESSION_TRACKER_JSON_RESULT_CONNECTION_ENDPOINT_ID_PROPERTY_KEY, L"").c_str(), - (uint16_t)(internal::JsonGetDoubleProperty(connectionJson, MIDI_SESSION_TRACKER_JSON_RESULT_CONNECTION_COUNT_PROPERTY_KEY, 0)), + connectionJson.GetNamedString(MIDI_SESSION_TRACKER_JSON_RESULT_CONNECTION_ENDPOINT_ID_PROPERTY_KEY, L"").c_str(), + (uint16_t)(connectionJson.GetNamedNumber(MIDI_SESSION_TRACKER_JSON_RESULT_CONNECTION_COUNT_PROPERTY_KEY, 0)), winrt::clock::from_sys(earliestConnectionTime) ); @@ -374,80 +374,68 @@ namespace winrt::Windows::Devices::Midi2::implementation // build Endpoint A - internal::JsonSetWStringProperty( - endpointDeviceAObject, + endpointDeviceAObject.SetNamedValue( MIDI_CONFIG_JSON_ENDPOINT_COMMON_NAME_PROPERTY, - endpointDefinitionA.Name().c_str()); + json::JsonValue::CreateStringValue(endpointDefinitionA.Name().c_str())); - internal::JsonSetWStringProperty( - endpointDeviceAObject, + endpointDeviceAObject.SetNamedValue( MIDI_CONFIG_JSON_ENDPOINT_COMMON_DESCRIPTION_PROPERTY, - endpointDefinitionA.Description().c_str()); + json::JsonValue::CreateStringValue(endpointDefinitionA.Description().c_str())); - internal::JsonSetWStringProperty( - endpointDeviceAObject, + endpointDeviceAObject.SetNamedValue( MIDI_CONFIG_JSON_ENDPOINT_COMMON_UNIQUE_ID_PROPERTY, - endpointDefinitionA.UniqueId().c_str()); - + json::JsonValue::CreateStringValue(endpointDefinitionA.UniqueId().c_str())); //MIDI_CONFIG_JSON_ENDPOINT_COMMON_MANUFACTURER_PROPERTY // build Endpoint B - internal::JsonSetWStringProperty( - endpointDeviceBObject, + endpointDeviceBObject.SetNamedValue( MIDI_CONFIG_JSON_ENDPOINT_COMMON_NAME_PROPERTY, - endpointDefinitionB.Name().c_str()); + json::JsonValue::CreateStringValue(endpointDefinitionB.Name().c_str())); - internal::JsonSetWStringProperty( - endpointDeviceBObject, + endpointDeviceBObject.SetNamedValue( MIDI_CONFIG_JSON_ENDPOINT_COMMON_DESCRIPTION_PROPERTY, - endpointDefinitionB.Description().c_str()); + json::JsonValue::CreateStringValue(endpointDefinitionB.Description().c_str())); - internal::JsonSetWStringProperty( - endpointDeviceBObject, + endpointDeviceBObject.SetNamedValue( MIDI_CONFIG_JSON_ENDPOINT_COMMON_UNIQUE_ID_PROPERTY, - endpointDefinitionB.UniqueId().c_str()); + json::JsonValue::CreateStringValue(endpointDefinitionB.UniqueId().c_str())); + // create the association object with the two devices as children - internal::JsonSetObjectProperty( - endpointAssociationObject, + endpointAssociationObject.SetNamedValue( MIDI_CONFIG_JSON_ENDPOINT_LOOPBACK_DEVICE_ENDPOINT_A_KEY, endpointDeviceAObject); - internal::JsonSetObjectProperty( - endpointAssociationObject, + endpointAssociationObject.SetNamedValue( MIDI_CONFIG_JSON_ENDPOINT_LOOPBACK_DEVICE_ENDPOINT_B_KEY, endpointDeviceBObject); // create the creation node with the association object as the child property - internal::JsonSetObjectProperty( - endpointCreationObject, + endpointCreationObject.SetNamedValue( internal::GuidToString(associationId), endpointAssociationObject); // create the abstraction object with the child creation node - internal::JsonSetObjectProperty( - abstractionObject, + abstractionObject.SetNamedValue( MIDI_CONFIG_JSON_ENDPOINT_LOOPBACK_DEVICES_CREATE_KEY, endpointCreationObject); // create the main node - internal::JsonSetObjectProperty( - topLevelTransportPluginSettingsObject, + topLevelTransportPluginSettingsObject.SetNamedValue( internal::GuidToString(loopbackDeviceAbstractionId), abstractionObject); // wrap it all up so the json is valid - internal::JsonSetObjectProperty( - wrapperObject, + wrapperObject.SetNamedValue( MIDI_CONFIG_JSON_TRANSPORT_PLUGIN_SETTINGS_OBJECT, topLevelTransportPluginSettingsObject); @@ -456,14 +444,14 @@ namespace winrt::Windows::Devices::Midi2::implementation json::JsonObject responseObject = InternalSendConfigurationJsonAndGetResponse(loopbackDeviceAbstractionId, wrapperObject); // parse the results - auto successResult = internal::JsonGetBoolProperty(responseObject, MIDI_CONFIG_JSON_CONFIGURATION_RESPONSE_SUCCESS_PROPERTY_KEY, false); + auto successResult = responseObject.GetNamedBoolean(MIDI_CONFIG_JSON_CONFIGURATION_RESPONSE_SUCCESS_PROPERTY_KEY, false); if (successResult) { internal::LogInfo(__FUNCTION__, L"JSON payload indicates success"); - auto deviceIdA = internal::JsonGetWStringProperty(responseObject, MIDI_CONFIG_JSON_ENDPOINT_LOOPBACK_DEVICE_RESPONSE_CREATED_ENDPOINT_A_ID_KEY, L""); - auto deviceIdB = internal::JsonGetWStringProperty(responseObject, MIDI_CONFIG_JSON_ENDPOINT_LOOPBACK_DEVICE_RESPONSE_CREATED_ENDPOINT_B_ID_KEY, L""); + auto deviceIdA = responseObject.GetNamedString(MIDI_CONFIG_JSON_ENDPOINT_LOOPBACK_DEVICE_RESPONSE_CREATED_ENDPOINT_A_ID_KEY, L""); + auto deviceIdB = responseObject.GetNamedString(MIDI_CONFIG_JSON_ENDPOINT_LOOPBACK_DEVICE_RESPONSE_CREATED_ENDPOINT_B_ID_KEY, L""); if (deviceIdA.empty()) { @@ -616,23 +604,20 @@ namespace winrt::Windows::Devices::Midi2::implementation // create the abstraction object with the child creation node - internal::JsonSetArrayProperty( - abstractionObject, + abstractionObject.SetNamedValue( MIDI_CONFIG_JSON_ENDPOINT_LOOPBACK_DEVICES_REMOVE_KEY, endpointDeletionArray); // create the main node - internal::JsonSetObjectProperty( - topLevelTransportPluginSettingsObject, + topLevelTransportPluginSettingsObject.SetNamedValue( internal::GuidToString(loopbackDeviceAbstractionId), abstractionObject); // wrap it all up so the json is valid - internal::JsonSetObjectProperty( - wrapperObject, + wrapperObject.SetNamedValue( MIDI_CONFIG_JSON_TRANSPORT_PLUGIN_SETTINGS_OBJECT, topLevelTransportPluginSettingsObject); @@ -645,7 +630,7 @@ namespace winrt::Windows::Devices::Midi2::implementation // parse the results - auto successResult = internal::JsonGetBoolProperty(responseObject, MIDI_CONFIG_JSON_CONFIGURATION_RESPONSE_SUCCESS_PROPERTY_KEY, false); + auto successResult = responseObject.GetNamedBoolean(MIDI_CONFIG_JSON_CONFIGURATION_RESPONSE_SUCCESS_PROPERTY_KEY, false); if (successResult) { diff --git a/src/api/Client/Midi2Client/MidiSession.cpp b/src/api/Client/Midi2Client/MidiSession.cpp index ab3603f8..c0ce2186 100644 --- a/src/api/Client/Midi2Client/MidiSession.cpp +++ b/src/api/Client/Midi2Client/MidiSession.cpp @@ -232,21 +232,19 @@ namespace winrt::Windows::Devices::Midi2::implementation MIDI_CONFIG_JSON_ENDPOINT_VIRTUAL_DEVICE_ASSOCIATION_ID_PROPERTY_KEY, associationGuid); - internal::JsonSetWStringProperty( - endpointDefinitionObject, + + endpointDefinitionObject.SetNamedValue( MIDI_CONFIG_JSON_ENDPOINT_COMMON_UNIQUE_ID_PROPERTY, - deviceDefinition.EndpointProductInstanceId().c_str()); + json::JsonValue::CreateStringValue(deviceDefinition.EndpointProductInstanceId().c_str())); - internal::JsonSetWStringProperty( - endpointDefinitionObject, + endpointDefinitionObject.SetNamedValue( MIDI_CONFIG_JSON_ENDPOINT_COMMON_NAME_PROPERTY, - deviceDefinition.EndpointName().c_str()); + json::JsonValue::CreateStringValue(deviceDefinition.EndpointName().c_str())); - internal::JsonSetWStringProperty( - endpointDefinitionObject, + endpointDefinitionObject.SetNamedValue( MIDI_CONFIG_JSON_ENDPOINT_COMMON_DESCRIPTION_PROPERTY, - deviceDefinition.TransportSuppliedDescription().c_str()); - + json::JsonValue::CreateStringValue(deviceDefinition.TransportSuppliedDescription().c_str())); + // TODO: Other props that have to be set at the service level and not in-protocol @@ -357,15 +355,15 @@ namespace winrt::Windows::Devices::Midi2::implementation internal::LogInfo(__FUNCTION__, L"JsonObjectFromBSTR success"); // check for actual success - auto successResult = internal::JsonGetBoolProperty(responseObject, MIDI_CONFIG_JSON_CONFIGURATION_RESPONSE_SUCCESS_PROPERTY_KEY, false); + auto successResult = responseObject.GetNamedBoolean(MIDI_CONFIG_JSON_CONFIGURATION_RESPONSE_SUCCESS_PROPERTY_KEY, false); if (successResult) { internal::LogInfo(__FUNCTION__, L"JSON payload indicates success"); - auto responseArray = internal::JsonGetArrayProperty(responseObject, MIDI_CONFIG_JSON_ENDPOINT_VIRTUAL_DEVICE_RESPONSE_CREATED_DEVICES_ARRAY_KEY); + auto responseArray = responseObject.GetNamedArray(MIDI_CONFIG_JSON_ENDPOINT_VIRTUAL_DEVICE_RESPONSE_CREATED_DEVICES_ARRAY_KEY, nullptr); - if (responseArray.Size() == 0) + if (responseArray != nullptr && responseArray.Size() == 0) { internal::LogGeneralError(__FUNCTION__, L"Unexpected empty response array"); @@ -376,8 +374,7 @@ namespace winrt::Windows::Devices::Midi2::implementation auto firstObject = responseArray.GetObjectAt(0); - endpointDeviceId = internal::JsonGetWStringProperty( - firstObject, + firstObject.GetNamedString( MIDI_CONFIG_JSON_ENDPOINT_VIRTUAL_DEVICE_RESPONSE_CREATED_ID_PROPERTY_KEY, L""); diff --git a/src/api/Client/Midi2Client/Windows.Devices.Midi2.vcxproj b/src/api/Client/Midi2Client/Windows.Devices.Midi2.vcxproj index 3724aa5f..f15adaa7 100644 --- a/src/api/Client/Midi2Client/Windows.Devices.Midi2.vcxproj +++ b/src/api/Client/Midi2Client/Windows.Devices.Midi2.vcxproj @@ -11,7 +11,7 @@ true C++/WinRT true - 10.0.20348.0 + 10.0 10.0.20348.0 true en-US @@ -179,17 +179,17 @@ false false - AbstractionUtilities.lib;%(AdditionalDependencies) + %(AdditionalDependencies) false false - AbstractionUtilities.lib;%(AdditionalDependencies) + %(AdditionalDependencies) false false - AbstractionUtilities.lib;%(AdditionalDependencies) + %(AdditionalDependencies) @@ -232,9 +232,9 @@ false false false - AbstractionUtilities.lib;%(AdditionalDependencies) - AbstractionUtilities.lib;%(AdditionalDependencies) - AbstractionUtilities.lib;%(AdditionalDependencies) + %(AdditionalDependencies) + %(AdditionalDependencies) + %(AdditionalDependencies) diff --git a/src/api/Client/Midi2Client/pch.h b/src/api/Client/Midi2Client/pch.h index e76ca30f..dd3c030a 100644 --- a/src/api/Client/Midi2Client/pch.h +++ b/src/api/Client/Midi2Client/pch.h @@ -49,12 +49,8 @@ namespace json = ::winrt::Windows::Data::Json; #include "ump_helpers.h" #include "memory_buffer.h" #include "wstring_util.h" -#include "hstring_util.h" // AbstractionUtilities -#include "endpoint_data_helpers.h" -#include "swd_property_builders.h" -#include "json_helpers.h" // shared #include "midi_ump.h" // general shared @@ -66,8 +62,20 @@ namespace json = ::winrt::Windows::Data::Json; namespace foundation = ::winrt::Windows::Foundation; namespace collections = ::winrt::Windows::Foundation::Collections; +#include "hstring_util.h" +#include "wstring_util.h" namespace internal = ::Windows::Devices::Midi2::Internal; +#include "MidiDefs.h" +#include "MidiDataFormat.h" +#include "MidiFlow.h" +#include "MidiAbstraction.h" + +#include "json_defs.h" +#include "json_helpers.h" +#include "swd_helpers.h" + +//#include "MidiXProc.h" #include "resource.h" #include "ResourceManager.h" diff --git a/src/api/Drivers/MinMidi/Driver/Driver.vcxproj b/src/api/Drivers/MinMidi/Driver/Driver.vcxproj index 40609e54..f1da8c37 100644 --- a/src/api/Drivers/MinMidi/Driver/Driver.vcxproj +++ b/src/api/Drivers/MinMidi/Driver/Driver.vcxproj @@ -171,12 +171,12 @@ - + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - + \ No newline at end of file diff --git a/src/api/Drivers/MinMidi/Driver/packages.config b/src/api/Drivers/MinMidi/Driver/packages.config index 14c63219..a6e30b6e 100644 --- a/src/api/Drivers/MinMidi/Driver/packages.config +++ b/src/api/Drivers/MinMidi/Driver/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/src/api/Drivers/MinMidi2/Driver/MinMidi2.vcxproj b/src/api/Drivers/MinMidi2/Driver/MinMidi2.vcxproj index 0a837971..844b6c82 100644 --- a/src/api/Drivers/MinMidi2/Driver/MinMidi2.vcxproj +++ b/src/api/Drivers/MinMidi2/Driver/MinMidi2.vcxproj @@ -189,12 +189,12 @@ - + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - + \ No newline at end of file diff --git a/src/api/Drivers/MinMidi2/Driver/packages.config b/src/api/Drivers/MinMidi2/Driver/packages.config index 14c63219..a6e30b6e 100644 --- a/src/api/Drivers/MinMidi2/Driver/packages.config +++ b/src/api/Drivers/MinMidi2/Driver/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/src/api/Drivers/USBMIDI2/Driver/USBMidi2.vcxproj b/src/api/Drivers/USBMIDI2/Driver/USBMidi2.vcxproj index 31cb20c9..6923ae24 100644 --- a/src/api/Drivers/USBMIDI2/Driver/USBMidi2.vcxproj +++ b/src/api/Drivers/USBMIDI2/Driver/USBMidi2.vcxproj @@ -218,12 +218,12 @@ - + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - + \ No newline at end of file diff --git a/src/api/Drivers/USBMIDI2/Driver/packages.config b/src/api/Drivers/USBMIDI2/Driver/packages.config index 14c63219..a6e30b6e 100644 --- a/src/api/Drivers/USBMIDI2/Driver/packages.config +++ b/src/api/Drivers/USBMIDI2/Driver/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/src/api/InBoxApps/mididmp/mididmp.vcxproj b/src/api/InBoxApps/mididmp/mididmp.vcxproj index 8c907878..8295775e 100644 --- a/src/api/InBoxApps/mididmp/mididmp.vcxproj +++ b/src/api/InBoxApps/mididmp/mididmp.vcxproj @@ -1,6 +1,6 @@ - + true true @@ -10,7 +10,7 @@ {5ec6d5eb-53d4-4731-891e-f746f0201429} Win32Proj mididmp - 10.0.20348.0 + 10.0 10.0.17134.0 @@ -143,13 +143,13 @@ - + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - + + \ No newline at end of file diff --git a/src/api/InBoxApps/mididmp/packages.config b/src/api/InBoxApps/mididmp/packages.config index cbf6205e..09bfc449 100644 --- a/src/api/InBoxApps/mididmp/packages.config +++ b/src/api/InBoxApps/mididmp/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/src/api/Inc/MidiDefs.h b/src/api/Inc/MidiDefs.h index 56e820d6..a29da1dd 100644 --- a/src/api/Inc/MidiDefs.h +++ b/src/api/Inc/MidiDefs.h @@ -551,7 +551,7 @@ DEFINE_MIDIDEVPROPKEY(PKEY_MIDI_MidiOutLatencyTicksUserOverride, 802); // DE DEFINE_MIDIDEVPROPKEY(PKEY_MIDI_VirtualMidiEndpointAssociator, 900); // DEVPROP_TYPE_GUID #define STRING_PKEY_MIDI_TransportSuppliedDescription MIDI_STRING_PKEY_GUID MIDI_STRING_PKEY_PID_SEPARATOR L"901" -DEFINE_MIDIDEVPROPKEY(PKEY_MIDI_TransportSuppliedDescription, 910); // DEVPROP_TYPE_STRING +DEFINE_MIDIDEVPROPKEY(PKEY_MIDI_TransportSuppliedDescription, 901); // DEVPROP_TYPE_STRING diff --git a/src/api/Inc/json_defs.h b/src/api/Inc/json_defs.h new file mode 100644 index 00000000..0895ba45 --- /dev/null +++ b/src/api/Inc/json_defs.h @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License +// ============================================================================ +// This is part of the Windows MIDI Services App API and should be used +// in your Windows application via an official binary distribution. +// Further information: https://github.com/microsoft/MIDI/ +// ============================================================================ + +#pragma once + +#ifndef JSON_DEFS_H +#define JSON_DEFS_H + +#pragma once + +//#define MIDI_CONFIG_JSON_ENDPOINT_USER_SUPPLIED_NAME_PROPERTY_KEY L"userSuppliedName" +//#define MIDI_CONFIG_JSON_ENDPOINT_USER_SUPPLIED_DESCRIPTION_PROPERTY_KEY L"userSuppliedDescription" +//#define MIDI_CONFIG_JSON_ENDPOINT_FORCE_SINGLE_CLIENT_PROPERTY_KEY L"forceSingleClientOnly" + +//#define MIDI_CONFIG_JSON_ENDPOINT_IDENTIFIER_SWD L"SWD: " + + +// structural + +#define MIDI_CONFIG_JSON_HEADER_OBJECT L"header" +#define MIDI_CONFIG_JSON_HEADER_PRODUCT_KEY L"product" +#define MIDI_CONFIG_JSON_HEADER_FILE_VERSION_KEY L"fileVersion" + + + +#define MIDI_CONFIG_JSON_TRANSPORT_PLUGIN_SETTINGS_OBJECT L"endpointTransportPluginSettings" +#define MIDI_CONFIG_JSON_ENDPOINT_PROCESSING_PLUGIN_SETTINGS_OBJECT L"endpointProcessingPluginSettings" + +// common properties + +#define MIDI_CONFIG_JSON_ENDPOINT_COMMON_NAME_PROPERTY L"name" +#define MIDI_CONFIG_JSON_ENDPOINT_COMMON_DESCRIPTION_PROPERTY L"description" +#define MIDI_CONFIG_JSON_ENDPOINT_COMMON_UNIQUE_ID_PROPERTY L"uniqueIdentifier" +#define MIDI_CONFIG_JSON_ENDPOINT_COMMON_MANUFACTURER_PROPERTY L"manufacturer" + + +#define MIDI_CONFIG_JSON_ENDPOINT_COMMON_USER_SUPPLIED_NAME_PROPERTY L"userSuppliedName" +#define MIDI_CONFIG_JSON_ENDPOINT_COMMON_USER_SUPPLIED_DESCRIPTION_PROPERTY L"userSuppliedDescription" +#define MIDI_CONFIG_JSON_ENDPOINT_COMMON_USER_SUPPLIED_SMALL_IMAGE_PROPERTY L"userSuppliedSmallImage" +#define MIDI_CONFIG_JSON_ENDPOINT_COMMON_USER_SUPPLIED_LARGE_IMAGE_PROPERTY L"userSuppliedLargeImage" + +#define MIDI_CONFIG_JSON_CONFIGURATION_RESPONSE_SUCCESS_PROPERTY_KEY L"success" +#define MIDI_CONFIG_JSON_CONFIGURATION_RESPONSE_MESSAGE_PROPERTY_KEY L"message" + + + +// Virtual MIDI (here because also needed by the client API) + +#define MIDI_CONFIG_JSON_ENDPOINT_VIRTUAL_DEVICES_CREATE_ARRAY_KEY L"createVirtualDevices" +#define MIDI_CONFIG_JSON_ENDPOINT_VIRTUAL_DEVICES_UPDATE_ARRAY_KEY L"updateVirtualDevices" +#define MIDI_CONFIG_JSON_ENDPOINT_VIRTUAL_DEVICES_REMOVE_ARRAY_KEY L"removeVirtualDevices" + +#define MIDI_CONFIG_JSON_ENDPOINT_VIRTUAL_DEVICE_ASSOCIATION_ID_PROPERTY_KEY L"associationIdentifier" +#define MIDI_CONFIG_JSON_ENDPOINT_VIRTUAL_DEVICE_UNIQUE_ID_MAX_LEN 32 + + +#define MIDI_CONFIG_JSON_ENDPOINT_VIRTUAL_DEVICE_RESPONSE_CREATED_DEVICES_ARRAY_KEY L"createdDevices" +#define MIDI_CONFIG_JSON_ENDPOINT_VIRTUAL_DEVICE_RESPONSE_CREATED_ID_PROPERTY_KEY L"id" + + + +// loopback MIDI (here because these can also be created via the client API) + +#define MIDI_CONFIG_JSON_ENDPOINT_LOOPBACK_DEVICES_CREATE_KEY L"create" +#define MIDI_CONFIG_JSON_ENDPOINT_LOOPBACK_DEVICES_UPDATE_KEY L"update" +#define MIDI_CONFIG_JSON_ENDPOINT_LOOPBACK_DEVICES_REMOVE_KEY L"remove" + +#define MIDI_CONFIG_JSON_ENDPOINT_LOOPBACK_DEVICE_ENDPOINT_A_KEY L"endpointA" +#define MIDI_CONFIG_JSON_ENDPOINT_LOOPBACK_DEVICE_ENDPOINT_B_KEY L"endpointB" + + +#define MIDI_CONFIG_JSON_ENDPOINT_LOOPBACK_DEVICE_RESPONSE_CREATED_ENDPOINT_A_ID_KEY L"endpointA" +#define MIDI_CONFIG_JSON_ENDPOINT_LOOPBACK_DEVICE_RESPONSE_CREATED_ENDPOINT_B_ID_KEY L"endpointB" + + + + +// Session tracker. These are used in the service and in the client API + +#define MIDI_SESSION_TRACKER_JSON_RESULT_SESSION_ARRAY_PROPERTY_KEY L"sessions" + +#define MIDI_SESSION_TRACKER_JSON_RESULT_SESSION_ID_PROPERTY_KEY L"id" +#define MIDI_SESSION_TRACKER_JSON_RESULT_SESSION_NAME_PROPERTY_KEY L"name" +#define MIDI_SESSION_TRACKER_JSON_RESULT_PROCESS_ID_PROPERTY_KEY L"clientProcessId" +#define MIDI_SESSION_TRACKER_JSON_RESULT_PROCESS_NAME_PROPERTY_KEY L"processName" +#define MIDI_SESSION_TRACKER_JSON_RESULT_SESSION_TIME_PROPERTY_KEY L"startTime" + + +#define MIDI_SESSION_TRACKER_JSON_RESULT_CONNECTION_ARRAY_PROPERTY_KEY L"connections" + +#define MIDI_SESSION_TRACKER_JSON_RESULT_CONNECTION_TIME_PROPERTY_KEY L"earliestStartTime" +#define MIDI_SESSION_TRACKER_JSON_RESULT_CONNECTION_COUNT_PROPERTY_KEY L"instanceCount" +#define MIDI_SESSION_TRACKER_JSON_RESULT_CONNECTION_ENDPOINT_ID_PROPERTY_KEY L"endpointId" + + +#endif \ No newline at end of file diff --git a/src/api/Inc/json_helpers.h b/src/api/Inc/json_helpers.h new file mode 100644 index 00000000..14e0e0db --- /dev/null +++ b/src/api/Inc/json_helpers.h @@ -0,0 +1,217 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License +// ============================================================================ +// This is part of the Windows MIDI Services App API and should be used +// in your Windows application via an official binary distribution. +// Further information: https://github.com/microsoft/MIDI/ +// ============================================================================ + +#pragma once + +#ifndef JSON_HELPERS_H +#define JSON_HELPERS_H + +// this def messes with json so we need to undef it here +#pragma push_macro("GetObject") +#undef GetObject +#include +#pragma pop_macro("GetObject") + +#include +#include + +#include "atlbase.h" // for CComBSTR + + +namespace json = ::winrt::Windows::Data::Json; + + +namespace Windows::Devices::Midi2::Internal +{ + inline json::JsonObject BuildConfigurationResponseObject(_In_ bool const success) + { + // the root object just has a wrapper with a success or fail property. Additional + // properties depend on the specific use case and so are added in those cases. + + json::JsonObject response; + + json::JsonValue successValue = json::JsonValue::CreateBooleanValue(success); + + response.SetNamedValue(MIDI_CONFIG_JSON_CONFIGURATION_RESPONSE_SUCCESS_PROPERTY_KEY, successValue); + + return response; + } + + inline void SetConfigurationResponseObjectFail(_In_ json::JsonObject& object, _In_ std::wstring message) + { + auto messageVal = json::JsonValue::CreateStringValue(message.c_str()); + object.SetNamedValue(MIDI_CONFIG_JSON_CONFIGURATION_RESPONSE_MESSAGE_PROPERTY_KEY, messageVal); + + auto successVal = json::JsonValue::CreateBooleanValue(false); + object.SetNamedValue(MIDI_CONFIG_JSON_CONFIGURATION_RESPONSE_SUCCESS_PROPERTY_KEY, messageVal); + } + + + inline bool JsonObjectFromBSTR(_In_ BSTR* const bstr, _Out_ json::JsonObject& obj) noexcept + { + if (bstr == nullptr) return false; + + try + { + ATL::CComBSTR ccbstr(*bstr); + if (ccbstr.Length() == 0) return false; + + winrt::hstring hstr(ccbstr); + + if (json::JsonObject::TryParse(hstr, obj)) + { + return true; + } + } + catch (...) + { + } + + obj = nullptr; + return false; + } + + inline bool JsonStringifyObjectToOutParam(_In_ json::JsonObject const& obj, _Out_ BSTR** outParam) noexcept + { + try + { + ATL::CComBSTR responseString = obj.Stringify().c_str(); + + auto hr = responseString.CopyTo(*outParam); + + if (SUCCEEDED(hr)) + { + return true; + } + } + catch (...) + { + + } + + return false; + } + + inline json::JsonObject JsonCreateSingleWStringPropertyObject(_In_ std::wstring const& key, _In_ std::wstring const& value) noexcept + { + json::JsonObject obj; + + obj.SetNamedValue(key, json::JsonValue::CreateStringValue(value.c_str())); + + return obj; + } + + // this handles accuracy of seconds and no finer + inline std::chrono::time_point + JsonGetDateTimeProperty( + _In_ json::JsonObject const& parent, + _In_ std::wstring const& key, + _In_ std::chrono::time_point const defaultValue) noexcept + { + if (parent != nullptr) + { + auto hkey = winrt::to_hstring(key.c_str()); + + if (parent.HasKey(hkey)) + { + try + { + auto result = parent.GetNamedNumber(hkey); + auto seconds = std::chrono::seconds((long)result); + + std::chrono::time_point tp; + tp += seconds; + + return tp; + } + catch (...) + { + // we'll fall through and return the default + } + } + } + + // return default in case of error + return defaultValue; + } + + // this handles accuracy of seconds and no finer + inline bool JsonSetDateTimeProperty( + _In_ json::JsonObject const& parent, + _In_ std::wstring const& key, + _In_ std::chrono::time_point const value) noexcept + { + try + { + if (parent != nullptr) + { + auto number = std::chrono::duration_cast(value.time_since_epoch()).count(); + + parent.SetNamedValue(key, json::JsonValue::CreateNumberValue((double)number)); + + return true; + } + } + catch (...) + { + + } + + return false; + } + + inline GUID JsonGetGuidProperty(_In_ json::JsonObject const& parent, _In_ std::wstring const& key, _In_ GUID const& defaultValue) noexcept + { + if (parent != nullptr) + { + auto hkey = winrt::to_hstring(key.c_str()); + + if (parent.HasKey(hkey)) + { + try + { + auto result = parent.GetNamedString(hkey); + + return StringToGuid(result.c_str()); + } + catch (...) + { + // we'll fall through and return the default + } + } + } + + // return default in case of error + return defaultValue; + } + + inline bool JsonSetGuidProperty(_In_ json::JsonObject const& parent, _In_ std::wstring const& key, _In_ GUID const& value) noexcept + { + try + { + if (parent != nullptr) + { + winrt::hstring stringValue = winrt::to_hstring(GuidToString(value).c_str()); + + parent.SetNamedValue(key, json::JsonValue::CreateStringValue(stringValue)); + + return true; + } + } + catch (...) + { + + } + + return false; + } + + +} + +#endif \ No newline at end of file diff --git a/src/api/Inc/midi_config_json.h b/src/api/Inc/midi_config_json.h deleted file mode 100644 index 5a3e3586..00000000 --- a/src/api/Inc/midi_config_json.h +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License -// ============================================================================ -// This is part of the Windows MIDI Services App API and should be used -// in your Windows application via an official binary distribution. -// Further information: https://github.com/microsoft/MIDI/ -// ============================================================================ - -#pragma once - -#define MIDI_CONFIG_JSON_ENDPOINT_USER_SUPPLIED_NAME_PROPERTY_KEY L"userSuppliedName" -#define MIDI_CONFIG_JSON_ENDPOINT_USER_SUPPLIED_DESCRIPTION_PROPERTY_KEY L"userSuppliedDescription" -#define MIDI_CONFIG_JSON_ENDPOINT_FORCE_SINGLE_CLIENT_PROPERTY_KEY L"forceSingleClientOnly" - -#define MIDI_CONFIG_JSON_ENDPOINT_IDENTIFIER_SWD L"SWD: " diff --git a/src/api/Inc/swd_helpers.h b/src/api/Inc/swd_helpers.h new file mode 100644 index 00000000..7a9eb06b --- /dev/null +++ b/src/api/Inc/swd_helpers.h @@ -0,0 +1,125 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License +// ============================================================================ +// This is part of the Windows MIDI Services App API and should be used +// in your Windows application via an official binary distribution. +// Further information: https://github.com/microsoft/MIDI/ +// ============================================================================ + +#pragma once + +#ifndef SWD_HELPERS_H +#define SWD_HELPERS_H + + +#include + + + +namespace Windows::Devices::Midi2::Internal +{ + inline std::wstring CalculateEndpointDevicePrimaryName( + _In_ std::wstring const& transportSuppliedEndpointName, + _In_ std::wstring const& userSuppliedEndpointName, + _In_ std::wstring const& inProtocolDiscoveredEndpointName + ) + { + // top priority is any user-supplied name + if (!::Windows::Devices::Midi2::Internal::TrimmedWStringCopy(userSuppliedEndpointName).empty()) + { + return ::Windows::Devices::Midi2::Internal::TrimmedWStringCopy(userSuppliedEndpointName); + } + + // next priority is any in-protocol name + if (!internal::TrimmedWStringCopy(inProtocolDiscoveredEndpointName).empty()) + { + return ::Windows::Devices::Midi2::Internal::TrimmedWStringCopy(inProtocolDiscoveredEndpointName); + } + + // otherwise, we return the transport-supplied name. For example, this is the name from USB + + return ::Windows::Devices::Midi2::Internal::TrimmedWStringCopy(transportSuppliedEndpointName); + + } + + // This is for the device instance id. Not to be confused with the interface id + inline std::wstring NormalizeDeviceInstanceIdWStringCopy(_In_ std::wstring const& deviceInstanceId) + { + return ::Windows::Devices::Midi2::Internal::ToUpperTrimmedWStringCopy(deviceInstanceId); + } + + // This is for the endpoint device interface id (the long SWD id with the GUID) + inline std::wstring NormalizeEndpointInterfaceIdWStringCopy(_In_ std::wstring const& endpointInterfaceId) + { + return ::Windows::Devices::Midi2::Internal::ToLowerTrimmedWStringCopy(endpointInterfaceId); + } + + // used for searching for a substring in an endpoint interface id. Matches case with + // what NormalizeEndpointInterfaceIdCopy produces + inline bool EndpointInterfaceIdContainsString(_In_ std::wstring const& endpointInterfaceId, _In_ std::wstring const& searchFor) + { + auto id = NormalizeEndpointInterfaceIdWStringCopy(endpointInterfaceId); + auto sub = ::Windows::Devices::Midi2::Internal::ToLowerWStringCopy(searchFor); // match case with NormalizeEndpointInterfaceIdCopy + + if (id == L"" || sub == L"") + { + return false; + } + + return id.find(sub) != std::wstring::npos; + } + + + + inline DEVPROPERTY BuildEmptyDevProperty( + _In_ DEVPROPKEY const key) + { + return DEVPROPERTY{ {key, DEVPROP_STORE_SYSTEM, nullptr}, + DEVPROP_TYPE_EMPTY, 0, nullptr }; + } + + + inline std::wstring GetSwdStringProperty(_In_ std::wstring deviceInterfaceId, _In_ std::wstring propertyName, _In_ std::wstring defaultValue) + { + auto propertyKey = winrt::to_hstring(propertyName.c_str()); + + auto additionalProperties = winrt::single_threaded_vector(); + additionalProperties.Append(propertyKey); + + + auto deviceInfo = winrt::Windows::Devices::Enumeration::DeviceInformation::CreateFromIdAsync( + winrt::to_hstring(deviceInterfaceId.c_str()), + additionalProperties, + winrt::Windows::Devices::Enumeration::DeviceInformationKind::DeviceInterface).get(); + + auto prop = deviceInfo.Properties().Lookup(propertyKey); + + if (prop) + { + // this interface is pointing to a UMP interface, so use that instance id. + return (winrt::unbox_value(prop)).c_str(); + } + else + { + // default to any + return defaultValue; + } + } + + inline std::wstring GetSwdPropertyVirtualEndpointAssociationId(_In_ std::wstring deviceInterfaceId) + { + std::wstring cleanId = ::Windows::Devices::Midi2::Internal::NormalizeEndpointInterfaceIdWStringCopy(deviceInterfaceId); + + return internal::ToUpperTrimmedWStringCopy(GetSwdStringProperty(cleanId, STRING_PKEY_MIDI_VirtualMidiEndpointAssociator, L"")); + } + + inline std::wstring GetSwdPropertyInstanceId(_In_ std::wstring deviceInterfaceId) + { + std::wstring cleanId = ::Windows::Devices::Midi2::Internal::NormalizeEndpointInterfaceIdWStringCopy(deviceInterfaceId); + + return internal::NormalizeDeviceInstanceIdWStringCopy(GetSwdStringProperty(cleanId, L"System.Devices.DeviceInstanceId", L"")); + } + +} + +#endif diff --git a/src/api/Libs/AM_MIDI2/src/AM_MIDI2.vcxproj b/src/api/Libs/AM_MIDI2/src/AM_MIDI2.vcxproj index 085e714b..73dc65f7 100644 --- a/src/api/Libs/AM_MIDI2/src/AM_MIDI2.vcxproj +++ b/src/api/Libs/AM_MIDI2/src/AM_MIDI2.vcxproj @@ -50,7 +50,7 @@ 17.0 {3CC19466-95AA-43CD-B327-4C53C026B965} Win32Proj - 10.0.22621.0 + 10.0 @@ -154,7 +154,7 @@ Disabled %(AdditionalIncludeDirectories);$(SolutionDir)inc;$(SolutionDir)VSFiles\intermediate\idl\$(Platform)\$(Configuration) true - stdcpp17 + stdcpp20 true @@ -170,7 +170,7 @@ Disabled %(AdditionalIncludeDirectories);$(SolutionDir)inc;$(SolutionDir)VSFiles\intermediate\idl\$(Platform)\$(Configuration) true - stdcpp17 + stdcpp20 true @@ -185,7 +185,7 @@ ProgramDatabase %(AdditionalIncludeDirectories);$(SolutionDir)inc;$(SolutionDir)VSFiles\intermediate\idl\$(Platform)\$(Configuration) true - stdcpp17 + stdcpp20 true @@ -202,7 +202,7 @@ ProgramDatabase %(AdditionalIncludeDirectories);$(SolutionDir)inc;$(SolutionDir)VSFiles\intermediate\idl\$(Platform)\$(Configuration) true - stdcpp17 + stdcpp20 true @@ -217,7 +217,7 @@ Level4 %(AdditionalIncludeDirectories);$(SolutionDir)inc;$(SolutionDir)VSFiles\intermediate\idl\$(Platform)\$(Configuration) true - stdcpp17 + stdcpp20 @@ -226,7 +226,7 @@ Level4 %(AdditionalIncludeDirectories);$(SolutionDir)inc;$(SolutionDir)VSFiles\intermediate\idl\$(Platform)\$(Configuration) true - stdcpp17 + stdcpp20 diff --git a/src/api/Libs/AbstractionUtilities/AbstractionUtilities.vcxproj b/src/api/Libs/AbstractionUtilities/AbstractionUtilities.vcxproj index 1b3209bf..81fa5f83 100644 --- a/src/api/Libs/AbstractionUtilities/AbstractionUtilities.vcxproj +++ b/src/api/Libs/AbstractionUtilities/AbstractionUtilities.vcxproj @@ -23,7 +23,7 @@ Win32Proj {60d2e061-fc7d-40ff-ad8c-4cb3d175a814} AbstractionUtilities - 10.0.20348.0 + 10.0 AbstractionUtilities @@ -95,7 +95,7 @@ true Use pch.h - stdcpp17 + stdcpp20 %(AdditionalIncludeDirectories);$(SolutionDir)inc;$(SolutionDir)VSFiles\intermediate\idl\$(Platform)\$(Configuration);$(IntDir);$(ProjectDir)inc true @@ -115,7 +115,7 @@ true Use pch.h - stdcpp17 + stdcpp20 %(AdditionalIncludeDirectories);$(SolutionDir)inc;$(SolutionDir)VSFiles\intermediate\idl\$(Platform)\$(Configuration);$(IntDir);$(ProjectDir)inc true @@ -135,7 +135,7 @@ true Use pch.h - stdcpp17 + stdcpp20 %(AdditionalIncludeDirectories);$(SolutionDir)inc;$(SolutionDir)VSFiles\intermediate\idl\$(Platform)\$(Configuration);$(IntDir);$(ProjectDir)inc true @@ -155,7 +155,7 @@ true Use pch.h - stdcpp17 + stdcpp20 %(AdditionalIncludeDirectories);$(SolutionDir)inc;$(SolutionDir)VSFiles\intermediate\idl\$(Platform)\$(Configuration);$(IntDir);$(ProjectDir)inc true @@ -168,15 +168,13 @@ - + - + - - - + Create @@ -184,10 +182,18 @@ Create Create - - + + + + + + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + \ No newline at end of file diff --git a/src/api/Libs/AbstractionUtilities/AbstractionUtilities.vcxproj.filters b/src/api/Libs/AbstractionUtilities/AbstractionUtilities.vcxproj.filters index 912f99c2..491062a7 100644 --- a/src/api/Libs/AbstractionUtilities/AbstractionUtilities.vcxproj.filters +++ b/src/api/Libs/AbstractionUtilities/AbstractionUtilities.vcxproj.filters @@ -15,7 +15,7 @@ - + Header Files @@ -24,18 +24,12 @@ Header Files - - Header Files - - + Header Files - - Source Files - - + Source Files @@ -44,11 +38,8 @@ Source Files - - Source Files - - - Source Files - + + + \ No newline at end of file diff --git a/src/api/Libs/AbstractionUtilities/inc/endpoint_data_helpers.h b/src/api/Libs/AbstractionUtilities/inc/endpoint_data_helpers.h deleted file mode 100644 index 9953ff5e..00000000 --- a/src/api/Libs/AbstractionUtilities/inc/endpoint_data_helpers.h +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License -// ============================================================================ -// This is part of the Windows MIDI Services App API and should be used -// in your Windows application via an official binary distribution. -// Further information: https://github.com/microsoft/MIDI/ -// ============================================================================ - -#pragma once - -#ifndef SWD_DATA_HELPERS_H -#define SWD_DATA_HELPERS_H - - -namespace Windows::Devices::Midi2::Internal -{ - std::wstring CalculateEndpointDevicePrimaryName( - _In_ std::wstring const& transportSuppliedEndpointName, - _In_ std::wstring const& userSuppliedEndpointName, - _In_ std::wstring const& inProtocolDiscoveredEndpointName - ); - - // This is for the device instance id. Not to be confused with the interface id - std::wstring NormalizeDeviceInstanceIdWStringCopy(_In_ std::wstring const& deviceInstanceId); - - // This is for the endpoint device interface id (the long SWD id with the GUID) - std::wstring NormalizeEndpointInterfaceIdWStringCopy(_In_ std::wstring const& endpointInterfaceId); - - // used for searching for a substring in an endpoint interface id. Matches case with - // what NormalizeEndpointInterfaceIdCopy produces - bool EndpointInterfaceIdContainsString(_In_ std::wstring const& endpointInterfaceId, _In_ std::wstring const& searchFor); - -} - -#endif diff --git a/src/api/Libs/AbstractionUtilities/inc/json_helpers.h b/src/api/Libs/AbstractionUtilities/inc/json_helpers.h deleted file mode 100644 index a4e8dd9b..00000000 --- a/src/api/Libs/AbstractionUtilities/inc/json_helpers.h +++ /dev/null @@ -1,154 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License -// ============================================================================ -// This is part of the Windows MIDI Services App API and should be used -// in your Windows application via an official binary distribution. -// Further information: https://github.com/microsoft/MIDI/ -// ============================================================================ - -#pragma once - -#ifndef JSON_HELPERS_H -#define JSON_HELPERS_H - -// this def messes with json so we need to undef it here -#pragma push_macro("GetObject") -#undef GetObject -#include -#pragma pop_macro("GetObject") - -#include -#include - -#include "atlbase.h" // for CComBSTR - - -namespace json = ::winrt::Windows::Data::Json; - -// structural - -#define MIDI_CONFIG_JSON_HEADER_OBJECT L"header" -#define MIDI_CONFIG_JSON_HEADER_PRODUCT_KEY L"product" -#define MIDI_CONFIG_JSON_HEADER_FILE_VERSION_KEY L"fileVersion" - - - -#define MIDI_CONFIG_JSON_TRANSPORT_PLUGIN_SETTINGS_OBJECT L"endpointTransportPluginSettings" -#define MIDI_CONFIG_JSON_ENDPOINT_PROCESSING_PLUGIN_SETTINGS_OBJECT L"endpointProcessingPluginSettings" - -// common properties - -#define MIDI_CONFIG_JSON_ENDPOINT_COMMON_NAME_PROPERTY L"name" -#define MIDI_CONFIG_JSON_ENDPOINT_COMMON_DESCRIPTION_PROPERTY L"description" -#define MIDI_CONFIG_JSON_ENDPOINT_COMMON_UNIQUE_ID_PROPERTY L"uniqueIdentifier" -#define MIDI_CONFIG_JSON_ENDPOINT_COMMON_MANUFACTURER_PROPERTY L"manufacturer" - - -#define MIDI_CONFIG_JSON_ENDPOINT_COMMON_USER_SUPPLIED_NAME_PROPERTY L"userSuppliedName" -#define MIDI_CONFIG_JSON_ENDPOINT_COMMON_USER_SUPPLIED_DESCRIPTION_PROPERTY L"userSuppliedDescription" -#define MIDI_CONFIG_JSON_ENDPOINT_COMMON_USER_SUPPLIED_SMALL_IMAGE_PROPERTY L"userSuppliedSmallImage" -#define MIDI_CONFIG_JSON_ENDPOINT_COMMON_USER_SUPPLIED_LARGE_IMAGE_PROPERTY L"userSuppliedLargeImage" - -#define MIDI_CONFIG_JSON_CONFIGURATION_RESPONSE_SUCCESS_PROPERTY_KEY L"success" -#define MIDI_CONFIG_JSON_CONFIGURATION_RESPONSE_MESSAGE_PROPERTY_KEY L"message" - - -// Virtual MIDI (here because also needed by the client API) - -#define MIDI_CONFIG_JSON_ENDPOINT_VIRTUAL_DEVICES_CREATE_ARRAY_KEY L"createVirtualDevices" -#define MIDI_CONFIG_JSON_ENDPOINT_VIRTUAL_DEVICES_UPDATE_ARRAY_KEY L"updateVirtualDevices" -#define MIDI_CONFIG_JSON_ENDPOINT_VIRTUAL_DEVICES_REMOVE_ARRAY_KEY L"removeVirtualDevices" - -#define MIDI_CONFIG_JSON_ENDPOINT_VIRTUAL_DEVICE_ASSOCIATION_ID_PROPERTY_KEY L"associationIdentifier" -#define MIDI_CONFIG_JSON_ENDPOINT_VIRTUAL_DEVICE_UNIQUE_ID_MAX_LEN 32 - - -#define MIDI_CONFIG_JSON_ENDPOINT_VIRTUAL_DEVICE_RESPONSE_CREATED_DEVICES_ARRAY_KEY L"createdDevices" -#define MIDI_CONFIG_JSON_ENDPOINT_VIRTUAL_DEVICE_RESPONSE_CREATED_ID_PROPERTY_KEY L"id" - -// loopback MIDI (here because these can also be created via the client API) - -#define MIDI_CONFIG_JSON_ENDPOINT_LOOPBACK_DEVICES_CREATE_KEY L"create" -#define MIDI_CONFIG_JSON_ENDPOINT_LOOPBACK_DEVICES_UPDATE_KEY L"update" -#define MIDI_CONFIG_JSON_ENDPOINT_LOOPBACK_DEVICES_REMOVE_KEY L"remove" - -#define MIDI_CONFIG_JSON_ENDPOINT_LOOPBACK_DEVICE_ENDPOINT_A_KEY L"endpointA" -#define MIDI_CONFIG_JSON_ENDPOINT_LOOPBACK_DEVICE_ENDPOINT_B_KEY L"endpointB" - - -#define MIDI_CONFIG_JSON_ENDPOINT_LOOPBACK_DEVICE_RESPONSE_CREATED_ENDPOINT_A_ID_KEY L"endpointA" -#define MIDI_CONFIG_JSON_ENDPOINT_LOOPBACK_DEVICE_RESPONSE_CREATED_ENDPOINT_B_ID_KEY L"endpointB" - - - -// Session tracker. These are used in the service and in the client API - -#define MIDI_SESSION_TRACKER_JSON_RESULT_SESSION_ARRAY_PROPERTY_KEY L"sessions" - -#define MIDI_SESSION_TRACKER_JSON_RESULT_SESSION_ID_PROPERTY_KEY L"id" -#define MIDI_SESSION_TRACKER_JSON_RESULT_SESSION_NAME_PROPERTY_KEY L"name" -#define MIDI_SESSION_TRACKER_JSON_RESULT_PROCESS_ID_PROPERTY_KEY L"clientProcessId" -#define MIDI_SESSION_TRACKER_JSON_RESULT_PROCESS_NAME_PROPERTY_KEY L"processName" -#define MIDI_SESSION_TRACKER_JSON_RESULT_SESSION_TIME_PROPERTY_KEY L"startTime" - - -#define MIDI_SESSION_TRACKER_JSON_RESULT_CONNECTION_ARRAY_PROPERTY_KEY L"connections" - -#define MIDI_SESSION_TRACKER_JSON_RESULT_CONNECTION_TIME_PROPERTY_KEY L"earliestStartTime" -#define MIDI_SESSION_TRACKER_JSON_RESULT_CONNECTION_COUNT_PROPERTY_KEY L"instanceCount" -#define MIDI_SESSION_TRACKER_JSON_RESULT_CONNECTION_ENDPOINT_ID_PROPERTY_KEY L"endpointId" - - - -namespace Windows::Devices::Midi2::Internal -{ - json::JsonObject BuildConfigurationResponseObject(_In_ bool const success); - - void SetConfigurationResponseObjectFail(_In_ json::JsonObject& object, _In_ std::wstring message); - - - bool JsonObjectFromBSTR(_In_ BSTR* const bstr, _Out_ json::JsonObject& obj) noexcept; - - bool JsonStringifyObjectToOutParam(_In_ json::JsonObject const& obj, _Out_ BSTR** outParam) noexcept; - - json::JsonObject JsonCreateSingleWStringPropertyObject(_In_ std::wstring const& key, _In_ std::wstring const& value) noexcept; - - - json::JsonArray JsonGetArrayProperty(_In_ json::JsonObject const& parent, _In_ std::wstring const& key) noexcept; - bool JsonSetArrayProperty(_In_ json::JsonObject const& parent, _In_ std::wstring const& key, _In_ json::JsonArray const& value) noexcept; - - std::wstring JsonGetWStringProperty(_In_ json::JsonObject const& parent, _In_ std::wstring const& key, std::wstring const& defaultValue) noexcept; - bool JsonSetWStringProperty(_In_ json::JsonObject const& parent, _In_ std::wstring const& key, _In_ std::wstring const& value) noexcept; - - // this handles accuracy of seconds and no finer - std::chrono::time_point - JsonGetDateTimeProperty( - _In_ json::JsonObject const& parent, - _In_ std::wstring const& key, - _In_ std::chrono::time_point const defaultValue) noexcept; - - // this handles accuracy of seconds and no finer - bool JsonSetDateTimeProperty( - _In_ json::JsonObject const& parent, - _In_ std::wstring const& key, - _In_ std::chrono::time_point const value) noexcept; - - GUID JsonGetGuidProperty(_In_ json::JsonObject const& parent, _In_ std::wstring const& key, _In_ GUID const& defaultValue) noexcept; - bool JsonSetGuidProperty(_In_ json::JsonObject const& parent, _In_ std::wstring const& key, _In_ GUID const& value) noexcept; - - bool JsonGetBoolProperty(_In_ json::JsonObject const& parent, _In_ std::wstring const& key, _In_ bool const defaultValue) noexcept; - bool JsonSetBoolProperty(_In_ json::JsonObject const& parent, _In_ std::wstring const& key, _In_ bool const value) noexcept; - - double JsonGetDoubleProperty(_In_ json::JsonObject const& parent, _In_ std::wstring const& key, _In_ double const defaultValue) noexcept; - bool JsonSetDoubleProperty(_In_ json::JsonObject const& parent, _In_ std::wstring const& key, _In_ double const value) noexcept; - - long JsonGetLongProperty(_In_ json::JsonObject const& parent, _In_ std::wstring const& key, _In_ long const defaultValue) noexcept; - bool JsonSetLongProperty(_In_ json::JsonObject const& parent, _In_ std::wstring const& key, _In_ long const value) noexcept; - - json::JsonObject JsonGetObjectProperty(_In_ json::JsonObject const& parent, _In_ std::wstring const& key, json::JsonObject const& defaultValue) noexcept; - bool JsonSetObjectProperty(_In_ json::JsonObject const& parent, _In_ std::wstring const& key, _In_ json::JsonObject const& value) noexcept; - - -} - -#endif \ No newline at end of file diff --git a/src/api/Libs/AbstractionUtilities/inc/swd_property_builders.h b/src/api/Libs/AbstractionUtilities/inc/swd_property_builders.h deleted file mode 100644 index 6b3a456c..00000000 --- a/src/api/Libs/AbstractionUtilities/inc/swd_property_builders.h +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License -// ============================================================================ -// This is part of the Windows MIDI Services App API and should be used -// in your Windows application via an official binary distribution. -// Further information: https://github.com/microsoft/MIDI/ -// ============================================================================ - -#pragma once - -#ifndef SWD_PROPERTY_BUILDERS_H -#define SWD_PROPERTY_BUILDERS_H - -#include "Devpkey.h" -#include - - -namespace Windows::Devices::Midi2::Internal -{ - DEVPROPERTY BuildEmptyDevProperty( - _In_ DEVPROPKEY const key); - -} - -#endif \ No newline at end of file diff --git a/src/api/Libs/AbstractionUtilities/inc/swd_shared.h b/src/api/Libs/AbstractionUtilities/inc/swd_shared.h deleted file mode 100644 index 1a100b14..00000000 --- a/src/api/Libs/AbstractionUtilities/inc/swd_shared.h +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License -// ============================================================================ -// This is part of the Windows MIDI Services App API and should be used -// in your Windows application via an official binary distribution. -// Further information: https://github.com/microsoft/MIDI/ -// ============================================================================ - - -#include -#include - - -#pragma once - -namespace Windows::Devices::Midi2::Internal -{ - - std::wstring GetSwdStringProperty(_In_ std::wstring deviceInterfaceId, _In_ std::wstring propertyName, _In_ std::wstring defaultValue); - - std::wstring GetSwdPropertyVirtualEndpointAssociationId(_In_ std::wstring deviceInterfaceId); - - std::wstring GetSwdPropertyInstanceId(_In_ std::wstring deviceInterfaceId); -} \ No newline at end of file diff --git a/src/api/Libs/AbstractionUtilities/packages.config b/src/api/Libs/AbstractionUtilities/packages.config new file mode 100644 index 00000000..09be25d9 --- /dev/null +++ b/src/api/Libs/AbstractionUtilities/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/src/api/Libs/AbstractionUtilities/src/endpoint_data_helpers.cpp b/src/api/Libs/AbstractionUtilities/src/endpoint_data_helpers.cpp deleted file mode 100644 index 93249230..00000000 --- a/src/api/Libs/AbstractionUtilities/src/endpoint_data_helpers.cpp +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License -// ============================================================================ -// This is part of the Windows MIDI Services App API and should be used -// in your Windows application via an official binary distribution. -// Further information: https://github.com/microsoft/MIDI/ -// ============================================================================ - -#include "pch.h" - -namespace Windows::Devices::Midi2::Internal -{ - _Use_decl_annotations_ - std::wstring CalculateEndpointDevicePrimaryName( - std::wstring const& transportSuppliedEndpointName, - std::wstring const& userSuppliedEndpointName, - std::wstring const& inProtocolDiscoveredEndpointName - ) - { - // top priority is any user-supplied name - if (!internal::TrimmedWStringCopy(userSuppliedEndpointName).empty()) - { - return internal::TrimmedWStringCopy(userSuppliedEndpointName); - } - - // next priority is any in-protocol name - if (!internal::TrimmedWStringCopy(inProtocolDiscoveredEndpointName).empty()) - { - return internal::TrimmedWStringCopy(inProtocolDiscoveredEndpointName); - } - - // otherwise, we return the transport-supplied name. For example, this is the name from USB - - return internal::TrimmedWStringCopy(transportSuppliedEndpointName); - - } - - // This is for the device instance id. Not to be confused with the interface id - _Use_decl_annotations_ - std::wstring NormalizeDeviceInstanceIdWStringCopy(std::wstring const& deviceInstanceId) - { - return ToUpperTrimmedWStringCopy(deviceInstanceId); - } - - - // This is for the endpoint device interface id (the long SWD id with the GUID) - _Use_decl_annotations_ - std::wstring NormalizeEndpointInterfaceIdWStringCopy(std::wstring const& endpointInterfaceId) - { - return ToLowerTrimmedWStringCopy(endpointInterfaceId); - } - - // used for searching for a substring in an endpoint interface id. Matches case with - // what NormalizeEndpointInterfaceIdCopy produces - _Use_decl_annotations_ - bool EndpointInterfaceIdContainsString(std::wstring const& endpointInterfaceId, std::wstring const& searchFor) - { - auto id = NormalizeEndpointInterfaceIdWStringCopy(endpointInterfaceId); - auto sub = ToLowerWStringCopy(searchFor); // match case with NormalizeEndpointInterfaceIdCopy - - if (id == L"" || sub == L"") - { - return false; - } - - return id.find(sub) != std::wstring::npos; - } -} - diff --git a/src/api/Libs/AbstractionUtilities/src/json_helpers.cpp b/src/api/Libs/AbstractionUtilities/src/json_helpers.cpp deleted file mode 100644 index 23ef34c7..00000000 --- a/src/api/Libs/AbstractionUtilities/src/json_helpers.cpp +++ /dev/null @@ -1,503 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License -// ============================================================================ -// This is part of the Windows MIDI Services App API and should be used -// in your Windows application via an official binary distribution. -// Further information: https://github.com/microsoft/MIDI/ -// ============================================================================ - -#include "pch.h" - -namespace Windows::Devices::Midi2::Internal -{ - _Use_decl_annotations_ - void SetConfigurationResponseObjectFail( - json::JsonObject& object, - std::wstring message) - { - auto messageVal = json::JsonValue::CreateStringValue(message.c_str()); - object.SetNamedValue(MIDI_CONFIG_JSON_CONFIGURATION_RESPONSE_MESSAGE_PROPERTY_KEY, messageVal); - - auto successVal = json::JsonValue::CreateBooleanValue(false); - object.SetNamedValue(MIDI_CONFIG_JSON_CONFIGURATION_RESPONSE_SUCCESS_PROPERTY_KEY, messageVal); - } - - - - _Use_decl_annotations_ - json::JsonObject BuildConfigurationResponseObject(_In_ bool const success) - { - // the root object just has a wrapper with a success or fail property. Additional - // properties depend on the specific use case and so are added in those cases. - - json::JsonObject response; - - json::JsonValue successValue = json::JsonValue::CreateBooleanValue(success); - - response.SetNamedValue(MIDI_CONFIG_JSON_CONFIGURATION_RESPONSE_SUCCESS_PROPERTY_KEY, successValue); - - return response; - } - - - - _Use_decl_annotations_ - bool JsonObjectFromBSTR(BSTR* const bstr, json::JsonObject& obj) noexcept - { - if (bstr == nullptr) return false; - - try - { - ATL::CComBSTR ccbstr(*bstr); - if (ccbstr.Length() == 0) return false; - - winrt::hstring hstr(ccbstr); - - if (json::JsonObject::TryParse(hstr, obj)) - { - return true; - } - } - catch (...) - { - } - - obj = nullptr; - return false; - } - - - - _Use_decl_annotations_ - bool JsonStringifyObjectToOutParam(json::JsonObject const& obj, BSTR** outParam) noexcept - { - try - { - ATL::CComBSTR responseString = obj.Stringify().c_str(); - - auto hr = responseString.CopyTo(*outParam); - - if (SUCCEEDED(hr)) - { - return true; - } - } - catch (...) - { - - } - - return false; - } - - _Use_decl_annotations_ - json::JsonObject JsonCreateSingleWStringPropertyObject(std::wstring const& key, std::wstring const& value) noexcept - { - json::JsonObject obj; - - obj.SetNamedValue(key, json::JsonValue::CreateStringValue(value.c_str())); - - return obj; - } - - - _Use_decl_annotations_ - json::JsonArray JsonGetArrayProperty(json::JsonObject const& parent, std::wstring const& key) noexcept - { - if (parent != nullptr) - { - auto hkey = winrt::to_hstring(key.c_str()); - - if (parent.HasKey(hkey)) - { - try - { - auto result = parent.GetNamedArray(hkey); - - return result; - } - catch (...) - { - // we'll fall through and return an empty array - } - - } - } - - // return an empty array in case of error - return json::JsonArray{}; - } - - _Use_decl_annotations_ - bool JsonSetArrayProperty(json::JsonObject const& parent, std::wstring const& key, json::JsonArray const& value) noexcept - { - try - { - if (parent != nullptr) - { - parent.SetNamedValue(key, value); - - return true; - } - } - catch (...) - { - - } - - return false; - } - - _Use_decl_annotations_ - std::wstring JsonGetWStringProperty(json::JsonObject const& parent, std::wstring const& key, std::wstring const& defaultValue) noexcept - { - if (parent != nullptr) - { - auto hkey = winrt::to_hstring(key.c_str()); - - if (parent.HasKey(hkey)) - { - try - { - auto result = parent.GetNamedString(hkey); - - return result.c_str(); - } - catch (...) - { - // we'll fall through and return the default - } - - } - } - - // return default in case of error - return defaultValue; - } - - _Use_decl_annotations_ - bool JsonSetWStringProperty(json::JsonObject const& parent, std::wstring const& key, std::wstring const& value) noexcept - { - try - { - if (parent != nullptr) - { - winrt::hstring stringValue = winrt::to_hstring(value.c_str()); - - parent.SetNamedValue(key, json::JsonValue::CreateStringValue(stringValue)); - - return true; - } - } - catch (...) - { - - } - - return false; - } - - // this handles accuracy of seconds and no finer - _Use_decl_annotations_ - std::chrono::time_point - JsonGetDateTimeProperty( - json::JsonObject const& parent, - std::wstring const& key, - std::chrono::time_point const defaultValue) noexcept - { - if (parent != nullptr) - { - auto hkey = winrt::to_hstring(key.c_str()); - - if (parent.HasKey(hkey)) - { - try - { - auto result = parent.GetNamedNumber(hkey); - auto seconds = std::chrono::seconds((long)result); - - std::chrono::time_point tp; - tp += seconds; - - return tp; - } - catch (...) - { - // we'll fall through and return the default - } - } - } - - // return default in case of error - return defaultValue; - } - - // this handles accuracy of seconds and no finer - _Use_decl_annotations_ - bool JsonSetDateTimeProperty( - json::JsonObject const& parent, - std::wstring const& key, - std::chrono::time_point const value) noexcept - { - try - { - if (parent != nullptr) - { - auto number = std::chrono::duration_cast(value.time_since_epoch()).count(); - - parent.SetNamedValue(key, json::JsonValue::CreateNumberValue((double)number)); - - return true; - } - } - catch (...) - { - - } - - return false; - } - - _Use_decl_annotations_ - GUID JsonGetGuidProperty(json::JsonObject const& parent, std::wstring const& key, GUID const& defaultValue) noexcept - { - if (parent != nullptr) - { - auto hkey = winrt::to_hstring(key.c_str()); - - if (parent.HasKey(hkey)) - { - try - { - auto result = parent.GetNamedString(hkey); - - return StringToGuid(result.c_str()); - } - catch (...) - { - // we'll fall through and return the default - } - } - } - - // return default in case of error - return defaultValue; - } - - _Use_decl_annotations_ - bool JsonSetGuidProperty(json::JsonObject const& parent, std::wstring const& key, GUID const& value) noexcept - { - try - { - if (parent != nullptr) - { - winrt::hstring stringValue = winrt::to_hstring(GuidToString(value).c_str()); - - parent.SetNamedValue(key, json::JsonValue::CreateStringValue(stringValue)); - - return true; - } - } - catch (...) - { - - } - - return false; - } - - _Use_decl_annotations_ - bool JsonGetBoolProperty(json::JsonObject const& parent, std::wstring const& key, bool const defaultValue) noexcept - { - if (parent != nullptr) - { - auto hkey = winrt::to_hstring(key.c_str()); - - if (parent.HasKey(hkey)) - { - try - { - auto result = parent.GetNamedBoolean(hkey); - - return result; - } - catch (...) - { - // we'll fall through and return the default - } - - } - } - - // return default in case of error - return defaultValue; - } - - _Use_decl_annotations_ - bool JsonSetBoolProperty(json::JsonObject const& parent, std::wstring const& key, bool const value) noexcept - { - try - { - if (parent != nullptr) - { - parent.SetNamedValue(key, json::JsonValue::CreateBooleanValue(value)); - - return true; - } - } - catch (...) - { - - } - - return false; - } - - _Use_decl_annotations_ - double JsonGetDoubleProperty(json::JsonObject const& parent, std::wstring const& key, double const defaultValue) noexcept - { - if (parent != nullptr) - { - auto hkey = winrt::to_hstring(key.c_str()); - - if (parent.HasKey(hkey)) - { - try - { - auto result = parent.GetNamedNumber(hkey); - - return result; - } - catch (...) - { - // we'll fall through and return the default - } - - } - } - - // return default in case of error - return defaultValue; - } - - _Use_decl_annotations_ - bool JsonSetDoubleProperty(json::JsonObject const& parent, std::wstring const& key, double const value) noexcept - { - try - { - if (parent != nullptr) - { - parent.SetNamedValue(key, json::JsonValue::CreateNumberValue(value)); - - return true; - } - } - catch (...) - { - - } - - return false; - } - - _Use_decl_annotations_ - long JsonGetLongProperty(json::JsonObject const& parent, std::wstring const& key, long const defaultValue) noexcept - { - if (parent != nullptr) - { - auto hkey = winrt::to_hstring(key.c_str()); - - if (parent.HasKey(hkey)) - { - try - { - auto result = (long)parent.GetNamedNumber(hkey); - - return result; - } - catch (...) - { - // we'll fall through and return the default - } - - } - } - - // return default in case of error - return defaultValue; - } - - _Use_decl_annotations_ - bool JsonSetLongProperty(json::JsonObject const& parent, std::wstring const& key, long const value) noexcept - { - try - { - if (parent != nullptr) - { - parent.SetNamedValue(key, json::JsonValue::CreateNumberValue((double)value)); - - return true; - } - } - catch (...) - { - - } - - return false; - } - - - - - - - _Use_decl_annotations_ - json::JsonObject JsonGetObjectProperty(json::JsonObject const& parent, std::wstring const& key, json::JsonObject const& defaultValue) noexcept - { - if (parent != nullptr) - { - auto hkey = winrt::to_hstring(key.c_str()); - - if (parent.HasKey(hkey)) - { - try - { - auto result = parent.GetNamedObject(hkey); - - return result; - } - catch (...) - { - // we'll fall through and return the default - } - - } - } - - // return default in case of error - return defaultValue; - } - - _Use_decl_annotations_ - bool JsonSetObjectProperty(json::JsonObject const& parent, std::wstring const& key, json::JsonObject const& value) noexcept - { - try - { - if (parent != nullptr) - { - parent.SetNamedValue(key, value); - - return true; - } - } - catch (...) - { - - } - - return false; - } - -} - diff --git a/src/api/Libs/AbstractionUtilities/src/pch.cpp b/src/api/Libs/AbstractionUtilities/src/pch.cpp deleted file mode 100644 index a128584f..00000000 --- a/src/api/Libs/AbstractionUtilities/src/pch.cpp +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License -// ============================================================================ -// This is part of the Windows MIDI Services App API and should be used -// in your Windows application via an official binary distribution. -// Further information: https://github.com/microsoft/MIDI/ -// ============================================================================ - -#pragma once - -#include "pch.h" - -// When you are using pre-compiled headers, this source file is necessary for compilation to succeed. diff --git a/src/api/Libs/AbstractionUtilities/src/pch.h b/src/api/Libs/AbstractionUtilities/src/pch.h index b8fd2bd2..ab8a97e5 100644 --- a/src/api/Libs/AbstractionUtilities/src/pch.h +++ b/src/api/Libs/AbstractionUtilities/src/pch.h @@ -50,10 +50,8 @@ namespace internal = ::Windows::Devices::Midi2::Internal; -#include "endpoint_data_helpers.h" -#include "swd_property_builders.h" +#include "swd_helpers.h" #include "json_helpers.h" -#include "swd_shared.h" #endif //PCH_H diff --git a/src/api/Libs/AbstractionUtilities/src/property_builders.cpp b/src/api/Libs/AbstractionUtilities/src/property_builders.cpp deleted file mode 100644 index e69de29b..00000000 diff --git a/src/api/Libs/AbstractionUtilities/src/swd_property_builders.cpp b/src/api/Libs/AbstractionUtilities/src/swd_property_builders.cpp deleted file mode 100644 index 04647332..00000000 --- a/src/api/Libs/AbstractionUtilities/src/swd_property_builders.cpp +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License -// ============================================================================ -// This is part of the Windows MIDI Services App API and should be used -// in your Windows application via an official binary distribution. -// Further information: https://github.com/microsoft/MIDI/ -// ============================================================================ - -#include "pch.h" - -namespace Windows::Devices::Midi2::Internal -{ - _Use_decl_annotations_ - DEVPROPERTY BuildEmptyDevProperty(DEVPROPKEY const key) - { - return DEVPROPERTY{ {key, DEVPROP_STORE_SYSTEM, nullptr}, - DEVPROP_TYPE_EMPTY, 0, nullptr }; - - } -} diff --git a/src/api/Libs/AbstractionUtilities/src/swd_property_helpers.cpp b/src/api/Libs/AbstractionUtilities/src/swd_property_helpers.cpp deleted file mode 100644 index 9d9cf050..00000000 --- a/src/api/Libs/AbstractionUtilities/src/swd_property_helpers.cpp +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License -// ============================================================================ -// This is part of the Windows MIDI Services App API and should be used -// in your Windows application via an official binary distribution. -// Further information: https://github.com/microsoft/MIDI/ -// ============================================================================ - - -#include "pch.h" - - -namespace Windows::Devices::Midi2::Internal -{ - // NOTE: The parameters in here are all passed to the API by ref, so the - // calling code needs to keep them around until the device creation returns. - - _Use_decl_annotations_ - bool AddStandardEndpointProperties( - - ) - { - try - { - //interfaceDeviceProperties.push_back(BuildGuidDevProperty(PKEY_MIDI_AbstractionLayer, abstractionLayerGuid)); - //interfaceDeviceProperties.push_back(BuildUInt32DevProperty(PKEY_MIDI_EndpointDevicePurpose, endpointPurpose)); - - //interfaceDeviceProperties.push_back(BuildWStringDevProperty(DEVPKEY_DeviceInterface_FriendlyName, friendlyName)); - - ////// transport information - - //interfaceDeviceProperties.push_back(BuildWStringDevProperty(PKEY_MIDI_TransportMnemonic, transportMnemonic)); - //interfaceDeviceProperties.push_back(BuildWStringDevProperty(PKEY_MIDI_TransportSuppliedEndpointName, transportSuppliedEndpointName)); - //interfaceDeviceProperties.push_back(BuildWStringDevProperty(PKEY_MIDI_TransportSuppliedDescription, transportSuppliedEndpointDescription)); - - //interfaceDeviceProperties.push_back(BuildWStringDevProperty(PKEY_MIDI_SerialNumber, uniqueIdentifier)); - - - //// user-supplied information, if available - - //interfaceDeviceProperties.push_back(BuildWStringDevProperty(PKEY_MIDI_UserSuppliedEndpointName, userSuppliedEndpointName)); - //interfaceDeviceProperties.push_back(BuildWStringDevProperty(PKEY_MIDI_UserSuppliedDescription, userSuppliedEndpointDescription)); - - - //// data format. These each have different uses. Native format is the device's format. Supported - //// format is how we talk to it from the service (the driver may translate to UMP, for example) - - //interfaceDeviceProperties.push_back(BuildByteDevProperty(PKEY_MIDI_NativeDataFormat, nativeDataFormat)); - //interfaceDeviceProperties.push_back(BuildUInt32DevProperty(PKEY_MIDI_SupportedDataFormats, supportedDataFormats)); - - //// behavior - - //interfaceDeviceProperties.push_back(BuildBooleanDevProperty(PKEY_MIDI_GenerateIncomingTimestamp, generateIncomingTimestamps)); - //interfaceDeviceProperties.push_back(BuildBooleanDevProperty(PKEY_MIDI_EndpointRequiresMetadataHandler, requiresMetadataHandler)); - - //interfaceDeviceProperties.push_back(BuildBooleanDevProperty(PKEY_MIDI_SupportsMulticlient, supportsMultiClient)); - - return true; - } - catch (...) - { - - } - - return false; - } - - - -} - diff --git a/src/api/Libs/AbstractionUtilities/src/swd_shared.cpp b/src/api/Libs/AbstractionUtilities/src/swd_shared.cpp deleted file mode 100644 index 385f46c5..00000000 --- a/src/api/Libs/AbstractionUtilities/src/swd_shared.cpp +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License -// ============================================================================ -// This is part of the Windows MIDI Services App API and should be used -// in your Windows application via an official binary distribution. -// Further information: https://github.com/microsoft/MIDI/ -// ============================================================================ - - -#include "pch.h" - -#include "swd_shared.h" - -namespace Windows::Devices::Midi2::Internal -{ - - _Use_decl_annotations_ - std::wstring GetStringSwdProperty(std::wstring deviceInterfaceId, std::wstring propertyName, std::wstring defaultValue) - { - auto propertyKey = winrt::to_hstring(propertyName.c_str()); - - auto additionalProperties = winrt::single_threaded_vector(); - additionalProperties.Append(propertyKey); - - - auto deviceInfo = winrt::Windows::Devices::Enumeration::DeviceInformation::CreateFromIdAsync( - winrt::to_hstring(deviceInterfaceId.c_str()), - additionalProperties, - winrt::Windows::Devices::Enumeration::DeviceInformationKind::DeviceInterface).get(); - - auto prop = deviceInfo.Properties().Lookup(propertyKey); - - if (prop) - { - OutputDebugString(__FUNCTION__ L" found property"); - - // this interface is pointing to a UMP interface, so use that instance id. - return (winrt::unbox_value(prop)).c_str(); - } - else - { - OutputDebugString(__FUNCTION__ L" didn't find property"); - // default to any - return defaultValue; - } - - } - - - _Use_decl_annotations_ - std::wstring GetSwdPropertyVirtualEndpointAssociationId(std::wstring deviceInterfaceId) - { - std::wstring cleanId = internal::NormalizeEndpointInterfaceIdWStringCopy(deviceInterfaceId); - - return internal::ToUpperTrimmedWStringCopy(GetStringSwdProperty(cleanId, STRING_PKEY_MIDI_VirtualMidiEndpointAssociator, L"")); - } - - - _Use_decl_annotations_ - std::wstring GetSwdPropertyInstanceId(std::wstring deviceInterfaceId) - { - std::wstring cleanId = internal::NormalizeEndpointInterfaceIdWStringCopy(deviceInterfaceId); - - return internal::NormalizeDeviceInstanceIdWStringCopy(GetStringSwdProperty(cleanId, L"System.Devices.DeviceInstanceId", L"")); - } -} \ No newline at end of file diff --git a/src/api/Libs/MidiKs/MidiKS.vcxproj b/src/api/Libs/MidiKs/MidiKS.vcxproj index 367ce392..c163bef2 100644 --- a/src/api/Libs/MidiKs/MidiKS.vcxproj +++ b/src/api/Libs/MidiKs/MidiKS.vcxproj @@ -30,7 +30,7 @@ 17.0 {00B066CB-3F9F-4B31-B30A-48631B07D157} Win32Proj - 10.0.20348.0 + 10.0 @@ -134,7 +134,7 @@ Disabled %(AdditionalIncludeDirectories);$(SolutionDir)inc;$(SolutionDir)VSFiles\intermediate\idl\$(Platform)\$(Configuration) true - stdcpp17 + stdcpp20 true @@ -150,7 +150,7 @@ Disabled %(AdditionalIncludeDirectories);$(SolutionDir)inc;$(SolutionDir)VSFiles\intermediate\idl\$(Platform)\$(Configuration) true - stdcpp17 + stdcpp20 true @@ -165,7 +165,7 @@ ProgramDatabase %(AdditionalIncludeDirectories);$(SolutionDir)inc;$(SolutionDir)VSFiles\intermediate\idl\$(Platform)\$(Configuration) true - stdcpp17 + stdcpp20 true @@ -182,7 +182,7 @@ ProgramDatabase %(AdditionalIncludeDirectories);$(SolutionDir)inc;$(SolutionDir)VSFiles\intermediate\idl\$(Platform)\$(Configuration) true - stdcpp17 + stdcpp20 true @@ -197,7 +197,7 @@ Level4 %(AdditionalIncludeDirectories);$(SolutionDir)inc;$(SolutionDir)VSFiles\intermediate\idl\$(Platform)\$(Configuration) true - stdcpp17 + stdcpp20 @@ -206,7 +206,7 @@ Level4 %(AdditionalIncludeDirectories);$(SolutionDir)inc;$(SolutionDir)VSFiles\intermediate\idl\$(Platform)\$(Configuration) true - stdcpp17 + stdcpp20 @@ -227,12 +227,12 @@ - + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - + \ No newline at end of file diff --git a/src/api/Libs/MidiKs/packages.config b/src/api/Libs/MidiKs/packages.config index 14c63219..a6e30b6e 100644 --- a/src/api/Libs/MidiKs/packages.config +++ b/src/api/Libs/MidiKs/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/src/api/Libs/MidiKsCommon/MidiKSCommon.vcxproj b/src/api/Libs/MidiKsCommon/MidiKSCommon.vcxproj index 0ddf0ef9..63400a00 100644 --- a/src/api/Libs/MidiKsCommon/MidiKSCommon.vcxproj +++ b/src/api/Libs/MidiKsCommon/MidiKSCommon.vcxproj @@ -30,7 +30,7 @@ 17.0 {0FB85768-237C-4A60-A824-E09884C3EB34} Win32Proj - 10.0.20348.0 + 10.0 @@ -123,7 +123,7 @@ Level4 %(AdditionalIncludeDirectories);$(SolutionDir)\inc true - stdcpp17 + stdcpp20 @@ -132,7 +132,7 @@ Level4 %(AdditionalIncludeDirectories);$(SolutionDir)\inc true - stdcpp17 + stdcpp20 @@ -141,7 +141,7 @@ Level4 %(AdditionalIncludeDirectories);$(SolutionDir)\inc true - stdcpp17 + stdcpp20 @@ -150,7 +150,7 @@ Level4 %(AdditionalIncludeDirectories);$(SolutionDir)\inc true - stdcpp17 + stdcpp20 @@ -159,7 +159,7 @@ Level4 %(AdditionalIncludeDirectories);$(SolutionDir)\inc true - stdcpp17 + stdcpp20 @@ -168,7 +168,7 @@ Level4 %(AdditionalIncludeDirectories);$(SolutionDir)\inc true - stdcpp17 + stdcpp20 @@ -182,12 +182,12 @@ - + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - + \ No newline at end of file diff --git a/src/api/Libs/MidiKsCommon/packages.config b/src/api/Libs/MidiKsCommon/packages.config index 14c63219..a6e30b6e 100644 --- a/src/api/Libs/MidiKsCommon/packages.config +++ b/src/api/Libs/MidiKsCommon/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/src/api/Libs/MidiXProc/MidiXProc.vcxproj b/src/api/Libs/MidiXProc/MidiXProc.vcxproj index aac1796a..3feaa4c2 100644 --- a/src/api/Libs/MidiXProc/MidiXProc.vcxproj +++ b/src/api/Libs/MidiXProc/MidiXProc.vcxproj @@ -30,7 +30,7 @@ 17.0 {2480B077-46E5-42AE-9BDB-685AFF258529} Win32Proj - 10.0.22621.0 + 10.0 @@ -134,7 +134,7 @@ Disabled %(AdditionalIncludeDirectories);$(SolutionDir)inc;$(SolutionDir)VSFiles\intermediate\idl\$(Platform)\$(Configuration) true - stdcpp17 + stdcpp20 true @@ -150,7 +150,7 @@ Disabled %(AdditionalIncludeDirectories);$(SolutionDir)inc;$(SolutionDir)VSFiles\intermediate\idl\$(Platform)\$(Configuration) true - stdcpp17 + stdcpp20 true @@ -165,7 +165,7 @@ ProgramDatabase %(AdditionalIncludeDirectories);$(SolutionDir)inc;$(SolutionDir)VSFiles\intermediate\idl\$(Platform)\$(Configuration) true - stdcpp17 + stdcpp20 true @@ -182,7 +182,7 @@ ProgramDatabase %(AdditionalIncludeDirectories);$(SolutionDir)inc;$(SolutionDir)VSFiles\intermediate\idl\$(Platform)\$(Configuration) true - stdcpp17 + stdcpp20 true @@ -197,7 +197,7 @@ Level4 %(AdditionalIncludeDirectories);$(SolutionDir)inc;$(SolutionDir)VSFiles\intermediate\idl\$(Platform)\$(Configuration) true - stdcpp17 + stdcpp20 @@ -206,7 +206,7 @@ Level4 %(AdditionalIncludeDirectories);$(SolutionDir)inc;$(SolutionDir)VSFiles\intermediate\idl\$(Platform)\$(Configuration) true - stdcpp17 + stdcpp20 @@ -227,12 +227,12 @@ - + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - + \ No newline at end of file diff --git a/src/api/Libs/MidiXProc/packages.config b/src/api/Libs/MidiXProc/packages.config index 14c63219..a6e30b6e 100644 --- a/src/api/Libs/MidiXProc/packages.config +++ b/src/api/Libs/MidiXProc/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/src/api/Midi2.sln b/src/api/Midi2.sln index fed02a0d..02935998 100644 --- a/src/api/Midi2.sln +++ b/src/api/Midi2.sln @@ -8,7 +8,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Midi2.KSAbstraction", "Abst {0FB85768-237C-4A60-A824-E09884C3EB34} = {0FB85768-237C-4A60-A824-E09884C3EB34} {2480B077-46E5-42AE-9BDB-685AFF258529} = {2480B077-46E5-42AE-9BDB-685AFF258529} {3BD492AD-A08C-4923-9486-138189CA4A0A} = {3BD492AD-A08C-4923-9486-138189CA4A0A} - {60D2E061-FC7D-40FF-AD8C-4CB3D175A814} = {60D2E061-FC7D-40FF-AD8C-4CB3D175A814} {EFB7CF90-7DEF-44CF-868A-191CA30E0FCF} = {EFB7CF90-7DEF-44CF-868A-191CA30E0FCF} EndProjectSection EndProject @@ -76,7 +75,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MidiSrv", "Service\Exe\Midi {366FA284-D8C0-4CC5-B9A3-917EAB967173} = {366FA284-D8C0-4CC5-B9A3-917EAB967173} {36E99993-ABE3-44CC-A776-B4E835B5EEC6} = {36E99993-ABE3-44CC-A776-B4E835B5EEC6} {3BD492AD-A08C-4923-9486-138189CA4A0A} = {3BD492AD-A08C-4923-9486-138189CA4A0A} - {60D2E061-FC7D-40FF-AD8C-4CB3D175A814} = {60D2E061-FC7D-40FF-AD8C-4CB3D175A814} {6D151BF5-40A2-4BD7-BB67-07D2741DA01E} = {6D151BF5-40A2-4BD7-BB67-07D2741DA01E} {7427BC7A-4247-42B0-AC9B-7DA10418AA9D} = {7427BC7A-4247-42B0-AC9B-7DA10418AA9D} {7E618284-6AA0-4FCE-9E4A-D895A5EE8E3C} = {7E618284-6AA0-4FCE-9E4A-D895A5EE8E3C} @@ -92,7 +90,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Midi2.MidiSrvAbstraction", EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Midi2.SampleAbstraction", "Abstraction\SampleAbstraction\Midi2.SampleAbstraction.vcxproj", "{3D391727-2A65-4BA6-A730-EC10406AF543}" ProjectSection(ProjectDependencies) = postProject - {60D2E061-FC7D-40FF-AD8C-4CB3D175A814} = {60D2E061-FC7D-40FF-AD8C-4CB3D175A814} {EFB7CF90-7DEF-44CF-868A-191CA30E0FCF} = {EFB7CF90-7DEF-44CF-868A-191CA30E0FCF} EndProjectSection EndProject @@ -120,13 +117,11 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MidiSWEnum", "Test\Libs\Mid EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Midi2.NetworkMidiAbstraction", "Abstraction\NetworkMidiAbstraction\Midi2.NetworkMidiAbstraction.vcxproj", "{7E618284-6AA0-4FCE-9E4A-D895A5EE8E3C}" ProjectSection(ProjectDependencies) = postProject - {60D2E061-FC7D-40FF-AD8C-4CB3D175A814} = {60D2E061-FC7D-40FF-AD8C-4CB3D175A814} {EFB7CF90-7DEF-44CF-868A-191CA30E0FCF} = {EFB7CF90-7DEF-44CF-868A-191CA30E0FCF} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Midi2.VirtualMidiAbstraction", "Abstraction\VirtualMidiAbstraction\Midi2.VirtualMidiAbstraction.vcxproj", "{03009B2B-E3E8-49DC-A0D6-0FA90AE3B15B}" ProjectSection(ProjectDependencies) = postProject - {60D2E061-FC7D-40FF-AD8C-4CB3D175A814} = {60D2E061-FC7D-40FF-AD8C-4CB3D175A814} {EFB7CF90-7DEF-44CF-868A-191CA30E0FCF} = {EFB7CF90-7DEF-44CF-868A-191CA30E0FCF} EndProjectSection EndProject @@ -154,7 +149,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "libraries", "libraries", "{ EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Midi2.DiagnosticsAbstraction", "Abstraction\DiagnosticsAbstraction\Midi2.DiagnosticsAbstraction.vcxproj", "{093852BE-32B8-4EB8-814E-91410FFDB4F6}" ProjectSection(ProjectDependencies) = postProject - {60D2E061-FC7D-40FF-AD8C-4CB3D175A814} = {60D2E061-FC7D-40FF-AD8C-4CB3D175A814} {EFB7CF90-7DEF-44CF-868A-191CA30E0FCF} = {EFB7CF90-7DEF-44CF-868A-191CA30E0FCF} EndProjectSection EndProject @@ -166,13 +160,11 @@ Project("{54435603-DBB4-11D2-8724-00A0C9A8B90C}") = "Midi2", "Midi2Setup\Midi2Se EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Midi2.VirtualPatchBayAbstraction", "Abstraction\VirtualPatchBayAbstraction\Midi2.VirtualPatchBayAbstraction.vcxproj", "{7427BC7A-4247-42B0-AC9B-7DA10418AA9D}" ProjectSection(ProjectDependencies) = postProject - {60D2E061-FC7D-40FF-AD8C-4CB3D175A814} = {60D2E061-FC7D-40FF-AD8C-4CB3D175A814} {EFB7CF90-7DEF-44CF-868A-191CA30E0FCF} = {EFB7CF90-7DEF-44CF-868A-191CA30E0FCF} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Midi2.BluetoothMidiAbstraction", "Abstraction\BleMidiAbstraction\Midi2.BluetoothMidiAbstraction.vcxproj", "{8795821B-541D-4B9B-BF7F-50CA976FC54E}" ProjectSection(ProjectDependencies) = postProject - {60D2E061-FC7D-40FF-AD8C-4CB3D175A814} = {60D2E061-FC7D-40FF-AD8C-4CB3D175A814} {EFB7CF90-7DEF-44CF-868A-191CA30E0FCF} = {EFB7CF90-7DEF-44CF-868A-191CA30E0FCF} EndProjectSection EndProject @@ -245,12 +237,6 @@ EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "In-Box Apps", "In-Box Apps", "{67A42126-8502-4681-9ACC-B1417C527620}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Midi2.LoopbackMidiAbstraction", "Abstraction\LoopbackMidiAbstraction\Midi2.LoopbackMidiAbstraction.vcxproj", "{0F94A751-9159-4A88-8A71-347151124548}" - ProjectSection(ProjectDependencies) = postProject - {60D2E061-FC7D-40FF-AD8C-4CB3D175A814} = {60D2E061-FC7D-40FF-AD8C-4CB3D175A814} - {EFB7CF90-7DEF-44CF-868A-191CA30E0FCF} = {EFB7CF90-7DEF-44CF-868A-191CA30E0FCF} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AbstractionUtilities", "Libs\AbstractionUtilities\AbstractionUtilities.vcxproj", "{60D2E061-FC7D-40FF-AD8C-4CB3D175A814}" ProjectSection(ProjectDependencies) = postProject {EFB7CF90-7DEF-44CF-868A-191CA30E0FCF} = {EFB7CF90-7DEF-44CF-868A-191CA30E0FCF} EndProjectSection @@ -1051,26 +1037,6 @@ Global {0F94A751-9159-4A88-8A71-347151124548}.Release|x64.Build.0 = Release|x64 {0F94A751-9159-4A88-8A71-347151124548}.Release|x86.ActiveCfg = Release|x64 {0F94A751-9159-4A88-8A71-347151124548}.Release|x86.Build.0 = Release|x64 - {60D2E061-FC7D-40FF-AD8C-4CB3D175A814}.Debug|Any CPU.ActiveCfg = Debug|x64 - {60D2E061-FC7D-40FF-AD8C-4CB3D175A814}.Debug|Any CPU.Build.0 = Debug|x64 - {60D2E061-FC7D-40FF-AD8C-4CB3D175A814}.Debug|ARM64.ActiveCfg = Debug|x64 - {60D2E061-FC7D-40FF-AD8C-4CB3D175A814}.Debug|ARM64.Build.0 = Debug|x64 - {60D2E061-FC7D-40FF-AD8C-4CB3D175A814}.Debug|ARM64EC.ActiveCfg = Debug|x64 - {60D2E061-FC7D-40FF-AD8C-4CB3D175A814}.Debug|ARM64EC.Build.0 = Debug|x64 - {60D2E061-FC7D-40FF-AD8C-4CB3D175A814}.Debug|x64.ActiveCfg = Debug|x64 - {60D2E061-FC7D-40FF-AD8C-4CB3D175A814}.Debug|x64.Build.0 = Debug|x64 - {60D2E061-FC7D-40FF-AD8C-4CB3D175A814}.Debug|x86.ActiveCfg = Debug|Win32 - {60D2E061-FC7D-40FF-AD8C-4CB3D175A814}.Debug|x86.Build.0 = Debug|Win32 - {60D2E061-FC7D-40FF-AD8C-4CB3D175A814}.Release|Any CPU.ActiveCfg = Release|x64 - {60D2E061-FC7D-40FF-AD8C-4CB3D175A814}.Release|Any CPU.Build.0 = Release|x64 - {60D2E061-FC7D-40FF-AD8C-4CB3D175A814}.Release|ARM64.ActiveCfg = Release|x64 - {60D2E061-FC7D-40FF-AD8C-4CB3D175A814}.Release|ARM64.Build.0 = Release|x64 - {60D2E061-FC7D-40FF-AD8C-4CB3D175A814}.Release|ARM64EC.ActiveCfg = Release|x64 - {60D2E061-FC7D-40FF-AD8C-4CB3D175A814}.Release|ARM64EC.Build.0 = Release|x64 - {60D2E061-FC7D-40FF-AD8C-4CB3D175A814}.Release|x64.ActiveCfg = Release|x64 - {60D2E061-FC7D-40FF-AD8C-4CB3D175A814}.Release|x64.Build.0 = Release|x64 - {60D2E061-FC7D-40FF-AD8C-4CB3D175A814}.Release|x86.ActiveCfg = Release|Win32 - {60D2E061-FC7D-40FF-AD8C-4CB3D175A814}.Release|x86.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -1118,7 +1084,6 @@ Global {16F34756-0269-4CEB-8F1C-32D9C6441990} = {6DB1D424-53D4-488F-8053-EBBD7D1F2E49} {5EC6D5EB-53D4-4731-891E-F746F0201429} = {67A42126-8502-4681-9ACC-B1417C527620} {0F94A751-9159-4A88-8A71-347151124548} = {69CC5CD9-47DC-4118-A3C7-E0D071407185} - {60D2E061-FC7D-40FF-AD8C-4CB3D175A814} = {A4512DDC-CB43-4774-80AA-3B5D13B50D75} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {7F5A157F-9894-451D-B091-848921952166} diff --git a/src/api/Service/Exe/MidiConfigurationManager.cpp b/src/api/Service/Exe/MidiConfigurationManager.cpp index ed4f344e..52c79697 100644 --- a/src/api/Service/Exe/MidiConfigurationManager.cpp +++ b/src/api/Service/Exe/MidiConfigurationManager.cpp @@ -413,7 +413,7 @@ std::map CMidiConfigurationManager::GetTranspor // we treat this as an object where each abstraction id is a property - auto plugins = internal::JsonGetObjectProperty(jsonObject, MIDI_CONFIG_JSON_TRANSPORT_PLUGIN_SETTINGS_OBJECT, nullptr); + auto plugins = jsonObject.GetNamedObject(MIDI_CONFIG_JSON_TRANSPORT_PLUGIN_SETTINGS_OBJECT, nullptr); if (plugins == nullptr) { diff --git a/src/api/Service/Exe/MidiService.cpp b/src/api/Service/Exe/MidiService.cpp index b7a18aa3..ccf039fb 100644 --- a/src/api/Service/Exe/MidiService.cpp +++ b/src/api/Service/Exe/MidiService.cpp @@ -392,7 +392,7 @@ int __cdecl _tmain(_In_ int ArgC, _In_reads_(ArgC) TCHAR *ArgV[]) SERVICE_TABLE_ENTRY DispatchTable[] = { - { SVCNAME, (LPSERVICE_MAIN_FUNCTION) SvcMain }, + { (LPWSTR)SVCNAME, (LPSERVICE_MAIN_FUNCTION) SvcMain }, { NULL, NULL } }; diff --git a/src/api/Service/Exe/MidiSessionTracker.cpp b/src/api/Service/Exe/MidiSessionTracker.cpp index 77ba6624..0d5633d6 100644 --- a/src/api/Service/Exe/MidiSessionTracker.cpp +++ b/src/api/Service/Exe/MidiSessionTracker.cpp @@ -163,20 +163,18 @@ CMidiSessionTracker::GetSessionListJson( BSTR* SessionList ) { - json::JsonObject rootObject; json::JsonArray sessionsArray{}; - for (auto sessionIter = m_sessions.begin(); sessionIter != m_sessions.end(); sessionIter++) { json::JsonObject sessionObject; internal::JsonSetGuidProperty(sessionObject, MIDI_SESSION_TRACKER_JSON_RESULT_SESSION_ID_PROPERTY_KEY, sessionIter->second.SessionId); - internal::JsonSetWStringProperty(sessionObject, MIDI_SESSION_TRACKER_JSON_RESULT_SESSION_NAME_PROPERTY_KEY, sessionIter->second.SessionName); - internal::JsonSetWStringProperty(sessionObject, MIDI_SESSION_TRACKER_JSON_RESULT_PROCESS_NAME_PROPERTY_KEY, sessionIter->second.ProcessName); - internal::JsonSetWStringProperty(sessionObject, MIDI_SESSION_TRACKER_JSON_RESULT_PROCESS_ID_PROPERTY_KEY, std::to_wstring(sessionIter->second.ClientProcessId)); + sessionObject.SetNamedValue(MIDI_SESSION_TRACKER_JSON_RESULT_SESSION_NAME_PROPERTY_KEY, json::JsonValue::CreateStringValue(sessionIter->second.SessionName)); + sessionObject.SetNamedValue(MIDI_SESSION_TRACKER_JSON_RESULT_PROCESS_NAME_PROPERTY_KEY, json::JsonValue::CreateStringValue(sessionIter->second.ProcessName)); + sessionObject.SetNamedValue(MIDI_SESSION_TRACKER_JSON_RESULT_PROCESS_ID_PROPERTY_KEY, json::JsonValue::CreateStringValue(std::to_wstring(sessionIter->second.ClientProcessId))); internal::JsonSetDateTimeProperty(sessionObject, MIDI_SESSION_TRACKER_JSON_RESULT_SESSION_TIME_PROPERTY_KEY, sessionIter->second.StartTime); // now add all the client connections @@ -188,8 +186,8 @@ CMidiSessionTracker::GetSessionListJson( json::JsonObject connectionObject; internal::JsonSetDateTimeProperty(sessionObject, MIDI_SESSION_TRACKER_JSON_RESULT_CONNECTION_TIME_PROPERTY_KEY, connectionIter->second.EarliestStartTime); - internal::JsonSetDoubleProperty(connectionObject, MIDI_SESSION_TRACKER_JSON_RESULT_CONNECTION_COUNT_PROPERTY_KEY, connectionIter->second.InstanceCount); - internal::JsonSetWStringProperty(connectionObject, MIDI_SESSION_TRACKER_JSON_RESULT_CONNECTION_ENDPOINT_ID_PROPERTY_KEY, connectionIter->second.ConnectedEndpointInterfaceId); + connectionObject.SetNamedValue(MIDI_SESSION_TRACKER_JSON_RESULT_CONNECTION_COUNT_PROPERTY_KEY, json::JsonValue::CreateNumberValue(connectionIter->second.InstanceCount)); + connectionObject.SetNamedValue(MIDI_SESSION_TRACKER_JSON_RESULT_CONNECTION_ENDPOINT_ID_PROPERTY_KEY, json::JsonValue::CreateStringValue(connectionIter->second.ConnectedEndpointInterfaceId)); connectionsArray.Append(connectionObject); } @@ -197,7 +195,7 @@ CMidiSessionTracker::GetSessionListJson( // append the connections array only if we have some if (connectionsArray.Size() > 0) { - internal::JsonSetArrayProperty(sessionObject, MIDI_SESSION_TRACKER_JSON_RESULT_CONNECTION_ARRAY_PROPERTY_KEY, connectionsArray); + sessionObject.SetNamedValue(MIDI_SESSION_TRACKER_JSON_RESULT_CONNECTION_ARRAY_PROPERTY_KEY, connectionsArray); } sessionsArray.Append(sessionObject); diff --git a/src/api/Service/Exe/MidiSrv.cpp b/src/api/Service/Exe/MidiSrv.cpp index bc62521d..f7c133c1 100644 --- a/src/api/Service/Exe/MidiSrv.cpp +++ b/src/api/Service/Exe/MidiSrv.cpp @@ -91,12 +91,23 @@ CMidiSrv::Initialize() &rpcSecurityDescriptor, NULL)); + + // this is an ugly set of casts, but the reinterpret_cast error only + // comes up with C++/20. Risk of a straight c-style cast here going + // poorly is low. Error comes from the function taking non-const params + // but our arguments here are const. RETURN_IF_FAILED(HRESULT_FROM_RPCSTATUS(RpcServerUseProtseqEp( - reinterpret_cast(MIDISRV_LRPC_PROTOCOL), + (RPC_WSTR)MIDISRV_LRPC_PROTOCOL, RPC_C_PROTSEQ_MAX_REQS_DEFAULT, - reinterpret_cast(MIDISRV_ENDPOINT), + (RPC_WSTR)MIDISRV_ENDPOINT, rpcSecurityDescriptor.get()))); + //RETURN_IF_FAILED(HRESULT_FROM_RPCSTATUS(RpcServerUseProtseqEp( + // reinterpret_cast(MIDISRV_LRPC_PROTOCOL), + // RPC_C_PROTSEQ_MAX_REQS_DEFAULT, + // reinterpret_cast(MIDISRV_ENDPOINT), + // rpcSecurityDescriptor.get()))); + RETURN_IF_FAILED(HRESULT_FROM_RPCSTATUS(RpcServerRegisterIf3( MidiSrvRPC_v1_0_s_ifspec, NULL, NULL, diff --git a/src/api/Service/Exe/MidiSrv.vcxproj b/src/api/Service/Exe/MidiSrv.vcxproj index 7ee2743d..15039a27 100644 --- a/src/api/Service/Exe/MidiSrv.vcxproj +++ b/src/api/Service/Exe/MidiSrv.vcxproj @@ -137,7 +137,7 @@ Level4 true - stdcpp17 + stdcpp20 $(SolutionDir)VSFiles\intermediate\MidiSrv\$(Platform)\$(Configuration)\ @@ -146,7 +146,7 @@ $(SolutionDir)idl - Rpcrt4.lib;onecoreuap.lib;ksuser.lib;avrt.lib;midixproc.lib;AbstractionUtilities.lib;$(CoreLibraryDependencies);%(AdditionalDependencies) + Rpcrt4.lib;onecoreuap.lib;ksuser.lib;avrt.lib;midixproc.lib;$(CoreLibraryDependencies);%(AdditionalDependencies) false @@ -154,7 +154,7 @@ Level4 true - stdcpp17 + stdcpp20 $(SolutionDir)VSFiles\intermediate\MidiSrv\$(Platform)\$(Configuration)\ @@ -163,7 +163,7 @@ $(SolutionDir)idl - Rpcrt4.lib;onecoreuap.lib;ksuser.lib;avrt.lib;midixproc.lib;AbstractionUtilities.lib;$(CoreLibraryDependencies);%(AdditionalDependencies) + Rpcrt4.lib;onecoreuap.lib;ksuser.lib;avrt.lib;midixproc.lib;$(CoreLibraryDependencies);%(AdditionalDependencies) false @@ -181,7 +181,7 @@ Level4 true - stdcpp17 + stdcpp20 $(SolutionDir)VSFiles\intermediate\MidiSrv\$(Platform)\$(Configuration)\ @@ -190,7 +190,7 @@ $(SolutionDir)idl - Rpcrt4.lib;onecoreuap.lib;ksuser.lib;avrt.lib;midixproc.lib;AbstractionUtilities.lib;$(CoreLibraryDependencies);%(AdditionalDependencies) + Rpcrt4.lib;onecoreuap.lib;ksuser.lib;avrt.lib;midixproc.lib;$(CoreLibraryDependencies);%(AdditionalDependencies) false @@ -198,7 +198,7 @@ Level4 true - stdcpp17 + stdcpp20 $(SolutionDir)VSFiles\intermediate\MidiSrv\$(Platform)\$(Configuration)\ @@ -207,7 +207,7 @@ $(SolutionDir)idl - Rpcrt4.lib;onecoreuap.lib;ksuser.lib;avrt.lib;midixproc.lib;AbstractionUtilities.lib;$(CoreLibraryDependencies);%(AdditionalDependencies) + Rpcrt4.lib;onecoreuap.lib;ksuser.lib;avrt.lib;midixproc.lib;$(CoreLibraryDependencies);%(AdditionalDependencies) false @@ -220,7 +220,7 @@ Level4 true - stdcpp17 + stdcpp20 Stub @@ -231,7 +231,7 @@ $(SolutionDir)idl - Rpcrt4.lib;onecoreuap.lib;ksuser.lib;avrt.lib;midixproc.lib;AbstractionUtilities.lib;$(CoreLibraryDependencies);%(AdditionalDependencies) + Rpcrt4.lib;onecoreuap.lib;ksuser.lib;avrt.lib;midixproc.lib;$(CoreLibraryDependencies);%(AdditionalDependencies) false @@ -244,7 +244,7 @@ Level4 true - stdcpp17 + stdcpp20 $(SolutionDir)VSFiles\intermediate\MidiSrv\$(Platform)\$(Configuration)\ @@ -253,7 +253,7 @@ $(SolutionDir)idl - Rpcrt4.lib;onecoreuap.lib;ksuser.lib;avrt.lib;midixproc.lib;AbstractionUtilities.lib;$(CoreLibraryDependencies);%(AdditionalDependencies) + Rpcrt4.lib;onecoreuap.lib;ksuser.lib;avrt.lib;midixproc.lib;$(CoreLibraryDependencies);%(AdditionalDependencies) false @@ -309,12 +309,12 @@ - + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - + \ No newline at end of file diff --git a/src/api/Service/Exe/packages.config b/src/api/Service/Exe/packages.config index 14c63219..a6e30b6e 100644 --- a/src/api/Service/Exe/packages.config +++ b/src/api/Service/Exe/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/src/api/Service/Exe/stdafx.h b/src/api/Service/Exe/stdafx.h index 9e089d9c..8c3f681d 100644 --- a/src/api/Service/Exe/stdafx.h +++ b/src/api/Service/Exe/stdafx.h @@ -42,21 +42,25 @@ #include "SWDevice.h" #include #include +#include "devpkey.h" // Shared helpers #include "midi_ump.h" #include "midi_timestamp.h" -#include "wstring_util.h" // AbstractionUtilities -#include "endpoint_data_helpers.h" -#include "swd_property_builders.h" -#include "json_helpers.h" +#include "wstring_util.h" +namespace internal = ::Windows::Devices::Midi2::Internal; -// Main definitions #include "MidiDefs.h" +#include "MidiDataFormat.h" +#include "MidiFlow.h" +#include "MidiAbstraction.h" + +#include "json_defs.h" +#include "json_helpers.h" +#include "swd_helpers.h" -namespace internal = ::Windows::Devices::Midi2::Internal; namespace shared = ::Windows::Devices::Midi2::Internal::Shared; #include "resource.h" diff --git a/src/api/Service/Inc/MidiClientManager.h b/src/api/Service/Inc/MidiClientManager.h index cbf6fdb3..ea65cdb9 100644 --- a/src/api/Service/Inc/MidiClientManager.h +++ b/src/api/Service/Inc/MidiClientManager.h @@ -49,8 +49,7 @@ class CMidiClientManager // TODO: These should be made more generic and go by a configuration, rather than have // discrete methods for each type of transform. But right now, it's about making the // transform process work properly - HRESULT - CMidiClientManager::GetMidiTransform( + HRESULT GetMidiTransform( _In_ handle_t, _In_ MidiFlow, _In_ MidiDataFormat, @@ -58,24 +57,21 @@ class CMidiClientManager _In_ wil::com_ptr_nothrow&, _In_ wil::com_ptr_nothrow&); - HRESULT - CMidiClientManager::GetMidiScheduler( + HRESULT GetMidiScheduler( _In_ handle_t, _In_ MidiFlow, _In_ wil::com_ptr_nothrow&, _In_ wil::com_ptr_nothrow&, _In_ wil::com_ptr_nothrow&); - HRESULT - CMidiClientManager::GetMidiJRTimestampHandler( + HRESULT GetMidiJRTimestampHandler( _In_ handle_t, _In_ MidiFlow, _In_ wil::com_ptr_nothrow&, _In_ wil::com_ptr_nothrow&, _In_ wil::com_ptr_nothrow&); - HRESULT - CMidiClientManager::GetMidiEndpointMetadataHandler( + HRESULT GetMidiEndpointMetadataHandler( _In_ handle_t, _In_ MidiFlow, _In_ wil::com_ptr_nothrow&, diff --git a/src/api/Test/Libs/MidiKSEnum/MidiKSEnum.vcxproj b/src/api/Test/Libs/MidiKSEnum/MidiKSEnum.vcxproj index dbee8601..654e5155 100644 --- a/src/api/Test/Libs/MidiKSEnum/MidiKSEnum.vcxproj +++ b/src/api/Test/Libs/MidiKSEnum/MidiKSEnum.vcxproj @@ -30,7 +30,7 @@ 17.0 {3BD492AD-A08C-4923-9486-138189CA4A0A} Win32Proj - 10.0.20348.0 + 10.0 @@ -123,7 +123,7 @@ Level4 %(AdditionalIncludeDirectories);$(SolutionDir)\inc;$(SolutionDir)\test\inc true - stdcpp17 + stdcpp20 @@ -132,7 +132,7 @@ Level4 %(AdditionalIncludeDirectories);$(SolutionDir)\inc;$(SolutionDir)\test\inc true - stdcpp17 + stdcpp20 @@ -141,7 +141,7 @@ Level4 %(AdditionalIncludeDirectories);$(SolutionDir)\inc;$(SolutionDir)\test\inc true - stdcpp17 + stdcpp20 @@ -150,7 +150,7 @@ Level4 %(AdditionalIncludeDirectories);$(SolutionDir)\inc;$(SolutionDir)\test\inc true - stdcpp17 + stdcpp20 @@ -159,7 +159,7 @@ Level4 %(AdditionalIncludeDirectories);$(SolutionDir)\inc;$(SolutionDir)\test\inc true - stdcpp17 + stdcpp20 @@ -168,7 +168,7 @@ Level4 %(AdditionalIncludeDirectories);$(SolutionDir)\inc;$(SolutionDir)\test\inc true - stdcpp17 + stdcpp20 @@ -182,12 +182,12 @@ - + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - + \ No newline at end of file diff --git a/src/api/Test/Libs/MidiKSEnum/packages.config b/src/api/Test/Libs/MidiKSEnum/packages.config index 14c63219..a6e30b6e 100644 --- a/src/api/Test/Libs/MidiKSEnum/packages.config +++ b/src/api/Test/Libs/MidiKSEnum/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/src/api/Test/Libs/MidiSWEnum/MidiSWEnum.vcxproj b/src/api/Test/Libs/MidiSWEnum/MidiSWEnum.vcxproj index ee3ddd44..070f35f4 100644 --- a/src/api/Test/Libs/MidiSWEnum/MidiSWEnum.vcxproj +++ b/src/api/Test/Libs/MidiSWEnum/MidiSWEnum.vcxproj @@ -123,7 +123,7 @@ Level4 %(AdditionalIncludeDirectories);$(SolutionDir)\inc;$(SolutionDir)\test\inc;$(SolutionDir)VSFiles\intermediate\idl\$(Platform)\$(Configuration);$(SolutionDir)VSFiles\intermediate\midi2.midisrvabstraction\$(Platform)\$(Configuration) true - stdcpp17 + stdcpp20 Disabled @@ -133,7 +133,7 @@ Level4 %(AdditionalIncludeDirectories);$(SolutionDir)\inc;$(SolutionDir)\test\inc;$(SolutionDir)VSFiles\intermediate\idl\$(Platform)\$(Configuration);$(SolutionDir)VSFiles\intermediate\midi2.midisrvabstraction\$(Platform)\$(Configuration) true - stdcpp17 + stdcpp20 @@ -142,7 +142,7 @@ Level4 %(AdditionalIncludeDirectories);$(SolutionDir)\inc;$(SolutionDir)\test\inc;$(SolutionDir)VSFiles\intermediate\idl\$(Platform)\$(Configuration);$(SolutionDir)VSFiles\intermediate\midi2.midisrvabstraction\$(Platform)\$(Configuration) true - stdcpp17 + stdcpp20 @@ -151,7 +151,7 @@ Level4 %(AdditionalIncludeDirectories);$(SolutionDir)\inc;$(SolutionDir)\test\inc;$(SolutionDir)VSFiles\intermediate\idl\$(Platform)\$(Configuration);$(SolutionDir)VSFiles\intermediate\midi2.midisrvabstraction\$(Platform)\$(Configuration) true - stdcpp17 + stdcpp20 @@ -160,7 +160,7 @@ Level4 %(AdditionalIncludeDirectories);$(SolutionDir)\inc;$(SolutionDir)\test\inc;$(SolutionDir)VSFiles\intermediate\idl\$(Platform)\$(Configuration);$(SolutionDir)VSFiles\intermediate\midi2.midisrvabstraction\$(Platform)\$(Configuration) true - stdcpp17 + stdcpp20 @@ -169,7 +169,7 @@ Level4 %(AdditionalIncludeDirectories);$(SolutionDir)\inc;$(SolutionDir)\test\inc;$(SolutionDir)VSFiles\intermediate\idl\$(Platform)\$(Configuration);$(SolutionDir)VSFiles\intermediate\midi2.midisrvabstraction\$(Platform)\$(Configuration) true - stdcpp17 + stdcpp20 @@ -183,12 +183,12 @@ - + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - + \ No newline at end of file diff --git a/src/api/Test/Libs/MidiSWEnum/packages.config b/src/api/Test/Libs/MidiSWEnum/packages.config index 14c63219..a6e30b6e 100644 --- a/src/api/Test/Libs/MidiSWEnum/packages.config +++ b/src/api/Test/Libs/MidiSWEnum/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/src/api/Test/Libs/MidiTestCommon/MidiTestCommon.vcxproj b/src/api/Test/Libs/MidiTestCommon/MidiTestCommon.vcxproj index 7cb1dc0a..b0d5fef3 100644 --- a/src/api/Test/Libs/MidiTestCommon/MidiTestCommon.vcxproj +++ b/src/api/Test/Libs/MidiTestCommon/MidiTestCommon.vcxproj @@ -100,7 +100,7 @@ Disabled %(AdditionalIncludeDirectories);$(SolutionDir)inc;$(WindowsSdkDir)Testing\Development\inc;$(SolutionDir)test\inc; true - stdcpp17 + stdcpp20 true @@ -115,7 +115,7 @@ ProgramDatabase %(AdditionalIncludeDirectories);$(SolutionDir)inc;$(WindowsSdkDir)Testing\Development\inc;$(SolutionDir)test\inc; true - stdcpp17 + stdcpp20 true @@ -130,7 +130,7 @@ Level4 %(AdditionalIncludeDirectories);$(SolutionDir)inc;$(WindowsSdkDir)Testing\Development\inc;$(SolutionDir)test\inc; true - stdcpp17 + stdcpp20 Disabled @@ -140,7 +140,7 @@ Level4 %(AdditionalIncludeDirectories);$(SolutionDir)inc;$(WindowsSdkDir)Testing\Development\inc;$(SolutionDir)test\inc; true - stdcpp17 + stdcpp20 @@ -159,12 +159,12 @@ - + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - + \ No newline at end of file diff --git a/src/api/Test/Libs/MidiTestCommon/packages.config b/src/api/Test/Libs/MidiTestCommon/packages.config index 14c63219..a6e30b6e 100644 --- a/src/api/Test/Libs/MidiTestCommon/packages.config +++ b/src/api/Test/Libs/MidiTestCommon/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/src/api/Test/Midi2.Abstraction.unittests/Midi2.Abstraction.unittests.vcxproj b/src/api/Test/Midi2.Abstraction.unittests/Midi2.Abstraction.unittests.vcxproj index 68b7e4d5..314fb1e9 100644 --- a/src/api/Test/Midi2.Abstraction.unittests/Midi2.Abstraction.unittests.vcxproj +++ b/src/api/Test/Midi2.Abstraction.unittests/Midi2.Abstraction.unittests.vcxproj @@ -92,7 +92,7 @@ %(AdditionalIncludeDirectories);$(SolutionDir)inc;$(SolutionDir)test\inc;$(WindowsSdkDir)Testing\Development\inc;$(SolutionDir)VSFiles\intermediate\idl\$(Platform)\$(Configuration);$(SolutionDir)VSFiles\intermediate\midi2.ksabstraction\$(Platform)\$(Configuration);$(SolutionDir)VSFiles\intermediate\midi2.midisrvabstraction\$(Platform)\$(Configuration) Level4 true - stdcpp17 + stdcpp20 %(AdditionalDependencies);midixproc.lib;onecoreuap.lib;ksuser.lib;avrt.lib;midikscommon.lib;midiswenum.lib;miditestcommon.lib;$(CoreLibraryDependencies) @@ -103,7 +103,7 @@ %(AdditionalIncludeDirectories);$(SolutionDir)inc;$(SolutionDir)test\inc;$(WindowsSdkDir)Testing\Development\inc;$(SolutionDir)VSFiles\intermediate\idl\$(Platform)\$(Configuration);$(SolutionDir)VSFiles\intermediate\midi2.ksabstraction\$(Platform)\$(Configuration);$(SolutionDir)VSFiles\intermediate\midi2.midisrvabstraction\$(Platform)\$(Configuration) Level4 true - stdcpp17 + stdcpp20 %(AdditionalDependencies);midixproc.lib;onecoreuap.lib;ksuser.lib;avrt.lib;midikscommon.lib;midiswenum.lib;miditestcommon.lib;$(CoreLibraryDependencies) @@ -118,7 +118,7 @@ Level4 %(AdditionalIncludeDirectories);$(SolutionDir)inc;$(SolutionDir)test\inc;$(WindowsSdkDir)Testing\Development\inc;$(SolutionDir)VSFiles\intermediate\idl\$(Platform)\$(Configuration);$(SolutionDir)VSFiles\intermediate\midi2.ksabstraction\$(Platform)\$(Configuration);$(SolutionDir)VSFiles\intermediate\midi2.midisrvabstraction\$(Platform)\$(Configuration) true - stdcpp17 + stdcpp20 @@ -149,12 +149,12 @@ - + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - + \ No newline at end of file diff --git a/src/api/Test/Midi2.Abstraction.unittests/packages.config b/src/api/Test/Midi2.Abstraction.unittests/packages.config index 14c63219..a6e30b6e 100644 --- a/src/api/Test/Midi2.Abstraction.unittests/packages.config +++ b/src/api/Test/Midi2.Abstraction.unittests/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/src/api/Test/Midi2.Abstraction.unittests/stdafx.h b/src/api/Test/Midi2.Abstraction.unittests/stdafx.h index fe629f7d..1613ce82 100644 --- a/src/api/Test/Midi2.Abstraction.unittests/stdafx.h +++ b/src/api/Test/Midi2.Abstraction.unittests/stdafx.h @@ -1,6 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. #pragma once + +// this is a hack, but because this is a test project, and know we're not +// using coroutines in our tests, we'll risk it. +#define _ALLOW_COROUTINE_ABI_MISMATCH + + #include #include #include diff --git a/src/api/Test/Midi2.Client.benchmarks/Midi2.Client.benchmarks.vcxproj b/src/api/Test/Midi2.Client.benchmarks/Midi2.Client.benchmarks.vcxproj index 4c224806..4c267b1b 100644 --- a/src/api/Test/Midi2.Client.benchmarks/Midi2.Client.benchmarks.vcxproj +++ b/src/api/Test/Midi2.Client.benchmarks/Midi2.Client.benchmarks.vcxproj @@ -1,6 +1,6 @@ - + Debug @@ -23,7 +23,7 @@ 17.0 {4DABE157-7DD5-422A-8C77-B83EAC9987D0} Win32Proj - 10.0.20348.0 + 10.0 true true true @@ -171,15 +171,15 @@ - - + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - + + + \ No newline at end of file diff --git a/src/api/Test/Midi2.Client.benchmarks/packages.config b/src/api/Test/Midi2.Client.benchmarks/packages.config index 2884a839..1b706ca9 100644 --- a/src/api/Test/Midi2.Client.benchmarks/packages.config +++ b/src/api/Test/Midi2.Client.benchmarks/packages.config @@ -1,4 +1,5 @@  - + + \ No newline at end of file diff --git a/src/api/Test/Midi2.Client.benchmarks/stdafx.h b/src/api/Test/Midi2.Client.benchmarks/stdafx.h index 2552d5b3..a72e720d 100644 --- a/src/api/Test/Midi2.Client.benchmarks/stdafx.h +++ b/src/api/Test/Midi2.Client.benchmarks/stdafx.h @@ -1,6 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. #pragma once + +#ifndef STDAFX_H +#define STDAFX_H + + #include #include @@ -37,3 +42,4 @@ using namespace winrt::Windows::Devices::Midi2; +#endif \ No newline at end of file diff --git a/src/api/Test/Midi2.Client.unittests/Midi2.Client.unittests.vcxproj b/src/api/Test/Midi2.Client.unittests/Midi2.Client.unittests.vcxproj index 67238690..9485bf94 100644 --- a/src/api/Test/Midi2.Client.unittests/Midi2.Client.unittests.vcxproj +++ b/src/api/Test/Midi2.Client.unittests/Midi2.Client.unittests.vcxproj @@ -1,6 +1,6 @@ - + Debug @@ -23,7 +23,7 @@ 17.0 {14F12F86-9BDE-4DA3-B295-7FD990080E57} Win32Proj - 10.0.20348.0 + 10.0 true true true @@ -191,15 +191,15 @@ - - + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - + + + \ No newline at end of file diff --git a/src/api/Test/Midi2.Client.unittests/MidiClockTests.cpp b/src/api/Test/Midi2.Client.unittests/MidiClockTests.cpp index 7068fd4c..83b129fa 100644 --- a/src/api/Test/Midi2.Client.unittests/MidiClockTests.cpp +++ b/src/api/Test/Midi2.Client.unittests/MidiClockTests.cpp @@ -9,9 +9,6 @@ #include "stdafx.h" -#include "MidiClockTests.h" - - using namespace winrt::Windows::Devices::Midi2; diff --git a/src/api/Test/Midi2.Client.unittests/MidiEndpointConnectionBufferTests.cpp b/src/api/Test/Midi2.Client.unittests/MidiEndpointConnectionBufferTests.cpp index 2d20aa6b..21fcdef2 100644 --- a/src/api/Test/Midi2.Client.unittests/MidiEndpointConnectionBufferTests.cpp +++ b/src/api/Test/Midi2.Client.unittests/MidiEndpointConnectionBufferTests.cpp @@ -10,11 +10,6 @@ #include "stdafx.h" -#include "MidiEndpointConnectionBufferTests.h" - - -#include - using namespace winrt::Windows::Devices::Midi2; diff --git a/src/api/Test/Midi2.Client.unittests/MidiEndpointConnectionTests.cpp b/src/api/Test/Midi2.Client.unittests/MidiEndpointConnectionTests.cpp index 1e8a3ac9..1d351165 100644 --- a/src/api/Test/Midi2.Client.unittests/MidiEndpointConnectionTests.cpp +++ b/src/api/Test/Midi2.Client.unittests/MidiEndpointConnectionTests.cpp @@ -10,11 +10,6 @@ #include "stdafx.h" -#include "MidiEndpointConnectionTests.h" - - -#include - using namespace winrt::Windows::Devices::Midi2; diff --git a/src/api/Test/Midi2.Client.unittests/MidiEndpointCreationThreadTests.cpp b/src/api/Test/Midi2.Client.unittests/MidiEndpointCreationThreadTests.cpp index 0343011a..84629260 100644 --- a/src/api/Test/Midi2.Client.unittests/MidiEndpointCreationThreadTests.cpp +++ b/src/api/Test/Midi2.Client.unittests/MidiEndpointCreationThreadTests.cpp @@ -1,11 +1,8 @@ #include "stdafx.h" -#include "MidiEndpointCreationThreadTests.h" -#include - #define NUM_MESSAGES_TO_TRANSMIT 10 diff --git a/src/api/Test/Midi2.Client.unittests/MidiEndpointDeviceWatcherTests.cpp b/src/api/Test/Midi2.Client.unittests/MidiEndpointDeviceWatcherTests.cpp index 105a5fa8..a360d256 100644 --- a/src/api/Test/Midi2.Client.unittests/MidiEndpointDeviceWatcherTests.cpp +++ b/src/api/Test/Midi2.Client.unittests/MidiEndpointDeviceWatcherTests.cpp @@ -9,8 +9,6 @@ #include "stdafx.h" -#include "MidiEndpointDeviceWatcherTests.h" - using namespace winrt::Windows::Devices::Midi2; diff --git a/src/api/Test/Midi2.Client.unittests/MidiEndpointListenerTests.cpp b/src/api/Test/Midi2.Client.unittests/MidiEndpointListenerTests.cpp index 86ee7e92..89e26e22 100644 --- a/src/api/Test/Midi2.Client.unittests/MidiEndpointListenerTests.cpp +++ b/src/api/Test/Midi2.Client.unittests/MidiEndpointListenerTests.cpp @@ -9,8 +9,6 @@ #include "stdafx.h" -#include "MidiEndpointListenerTests.h" - void MidiEndpointListenerTests::TestMessageTypeListener() { diff --git a/src/api/Test/Midi2.Client.unittests/MidiFunctionBlockMessageBuilderTests.cpp b/src/api/Test/Midi2.Client.unittests/MidiFunctionBlockMessageBuilderTests.cpp index ba05568a..6769efc7 100644 --- a/src/api/Test/Midi2.Client.unittests/MidiFunctionBlockMessageBuilderTests.cpp +++ b/src/api/Test/Midi2.Client.unittests/MidiFunctionBlockMessageBuilderTests.cpp @@ -10,8 +10,6 @@ #include "stdafx.h" -#include "MidiFunctionBlockMessageBuilderTests.h" - using namespace winrt::Windows::Devices::Midi2; diff --git a/src/api/Test/Midi2.Client.unittests/MidiMessageBuilderTests.cpp b/src/api/Test/Midi2.Client.unittests/MidiMessageBuilderTests.cpp index e594ad08..aade7af3 100644 --- a/src/api/Test/Midi2.Client.unittests/MidiMessageBuilderTests.cpp +++ b/src/api/Test/Midi2.Client.unittests/MidiMessageBuilderTests.cpp @@ -9,10 +9,6 @@ #include "stdafx.h" - -#include "MidiMessageBuilderTests.h" - - void MidiMessageBuilderTests::TestBuildType0UtilityMessages() { uint8_t status = 0x0D; diff --git a/src/api/Test/Midi2.Client.unittests/MidiMessagePacketTests.cpp b/src/api/Test/Midi2.Client.unittests/MidiMessagePacketTests.cpp index 4cba3c46..a18b7b2e 100644 --- a/src/api/Test/Midi2.Client.unittests/MidiMessagePacketTests.cpp +++ b/src/api/Test/Midi2.Client.unittests/MidiMessagePacketTests.cpp @@ -10,9 +10,6 @@ #include "stdafx.h" -#include "MidiMessagePacketTests.h" - - using namespace winrt::Windows::Devices::Midi2; void MidiMessagePacketTests::TestUmp32() diff --git a/src/api/Test/Midi2.Client.unittests/MidiMessageSchedulerTests.cpp b/src/api/Test/Midi2.Client.unittests/MidiMessageSchedulerTests.cpp index b4d6376a..3725a7a8 100644 --- a/src/api/Test/Midi2.Client.unittests/MidiMessageSchedulerTests.cpp +++ b/src/api/Test/Midi2.Client.unittests/MidiMessageSchedulerTests.cpp @@ -9,8 +9,6 @@ #include "stdafx.h" -#include "MidiMessageSchedulerTests.h" - void MidiMessageSchedulerTests::TestScheduledMessagesTimingSmall() { LOG_OUTPUT(L"Test timing small **********************************************************************"); diff --git a/src/api/Test/Midi2.Client.unittests/MidiSessionTests.cpp b/src/api/Test/Midi2.Client.unittests/MidiSessionTests.cpp index 470180d8..39276ca8 100644 --- a/src/api/Test/Midi2.Client.unittests/MidiSessionTests.cpp +++ b/src/api/Test/Midi2.Client.unittests/MidiSessionTests.cpp @@ -9,8 +9,6 @@ #include "stdafx.h" -#include "MidiSessionTests.h" - using namespace winrt::Windows::Devices::Midi2; void MidiSessionTests::TestCreateNewSessionWithoutSettings() diff --git a/src/api/Test/Midi2.Client.unittests/MidiStreamMessageBuilderTests.cpp b/src/api/Test/Midi2.Client.unittests/MidiStreamMessageBuilderTests.cpp index b41374f9..ca9b07e1 100644 --- a/src/api/Test/Midi2.Client.unittests/MidiStreamMessageBuilderTests.cpp +++ b/src/api/Test/Midi2.Client.unittests/MidiStreamMessageBuilderTests.cpp @@ -9,9 +9,6 @@ #include "stdafx.h" - -#include "MidiStreamMessageBuilderTests.h" - using namespace winrt::Windows::Devices::Midi2; void MidiStreamMessageBuilderTests::TestBuildEndpointNameNotificationLong() diff --git a/src/api/Test/Midi2.Client.unittests/packages.config b/src/api/Test/Midi2.Client.unittests/packages.config index 14c63219..e9c036c6 100644 --- a/src/api/Test/Midi2.Client.unittests/packages.config +++ b/src/api/Test/Midi2.Client.unittests/packages.config @@ -1,4 +1,5 @@  - + + \ No newline at end of file diff --git a/src/api/Test/Midi2.Client.unittests/stdafx.h b/src/api/Test/Midi2.Client.unittests/stdafx.h index 315da31e..de520a9f 100644 --- a/src/api/Test/Midi2.Client.unittests/stdafx.h +++ b/src/api/Test/Midi2.Client.unittests/stdafx.h @@ -1,6 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. #pragma once +#ifndef STDAFX_H +#define STDAFX_H + #include #include @@ -20,7 +23,22 @@ #include "loopback_ids.h" #include "MidiDefs.h" + +#include "MidiClockTests.h" +#include "MidiEndpointConnectionBufferTests.h" +#include "MidiEndpointConnectionTests.h" +#include "MidiEndpointCreationThreadTests.h" +#include "MidiEndpointDeviceWatcherTests.h" +#include "MidiEndpointListenerTests.h" +#include "MidiFunctionBlockMessageBuilderTests.h" +#include "MidiMessageBuilderTests.h" +#include "MidiMessagePacketTests.h" +#include "MidiMessageSchedulerTests.h" +#include "MidiSessionTests.h" +#include "MidiStreamMessageBuilderTests.h" + #ifndef LOG_OUTPUT #define LOG_OUTPUT(fmt, ...) WEX::Logging::Log::Comment(WEX::Common::String().Format(fmt, __VA_ARGS__)) #endif +#endif \ No newline at end of file diff --git a/src/api/Test/Midi2.Driver.unittests/Midi2.Driver.unittests.vcxproj b/src/api/Test/Midi2.Driver.unittests/Midi2.Driver.unittests.vcxproj index 88dd5afb..343afceb 100644 --- a/src/api/Test/Midi2.Driver.unittests/Midi2.Driver.unittests.vcxproj +++ b/src/api/Test/Midi2.Driver.unittests/Midi2.Driver.unittests.vcxproj @@ -39,7 +39,7 @@ 12.0 Debug Win32 - 10.0.22621.0 + 10.0 @@ -177,12 +177,12 @@ - + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - + \ No newline at end of file diff --git a/src/api/Test/Midi2.Driver.unittests/packages.config b/src/api/Test/Midi2.Driver.unittests/packages.config index 14c63219..a6e30b6e 100644 --- a/src/api/Test/Midi2.Driver.unittests/packages.config +++ b/src/api/Test/Midi2.Driver.unittests/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/src/api/Test/Midi2.Driver.unittests/stdafx.h b/src/api/Test/Midi2.Driver.unittests/stdafx.h index 36ccb1fc..4d596bad 100644 --- a/src/api/Test/Midi2.Driver.unittests/stdafx.h +++ b/src/api/Test/Midi2.Driver.unittests/stdafx.h @@ -1,6 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. #pragma once +// this is a hack, but because this is a test project, and know we're not +// using coroutines in our tests, we'll risk it. +#define _ALLOW_COROUTINE_ABI_MISMATCH + + #include #include diff --git a/src/api/Test/Midi2.Service.unittests/Midi2.Service.unittests.vcxproj b/src/api/Test/Midi2.Service.unittests/Midi2.Service.unittests.vcxproj index 45b65cde..bc8c45e2 100644 --- a/src/api/Test/Midi2.Service.unittests/Midi2.Service.unittests.vcxproj +++ b/src/api/Test/Midi2.Service.unittests/Midi2.Service.unittests.vcxproj @@ -22,7 +22,7 @@ 17.0 {4C09E660-79C6-4BA1-B823-21A867A3A4A9} Win32Proj - 10.0.22621.0 + 10.0 @@ -92,7 +92,7 @@ Level4 %(AdditionalIncludeDirectories);$(SolutionDir)inc;$(SolutionDir)test\inc;$(WindowsSdkDir)\Testing\Development\inc;$(SolutionDir)VSFiles\intermediate\idl\$(Platform)\$(Configuration);$(SolutionDir)VSFiles\intermediate\midisrv\$(Platform)\$(Configuration);$(SolutionDir)VSFiles\intermediate\midi2.midisrvabstraction\$(Platform)\$(Configuration) true - stdcpp17 + stdcpp20 %(AdditionalDependencies);onecoreuap.lib;ksuser.lib;avrt.lib;midixproc.lib;midikscommon.lib;midiswenum.lib;miditestcommon.lib;$(CoreLibraryDependencies) @@ -103,7 +103,7 @@ Level4 %(AdditionalIncludeDirectories);$(SolutionDir)inc;$(SolutionDir)test\inc;$(WindowsSdkDir)\Testing\Development\inc;$(SolutionDir)VSFiles\intermediate\idl\$(Platform)\$(Configuration);$(SolutionDir)VSFiles\intermediate\midisrv\$(Platform)\$(Configuration);$(SolutionDir)VSFiles\intermediate\midi2.midisrvabstraction\$(Platform)\$(Configuration) true - stdcpp17 + stdcpp20 %(AdditionalDependencies);onecoreuap.lib;ksuser.lib;avrt.lib;midixproc.lib;midikscommon.lib;midiswenum.lib;miditestcommon.lib;$(CoreLibraryDependencies) @@ -114,7 +114,7 @@ Level4 %(AdditionalIncludeDirectories);$(SolutionDir)inc;$(SolutionDir)test\inc;$(WindowsSdkDir)\Testing\Development\inc;$(SolutionDir)VSFiles\intermediate\idl\$(Platform)\$(Configuration);$(SolutionDir)VSFiles\intermediate\midisrv\$(Platform)\$(Configuration);$(SolutionDir)VSFiles\intermediate\midi2.midisrvabstraction\$(Platform)\$(Configuration) true - stdcpp17 + stdcpp20 %(AdditionalDependencies);onecoreuap.lib;ksuser.lib;avrt.lib;midixproc.lib;midikscommon.lib;midiswenum.lib;miditestcommon.lib;$(CoreLibraryDependencies) @@ -149,12 +149,12 @@ - + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - + \ No newline at end of file diff --git a/src/api/Test/Midi2.Service.unittests/Midi2ServiceTests.cpp b/src/api/Test/Midi2.Service.unittests/Midi2ServiceTests.cpp index d0371071..f7cd4eda 100644 --- a/src/api/Test/Midi2.Service.unittests/Midi2ServiceTests.cpp +++ b/src/api/Test/Midi2.Service.unittests/Midi2ServiceTests.cpp @@ -44,9 +44,9 @@ HRESULT GetMidiSrvBindingHandle(handle_t* BindingHandle) RETURN_IF_WIN32_ERROR(RpcStringBindingCompose( nullptr, - reinterpret_cast(MIDISRV_LRPC_PROTOCOL), + (RPC_WSTR)MIDISRV_LRPC_PROTOCOL, nullptr, - reinterpret_cast(MIDISRV_ENDPOINT), + (RPC_WSTR)MIDISRV_ENDPOINT, nullptr, &stringBinding)); @@ -106,7 +106,7 @@ void Midi2ServiceTests::TestMidiServiceClientRPC() { WEX::TestExecution::SetVerifyOutput verifySettings(WEX::TestExecution::VerifyOutputSettings::LogOnlyFailures); - MIDISRV_CLIENTCREATION_PARAMS creationParams {0}; + MIDISRV_CLIENTCREATION_PARAMS creationParams { }; PMIDISRV_CLIENT client {nullptr}; wil::unique_rpc_binding bindingHandle; MidiClientHandle clientHandle{ 0 }; diff --git a/src/api/Test/Midi2.Service.unittests/packages.config b/src/api/Test/Midi2.Service.unittests/packages.config index 14c63219..a6e30b6e 100644 --- a/src/api/Test/Midi2.Service.unittests/packages.config +++ b/src/api/Test/Midi2.Service.unittests/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/src/api/Test/Midi2.Service.unittests/stdafx.h b/src/api/Test/Midi2.Service.unittests/stdafx.h index 5ad42934..1b9944c5 100644 --- a/src/api/Test/Midi2.Service.unittests/stdafx.h +++ b/src/api/Test/Midi2.Service.unittests/stdafx.h @@ -1,6 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. #pragma once +// this is a hack, but because this is a test project, and know we're not +// using coroutines in our tests, we'll risk it. +#define _ALLOW_COROUTINE_ABI_MISMATCH + #include #include diff --git a/src/api/Test/Midi2.Transform.unittests/Midi2.Transform.unittests.vcxproj b/src/api/Test/Midi2.Transform.unittests/Midi2.Transform.unittests.vcxproj index e7098bc6..050aad06 100644 --- a/src/api/Test/Midi2.Transform.unittests/Midi2.Transform.unittests.vcxproj +++ b/src/api/Test/Midi2.Transform.unittests/Midi2.Transform.unittests.vcxproj @@ -149,12 +149,12 @@ - + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - + \ No newline at end of file diff --git a/src/api/Test/Midi2.Transform.unittests/packages.config b/src/api/Test/Midi2.Transform.unittests/packages.config index 2884a839..09be25d9 100644 --- a/src/api/Test/Midi2.Transform.unittests/packages.config +++ b/src/api/Test/Midi2.Transform.unittests/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/src/api/Test/inc/MidiTestCommon.h b/src/api/Test/inc/MidiTestCommon.h index a8ae9a57..776841ef 100644 --- a/src/api/Test/inc/MidiTestCommon.h +++ b/src/api/Test/inc/MidiTestCommon.h @@ -1,6 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. #pragma once +#ifndef MIDITESTCOMMON_H +#define MIDITESTCOMMON_H + typedef struct { BYTE status; @@ -48,3 +51,6 @@ void PrintMidiMessage(_In_ PVOID, _In_ UINT32, _In_ UINT32, _In_ LONGLONG); #define LOG_OUTPUT(fmt, ...) WEX::Logging::Log::Comment(WEX::Common::String().Format(fmt, __VA_ARGS__)) #endif + +#endif + diff --git a/src/api/Transform/ByteStreamToUMP/Midi2.BS2UMPTransform.vcxproj b/src/api/Transform/ByteStreamToUMP/Midi2.BS2UMPTransform.vcxproj index ebdb15cf..763a5531 100644 --- a/src/api/Transform/ByteStreamToUMP/Midi2.BS2UMPTransform.vcxproj +++ b/src/api/Transform/ByteStreamToUMP/Midi2.BS2UMPTransform.vcxproj @@ -30,7 +30,7 @@ 17.0 {206CEDBF-6343-4171-87A8-1DDDE6E2ED60} Win32Proj - 10.0.20348.0 + 10.0 @@ -144,7 +144,7 @@ %(AdditionalIncludeDirectories);$(SolutionDir)inc;$(SolutionDir)VSFiles\intermediate\idl\$(Platform)\$(Configuration);$(IntDir);$(SolutionDir)Libs\AM_MIDI2\Include Create pch.h - stdcpp17 + stdcpp20 %(AdditionalDependencies);onecoreuap.lib;avrt.lib;am_midi2.lib;$(CoreLibraryDependencies) @@ -162,7 +162,7 @@ %(AdditionalIncludeDirectories);$(SolutionDir)inc;$(SolutionDir)VSFiles\intermediate\idl\$(Platform)\$(Configuration);$(IntDir);$(SolutionDir)Libs\AM_MIDI2\Include Create pch.h - stdcpp17 + stdcpp20 %(AdditionalDependencies);onecoreuap.lib;avrt.lib;am_midi2.lib;$(CoreLibraryDependencies) @@ -180,7 +180,7 @@ %(AdditionalIncludeDirectories);$(SolutionDir)inc;$(SolutionDir)VSFiles\intermediate\idl\$(Platform)\$(Configuration);$(IntDir);$(SolutionDir)Libs\AM_MIDI2\Include Create pch.h - stdcpp17 + stdcpp20 %(AdditionalDependencies);onecoreuap.lib;avrt.lib;am_midi2.lib;$(CoreLibraryDependencies) @@ -217,7 +217,7 @@ true Create pch.h - stdcpp17 + stdcpp20 %(AdditionalDependencies);onecoreuap.lib;avrt.lib;am_midi2.lib;$(CoreLibraryDependencies) @@ -234,7 +234,7 @@ true Create pch.h - stdcpp17 + stdcpp20 %(AdditionalDependencies);onecoreuap.lib;avrt.lib;am_midi2.lib;$(CoreLibraryDependencies) @@ -261,7 +261,7 @@ true Create pch.h - stdcpp17 + stdcpp20 %(AdditionalDependencies);onecoreuap.lib;avrt.lib;am_midi2.lib;$(CoreLibraryDependencies) @@ -299,12 +299,12 @@ - + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - + \ No newline at end of file diff --git a/src/api/Transform/ByteStreamToUMP/packages.config b/src/api/Transform/ByteStreamToUMP/packages.config index 14c63219..a6e30b6e 100644 --- a/src/api/Transform/ByteStreamToUMP/packages.config +++ b/src/api/Transform/ByteStreamToUMP/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/src/api/Transform/EndpointMetadataListenerTransform/Midi2.EndpointMetadataListenerTransform.vcxproj b/src/api/Transform/EndpointMetadataListenerTransform/Midi2.EndpointMetadataListenerTransform.vcxproj index 35514a94..153b5544 100644 --- a/src/api/Transform/EndpointMetadataListenerTransform/Midi2.EndpointMetadataListenerTransform.vcxproj +++ b/src/api/Transform/EndpointMetadataListenerTransform/Midi2.EndpointMetadataListenerTransform.vcxproj @@ -30,7 +30,7 @@ 17.0 {0DDD9961-7959-46B1-A11D-05BA8AF65297} Win32Proj - 10.0.20348.0 + 10.0 Midi2.EndpointMetadataListenerTransform @@ -151,7 +151,7 @@ %(AdditionalIncludeDirectories);$(SolutionDir)inc;$(SolutionDir)VSFiles\intermediate\idl\$(Platform)\$(Configuration);$(IntDir) Create pch.h - stdcpp17 + stdcpp20 %(AdditionalDependencies);onecoreuap.lib;avrt.lib;$(CoreLibraryDependencies) @@ -169,7 +169,7 @@ %(AdditionalIncludeDirectories);$(SolutionDir)inc;$(SolutionDir)VSFiles\intermediate\idl\$(Platform)\$(Configuration);$(IntDir) Create pch.h - stdcpp17 + stdcpp20 %(AdditionalDependencies);onecoreuap.lib;avrt.lib;$(CoreLibraryDependencies) @@ -187,7 +187,7 @@ %(AdditionalIncludeDirectories);$(SolutionDir)inc;$(SolutionDir)VSFiles\intermediate\idl\$(Platform)\$(Configuration);$(IntDir) Create pch.h - stdcpp17 + stdcpp20 %(AdditionalDependencies);onecoreuap.lib;avrt.lib;$(CoreLibraryDependencies) @@ -224,7 +224,7 @@ true Create pch.h - stdcpp17 + stdcpp20 %(AdditionalDependencies);onecoreuap.lib;avrt.lib;$(CoreLibraryDependencies) @@ -241,7 +241,7 @@ true Create pch.h - stdcpp17 + stdcpp20 %(AdditionalDependencies);onecoreuap.lib;avrt.lib;$(CoreLibraryDependencies) @@ -268,7 +268,7 @@ true Create pch.h - stdcpp17 + stdcpp20 %(AdditionalDependencies);onecoreuap.lib;avrt.lib;$(CoreLibraryDependencies) @@ -308,12 +308,12 @@ - + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - + \ No newline at end of file diff --git a/src/api/Transform/EndpointMetadataListenerTransform/packages.config b/src/api/Transform/EndpointMetadataListenerTransform/packages.config index 2884a839..09be25d9 100644 --- a/src/api/Transform/EndpointMetadataListenerTransform/packages.config +++ b/src/api/Transform/EndpointMetadataListenerTransform/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/src/api/Transform/JitterReductionGeneratorTransform/Midi2.JitterReductionGeneratorTransform.vcxproj b/src/api/Transform/JitterReductionGeneratorTransform/Midi2.JitterReductionGeneratorTransform.vcxproj index 128853fc..823c53ab 100644 --- a/src/api/Transform/JitterReductionGeneratorTransform/Midi2.JitterReductionGeneratorTransform.vcxproj +++ b/src/api/Transform/JitterReductionGeneratorTransform/Midi2.JitterReductionGeneratorTransform.vcxproj @@ -30,7 +30,7 @@ 17.0 {6D151BF5-40A2-4BD7-BB67-07D2741DA01E} Win32Proj - 10.0.20348.0 + 10.0 Midi2.JitterReductionGeneratorTransform @@ -151,7 +151,7 @@ %(AdditionalIncludeDirectories);$(SolutionDir)inc;$(SolutionDir)VSFiles\intermediate\idl\$(Platform)\$(Configuration);$(IntDir) Create pch.h - stdcpp17 + stdcpp20 %(AdditionalDependencies);onecoreuap.lib;avrt.lib;$(CoreLibraryDependencies) @@ -169,7 +169,7 @@ %(AdditionalIncludeDirectories);$(SolutionDir)inc;$(SolutionDir)VSFiles\intermediate\idl\$(Platform)\$(Configuration);$(IntDir) Create pch.h - stdcpp17 + stdcpp20 %(AdditionalDependencies);onecoreuap.lib;avrt.lib;$(CoreLibraryDependencies) @@ -187,7 +187,7 @@ %(AdditionalIncludeDirectories);$(SolutionDir)inc;$(SolutionDir)VSFiles\intermediate\idl\$(Platform)\$(Configuration);$(IntDir) Create pch.h - stdcpp17 + stdcpp20 %(AdditionalDependencies);onecoreuap.lib;avrt.lib;$(CoreLibraryDependencies) @@ -224,7 +224,7 @@ true Create pch.h - stdcpp17 + stdcpp20 %(AdditionalDependencies);onecoreuap.lib;avrt.lib;$(CoreLibraryDependencies) @@ -241,7 +241,7 @@ true Create pch.h - stdcpp17 + stdcpp20 %(AdditionalDependencies);onecoreuap.lib;avrt.lib;$(CoreLibraryDependencies) @@ -268,7 +268,7 @@ true Create pch.h - stdcpp17 + stdcpp20 %(AdditionalDependencies);onecoreuap.lib;avrt.lib;$(CoreLibraryDependencies) @@ -307,12 +307,12 @@ - + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - + \ No newline at end of file diff --git a/src/api/Transform/JitterReductionGeneratorTransform/packages.config b/src/api/Transform/JitterReductionGeneratorTransform/packages.config index 2884a839..09be25d9 100644 --- a/src/api/Transform/JitterReductionGeneratorTransform/packages.config +++ b/src/api/Transform/JitterReductionGeneratorTransform/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/src/api/Transform/JitterReductionListenerTransform/Midi2.JitterReductionListenerTransform.vcxproj b/src/api/Transform/JitterReductionListenerTransform/Midi2.JitterReductionListenerTransform.vcxproj index eaace7a3..9698cc66 100644 --- a/src/api/Transform/JitterReductionListenerTransform/Midi2.JitterReductionListenerTransform.vcxproj +++ b/src/api/Transform/JitterReductionListenerTransform/Midi2.JitterReductionListenerTransform.vcxproj @@ -30,7 +30,7 @@ 17.0 {36E99993-ABE3-44CC-A776-B4E835B5EEC6} Win32Proj - 10.0.20348.0 + 10.0 Midi2.JitterReductionListenerTransform @@ -151,7 +151,7 @@ %(AdditionalIncludeDirectories);$(SolutionDir)inc;$(SolutionDir)VSFiles\intermediate\idl\$(Platform)\$(Configuration);$(IntDir) Create pch.h - stdcpp17 + stdcpp20 %(AdditionalDependencies);onecoreuap.lib;avrt.lib;$(CoreLibraryDependencies) @@ -169,7 +169,7 @@ %(AdditionalIncludeDirectories);$(SolutionDir)inc;$(SolutionDir)VSFiles\intermediate\idl\$(Platform)\$(Configuration);$(IntDir) Create pch.h - stdcpp17 + stdcpp20 %(AdditionalDependencies);onecoreuap.lib;avrt.lib;$(CoreLibraryDependencies) @@ -187,7 +187,7 @@ %(AdditionalIncludeDirectories);$(SolutionDir)inc;$(SolutionDir)VSFiles\intermediate\idl\$(Platform)\$(Configuration);$(IntDir) Create pch.h - stdcpp17 + stdcpp20 %(AdditionalDependencies);onecoreuap.lib;avrt.lib;$(CoreLibraryDependencies) @@ -224,7 +224,7 @@ true Create pch.h - stdcpp17 + stdcpp20 %(AdditionalDependencies);onecoreuap.lib;avrt.lib;$(CoreLibraryDependencies) @@ -241,7 +241,7 @@ true Create pch.h - stdcpp17 + stdcpp20 %(AdditionalDependencies);onecoreuap.lib;avrt.lib;$(CoreLibraryDependencies) @@ -268,7 +268,7 @@ true Create pch.h - stdcpp17 + stdcpp20 %(AdditionalDependencies);onecoreuap.lib;avrt.lib;$(CoreLibraryDependencies) @@ -307,12 +307,12 @@ - + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - + \ No newline at end of file diff --git a/src/api/Transform/JitterReductionListenerTransform/packages.config b/src/api/Transform/JitterReductionListenerTransform/packages.config index 2884a839..09be25d9 100644 --- a/src/api/Transform/JitterReductionListenerTransform/packages.config +++ b/src/api/Transform/JitterReductionListenerTransform/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/src/api/Transform/SampleTransform/Midi2.SampleTransform.vcxproj b/src/api/Transform/SampleTransform/Midi2.SampleTransform.vcxproj index b6287a98..9948eccf 100644 --- a/src/api/Transform/SampleTransform/Midi2.SampleTransform.vcxproj +++ b/src/api/Transform/SampleTransform/Midi2.SampleTransform.vcxproj @@ -30,7 +30,7 @@ 17.0 {35B356BF-276B-4D4E-83AA-CB3B98A92F42} Win32Proj - 10.0.20348.0 + 10.0 @@ -144,7 +144,7 @@ %(AdditionalIncludeDirectories);$(SolutionDir)inc;$(SolutionDir)VSFiles\intermediate\idl\$(Platform)\$(Configuration);$(IntDir) Create pch.h - stdcpp17 + stdcpp20 %(AdditionalDependencies);onecoreuap.lib;avrt.lib;$(CoreLibraryDependencies) @@ -162,7 +162,7 @@ %(AdditionalIncludeDirectories);$(SolutionDir)inc;$(SolutionDir)VSFiles\intermediate\idl\$(Platform)\$(Configuration);$(IntDir) Create pch.h - stdcpp17 + stdcpp20 %(AdditionalDependencies);onecoreuap.lib;avrt.lib;$(CoreLibraryDependencies) @@ -180,7 +180,7 @@ %(AdditionalIncludeDirectories);$(SolutionDir)inc;$(SolutionDir)VSFiles\intermediate\idl\$(Platform)\$(Configuration);$(IntDir) Create pch.h - stdcpp17 + stdcpp20 %(AdditionalDependencies);onecoreuap.lib;avrt.lib;$(CoreLibraryDependencies) @@ -217,7 +217,7 @@ true Create pch.h - stdcpp17 + stdcpp20 %(AdditionalDependencies);onecoreuap.lib;avrt.lib;$(CoreLibraryDependencies) @@ -234,7 +234,7 @@ true Create pch.h - stdcpp17 + stdcpp20 %(AdditionalDependencies);onecoreuap.lib;avrt.lib;$(CoreLibraryDependencies) @@ -261,7 +261,7 @@ true Create pch.h - stdcpp17 + stdcpp20 %(AdditionalDependencies);onecoreuap.lib;avrt.lib;$(CoreLibraryDependencies) @@ -299,12 +299,12 @@ - + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - + \ No newline at end of file diff --git a/src/api/Transform/SampleTransform/packages.config b/src/api/Transform/SampleTransform/packages.config index 14c63219..a6e30b6e 100644 --- a/src/api/Transform/SampleTransform/packages.config +++ b/src/api/Transform/SampleTransform/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/src/api/Transform/SchedulerTransform/Midi2.SchedulerTransform.vcxproj b/src/api/Transform/SchedulerTransform/Midi2.SchedulerTransform.vcxproj index 93e07633..760b5be7 100644 --- a/src/api/Transform/SchedulerTransform/Midi2.SchedulerTransform.vcxproj +++ b/src/api/Transform/SchedulerTransform/Midi2.SchedulerTransform.vcxproj @@ -30,7 +30,7 @@ 17.0 {366FA284-D8C0-4CC5-B9A3-917EAB967173} Win32Proj - 10.0.20348.0 + 10.0 @@ -144,7 +144,7 @@ %(AdditionalIncludeDirectories);$(SolutionDir)inc;$(SolutionDir)VSFiles\intermediate\idl\$(Platform)\$(Configuration);$(IntDir) Create pch.h - stdcpp17 + stdcpp20 %(AdditionalDependencies);onecoreuap.lib;avrt.lib;$(CoreLibraryDependencies) @@ -162,7 +162,7 @@ %(AdditionalIncludeDirectories);$(SolutionDir)inc;$(SolutionDir)VSFiles\intermediate\idl\$(Platform)\$(Configuration);$(IntDir) Create pch.h - stdcpp17 + stdcpp20 %(AdditionalDependencies);onecoreuap.lib;avrt.lib;$(CoreLibraryDependencies) @@ -180,7 +180,7 @@ %(AdditionalIncludeDirectories);$(SolutionDir)inc;$(SolutionDir)VSFiles\intermediate\idl\$(Platform)\$(Configuration);$(IntDir) Create pch.h - stdcpp17 + stdcpp20 %(AdditionalDependencies);onecoreuap.lib;avrt.lib;$(CoreLibraryDependencies) @@ -217,7 +217,7 @@ true Create pch.h - stdcpp17 + stdcpp20 %(AdditionalDependencies);onecoreuap.lib;avrt.lib;$(CoreLibraryDependencies) @@ -234,7 +234,7 @@ true Create pch.h - stdcpp17 + stdcpp20 %(AdditionalDependencies);onecoreuap.lib;avrt.lib;$(CoreLibraryDependencies) @@ -261,7 +261,7 @@ true Create pch.h - stdcpp17 + stdcpp20 %(AdditionalDependencies);onecoreuap.lib;avrt.lib;$(CoreLibraryDependencies) @@ -301,12 +301,12 @@ - + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - + \ No newline at end of file diff --git a/src/api/Transform/SchedulerTransform/packages.config b/src/api/Transform/SchedulerTransform/packages.config index 2884a839..09be25d9 100644 --- a/src/api/Transform/SchedulerTransform/packages.config +++ b/src/api/Transform/SchedulerTransform/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/src/api/Transform/UMPToByteStream/Midi2.UMP2BSTransform.vcxproj b/src/api/Transform/UMPToByteStream/Midi2.UMP2BSTransform.vcxproj index 058a48b7..1035c451 100644 --- a/src/api/Transform/UMPToByteStream/Midi2.UMP2BSTransform.vcxproj +++ b/src/api/Transform/UMPToByteStream/Midi2.UMP2BSTransform.vcxproj @@ -30,7 +30,7 @@ 17.0 {0E739771-0C0B-42EE-AADB-95E7E1E5A5ED} Win32Proj - 10.0.20348.0 + 10.0 @@ -144,7 +144,7 @@ %(AdditionalIncludeDirectories);$(SolutionDir)inc;$(SolutionDir)VSFiles\intermediate\idl\$(Platform)\$(Configuration);$(IntDir);$(SolutionDir)Libs\AM_MIDI2\Include Create pch.h - stdcpp17 + stdcpp20 %(AdditionalDependencies);onecoreuap.lib;avrt.lib;am_midi2.lib;$(CoreLibraryDependencies) @@ -154,6 +154,7 @@ $(SolutionDir)\idl;%(AdditionalIncludeDirectories) $(SolutionDir)VSFiles\intermediate\MIDI2.UMP2BSTransform\$(Platform)\$(Configuration)\ %(Filename).h + false @@ -162,7 +163,7 @@ %(AdditionalIncludeDirectories);$(SolutionDir)inc;$(SolutionDir)VSFiles\intermediate\idl\$(Platform)\$(Configuration);$(IntDir);$(SolutionDir)Libs\AM_MIDI2\Include Create pch.h - stdcpp17 + stdcpp20 %(AdditionalDependencies);onecoreuap.lib;avrt.lib;am_midi2.lib;$(CoreLibraryDependencies) @@ -172,6 +173,7 @@ $(SolutionDir)\idl;%(AdditionalIncludeDirectories) $(SolutionDir)VSFiles\intermediate\MIDI2.UMP2BSTransform\$(Platform)\$(Configuration)\ %(Filename).h + false @@ -180,7 +182,7 @@ %(AdditionalIncludeDirectories);$(SolutionDir)inc;$(SolutionDir)VSFiles\intermediate\idl\$(Platform)\$(Configuration);$(IntDir);$(SolutionDir)Libs\AM_MIDI2\Include Create pch.h - stdcpp17 + stdcpp20 %(AdditionalDependencies);onecoreuap.lib;avrt.lib;am_midi2.lib;$(CoreLibraryDependencies) @@ -190,6 +192,7 @@ $(SolutionDir)\idl;%(AdditionalIncludeDirectories) $(SolutionDir)VSFiles\intermediate\MIDI2.UMP2BSTransform\$(Platform)\$(Configuration)\ %(Filename).h + false @@ -217,7 +220,7 @@ true Create pch.h - stdcpp17 + stdcpp20 %(AdditionalDependencies);onecoreuap.lib;avrt.lib;am_midi2.lib;$(CoreLibraryDependencies) @@ -227,6 +230,7 @@ $(SolutionDir)\idl;%(AdditionalIncludeDirectories) $(SolutionDir)VSFiles\intermediate\MIDI2.UMP2BSTransform\$(Platform)\$(Configuration)\ %(Filename).h + false @@ -234,7 +238,7 @@ true Create pch.h - stdcpp17 + stdcpp20 %(AdditionalDependencies);onecoreuap.lib;avrt.lib;am_midi2.lib;$(CoreLibraryDependencies) @@ -244,6 +248,7 @@ $(SolutionDir)\idl;%(AdditionalIncludeDirectories) $(SolutionDir)VSFiles\intermediate\MIDI2.UMP2BSTransform\$(Platform)\$(Configuration)\ %(Filename).h + false @@ -261,7 +266,7 @@ true Create pch.h - stdcpp17 + stdcpp20 %(AdditionalDependencies);onecoreuap.lib;avrt.lib;am_midi2.lib;$(CoreLibraryDependencies) @@ -271,6 +276,7 @@ $(SolutionDir)\idl;%(AdditionalIncludeDirectories) $(SolutionDir)VSFiles\intermediate\MIDI2.UMP2BSTransform\$(Platform)\$(Configuration)\ %(Filename).h + false @@ -299,12 +305,12 @@ - + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - + \ No newline at end of file diff --git a/src/api/Transform/UMPToByteStream/packages.config b/src/api/Transform/UMPToByteStream/packages.config index 14c63219..a6e30b6e 100644 --- a/src/api/Transform/UMPToByteStream/packages.config +++ b/src/api/Transform/UMPToByteStream/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/src/api/idl/IDL.vcxproj b/src/api/idl/IDL.vcxproj index af6a0999..f0c21827 100644 --- a/src/api/idl/IDL.vcxproj +++ b/src/api/idl/IDL.vcxproj @@ -30,7 +30,7 @@ 17.0 {EFB7CF90-7DEF-44CF-868A-191CA30E0FCF} Win32Proj - 10.0.22621.0 + 10.0 @@ -131,7 +131,7 @@ %(Filename).h - stdcpp17 + stdcpp20 @@ -140,7 +140,7 @@ %(Filename).h - stdcpp17 + stdcpp20 @@ -149,7 +149,7 @@ %(Filename).h - stdcpp17 + stdcpp20 @@ -158,7 +158,7 @@ %(Filename).h - stdcpp17 + stdcpp20 @@ -167,7 +167,7 @@ %(Filename).h - stdcpp17 + stdcpp20 @@ -176,7 +176,7 @@ %(Filename).h - stdcpp17 + stdcpp20 @@ -193,12 +193,12 @@ - + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - + \ No newline at end of file diff --git a/src/api/idl/packages.config b/src/api/idl/packages.config index 14c63219..a6e30b6e 100644 --- a/src/api/idl/packages.config +++ b/src/api/idl/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/src/user-tools/midi-settings/Microsoft.Midi.Settings/App.xaml.cs b/src/user-tools/midi-settings/Microsoft.Midi.Settings/App.xaml.cs index 43cc250d..ca0a74ce 100644 --- a/src/user-tools/midi-settings/Microsoft.Midi.Settings/App.xaml.cs +++ b/src/user-tools/midi-settings/Microsoft.Midi.Settings/App.xaml.cs @@ -90,6 +90,10 @@ public App() services.AddTransient(); services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + + services.AddTransient(); services.AddTransient(); diff --git a/src/user-tools/midi-settings/Microsoft.Midi.Settings/Helpers/MidiEndpointDevicePurposeConverter.cs b/src/user-tools/midi-settings/Microsoft.Midi.Settings/Helpers/MidiEndpointDevicePurposeConverter.cs new file mode 100644 index 00000000..57d06a2c --- /dev/null +++ b/src/user-tools/midi-settings/Microsoft.Midi.Settings/Helpers/MidiEndpointDevicePurposeConverter.cs @@ -0,0 +1,59 @@ +using Microsoft.UI.Xaml.Data; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Microsoft.Midi.Settings.Helpers +{ + public class MidiEndpointDevicePurposeConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, string language) + { + if (value is null) + { + return string.Empty; + } + + if (value is MidiEndpointDevicePurpose) + { + var val = (MidiEndpointDevicePurpose)value; + + // TODO: Localize + + switch (val) + { + case MidiEndpointDevicePurpose.DiagnosticPing: + return "Internal endpoint for the service ping feature"; + + case MidiEndpointDevicePurpose.DiagnosticLoopback: + return "Loopback endpoint for testing and development"; + + case MidiEndpointDevicePurpose.InBoxGeneralMidiSynth: + return "In-box General MIDI 1.0 Synth"; + + case MidiEndpointDevicePurpose.VirtualDeviceResponder: + return "The private device-side connection of an app-to-app MIDI setup"; + + case MidiEndpointDevicePurpose.NormalMessageEndpoint: + return "Normal message endpoint"; + + default: + return "Unknown"; + } + } + else + { + return string.Empty; + } + + } + + public object ConvertBack(object value, Type targetType, object parameter, string language) + { + throw new NotImplementedException(); + } + } + +} diff --git a/src/user-tools/midi-settings/Microsoft.Midi.Settings/Helpers/MidiEndpointNativeDataFormatConverter.cs b/src/user-tools/midi-settings/Microsoft.Midi.Settings/Helpers/MidiEndpointNativeDataFormatConverter.cs new file mode 100644 index 00000000..f366dd21 --- /dev/null +++ b/src/user-tools/midi-settings/Microsoft.Midi.Settings/Helpers/MidiEndpointNativeDataFormatConverter.cs @@ -0,0 +1,51 @@ +using Microsoft.UI.Xaml.Data; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Microsoft.Midi.Settings.Helpers +{ + public class MidiEndpointNativeDataFormatConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, string language) + { + if (value is null) + { + return string.Empty; + } + + if (value is MidiEndpointNativeDataFormat) + { + var val = (MidiEndpointNativeDataFormat)value; + + // TODO: Localize + + switch (val) + { + case MidiEndpointNativeDataFormat.UniversalMidiPacket: + return "MIDI 2.0 Universal MIDI Packet (UMP) format"; + + case MidiEndpointNativeDataFormat.ByteStream: + return "MIDI 1.0 byte stream format"; + + + default: + return "Unknown"; + } + } + else + { + return string.Empty; + } + + } + + public object ConvertBack(object value, Type targetType, object parameter, string language) + { + throw new NotImplementedException(); + } + } + +} diff --git a/src/user-tools/midi-settings/Microsoft.Midi.Settings/Helpers/MidiFunctionBlockMidi10Converter.cs b/src/user-tools/midi-settings/Microsoft.Midi.Settings/Helpers/MidiFunctionBlockMidi10Converter.cs new file mode 100644 index 00000000..7840bd56 --- /dev/null +++ b/src/user-tools/midi-settings/Microsoft.Midi.Settings/Helpers/MidiFunctionBlockMidi10Converter.cs @@ -0,0 +1,53 @@ +using Microsoft.UI.Xaml.Data; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Microsoft.Midi.Settings.Helpers +{ + public class MidiFunctionBlockMidi10Converter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, string language) + { + if (value is null) + { + return string.Empty; + } + + if (value is MidiFunctionBlockMidi10) + { + var val = (MidiFunctionBlockMidi10)value; + + // TODO: Localize + + switch (val) + { + case MidiFunctionBlockMidi10.Not10: + return "Not MIDI 1.0"; + + case MidiFunctionBlockMidi10.YesBandwidthUnrestricted: + return "MIDI 1.0 unrestricted bandwidth"; + + case MidiFunctionBlockMidi10.YesBandwidthRestricted: + return "MIDI 1.0 restricted bandwidth"; + + default: + return "Unknown"; + } + } + else + { + return string.Empty; + } + + } + + public object ConvertBack(object value, Type targetType, object parameter, string language) + { + throw new NotImplementedException(); + } + } + +} diff --git a/src/user-tools/midi-settings/Microsoft.Midi.Settings/Helpers/MidiFunctionBlockSysEx8FormatConverter.cs b/src/user-tools/midi-settings/Microsoft.Midi.Settings/Helpers/MidiFunctionBlockSysEx8FormatConverter.cs new file mode 100644 index 00000000..c59c3b36 --- /dev/null +++ b/src/user-tools/midi-settings/Microsoft.Midi.Settings/Helpers/MidiFunctionBlockSysEx8FormatConverter.cs @@ -0,0 +1,46 @@ +using Microsoft.UI.Xaml.Data; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Microsoft.Midi.Settings.Helpers +{ + public class MidiFunctionBlockSysEx8FormatConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, string language) + { + if (value is null) + { + return string.Empty; + } + + if (value is byte) + { + var val = (byte)value; + + // todo: localize + + if (val==0) + { + return "8-bit SysEx not supported"; + } + else + { + return val.ToString() ; + } + } + else + { + return string.Empty; + } + + } + + public object ConvertBack(object value, Type targetType, object parameter, string language) + { + throw new NotImplementedException(); + } + } +} diff --git a/src/user-tools/midi-settings/Microsoft.Midi.Settings/Helpers/MidiGroupIndexConverter.cs b/src/user-tools/midi-settings/Microsoft.Midi.Settings/Helpers/MidiGroupIndexConverter.cs new file mode 100644 index 00000000..9a15c9a8 --- /dev/null +++ b/src/user-tools/midi-settings/Microsoft.Midi.Settings/Helpers/MidiGroupIndexConverter.cs @@ -0,0 +1,38 @@ +using Microsoft.UI.Xaml.Data; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Microsoft.Midi.Settings.Helpers +{ + public class MidiGroupIndexConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, string language) + { + if (value is null) + { + return string.Empty; + } + + if (value is byte) + { + var val = (byte)value; + + // todo: localize + return $"{MidiGroup.LabelFull} {(val + 1)} (Index {val})"; + } + else + { + return string.Empty; + } + + } + + public object ConvertBack(object value, Type targetType, object parameter, string language) + { + throw new NotImplementedException(); + } + } +} diff --git a/src/user-tools/midi-settings/Microsoft.Midi.Settings/Microsoft.Midi.Settings.csproj b/src/user-tools/midi-settings/Microsoft.Midi.Settings/Microsoft.Midi.Settings.csproj index 1c33c4e5..e47b7884 100644 --- a/src/user-tools/midi-settings/Microsoft.Midi.Settings/Microsoft.Midi.Settings.csproj +++ b/src/user-tools/midi-settings/Microsoft.Midi.Settings/Microsoft.Midi.Settings.csproj @@ -4,7 +4,7 @@ net8.0-windows10.0.20348.0 10.0.20348.0 enable - Microsoft.Devices.Midi2.Settings + Microsoft.Midi.Settings Assets/WindowIcon.ico app.manifest @@ -53,6 +53,7 @@ + @@ -70,25 +71,26 @@ - - - - + + + + + - - + + - + - + - + - + @@ -99,6 +101,9 @@ Always + + MSBuild:Compile + MSBuild:Compile @@ -180,5 +185,10 @@ + + + ResXFileCodeGenerator + + diff --git a/src/user-tools/midi-settings/Microsoft.Midi.Settings/Models/AppState.cs b/src/user-tools/midi-settings/Microsoft.Midi.Settings/Models/AppState.cs index 3be9d86e..701b8eea 100644 --- a/src/user-tools/midi-settings/Microsoft.Midi.Settings/Models/AppState.cs +++ b/src/user-tools/midi-settings/Microsoft.Midi.Settings/Models/AppState.cs @@ -1,9 +1,10 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Resources; using System.Text; using System.Threading.Tasks; -//using Microsoft.Midi.Settings.SdkMock; + namespace Microsoft.Midi.Settings.Models; @@ -11,10 +12,11 @@ namespace Microsoft.Midi.Settings.Models; public class AppState { private static AppState? _current; - //private MidiSession? _midiSession; + private MidiSession? _midiSession; private AppState() { + _midiSession = MidiSession.CreateSession("AppSessionName".GetLocalized()); } public static AppState Current @@ -30,28 +32,14 @@ public static AppState Current // static because the settings app is only opening one session, but an // app can have more than one MidiSession - //public MidiSession? MidiSession - //{ - // get - // { - // return _midiSession; - // } - //} - - //public bool HasActiveMidiSession - //{ - // get - // { - // return _midiSession != null; - // } - //} - - //public void CreateMidiSession() - //{ - // // todo: set session name etc. - - // _midiSession = new MidiSession(); - //} + public MidiSession? MidiSession + { + get + { + + return _midiSession; + } + } } diff --git a/src/user-tools/midi-settings/Microsoft.Midi.Settings/Services/PageService.cs b/src/user-tools/midi-settings/Microsoft.Midi.Settings/Services/PageService.cs index 8ada2c17..f97188b3 100644 --- a/src/user-tools/midi-settings/Microsoft.Midi.Settings/Services/PageService.cs +++ b/src/user-tools/midi-settings/Microsoft.Midi.Settings/Services/PageService.cs @@ -17,6 +17,9 @@ public PageService() Configure(); Configure(); + Configure(); + + Configure(); Configure(); Configure(); diff --git a/src/user-tools/midi-settings/Microsoft.Midi.Settings/Strings/en-us/Resources.resw b/src/user-tools/midi-settings/Microsoft.Midi.Settings/Strings/en-us/Resources.resw index 6ad31f5c..4cff11fd 100644 --- a/src/user-tools/midi-settings/Microsoft.Midi.Settings/Strings/en-us/Resources.resw +++ b/src/user-tools/midi-settings/Microsoft.Midi.Settings/Strings/en-us/Resources.resw @@ -285,4 +285,7 @@ Below is a list of all MIDI devices as seen by the legacy MIDI 1.0 APIs, and the apps which use them. + + Settings + \ No newline at end of file diff --git a/src/user-tools/midi-settings/Microsoft.Midi.Settings/Styles/FontSizes.xaml b/src/user-tools/midi-settings/Microsoft.Midi.Settings/Styles/FontSizes.xaml index 44904b1c..f8ec9ee7 100644 --- a/src/user-tools/midi-settings/Microsoft.Midi.Settings/Styles/FontSizes.xaml +++ b/src/user-tools/midi-settings/Microsoft.Midi.Settings/Styles/FontSizes.xaml @@ -4,6 +4,13 @@ 24 + 20 + 16 + 14 + + 12 + + diff --git a/src/user-tools/midi-settings/Microsoft.Midi.Settings/Styles/TextBlock.xaml b/src/user-tools/midi-settings/Microsoft.Midi.Settings/Styles/TextBlock.xaml index 7a81d165..14add3a3 100644 --- a/src/user-tools/midi-settings/Microsoft.Midi.Settings/Styles/TextBlock.xaml +++ b/src/user-tools/midi-settings/Microsoft.Midi.Settings/Styles/TextBlock.xaml @@ -11,6 +11,40 @@ + + + + + + + + \ No newline at end of file diff --git a/src/user-tools/midi-settings/Microsoft.Midi.Settings/Usings.cs b/src/user-tools/midi-settings/Microsoft.Midi.Settings/Usings.cs index 4cc487e9..c5a49ff0 100644 --- a/src/user-tools/midi-settings/Microsoft.Midi.Settings/Usings.cs +++ b/src/user-tools/midi-settings/Microsoft.Midi.Settings/Usings.cs @@ -1 +1,3 @@ global using WinUIEx; +global using Microsoft.Midi.Settings.Helpers; +global using Windows.Devices.Midi2; \ No newline at end of file diff --git a/src/user-tools/midi-settings/Microsoft.Midi.Settings/ViewModels/DeviceDetailViewModel.cs b/src/user-tools/midi-settings/Microsoft.Midi.Settings/ViewModels/DeviceDetailViewModel.cs new file mode 100644 index 00000000..4278ca9b --- /dev/null +++ b/src/user-tools/midi-settings/Microsoft.Midi.Settings/ViewModels/DeviceDetailViewModel.cs @@ -0,0 +1,34 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using CommunityToolkit.Mvvm.ComponentModel; +using Microsoft.Midi.Settings.Contracts.ViewModels; +using Microsoft.Midi.Settings.Models; +using Microsoft.UI.Dispatching; + +namespace Microsoft.Midi.Settings.ViewModels +{ + public class DeviceDetailViewModel : ObservableRecipient, INavigationAware + { + + public MidiEndpointDeviceInformation? DeviceInformation + { + get; private set; + } + + + + public void OnNavigatedFrom() + { + // throw new NotImplementedException(); + } + + public void OnNavigatedTo(object parameter) + { + DeviceInformation = (MidiEndpointDeviceInformation)parameter; + } + } +} diff --git a/src/user-tools/midi-settings/Microsoft.Midi.Settings/ViewModels/DevicesViewModel.cs b/src/user-tools/midi-settings/Microsoft.Midi.Settings/ViewModels/DevicesViewModel.cs index 4e0d3c6b..d1c73d7c 100644 --- a/src/user-tools/midi-settings/Microsoft.Midi.Settings/ViewModels/DevicesViewModel.cs +++ b/src/user-tools/midi-settings/Microsoft.Midi.Settings/ViewModels/DevicesViewModel.cs @@ -4,47 +4,173 @@ using System.Linq; using System.Text; using System.Threading.Tasks; +using System.Windows.Input; using CommunityToolkit.Mvvm.ComponentModel; +using CommunityToolkit.Mvvm.Input; +using Microsoft.Midi.Settings.Contracts.Services; using Microsoft.Midi.Settings.Contracts.ViewModels; using Microsoft.Midi.Settings.Models; +using Microsoft.UI.Dispatching; +using Microsoft.UI.Xaml; + + //using Microsoft.Midi.Settings.SdkMock; +using Windows.Devices.Midi2; + namespace Microsoft.Midi.Settings.ViewModels { public class DevicesViewModel : ObservableRecipient, INavigationAware { - public DevicesViewModel() + private MidiEndpointDeviceWatcher? _watcher = null; + private DispatcherQueue _dispatcherQueue; + + private INavigationService _navigationService; + + public ICommand ViewDeviceDetailsCommand + { + get; private set; + } + + public DevicesViewModel(INavigationService navigationService) { + _navigationService = navigationService; + + _dispatcherQueue = DispatcherQueue.GetForCurrentThread(); + + ViewDeviceDetailsCommand = new RelayCommand( + async (param) => + { + System.Diagnostics.Debug.WriteLine("View Device Details Command exec"); + + _navigationService.NavigateTo(typeof(DeviceDetailViewModel).FullName!, param); + + }); + } + + public ObservableCollection MidiEndpointDevices { get; private set; } = + new ObservableCollection(); + + public event EventHandler? EndpointDeviceUpdated; + + + + // CollectionViewSource grouped by transport + + + + + + + + + + + + + + + + + private void StartDeviceWatcher(bool includeAll) + { + if (_watcher != null) + { + ShutDownDeviceWatcher(); + } + + var filter = MidiEndpointDeviceInformationFilter.AllTypicalEndpoints; + + if (includeAll) + { + filter |= MidiEndpointDeviceInformationFilter.IncludeDiagnosticLoopback; + filter |= MidiEndpointDeviceInformationFilter.IncludeDiagnosticPing; + filter |= MidiEndpointDeviceInformationFilter.IncludeVirtualDeviceResponder; + } + + _watcher = MidiEndpointDeviceWatcher.CreateWatcher(filter); + + _watcher.Stopped += OnDeviceWatcherStopped; + _watcher.Updated += OnDeviceWatcherEndpointUpdated; + _watcher.Removed += OnDeviceWatcherEndpointRemoved; + _watcher.Added += OnDeviceWatcherEndpointAdded; + _watcher.EnumerationCompleted += OnDeviceWatcherEnumerationCompleted; + + _watcher.Start(); } + private void OnDeviceWatcherEnumerationCompleted(MidiEndpointDeviceWatcher sender, object args) + { + // todo + } - //public ObservableCollection Devices - //{ - // get - // { - // if (!AppState.Current.HasActiveMidiSession || AppState.Current.MidiSession is null) - // { - // AppState.Current.CreateMidiSession(); - // } + private void OnDeviceWatcherEndpointAdded(MidiEndpointDeviceWatcher sender, MidiEndpointDeviceInformation args) + { + _dispatcherQueue.TryEnqueue(() => + { + MidiEndpointDevices.Add(args); + }); + } - // return AppState.Current.MidiSession.Devices; + private void OnDeviceWatcherEndpointRemoved(MidiEndpointDeviceWatcher sender, global::Windows.Devices.Enumeration.DeviceInformationUpdate args) + { + _dispatcherQueue.TryEnqueue(() => + { + foreach (MidiEndpointDeviceInformation info in MidiEndpointDevices) + { + if (info.Id == args.Id) + { + MidiEndpointDevices.Remove(info); + break; + } + } + }); + } - // } - //} + private void OnDeviceWatcherEndpointUpdated(MidiEndpointDeviceWatcher sender, MidiEndpointDeviceInformationUpdateEventArgs args) + { + _dispatcherQueue.TryEnqueue(() => + { + if (EndpointDeviceUpdated != null) + { + EndpointDeviceUpdated(sender, args); + } + }); + } + private void OnDeviceWatcherStopped(MidiEndpointDeviceWatcher sender, object args) + { + // nothing to do. + } + private void ShutDownDeviceWatcher() + { + if (_watcher != null) + { + _watcher.Stop(); + _watcher.Stopped -= OnDeviceWatcherStopped; + _watcher.Updated -= OnDeviceWatcherEndpointUpdated; + _watcher.Removed -= OnDeviceWatcherEndpointRemoved; + _watcher.Added -= OnDeviceWatcherEndpointAdded; + _watcher = null; + } + } public void OnNavigatedFrom() { + ShutDownDeviceWatcher(); } + + public void OnNavigatedTo(object parameter) { + StartDeviceWatcher(true); } } } diff --git a/src/user-tools/midi-settings/Microsoft.Midi.Settings/ViewModels/SettingsViewModel.cs b/src/user-tools/midi-settings/Microsoft.Midi.Settings/ViewModels/SettingsViewModel.cs index 1f42e7a4..4d53dd3b 100644 --- a/src/user-tools/midi-settings/Microsoft.Midi.Settings/ViewModels/SettingsViewModel.cs +++ b/src/user-tools/midi-settings/Microsoft.Midi.Settings/ViewModels/SettingsViewModel.cs @@ -48,7 +48,10 @@ public ICommand SwitchThemeCommand } - public SettingsViewModel(IThemeSelectorService themeSelectorService, ILocalSettingsService localSettingsService, IGeneralSettingsService generalSettingsService) + public SettingsViewModel( + IThemeSelectorService themeSelectorService, + ILocalSettingsService localSettingsService, + IGeneralSettingsService generalSettingsService) { _themeSelectorService = themeSelectorService; _elementTheme = _themeSelectorService.Theme; diff --git a/src/user-tools/midi-settings/Microsoft.Midi.Settings/Views/DeviceDetailPage.xaml b/src/user-tools/midi-settings/Microsoft.Midi.Settings/Views/DeviceDetailPage.xaml new file mode 100644 index 00000000..d7c3e927 --- /dev/null +++ b/src/user-tools/midi-settings/Microsoft.Midi.Settings/Views/DeviceDetailPage.xaml @@ -0,0 +1,347 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +