I would like to co_await the file completed event from the WinRT AudioGraph API.
co_await
AudioGraph
Is this possible? It seams like a far superior way to program than using state or recursion.
Yes. You co_await the resume_on_signal function.
resume_on_signal
co_await winrt::resume_on_signal(m_event_handle);
Here's the handle being created
HANDLE m_event_handle; m_event_handle = CreateEventA(nullptr, false, false, nullptr);
Then subscribe to the event with the following event handler
fileInputNode.FileCompleted([this](auto, auto) { winrt::check_bool(SetEvent(m_event_handle)); });
Yes. You
co_awaittheresume_on_signalfunction.Here's the handle being created
Then subscribe to the event with the following event handler