Closed MusicMaker closed 2 months ago
Thanks.
I assume this is the api-watch-endpoints
sample you mentioned on Discord. If so, the event handler signatures changed per the release notes (they each take proper args
classes as parameters now), but I missed updating this sample for Preview 5.
auto OnWatcherStopped = [&](MidiEndpointDeviceWatcher const& /*sender*/, foundation::IInspectable const& /*args*/)
{
std::cout << std::endl;
std::cout << "Watcher stopped." << std::endl;
};
auto OnWatcherEnumerationCompleted = [&](MidiEndpointDeviceWatcher const& /*sender*/, foundation::IInspectable const& args)
{
std::cout << std::endl;
std::cout << "Initial enumeration completed." << std::endl;
};
auto OnWatcherDeviceRemoved = [&](MidiEndpointDeviceWatcher const& /*sender*/, MidiEndpointDeviceInformationRemovedEventArgs const& args)
{
std::cout << std::endl;
std::cout << "Removed: " << winrt::to_string(args.Id()) << std::endl;
};
auto OnWatcherDeviceUpdated = [&](MidiEndpointDeviceWatcher const& /*sender*/, MidiEndpointDeviceInformationUpdatedEventArgs const& args)
{
std::cout << std::endl;
std::cout << "Updated: " << winrt::to_string(args.Id()) << std::endl;
// Show how to use the various data update flags here
if (args.UpdatedName()) std::cout << "- Name" << std::endl;
if (args.UpdatedUserMetadata()) std::cout << "- User Metadata" << std::endl;
if (args.UpdatedEndpointInformation()) std::cout << "- Endpoint Information" << std::endl;
if (args.UpdatedStreamConfiguration()) std::cout << "- Stream Configuration" << std::endl;
if (args.UpdatedFunctionBlocks()) std::cout << "- Function Blocks" << std::endl;
if (args.UpdatedDeviceIdentity()) std::cout << "- Device Identity" << std::endl;
if (args.UpdatedAdditionalCapabilities()) std::cout << "- Additional Capabilities" << std::endl;
};
auto OnWatcherDeviceAdded = [&](MidiEndpointDeviceWatcher const& /*sender*/, MidiEndpointDeviceInformationAddedEventArgs const& args)
{
std::cout << std::endl;
std::cout << "Added : " << winrt::to_string(args.AddedDevice().Name()) << std::endl;
std::cout << " " << winrt::to_string(args.AddedDevice().Id()) << std::endl ;
};
Did you mean to have something in this part of the report?
Thanks for catching this one. Will be fixed in next PR to main.
Github hid the content. Fixed now.
Completed. Samples are updated in main. Everything will be synchronized with the next dev preview.
Issue Sample projects won't build when using Visual Studio 2022.
How to reproduce Install Visual Studio 2022 with SDK's Open nuget package manager Add the path where the nuget package is located Add the reference for MIDI2 to the project
Expected behavior Open the project.sln file in Visual studio Add the nuget package for MIDI 2.0 Preview 5 Build No Errors
**Cause*** Sample projects for git (now preview 5) visual studio project files show: `
`
Solution (Edited)