diff options
author | Zach Hilman <DarkLordZach@users.noreply.github.com> | 2019-06-19 16:29:42 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-06-19 16:29:42 +0200 |
commit | 5c665fcc5b3086d8b7d6d84ccdec5356ec58f5fb (patch) | |
tree | 59fbc197a941e8a363cef85a3f75b2293c3c3bff /src/core/hle/service/audio | |
parent | Merge pull request #2562 from ReinUsesLisp/split-cbuf-upload (diff) | |
parent | Addressed issues (diff) | |
download | yuzu-5c665fcc5b3086d8b7d6d84ccdec5356ec58f5fb.tar yuzu-5c665fcc5b3086d8b7d6d84ccdec5356ec58f5fb.tar.gz yuzu-5c665fcc5b3086d8b7d6d84ccdec5356ec58f5fb.tar.bz2 yuzu-5c665fcc5b3086d8b7d6d84ccdec5356ec58f5fb.tar.lz yuzu-5c665fcc5b3086d8b7d6d84ccdec5356ec58f5fb.tar.xz yuzu-5c665fcc5b3086d8b7d6d84ccdec5356ec58f5fb.tar.zst yuzu-5c665fcc5b3086d8b7d6d84ccdec5356ec58f5fb.zip |
Diffstat (limited to '')
-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..7db6eb08d 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}; + const float volume = rp.Pop<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.Push(stream->GetVolume()); + } + AudioCore::AudioOut& audio_core; AudioCore::StreamPtr stream; std::string device_name; |