diff --git a/src/api/Client/Midi2Client/IMidiUniversalPacket.idl b/src/api/Client/Midi2Client/IMidiUniversalPacket.idl index 7cc3b86e..9c8ede65 100644 --- a/src/api/Client/Midi2Client/IMidiUniversalPacket.idl +++ b/src/api/Client/Midi2Client/IMidiUniversalPacket.idl @@ -29,8 +29,8 @@ namespace Windows.Devices.Midi2 IVector GetAllWords(); - UInt8 AppendAllMessageWordsToVector(IVector targetVector); + UInt8 AppendAllMessageWordsToList(IVector targetList); - UInt8 AddAllMessageBytesToBuffer(UInt32 byteOffset, Windows.Foundation.IMemoryBuffer buffer); + UInt8 FillBuffer(UInt32 byteOffset, Windows.Foundation.IMemoryBuffer buffer); }; } \ No newline at end of file diff --git a/src/api/Client/Midi2Client/MidiEndpointDeviceInformation.cpp b/src/api/Client/Midi2Client/MidiEndpointDeviceInformation.cpp index 01db7a5f..b161f147 100644 --- a/src/api/Client/Midi2Client/MidiEndpointDeviceInformation.cpp +++ b/src/api/Client/Midi2Client/MidiEndpointDeviceInformation.cpp @@ -113,20 +113,22 @@ namespace winrt::Windows::Devices::Midi2::implementation additionalProperties.Append(STRING_PKEY_MIDI_TransportMnemonic); additionalProperties.Append(STRING_PKEY_MIDI_NativeDataFormat); + additionalProperties.Append(STRING_PKEY_MIDI_SupportsMulticlient); additionalProperties.Append(STRING_PKEY_MIDI_SupportedDataFormats); + additionalProperties.Append(STRING_PKEY_MIDI_ManufacturerName); + additionalProperties.Append(STRING_PKEY_MIDI_GenerateIncomingTimestamp); + additionalProperties.Append(STRING_PKEY_MIDI_TransportSuppliedEndpointName); additionalProperties.Append(STRING_PKEY_MIDI_TransportSuppliedDescription); - additionalProperties.Append(STRING_PKEY_MIDI_SupportsMulticlient); - additionalProperties.Append(STRING_PKEY_MIDI_GenerateIncomingTimestamp); + // USB / KS Properties =============================================================== // TODO: Group Terminal Blocks will likely be a single property additionalProperties.Append(STRING_PKEY_MIDI_IN_GroupTerminalBlocks); additionalProperties.Append(STRING_PKEY_MIDI_OUT_GroupTerminalBlocks); additionalProperties.Append(STRING_PKEY_MIDI_AssociatedUMP); - additionalProperties.Append(STRING_PKEY_MIDI_ManufacturerName); additionalProperties.Append(STRING_PKEY_MIDI_SerialNumber); additionalProperties.Append(STRING_PKEY_MIDI_UsbVID); additionalProperties.Append(STRING_PKEY_MIDI_UsbPID); @@ -135,6 +137,8 @@ namespace winrt::Windows::Devices::Midi2::implementation // Major Known Endpoint Types ======================================================== additionalProperties.Append(STRING_PKEY_MIDI_EndpointDevicePurpose); + additionalProperties.Append(STRING_PKEY_MIDI_EndpointRequiresMetadataHandler); + // In-protocol Endpoint information ================================================== additionalProperties.Append(STRING_PKEY_MIDI_EndpointSupportsMidi2Protocol); additionalProperties.Append(STRING_PKEY_MIDI_EndpointSupportsMidi1Protocol); @@ -142,6 +146,7 @@ namespace winrt::Windows::Devices::Midi2::implementation additionalProperties.Append(STRING_PKEY_MIDI_EndpointSupportsSendingJRTimestamps); additionalProperties.Append(STRING_PKEY_MIDI_EndpointUmpVersionMajor); additionalProperties.Append(STRING_PKEY_MIDI_EndpointUmpVersionMinor); + additionalProperties.Append(STRING_PKEY_MIDI_EndpointProvidedName); additionalProperties.Append(STRING_PKEY_MIDI_EndpointProvidedProductInstanceId); additionalProperties.Append(STRING_PKEY_MIDI_DeviceIdentity); @@ -176,6 +181,13 @@ namespace winrt::Windows::Devices::Midi2::implementation additionalProperties.Append(STRING_PKEY_MIDI_FunctionBlocksLastUpdateTime); + additionalProperties.Append(STRING_PKEY_MIDI_MidiOutCalculatedLatencyTicks); + additionalProperties.Append(STRING_PKEY_MIDI_MidiOutUserSuppliedLatencyTicks); + additionalProperties.Append(STRING_PKEY_MIDI_MidiOutLatencyTicksUserOverride); + + + additionalProperties.Append(STRING_PKEY_MIDI_VirtualMidiEndpointAssociator); + // Calculated metrics ================================================================= // we don't load them here because they would spam device information update events diff --git a/src/api/Client/Midi2Client/MidiEndpointDeviceInformation.idl b/src/api/Client/Midi2Client/MidiEndpointDeviceInformation.idl index 5bd32bb9..baae7538 100644 --- a/src/api/Client/Midi2Client/MidiEndpointDeviceInformation.idl +++ b/src/api/Client/Midi2Client/MidiEndpointDeviceInformation.idl @@ -136,9 +136,6 @@ namespace Windows.Devices.Midi2 - - - // The settings app allows the user to add some metadata, like a description String UserSuppliedName{ get; }; // name supplied by the user, if available String UserSuppliedDescription{ get; }; diff --git a/src/api/Client/Midi2Client/MidiMessage128.cpp b/src/api/Client/Midi2Client/MidiMessage128.cpp index 40dc932a..cb21a25f 100644 --- a/src/api/Client/Midi2Client/MidiMessage128.cpp +++ b/src/api/Client/Midi2Client/MidiMessage128.cpp @@ -25,7 +25,7 @@ namespace winrt::Windows::Devices::Midi2::implementation } _Use_decl_annotations_ - uint8_t MidiMessage128::AppendAllMessageWordsToVector(collections::IVector targetVector) const noexcept + uint8_t MidiMessage128::AppendAllMessageWordsToList(collections::IVector targetVector) const noexcept { targetVector.Append(m_ump.word0); targetVector.Append(m_ump.word1); @@ -36,7 +36,7 @@ namespace winrt::Windows::Devices::Midi2::implementation } _Use_decl_annotations_ - uint8_t MidiMessage128::AddAllMessageBytesToBuffer(uint32_t const byteOffset, foundation::IMemoryBuffer const& buffer) const noexcept + uint8_t MidiMessage128::FillBuffer(uint32_t const byteOffset, foundation::IMemoryBuffer const& buffer) const noexcept { const uint8_t numWordsInPacket = 4; const uint8_t numBytesInPacket = numWordsInPacket * sizeof(uint32_t); diff --git a/src/api/Client/Midi2Client/MidiMessage128.h b/src/api/Client/Midi2Client/MidiMessage128.h index 84f99ede..8bffc89b 100644 --- a/src/api/Client/Midi2Client/MidiMessage128.h +++ b/src/api/Client/Midi2Client/MidiMessage128.h @@ -66,10 +66,10 @@ namespace winrt::Windows::Devices::Midi2::implementation collections::IVector GetAllWords() const noexcept; - uint8_t AppendAllMessageWordsToVector( + uint8_t AppendAllMessageWordsToList( _Inout_ collections::IVector targetVector) const noexcept; - uint8_t AddAllMessageBytesToBuffer( + uint8_t FillBuffer( _In_ uint32_t const byteOffset, _In_ foundation::IMemoryBuffer const& buffer ) const noexcept; diff --git a/src/api/Client/Midi2Client/MidiMessage32.cpp b/src/api/Client/Midi2Client/MidiMessage32.cpp index 384b3656..0b12a437 100644 --- a/src/api/Client/Midi2Client/MidiMessage32.cpp +++ b/src/api/Client/Midi2Client/MidiMessage32.cpp @@ -25,7 +25,7 @@ namespace winrt::Windows::Devices::Midi2::implementation } _Use_decl_annotations_ - uint8_t MidiMessage32::AppendAllMessageWordsToVector(collections::IVector targetVector) const noexcept + uint8_t MidiMessage32::AppendAllMessageWordsToList(collections::IVector targetVector) const noexcept { targetVector.Append(m_ump.word0); @@ -33,7 +33,7 @@ namespace winrt::Windows::Devices::Midi2::implementation } _Use_decl_annotations_ - uint8_t MidiMessage32::AddAllMessageBytesToBuffer(uint32_t const byteOffset, foundation::IMemoryBuffer const& buffer) const noexcept + uint8_t MidiMessage32::FillBuffer(uint32_t const byteOffset, foundation::IMemoryBuffer const& buffer) const noexcept { const uint8_t numWordsInPacket = 2; const uint8_t numBytesInPacket = numWordsInPacket * sizeof(uint32_t); diff --git a/src/api/Client/Midi2Client/MidiMessage32.h b/src/api/Client/Midi2Client/MidiMessage32.h index 93c67e39..d8a4b72d 100644 --- a/src/api/Client/Midi2Client/MidiMessage32.h +++ b/src/api/Client/Midi2Client/MidiMessage32.h @@ -47,11 +47,11 @@ namespace winrt::Windows::Devices::Midi2::implementation uint32_t PeekFirstWord() { return Word0(); } collections::IVector GetAllWords() const noexcept; - uint8_t AppendAllMessageWordsToVector( + uint8_t AppendAllMessageWordsToList( _Inout_ collections::IVector targetVector ) const noexcept; - uint8_t AddAllMessageBytesToBuffer( + uint8_t FillBuffer( _In_ uint32_t const byteOffset, _In_ foundation::IMemoryBuffer const& buffer ) const noexcept; diff --git a/src/api/Client/Midi2Client/MidiMessage64.cpp b/src/api/Client/Midi2Client/MidiMessage64.cpp index ae3dab54..5fa35453 100644 --- a/src/api/Client/Midi2Client/MidiMessage64.cpp +++ b/src/api/Client/Midi2Client/MidiMessage64.cpp @@ -24,7 +24,7 @@ namespace winrt::Windows::Devices::Midi2::implementation } _Use_decl_annotations_ - uint8_t MidiMessage64::AppendAllMessageWordsToVector(collections::IVector targetVector) const noexcept + uint8_t MidiMessage64::AppendAllMessageWordsToList(collections::IVector targetVector) const noexcept { targetVector.Append(m_ump.word0); targetVector.Append(m_ump.word1); @@ -33,7 +33,7 @@ namespace winrt::Windows::Devices::Midi2::implementation } _Use_decl_annotations_ - uint8_t MidiMessage64::AddAllMessageBytesToBuffer(uint32_t const byteOffset, foundation::IMemoryBuffer const& buffer) const noexcept + uint8_t MidiMessage64::FillBuffer(uint32_t const byteOffset, foundation::IMemoryBuffer const& buffer) const noexcept { const uint8_t numWordsInPacket = 2; const uint8_t numBytesInPacket = numWordsInPacket * sizeof(uint32_t); diff --git a/src/api/Client/Midi2Client/MidiMessage64.h b/src/api/Client/Midi2Client/MidiMessage64.h index 0181cef8..2dd9ffc4 100644 --- a/src/api/Client/Midi2Client/MidiMessage64.h +++ b/src/api/Client/Midi2Client/MidiMessage64.h @@ -59,10 +59,10 @@ namespace winrt::Windows::Devices::Midi2::implementation winrt::hstring ToString(); collections::IVector GetAllWords() const noexcept; - uint8_t AppendAllMessageWordsToVector( + uint8_t AppendAllMessageWordsToList( _Inout_ collections::IVector targetVector) const noexcept; - uint8_t AddAllMessageBytesToBuffer( + uint8_t FillBuffer( _In_ uint32_t const byteOffset, _In_ foundation::IMemoryBuffer const& buffer ) const noexcept; diff --git a/src/api/Client/Midi2Client/MidiMessage96.cpp b/src/api/Client/Midi2Client/MidiMessage96.cpp index 8d0cdfd3..ef266cdf 100644 --- a/src/api/Client/Midi2Client/MidiMessage96.cpp +++ b/src/api/Client/Midi2Client/MidiMessage96.cpp @@ -24,7 +24,7 @@ namespace winrt::Windows::Devices::Midi2::implementation } _Use_decl_annotations_ - uint8_t MidiMessage96::AppendAllMessageWordsToVector(collections::IVector targetVector) const noexcept + uint8_t MidiMessage96::AppendAllMessageWordsToList(collections::IVector targetVector) const noexcept { targetVector.Append(m_ump.word0); targetVector.Append(m_ump.word1); @@ -35,7 +35,7 @@ namespace winrt::Windows::Devices::Midi2::implementation _Use_decl_annotations_ - uint8_t MidiMessage96::AddAllMessageBytesToBuffer(uint32_t const byteOffset, foundation::IMemoryBuffer const& buffer) const noexcept + uint8_t MidiMessage96::FillBuffer(uint32_t const byteOffset, foundation::IMemoryBuffer const& buffer) const noexcept { const uint8_t numWordsInPacket = 3; const uint8_t numBytesInPacket = numWordsInPacket * sizeof(uint32_t); diff --git a/src/api/Client/Midi2Client/MidiMessage96.h b/src/api/Client/Midi2Client/MidiMessage96.h index 356356f4..9a8b276d 100644 --- a/src/api/Client/Midi2Client/MidiMessage96.h +++ b/src/api/Client/Midi2Client/MidiMessage96.h @@ -61,10 +61,10 @@ namespace winrt::Windows::Devices::Midi2::implementation { return midi2::MidiPacketType::UniversalMidiPacket96; } collections::IVector GetAllWords() const noexcept; - uint8_t AppendAllMessageWordsToVector( + uint8_t AppendAllMessageWordsToList( _Inout_ collections::IVector targetVector) const noexcept; - uint8_t AddAllMessageBytesToBuffer( + uint8_t FillBuffer( _In_ uint32_t const byteOffset, _In_ foundation::IMemoryBuffer const& buffer ) const noexcept; diff --git a/src/api/Client/Midi2Client/MidiMessageReceivedEventArgs.cpp b/src/api/Client/Midi2Client/MidiMessageReceivedEventArgs.cpp index e0c78a02..dd895735 100644 --- a/src/api/Client/Midi2Client/MidiMessageReceivedEventArgs.cpp +++ b/src/api/Client/Midi2Client/MidiMessageReceivedEventArgs.cpp @@ -276,6 +276,26 @@ namespace winrt::Windows::Devices::Midi2::implementation return messageWordCount; } + _Use_decl_annotations_ + uint8_t MidiMessageReceivedEventArgs::AppendWordsToList( + collections::IVector wordList + ) + { + uint8_t messageWordCount = GetValidMessageWordCount(); + + // copy over the words + + uint32_t* umpData = (uint32_t*)&m_data; + + for (int i = 0; i < messageWordCount; i++) + { + wordList.Append(umpData[i]); + } + + return messageWordCount; + } + + _Use_decl_annotations_ uint8_t MidiMessageReceivedEventArgs::FillByteArray( uint32_t const startIndex, diff --git a/src/api/Client/Midi2Client/MidiMessageReceivedEventArgs.h b/src/api/Client/Midi2Client/MidiMessageReceivedEventArgs.h index b06f3042..51a89cdd 100644 --- a/src/api/Client/Midi2Client/MidiMessageReceivedEventArgs.h +++ b/src/api/Client/Midi2Client/MidiMessageReceivedEventArgs.h @@ -75,6 +75,10 @@ namespace winrt::Windows::Devices::Midi2::implementation _In_ foundation::IMemoryBuffer const& buffer ); + uint8_t AppendWordsToList( + _In_ collections::IVector wordList + ); + private: uint8_t GetValidMessageWordCount() { return internal::GetUmpLengthInMidiWordsFromFirstWord(m_data.Word0); } diff --git a/src/api/Client/Midi2Client/MidiMessageReceivedEventArgs.idl b/src/api/Client/Midi2Client/MidiMessageReceivedEventArgs.idl index d26a6a95..d8eb6568 100644 --- a/src/api/Client/Midi2Client/MidiMessageReceivedEventArgs.idl +++ b/src/api/Client/Midi2Client/MidiMessageReceivedEventArgs.idl @@ -68,5 +68,8 @@ namespace Windows.Devices.Midi2 // Fill a spot in an existing IMemoryBuffer controlled by the caller. Returns the number of BYTES written UInt8 FillBuffer(UInt32 byteOffset, Windows.Foundation.IMemoryBuffer buffer); + // Adds the message words to the end of the provided list, and returns the number of words added. + UInt8 AppendWordsToList(IVector wordList); + } } \ No newline at end of file diff --git a/src/api/Client/Midi2Client/MidiMessageUtility.cpp b/src/api/Client/Midi2Client/MidiMessageUtility.cpp index 40eaa24d..a748fabe 100644 --- a/src/api/Client/Midi2Client/MidiMessageUtility.cpp +++ b/src/api/Client/Midi2Client/MidiMessageUtility.cpp @@ -97,7 +97,7 @@ namespace winrt::Windows::Devices::Midi2::implementation for (auto const& message : messages) { - message.AppendAllMessageWordsToVector(result); + message.AppendAllMessageWordsToList(result); } return result;