mirror of
https://github.com/yuzu-mirror/yuzu
synced 2024-11-27 15:12:22 +00:00
Merge pull request #11224 from german77/audio
service: audctl: Stub functions needed by Qlaunch
This commit is contained in:
commit
bed2fc8707
2 changed files with 64 additions and 4 deletions
|
@ -22,13 +22,13 @@ AudCtl::AudCtl(Core::System& system_) : ServiceFramework{system_, "audctl"} {
|
||||||
{9, nullptr, "GetAudioOutputMode"},
|
{9, nullptr, "GetAudioOutputMode"},
|
||||||
{10, nullptr, "SetAudioOutputMode"},
|
{10, nullptr, "SetAudioOutputMode"},
|
||||||
{11, nullptr, "SetForceMutePolicy"},
|
{11, nullptr, "SetForceMutePolicy"},
|
||||||
{12, nullptr, "GetForceMutePolicy"},
|
{12, &AudCtl::GetForceMutePolicy, "GetForceMutePolicy"},
|
||||||
{13, nullptr, "GetOutputModeSetting"},
|
{13, &AudCtl::GetOutputModeSetting, "GetOutputModeSetting"},
|
||||||
{14, nullptr, "SetOutputModeSetting"},
|
{14, nullptr, "SetOutputModeSetting"},
|
||||||
{15, nullptr, "SetOutputTarget"},
|
{15, nullptr, "SetOutputTarget"},
|
||||||
{16, nullptr, "SetInputTargetForceEnabled"},
|
{16, nullptr, "SetInputTargetForceEnabled"},
|
||||||
{17, nullptr, "SetHeadphoneOutputLevelMode"},
|
{17, nullptr, "SetHeadphoneOutputLevelMode"},
|
||||||
{18, nullptr, "GetHeadphoneOutputLevelMode"},
|
{18, &AudCtl::GetHeadphoneOutputLevelMode, "GetHeadphoneOutputLevelMode"},
|
||||||
{19, nullptr, "AcquireAudioVolumeUpdateEventForPlayReport"},
|
{19, nullptr, "AcquireAudioVolumeUpdateEventForPlayReport"},
|
||||||
{20, nullptr, "AcquireAudioOutputDeviceUpdateEventForPlayReport"},
|
{20, nullptr, "AcquireAudioOutputDeviceUpdateEventForPlayReport"},
|
||||||
{21, nullptr, "GetAudioOutputTargetForPlayReport"},
|
{21, nullptr, "GetAudioOutputTargetForPlayReport"},
|
||||||
|
@ -41,7 +41,7 @@ AudCtl::AudCtl(Core::System& system_) : ServiceFramework{system_, "audctl"} {
|
||||||
{28, nullptr, "GetAudioOutputChannelCountForPlayReport"},
|
{28, nullptr, "GetAudioOutputChannelCountForPlayReport"},
|
||||||
{29, nullptr, "BindAudioOutputChannelCountUpdateEventForPlayReport"},
|
{29, nullptr, "BindAudioOutputChannelCountUpdateEventForPlayReport"},
|
||||||
{30, nullptr, "SetSpeakerAutoMuteEnabled"},
|
{30, nullptr, "SetSpeakerAutoMuteEnabled"},
|
||||||
{31, nullptr, "IsSpeakerAutoMuteEnabled"},
|
{31, &AudCtl::IsSpeakerAutoMuteEnabled, "IsSpeakerAutoMuteEnabled"},
|
||||||
{32, nullptr, "GetActiveOutputTarget"},
|
{32, nullptr, "GetActiveOutputTarget"},
|
||||||
{33, nullptr, "GetTargetDeviceInfo"},
|
{33, nullptr, "GetTargetDeviceInfo"},
|
||||||
{34, nullptr, "AcquireTargetNotification"},
|
{34, nullptr, "AcquireTargetNotification"},
|
||||||
|
@ -96,4 +96,42 @@ void AudCtl::GetTargetVolumeMax(HLERequestContext& ctx) {
|
||||||
rb.Push(target_max_volume);
|
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<u32>();
|
||||||
|
|
||||||
|
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<u8>(is_speaker_auto_mute_enabled);
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace Service::Audio
|
} // namespace Service::Audio
|
||||||
|
|
|
@ -17,8 +17,30 @@ public:
|
||||||
~AudCtl() override;
|
~AudCtl() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
enum class AudioOutputMode {
|
||||||
|
Invalid,
|
||||||
|
Pcm1ch,
|
||||||
|
Pcm2ch,
|
||||||
|
Pcm6ch,
|
||||||
|
PcmAuto,
|
||||||
|
};
|
||||||
|
|
||||||
|
enum class ForceMutePolicy {
|
||||||
|
Disable,
|
||||||
|
SpeakerMuteOnHeadphoneUnplugged,
|
||||||
|
};
|
||||||
|
|
||||||
|
enum class HeadphoneOutputLevelMode {
|
||||||
|
Normal,
|
||||||
|
HighPower,
|
||||||
|
};
|
||||||
|
|
||||||
void GetTargetVolumeMin(HLERequestContext& ctx);
|
void GetTargetVolumeMin(HLERequestContext& ctx);
|
||||||
void GetTargetVolumeMax(HLERequestContext& ctx);
|
void GetTargetVolumeMax(HLERequestContext& ctx);
|
||||||
|
void GetForceMutePolicy(HLERequestContext& ctx);
|
||||||
|
void GetOutputModeSetting(HLERequestContext& ctx);
|
||||||
|
void GetHeadphoneOutputLevelMode(HLERequestContext& ctx);
|
||||||
|
void IsSpeakerAutoMuteEnabled(HLERequestContext& ctx);
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Service::Audio
|
} // namespace Service::Audio
|
||||||
|
|
Loading…
Reference in a new issue