diff options
| author | 2019-07-04 01:42:22 -0400 | |
|---|---|---|
| committer | 2019-07-04 01:42:22 -0400 | |
| commit | 3c7eed16dc290de13d7036f939e3364eb941f747 (patch) | |
| tree | f4a58dcbef12307fab060ecaac6e7ae9063740b5 | |
| parent | Merge pull request #2638 from DarkLordZach/quest-flag (diff) | |
| parent | IAudioDevice::QueryAudioDeviceOutputEvent (diff) | |
| download | yuzu-3c7eed16dc290de13d7036f939e3364eb941f747.tar.gz yuzu-3c7eed16dc290de13d7036f939e3364eb941f747.tar.xz yuzu-3c7eed16dc290de13d7036f939e3364eb941f747.zip | |
Merge pull request #2658 from ogniK5377/QueryAudioDeviceOutputEvent
IAudioDevice::QueryAudioDeviceOutputEvent
| -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: | |||
| 167 | {3, &IAudioDevice::GetActiveAudioDeviceName, "GetActiveAudioDeviceName"}, | 167 | {3, &IAudioDevice::GetActiveAudioDeviceName, "GetActiveAudioDeviceName"}, |
| 168 | {4, &IAudioDevice::QueryAudioDeviceSystemEvent, "QueryAudioDeviceSystemEvent"}, | 168 | {4, &IAudioDevice::QueryAudioDeviceSystemEvent, "QueryAudioDeviceSystemEvent"}, |
| 169 | {5, &IAudioDevice::GetActiveChannelCount, "GetActiveChannelCount"}, | 169 | {5, &IAudioDevice::GetActiveChannelCount, "GetActiveChannelCount"}, |
| 170 | {6, &IAudioDevice::ListAudioDeviceName, | 170 | {6, &IAudioDevice::ListAudioDeviceName, "ListAudioDeviceNameAuto"}, |
| 171 | "ListAudioDeviceNameAuto"}, // TODO(ogniK): Confirm if autos are identical to non auto | ||
| 172 | {7, &IAudioDevice::SetAudioDeviceOutputVolume, "SetAudioDeviceOutputVolumeAuto"}, | 171 | {7, &IAudioDevice::SetAudioDeviceOutputVolume, "SetAudioDeviceOutputVolumeAuto"}, |
| 173 | {8, nullptr, "GetAudioDeviceOutputVolumeAuto"}, | 172 | {8, nullptr, "GetAudioDeviceOutputVolumeAuto"}, |
| 174 | {10, &IAudioDevice::GetActiveAudioDeviceName, "GetActiveAudioDeviceNameAuto"}, | 173 | {10, &IAudioDevice::GetActiveAudioDeviceName, "GetActiveAudioDeviceNameAuto"}, |
| 175 | {11, nullptr, "QueryAudioDeviceInputEvent"}, | 174 | {11, nullptr, "QueryAudioDeviceInputEvent"}, |
| 176 | {12, nullptr, "QueryAudioDeviceOutputEvent"}, | 175 | {12, &IAudioDevice::QueryAudioDeviceOutputEvent, "QueryAudioDeviceOutputEvent"}, |
| 177 | {13, nullptr, "GetAudioSystemMasterVolumeSetting"}, | 176 | {13, nullptr, "GetAudioSystemMasterVolumeSetting"}, |
| 178 | }; | 177 | }; |
| 179 | RegisterHandlers(functions); | 178 | RegisterHandlers(functions); |
| @@ -181,6 +180,11 @@ public: | |||
| 181 | auto& kernel = Core::System::GetInstance().Kernel(); | 180 | auto& kernel = Core::System::GetInstance().Kernel(); |
| 182 | buffer_event = Kernel::WritableEvent::CreateEventPair(kernel, Kernel::ResetType::Automatic, | 181 | buffer_event = Kernel::WritableEvent::CreateEventPair(kernel, Kernel::ResetType::Automatic, |
| 183 | "IAudioOutBufferReleasedEvent"); | 182 | "IAudioOutBufferReleasedEvent"); |
| 183 | |||
| 184 | // Should only be signalled when an audio output device has been changed, example: speaker | ||
| 185 | // to headset | ||
| 186 | audio_output_device_switch_event = Kernel::WritableEvent::CreateEventPair( | ||
| 187 | kernel, Kernel::ResetType::Automatic, "IAudioDevice:AudioOutputDeviceSwitchedEvent"); | ||
| 184 | } | 188 | } |
| 185 | 189 | ||
| 186 | private: | 190 | private: |
| @@ -237,7 +241,16 @@ private: | |||
| 237 | rb.Push<u32>(1); | 241 | rb.Push<u32>(1); |
| 238 | } | 242 | } |
| 239 | 243 | ||
| 244 | void QueryAudioDeviceOutputEvent(Kernel::HLERequestContext& ctx) { | ||
| 245 | LOG_DEBUG(Service_Audio, "called"); | ||
| 246 | |||
| 247 | IPC::ResponseBuilder rb{ctx, 2, 1}; | ||
| 248 | rb.Push(RESULT_SUCCESS); | ||
| 249 | rb.PushCopyObjects(audio_output_device_switch_event.readable); | ||
| 250 | } | ||
| 251 | |||
| 240 | Kernel::EventPair buffer_event; | 252 | Kernel::EventPair buffer_event; |
| 253 | Kernel::EventPair audio_output_device_switch_event; | ||
| 241 | 254 | ||
| 242 | }; // namespace Audio | 255 | }; // namespace Audio |
| 243 | 256 | ||