From 8d2f0dc7073c6888184c1e1de83e107f018bed09 Mon Sep 17 00:00:00 2001 From: german77 Date: Sat, 5 Aug 2023 20:14:42 -0600 Subject: service: audctl: Stub functions needed by Qlaunch --- src/core/hle/service/audio/audctl.cpp | 46 ++++++++++++++++++++++++++++++++--- 1 file changed, 42 insertions(+), 4 deletions(-) (limited to 'src/core/hle/service/audio/audctl.cpp') diff --git a/src/core/hle/service/audio/audctl.cpp b/src/core/hle/service/audio/audctl.cpp index 7ad93be6b..66dd64fd1 100644 --- a/src/core/hle/service/audio/audctl.cpp +++ b/src/core/hle/service/audio/audctl.cpp @@ -22,13 +22,13 @@ AudCtl::AudCtl(Core::System& system_) : ServiceFramework{system_, "audctl"} { {9, nullptr, "GetAudioOutputMode"}, {10, nullptr, "SetAudioOutputMode"}, {11, nullptr, "SetForceMutePolicy"}, - {12, nullptr, "GetForceMutePolicy"}, - {13, nullptr, "GetOutputModeSetting"}, + {12, &AudCtl::GetForceMutePolicy, "GetForceMutePolicy"}, + {13, &AudCtl::GetOutputModeSetting, "GetOutputModeSetting"}, {14, nullptr, "SetOutputModeSetting"}, {15, nullptr, "SetOutputTarget"}, {16, nullptr, "SetInputTargetForceEnabled"}, {17, nullptr, "SetHeadphoneOutputLevelMode"}, - {18, nullptr, "GetHeadphoneOutputLevelMode"}, + {18, &AudCtl::GetHeadphoneOutputLevelMode, "GetHeadphoneOutputLevelMode"}, {19, nullptr, "AcquireAudioVolumeUpdateEventForPlayReport"}, {20, nullptr, "AcquireAudioOutputDeviceUpdateEventForPlayReport"}, {21, nullptr, "GetAudioOutputTargetForPlayReport"}, @@ -41,7 +41,7 @@ AudCtl::AudCtl(Core::System& system_) : ServiceFramework{system_, "audctl"} { {28, nullptr, "GetAudioOutputChannelCountForPlayReport"}, {29, nullptr, "BindAudioOutputChannelCountUpdateEventForPlayReport"}, {30, nullptr, "SetSpeakerAutoMuteEnabled"}, - {31, nullptr, "IsSpeakerAutoMuteEnabled"}, + {31, &AudCtl::IsSpeakerAutoMuteEnabled, "IsSpeakerAutoMuteEnabled"}, {32, nullptr, "GetActiveOutputTarget"}, {33, nullptr, "GetTargetDeviceInfo"}, {34, nullptr, "AcquireTargetNotification"}, @@ -96,4 +96,42 @@ void AudCtl::GetTargetVolumeMax(HLERequestContext& ctx) { rb.Push(target_max_volume); } +void AudCtl::GetForceMutePolicy(HLERequestContext& ctx) { + LOG_WARNING(Audio, "(STUBBED) called"); + + IPC::ResponseBuilder rb{ctx, 3}; + rb.Push(ResultSuccess); + rb.PushEnum(ForceMutePolicy::Disable); +} + +void AudCtl::GetOutputModeSetting(HLERequestContext& ctx) { + IPC::RequestParser rp{ctx}; + const auto value = rp.Pop(); + + LOG_WARNING(Audio, "(STUBBED) called, value={}", value); + + IPC::ResponseBuilder rb{ctx, 3}; + rb.Push(ResultSuccess); + rb.PushEnum(AudioOutputMode::PcmAuto); +} + +void AudCtl::GetHeadphoneOutputLevelMode(HLERequestContext& ctx) { + LOG_WARNING(Audio, "(STUBBED) called"); + + IPC::ResponseBuilder rb{ctx, 3}; + rb.Push(ResultSuccess); + rb.PushEnum(HeadphoneOutputLevelMode::Normal); +} + +void AudCtl::IsSpeakerAutoMuteEnabled(HLERequestContext& ctx) { + const bool is_speaker_auto_mute_enabled = false; + + LOG_WARNING(Audio, "(STUBBED) called, is_speaker_auto_mute_enabled={}", + is_speaker_auto_mute_enabled); + + IPC::ResponseBuilder rb{ctx, 3}; + rb.Push(ResultSuccess); + rb.Push(is_speaker_auto_mute_enabled); +} + } // namespace Service::Audio -- cgit v1.2.3