diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/hle/service/audio/audin_u.cpp | 11 | ||||
| -rw-r--r-- | src/core/hle/service/audio/audin_u.h | 3 |
2 files changed, 12 insertions, 2 deletions
diff --git a/src/core/hle/service/audio/audin_u.cpp b/src/core/hle/service/audio/audin_u.cpp index 30fedcc8d..570525019 100644 --- a/src/core/hle/service/audio/audin_u.cpp +++ b/src/core/hle/service/audio/audin_u.cpp | |||
| @@ -3,13 +3,16 @@ | |||
| 3 | // Refer to the license.txt file included. | 3 | // Refer to the license.txt file included. |
| 4 | 4 | ||
| 5 | #include "common/logging/log.h" | 5 | #include "common/logging/log.h" |
| 6 | #include "core/core.h" | ||
| 6 | #include "core/hle/ipc_helpers.h" | 7 | #include "core/hle/ipc_helpers.h" |
| 7 | #include "core/hle/kernel/hle_ipc.h" | 8 | #include "core/hle/kernel/hle_ipc.h" |
| 9 | #include "core/hle/kernel/k_event.h" | ||
| 8 | #include "core/hle/service/audio/audin_u.h" | 10 | #include "core/hle/service/audio/audin_u.h" |
| 9 | 11 | ||
| 10 | namespace Service::Audio { | 12 | namespace Service::Audio { |
| 11 | 13 | ||
| 12 | IAudioIn::IAudioIn(Core::System& system_) : ServiceFramework{system_, "IAudioIn"} { | 14 | IAudioIn::IAudioIn(Core::System& system_) |
| 15 | : ServiceFramework{system_, "IAudioIn"}, buffer_event{system_.Kernel()} { | ||
| 13 | // clang-format off | 16 | // clang-format off |
| 14 | static const FunctionInfo functions[] = { | 17 | static const FunctionInfo functions[] = { |
| 15 | {0, nullptr, "GetAudioInState"}, | 18 | {0, nullptr, "GetAudioInState"}, |
| @@ -31,6 +34,9 @@ IAudioIn::IAudioIn(Core::System& system_) : ServiceFramework{system_, "IAudioIn" | |||
| 31 | // clang-format on | 34 | // clang-format on |
| 32 | 35 | ||
| 33 | RegisterHandlers(functions); | 36 | RegisterHandlers(functions); |
| 37 | |||
| 38 | Kernel::KAutoObject::Create(std::addressof(buffer_event)); | ||
| 39 | buffer_event.Initialize("IAudioIn:BufferEvent"); | ||
| 34 | } | 40 | } |
| 35 | 41 | ||
| 36 | IAudioIn::~IAudioIn() = default; | 42 | IAudioIn::~IAudioIn() = default; |
| @@ -45,8 +51,9 @@ void IAudioIn::Start(Kernel::HLERequestContext& ctx) { | |||
| 45 | void IAudioIn::RegisterBufferEvent(Kernel::HLERequestContext& ctx) { | 51 | void IAudioIn::RegisterBufferEvent(Kernel::HLERequestContext& ctx) { |
| 46 | LOG_WARNING(Service_Audio, "(STUBBED) called"); | 52 | LOG_WARNING(Service_Audio, "(STUBBED) called"); |
| 47 | 53 | ||
| 48 | IPC::ResponseBuilder rb{ctx, 2}; | 54 | IPC::ResponseBuilder rb{ctx, 2, 1}; |
| 49 | rb.Push(ResultSuccess); | 55 | rb.Push(ResultSuccess); |
| 56 | rb.PushCopyObjects(buffer_event.GetReadableEvent()); | ||
| 50 | } | 57 | } |
| 51 | 58 | ||
| 52 | void IAudioIn::AppendAudioInBufferAuto(Kernel::HLERequestContext& ctx) { | 59 | void IAudioIn::AppendAudioInBufferAuto(Kernel::HLERequestContext& ctx) { |
diff --git a/src/core/hle/service/audio/audin_u.h b/src/core/hle/service/audio/audin_u.h index bde8fe7b7..f2f7f9932 100644 --- a/src/core/hle/service/audio/audin_u.h +++ b/src/core/hle/service/audio/audin_u.h | |||
| @@ -4,6 +4,7 @@ | |||
| 4 | 4 | ||
| 5 | #pragma once | 5 | #pragma once |
| 6 | 6 | ||
| 7 | #include "core/hle/kernel/k_event.h" | ||
| 7 | #include "core/hle/service/service.h" | 8 | #include "core/hle/service/service.h" |
| 8 | 9 | ||
| 9 | namespace Core { | 10 | namespace Core { |
| @@ -25,6 +26,8 @@ private: | |||
| 25 | void Start(Kernel::HLERequestContext& ctx); | 26 | void Start(Kernel::HLERequestContext& ctx); |
| 26 | void RegisterBufferEvent(Kernel::HLERequestContext& ctx); | 27 | void RegisterBufferEvent(Kernel::HLERequestContext& ctx); |
| 27 | void AppendAudioInBufferAuto(Kernel::HLERequestContext& ctx); | 28 | void AppendAudioInBufferAuto(Kernel::HLERequestContext& ctx); |
| 29 | |||
| 30 | Kernel::KEvent buffer_event; | ||
| 28 | }; | 31 | }; |
| 29 | 32 | ||
| 30 | class AudInU final : public ServiceFramework<AudInU> { | 33 | class AudInU final : public ServiceFramework<AudInU> { |