diff options
author | David Marcec <dmarcecguzman@gmail.com> | 2019-06-16 11:06:33 +0200 |
---|---|---|
committer | David Marcec <dmarcecguzman@gmail.com> | 2019-06-16 11:06:33 +0200 |
commit | 335127af6921ce298a6dd63682895768c6b06e86 (patch) | |
tree | 0a505fec2c232dec0945fc02159eecc9c3af087e /src/core/hle/service/audio/audout_u.cpp | |
parent | Merge pull request #2538 from ReinUsesLisp/ssy-pbk (diff) | |
download | yuzu-335127af6921ce298a6dd63682895768c6b06e86.tar yuzu-335127af6921ce298a6dd63682895768c6b06e86.tar.gz yuzu-335127af6921ce298a6dd63682895768c6b06e86.tar.bz2 yuzu-335127af6921ce298a6dd63682895768c6b06e86.tar.lz yuzu-335127af6921ce298a6dd63682895768c6b06e86.tar.xz yuzu-335127af6921ce298a6dd63682895768c6b06e86.tar.zst yuzu-335127af6921ce298a6dd63682895768c6b06e86.zip |
Diffstat (limited to 'src/core/hle/service/audio/audout_u.cpp')
-rw-r--r-- | src/core/hle/service/audio/audout_u.cpp | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/src/core/hle/service/audio/audout_u.cpp b/src/core/hle/service/audio/audout_u.cpp index 6ba41b20a..0004f2f47 100644 --- a/src/core/hle/service/audio/audout_u.cpp +++ b/src/core/hle/service/audio/audout_u.cpp @@ -58,8 +58,8 @@ public: {9, &IAudioOut::GetAudioOutBufferCount, "GetAudioOutBufferCount"}, {10, nullptr, "GetAudioOutPlayedSampleCount"}, {11, nullptr, "FlushAudioOutBuffers"}, - {12, nullptr, "SetAudioOutVolume"}, - {13, nullptr, "GetAudioOutVolume"}, + {12, &IAudioOut::SetAudioOutVolume, "SetAudioOutVolume"}, + {13, &IAudioOut::GetAudioOutVolume, "GetAudioOutVolume"}, }; // clang-format on RegisterHandlers(functions); @@ -183,6 +183,25 @@ private: rb.Push(static_cast<u32>(stream->GetQueueSize())); } + void SetAudioOutVolume(Kernel::HLERequestContext& ctx) { + IPC::RequestParser rp{ctx}; + float volume = rp.PopRaw<float>(); + LOG_DEBUG(Service_Audio, "called, volume={}", volume); + + stream->SetVolume(volume); + + IPC::ResponseBuilder rb{ctx, 2}; + rb.Push(RESULT_SUCCESS); + } + + void GetAudioOutVolume(Kernel::HLERequestContext& ctx) { + LOG_DEBUG(Service_Audio, "called"); + + IPC::ResponseBuilder rb{ctx, 3}; + rb.Push(RESULT_SUCCESS); + rb.PushRaw<float>(stream->GetVolume()); + } + AudioCore::AudioOut& audio_core; AudioCore::StreamPtr stream; std::string device_name; |