diff options
author | Zach Hilman <zachhilman@gmail.com> | 2018-11-27 15:18:29 +0100 |
---|---|---|
committer | Zach Hilman <zachhilman@gmail.com> | 2018-11-29 14:48:40 +0100 |
commit | a342bcc9b130e9bd78720e09e04c92dcac8840d0 (patch) | |
tree | df1d16c2a71b121fc449b53fc931c6fac8ccf82a /src/core/hle/service/audio/audren_u.cpp | |
parent | core: Port all current usages of Event to Readable/WritableEvent (diff) | |
download | yuzu-a342bcc9b130e9bd78720e09e04c92dcac8840d0.tar yuzu-a342bcc9b130e9bd78720e09e04c92dcac8840d0.tar.gz yuzu-a342bcc9b130e9bd78720e09e04c92dcac8840d0.tar.bz2 yuzu-a342bcc9b130e9bd78720e09e04c92dcac8840d0.tar.lz yuzu-a342bcc9b130e9bd78720e09e04c92dcac8840d0.tar.xz yuzu-a342bcc9b130e9bd78720e09e04c92dcac8840d0.tar.zst yuzu-a342bcc9b130e9bd78720e09e04c92dcac8840d0.zip |
Diffstat (limited to 'src/core/hle/service/audio/audren_u.cpp')
-rw-r--r-- | src/core/hle/service/audio/audren_u.cpp | 26 |
1 files changed, 11 insertions, 15 deletions
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 |