mirror of
https://github.com/skyline-emu/skyline.git
synced 2024-11-05 22:15:05 +01:00
Stub some IAudioDevice calls
This commit is contained in:
parent
3a94bcf692
commit
efef67b92b
@ -62,4 +62,25 @@ namespace skyline::service::audio {
|
||||
response.copyHandles.push_back(handle);
|
||||
return {};
|
||||
}
|
||||
|
||||
Result IAudioDevice::GetActiveAudioOutputDeviceName(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response) {
|
||||
std::string_view deviceName{"AudioTvOutput\0"};
|
||||
if (deviceName.size() > request.outputBuf.at(0).size())
|
||||
throw exception("The buffer supplied to GetActiveAudioDeviceName is too small");
|
||||
request.outputBuf.at(0).copy_from(deviceName);
|
||||
return {};
|
||||
}
|
||||
|
||||
Result IAudioDevice::ListAudioOutputDeviceName(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response) {
|
||||
span buffer{request.outputBuf.at(0)};
|
||||
std::array<std::string_view, 3> devices{"AudioExternalOutput\0", "AudioBuiltInSpeakerOutput\0", "AudioTvOutput\0"};
|
||||
for (std::string_view deviceName : devices) {
|
||||
if (deviceName.size() > buffer.size())
|
||||
throw exception("The buffer supplied to ListAudioDeviceName is too small");
|
||||
buffer.copy_from(deviceName);
|
||||
buffer = buffer.subspan(deviceName.size());
|
||||
}
|
||||
response.Push<u32>(devices.size());
|
||||
return {};
|
||||
}
|
||||
}
|
||||
|
@ -51,6 +51,13 @@ namespace skyline::service::audio {
|
||||
|
||||
Result QueryAudioDeviceOutputEvent(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response);
|
||||
|
||||
/**
|
||||
* @url https://switchbrew.org/wiki/Audio_services#GetActiveAudioOutputDeviceName
|
||||
*/
|
||||
Result GetActiveAudioOutputDeviceName(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response);
|
||||
|
||||
Result ListAudioOutputDeviceName(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response);
|
||||
|
||||
SERVICE_DECL(
|
||||
SFUNC(0x0, IAudioDevice, ListAudioDeviceName),
|
||||
SFUNC(0x1, IAudioDevice, SetAudioDeviceOutputVolume),
|
||||
@ -61,7 +68,9 @@ namespace skyline::service::audio {
|
||||
SFUNC(0x7, IAudioDevice, SetAudioDeviceOutputVolume),
|
||||
SFUNC(0xA, IAudioDevice, GetActiveAudioDeviceName),
|
||||
SFUNC(0xB, IAudioDevice, QueryAudioDeviceInputEvent),
|
||||
SFUNC(0xC, IAudioDevice, QueryAudioDeviceOutputEvent)
|
||||
SFUNC(0xC, IAudioDevice, QueryAudioDeviceOutputEvent),
|
||||
SFUNC(0xD, IAudioDevice, GetActiveAudioOutputDeviceName),
|
||||
SFUNC(0xE, IAudioDevice, ListAudioOutputDeviceName)
|
||||
)
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user