diff options
Diffstat (limited to 'src/core/hle/service/audio')
-rw-r--r-- | src/core/hle/service/audio/audout_u.cpp | 15 | ||||
-rw-r--r-- | src/core/hle/service/audio/audren_u.cpp | 26 |
2 files changed, 18 insertions, 23 deletions
diff --git a/src/core/hle/service/audio/audout_u.cpp b/src/core/hle/service/audio/audout_u.cpp index b5012e579..22e5c85ab 100644 --- a/src/core/hle/service/audio/audout_u.cpp +++ b/src/core/hle/service/audio/audout_u.cpp @@ -69,11 +69,12 @@ public: // This is the event handle used to check if the audio buffer was released auto& kernel = Core::System::GetInstance().Kernel(); - buffer_event = Kernel::WritableEvent::CreateRegisteredEventPair( - kernel, Kernel::ResetType::Sticky, "IAudioOutBufferReleased"); + buffer_event = Kernel::WritableEvent::CreateEventPair(kernel, Kernel::ResetType::Sticky, + "IAudioOutBufferReleased"); stream = audio_core.OpenStream(audio_params.sample_rate, audio_params.channel_count, - std::move(unique_name), [=]() { buffer_event->Signal(); }); + std::move(unique_name), + [=]() { buffer_event.writable->Signal(); }); } private: @@ -123,9 +124,7 @@ private: IPC::ResponseBuilder rb{ctx, 2, 1}; rb.Push(RESULT_SUCCESS); - const auto& event{ - Core::System::GetInstance().Kernel().FindNamedEvent("IAudioOutBufferReleased")}; - rb.PushCopyObjects(event->second); + rb.PushCopyObjects(buffer_event.readable); } void AppendAudioOutBufferImpl(Kernel::HLERequestContext& ctx) { @@ -191,8 +190,8 @@ private: AudoutParams audio_params{}; - /// This is the evend handle used to check if the audio buffer was released - Kernel::SharedPtr<Kernel::WritableEvent> buffer_event; + /// This is the event handle used to check if the audio buffer was released + Kernel::EventPair buffer_event; }; void AudOutU::ListAudioOutsImpl(Kernel::HLERequestContext& ctx) { diff --git a/src/core/hle/service/audio/audren_u.cpp b/src/core/hle/service/audio/audren_u.cpp index 9b7f7b201..945259c7d 100644 --- a/src/core/hle/service/audio/audren_u.cpp +++ b/src/core/hle/service/audio/audren_u.cpp @@ -43,14 +43,14 @@ public: RegisterHandlers(functions); auto& kernel = Core::System::GetInstance().Kernel(); - system_event = Kernel::WritableEvent::CreateRegisteredEventPair( - kernel, Kernel::ResetType::Sticky, "IAudioRenderer:SystemEvent"); - renderer = std::make_unique<AudioCore::AudioRenderer>(audren_params, system_event); + system_event = Kernel::WritableEvent::CreateEventPair(kernel, Kernel::ResetType::Sticky, + "IAudioRenderer:SystemEvent"); + renderer = std::make_unique<AudioCore::AudioRenderer>(audren_params, system_event.writable); } private: void UpdateAudioCallback() { - system_event->Signal(); + system_event.writable->Signal(); } void GetSampleRate(Kernel::HLERequestContext& ctx) { @@ -114,9 +114,7 @@ private: IPC::ResponseBuilder rb{ctx, 2, 1}; rb.Push(RESULT_SUCCESS); - const auto& event{ - Core::System::GetInstance().Kernel().FindNamedEvent("IAudioRenderer:SystemEvent")}; - rb.PushCopyObjects(event->second); + rb.PushCopyObjects(system_event.readable); } void SetRenderingTimeLimit(Kernel::HLERequestContext& ctx) { @@ -139,7 +137,7 @@ private: rb.Push(rendering_time_limit_percent); } - Kernel::SharedPtr<Kernel::WritableEvent> system_event; + Kernel::EventPair system_event; std::unique_ptr<AudioCore::AudioRenderer> renderer; u32 rendering_time_limit_percent = 100; }; @@ -166,8 +164,8 @@ public: RegisterHandlers(functions); auto& kernel = Core::System::GetInstance().Kernel(); - buffer_event = Kernel::WritableEvent::CreateRegisteredEventPair( - kernel, Kernel::ResetType::OneShot, "IAudioOutBufferReleasedEvent"); + buffer_event = Kernel::WritableEvent::CreateEventPair(kernel, Kernel::ResetType::OneShot, + "IAudioOutBufferReleasedEvent"); } private: @@ -211,13 +209,11 @@ private: void QueryAudioDeviceSystemEvent(Kernel::HLERequestContext& ctx) { LOG_WARNING(Service_Audio, "(STUBBED) called"); - buffer_event->Signal(); + buffer_event.writable->Signal(); IPC::ResponseBuilder rb{ctx, 2, 1}; rb.Push(RESULT_SUCCESS); - const auto& event{ - Core::System::GetInstance().Kernel().FindNamedEvent("IAudioOutBufferReleasedEvent")}; - rb.PushCopyObjects(event->second); + rb.PushCopyObjects(buffer_event.readable); } void GetActiveChannelCount(Kernel::HLERequestContext& ctx) { @@ -228,7 +224,7 @@ private: rb.Push<u32>(1); } - Kernel::SharedPtr<Kernel::WritableEvent> buffer_event; + Kernel::EventPair buffer_event; }; // namespace Audio |