mirror of
https://github.com/switchbrew/libnx.git
synced 2025-06-21 12:32:40 +02:00
audctl: add GetActiveOutputTarget
This commit is contained in:
parent
412505092b
commit
24336f704e
@ -17,6 +17,7 @@ typedef enum {
|
||||
AudioTarget_Headphone = 2,
|
||||
AudioTarget_Tv = 3,
|
||||
AudioTarget_UsbOutputDevice = 4,
|
||||
AudioTarget_Bluetooth = 5,
|
||||
} AudioTarget;
|
||||
|
||||
typedef enum {
|
||||
@ -66,3 +67,4 @@ Result audctlGetAudioOutputTargetForPlayReport(AudioTarget* target_out); ///< [3
|
||||
Result audctlNotifyHeadphoneVolumeWarningDisplayedEvent(void); ///< [3.0.0+]
|
||||
Result audctlSetSystemOutputMasterVolume(float volume); ///< [4.0.0+]
|
||||
Result audctlGetSystemOutputMasterVolume(float* volume_out); ///< [4.0.0+]
|
||||
Result audctlGetActiveOutputTarget(AudioTarget* target);
|
||||
|
@ -340,3 +340,19 @@ Result audctlGetSystemOutputMasterVolume(float* volume_out) {
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
||||
Result audctlGetActiveOutputTarget(AudioTarget* target) {
|
||||
if (hosversionBefore(13,0,0))
|
||||
return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer);
|
||||
|
||||
struct {
|
||||
u32 target;
|
||||
} out;
|
||||
|
||||
Result rc = serviceDispatchOut(&g_audctlSrv, 32, out);
|
||||
|
||||
if (R_SUCCEEDED(rc)) {
|
||||
*target = out.target;
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user