spotify 9.1.0 → 10.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/spotify.rb +34 -10
- data/lib/spotify/version.rb +1 -1
- data/spec/api.h +169 -50
- metadata +15 -14
data/lib/spotify.rb
CHANGED
@@ -70,7 +70,15 @@ module Spotify
|
|
70
70
|
:index_out_of_range, :user_needs_premium,
|
71
71
|
:other_transient, :is_loading, :no_stream_available,
|
72
72
|
:permission_denied, :inbox_is_full, :no_cache,
|
73
|
-
:no_such_user, :no_credentials
|
73
|
+
:no_such_user, :no_credentials,
|
74
|
+
|
75
|
+
:network_disabled, :invalid_device_id,
|
76
|
+
:cant_open_trace_file, :application_banned,
|
77
|
+
|
78
|
+
:offline_too_many_tracks, 31,
|
79
|
+
:offline_disk_cache, :offline_expired,
|
80
|
+
:offline_not_allowed, :offline_license_lost,
|
81
|
+
:offline_license_error]
|
74
82
|
|
75
83
|
# @macro [attach] attach_function
|
76
84
|
#
|
@@ -154,7 +162,8 @@ module Spotify
|
|
154
162
|
:start_playback, callback([ :session ], :void),
|
155
163
|
:stop_playback, callback([ :session ], :void),
|
156
164
|
:get_audio_buffer_stats, callback([ :session, AudioBufferStats ], :void),
|
157
|
-
:offline_status_updated, callback([ :session ], :void)
|
165
|
+
:offline_status_updated, callback([ :session ], :void),
|
166
|
+
:offline_error, callback([ :session, :error ], :void)
|
158
167
|
end
|
159
168
|
|
160
169
|
# FFI::Struct for Session configuration.
|
@@ -179,7 +188,9 @@ module Spotify
|
|
179
188
|
:userdata, :userdata,
|
180
189
|
:compress_playlists, Bool,
|
181
190
|
:dont_save_metadata_for_playlists, Bool,
|
182
|
-
:initially_unload_playlists, Bool
|
191
|
+
:initially_unload_playlists, Bool,
|
192
|
+
:device_id, :pointer,
|
193
|
+
:tracefile, :pointer
|
183
194
|
end
|
184
195
|
|
185
196
|
# FFI::Struct for Offline Sync Status
|
@@ -242,8 +253,6 @@ module Spotify
|
|
242
253
|
attach_function :session_starred_for_user_create, :sp_session_starred_for_user_create, [ :session, :string ], :playlist
|
243
254
|
attach_function :session_publishedcontainer_for_user_create, :sp_session_publishedcontainer_for_user_create, [ :playlist, :string ], :playlistcontainer
|
244
255
|
attach_function :session_preferred_bitrate, :sp_session_preferred_bitrate, [ :session, :bitrate ], :void
|
245
|
-
attach_function :session_num_friends, :sp_session_num_friends, [ :session ], :int
|
246
|
-
attach_function :session_friend, :sp_session_friend, [ :session, :int ], :user
|
247
256
|
|
248
257
|
attach_function :session_set_connection_type, :sp_session_set_connection_type, [ :session, :connection_type ], :void
|
249
258
|
attach_function :session_set_connection_rules, :sp_session_set_connection_rules, [ :session, :connection_rules ], :void
|
@@ -256,6 +265,9 @@ module Spotify
|
|
256
265
|
attach_function :session_user_country, :sp_session_user_country, [ :session ], :int
|
257
266
|
attach_function :session_preferred_offline_bitrate, :sp_session_preferred_offline_bitrate, [ :session, :bitrate, :bool ], :void
|
258
267
|
|
268
|
+
attach_function :session_set_volume_normalization, :sp_session_set_volume_normalization, [ :session, :bool ], :void
|
269
|
+
attach_function :session_get_volume_normalization, :sp_session_get_volume_normalization, [ :session ], :bool
|
270
|
+
|
259
271
|
#
|
260
272
|
# Link
|
261
273
|
#
|
@@ -292,10 +304,15 @@ module Spotify
|
|
292
304
|
#
|
293
305
|
# @see http://developer.spotify.com/en/libspotify/docs/group__track.html
|
294
306
|
|
307
|
+
enum :availability, [:unavailable, :available, :not_streamable, :banned_by_artist]
|
308
|
+
typedef :availability, :track_availability
|
309
|
+
|
310
|
+
enum :track_offline_status, [:no, :waiting, :downloading, :done, :error, :done_expired, :limit_exceeded, :done_resync]
|
311
|
+
|
295
312
|
#
|
296
313
|
attach_function :track_is_loaded, :sp_track_is_loaded, [ :track ], :bool
|
297
314
|
attach_function :track_error, :sp_track_error, [ :track ], :error
|
298
|
-
attach_function :
|
315
|
+
attach_function :track_get_availability, :sp_track_get_availability, [ :session, :track ], :track_availability
|
299
316
|
attach_function :track_is_local, :sp_track_is_local, [ :session, :track ], :bool
|
300
317
|
attach_function :track_is_autolinked, :sp_track_is_autolinked, [ :session, :track ], :bool
|
301
318
|
attach_function :track_is_starred, :sp_track_is_starred, [ :session, :track ], :bool
|
@@ -308,6 +325,10 @@ module Spotify
|
|
308
325
|
attach_function :track_popularity, :sp_track_popularity, [ :track ], :int
|
309
326
|
attach_function :track_disc, :sp_track_disc, [ :track ], :int
|
310
327
|
attach_function :track_index, :sp_track_index, [ :track ], :int
|
328
|
+
attach_function :track_is_placeholder, :sp_track_is_placeholder, [ :track ], :bool
|
329
|
+
|
330
|
+
attach_function :track_offline_get_status, :sp_track_offline_get_status, [ :track ], :track_offline_status
|
331
|
+
|
311
332
|
attach_function :localtrack_create, :sp_localtrack_create, [ :string, :string, :string, :int ], :track
|
312
333
|
|
313
334
|
attach_function :track_add_ref, :sp_track_add_ref, [ :track ], :void
|
@@ -349,6 +370,7 @@ module Spotify
|
|
349
370
|
attach_function :albumbrowse_num_tracks, :sp_albumbrowse_num_tracks, [ :albumbrowse ], :int
|
350
371
|
attach_function :albumbrowse_track, :sp_albumbrowse_track, [ :albumbrowse, :int ], :track
|
351
372
|
attach_function :albumbrowse_review, :sp_albumbrowse_review, [ :albumbrowse ], :string
|
373
|
+
attach_function :albumbrowse_backend_request_duration, :sp_albumbrowse_backend_request_duration, [ :albumbrowse ], :int
|
352
374
|
|
353
375
|
attach_function :albumbrowse_add_ref, :sp_albumbrowse_add_ref, [ :albumbrowse ], :void
|
354
376
|
attach_function :albumbrowse_release, :sp_albumbrowse_release, [ :albumbrowse ], :void
|
@@ -361,6 +383,7 @@ module Spotify
|
|
361
383
|
#
|
362
384
|
attach_function :artist_name, :sp_artist_name, [ :artist ], :string
|
363
385
|
attach_function :artist_is_loaded, :sp_artist_is_loaded, [ :artist ], :bool
|
386
|
+
attach_function :artist_portrait, :sp_artist_portrait, [ :artist ], :image_id
|
364
387
|
|
365
388
|
attach_function :artist_add_ref, :sp_artist_add_ref, [ :artist ], :void
|
366
389
|
attach_function :artist_release, :sp_artist_release, [ :artist ], :void
|
@@ -370,9 +393,11 @@ module Spotify
|
|
370
393
|
#
|
371
394
|
# @see http://developer.spotify.com/en/libspotify/docs/group__artistbrowse.html
|
372
395
|
|
396
|
+
enum :artistbrowse_type, [:full, :no_tracks, :no_albums]
|
397
|
+
|
373
398
|
#
|
374
399
|
callback :artistbrowse_complete_cb, [:artistbrowse, :userdata], :void
|
375
|
-
attach_function :artistbrowse_create, :sp_artistbrowse_create, [ :session, :artist, :artistbrowse_complete_cb, :userdata ], :artistbrowse
|
400
|
+
attach_function :artistbrowse_create, :sp_artistbrowse_create, [ :session, :artist, :artistbrowse_type, :artistbrowse_complete_cb, :userdata ], :artistbrowse
|
376
401
|
attach_function :artistbrowse_is_loaded, :sp_artistbrowse_is_loaded, [ :artistbrowse ], :bool
|
377
402
|
attach_function :artistbrowse_error, :sp_artistbrowse_error, [ :artistbrowse ], :error
|
378
403
|
attach_function :artistbrowse_artist, :sp_artistbrowse_artist, [ :artistbrowse ], :artist
|
@@ -385,6 +410,7 @@ module Spotify
|
|
385
410
|
attach_function :artistbrowse_num_similar_artists, :sp_artistbrowse_num_similar_artists, [ :artistbrowse ], :int
|
386
411
|
attach_function :artistbrowse_similar_artist, :sp_artistbrowse_similar_artist, [ :artistbrowse, :int ], :artist
|
387
412
|
attach_function :artistbrowse_biography, :sp_artistbrowse_biography, [ :artistbrowse ], :string
|
413
|
+
attach_function :artistbrowse_backend_request_duration, :sp_artistbrowse_backend_request_duration, [ :artistbrowse ], :int
|
388
414
|
|
389
415
|
attach_function :artistbrowse_add_ref, :sp_artistbrowse_add_ref, [ :artistbrowse ], :void
|
390
416
|
attach_function :artistbrowse_release, :sp_artistbrowse_release, [ :artistbrowse ], :void
|
@@ -600,9 +626,6 @@ module Spotify
|
|
600
626
|
attach_function :user_canonical_name, :sp_user_canonical_name, [ :user ], :string
|
601
627
|
attach_function :user_display_name, :sp_user_display_name, [ :user ], :string
|
602
628
|
attach_function :user_is_loaded, :sp_user_is_loaded, [ :user ], :bool
|
603
|
-
attach_function :user_full_name, :sp_user_full_name, [ :user ], :string
|
604
|
-
attach_function :user_picture, :sp_user_picture, [ :user ], :string
|
605
|
-
attach_function :user_relation_type, :sp_user_relation_type, [ :session, :user ], :relation_type
|
606
629
|
|
607
630
|
attach_function :user_add_ref, :sp_user_add_ref, [ :user ], :void
|
608
631
|
attach_function :user_release, :sp_user_release, [ :user ], :void
|
@@ -626,6 +649,7 @@ module Spotify
|
|
626
649
|
attach_function :toplistbrowse_album, :sp_toplistbrowse_album, [ :toplistbrowse, :int ], :album
|
627
650
|
attach_function :toplistbrowse_num_tracks, :sp_toplistbrowse_num_tracks, [ :toplistbrowse ], :int
|
628
651
|
attach_function :toplistbrowse_track, :sp_toplistbrowse_track, [ :toplistbrowse, :int ], :track
|
652
|
+
attach_function :toplistbrowse_backend_request_duration, :sp_toplistbrowse_backend_request_duration, [ :toplistbrowse ], :int
|
629
653
|
|
630
654
|
attach_function :toplistbrowse_add_ref, :sp_toplistbrowse_add_ref, [ :toplistbrowse ], :void
|
631
655
|
attach_function :toplistbrowse_release, :sp_toplistbrowse_release, [ :toplistbrowse ], :void
|
data/lib/spotify/version.rb
CHANGED
data/spec/api.h
CHANGED
@@ -43,6 +43,8 @@ extern "C" {
|
|
43
43
|
/* Includes */
|
44
44
|
#include <stddef.h>
|
45
45
|
|
46
|
+
//endif
|
47
|
+
|
46
48
|
#ifdef _WIN32
|
47
49
|
typedef unsigned __int64 sp_uint64;
|
48
50
|
#else
|
@@ -116,6 +118,17 @@ typedef enum sp_error {
|
|
116
118
|
SP_ERROR_NO_CACHE = 21, ///< Cache is not enabled
|
117
119
|
SP_ERROR_NO_SUCH_USER = 22, ///< Requested user does not exist
|
118
120
|
SP_ERROR_NO_CREDENTIALS = 23, ///< No credentials are stored
|
121
|
+
SP_ERROR_NETWORK_DISABLED = 24, ///< Network disabled
|
122
|
+
SP_ERROR_INVALID_DEVICE_ID = 25, ///< Invalid device ID
|
123
|
+
SP_ERROR_CANT_OPEN_TRACE_FILE = 26, ///< Unable to open trace file
|
124
|
+
SP_ERROR_APPLICATION_BANNED = 27, ///< This application is no longer allowed to use the Spotify service
|
125
|
+
//endif
|
126
|
+
SP_ERROR_OFFLINE_TOO_MANY_TRACKS = 31, ///< Reached the device limit for number of tracks to download
|
127
|
+
SP_ERROR_OFFLINE_DISK_CACHE = 32, ///< Disk cache is full so no more tracks can be downloaded to offline mode
|
128
|
+
SP_ERROR_OFFLINE_EXPIRED = 33, ///< Offline key has expired, the user needs to go online again
|
129
|
+
SP_ERROR_OFFLINE_NOT_ALLOWED = 34, ///< This user is not allowed to use offline mode
|
130
|
+
SP_ERROR_OFFLINE_LICENSE_LOST = 35, ///< The license for this device has been lost. Most likely because the user used offline on three other device
|
131
|
+
SP_ERROR_OFFLINE_LICENSE_ERROR = 36, ///< The Spotify license server does not respond correctly
|
119
132
|
} sp_error;
|
120
133
|
|
121
134
|
/**
|
@@ -147,7 +160,7 @@ SP_LIBEXPORT(const char*) sp_error_message(sp_error error);
|
|
147
160
|
* returned from sp_session_create(). Future versions of the library will provide you with some kind of mechanism
|
148
161
|
* to request an updated version of the library.
|
149
162
|
*/
|
150
|
-
#define SPOTIFY_API_VERSION
|
163
|
+
#define SPOTIFY_API_VERSION 10
|
151
164
|
|
152
165
|
/**
|
153
166
|
* Describes the current state of the connection
|
@@ -206,6 +219,30 @@ typedef enum sp_playlist_offline_status {
|
|
206
219
|
SP_PLAYLIST_OFFLINE_STATUS_WAITING = 3, ///< Playlist is queued for download
|
207
220
|
} sp_playlist_offline_status;
|
208
221
|
|
222
|
+
/**
|
223
|
+
* Track availability
|
224
|
+
*/
|
225
|
+
typedef enum sp_availability {
|
226
|
+
SP_TRACK_AVAILABILITY_UNAVAILABLE = 0, ///< Track is not available
|
227
|
+
SP_TRACK_AVAILABILITY_AVAILABLE = 1, ///< Track is available and can be played
|
228
|
+
SP_TRACK_AVAILABILITY_NOT_STREAMABLE = 2, ///< Track can not be streamed using this account
|
229
|
+
SP_TRACK_AVAILABILITY_BANNED_BY_ARTIST = 3, ///< Track not available on artist's reqeust
|
230
|
+
} sp_track_availability;
|
231
|
+
|
232
|
+
/**
|
233
|
+
* Track offline status
|
234
|
+
*/
|
235
|
+
typedef enum sp_track_offline_status {
|
236
|
+
SP_TRACK_OFFLINE_NO = 0, ///< Not marked for offline
|
237
|
+
SP_TRACK_OFFLINE_WAITING = 1, ///< Waiting for download
|
238
|
+
SP_TRACK_OFFLINE_DOWNLOADING = 2, ///< Currently downloading
|
239
|
+
SP_TRACK_OFFLINE_DONE = 3, ///< Downloaded OK and can be played
|
240
|
+
SP_TRACK_OFFLINE_ERROR = 4, ///< Error during download
|
241
|
+
SP_TRACK_OFFLINE_DONE_EXPIRED = 5, ///< Downloaded OK but not playable due to expiery
|
242
|
+
SP_TRACK_OFFLINE_LIMIT_EXCEEDED = 6, ///< Waiting because device have reached max number of allowed tracks
|
243
|
+
SP_TRACK_OFFLINE_DONE_RESYNC = 7, ///< Downloaded OK and available but scheduled for re-download
|
244
|
+
} sp_track_offline_status;
|
245
|
+
|
209
246
|
/**
|
210
247
|
* Buffer stats used by get_audio_buffer_stats callback
|
211
248
|
*/
|
@@ -249,6 +286,23 @@ typedef enum sp_connection_rules {
|
|
249
286
|
} sp_connection_rules;
|
250
287
|
|
251
288
|
|
289
|
+
/**
|
290
|
+
* Controls the type of data that will be included in artist browse queries
|
291
|
+
*/
|
292
|
+
typedef enum sp_artistbrowse_type {
|
293
|
+
SP_ARTISTBROWSE_FULL, /**< All information */
|
294
|
+
SP_ARTISTBROWSE_NO_TRACKS, /**< Only albums and data about them, no tracks.
|
295
|
+
In other words, sp_artistbrowse_num_tracks() will return 0
|
296
|
+
*/
|
297
|
+
SP_ARTISTBROWSE_NO_ALBUMS, /**< Only return data about the artist (artist name, similar artist
|
298
|
+
biography, etc
|
299
|
+
No tracks or album will be abailable.
|
300
|
+
sp_artistbrowse_num_tracks() and sp_artistbrowse_num_albums()
|
301
|
+
will both return 0
|
302
|
+
*/
|
303
|
+
} sp_artistbrowse_type;
|
304
|
+
|
305
|
+
|
252
306
|
/**
|
253
307
|
* Offline sync status
|
254
308
|
*/
|
@@ -294,8 +348,6 @@ typedef struct sp_offline_sync_status {
|
|
294
348
|
} sp_offline_sync_status;
|
295
349
|
|
296
350
|
|
297
|
-
|
298
|
-
|
299
351
|
/**
|
300
352
|
* Session callbacks
|
301
353
|
*
|
@@ -496,6 +548,16 @@ typedef struct sp_session_callbacks {
|
|
496
548
|
*/
|
497
549
|
void (SP_CALLCONV *offline_status_updated)(sp_session *session);
|
498
550
|
|
551
|
+
/**
|
552
|
+
* Called when offline synchronization status is updated
|
553
|
+
*
|
554
|
+
* @param[in] session Session
|
555
|
+
* @param[in] error Offline error. Will be SP_ERROR_OK if the offline synchronization
|
556
|
+
* error state has cleared
|
557
|
+
*/
|
558
|
+
void (SP_CALLCONV *offline_error)(sp_session *session, sp_error error);
|
559
|
+
|
560
|
+
//endif
|
499
561
|
} sp_session_callbacks;
|
500
562
|
|
501
563
|
/**
|
@@ -539,6 +601,17 @@ typedef struct sp_session_config {
|
|
539
601
|
* See sp_playlist_is_in_ram() for more details.
|
540
602
|
*/
|
541
603
|
bool initially_unload_playlists;
|
604
|
+
|
605
|
+
/**
|
606
|
+
* Device ID for offline synchronization
|
607
|
+
*/
|
608
|
+
const char *device_id;
|
609
|
+
|
610
|
+
/**
|
611
|
+
* Path to API trace file
|
612
|
+
*/
|
613
|
+
const char *tracefile;
|
614
|
+
|
542
615
|
} sp_session_config;
|
543
616
|
|
544
617
|
/**
|
@@ -560,6 +633,7 @@ typedef struct sp_session_config {
|
|
560
633
|
* SP_ERROR_BAD_USER_AGENT
|
561
634
|
* SP_ERROR_BAD_APPLICATION_KEY
|
562
635
|
* SP_ERROR_API_INITIALIZATION_FAILED
|
636
|
+
* SP_ERROR_INVALID_DEVICE_ID
|
563
637
|
*/
|
564
638
|
SP_LIBEXPORT(sp_error) sp_session_create(const sp_session_config *config, sp_session **sess);
|
565
639
|
|
@@ -583,11 +657,10 @@ SP_LIBEXPORT(void) sp_session_release(sp_session *sess);
|
|
583
657
|
* @skip sp_session_login
|
584
658
|
* @until }
|
585
659
|
*
|
586
|
-
* @param[in] session
|
587
|
-
* @param[in] username
|
588
|
-
* @param[in] password
|
589
|
-
* @param[in] remember_me
|
590
|
-
*
|
660
|
+
* @param[in] session Your session object
|
661
|
+
* @param[in] username The username to log in
|
662
|
+
* @param[in] password The password for the specified username
|
663
|
+
* @param[in] remember_me If set, the username / password will be remembered by libspotify
|
591
664
|
*/
|
592
665
|
SP_LIBEXPORT(void) sp_session_login(sp_session *session, const char *username, const char *password, bool remember_me);
|
593
666
|
|
@@ -831,26 +904,26 @@ SP_LIBEXPORT(void) sp_session_preferred_offline_bitrate(sp_session *session, sp_
|
|
831
904
|
|
832
905
|
|
833
906
|
/**
|
834
|
-
* Return
|
907
|
+
* Return status of volume normalization
|
835
908
|
*
|
836
909
|
* @param[in] session Session object
|
910
|
+
*
|
911
|
+
* @return true iff volume normalization is enabled
|
837
912
|
*
|
838
|
-
* @return Number of users in friends. Each user can be extracted using the sp_session_friend() method
|
839
|
-
* The number of users in the list will not be updated nor change order between calls to
|
840
|
-
* sp_session_process_events()
|
841
913
|
*/
|
842
|
-
SP_LIBEXPORT(
|
914
|
+
SP_LIBEXPORT(bool) sp_session_get_volume_normalization(sp_session *session);
|
915
|
+
|
843
916
|
|
844
917
|
/**
|
845
|
-
*
|
918
|
+
* Set volume normalization
|
846
919
|
*
|
847
920
|
* @param[in] session Session object
|
848
|
-
* @param[in]
|
921
|
+
* @param[in] on True iff volume normalization should be enabled
|
849
922
|
*
|
850
|
-
* @return A user. The object is owned by the session so the caller should not release it.
|
851
923
|
*/
|
852
|
-
SP_LIBEXPORT(
|
924
|
+
SP_LIBEXPORT(void) sp_session_set_volume_normalization(sp_session *session, bool on);
|
853
925
|
|
926
|
+
//endif
|
854
927
|
|
855
928
|
/**
|
856
929
|
* Set to true if the connection is currently routed over a roamed connectivity
|
@@ -932,7 +1005,6 @@ SP_LIBEXPORT(int) sp_offline_time_left(sp_session *session);
|
|
932
1005
|
SP_LIBEXPORT(int) sp_session_user_country(sp_session *session);
|
933
1006
|
|
934
1007
|
|
935
|
-
|
936
1008
|
/** @} */
|
937
1009
|
|
938
1010
|
|
@@ -1232,18 +1304,30 @@ SP_LIBEXPORT(bool) sp_track_is_loaded(sp_track *track);
|
|
1232
1304
|
*/
|
1233
1305
|
SP_LIBEXPORT(sp_error) sp_track_error(sp_track *track);
|
1234
1306
|
|
1307
|
+
|
1308
|
+
/**
|
1309
|
+
* Return offline status for a track. sp_session_callbacks::metadata_updated() will be invoked when
|
1310
|
+
* offline status of a track changes
|
1311
|
+
*
|
1312
|
+
* @param[in] track The track
|
1313
|
+
*
|
1314
|
+
* @return Stats as described by ::sp_track_offline_status
|
1315
|
+
*
|
1316
|
+
*/
|
1317
|
+
SP_LIBEXPORT(sp_track_offline_status) sp_track_offline_get_status(sp_track *track);
|
1318
|
+
|
1235
1319
|
/**
|
1236
|
-
* Return
|
1320
|
+
* Return availability for a track
|
1237
1321
|
*
|
1238
1322
|
* @param[in] session Session
|
1239
1323
|
* @param[in] track The track
|
1240
1324
|
*
|
1241
|
-
* @return
|
1325
|
+
* @return Availability status, see ::sp_track_availability
|
1242
1326
|
*
|
1243
|
-
* @note The track must be loaded or this function will always
|
1327
|
+
* @note The track must be loaded or this function will always SP_TRACK_AVAILABILITY_UNAVAILABLE
|
1244
1328
|
* @see sp_track_is_loaded()
|
1245
1329
|
*/
|
1246
|
-
SP_LIBEXPORT(
|
1330
|
+
SP_LIBEXPORT(sp_track_availability) sp_track_get_availability(sp_session *session, sp_track *track);
|
1247
1331
|
|
1248
1332
|
/**
|
1249
1333
|
* Return true if the track is a local file.
|
@@ -1271,6 +1355,24 @@ SP_LIBEXPORT(bool) sp_track_is_local(sp_session *session, sp_track *track);
|
|
1271
1355
|
*/
|
1272
1356
|
SP_LIBEXPORT(bool) sp_track_is_autolinked(sp_session *session, sp_track *track);
|
1273
1357
|
|
1358
|
+
/**
|
1359
|
+
* Return true if the track is a placeholder. Placeholder tracks are used
|
1360
|
+
* to store other objects than tracks in the playlist. Currently this is
|
1361
|
+
* used in the inbox to store artists, albums and playlists.
|
1362
|
+
*
|
1363
|
+
* Use sp_link_create_from_track() to get a link object that points
|
1364
|
+
* to the real object this "track" points to.
|
1365
|
+
*
|
1366
|
+
* @param[in] track The track
|
1367
|
+
*
|
1368
|
+
* @return True if track is a placeholder
|
1369
|
+
*
|
1370
|
+
* @note Contrary to most functions the track does not have to be
|
1371
|
+
* loaded for this function to return correct value
|
1372
|
+
*/
|
1373
|
+
SP_LIBEXPORT(bool) sp_track_is_placeholder(sp_track *track);
|
1374
|
+
|
1375
|
+
|
1274
1376
|
/**
|
1275
1377
|
* Return true if the track is starred by the currently logged in user.
|
1276
1378
|
*
|
@@ -1544,6 +1646,17 @@ SP_LIBEXPORT(const char *) sp_artist_name(sp_artist *artist);
|
|
1544
1646
|
*/
|
1545
1647
|
SP_LIBEXPORT(bool) sp_artist_is_loaded(sp_artist *artist);
|
1546
1648
|
|
1649
|
+
/**
|
1650
|
+
* Return portrait for artist
|
1651
|
+
*
|
1652
|
+
* @param[in] artist The artist object
|
1653
|
+
*
|
1654
|
+
* @return ID byte sequence that can be passed to sp_image_create()
|
1655
|
+
* If the album has no image or the metadata for the album is not
|
1656
|
+
* loaded yet, this function returns NULL.
|
1657
|
+
*
|
1658
|
+
*/
|
1659
|
+
SP_LIBEXPORT(const byte *) sp_artist_portrait(sp_artist *artist);
|
1547
1660
|
|
1548
1661
|
/**
|
1549
1662
|
* Increase the reference count of a artist
|
@@ -1693,6 +1806,16 @@ SP_LIBEXPORT(sp_track *) sp_albumbrowse_track(sp_albumbrowse *alb, int index);
|
|
1693
1806
|
*/
|
1694
1807
|
SP_LIBEXPORT(const char *) sp_albumbrowse_review(sp_albumbrowse *alb);
|
1695
1808
|
|
1809
|
+
/**
|
1810
|
+
* Return the time (in ms) that was spent waiting for the Spotify backend to serve the request
|
1811
|
+
*
|
1812
|
+
* @param[in] alb Album browse object
|
1813
|
+
*
|
1814
|
+
* @return -1 if the request was served from the local cache
|
1815
|
+
* If the result is not yet loaded the return value is undefined
|
1816
|
+
*/
|
1817
|
+
SP_LIBEXPORT(int) sp_albumbrowse_backend_request_duration(sp_albumbrowse *alb);
|
1818
|
+
|
1696
1819
|
|
1697
1820
|
/**
|
1698
1821
|
* Increase the reference count of an album browse result
|
@@ -1742,6 +1865,7 @@ typedef void SP_CALLCONV artistbrowse_complete_cb(sp_artistbrowse *result, void
|
|
1742
1865
|
*
|
1743
1866
|
* @param[in] session Session object
|
1744
1867
|
* @param[in] artist Artist to be browsed. The artist metadata does not have to be loaded
|
1868
|
+
* @param[in] type Type of data requested, see the sp_artistbrowse_type enum for details
|
1745
1869
|
* @param[in] callback Callback to be invoked when browsing has been completed. Pass NULL if you are not interested in this event.
|
1746
1870
|
* @param[in] userdata Userdata passed to callback.
|
1747
1871
|
*
|
@@ -1749,7 +1873,7 @@ typedef void SP_CALLCONV artistbrowse_complete_cb(sp_artistbrowse *result, void
|
|
1749
1873
|
*
|
1750
1874
|
* @see ::artistbrowse_complete_cb
|
1751
1875
|
*/
|
1752
|
-
SP_LIBEXPORT(sp_artistbrowse *) sp_artistbrowse_create(sp_session *session, sp_artist *artist, artistbrowse_complete_cb *callback, void *userdata);
|
1876
|
+
SP_LIBEXPORT(sp_artistbrowse *) sp_artistbrowse_create(sp_session *session, sp_artist *artist, sp_artistbrowse_type type, artistbrowse_complete_cb *callback, void *userdata);
|
1753
1877
|
|
1754
1878
|
/**
|
1755
1879
|
* Check if an artist browse request is completed
|
@@ -1878,6 +2002,16 @@ SP_LIBEXPORT(sp_artist *) sp_artistbrowse_similar_artist(sp_artistbrowse *arb, i
|
|
1878
2002
|
*/
|
1879
2003
|
SP_LIBEXPORT(const char *) sp_artistbrowse_biography(sp_artistbrowse *arb);
|
1880
2004
|
|
2005
|
+
/**
|
2006
|
+
* Return the time (in ms) that was spent waiting for the Spotify backend to serve the request
|
2007
|
+
*
|
2008
|
+
* @param[in] arb Artist browse object
|
2009
|
+
*
|
2010
|
+
* @return -1 if the request was served from the local cache
|
2011
|
+
* If the result is not yet loaded the return value is undefined
|
2012
|
+
*/
|
2013
|
+
SP_LIBEXPORT(int) sp_artistbrowse_backend_request_duration(sp_artistbrowse *arb);
|
2014
|
+
|
1881
2015
|
|
1882
2016
|
/**
|
1883
2017
|
* Increase the reference count of an artist browse result
|
@@ -3141,33 +3275,7 @@ SP_LIBEXPORT(const char *) sp_user_display_name(sp_user *user);
|
|
3141
3275
|
*/
|
3142
3276
|
SP_LIBEXPORT(bool) sp_user_is_loaded(sp_user *user);
|
3143
3277
|
|
3144
|
-
|
3145
|
-
* Get a pointer to a string representing the user's full name as returned from social networks.
|
3146
|
-
*
|
3147
|
-
* @param[in] user The Spotify user whose displayable username you would like a string representation of
|
3148
|
-
*
|
3149
|
-
* @return A string, NULL if the full name is not known.
|
3150
|
-
*/
|
3151
|
-
SP_LIBEXPORT(const char *) sp_user_full_name(sp_user *user);
|
3152
|
-
|
3153
|
-
/**
|
3154
|
-
* Get a pointer to an URL for an picture representing the user
|
3155
|
-
*
|
3156
|
-
* @param[in] user The Spotify user whose displayable username you would like a string representation of
|
3157
|
-
*
|
3158
|
-
* @return A string, NULL if the URL is not known.
|
3159
|
-
*/
|
3160
|
-
SP_LIBEXPORT(const char *) sp_user_picture(sp_user *user);
|
3161
|
-
|
3162
|
-
/**
|
3163
|
-
* Get relation type for a given user
|
3164
|
-
*
|
3165
|
-
* @param[in] session Session
|
3166
|
-
* @param[in] user The Spotify user you want to query relation type for
|
3167
|
-
*
|
3168
|
-
* @return ::sp_relation_type
|
3169
|
-
*/
|
3170
|
-
SP_LIBEXPORT(sp_relation_type) sp_user_relation_type(sp_session *session, sp_user *user);
|
3278
|
+
//endif
|
3171
3279
|
|
3172
3280
|
/**
|
3173
3281
|
* Increase the reference count of an user
|
@@ -3350,6 +3458,16 @@ SP_LIBEXPORT(int) sp_toplistbrowse_num_tracks(sp_toplistbrowse *tlb);
|
|
3350
3458
|
*/
|
3351
3459
|
SP_LIBEXPORT(sp_track *) sp_toplistbrowse_track(sp_toplistbrowse *tlb, int index);
|
3352
3460
|
|
3461
|
+
/**
|
3462
|
+
* Return the time (in ms) that was spent waiting for the Spotify backend to serve the request
|
3463
|
+
*
|
3464
|
+
* @param[in] tlb Toplist object
|
3465
|
+
*
|
3466
|
+
* @return -1 if the request was served from the local cache
|
3467
|
+
* If the result is not yet loaded the return value is undefined
|
3468
|
+
*/
|
3469
|
+
SP_LIBEXPORT(int) sp_toplistbrowse_backend_request_duration(sp_toplistbrowse *tlb);
|
3470
|
+
|
3353
3471
|
|
3354
3472
|
/** @} */
|
3355
3473
|
|
@@ -3426,6 +3544,7 @@ SP_LIBEXPORT(void) sp_inbox_release(sp_inbox *inbox);
|
|
3426
3544
|
*/
|
3427
3545
|
SP_LIBEXPORT(const char *) sp_build_id(void);
|
3428
3546
|
|
3547
|
+
//endif
|
3429
3548
|
|
3430
3549
|
#ifdef __cplusplus
|
3431
3550
|
}
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spotify
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 10.0.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2011-
|
12
|
+
date: 2011-11-01 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: ffi
|
16
|
-
requirement: &
|
16
|
+
requirement: &2160952820 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '1.0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *2160952820
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: yard
|
27
|
-
requirement: &
|
27
|
+
requirement: &2160952400 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :development
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *2160952400
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: rbgccxml
|
38
|
-
requirement: &
|
38
|
+
requirement: &2160951940 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: '0'
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *2160951940
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: gccxml_gem
|
49
|
-
requirement: &
|
49
|
+
requirement: &2160951440 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ! '!='
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: 0.9.3
|
55
55
|
type: :development
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *2160951440
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: minitest
|
60
|
-
requirement: &
|
60
|
+
requirement: &2160950940 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ~>
|
@@ -65,10 +65,10 @@ dependencies:
|
|
65
65
|
version: '2.0'
|
66
66
|
type: :development
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *2160950940
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: bundler
|
71
|
-
requirement: &
|
71
|
+
requirement: &2160950480 !ruby/object:Gem::Requirement
|
72
72
|
none: false
|
73
73
|
requirements:
|
74
74
|
- - ~>
|
@@ -76,7 +76,7 @@ dependencies:
|
|
76
76
|
version: '1.0'
|
77
77
|
type: :development
|
78
78
|
prerelease: false
|
79
|
-
version_requirements: *
|
79
|
+
version_requirements: *2160950480
|
80
80
|
description:
|
81
81
|
email:
|
82
82
|
- kim@burgestrand.se
|
@@ -125,3 +125,4 @@ summary: Bare-bones Ruby bindings for libspotify
|
|
125
125
|
test_files:
|
126
126
|
- spec/api.h
|
127
127
|
- spec/spotify_spec.rb
|
128
|
+
has_rdoc:
|