summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/am/am.cpp
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2019-03-18 02:09:25 +0100
committerLioncash <mathew1800@gmail.com>2019-03-18 14:18:34 +0100
commitc07ebeac19921d376979b420f5287f7016fa558c (patch)
treed4b185ba5ad1fbc2e9cf8774106e99a839b0ccf4 /src/core/hle/service/am/am.cpp
parentservice/am: Unstub SetExpectedMasterVolume() (diff)
downloadyuzu-c07ebeac19921d376979b420f5287f7016fa558c.tar
yuzu-c07ebeac19921d376979b420f5287f7016fa558c.tar.gz
yuzu-c07ebeac19921d376979b420f5287f7016fa558c.tar.bz2
yuzu-c07ebeac19921d376979b420f5287f7016fa558c.tar.lz
yuzu-c07ebeac19921d376979b420f5287f7016fa558c.tar.xz
yuzu-c07ebeac19921d376979b420f5287f7016fa558c.tar.zst
yuzu-c07ebeac19921d376979b420f5287f7016fa558c.zip
Diffstat (limited to 'src/core/hle/service/am/am.cpp')
-rw-r--r--src/core/hle/service/am/am.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/core/hle/service/am/am.cpp b/src/core/hle/service/am/am.cpp
index 4f1541e9d..4ef449ccb 100644
--- a/src/core/hle/service/am/am.cpp
+++ b/src/core/hle/service/am/am.cpp
@@ -99,7 +99,7 @@ IAudioController::IAudioController() : ServiceFramework("IAudioController") {
{1, &IAudioController::GetMainAppletExpectedMasterVolume, "GetMainAppletExpectedMasterVolume"},
{2, &IAudioController::GetLibraryAppletExpectedMasterVolume, "GetLibraryAppletExpectedMasterVolume"},
{3, nullptr, "ChangeMainAppletMasterVolume"},
- {4, nullptr, "SetTransparentVolumeRate"},
+ {4, &IAudioController::SetTransparentAudioRate, "SetTransparentVolumeRate"},
};
// clang-format on
@@ -139,6 +139,20 @@ void IAudioController::GetLibraryAppletExpectedMasterVolume(Kernel::HLERequestCo
rb.Push(library_applet_volume);
}
+void IAudioController::SetTransparentAudioRate(Kernel::HLERequestContext& ctx) {
+ IPC::RequestParser rp{ctx};
+ const float transparent_volume_rate_tmp = rp.Pop<float>();
+
+ LOG_DEBUG(Service_AM, "called. transparent_volume_rate={}", transparent_volume_rate_tmp);
+
+ // Clamp volume range to 0-100%.
+ transparent_volume_rate =
+ std::clamp(transparent_volume_rate_tmp, min_allowed_volume, max_allowed_volume);
+
+ IPC::ResponseBuilder rb{ctx, 2};
+ rb.Push(RESULT_SUCCESS);
+}
+
IDisplayController::IDisplayController() : ServiceFramework("IDisplayController") {
// clang-format off
static const FunctionInfo functions[] = {