Merge pull request #7018 from lat9nq/splat-stubs
audin_u: stub Start, RegisterBufferEvent, AppendAudioInBufferAuto
This commit is contained in:
		| @@ -3,26 +3,27 @@ | |||||||
| // Refer to the license.txt file included. | // Refer to the license.txt file included. | ||||||
|  |  | ||||||
| #include "common/logging/log.h" | #include "common/logging/log.h" | ||||||
|  | #include "core/core.h" | ||||||
| #include "core/hle/ipc_helpers.h" | #include "core/hle/ipc_helpers.h" | ||||||
| #include "core/hle/kernel/hle_ipc.h" | #include "core/hle/kernel/hle_ipc.h" | ||||||
|  | #include "core/hle/kernel/k_event.h" | ||||||
| #include "core/hle/service/audio/audin_u.h" | #include "core/hle/service/audio/audin_u.h" | ||||||
|  |  | ||||||
| namespace Service::Audio { | namespace Service::Audio { | ||||||
|  |  | ||||||
| class IAudioIn final : public ServiceFramework<IAudioIn> { | IAudioIn::IAudioIn(Core::System& system_) | ||||||
| public: |     : ServiceFramework{system_, "IAudioIn"}, buffer_event{system_.Kernel()} { | ||||||
|     explicit IAudioIn(Core::System& system_) : ServiceFramework{system_, "IAudioIn"} { |  | ||||||
|     // clang-format off |     // clang-format off | ||||||
|     static const FunctionInfo functions[] = { |     static const FunctionInfo functions[] = { | ||||||
|         {0, nullptr, "GetAudioInState"}, |         {0, nullptr, "GetAudioInState"}, | ||||||
|             {1, nullptr, "Start"}, |         {1, &IAudioIn::Start, "Start"}, | ||||||
|         {2, nullptr, "Stop"}, |         {2, nullptr, "Stop"}, | ||||||
|         {3, nullptr, "AppendAudioInBuffer"}, |         {3, nullptr, "AppendAudioInBuffer"}, | ||||||
|             {4, nullptr, "RegisterBufferEvent"}, |         {4, &IAudioIn::RegisterBufferEvent, "RegisterBufferEvent"}, | ||||||
|         {5, nullptr, "GetReleasedAudioInBuffer"}, |         {5, nullptr, "GetReleasedAudioInBuffer"}, | ||||||
|         {6, nullptr, "ContainsAudioInBuffer"}, |         {6, nullptr, "ContainsAudioInBuffer"}, | ||||||
|         {7, nullptr, "AppendUacInBuffer"}, |         {7, nullptr, "AppendUacInBuffer"}, | ||||||
|             {8, nullptr, "AppendAudioInBufferAuto"}, |         {8, &IAudioIn::AppendAudioInBufferAuto, "AppendAudioInBufferAuto"}, | ||||||
|         {9, nullptr, "GetReleasedAudioInBuffersAuto"}, |         {9, nullptr, "GetReleasedAudioInBuffersAuto"}, | ||||||
|         {10, nullptr, "AppendUacInBufferAuto"}, |         {10, nullptr, "AppendUacInBufferAuto"}, | ||||||
|         {11, nullptr, "GetAudioInBufferCount"}, |         {11, nullptr, "GetAudioInBufferCount"}, | ||||||
| @@ -33,8 +34,34 @@ public: | |||||||
|     // clang-format on |     // clang-format on | ||||||
|  |  | ||||||
|     RegisterHandlers(functions); |     RegisterHandlers(functions); | ||||||
|  |  | ||||||
|  |     Kernel::KAutoObject::Create(std::addressof(buffer_event)); | ||||||
|  |     buffer_event.Initialize("IAudioIn:BufferEvent"); | ||||||
|  | } | ||||||
|  |  | ||||||
|  | IAudioIn::~IAudioIn() = default; | ||||||
|  |  | ||||||
|  | void IAudioIn::Start(Kernel::HLERequestContext& ctx) { | ||||||
|  |     LOG_WARNING(Service_Audio, "(STUBBED) called"); | ||||||
|  |  | ||||||
|  |     IPC::ResponseBuilder rb{ctx, 2}; | ||||||
|  |     rb.Push(ResultSuccess); | ||||||
|  | } | ||||||
|  |  | ||||||
|  | void IAudioIn::RegisterBufferEvent(Kernel::HLERequestContext& ctx) { | ||||||
|  |     LOG_WARNING(Service_Audio, "(STUBBED) called"); | ||||||
|  |  | ||||||
|  |     IPC::ResponseBuilder rb{ctx, 2, 1}; | ||||||
|  |     rb.Push(ResultSuccess); | ||||||
|  |     rb.PushCopyObjects(buffer_event.GetReadableEvent()); | ||||||
|  | } | ||||||
|  |  | ||||||
|  | void IAudioIn::AppendAudioInBufferAuto(Kernel::HLERequestContext& ctx) { | ||||||
|  |     LOG_WARNING(Service_Audio, "(STUBBED) called"); | ||||||
|  |  | ||||||
|  |     IPC::ResponseBuilder rb{ctx, 2}; | ||||||
|  |     rb.Push(ResultSuccess); | ||||||
| } | } | ||||||
| }; |  | ||||||
|  |  | ||||||
| AudInU::AudInU(Core::System& system_) : ServiceFramework{system_, "audin:u"} { | AudInU::AudInU(Core::System& system_) : ServiceFramework{system_, "audin:u"} { | ||||||
|     // clang-format off |     // clang-format off | ||||||
|   | |||||||
| @@ -4,6 +4,7 @@ | |||||||
|  |  | ||||||
| #pragma once | #pragma once | ||||||
|  |  | ||||||
|  | #include "core/hle/kernel/k_event.h" | ||||||
| #include "core/hle/service/service.h" | #include "core/hle/service/service.h" | ||||||
|  |  | ||||||
| namespace Core { | namespace Core { | ||||||
| @@ -16,6 +17,19 @@ class HLERequestContext; | |||||||
|  |  | ||||||
| namespace Service::Audio { | namespace Service::Audio { | ||||||
|  |  | ||||||
|  | class IAudioIn final : public ServiceFramework<IAudioIn> { | ||||||
|  | public: | ||||||
|  |     explicit IAudioIn(Core::System& system_); | ||||||
|  |     ~IAudioIn() override; | ||||||
|  |  | ||||||
|  | private: | ||||||
|  |     void Start(Kernel::HLERequestContext& ctx); | ||||||
|  |     void RegisterBufferEvent(Kernel::HLERequestContext& ctx); | ||||||
|  |     void AppendAudioInBufferAuto(Kernel::HLERequestContext& ctx); | ||||||
|  |  | ||||||
|  |     Kernel::KEvent buffer_event; | ||||||
|  | }; | ||||||
|  |  | ||||||
| class AudInU final : public ServiceFramework<AudInU> { | class AudInU final : public ServiceFramework<AudInU> { | ||||||
| public: | public: | ||||||
|     explicit AudInU(Core::System& system_); |     explicit AudInU(Core::System& system_); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user