diff options
author | bunnei <bunneidev@gmail.com> | 2019-07-04 07:42:22 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-07-04 07:42:22 +0200 |
commit | 3c7eed16dc290de13d7036f939e3364eb941f747 (patch) | |
tree | f4a58dcbef12307fab060ecaac6e7ae9063740b5 /src | |
parent | Merge pull request #2638 from DarkLordZach/quest-flag (diff) | |
parent | IAudioDevice::QueryAudioDeviceOutputEvent (diff) | |
download | yuzu-3c7eed16dc290de13d7036f939e3364eb941f747.tar yuzu-3c7eed16dc290de13d7036f939e3364eb941f747.tar.gz yuzu-3c7eed16dc290de13d7036f939e3364eb941f747.tar.bz2 yuzu-3c7eed16dc290de13d7036f939e3364eb941f747.tar.lz yuzu-3c7eed16dc290de13d7036f939e3364eb941f747.tar.xz yuzu-3c7eed16dc290de13d7036f939e3364eb941f747.tar.zst yuzu-3c7eed16dc290de13d7036f939e3364eb941f747.zip |
Diffstat (limited to 'src')
-rw-r--r-- | src/core/hle/service/audio/audren_u.cpp | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/src/core/hle/service/audio/audren_u.cpp b/src/core/hle/service/audio/audren_u.cpp index 75db0c2dc..3711e1ea1 100644 --- a/src/core/hle/service/audio/audren_u.cpp +++ b/src/core/hle/service/audio/audren_u.cpp @@ -167,13 +167,12 @@ public: {3, &IAudioDevice::GetActiveAudioDeviceName, "GetActiveAudioDeviceName"}, {4, &IAudioDevice::QueryAudioDeviceSystemEvent, "QueryAudioDeviceSystemEvent"}, {5, &IAudioDevice::GetActiveChannelCount, "GetActiveChannelCount"}, - {6, &IAudioDevice::ListAudioDeviceName, - "ListAudioDeviceNameAuto"}, // TODO(ogniK): Confirm if autos are identical to non auto + {6, &IAudioDevice::ListAudioDeviceName, "ListAudioDeviceNameAuto"}, {7, &IAudioDevice::SetAudioDeviceOutputVolume, "SetAudioDeviceOutputVolumeAuto"}, {8, nullptr, "GetAudioDeviceOutputVolumeAuto"}, {10, &IAudioDevice::GetActiveAudioDeviceName, "GetActiveAudioDeviceNameAuto"}, {11, nullptr, "QueryAudioDeviceInputEvent"}, - {12, nullptr, "QueryAudioDeviceOutputEvent"}, + {12, &IAudioDevice::QueryAudioDeviceOutputEvent, "QueryAudioDeviceOutputEvent"}, {13, nullptr, "GetAudioSystemMasterVolumeSetting"}, }; RegisterHandlers(functions); @@ -181,6 +180,11 @@ public: auto& kernel = Core::System::GetInstance().Kernel(); buffer_event = Kernel::WritableEvent::CreateEventPair(kernel, Kernel::ResetType::Automatic, "IAudioOutBufferReleasedEvent"); + + // Should only be signalled when an audio output device has been changed, example: speaker + // to headset + audio_output_device_switch_event = Kernel::WritableEvent::CreateEventPair( + kernel, Kernel::ResetType::Automatic, "IAudioDevice:AudioOutputDeviceSwitchedEvent"); } private: @@ -237,7 +241,16 @@ private: rb.Push<u32>(1); } + void QueryAudioDeviceOutputEvent(Kernel::HLERequestContext& ctx) { + LOG_DEBUG(Service_Audio, "called"); + + IPC::ResponseBuilder rb{ctx, 2, 1}; + rb.Push(RESULT_SUCCESS); + rb.PushCopyObjects(audio_output_device_switch_event.readable); + } + Kernel::EventPair buffer_event; + Kernel::EventPair audio_output_device_switch_event; }; // namespace Audio |