forked from bscarell/losers
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtune.h
165 lines (132 loc) · 3.88 KB
/
tune.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
#pragma once
#ifdef __cplusplus
extern "C" {
#endif
#include <switch.h>
typedef enum {
TuneShuffleMode_Off,
TuneShuffleMode_On,
TuneShuffleMode_Count,
} TuneShuffleMode;
typedef enum {
TuneRepeatMode_Off,
TuneRepeatMode_One,
TuneRepeatMode_All,
TuneRepeatMode_Count,
} TuneRepeatMode;
typedef enum {
TuneEnqueueType_Front,
TuneEnqueueType_Back,
TuneEnqueueType_Count,
} TuneEnqueueType;
typedef struct {
u32 sample_rate;
u32 current_frame;
u32 total_frames;
} TuneCurrentStats;
Result tuneInitialize();
void tuneExit();
/**
* @brief Get the current status of playback.
* @param[out] status \ref AudioOutState
*/
Result tuneGetStatus(bool *status);
Result tunePlay();
Result tunePause();
Result tuneNext();
Result tunePrev();
/**
* @brief Get the current playback volume.
* @note On FW lower than [6.0.0] this will set the decode volume.
* @param[out] out volume value (linear factor).
*/
Result tuneGetBass(double *out);
/**
* @brief Set the playback volume.
* @note On FW lower than [6.0.0] this will return the decode volume.
* @param[in] volume volume value (linear factor).
*/
Result tuneSetBass(double bass);
/**
* @brief Get the current playback volume.
* @note On FW lower than [6.0.0] this will set the decode volume.
* @param[out] out volume value (linear factor).
*/
Result tuneGetVolume(double *out);
/**
* @brief Set the playback volume.
* @note On FW lower than [6.0.0] this will return the decode volume.
* @param[in] volume volume value (linear factor).
*/
Result tuneSetVolume(double volume);
/**
* @brief Get the volume of the current title
* @param[out] out volume value (linear factor).
*/
Result tuneGetTitleVolume(double *out);
/**
* @brief Set the volume of the current title
* @param[in] volume volume value (linear factor).
*/
Result tuneSetTitleVolume(double volume);
/**
* @brief Get the default volume of all titles
* @param[out] out volume value (linear factor).
*/
Result tuneGetDefaultTitleVolume(double *out);
/**
* @brief Set the default volume of all titles
* @param[in] volume volume value (linear factor).
*/
Result tuneSetDefaultTitleVolume(double volume);
/**
* @brief Get the current loop status.
* @param[out] state \ref TuneRepeatMode
*/
Result tuneGetRepeatMode(TuneRepeatMode *state);
/**
* @brief Set repeat mode.
* @param[in] state \ref TuneRepeatMode
*/
Result tuneSetRepeatMode(TuneRepeatMode state);
Result tuneGetShuffleMode(TuneShuffleMode *state);
Result tuneSetShuffleMode(TuneShuffleMode state);
/**
* @brief Get the current queue size.
* @param[out] count remaining tracks after current.
*/
Result tuneGetPlaylistSize(u32 *count);
/**
* @brief Read queue.
* @param[out] read Amount written to buffer.
* @param[out] out_path Path array FS_MAX_PATH * n
* @param[in] out_path_length Size of the supplied path array.
*/
Result tuneGetPlaylistItem(u32 index, char *out_path, size_t out_path_length);
/**
* @brief Get current song.
* @param[out] out_path Path to current playing song.
* @param[in] out_path_length Size of the out_path buffer. Path of the current track needs to fit.
* @param[out] out \ref MusicCurrentTune
*/
Result tuneGetCurrentQueueItem(char *out_path, size_t out_path_length, TuneCurrentStats *out);
/**
* @brief Clear queue.
*/
Result tuneClearQueue();
Result tuneMoveQueueItem(u32 src, u32 dst);
Result tuneSelect(u32 index);
Result tuneSeek(u32 position);
/**
* @brief Add track to queue.
* @note Must not include leading mount name.
* @note Must match ^(sdmc:/.*.mp3)$
* @param[in] path Path to file on sdcard.
*/
Result tuneEnqueue(const char *path, TuneEnqueueType type);
Result tuneRemove(u32 index);
Result tuneQuit();
Result tuneGetApiVersion(u32 *version);
#ifdef __cplusplus
}
#endif