libnx v4.9.0
Loading...
Searching...
No Matches
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
14typedef 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
23typedef enum {
24 AudioOutputMode_Invalid = 0,
25 AudioOutputMode_Pcm1ch = 1,
26 AudioOutputMode_Pcm2ch = 2,
27 AudioOutputMode_Pcm6ch = 3,
28 AudioOutputMode_PcmAuto = 4,
29} AudioOutputMode;
30
31typedef enum {
32 AudioForceMutePolicy_Disable = 0,
33 AudioForceMutePolicy_SpeakerMuteOnHeadphoneUnplugged = 1,
34} AudioForceMutePolicy;
35
36typedef enum {
37 AudioHeadphoneOutputLevelMode_Normal = 0,
38 AudioHeadphoneOutputLevelMode_HighPower = 1,
39} AudioHeadphoneOutputLevelMode;
40
41Result audctlInitialize(void);
42void audctlExit(void);
43Service* audctlGetServiceSession(void);
44
45Result audctlGetTargetVolume(s32* volume_out, AudioTarget target);
46Result audctlSetTargetVolume(AudioTarget target, s32 volume);
47Result audctlGetTargetVolumeMin(s32* volume_out);
48Result audctlGetTargetVolumeMax(s32* volume_out);
49Result audctlIsTargetMute(bool* mute_out, AudioTarget target);
50Result audctlSetTargetMute(AudioTarget target, bool mute);
51Result audctlIsTargetConnected(bool* connected_out, AudioTarget target); ///< [1.0.0-17.0.1]
52Result audctlSetDefaultTarget(AudioTarget target, u64 fade_in_ns, u64 fade_out_ns);
53Result audctlGetDefaultTarget(AudioTarget* target_out);
54Result audctlGetAudioOutputMode(AudioOutputMode* mode_out, AudioTarget target);
55Result audctlSetAudioOutputMode(AudioTarget target, AudioOutputMode mode);
56Result audctlSetForceMutePolicy(AudioForceMutePolicy policy); ///< [1.0.0-13.2.1]
57Result audctlGetForceMutePolicy(AudioForceMutePolicy* policy_out); ///< [1.0.0-13.2.1]
58Result audctlGetOutputModeSetting(AudioOutputMode* mode_out, AudioTarget target);
59Result audctlSetOutputModeSetting(AudioTarget target, AudioOutputMode mode);
60Result audctlSetOutputTarget(AudioTarget target);
61Result audctlSetInputTargetForceEnabled(bool enable);
62Result audctlSetHeadphoneOutputLevelMode(AudioHeadphoneOutputLevelMode mode); ///< [3.0.0+]
63Result audctlGetHeadphoneOutputLevelMode(AudioHeadphoneOutputLevelMode* mode_out); ///< [3.0.0+]
66Result audctlGetAudioOutputTargetForPlayReport(AudioTarget* target_out); ///< [3.0.0+]
68Result audctlSetSystemOutputMasterVolume(float volume); ///< [4.0.0+]
69Result audctlGetSystemOutputMasterVolume(float* volume_out); ///< [4.0.0+]
70Result 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 audctlGetForceMutePolicy(AudioForceMutePolicy *policy_out)
[1.0.0-13.2.1]
Result audctlGetSystemOutputMasterVolume(float *volume_out)
[4.0.0+]
Result audctlSetForceMutePolicy(AudioForceMutePolicy policy)
[1.0.0-13.2.1]
Result audctlAcquireAudioOutputDeviceUpdateEventForPlayReport(Event *event_out)
[3.0.0-13.2.1]
Result audctlIsTargetConnected(bool *connected_out, AudioTarget target)
[1.0.0-17.0.1]
Result audctlGetHeadphoneOutputLevelMode(AudioHeadphoneOutputLevelMode *mode_out)
[3.0.0+]
Result audctlAcquireAudioVolumeUpdateEventForPlayReport(Event *event_out)
[3.0.0-13.2.1]
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