mirror of
https://github.com/switchbrew/libnx.git
synced 2025-06-21 04:22:50 +02:00
auddev: add GetActiveAudioDeviceName
This commit is contained in:
parent
dcebe96e71
commit
4d59d366a1
@ -22,4 +22,4 @@ Service* auddevGetServiceSession(void);
|
||||
Result auddevListAudioDeviceName(AudioDeviceName *DeviceNames, s32 max_names, s32 *total_names);
|
||||
Result auddevSetAudioDeviceOutputVolume(const AudioDeviceName *DeviceName, float volume);
|
||||
Result auddevGetAudioDeviceOutputVolume(const AudioDeviceName *DeviceName, float *volume);
|
||||
|
||||
Result auddevGetActiveAudioDeviceName(AudioDeviceName *DeviceName);
|
||||
|
@ -62,3 +62,11 @@ Result auddevGetAudioDeviceOutputVolume(const AudioDeviceName *DeviceName, float
|
||||
.buffers = { { DeviceName, sizeof(AudioDeviceName) } },
|
||||
);
|
||||
}
|
||||
|
||||
Result auddevGetActiveAudioDeviceName(AudioDeviceName *DeviceName) {
|
||||
bool new_cmd = hosversionAtLeast(3,0,0);
|
||||
return serviceDispatch(&g_auddevIAudioDevice, new_cmd==0 ? 3 : 10,
|
||||
.buffer_attrs = { (new_cmd==0 ? SfBufferAttr_HipcMapAlias : SfBufferAttr_HipcAutoSelect) | SfBufferAttr_Out },
|
||||
.buffers = { { DeviceName, sizeof(AudioDeviceName) } },
|
||||
);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user