1
0
mirror of https://github.com/switchbrew/libnx.git synced 2025-07-23 18:52:14 +02:00

audctl: add GetActiveOutputTarget

This commit is contained in:
averne 2023-02-03 23:05:28 +01:00 committed by fincs
parent 4d59d366a1
commit ada230a882
2 changed files with 18 additions and 0 deletions
nx
include/switch/services
source/services

View File

@ -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);

View File

@ -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;
}