spotify 11.0.2 → 12.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/spotify.rb +123 -98
- data/lib/spotify/version.rb +1 -1
- data/spec/api.h +323 -71
- data/spec/spotify_spec.rb +1 -1
- metadata +47 -13
data/lib/spotify.rb
CHANGED
@@ -109,6 +109,8 @@ module Spotify
|
|
109
109
|
typedef :pointer, :userdata
|
110
110
|
typedef :pointer, :array
|
111
111
|
|
112
|
+
typedef :pointer, :string_pointer
|
113
|
+
|
112
114
|
typedef UTF8String, :utf8_string
|
113
115
|
typedef ImageID, :image_id
|
114
116
|
|
@@ -118,24 +120,25 @@ module Spotify
|
|
118
120
|
# @see http://developer.spotify.com/en/libspotify/docs/group__error.html
|
119
121
|
|
120
122
|
#
|
121
|
-
enum :error, [:ok,
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
123
|
+
enum :error, [:ok, 0,
|
124
|
+
:bad_api_version, :api_initialization_failed, :track_not_playable,
|
125
|
+
|
126
|
+
:bad_application_key, 5,
|
127
|
+
:bad_username_or_password, :user_banned,
|
128
|
+
:unable_to_contact_server, :client_too_old, :other_permanent,
|
129
|
+
:bad_user_agent, :missing_callback, :invalid_indata,
|
130
|
+
:index_out_of_range, :user_needs_premium, :other_transient,
|
131
|
+
:is_loading, :no_stream_available, :permission_denied,
|
132
|
+
:inbox_is_full, :no_cache, :no_such_user, :no_credentials,
|
133
|
+
:network_disabled, :invalid_device_id, :cant_open_trace_file,
|
134
|
+
:application_banned,
|
131
135
|
|
132
|
-
|
133
|
-
|
136
|
+
:offline_too_many_tracks, 31,
|
137
|
+
:offline_disk_cache, :offline_expired, :offline_not_allowed,
|
138
|
+
:offline_license_lost, :offline_license_error,
|
134
139
|
|
135
|
-
|
136
|
-
|
137
|
-
:offline_not_allowed, :offline_license_lost,
|
138
|
-
:offline_license_error]
|
140
|
+
:lastfm_auth_error, 39,
|
141
|
+
:invalid_argument, :system_failure]
|
139
142
|
|
140
143
|
# @macro [attach] attach_function
|
141
144
|
#
|
@@ -221,7 +224,10 @@ module Spotify
|
|
221
224
|
:get_audio_buffer_stats, callback([ :session, AudioBufferStats ], :void),
|
222
225
|
:offline_status_updated, callback([ :session ], :void),
|
223
226
|
:offline_error, callback([ :session, :error ], :void),
|
224
|
-
:credentials_blob_updated, callback([ :session, :string ], :void)
|
227
|
+
:credentials_blob_updated, callback([ :session, :string ], :void),
|
228
|
+
:connectionstate_updated, callback([ :session ], :void),
|
229
|
+
:scrobble_error, callback([ :session, :error ], :void),
|
230
|
+
:private_session_mode_changed, callback([ :session, :bool ], :void)
|
225
231
|
end
|
226
232
|
|
227
233
|
# FFI::Struct for Session configuration.
|
@@ -237,18 +243,21 @@ module Spotify
|
|
237
243
|
# @attr [Fixnum] initially_unload_playlists
|
238
244
|
class SessionConfig < FFI::Struct
|
239
245
|
layout :api_version, :int,
|
240
|
-
:cache_location, :
|
241
|
-
:settings_location, :
|
246
|
+
:cache_location, :string_pointer,
|
247
|
+
:settings_location, :string_pointer,
|
242
248
|
:application_key, :pointer,
|
243
249
|
:application_key_size, :size_t,
|
244
|
-
:user_agent, :
|
250
|
+
:user_agent, :string_pointer,
|
245
251
|
:callbacks, SessionCallbacks.by_ref,
|
246
252
|
:userdata, :userdata,
|
247
253
|
:compress_playlists, :bool,
|
248
254
|
:dont_save_metadata_for_playlists, :bool,
|
249
255
|
:initially_unload_playlists, :bool,
|
250
|
-
:device_id, :
|
251
|
-
:
|
256
|
+
:device_id, :string_pointer,
|
257
|
+
:proxy, :string_pointer,
|
258
|
+
:proxy_username, :string_pointer,
|
259
|
+
:proxy_password, :string_pointer,
|
260
|
+
:tracefile, :string_pointer
|
252
261
|
end
|
253
262
|
|
254
263
|
# FFI::Struct for Offline Sync Status
|
@@ -274,6 +283,12 @@ module Spotify
|
|
274
283
|
:syncing, :bool
|
275
284
|
end
|
276
285
|
|
286
|
+
#
|
287
|
+
enum :social_provider, [:spotify, :facebook, :lastfm]
|
288
|
+
|
289
|
+
#
|
290
|
+
enum :scrobbling_state, [:use_global_setting, :local_enabled, :local_disabled, :global_enabled, :global_disabled]
|
291
|
+
|
277
292
|
#
|
278
293
|
enum :connectionstate, [:logged_out, :logged_in, :disconnected, :undefined, :offline]
|
279
294
|
|
@@ -287,33 +302,33 @@ module Spotify
|
|
287
302
|
:allow_sync_over_wifi , 0x8]
|
288
303
|
|
289
304
|
attach_function :session_create, :sp_session_create, [ SessionConfig, :buffer_out ], :error
|
290
|
-
attach_function :session_release, :sp_session_release, [ :session ], :
|
305
|
+
attach_function :session_release, :sp_session_release, [ :session ], :error
|
291
306
|
|
292
|
-
attach_function :session_process_events, :sp_session_process_events, [ :session, :buffer_out ], :
|
293
|
-
attach_function :session_login, :sp_session_login, [ :session, :utf8_string, :string, :bool, :string ], :
|
307
|
+
attach_function :session_process_events, :sp_session_process_events, [ :session, :buffer_out ], :error
|
308
|
+
attach_function :session_login, :sp_session_login, [ :session, :utf8_string, :string, :bool, :string ], :error
|
294
309
|
attach_function :session_relogin, :sp_session_relogin, [ :session ], :error
|
295
|
-
attach_function :session_forget_me, :sp_session_forget_me, [ :session ], :
|
310
|
+
attach_function :session_forget_me, :sp_session_forget_me, [ :session ], :error
|
296
311
|
attach_function :session_remembered_user, :sp_session_remembered_user, [ :session, :buffer_out, :size_t ], :int
|
297
312
|
|
298
313
|
attach_function :session_user, :sp_session_user, [ :session ], :user
|
299
|
-
attach_function :session_logout, :sp_session_logout, [ :session ], :
|
314
|
+
attach_function :session_logout, :sp_session_logout, [ :session ], :error
|
300
315
|
attach_function :session_connectionstate, :sp_session_connectionstate, [ :session ], :connectionstate
|
301
316
|
attach_function :session_userdata, :sp_session_userdata, [ :session ], :userdata
|
302
|
-
attach_function :session_set_cache_size, :sp_session_set_cache_size, [ :session, :size_t ], :
|
317
|
+
attach_function :session_set_cache_size, :sp_session_set_cache_size, [ :session, :size_t ], :error
|
303
318
|
attach_function :session_player_load, :sp_session_player_load, [ :session, :track ], :error
|
304
|
-
attach_function :session_player_seek, :sp_session_player_seek, [ :session, :int ], :
|
305
|
-
attach_function :session_player_play, :sp_session_player_play, [ :session, :bool ], :
|
306
|
-
attach_function :session_player_unload, :sp_session_player_unload, [ :session ], :
|
319
|
+
attach_function :session_player_seek, :sp_session_player_seek, [ :session, :int ], :error
|
320
|
+
attach_function :session_player_play, :sp_session_player_play, [ :session, :bool ], :error
|
321
|
+
attach_function :session_player_unload, :sp_session_player_unload, [ :session ], :error
|
307
322
|
attach_function :session_player_prefetch, :sp_session_player_prefetch, [ :session, :track ], :error
|
308
323
|
attach_function :session_playlistcontainer, :sp_session_playlistcontainer, [ :session ], :playlistcontainer
|
309
324
|
attach_function :session_inbox_create, :sp_session_inbox_create, [ :session ], :playlist
|
310
325
|
attach_function :session_starred_create, :sp_session_starred_create, [ :session ], :playlist
|
311
326
|
attach_function :session_starred_for_user_create, :sp_session_starred_for_user_create, [ :session, :utf8_string ], :playlist
|
312
327
|
attach_function :session_publishedcontainer_for_user_create, :sp_session_publishedcontainer_for_user_create, [ :playlist, :utf8_string ], :playlistcontainer
|
313
|
-
attach_function :session_preferred_bitrate, :sp_session_preferred_bitrate, [ :session, :bitrate ], :
|
328
|
+
attach_function :session_preferred_bitrate, :sp_session_preferred_bitrate, [ :session, :bitrate ], :error
|
314
329
|
|
315
|
-
attach_function :session_set_connection_type, :sp_session_set_connection_type, [ :session, :connection_type ], :
|
316
|
-
attach_function :session_set_connection_rules, :sp_session_set_connection_rules, [ :session, :connection_rules ], :
|
330
|
+
attach_function :session_set_connection_type, :sp_session_set_connection_type, [ :session, :connection_type ], :error
|
331
|
+
attach_function :session_set_connection_rules, :sp_session_set_connection_rules, [ :session, :connection_rules ], :error
|
317
332
|
|
318
333
|
attach_function :offline_tracks_to_sync, :sp_offline_tracks_to_sync, [ :session ], :int
|
319
334
|
attach_function :offline_num_playlists, :sp_offline_num_playlists, [ :session ], :int
|
@@ -321,12 +336,44 @@ module Spotify
|
|
321
336
|
attach_function :offline_time_left, :sp_offline_time_left, [ :session ], :int
|
322
337
|
|
323
338
|
attach_function :session_user_country, :sp_session_user_country, [ :session ], :int
|
324
|
-
attach_function :session_preferred_offline_bitrate, :sp_session_preferred_offline_bitrate, [ :session, :bitrate, :bool ], :
|
339
|
+
attach_function :session_preferred_offline_bitrate, :sp_session_preferred_offline_bitrate, [ :session, :bitrate, :bool ], :error
|
325
340
|
|
326
|
-
attach_function :session_set_volume_normalization, :sp_session_set_volume_normalization, [ :session, :bool ], :
|
341
|
+
attach_function :session_set_volume_normalization, :sp_session_set_volume_normalization, [ :session, :bool ], :error
|
327
342
|
attach_function :session_get_volume_normalization, :sp_session_get_volume_normalization, [ :session ], :bool
|
328
343
|
|
329
|
-
attach_function :session_flush_caches, :sp_session_flush_caches, [ :session ], :
|
344
|
+
attach_function :session_flush_caches, :sp_session_flush_caches, [ :session ], :error
|
345
|
+
attach_function :session_user_name, :sp_session_user_name, [ :session ], :string
|
346
|
+
|
347
|
+
attach_function :session_set_private_session, :sp_session_set_private_session, [ :session, :bool ], :error
|
348
|
+
attach_function :session_is_private_session, :sp_session_is_private_session, [ :session ], :bool
|
349
|
+
attach_function :session_set_scrobbling, :sp_session_set_scrobbling, [ :session, :social_provider, :scrobbling_state ], :error
|
350
|
+
attach_function :session_is_scrobbling, :sp_session_is_scrobbling, [ :session, :social_provider, :buffer_out ], :error
|
351
|
+
attach_function :session_is_scrobbling_possible, :sp_session_is_scrobbling_possible, [ :session, :social_provider, :buffer_out ], :error
|
352
|
+
attach_function :session_set_social_credentials, :sp_session_set_social_credentials, [ :session, :social_provider, :utf8_string, :string ], :error
|
353
|
+
|
354
|
+
#
|
355
|
+
# Images
|
356
|
+
#
|
357
|
+
# @see http://developer.spotify.com/en/libspotify/docs/group__image.html
|
358
|
+
|
359
|
+
#
|
360
|
+
enum :imageformat, [:unknown, -1, :jpeg]
|
361
|
+
enum :image_size, [ :normal, :small, :large ]
|
362
|
+
|
363
|
+
callback :image_loaded_cb, [ :image, :userdata ], :void
|
364
|
+
attach_function :image_create, :sp_image_create, [ :session, :image_id ], :image
|
365
|
+
attach_function :image_add_load_callback, :sp_image_add_load_callback, [ :image, :image_loaded_cb, :userdata ], :error
|
366
|
+
attach_function :image_remove_load_callback, :sp_image_remove_load_callback, [ :image, :image_loaded_cb, :userdata ], :error
|
367
|
+
attach_function :image_is_loaded, :sp_image_is_loaded, [ :image ], :bool
|
368
|
+
attach_function :image_error, :sp_image_error, [ :image ], :error
|
369
|
+
attach_function :image_format, :sp_image_format, [ :image ], :imageformat
|
370
|
+
attach_function :image_data, :sp_image_data, [ :image, :buffer_out ], :pointer
|
371
|
+
attach_function :image_image_id, :sp_image_image_id, [ :image ], :image_id
|
372
|
+
attach_function :image_create_from_link, :sp_image_create_from_link, [ :session, :link ], :image
|
373
|
+
|
374
|
+
attach_function :image_add_ref, :sp_image_add_ref, [ :image ], :error
|
375
|
+
attach_function :image_release, :sp_image_release, [ :image ], :error
|
376
|
+
|
330
377
|
|
331
378
|
#
|
332
379
|
# Link
|
@@ -343,9 +390,9 @@ module Spotify
|
|
343
390
|
attach_function :link_create_from_artist, :sp_link_create_from_artist, [ :artist ], :link
|
344
391
|
attach_function :link_create_from_search, :sp_link_create_from_search, [ :search ], :link
|
345
392
|
attach_function :link_create_from_playlist, :sp_link_create_from_playlist, [ :playlist ], :link
|
346
|
-
attach_function :link_create_from_artist_portrait, :sp_link_create_from_artist_portrait, [ :artist ], :link
|
393
|
+
attach_function :link_create_from_artist_portrait, :sp_link_create_from_artist_portrait, [ :artist, :image_size ], :link
|
347
394
|
attach_function :link_create_from_artistbrowse_portrait, :sp_link_create_from_artistbrowse_portrait, [ :artistbrowse, :int ], :link
|
348
|
-
attach_function :link_create_from_album_cover, :sp_link_create_from_album_cover, [ :album ], :link
|
395
|
+
attach_function :link_create_from_album_cover, :sp_link_create_from_album_cover, [ :album, :image_size ], :link
|
349
396
|
attach_function :link_create_from_image, :sp_link_create_from_image, [ :image ], :link
|
350
397
|
attach_function :link_create_from_user, :sp_link_create_from_user, [ :user ], :link
|
351
398
|
attach_function :link_as_string, :sp_link_as_string, [ :link, :buffer_out, :int ], :int
|
@@ -356,8 +403,8 @@ module Spotify
|
|
356
403
|
attach_function :link_as_artist, :sp_link_as_artist, [ :link ], :artist
|
357
404
|
attach_function :link_as_user, :sp_link_as_user, [ :link ], :user
|
358
405
|
|
359
|
-
attach_function :link_add_ref, :sp_link_add_ref, [ :link ], :
|
360
|
-
attach_function :link_release, :sp_link_release, [ :link ], :
|
406
|
+
attach_function :link_add_ref, :sp_link_add_ref, [ :link ], :error
|
407
|
+
attach_function :link_release, :sp_link_release, [ :link ], :error
|
361
408
|
|
362
409
|
#
|
363
410
|
# Tracks
|
@@ -376,7 +423,7 @@ module Spotify
|
|
376
423
|
attach_function :track_is_local, :sp_track_is_local, [ :session, :track ], :bool
|
377
424
|
attach_function :track_is_autolinked, :sp_track_is_autolinked, [ :session, :track ], :bool
|
378
425
|
attach_function :track_is_starred, :sp_track_is_starred, [ :session, :track ], :bool
|
379
|
-
attach_function :track_set_starred, :sp_track_set_starred, [ :session, :array, :int, :bool ], :
|
426
|
+
attach_function :track_set_starred, :sp_track_set_starred, [ :session, :array, :int, :bool ], :error
|
380
427
|
attach_function :track_num_artists, :sp_track_num_artists, [ :track ], :int
|
381
428
|
attach_function :track_artist, :sp_track_artist, [ :track, :int ], :artist
|
382
429
|
attach_function :track_album, :sp_track_album, [ :track ], :album
|
@@ -392,8 +439,8 @@ module Spotify
|
|
392
439
|
|
393
440
|
attach_function :localtrack_create, :sp_localtrack_create, [ :utf8_string, :utf8_string, :utf8_string, :int ], :track
|
394
441
|
|
395
|
-
attach_function :track_add_ref, :sp_track_add_ref, [ :track ], :
|
396
|
-
attach_function :track_release, :sp_track_release, [ :track ], :
|
442
|
+
attach_function :track_add_ref, :sp_track_add_ref, [ :track ], :error
|
443
|
+
attach_function :track_release, :sp_track_release, [ :track ], :error
|
397
444
|
|
398
445
|
#
|
399
446
|
# Albums
|
@@ -406,13 +453,13 @@ module Spotify
|
|
406
453
|
attach_function :album_is_loaded, :sp_album_is_loaded, [ :album ], :bool
|
407
454
|
attach_function :album_is_available, :sp_album_is_available, [ :album ], :bool
|
408
455
|
attach_function :album_artist, :sp_album_artist, [ :album ], :artist
|
409
|
-
attach_function :album_cover, :sp_album_cover, [ :album ], :image_id
|
456
|
+
attach_function :album_cover, :sp_album_cover, [ :album, :image_size ], :image_id
|
410
457
|
attach_function :album_name, :sp_album_name, [ :album ], :utf8_string
|
411
458
|
attach_function :album_year, :sp_album_year, [ :album ], :int
|
412
459
|
attach_function :album_type, :sp_album_type, [ :album ], :albumtype
|
413
460
|
|
414
|
-
attach_function :album_add_ref, :sp_album_add_ref, [ :album ], :
|
415
|
-
attach_function :album_release, :sp_album_release, [ :album ], :
|
461
|
+
attach_function :album_add_ref, :sp_album_add_ref, [ :album ], :error
|
462
|
+
attach_function :album_release, :sp_album_release, [ :album ], :error
|
416
463
|
|
417
464
|
#
|
418
465
|
# Album Browser
|
@@ -433,8 +480,8 @@ module Spotify
|
|
433
480
|
attach_function :albumbrowse_review, :sp_albumbrowse_review, [ :albumbrowse ], :utf8_string
|
434
481
|
attach_function :albumbrowse_backend_request_duration, :sp_albumbrowse_backend_request_duration, [ :albumbrowse ], :int
|
435
482
|
|
436
|
-
attach_function :albumbrowse_add_ref, :sp_albumbrowse_add_ref, [ :albumbrowse ], :
|
437
|
-
attach_function :albumbrowse_release, :sp_albumbrowse_release, [ :albumbrowse ], :
|
483
|
+
attach_function :albumbrowse_add_ref, :sp_albumbrowse_add_ref, [ :albumbrowse ], :error
|
484
|
+
attach_function :albumbrowse_release, :sp_albumbrowse_release, [ :albumbrowse ], :error
|
438
485
|
|
439
486
|
#
|
440
487
|
# Artists
|
@@ -444,10 +491,10 @@ module Spotify
|
|
444
491
|
#
|
445
492
|
attach_function :artist_name, :sp_artist_name, [ :artist ], :utf8_string
|
446
493
|
attach_function :artist_is_loaded, :sp_artist_is_loaded, [ :artist ], :bool
|
447
|
-
attach_function :artist_portrait, :sp_artist_portrait, [ :artist ], :image_id
|
494
|
+
attach_function :artist_portrait, :sp_artist_portrait, [ :artist, :image_size ], :image_id
|
448
495
|
|
449
|
-
attach_function :artist_add_ref, :sp_artist_add_ref, [ :artist ], :
|
450
|
-
attach_function :artist_release, :sp_artist_release, [ :artist ], :
|
496
|
+
attach_function :artist_add_ref, :sp_artist_add_ref, [ :artist ], :error
|
497
|
+
attach_function :artist_release, :sp_artist_release, [ :artist ], :error
|
451
498
|
|
452
499
|
#
|
453
500
|
# Artist Browsing
|
@@ -475,30 +522,8 @@ module Spotify
|
|
475
522
|
attach_function :artistbrowse_num_tophit_tracks, :sp_artistbrowse_num_tophit_tracks, [ :artistbrowse ], :int
|
476
523
|
attach_function :artistbrowse_tophit_track, :sp_artistbrowse_tophit_track, [ :artistbrowse, :int ], :track
|
477
524
|
|
478
|
-
attach_function :artistbrowse_add_ref, :sp_artistbrowse_add_ref, [ :artistbrowse ], :
|
479
|
-
attach_function :artistbrowse_release, :sp_artistbrowse_release, [ :artistbrowse ], :
|
480
|
-
|
481
|
-
#
|
482
|
-
# Images
|
483
|
-
#
|
484
|
-
# @see http://developer.spotify.com/en/libspotify/docs/group__image.html
|
485
|
-
|
486
|
-
#
|
487
|
-
enum :imageformat, [:unknown, -1, :jpeg]
|
488
|
-
|
489
|
-
callback :image_loaded_cb, [ :image, :userdata ], :void
|
490
|
-
attach_function :image_create, :sp_image_create, [ :session, :image_id ], :image
|
491
|
-
attach_function :image_add_load_callback, :sp_image_add_load_callback, [ :image, :image_loaded_cb, :userdata ], :void
|
492
|
-
attach_function :image_remove_load_callback, :sp_image_remove_load_callback, [ :image, :image_loaded_cb, :userdata ], :void
|
493
|
-
attach_function :image_is_loaded, :sp_image_is_loaded, [ :image ], :bool
|
494
|
-
attach_function :image_error, :sp_image_error, [ :image ], :error
|
495
|
-
attach_function :image_format, :sp_image_format, [ :image ], :imageformat
|
496
|
-
attach_function :image_data, :sp_image_data, [ :image, :buffer_out ], :pointer
|
497
|
-
attach_function :image_image_id, :sp_image_image_id, [ :image ], :image_id
|
498
|
-
attach_function :image_create_from_link, :sp_image_create_from_link, [ :session, :link ], :image
|
499
|
-
|
500
|
-
attach_function :image_add_ref, :sp_image_add_ref, [ :image ], :void
|
501
|
-
attach_function :image_release, :sp_image_release, [ :image ], :void
|
525
|
+
attach_function :artistbrowse_add_ref, :sp_artistbrowse_add_ref, [ :artistbrowse ], :error
|
526
|
+
attach_function :artistbrowse_release, :sp_artistbrowse_release, [ :artistbrowse ], :error
|
502
527
|
|
503
528
|
#
|
504
529
|
# Searching
|
@@ -528,8 +553,8 @@ module Spotify
|
|
528
553
|
attach_function :search_total_artists, :sp_search_total_artists, [ :search ], :int
|
529
554
|
attach_function :search_total_playlists, :sp_search_total_playlists, [ :search ], :int
|
530
555
|
|
531
|
-
attach_function :search_add_ref, :sp_search_add_ref, [ :search ], :
|
532
|
-
attach_function :search_release, :sp_search_release, [ :search ], :
|
556
|
+
attach_function :search_add_ref, :sp_search_add_ref, [ :search ], :error
|
557
|
+
attach_function :search_release, :sp_search_release, [ :search ], :error
|
533
558
|
|
534
559
|
#
|
535
560
|
# Playlists
|
@@ -596,8 +621,8 @@ module Spotify
|
|
596
621
|
enum :playlist_offline_status, [:no, :yes, :downloading, :waiting]
|
597
622
|
|
598
623
|
attach_function :playlist_is_loaded, :sp_playlist_is_loaded, [ :playlist ], :bool
|
599
|
-
attach_function :playlist_add_callbacks, :sp_playlist_add_callbacks, [ :playlist, PlaylistCallbacks, :userdata ], :
|
600
|
-
attach_function :playlist_remove_callbacks, :sp_playlist_remove_callbacks, [ :playlist, PlaylistCallbacks, :userdata ], :
|
624
|
+
attach_function :playlist_add_callbacks, :sp_playlist_add_callbacks, [ :playlist, PlaylistCallbacks, :userdata ], :error
|
625
|
+
attach_function :playlist_remove_callbacks, :sp_playlist_remove_callbacks, [ :playlist, PlaylistCallbacks, :userdata ], :error
|
601
626
|
attach_function :playlist_num_tracks, :sp_playlist_num_tracks, [ :playlist ], :int
|
602
627
|
attach_function :playlist_track, :sp_playlist_track, [ :playlist, :int ], :track
|
603
628
|
attach_function :playlist_track_create_time, :sp_playlist_track_create_time, [ :playlist, :int ], :int
|
@@ -609,8 +634,8 @@ module Spotify
|
|
609
634
|
attach_function :playlist_rename, :sp_playlist_rename, [ :playlist, :utf8_string ], :error
|
610
635
|
attach_function :playlist_owner, :sp_playlist_owner, [ :playlist ], :user
|
611
636
|
attach_function :playlist_is_collaborative, :sp_playlist_is_collaborative, [ :playlist ], :bool
|
612
|
-
attach_function :playlist_set_collaborative, :sp_playlist_set_collaborative, [ :playlist, :bool ], :
|
613
|
-
attach_function :playlist_set_autolink_tracks, :sp_playlist_set_autolink_tracks, [ :playlist, :bool ], :
|
637
|
+
attach_function :playlist_set_collaborative, :sp_playlist_set_collaborative, [ :playlist, :bool ], :error
|
638
|
+
attach_function :playlist_set_autolink_tracks, :sp_playlist_set_autolink_tracks, [ :playlist, :bool ], :error
|
614
639
|
attach_function :playlist_get_description, :sp_playlist_get_description, [ :playlist ], :utf8_string
|
615
640
|
attach_function :playlist_get_image, :sp_playlist_get_image, [ :playlist, :buffer_out ], :bool
|
616
641
|
attach_function :playlist_has_pending_changes, :sp_playlist_has_pending_changes, [ :playlist ], :bool
|
@@ -619,17 +644,17 @@ module Spotify
|
|
619
644
|
attach_function :playlist_reorder_tracks, :sp_playlist_reorder_tracks, [ :playlist, :array, :int, :int ], :error
|
620
645
|
attach_function :playlist_num_subscribers, :sp_playlist_num_subscribers, [ :playlist ], :uint
|
621
646
|
attach_function :playlist_subscribers, :sp_playlist_subscribers, [ :playlist ], Subscribers
|
622
|
-
attach_function :playlist_subscribers_free, :sp_playlist_subscribers_free, [ Subscribers ], :
|
623
|
-
attach_function :playlist_update_subscribers, :sp_playlist_update_subscribers, [ :session, :playlist ], :
|
647
|
+
attach_function :playlist_subscribers_free, :sp_playlist_subscribers_free, [ Subscribers ], :error
|
648
|
+
attach_function :playlist_update_subscribers, :sp_playlist_update_subscribers, [ :session, :playlist ], :error
|
624
649
|
attach_function :playlist_is_in_ram, :sp_playlist_is_in_ram, [ :session, :playlist ], :bool
|
625
|
-
attach_function :playlist_set_in_ram, :sp_playlist_set_in_ram, [ :session, :playlist, :bool ], :
|
650
|
+
attach_function :playlist_set_in_ram, :sp_playlist_set_in_ram, [ :session, :playlist, :bool ], :error
|
626
651
|
attach_function :playlist_create, :sp_playlist_create, [ :session, :link ], :playlist
|
627
652
|
attach_function :playlist_get_offline_status, :sp_playlist_get_offline_status, [ :session, :playlist ], :playlist_offline_status
|
628
653
|
attach_function :playlist_get_offline_download_completed, :sp_playlist_get_offline_download_completed, [ :session, :playlist ], :int
|
629
|
-
attach_function :playlist_set_offline_mode, :sp_playlist_set_offline_mode, [ :session, :playlist, :bool ], :
|
654
|
+
attach_function :playlist_set_offline_mode, :sp_playlist_set_offline_mode, [ :session, :playlist, :bool ], :error
|
630
655
|
|
631
|
-
attach_function :playlist_add_ref, :sp_playlist_add_ref, [ :playlist ], :
|
632
|
-
attach_function :playlist_release, :sp_playlist_release, [ :playlist ], :
|
656
|
+
attach_function :playlist_add_ref, :sp_playlist_add_ref, [ :playlist ], :error
|
657
|
+
attach_function :playlist_release, :sp_playlist_release, [ :playlist ], :error
|
633
658
|
|
634
659
|
#
|
635
660
|
# Playlist Container
|
@@ -649,8 +674,8 @@ module Spotify
|
|
649
674
|
end
|
650
675
|
|
651
676
|
#
|
652
|
-
attach_function :playlistcontainer_add_callbacks, :sp_playlistcontainer_add_callbacks, [ :playlistcontainer, PlaylistContainerCallbacks, :userdata ], :
|
653
|
-
attach_function :playlistcontainer_remove_callbacks, :sp_playlistcontainer_remove_callbacks, [ :playlistcontainer, PlaylistContainerCallbacks, :userdata ], :
|
677
|
+
attach_function :playlistcontainer_add_callbacks, :sp_playlistcontainer_add_callbacks, [ :playlistcontainer, PlaylistContainerCallbacks, :userdata ], :error
|
678
|
+
attach_function :playlistcontainer_remove_callbacks, :sp_playlistcontainer_remove_callbacks, [ :playlistcontainer, PlaylistContainerCallbacks, :userdata ], :error
|
654
679
|
attach_function :playlistcontainer_num_playlists, :sp_playlistcontainer_num_playlists, [ :playlistcontainer ], :int
|
655
680
|
attach_function :playlistcontainer_playlist, :sp_playlistcontainer_playlist, [ :playlistcontainer, :int ], :playlist
|
656
681
|
attach_function :playlistcontainer_playlist_type, :sp_playlistcontainer_playlist_type, [ :playlistcontainer, :int ], :playlist_type
|
@@ -667,8 +692,8 @@ module Spotify
|
|
667
692
|
attach_function :playlistcontainer_get_unseen_tracks, :sp_playlistcontainer_get_unseen_tracks, [ :playlistcontainer, :playlist, :array, :int ], :int
|
668
693
|
attach_function :playlistcontainer_clear_unseen_tracks, :sp_playlistcontainer_clear_unseen_tracks, [ :playlistcontainer, :playlist ], :int
|
669
694
|
|
670
|
-
attach_function :playlistcontainer_add_ref, :sp_playlistcontainer_add_ref, [ :playlistcontainer ], :
|
671
|
-
attach_function :playlistcontainer_release, :sp_playlistcontainer_release, [ :playlistcontainer ], :
|
695
|
+
attach_function :playlistcontainer_add_ref, :sp_playlistcontainer_add_ref, [ :playlistcontainer ], :error
|
696
|
+
attach_function :playlistcontainer_release, :sp_playlistcontainer_release, [ :playlistcontainer ], :error
|
672
697
|
|
673
698
|
#
|
674
699
|
# User handling
|
@@ -682,8 +707,8 @@ module Spotify
|
|
682
707
|
attach_function :user_display_name, :sp_user_display_name, [ :user ], :utf8_string
|
683
708
|
attach_function :user_is_loaded, :sp_user_is_loaded, [ :user ], :bool
|
684
709
|
|
685
|
-
attach_function :user_add_ref, :sp_user_add_ref, [ :user ], :
|
686
|
-
attach_function :user_release, :sp_user_release, [ :user ], :
|
710
|
+
attach_function :user_add_ref, :sp_user_add_ref, [ :user ], :error
|
711
|
+
attach_function :user_release, :sp_user_release, [ :user ], :error
|
687
712
|
|
688
713
|
#
|
689
714
|
# Toplists
|
@@ -706,8 +731,8 @@ module Spotify
|
|
706
731
|
attach_function :toplistbrowse_track, :sp_toplistbrowse_track, [ :toplistbrowse, :int ], :track
|
707
732
|
attach_function :toplistbrowse_backend_request_duration, :sp_toplistbrowse_backend_request_duration, [ :toplistbrowse ], :int
|
708
733
|
|
709
|
-
attach_function :toplistbrowse_add_ref, :sp_toplistbrowse_add_ref, [ :toplistbrowse ], :
|
710
|
-
attach_function :toplistbrowse_release, :sp_toplistbrowse_release, [ :toplistbrowse ], :
|
734
|
+
attach_function :toplistbrowse_add_ref, :sp_toplistbrowse_add_ref, [ :toplistbrowse ], :error
|
735
|
+
attach_function :toplistbrowse_release, :sp_toplistbrowse_release, [ :toplistbrowse ], :error
|
711
736
|
|
712
737
|
#
|
713
738
|
# Inbox
|
@@ -719,8 +744,8 @@ module Spotify
|
|
719
744
|
attach_function :inbox_post_tracks, :sp_inbox_post_tracks, [ :session, :utf8_string, :array, :int, :utf8_string, :inboxpost_complete_cb, :userdata ], :inbox
|
720
745
|
attach_function :inbox_error, :sp_inbox_error, [ :inbox ], :error
|
721
746
|
|
722
|
-
attach_function :inbox_add_ref, :sp_inbox_add_ref, [ :inbox ], :
|
723
|
-
attach_function :inbox_release, :sp_inbox_release, [ :inbox ], :
|
747
|
+
attach_function :inbox_add_ref, :sp_inbox_add_ref, [ :inbox ], :error
|
748
|
+
attach_function :inbox_release, :sp_inbox_release, [ :inbox ], :error
|
724
749
|
|
725
750
|
# Rescue errors thrown when binding to a method that does not exist. Often
|
726
751
|
# this is because of the user using an old version of libspotify, or a new
|
data/lib/spotify/version.rb
CHANGED
data/spec/api.h
CHANGED
@@ -43,7 +43,6 @@ extern "C" {
|
|
43
43
|
/* Includes */
|
44
44
|
#include <stddef.h>
|
45
45
|
|
46
|
-
|
47
46
|
#ifdef _WIN32
|
48
47
|
typedef unsigned __int64 sp_uint64;
|
49
48
|
#else
|
@@ -127,6 +126,9 @@ typedef enum sp_error {
|
|
127
126
|
SP_ERROR_OFFLINE_NOT_ALLOWED = 34, ///< This user is not allowed to use offline mode
|
128
127
|
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
|
129
128
|
SP_ERROR_OFFLINE_LICENSE_ERROR = 36, ///< The Spotify license server does not respond correctly
|
129
|
+
SP_ERROR_LASTFM_AUTH_ERROR = 39, ///< A LastFM scrobble authentication error has occurred
|
130
|
+
SP_ERROR_INVALID_ARGUMENT = 40, ///< An invalid argument was specified
|
131
|
+
SP_ERROR_SYSTEM_FAILURE = 41, ///< An operating system error
|
130
132
|
} sp_error;
|
131
133
|
|
132
134
|
/**
|
@@ -160,7 +162,7 @@ SP_LIBEXPORT(const char*) sp_error_message(sp_error error);
|
|
160
162
|
* returned from sp_session_create(). Future versions of the library will provide you with some kind of mechanism
|
161
163
|
* to request an updated version of the library.
|
162
164
|
*/
|
163
|
-
#define SPOTIFY_API_VERSION
|
165
|
+
#define SPOTIFY_API_VERSION 12
|
164
166
|
|
165
167
|
/**
|
166
168
|
* Describes the current state of the connection
|
@@ -253,6 +255,15 @@ typedef enum sp_track_offline_status {
|
|
253
255
|
SP_TRACK_OFFLINE_DONE_RESYNC = 7, ///< Downloaded OK and available but scheduled for re-download
|
254
256
|
} sp_track_offline_status;
|
255
257
|
|
258
|
+
/**
|
259
|
+
* Image size
|
260
|
+
*/
|
261
|
+
typedef enum sp_image_size {
|
262
|
+
SP_IMAGE_SIZE_NORMAL = 0, ///< Normal image size
|
263
|
+
SP_IMAGE_SIZE_SMALL = 1, ///< Small image size
|
264
|
+
SP_IMAGE_SIZE_LARGE = 2, ///< Large image size
|
265
|
+
} sp_image_size;
|
266
|
+
|
256
267
|
/**
|
257
268
|
* Buffer stats used by get_audio_buffer_stats callback
|
258
269
|
*/
|
@@ -313,6 +324,20 @@ typedef enum sp_artistbrowse_type {
|
|
313
324
|
*/
|
314
325
|
} sp_artistbrowse_type;
|
315
326
|
|
327
|
+
typedef enum sp_social_provider {
|
328
|
+
SP_SOCIAL_PROVIDER_SPOTIFY,
|
329
|
+
SP_SOCIAL_PROVIDER_FACEBOOK,
|
330
|
+
SP_SOCIAL_PROVIDER_LASTFM,
|
331
|
+
} sp_social_provider;
|
332
|
+
|
333
|
+
typedef enum sp_scrobbling_state {
|
334
|
+
SP_SCROBBLING_STATE_USE_GLOBAL_SETTING = 0,
|
335
|
+
SP_SCROBBLING_STATE_LOCAL_ENABLED = 1,
|
336
|
+
SP_SCROBBLING_STATE_LOCAL_DISABLED = 2,
|
337
|
+
SP_SCROBBLING_STATE_GLOBAL_ENABLED = 3,
|
338
|
+
SP_SCROBBLING_STATE_GLOBAL_DISABLED = 4,
|
339
|
+
} sp_scrobbling_state;
|
340
|
+
|
316
341
|
|
317
342
|
/**
|
318
343
|
* Offline sync status
|
@@ -588,6 +613,28 @@ typedef struct sp_session_callbacks {
|
|
588
613
|
*/
|
589
614
|
void (SP_CALLCONV *credentials_blob_updated)(sp_session *session, const char *blob);
|
590
615
|
|
616
|
+
/**
|
617
|
+
* Called when the connection state has updated - such as when logging in, going offline, etc.
|
618
|
+
*
|
619
|
+
* @param[in] session Session
|
620
|
+
*/
|
621
|
+
void (SP_CALLCONV *connectionstate_updated)(sp_session *session);
|
622
|
+
|
623
|
+
/**
|
624
|
+
* Called when there is a scrobble error event
|
625
|
+
*
|
626
|
+
* @param[in] session Session
|
627
|
+
* @param[in] error Scrobble error. Currently SP_ERROR_LASTFM_AUTH_ERROR.
|
628
|
+
*/
|
629
|
+
void (SP_CALLCONV *scrobble_error)(sp_session *session, sp_error error);
|
630
|
+
|
631
|
+
/**
|
632
|
+
* Called when there is a change in the private session mode
|
633
|
+
*
|
634
|
+
* @param[in] session Session
|
635
|
+
* @param[in] isPrivate True if in private session, false otherwhise
|
636
|
+
*/
|
637
|
+
void (SP_CALLCONV *private_session_mode_changed)(sp_session *session, bool is_private);
|
591
638
|
} sp_session_callbacks;
|
592
639
|
|
593
640
|
/**
|
@@ -639,6 +686,20 @@ typedef struct sp_session_config {
|
|
639
686
|
*/
|
640
687
|
const char *device_id;
|
641
688
|
|
689
|
+
/**
|
690
|
+
* Url to the proxy server that should be used.
|
691
|
+
* The format is protocol://<host>:port (where protocal is http/https/socks4/socks5)
|
692
|
+
*/
|
693
|
+
const char *proxy;
|
694
|
+
/**
|
695
|
+
* Username to authenticate with proxy server
|
696
|
+
*/
|
697
|
+
const char *proxy_username;
|
698
|
+
/**
|
699
|
+
* Password to authenticate with proxy server
|
700
|
+
*/
|
701
|
+
const char *proxy_password;
|
702
|
+
|
642
703
|
|
643
704
|
/**
|
644
705
|
* Path to API trace file
|
@@ -674,8 +735,10 @@ SP_LIBEXPORT(sp_error) sp_session_create(const sp_session_config *config, sp_ses
|
|
674
735
|
* Release the session. This will clean up all data and connections associated with the session
|
675
736
|
*
|
676
737
|
* @param[in] sess Session object returned from sp_session_create()
|
738
|
+
* @return One of the following errors, from ::sp_error
|
739
|
+
* SP_ERROR_OK
|
677
740
|
*/
|
678
|
-
SP_LIBEXPORT(
|
741
|
+
SP_LIBEXPORT(sp_error) sp_session_release(sp_session *sess);
|
679
742
|
|
680
743
|
|
681
744
|
/**
|
@@ -696,8 +759,10 @@ SP_LIBEXPORT(void) sp_session_release(sp_session *sess);
|
|
696
759
|
* @param[in] remember_me If set, the username / password will be remembered by libspotify
|
697
760
|
* @param[in] blob If you have received a blob in the #credentials_blob_updated
|
698
761
|
* you can pas this here instead of password
|
762
|
+
* @return One of the following errors, from ::sp_error
|
763
|
+
* SP_ERROR_OK
|
699
764
|
*/
|
700
|
-
SP_LIBEXPORT(
|
765
|
+
SP_LIBEXPORT(sp_error) sp_session_login(sp_session *session, const char *username, const char *password, bool remember_me, const char *blob);
|
701
766
|
|
702
767
|
|
703
768
|
/**
|
@@ -729,13 +794,24 @@ SP_LIBEXPORT(sp_error) sp_session_relogin(sp_session *session);
|
|
729
794
|
SP_LIBEXPORT(int) sp_session_remembered_user(sp_session *session, char *buffer, size_t buffer_size);
|
730
795
|
|
731
796
|
|
797
|
+
/**
|
798
|
+
* Get a pointer to a string representing the user's login username.
|
799
|
+
*
|
800
|
+
* @param[in] session Your session object
|
801
|
+
*
|
802
|
+
* @return A string representing the login username.
|
803
|
+
*/
|
804
|
+
SP_LIBEXPORT(const char *) sp_session_user_name(sp_session *session);
|
805
|
+
|
806
|
+
|
732
807
|
/**
|
733
808
|
* Remove stored credentials in libspotify. If no credentials are currently stored, nothing will happen.
|
734
809
|
*
|
735
810
|
* @param[in] session Your session object
|
736
|
-
*
|
811
|
+
* @return One of the following errors, from ::sp_error
|
812
|
+
* SP_ERROR_OK
|
737
813
|
*/
|
738
|
-
SP_LIBEXPORT(
|
814
|
+
SP_LIBEXPORT(sp_error) sp_session_forget_me(sp_session *session);
|
739
815
|
|
740
816
|
|
741
817
|
/**
|
@@ -754,8 +830,10 @@ SP_LIBEXPORT(sp_user *) sp_session_user(sp_session *session);
|
|
754
830
|
* logged in. Otherwise, the settings and cache may be lost.
|
755
831
|
*
|
756
832
|
* @param[in] session Your session object
|
833
|
+
* @return One of the following errors, from ::sp_error
|
834
|
+
* SP_ERROR_OK
|
757
835
|
*/
|
758
|
-
SP_LIBEXPORT(
|
836
|
+
SP_LIBEXPORT(sp_error) sp_session_logout(sp_session *session);
|
759
837
|
|
760
838
|
|
761
839
|
/**
|
@@ -767,8 +845,10 @@ SP_LIBEXPORT(void) sp_session_logout(sp_session *session);
|
|
767
845
|
* should never need to be used.
|
768
846
|
*
|
769
847
|
* @param[in] session Your session object
|
848
|
+
* @return One of the following errors, from ::sp_error
|
849
|
+
* SP_ERROR_OK
|
770
850
|
*/
|
771
|
-
SP_LIBEXPORT(
|
851
|
+
SP_LIBEXPORT(sp_error) sp_session_flush_caches(sp_session *session);
|
772
852
|
|
773
853
|
/**
|
774
854
|
* The connection state of the specified session.
|
@@ -795,16 +875,20 @@ SP_LIBEXPORT(void *) sp_session_userdata(sp_session *session);
|
|
795
875
|
* @param[in] size Maximum cache size in megabytes.
|
796
876
|
* Setting it to 0 (the default) will let libspotify automatically
|
797
877
|
* resize the cache (10% of disk free space)
|
878
|
+
* @return One of the following errors, from ::sp_error
|
879
|
+
* SP_ERROR_OK
|
798
880
|
*/
|
799
|
-
SP_LIBEXPORT(
|
881
|
+
SP_LIBEXPORT(sp_error) sp_session_set_cache_size(sp_session *session, size_t size);
|
800
882
|
|
801
883
|
/**
|
802
884
|
* Make the specified session process any pending events
|
803
885
|
*
|
804
886
|
* @param[in] session Your session object
|
805
887
|
* @param[out] next_timeout Stores the time (in milliseconds) until you should call this function again
|
888
|
+
* @return One of the following errors, from ::sp_error
|
889
|
+
* SP_ERROR_OK
|
806
890
|
*/
|
807
|
-
SP_LIBEXPORT(
|
891
|
+
SP_LIBEXPORT(sp_error) sp_session_process_events(sp_session *session, int *next_timeout);
|
808
892
|
|
809
893
|
/**
|
810
894
|
* Loads the specified track
|
@@ -819,7 +903,6 @@ SP_LIBEXPORT(void) sp_session_process_events(sp_session *session, int *next_time
|
|
819
903
|
* @return One of the following errors, from ::sp_error
|
820
904
|
* SP_ERROR_OK
|
821
905
|
* SP_ERROR_MISSING_CALLBACK
|
822
|
-
* SP_ERROR_RESOURCE_NOT_LOADED
|
823
906
|
* SP_ERROR_TRACK_NOT_PLAYABLE
|
824
907
|
*
|
825
908
|
*/
|
@@ -830,18 +913,20 @@ SP_LIBEXPORT(sp_error) sp_session_player_load(sp_session *session, sp_track *tra
|
|
830
913
|
*
|
831
914
|
* @param[in] session Your session object
|
832
915
|
* @param[in] offset Track position, in milliseconds.
|
833
|
-
*
|
916
|
+
* @return One of the following errors, from ::sp_error
|
917
|
+
* SP_ERROR_OK
|
834
918
|
*/
|
835
|
-
SP_LIBEXPORT(
|
919
|
+
SP_LIBEXPORT(sp_error) sp_session_player_seek(sp_session *session, int offset);
|
836
920
|
|
837
921
|
/**
|
838
922
|
* Play or pause the currently loaded track
|
839
923
|
*
|
840
924
|
* @param[in] session Your session object
|
841
925
|
* @param[in] play If set to true, playback will occur. If set to false, the playback will be paused.
|
842
|
-
*
|
926
|
+
* @return One of the following errors, from ::sp_error
|
927
|
+
* SP_ERROR_OK
|
843
928
|
*/
|
844
|
-
SP_LIBEXPORT(
|
929
|
+
SP_LIBEXPORT(sp_error) sp_session_player_play(sp_session *session, bool play);
|
845
930
|
|
846
931
|
/**
|
847
932
|
* Stops the currently playing track
|
@@ -850,9 +935,10 @@ SP_LIBEXPORT(void) sp_session_player_play(sp_session *session, bool play);
|
|
850
935
|
* playing track.
|
851
936
|
*
|
852
937
|
* @param[in] session Your session object
|
853
|
-
*
|
938
|
+
* @return One of the following errors, from ::sp_error
|
939
|
+
* SP_ERROR_OK
|
854
940
|
*/
|
855
|
-
SP_LIBEXPORT(
|
941
|
+
SP_LIBEXPORT(sp_error) sp_session_player_unload(sp_session *session);
|
856
942
|
|
857
943
|
/**
|
858
944
|
* Prefetch a track
|
@@ -935,9 +1021,11 @@ SP_LIBEXPORT(sp_playlistcontainer *) sp_session_publishedcontainer_for_user_crea
|
|
935
1021
|
*
|
936
1022
|
* @param[in] session Session object
|
937
1023
|
* @param[in] bitrate Preferred bitrate, see ::sp_bitrate for possible values
|
938
|
-
*
|
1024
|
+
* @return One of the following errors, from ::sp_error
|
1025
|
+
* SP_ERROR_OK
|
1026
|
+
* SP_ERROR_INVALID_ARGUMENT
|
939
1027
|
*/
|
940
|
-
SP_LIBEXPORT(
|
1028
|
+
SP_LIBEXPORT(sp_error) sp_session_preferred_bitrate(sp_session *session, sp_bitrate bitrate);
|
941
1029
|
|
942
1030
|
|
943
1031
|
/**
|
@@ -946,9 +1034,11 @@ SP_LIBEXPORT(void) sp_session_preferred_bitrate(sp_session *session, sp_bitrate
|
|
946
1034
|
* @param[in] session Session object
|
947
1035
|
* @param[in] bitrate Preferred bitrate, see ::sp_bitrate for possible values
|
948
1036
|
* @param[in] allow_resync Set to true if libspotify should resynchronize already synchronized tracks. Usually you should set this to false.
|
949
|
-
*
|
1037
|
+
* @return One of the following errors, from ::sp_error
|
1038
|
+
* SP_ERROR_OK
|
1039
|
+
* SP_ERROR_INVALID_ARGUMENT
|
950
1040
|
*/
|
951
|
-
SP_LIBEXPORT(
|
1041
|
+
SP_LIBEXPORT(sp_error) sp_session_preferred_offline_bitrate(sp_session *session, sp_bitrate bitrate, bool allow_resync);
|
952
1042
|
|
953
1043
|
|
954
1044
|
/**
|
@@ -967,10 +1057,95 @@ SP_LIBEXPORT(bool) sp_session_get_volume_normalization(sp_session *session);
|
|
967
1057
|
*
|
968
1058
|
* @param[in] session Session object
|
969
1059
|
* @param[in] on True iff volume normalization should be enabled
|
1060
|
+
* @return One of the following errors, from ::sp_error
|
1061
|
+
* SP_ERROR_OK
|
1062
|
+
*/
|
1063
|
+
SP_LIBEXPORT(sp_error) sp_session_set_volume_normalization(sp_session *session, bool on);
|
1064
|
+
|
1065
|
+
|
1066
|
+
/**
|
1067
|
+
* Set if private session is enabled. This disables sharing what the user is listening to
|
1068
|
+
* to services such as Spotify Social, Facebook and LastFM. The private session will
|
1069
|
+
* last for a time, and then libspotify will revert to the normal state. The private
|
1070
|
+
* session is prolonged by user activity.
|
1071
|
+
*
|
1072
|
+
* @param[in] session Session object
|
1073
|
+
* @param[in] enabled True iff private session should be enabled
|
1074
|
+
* @return One of the following errors, from ::sp_error
|
1075
|
+
* SP_ERROR_OK
|
1076
|
+
*/
|
1077
|
+
SP_LIBEXPORT(sp_error) sp_session_set_private_session(sp_session *session, bool enabled);
|
1078
|
+
|
1079
|
+
/**
|
1080
|
+
* Return True if private session is enabled
|
1081
|
+
*
|
1082
|
+
* @param[in] session Session object
|
1083
|
+
*
|
1084
|
+
* @return True if private session is enabled
|
1085
|
+
*/
|
1086
|
+
SP_LIBEXPORT(bool) sp_session_is_private_session(sp_session *session);
|
1087
|
+
|
1088
|
+
/**
|
1089
|
+
* Set if scrobbling is enabled. This api allows setting local overrides of the global scrobbling settings.
|
1090
|
+
* Changing the global settings are currently not supported.
|
1091
|
+
*
|
1092
|
+
* @param[in] session Session object
|
1093
|
+
* @param[in] provider The scrobbling provider referred to
|
1094
|
+
* @param[in] state The state to set the provider to
|
1095
|
+
*
|
1096
|
+
* @return error code
|
1097
|
+
*
|
1098
|
+
* @see sp_social_provider
|
1099
|
+
* @see sp_scrobbling_state
|
1100
|
+
*/
|
1101
|
+
SP_LIBEXPORT(sp_error) sp_session_set_scrobbling(sp_session *session, sp_social_provider provider, sp_scrobbling_state state);
|
1102
|
+
|
1103
|
+
/**
|
1104
|
+
* Return the scrobbling state. This makes it possible to find out if scrobbling is locally overrided or
|
1105
|
+
* if the global setting is used.
|
1106
|
+
*
|
1107
|
+
* @param[in] session Session object
|
1108
|
+
* @param[in] provider The scrobbling provider referred to
|
1109
|
+
* @param[out] state The output variable receiving the sp_scrobbling_state state
|
970
1110
|
*
|
1111
|
+
* @return error code
|
971
1112
|
*/
|
972
|
-
SP_LIBEXPORT(
|
1113
|
+
SP_LIBEXPORT(sp_error) sp_session_is_scrobbling(sp_session *session, sp_social_provider provider, sp_scrobbling_state* state);
|
973
1114
|
|
1115
|
+
/**
|
1116
|
+
* Return True if scrobbling settings should be shown to the user. Currently this setting is relevant
|
1117
|
+
* only to the facebook provider.
|
1118
|
+
* The returned value may be false if the user is not connected to facebook,
|
1119
|
+
* or if the user has opted out from facebook social graph.
|
1120
|
+
*
|
1121
|
+
* @param[in] session Session object
|
1122
|
+
* @param[in] provider The scrobbling provider referred to
|
1123
|
+
* @param[out] out True iff scrobbling is possible
|
1124
|
+
*
|
1125
|
+
* @return error code
|
1126
|
+
*/
|
1127
|
+
SP_LIBEXPORT(sp_error) sp_session_is_scrobbling_possible(sp_session *session, sp_social_provider provider, bool* out);
|
1128
|
+
|
1129
|
+
/**
|
1130
|
+
* Set the user's credentials with a social provider.
|
1131
|
+
* Currently this is only relevant for LastFm
|
1132
|
+
* Call sp_session_set_scrobbling to force an authentication attempt
|
1133
|
+
* with the LastFm server. If authentication fails a scrobble_error callback will be
|
1134
|
+
* sent.
|
1135
|
+
*
|
1136
|
+
* @param[in] session Session object
|
1137
|
+
* @param[in] provider The scrobbling provider referred to
|
1138
|
+
* @param[in] username The user name
|
1139
|
+
* @param[in] password The password
|
1140
|
+
*
|
1141
|
+
* @return error code
|
1142
|
+
|
1143
|
+
* @see sp_session_set_scrobbling
|
1144
|
+
* @see sp_session_callbacks#scrobble_error
|
1145
|
+
* @return One of the following errors, from ::sp_error
|
1146
|
+
* SP_ERROR_OK
|
1147
|
+
*/
|
1148
|
+
SP_LIBEXPORT(sp_error) sp_session_set_social_credentials(sp_session *session, sp_social_provider provider, const char* username, const char* password);
|
974
1149
|
|
975
1150
|
/**
|
976
1151
|
* Set to true if the connection is currently routed over a roamed connectivity
|
@@ -982,8 +1157,10 @@ SP_LIBEXPORT(void) sp_session_set_volume_normalization(sp_session *session, bool
|
|
982
1157
|
* how libspotify should behave in respect to network activity and offline
|
983
1158
|
* synchronization.
|
984
1159
|
* @see sp_connection_type
|
1160
|
+
* @return One of the following errors, from ::sp_error
|
1161
|
+
* SP_ERROR_OK
|
985
1162
|
*/
|
986
|
-
SP_LIBEXPORT(
|
1163
|
+
SP_LIBEXPORT(sp_error) sp_session_set_connection_type(sp_session *session, sp_connection_type type);
|
987
1164
|
|
988
1165
|
|
989
1166
|
/**
|
@@ -996,8 +1173,10 @@ SP_LIBEXPORT(void) sp_session_set_connection_type(sp_session *session, sp_connec
|
|
996
1173
|
* how libspotify should behave in respect to network activity and offline
|
997
1174
|
* synchronization.
|
998
1175
|
* @see sp_connection_rules
|
1176
|
+
* @return One of the following errors, from ::sp_error
|
1177
|
+
* SP_ERROR_OK
|
999
1178
|
*/
|
1000
|
-
SP_LIBEXPORT(
|
1179
|
+
SP_LIBEXPORT(sp_error) sp_session_set_connection_rules(sp_session *session, sp_connection_rules rules);
|
1001
1180
|
|
1002
1181
|
|
1003
1182
|
|
@@ -1124,13 +1303,14 @@ SP_LIBEXPORT(sp_link *) sp_link_create_from_album(sp_album *album);
|
|
1124
1303
|
* Create an image link object from an album
|
1125
1304
|
*
|
1126
1305
|
* @param[in] album An album object
|
1306
|
+
* @param[in] size The desired size of the image
|
1127
1307
|
*
|
1128
1308
|
* @return A link representing the album cover. Type is set to SP_LINKTYPE_IMAGE
|
1129
1309
|
*
|
1130
1310
|
* @note You need to release the link when you are done with it.
|
1131
1311
|
* @see sp_link_release()
|
1132
1312
|
*/
|
1133
|
-
SP_LIBEXPORT(sp_link *) sp_link_create_from_album_cover(sp_album *album);
|
1313
|
+
SP_LIBEXPORT(sp_link *) sp_link_create_from_album_cover(sp_album *album, sp_image_size size);
|
1134
1314
|
|
1135
1315
|
/**
|
1136
1316
|
* Creates a link object from an artist
|
@@ -1148,6 +1328,7 @@ SP_LIBEXPORT(sp_link *) sp_link_create_from_artist(sp_artist *artist);
|
|
1148
1328
|
* Creates a link object pointing to an artist portrait
|
1149
1329
|
*
|
1150
1330
|
* @param[in] artist Artist browse object
|
1331
|
+
* @param[in] size The desired size of the image
|
1151
1332
|
*
|
1152
1333
|
* @return A link object representing an image
|
1153
1334
|
*
|
@@ -1155,7 +1336,7 @@ SP_LIBEXPORT(sp_link *) sp_link_create_from_artist(sp_artist *artist);
|
|
1155
1336
|
* @see sp_link_release()
|
1156
1337
|
* @see sp_artistbrowse_num_portraits()
|
1157
1338
|
*/
|
1158
|
-
SP_LIBEXPORT(sp_link *) sp_link_create_from_artist_portrait(sp_artist *artist);
|
1339
|
+
SP_LIBEXPORT(sp_link *) sp_link_create_from_artist_portrait(sp_artist *artist, sp_image_size size);
|
1159
1340
|
|
1160
1341
|
|
1161
1342
|
/**
|
@@ -1311,15 +1492,19 @@ SP_LIBEXPORT(sp_user *) sp_link_as_user(sp_link *link);
|
|
1311
1492
|
* Increase the reference count of a link
|
1312
1493
|
*
|
1313
1494
|
* @param[in] link The link object
|
1495
|
+
* @return One of the following errors, from ::sp_error
|
1496
|
+
* SP_ERROR_OK
|
1314
1497
|
*/
|
1315
|
-
SP_LIBEXPORT(
|
1498
|
+
SP_LIBEXPORT(sp_error) sp_link_add_ref(sp_link *link);
|
1316
1499
|
|
1317
1500
|
/**
|
1318
1501
|
* Decrease the reference count of a link
|
1319
1502
|
*
|
1320
1503
|
* @param[in] link The link object
|
1504
|
+
* @return One of the following errors, from ::sp_error
|
1505
|
+
* SP_ERROR_OK
|
1321
1506
|
*/
|
1322
|
-
SP_LIBEXPORT(
|
1507
|
+
SP_LIBEXPORT(sp_error) sp_link_release(sp_link *link);
|
1323
1508
|
|
1324
1509
|
/** @} */
|
1325
1510
|
|
@@ -1458,7 +1643,7 @@ SP_LIBEXPORT(bool) sp_track_is_starred(sp_session *session, sp_track *track);
|
|
1458
1643
|
* @note This will fail silently if playlists are disabled.
|
1459
1644
|
* @see sp_set_playlists_enabled()
|
1460
1645
|
*/
|
1461
|
-
SP_LIBEXPORT(
|
1646
|
+
SP_LIBEXPORT(sp_error) sp_track_set_starred(sp_session *session, sp_track *const*tracks, int num_tracks, bool star);
|
1462
1647
|
|
1463
1648
|
/**
|
1464
1649
|
* The number of artists performing on the specified track
|
@@ -1561,15 +1746,19 @@ SP_LIBEXPORT(sp_track *) sp_localtrack_create(const char *artist, const char *ti
|
|
1561
1746
|
* Increase the reference count of a track
|
1562
1747
|
*
|
1563
1748
|
* @param[in] track The track object
|
1749
|
+
* @return One of the following errors, from ::sp_error
|
1750
|
+
* SP_ERROR_OK
|
1564
1751
|
*/
|
1565
|
-
SP_LIBEXPORT(
|
1752
|
+
SP_LIBEXPORT(sp_error) sp_track_add_ref(sp_track *track);
|
1566
1753
|
|
1567
1754
|
/**
|
1568
1755
|
* Decrease the reference count of a track
|
1569
1756
|
*
|
1570
1757
|
* @param[in] track The track object
|
1758
|
+
* @return One of the following errors, from ::sp_error
|
1759
|
+
* SP_ERROR_OK
|
1571
1760
|
*/
|
1572
|
-
SP_LIBEXPORT(
|
1761
|
+
SP_LIBEXPORT(sp_error) sp_track_release(sp_track *track);
|
1573
1762
|
|
1574
1763
|
/** @} */
|
1575
1764
|
|
@@ -1623,6 +1812,7 @@ SP_LIBEXPORT(sp_artist *) sp_album_artist(sp_album *album);
|
|
1623
1812
|
* Return image ID representing the album's coverart.
|
1624
1813
|
*
|
1625
1814
|
* @param[in] album Album object
|
1815
|
+
* @param[in] size The desired size of the image
|
1626
1816
|
*
|
1627
1817
|
* @return ID byte sequence that can be passed to sp_image_create()
|
1628
1818
|
* If the album has no image or the metadata for the album is not
|
@@ -1630,7 +1820,7 @@ SP_LIBEXPORT(sp_artist *) sp_album_artist(sp_album *album);
|
|
1630
1820
|
*
|
1631
1821
|
* @see sp_image_create
|
1632
1822
|
*/
|
1633
|
-
SP_LIBEXPORT(const byte *) sp_album_cover(sp_album *album);
|
1823
|
+
SP_LIBEXPORT(const byte *) sp_album_cover(sp_album *album, sp_image_size size);
|
1634
1824
|
|
1635
1825
|
/**
|
1636
1826
|
* Return name of album
|
@@ -1667,15 +1857,19 @@ SP_LIBEXPORT(sp_albumtype) sp_album_type(sp_album *album);
|
|
1667
1857
|
* Increase the reference count of an album
|
1668
1858
|
*
|
1669
1859
|
* @param[in] album The album object
|
1860
|
+
* @return One of the following errors, from ::sp_error
|
1861
|
+
* SP_ERROR_OK
|
1670
1862
|
*/
|
1671
|
-
SP_LIBEXPORT(
|
1863
|
+
SP_LIBEXPORT(sp_error) sp_album_add_ref(sp_album *album);
|
1672
1864
|
|
1673
1865
|
/**
|
1674
1866
|
* Decrease the reference count of an album
|
1675
1867
|
*
|
1676
1868
|
* @param[in] album The album object
|
1869
|
+
* @return One of the following errors, from ::sp_error
|
1870
|
+
* SP_ERROR_OK
|
1677
1871
|
*/
|
1678
|
-
SP_LIBEXPORT(
|
1872
|
+
SP_LIBEXPORT(sp_error) sp_album_release(sp_album *album);
|
1679
1873
|
|
1680
1874
|
/** @} */
|
1681
1875
|
|
@@ -1710,28 +1904,33 @@ SP_LIBEXPORT(bool) sp_artist_is_loaded(sp_artist *artist);
|
|
1710
1904
|
/**
|
1711
1905
|
* Return portrait for artist
|
1712
1906
|
*
|
1713
|
-
* @param[in] artist
|
1907
|
+
* @param[in] artist The artist object
|
1908
|
+
* @param[in] size The desired size of the image
|
1714
1909
|
*
|
1715
1910
|
* @return ID byte sequence that can be passed to sp_image_create()
|
1716
1911
|
* If the artist has no image or the metadata for the album is not
|
1717
1912
|
* loaded yet, this function returns NULL.
|
1718
1913
|
*
|
1719
1914
|
*/
|
1720
|
-
SP_LIBEXPORT(const byte *) sp_artist_portrait(sp_artist *artist);
|
1915
|
+
SP_LIBEXPORT(const byte *) sp_artist_portrait(sp_artist *artist, sp_image_size size);
|
1721
1916
|
|
1722
1917
|
/**
|
1723
1918
|
* Increase the reference count of a artist
|
1724
1919
|
*
|
1725
1920
|
* @param[in] artist The artist object
|
1921
|
+
* @return One of the following errors, from ::sp_error
|
1922
|
+
* SP_ERROR_OK
|
1726
1923
|
*/
|
1727
|
-
SP_LIBEXPORT(
|
1924
|
+
SP_LIBEXPORT(sp_error) sp_artist_add_ref(sp_artist *artist);
|
1728
1925
|
|
1729
1926
|
/**
|
1730
1927
|
* Decrease the reference count of a artist
|
1731
1928
|
*
|
1732
1929
|
* @param[in] artist The artist object
|
1930
|
+
* @return One of the following errors, from ::sp_error
|
1931
|
+
* SP_ERROR_OK
|
1733
1932
|
*/
|
1734
|
-
SP_LIBEXPORT(
|
1933
|
+
SP_LIBEXPORT(sp_error) sp_artist_release(sp_artist *artist);
|
1735
1934
|
|
1736
1935
|
/** @} */
|
1737
1936
|
|
@@ -1882,15 +2081,19 @@ SP_LIBEXPORT(int) sp_albumbrowse_backend_request_duration(sp_albumbrowse *alb);
|
|
1882
2081
|
* Increase the reference count of an album browse result
|
1883
2082
|
*
|
1884
2083
|
* @param[in] alb The album browse result object
|
2084
|
+
* @return One of the following errors, from ::sp_error
|
2085
|
+
* SP_ERROR_OK
|
1885
2086
|
*/
|
1886
|
-
SP_LIBEXPORT(
|
2087
|
+
SP_LIBEXPORT(sp_error) sp_albumbrowse_add_ref(sp_albumbrowse *alb);
|
1887
2088
|
|
1888
2089
|
/**
|
1889
2090
|
* Decrease the reference count of an album browse result
|
1890
2091
|
*
|
1891
2092
|
* @param[in] alb The album browse result object
|
2093
|
+
* @return One of the following errors, from ::sp_error
|
2094
|
+
* SP_ERROR_OK
|
1892
2095
|
*/
|
1893
|
-
SP_LIBEXPORT(
|
2096
|
+
SP_LIBEXPORT(sp_error) sp_albumbrowse_release(sp_albumbrowse *alb);
|
1894
2097
|
|
1895
2098
|
/** @} */
|
1896
2099
|
|
@@ -2102,15 +2305,19 @@ SP_LIBEXPORT(int) sp_artistbrowse_backend_request_duration(sp_artistbrowse *arb)
|
|
2102
2305
|
* Increase the reference count of an artist browse result
|
2103
2306
|
*
|
2104
2307
|
* @param[in] arb The artist browse result object
|
2308
|
+
* @return One of the following errors, from ::sp_error
|
2309
|
+
* SP_ERROR_OK
|
2105
2310
|
*/
|
2106
|
-
SP_LIBEXPORT(
|
2311
|
+
SP_LIBEXPORT(sp_error) sp_artistbrowse_add_ref(sp_artistbrowse *arb);
|
2107
2312
|
|
2108
2313
|
/**
|
2109
2314
|
* Decrease the reference count of an artist browse result
|
2110
2315
|
*
|
2111
2316
|
* @param[in] arb The artist browse result object
|
2317
|
+
* @return One of the following errors, from ::sp_error
|
2318
|
+
* SP_ERROR_OK
|
2112
2319
|
*/
|
2113
|
-
SP_LIBEXPORT(
|
2320
|
+
SP_LIBEXPORT(sp_error) sp_artistbrowse_release(sp_artistbrowse *arb);
|
2114
2321
|
|
2115
2322
|
/** @} */
|
2116
2323
|
|
@@ -2174,7 +2381,7 @@ SP_LIBEXPORT(sp_image *) sp_image_create_from_link(sp_session *session, sp_link
|
|
2174
2381
|
* @param[in] userdata Opaque pointer passed to \p callback
|
2175
2382
|
*
|
2176
2383
|
*/
|
2177
|
-
SP_LIBEXPORT(
|
2384
|
+
SP_LIBEXPORT(sp_error) sp_image_add_load_callback(sp_image *image, image_loaded_cb *callback, void *userdata);
|
2178
2385
|
|
2179
2386
|
/**
|
2180
2387
|
* Remove an image load callback previously added with sp_image_add_load_callback()
|
@@ -2183,9 +2390,10 @@ SP_LIBEXPORT(void) sp_image_add_load_callback(sp_image *image, image_loaded_cb *
|
|
2183
2390
|
* @param[in] callback Callback that will not be called when image has been
|
2184
2391
|
* fetched.
|
2185
2392
|
* @param[in] userdata Opaque pointer passed to \p callback
|
2186
|
-
*
|
2393
|
+
* @return One of the following errors, from ::sp_error
|
2394
|
+
* SP_ERROR_OK
|
2187
2395
|
*/
|
2188
|
-
SP_LIBEXPORT(
|
2396
|
+
SP_LIBEXPORT(sp_error) sp_image_remove_load_callback(sp_image *image, image_loaded_cb *callback, void *userdata);
|
2189
2397
|
|
2190
2398
|
/**
|
2191
2399
|
* Check if an image is loaded. Before the image is loaded, the rest of the
|
@@ -2244,15 +2452,19 @@ SP_LIBEXPORT(const byte *) sp_image_image_id(sp_image *image);
|
|
2244
2452
|
* Increase the reference count of an image
|
2245
2453
|
*
|
2246
2454
|
* @param[in] image The image object
|
2455
|
+
* @return One of the following errors, from ::sp_error
|
2456
|
+
* SP_ERROR_OK
|
2247
2457
|
*/
|
2248
|
-
SP_LIBEXPORT(
|
2458
|
+
SP_LIBEXPORT(sp_error) sp_image_add_ref(sp_image *image);
|
2249
2459
|
|
2250
2460
|
/**
|
2251
2461
|
* Decrease the reference count of an image
|
2252
2462
|
*
|
2253
2463
|
* @param[in] image The image object
|
2464
|
+
* @return One of the following errors, from ::sp_error
|
2465
|
+
* SP_ERROR_OK
|
2254
2466
|
*/
|
2255
|
-
SP_LIBEXPORT(
|
2467
|
+
SP_LIBEXPORT(sp_error) sp_image_release(sp_image *image);
|
2256
2468
|
|
2257
2469
|
/** @} */
|
2258
2470
|
|
@@ -2480,15 +2692,19 @@ SP_LIBEXPORT(int) sp_search_total_playlists(sp_search *search);
|
|
2480
2692
|
* Increase the reference count of a search result
|
2481
2693
|
*
|
2482
2694
|
* @param[in] search The search result object
|
2695
|
+
* @return One of the following errors, from ::sp_error
|
2696
|
+
* SP_ERROR_OK
|
2483
2697
|
*/
|
2484
|
-
SP_LIBEXPORT(
|
2698
|
+
SP_LIBEXPORT(sp_error) sp_search_add_ref(sp_search *search);
|
2485
2699
|
|
2486
2700
|
/**
|
2487
2701
|
* Decrease the reference count of a search result
|
2488
2702
|
*
|
2489
2703
|
* @param[in] search The search result object
|
2704
|
+
* @return One of the following errors, from ::sp_error
|
2705
|
+
* SP_ERROR_OK
|
2490
2706
|
*/
|
2491
|
-
SP_LIBEXPORT(
|
2707
|
+
SP_LIBEXPORT(sp_error) sp_search_release(sp_search *search);
|
2492
2708
|
|
2493
2709
|
/** @} */
|
2494
2710
|
|
@@ -2678,7 +2894,7 @@ SP_LIBEXPORT(bool) sp_playlist_is_loaded(sp_playlist *playlist);
|
|
2678
2894
|
* @sa sp_playlist_remove_callbacks
|
2679
2895
|
*
|
2680
2896
|
*/
|
2681
|
-
SP_LIBEXPORT(
|
2897
|
+
SP_LIBEXPORT(sp_error) sp_playlist_add_callbacks(sp_playlist *playlist, sp_playlist_callbacks *callbacks, void *userdata);
|
2682
2898
|
|
2683
2899
|
/**
|
2684
2900
|
* Unregister interest in the given playlist
|
@@ -2693,9 +2909,11 @@ SP_LIBEXPORT(void) sp_playlist_add_callbacks(sp_playlist *playlist, sp_playlist_
|
|
2693
2909
|
* @param[in] callbacks Callbacks, see #sp_playlist_callbacks
|
2694
2910
|
* @param[in] userdata Userdata to be passed to callbacks
|
2695
2911
|
* @sa sp_playlist_add_callbacks
|
2912
|
+
* @return One of the following errors, from ::sp_error
|
2913
|
+
* SP_ERROR_OK
|
2696
2914
|
*
|
2697
2915
|
*/
|
2698
|
-
SP_LIBEXPORT(
|
2916
|
+
SP_LIBEXPORT(sp_error) sp_playlist_remove_callbacks(sp_playlist *playlist, sp_playlist_callbacks *callbacks, void *userdata);
|
2699
2917
|
|
2700
2918
|
/**
|
2701
2919
|
* Return number of tracks in the given playlist
|
@@ -2819,9 +3037,10 @@ SP_LIBEXPORT(bool) sp_playlist_is_collaborative(sp_playlist *playlist);
|
|
2819
3037
|
*
|
2820
3038
|
* @param[in] playlist Playlist object
|
2821
3039
|
* @param[in] collaborative True or false
|
2822
|
-
*
|
3040
|
+
* @return One of the following errors, from ::sp_error
|
3041
|
+
* SP_ERROR_OK
|
2823
3042
|
*/
|
2824
|
-
SP_LIBEXPORT(
|
3043
|
+
SP_LIBEXPORT(sp_error) sp_playlist_set_collaborative(sp_playlist *playlist, bool collaborative);
|
2825
3044
|
|
2826
3045
|
/**
|
2827
3046
|
* Set autolinking state for a playlist.
|
@@ -2831,9 +3050,10 @@ SP_LIBEXPORT(void) sp_playlist_set_collaborative(sp_playlist *playlist, bool col
|
|
2831
3050
|
*
|
2832
3051
|
* @param[in] playlist Playlist object
|
2833
3052
|
* @param[in] link True or false
|
2834
|
-
*
|
3053
|
+
* @return One of the following errors, from ::sp_error
|
3054
|
+
* SP_ERROR_OK
|
2835
3055
|
*/
|
2836
|
-
SP_LIBEXPORT(
|
3056
|
+
SP_LIBEXPORT(sp_error) sp_playlist_set_autolink_tracks(sp_playlist *playlist, bool link);
|
2837
3057
|
|
2838
3058
|
|
2839
3059
|
/**
|
@@ -2948,8 +3168,10 @@ SP_LIBEXPORT(sp_subscribers *) sp_playlist_subscribers(sp_playlist *playlist);
|
|
2948
3168
|
* Free object returned from sp_playlist_subscribers()
|
2949
3169
|
*
|
2950
3170
|
* @param[in] subscribers Subscribers object
|
3171
|
+
* @return One of the following errors, from ::sp_error
|
3172
|
+
* SP_ERROR_OK
|
2951
3173
|
*/
|
2952
|
-
SP_LIBEXPORT(
|
3174
|
+
SP_LIBEXPORT(sp_error) sp_playlist_subscribers_free(sp_subscribers *subscribers);
|
2953
3175
|
|
2954
3176
|
/**
|
2955
3177
|
* Ask library to update the subscription count for a playlist
|
@@ -2963,8 +3185,10 @@ SP_LIBEXPORT(void) sp_playlist_subscribers_free(sp_subscribers *subscribers);
|
|
2963
3185
|
*
|
2964
3186
|
* @param[in] session Session object
|
2965
3187
|
* @param[in] playlist Playlist object
|
3188
|
+
* @return One of the following errors, from ::sp_error
|
3189
|
+
* SP_ERROR_OK
|
2966
3190
|
*/
|
2967
|
-
SP_LIBEXPORT(
|
3191
|
+
SP_LIBEXPORT(sp_error) sp_playlist_update_subscribers(sp_session *session, sp_playlist *playlist);
|
2968
3192
|
|
2969
3193
|
/**
|
2970
3194
|
* Return whether a playlist is loaded in RAM (as opposed to only
|
@@ -3004,8 +3228,10 @@ SP_LIBEXPORT(bool) sp_playlist_is_in_ram(sp_session *session, sp_playlist *playl
|
|
3004
3228
|
* @param[in] session Session object
|
3005
3229
|
* @param[in] playlist Playlist object
|
3006
3230
|
* @param[in] in_ram Controls whether or not to keep the list in RAM
|
3231
|
+
* @return One of the following errors, from ::sp_error
|
3232
|
+
* SP_ERROR_OK
|
3007
3233
|
*/
|
3008
|
-
SP_LIBEXPORT(
|
3234
|
+
SP_LIBEXPORT(sp_error) sp_playlist_set_in_ram(sp_session *session, sp_playlist *playlist, bool in_ram);
|
3009
3235
|
|
3010
3236
|
/**
|
3011
3237
|
* Load an already existing playlist without adding it to a playlistcontainer.
|
@@ -3025,8 +3251,10 @@ SP_LIBEXPORT(sp_playlist *) sp_playlist_create(sp_session *session, sp_link *lin
|
|
3025
3251
|
* @param[in] session Session object
|
3026
3252
|
* @param[in] playlist Playlist object
|
3027
3253
|
* @param[in] offline True iff playlist should be offline, false otherwise
|
3254
|
+
* @return One of the following errors, from ::sp_error
|
3255
|
+
* SP_ERROR_OK
|
3028
3256
|
*/
|
3029
|
-
SP_LIBEXPORT(
|
3257
|
+
SP_LIBEXPORT(sp_error) sp_playlist_set_offline_mode(sp_session *session, sp_playlist *playlist, bool offline);
|
3030
3258
|
|
3031
3259
|
/**
|
3032
3260
|
* Get offline status for a playlist
|
@@ -3059,15 +3287,19 @@ SP_LIBEXPORT(int) sp_playlist_get_offline_download_completed(sp_session *session
|
|
3059
3287
|
* Increase the reference count of a playlist
|
3060
3288
|
*
|
3061
3289
|
* @param[in] playlist The playlist object
|
3290
|
+
* @return One of the following errors, from ::sp_error
|
3291
|
+
* SP_ERROR_OK
|
3062
3292
|
*/
|
3063
|
-
SP_LIBEXPORT(
|
3293
|
+
SP_LIBEXPORT(sp_error) sp_playlist_add_ref(sp_playlist *playlist);
|
3064
3294
|
|
3065
3295
|
/**
|
3066
3296
|
* Decrease the reference count of a playlist
|
3067
3297
|
*
|
3068
3298
|
* @param[in] playlist The playlist object
|
3299
|
+
* @return One of the following errors, from ::sp_error
|
3300
|
+
* SP_ERROR_OK
|
3069
3301
|
*/
|
3070
|
-
SP_LIBEXPORT(
|
3302
|
+
SP_LIBEXPORT(sp_error) sp_playlist_release(sp_playlist *playlist);
|
3071
3303
|
|
3072
3304
|
|
3073
3305
|
/**
|
@@ -3135,8 +3367,10 @@ typedef struct sp_playlistcontainer_callbacks {
|
|
3135
3367
|
*
|
3136
3368
|
* @sa sp_session_playlistcontainer()
|
3137
3369
|
* @sa sp_playlistcontainer_remove_callbacks
|
3370
|
+
* @return One of the following errors, from ::sp_error
|
3371
|
+
* SP_ERROR_OK
|
3138
3372
|
*/
|
3139
|
-
SP_LIBEXPORT(
|
3373
|
+
SP_LIBEXPORT(sp_error) sp_playlistcontainer_add_callbacks(sp_playlistcontainer *pc, sp_playlistcontainer_callbacks *callbacks, void *userdata);
|
3140
3374
|
|
3141
3375
|
|
3142
3376
|
/**
|
@@ -3148,8 +3382,10 @@ SP_LIBEXPORT(void) sp_playlistcontainer_add_callbacks(sp_playlistcontainer *pc,
|
|
3148
3382
|
*
|
3149
3383
|
* @sa sp_session_playlistcontainer()
|
3150
3384
|
* @sa sp_playlistcontainer_add_callbacks
|
3385
|
+
* @return One of the following errors, from ::sp_error
|
3386
|
+
* SP_ERROR_OK
|
3151
3387
|
*/
|
3152
|
-
SP_LIBEXPORT(
|
3388
|
+
SP_LIBEXPORT(sp_error) sp_playlistcontainer_remove_callbacks(sp_playlistcontainer *pc, sp_playlistcontainer_callbacks *callbacks, void *userdata);
|
3153
3389
|
|
3154
3390
|
/**
|
3155
3391
|
* Return the number of playlists in the given playlist container
|
@@ -3312,15 +3548,19 @@ SP_LIBEXPORT(sp_user *) sp_playlistcontainer_owner(sp_playlistcontainer *pc);
|
|
3312
3548
|
* Increase reference count on playlistconatiner object
|
3313
3549
|
*
|
3314
3550
|
* @param[in] pc Playlist container.
|
3551
|
+
* @return One of the following errors, from ::sp_error
|
3552
|
+
* SP_ERROR_OK
|
3315
3553
|
*/
|
3316
|
-
SP_LIBEXPORT(
|
3554
|
+
SP_LIBEXPORT(sp_error) sp_playlistcontainer_add_ref(sp_playlistcontainer *pc);
|
3317
3555
|
|
3318
3556
|
/**
|
3319
3557
|
* Release reference count on playlistconatiner object
|
3320
3558
|
*
|
3321
3559
|
* @param[in] pc Playlist container.
|
3560
|
+
* @return One of the following errors, from ::sp_error
|
3561
|
+
* SP_ERROR_OK
|
3322
3562
|
*/
|
3323
|
-
SP_LIBEXPORT(
|
3563
|
+
SP_LIBEXPORT(sp_error) sp_playlistcontainer_release(sp_playlistcontainer *pc);
|
3324
3564
|
|
3325
3565
|
/**
|
3326
3566
|
* Get the number of new tracks in a playlist since the corresponding
|
@@ -3403,15 +3643,19 @@ SP_LIBEXPORT(bool) sp_user_is_loaded(sp_user *user);
|
|
3403
3643
|
* Increase the reference count of an user
|
3404
3644
|
*
|
3405
3645
|
* @param[in] user The user object
|
3646
|
+
* @return One of the following errors, from ::sp_error
|
3647
|
+
* SP_ERROR_OK
|
3406
3648
|
*/
|
3407
|
-
SP_LIBEXPORT(
|
3649
|
+
SP_LIBEXPORT(sp_error) sp_user_add_ref(sp_user *user);
|
3408
3650
|
|
3409
3651
|
/**
|
3410
3652
|
* Decrease the reference count of an user
|
3411
3653
|
*
|
3412
3654
|
* @param[in] user The user object
|
3655
|
+
* @return One of the following errors, from ::sp_error
|
3656
|
+
* SP_ERROR_OK
|
3413
3657
|
*/
|
3414
|
-
SP_LIBEXPORT(
|
3658
|
+
SP_LIBEXPORT(sp_error) sp_user_release(sp_user *user);
|
3415
3659
|
|
3416
3660
|
/** @} */
|
3417
3661
|
|
@@ -3509,15 +3753,19 @@ SP_LIBEXPORT(sp_error) sp_toplistbrowse_error(sp_toplistbrowse *tlb);
|
|
3509
3753
|
* Increase the reference count of an toplist browse result
|
3510
3754
|
*
|
3511
3755
|
* @param[in] tlb The toplist browse result object
|
3756
|
+
* @return One of the following errors, from ::sp_error
|
3757
|
+
* SP_ERROR_OK
|
3512
3758
|
*/
|
3513
|
-
SP_LIBEXPORT(
|
3759
|
+
SP_LIBEXPORT(sp_error) sp_toplistbrowse_add_ref(sp_toplistbrowse *tlb);
|
3514
3760
|
|
3515
3761
|
/**
|
3516
3762
|
* Decrease the reference count of an toplist browse result
|
3517
3763
|
*
|
3518
3764
|
* @param[in] tlb The toplist browse result object
|
3765
|
+
* @return One of the following errors, from ::sp_error
|
3766
|
+
* SP_ERROR_OK
|
3519
3767
|
*/
|
3520
|
-
SP_LIBEXPORT(
|
3768
|
+
SP_LIBEXPORT(sp_error) sp_toplistbrowse_release(sp_toplistbrowse *tlb);
|
3521
3769
|
|
3522
3770
|
/**
|
3523
3771
|
* Given an toplist browse object, return number of artists
|
@@ -3646,15 +3894,19 @@ SP_LIBEXPORT(sp_error) sp_inbox_error(sp_inbox *inbox);
|
|
3646
3894
|
* Increase the reference count of a inbox result
|
3647
3895
|
*
|
3648
3896
|
* @param[in] inbox The inbox result object
|
3897
|
+
* @return One of the following errors, from ::sp_error
|
3898
|
+
* SP_ERROR_OK
|
3649
3899
|
*/
|
3650
|
-
SP_LIBEXPORT(
|
3900
|
+
SP_LIBEXPORT(sp_error) sp_inbox_add_ref(sp_inbox *inbox);
|
3651
3901
|
|
3652
3902
|
/**
|
3653
3903
|
* Decrease the reference count of a inbox result
|
3654
3904
|
*
|
3655
3905
|
* @param[in] inbox The inbox result object
|
3906
|
+
* @return One of the following errors, from ::sp_error
|
3907
|
+
* SP_ERROR_OK
|
3656
3908
|
*/
|
3657
|
-
SP_LIBEXPORT(
|
3909
|
+
SP_LIBEXPORT(sp_error) sp_inbox_release(sp_inbox *inbox);
|
3658
3910
|
|
3659
3911
|
/** @} */
|
3660
3912
|
|