class Spotify::SessionCallbacks

Spotify::Struct for Session callbacks.

@!method logged_in(session, error)

@param [Session] session
@param [Symbol] error

@!method logged_out(session)

@param [Session] session

@!method metadata_updated(session)

@param [Session]

@!method connection_error(session, error)

@param [Session] session
@param [Symbol] error

@!method message_to_user(session, message)

@param [Session] session
@param [String] message

@!method notify_main_thread(session)

@param [Session] session

@!method music_delivery(session, audio_format, frames_pointer, frames_length)

Frames pointer is pointing to data in the format described by audio format, with interleaved channels:

frames memory (16 bit = 2 byte frames, 2 channels, 3 frames):
   00 00 # sample 1, frame 1, channel 1
   00 00 # sample 2, frame 1, channel 2
   00 00 # sample 3, frame 2, channel 1
   00 00 # sample 4, frame 2, channel 2
   00 00 # sample 5, frame 3, channel 1
   00 00 # sample 6, frame 3, channel 2
   # end of data, 3 frames * 2 channels = 6 samples

@param [Session] session
@param [AudioFormat] audio_format
@param [FFI::Pointer] frames_pointer
@param [Integer] frames_length
@return [Integer] number of consumed frames, 0..frames_length

@!method play_token_lost(session)

@param [Session] session

@!method log_message(session, message)

@param [Session] session
@param [String] message

@!method end_of_track(session)

@param [Session]

@!method streaming_error(session, error)

@param [Session] session
@param [Symbol] error

@!method userinfo_updated(session)

@param [Session] session

@!method start_playback(session)

@param [Session] session

@!method stop_playback(session)

@param [Session] session

@!method get_audio_buffer_stats(session, stats)

@param [Session] session
@param [AudioBufferStats] stats

@!method offline_status_updated(session)

@param [Session] session

@!method offline_error(session, error)

@param [Session] session
@param [Symbol] error

@!method credentials_blob_updated(session, blob)

@param [Session] session
@param [String] blob

@!method connectionstate_updated(session)

@param [Session] session

@!method scrobble_error(session, error)

@param [Session] session
@param [Symbol] error

@!method private_session_mode_changed(session, is_private)

@param [Session] session
@param [Boolean] is_private

Constants

DEFAULTS

Sane defaults, to avoid {Spotify::API#session_logout} segfaulting.