summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/audio
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/hle/service/audio')
-rw-r--r--src/core/hle/service/audio/audren_u.cpp51
-rw-r--r--src/core/hle/service/audio/audren_u.h4
2 files changed, 51 insertions, 4 deletions
diff --git a/src/core/hle/service/audio/audren_u.cpp b/src/core/hle/service/audio/audren_u.cpp
index 4bafdfac3..4c3a685e9 100644
--- a/src/core/hle/service/audio/audren_u.cpp
+++ b/src/core/hle/service/audio/audren_u.cpp
@@ -4,6 +4,7 @@
#include "common/logging/log.h"
#include "core/hle/ipc_helpers.h"
+#include "core/hle/kernel/event.h"
#include "core/hle/kernel/hle_ipc.h"
#include "core/hle/service/audio/audren_u.h"
@@ -18,27 +19,69 @@ public:
{0x1, nullptr, "GetAudioRendererSampleCount"},
{0x2, nullptr, "GetAudioRendererMixBufferCount"},
{0x3, nullptr, "GetAudioRendererState"},
- {0x4, nullptr, "RequestUpdateAudioRenderer"},
+ {0x4, &IAudioRenderer::RequestUpdateAudioRenderer, "RequestUpdateAudioRenderer"},
{0x5, nullptr, "StartAudioRenderer"},
{0x6, nullptr, "StopAudioRenderer"},
- {0x7, nullptr, "QuerySystemEvent"},
+ {0x7, &IAudioRenderer::QuerySystemEvent, "QuerySystemEvent"},
{0x8, nullptr, "SetAudioRendererRenderingTimeLimit"},
{0x9, nullptr, "GetAudioRendererRenderingTimeLimit"},
};
RegisterHandlers(functions);
+
+ system_event =
+ Kernel::Event::Create(Kernel::ResetType::OneShot, "IAudioRenderer:SystemEvent");
}
~IAudioRenderer() = default;
+
+private:
+ void RequestUpdateAudioRenderer(Kernel::HLERequestContext& ctx) {
+ IPC::ResponseBuilder rb{ctx, 2};
+
+ rb.Push(RESULT_SUCCESS);
+
+ LOG_WARNING(Service_Audio, "(STUBBED) called");
+ }
+
+ void QuerySystemEvent(Kernel::HLERequestContext& ctx) {
+ // system_event->Signal();
+
+ IPC::ResponseBuilder rb{ctx, 2, 1};
+ rb.Push(RESULT_SUCCESS);
+ rb.PushCopyObjects(system_event);
+
+ LOG_WARNING(Service_Audio, "(STUBBED) called");
+ }
+
+ Kernel::SharedPtr<Kernel::Event> system_event;
};
AudRenU::AudRenU() : ServiceFramework("audren:u") {
static const FunctionInfo functions[] = {
- {0x00000000, nullptr, "OpenAudioRenderer"},
- {0x00000001, nullptr, "GetAudioRendererWorkBufferSize"},
+ {0x00000000, &AudRenU::OpenAudioRenderer, "OpenAudioRenderer"},
+ {0x00000001, &AudRenU::GetAudioRendererWorkBufferSize, "GetAudioRendererWorkBufferSize"},
{0x00000002, nullptr, "GetAudioRenderersProcessMasterVolume"},
{0x00000003, nullptr, "SetAudioRenderersProcessMasterVolume"},
};
RegisterHandlers(functions);
}
+void AudRenU::OpenAudioRenderer(Kernel::HLERequestContext& ctx) {
+ IPC::ResponseBuilder rb{ctx, 2, 0, 1};
+
+ rb.Push(RESULT_SUCCESS);
+ rb.PushIpcInterface<Audio::IAudioRenderer>();
+
+ LOG_DEBUG(Service_Audio, "called");
+}
+
+void AudRenU::GetAudioRendererWorkBufferSize(Kernel::HLERequestContext& ctx) {
+ IPC::ResponseBuilder rb{ctx, 4};
+
+ rb.Push(RESULT_SUCCESS);
+ rb.Push<u64>(0x1000);
+
+ LOG_WARNING(Service_Audio, "called");
+}
+
} // namespace Audio
} // namespace Service
diff --git a/src/core/hle/service/audio/audren_u.h b/src/core/hle/service/audio/audren_u.h
index 1d9264c72..e97543742 100644
--- a/src/core/hle/service/audio/audren_u.h
+++ b/src/core/hle/service/audio/audren_u.h
@@ -17,6 +17,10 @@ class AudRenU final : public ServiceFramework<AudRenU> {
public:
explicit AudRenU();
~AudRenU() = default;
+
+private:
+ void OpenAudioRenderer(Kernel::HLERequestContext& ctx);
+ void GetAudioRendererWorkBufferSize(Kernel::HLERequestContext& ctx);
};
} // namespace Audio