libnx  v4.7.0
audctl.h
Go to the documentation of this file.
1 /**
2  * @file audctl.h
3  * @brief Audio Control IPC wrapper.
4  * @author plutoo
5  * @copyright libnx Authors
6  */
7 #pragma once
8 
9 #include "../types.h"
10 #include "../audio/audio.h"
11 #include "../sf/service.h"
12 #include "../kernel/event.h"
13 
14 typedef enum {
15  AudioTarget_Invalid = 0,
16  AudioTarget_Speaker = 1,
17  AudioTarget_Headphone = 2,
18  AudioTarget_Tv = 3,
19  AudioTarget_UsbOutputDevice = 4,
20  AudioTarget_Bluetooth = 5,
21 } AudioTarget;
22 
23 typedef enum {
24  AudioOutputMode_Invalid = 0,
25  AudioOutputMode_Pcm1ch = 1,
26  AudioOutputMode_Pcm2ch = 2,
27  AudioOutputMode_Pcm6ch = 3,
28  AudioOutputMode_PcmAuto = 4,
29 } AudioOutputMode;
30 
31 typedef enum {
32  AudioForceMutePolicy_Disable = 0,
33  AudioForceMutePolicy_SpeakerMuteOnHeadphoneUnplugged = 1,
34 } AudioForceMutePolicy;
35 
36 typedef enum {
37  AudioHeadphoneOutputLevelMode_Normal = 0,
38  AudioHeadphoneOutputLevelMode_HighPower = 1,
39 } AudioHeadphoneOutputLevelMode;
40 
41 Result audctlInitialize(void);
42 void audctlExit(void);
43 Service* audctlGetServiceSession(void);
44 
45 Result audctlGetTargetVolume(s32* volume_out, AudioTarget target);
46 Result audctlSetTargetVolume(AudioTarget target, s32 volume);
47 Result audctlGetTargetVolumeMin(s32* volume_out);
48 Result audctlGetTargetVolumeMax(s32* volume_out);
49 Result audctlIsTargetMute(bool* mute_out, AudioTarget target);
50 Result audctlSetTargetMute(AudioTarget target, bool mute);
51 Result audctlIsTargetConnected(bool* connected_out, AudioTarget target);
52 Result audctlSetDefaultTarget(AudioTarget target, u64 fade_in_ns, u64 fade_out_ns);
53 Result audctlGetDefaultTarget(AudioTarget* target_out);
54 Result audctlGetAudioOutputMode(AudioOutputMode* mode_out, AudioTarget target);
55 Result audctlSetAudioOutputMode(AudioTarget target, AudioOutputMode mode);
56 Result audctlSetForceMutePolicy(AudioForceMutePolicy policy);
57 Result audctlGetForceMutePolicy(AudioForceMutePolicy* policy_out);
58 Result audctlGetOutputModeSetting(AudioOutputMode* mode_out, AudioTarget target);
59 Result audctlSetOutputModeSetting(AudioTarget target, AudioOutputMode mode);
60 Result audctlSetOutputTarget(AudioTarget target);
61 Result audctlSetInputTargetForceEnabled(bool enable);
62 Result audctlSetHeadphoneOutputLevelMode(AudioHeadphoneOutputLevelMode mode); ///< [3.0.0+]
63 Result audctlGetHeadphoneOutputLevelMode(AudioHeadphoneOutputLevelMode* mode_out); ///< [3.0.0+]
66 Result audctlGetAudioOutputTargetForPlayReport(AudioTarget* target_out); ///< [3.0.0+]
68 Result audctlSetSystemOutputMasterVolume(float volume); ///< [4.0.0+]
69 Result audctlGetSystemOutputMasterVolume(float* volume_out); ///< [4.0.0+]
70 Result audctlGetActiveOutputTarget(AudioTarget* target);
Result audctlSetHeadphoneOutputLevelMode(AudioHeadphoneOutputLevelMode mode)
[3.0.0+]
Result audctlNotifyHeadphoneVolumeWarningDisplayedEvent(void)
[3.0.0+]
Result audctlSetSystemOutputMasterVolume(float volume)
[4.0.0+]
Result audctlGetAudioOutputTargetForPlayReport(AudioTarget *target_out)
[3.0.0+]
Result audctlGetSystemOutputMasterVolume(float *volume_out)
[4.0.0+]
Result audctlAcquireAudioOutputDeviceUpdateEventForPlayReport(Event *event_out)
[3.0.0+]
Result audctlGetHeadphoneOutputLevelMode(AudioHeadphoneOutputLevelMode *mode_out)
[3.0.0+]
Result audctlAcquireAudioVolumeUpdateEventForPlayReport(Event *event_out)
[3.0.0+]
Kernel-mode event structure.
Definition: event.h:13
Service object structure.
Definition: service.h:14
uint64_t u64
64-bit unsigned integer.
Definition: types.h:22
u32 Result
Function error code result type.
Definition: types.h:44
int32_t s32
32-bit signed integer.
Definition: types.h:27