-
Notifications
You must be signed in to change notification settings - Fork 63
/
spotify.processed.h
327 lines (234 loc) · 7.97 KB
/
spotify.processed.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
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
# 1 "spotify.h"
# 1 "<built-in>"
# 1 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 1 "<command-line>" 2
# 1 "spotify.h"
# 1 "/usr/lib/gcc/arm-linux-gnueabi/4.9/include/stddef.h" 1 3 4
# 147 "/usr/lib/gcc/arm-linux-gnueabi/4.9/include/stddef.h" 3 4
typedef int ptrdiff_t;
# 212 "/usr/lib/gcc/arm-linux-gnueabi/4.9/include/stddef.h" 3 4
typedef unsigned int size_t;
# 324 "/usr/lib/gcc/arm-linux-gnueabi/4.9/include/stddef.h" 3 4
typedef unsigned int wchar_t;
# 5 "spotify.h" 2
# 1 "/usr/lib/gcc/arm-linux-gnueabi/4.9/include/stdint.h" 1 3 4
# 9 "/usr/lib/gcc/arm-linux-gnueabi/4.9/include/stdint.h" 3 4
# 1 "/usr/include/stdint.h" 1 3 4
# 25 "/usr/include/stdint.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 374 "/usr/include/features.h" 3 4
# 1 "/usr/include/arm-linux-gnueabi/sys/cdefs.h" 1 3 4
# 385 "/usr/include/arm-linux-gnueabi/sys/cdefs.h" 3 4
# 1 "/usr/include/arm-linux-gnueabi/bits/wordsize.h" 1 3 4
# 386 "/usr/include/arm-linux-gnueabi/sys/cdefs.h" 2 3 4
# 375 "/usr/include/features.h" 2 3 4
# 398 "/usr/include/features.h" 3 4
# 1 "/usr/include/arm-linux-gnueabi/gnu/stubs.h" 1 3 4
# 1 "/usr/include/arm-linux-gnueabi/gnu/stubs-soft.h" 1 3 4
# 8 "/usr/include/arm-linux-gnueabi/gnu/stubs.h" 2 3 4
# 399 "/usr/include/features.h" 2 3 4
# 26 "/usr/include/stdint.h" 2 3 4
# 1 "/usr/include/arm-linux-gnueabi/bits/wchar.h" 1 3 4
# 27 "/usr/include/stdint.h" 2 3 4
# 1 "/usr/include/arm-linux-gnueabi/bits/wordsize.h" 1 3 4
# 28 "/usr/include/stdint.h" 2 3 4
# 36 "/usr/include/stdint.h" 3 4
typedef signed char int8_t;
typedef short int int16_t;
typedef int int32_t;
typedef long long int int64_t;
typedef unsigned char uint8_t;
typedef unsigned short int uint16_t;
typedef unsigned int uint32_t;
typedef unsigned long long int uint64_t;
typedef signed char int_least8_t;
typedef short int int_least16_t;
typedef int int_least32_t;
typedef long long int int_least64_t;
typedef unsigned char uint_least8_t;
typedef unsigned short int uint_least16_t;
typedef unsigned int uint_least32_t;
typedef unsigned long long int uint_least64_t;
typedef signed char int_fast8_t;
typedef int int_fast16_t;
typedef int int_fast32_t;
typedef long long int int_fast64_t;
typedef unsigned char uint_fast8_t;
typedef unsigned int uint_fast16_t;
typedef unsigned int uint_fast32_t;
typedef unsigned long long int uint_fast64_t;
# 125 "/usr/include/stdint.h" 3 4
typedef int intptr_t;
typedef unsigned int uintptr_t;
# 137 "/usr/include/stdint.h" 3 4
typedef long long int intmax_t;
typedef unsigned long long int uintmax_t;
# 10 "/usr/lib/gcc/arm-linux-gnueabi/4.9/include/stdint.h" 2 3 4
# 6 "spotify.h" 2
# 1 "/usr/lib/gcc/arm-linux-gnueabi/4.9/include/stdbool.h" 1 3 4
# 7 "spotify.h" 2
typedef enum {
kSpErrorOk = 0,
kSpErrorFailed = 1,
kSpErrorInitFailed = 2,
kSpErrorWrongAPIVersion = 3,
kSpErrorNullArgument = 4,
kSpErrorInvalidArgument = 5,
kSpErrorUninitialized = 6,
kSpErrorAlreadyInitialized = 7,
kSpErrorLoginBadCredentials = 8,
kSpErrorNeedsPremium = 9,
kSpErrorTravelRestriction = 10,
kSpErrorApplicationBanned = 11,
kSpErrorGeneralLoginError = 12,
kSpErrorUnsupported = 13,
kSpErrorNotActiveDevice = 14,
kSpErrorPlaybackErrorStart = 1000,
kSpErrorGeneralPlaybackError = 1001,
kSpErrorPlaybackRateLimited = 1002,
kSpErrorUnknown = 1003,
} SpError;
typedef enum {
kSpConnectionNotifyLoggedIn = 0,
kSpConnectionNotifyLoggedOut = 1,
kSpConnectionNotifyTemporaryError = 2,
} SpConnectionNotify;
typedef enum {
kSpPlaybackNotifyPlay = 0,
kSpPlaybackNotifyPause = 1,
kSpPlaybackNotifyTrackChanged = 2,
kSpPlaybackNotifyNext = 3,
kSpPlaybackNotifyPrev = 4,
kSpPlaybackNotifyShuffleEnabled = 5,
kSpPlaybackNotifyShuffleDisabled = 6,
kSpPlaybackNotifyRepeatEnabled = 7,
kSpPlaybackNotifyRepeatDisabled = 8,
kSpPlaybackNotifyBecameActive = 9,
kSpPlaybackNotifyBecameInactive = 10,
kSpPlaybackNotifyPlayTokenLost = 11,
kSpPlaybackEventAudioFlush = 12,
} SpPlaybackNotify;
typedef enum {
kSpDeviceTypeUnknown = 0,
kSpDeviceTypeComputer = 1,
kSpDeviceTypeTablet = 2,
kSpDeviceTypeSmartphone = 3,
kSpDeviceTypeSpeaker = 4,
kSpDeviceTypeTV = 5,
kSpDeviceTypeAVR = 6,
kSpDeviceTypeSTB = 7,
kSpDeviceTypeAudioDongle = 8,
} SpDeviceType;
typedef enum {
kSpSampleTypeS16NativeEndian,
} SpSampleType;
typedef enum {
kSpBitrate90k = 0,
kSpBitrate160k = 1,
kSpBitrate320k = 2,
} SpBitrate;
typedef enum {
kSpImageSizeSmall = 0,
kSpImageSizeNormal = 1,
kSpImageSizeLarge = 2,
} SpImageSize;
typedef struct {
uint16_t channels;
uint16_t sample_type;
uint32_t sample_rate;
} SpSampleFormat;
typedef struct {
uint32_t version;
uint8_t *buffer;
uint32_t buffer_size;
uint8_t *app_key;
uint32_t app_key_size;
const char *deviceId;
const char *remoteName;
const char *brandName;
const char *modelName;
char *client_id;
char *client_secret;
uint32_t deviceType;
void (*error_callback)(SpError error, void *userdata);
void *userdata;
} SpConfig;
typedef struct {
char publicKey[0x96];
char deviceId[0x41];
char activeUser[0x41];
char remoteName[0x41];
char accountReq[0x10];
char deviceType[0x10];
char libraryVersion[0x1f];
} SpZeroConfVars;
typedef struct {
char data0[0x100];
char context_uri[0x80];
char track_name[0x100];
char track_uri[0x80];
char artist_name[0x100];
char artist_uri[0x80];
char album_name[0x100];
char album_uri[0x80];
char cover_uri[0x80];
uint32_t duration;
} SpMetadata;
typedef struct {
uint8_t data[0x84];
} SpPreset;
typedef struct {
void (*notify)(SpConnectionNotify notification, void *userdata);
void (*new_credentials)(const char *blob, void *userdata);
} SpConnectionCallbacks;
typedef struct {
void (*notify)(SpPlaybackNotify notification, void *userdata);
uint32_t (*audio_data)(const void *samples, uint32_t num_samples,
SpSampleFormat *format, uint32_t *pending,
void *userdata);
void (*seek)(uint32_t millis, void *userdata);
void (*apply_volume)(uint16_t volume, void *userdata);
} SpPlaybackCallbacks;
typedef struct {
void (*message)(const char *msg, void *userdata);
} SpDebugCallbacks;
SpError SpInit(const SpConfig *config);
void SpFree(void);
SpError SpPumpEvents(void);
SpError SpGetMetadataValidRange(int *start, int *end);
SpError SpGetMetadata(SpMetadata *, int offset);
SpError SpGetMetadataImageURL(const char *uri, SpImageSize imageSize,
char *url, size_t size);
SpError SpGetPreset(SpPreset *preset, size_t *size);
SpError SpPlayPreset(const SpPreset *preset, size_t size);
SpError SpSetDisplayName(const char *name);
const char *SpGetLibraryVersion(void);
SpError SpZeroConfGetVars(SpZeroConfVars *vars);
SpError SpPlaybackPlay(void);
SpError SpPlaybackPause(void);
SpError SpPlaybackSkipToNext(void);
SpError SpPlaybackSkipToPrev(void);
SpError SpPlaybackSeek(uint32_t millis);
SpError SpPlaybackUpdateVolume(uint16_t volume);
SpError SpPlaybackEnableShuffle(_Bool enable);
SpError SpPlaybackEnableRepeat(_Bool enable);
SpError SpPlaybackSetBitrate(SpBitrate bitrate);
uint16_t SpPlaybackGetVolume(void);
_Bool SpPlaybackIsPlaying(void);
_Bool SpPlaybackIsShuffled(void);
_Bool SpPlaybackIsRepeated(void);
_Bool SpPlaybackIsActiveDevice(void);
SpError SpConnectionLoginBlob(const char *username, const char *blob);
SpError SpConnectionLoginPassword(const char *login, const char *password);
SpError SpConnectionLoginZeroConf(const char *username, const char *blob,
const char *clientKey);
SpError SpConnectionLoginOauthToken(const char *token);
_Bool SpConnectionIsLoggedIn(void);
SpError SpConnectionLogout(void);
SpError SpRegisterConnectionCallbacks(
const SpConnectionCallbacks *callbacks, void *userdata);
SpError SpRegisterPlaybackCallbacks(
const SpPlaybackCallbacks *callbacks, void *userdata);
SpError SpRegisterDebugCallbacks(
const SpDebugCallbacks *callbacks, void *userdata);