libnx  v4.2.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;
21 
22 typedef enum {
23  AudioOutputMode_Invalid = 0,
24  AudioOutputMode_Pcm1ch = 1,
25  AudioOutputMode_Pcm2ch = 2,
26  AudioOutputMode_Pcm6ch = 3,
27  AudioOutputMode_PcmAuto = 4,
28 } AudioOutputMode;
29 
30 typedef enum {
31  AudioForceMutePolicy_Disable = 0,
32  AudioForceMutePolicy_SpeakerMuteOnHeadphoneUnplugged = 1,
33 } AudioForceMutePolicy;
34 
35 typedef enum {
36  AudioHeadphoneOutputLevelMode_Normal = 0,
37  AudioHeadphoneOutputLevelMode_HighPower = 1,
38 } AudioHeadphoneOutputLevelMode;
39 
40 Result audctlInitialize(void);
41 void audctlExit(void);
42 Service* audctlGetServiceSession(void);
43 
44 Result audctlGetTargetVolume(float* volume_out, AudioTarget target);
45 Result audctlSetTargetVolume(AudioTarget target, float volume);
46 Result audctlGetTargetVolumeMin(float* volume_out);
47 Result audctlGetTargetVolumeMax(float* volume_out);
48 Result audctlIsTargetMute(bool* mute_out, AudioTarget target);
49 Result audctlSetTargetMute(AudioTarget target, bool mute);
50 Result audctlIsTargetConnected(bool* connected_out, AudioTarget target);
51 Result audctlSetDefaultTarget(AudioTarget target, u64 fade_in_ns, u64 fade_out_ns);
52 Result audctlGetDefaultTarget(AudioTarget* target_out);
53 Result audctlGetAudioOutputMode(AudioOutputMode* mode_out, AudioTarget target);
54 Result audctlSetAudioOutputMode(AudioTarget target, AudioOutputMode mode);
55 Result audctlSetForceMutePolicy(AudioForceMutePolicy policy);
56 Result audctlGetForceMutePolicy(AudioForceMutePolicy* policy_out);
57 Result audctlGetOutputModeSetting(AudioOutputMode* mode_out, AudioTarget target);
58 Result audctlSetOutputModeSetting(AudioTarget target, AudioOutputMode mode);
59 Result audctlSetOutputTarget(AudioTarget target);
60 Result audctlSetInputTargetForceEnabled(bool enable);
61 Result audctlSetHeadphoneOutputLevelMode(AudioHeadphoneOutputLevelMode mode); ///< [3.0.0+]
62 Result audctlGetHeadphoneOutputLevelMode(AudioHeadphoneOutputLevelMode* mode_out); ///< [3.0.0+]
65 Result audctlGetAudioOutputTargetForPlayReport(AudioTarget* target_out); ///< [3.0.0+]
67 Result audctlSetSystemOutputMasterVolume(float volume); ///< [4.0.0+]
68 Result audctlGetSystemOutputMasterVolume(float* volume_out); ///< [4.0.0+]
audctlNotifyHeadphoneVolumeWarningDisplayedEvent
Result audctlNotifyHeadphoneVolumeWarningDisplayedEvent(void)
[3.0.0+]
audctlAcquireAudioOutputDeviceUpdateEventForPlayReport
Result audctlAcquireAudioOutputDeviceUpdateEventForPlayReport(Event *event_out)
[3.0.0+]
audctlSetSystemOutputMasterVolume
Result audctlSetSystemOutputMasterVolume(float volume)
[4.0.0+]
audctlGetSystemOutputMasterVolume
Result audctlGetSystemOutputMasterVolume(float *volume_out)
[4.0.0+]
audctlSetHeadphoneOutputLevelMode
Result audctlSetHeadphoneOutputLevelMode(AudioHeadphoneOutputLevelMode mode)
[3.0.0+]
Event
Kernel-mode event structure.
Definition: event.h:13
audctlGetAudioOutputTargetForPlayReport
Result audctlGetAudioOutputTargetForPlayReport(AudioTarget *target_out)
[3.0.0+]
audctlAcquireAudioVolumeUpdateEventForPlayReport
Result audctlAcquireAudioVolumeUpdateEventForPlayReport(Event *event_out)
[3.0.0+]
u64
uint64_t u64
64-bit unsigned integer.
Definition: types.h:22
Result
u32 Result
Function error code result type.
Definition: types.h:44
audctlGetHeadphoneOutputLevelMode
Result audctlGetHeadphoneOutputLevelMode(AudioHeadphoneOutputLevelMode *mode_out)
[3.0.0+]
Service
Service object structure.
Definition: service.h:13