Class: Spotify::SessionCallbacks

Inherits:
Struct
  • Object
show all
Defined in:
lib/spotify/structs/session_callbacks.rb

Overview

Spotify::Struct for Session callbacks.

Constant Summary collapse

DEFAULTS =

Sane defaults, to avoid API#session_logout segfaulting.

{
  connection_error: proc {},
  connectionstate_updated: proc {},
  credentials_blob_updated: proc {},
  end_of_track: proc {},
  get_audio_buffer_stats: proc {},
  log_message: proc {},
  logged_in: proc {},
  logged_out: proc {},
  message_to_user: proc {},
  metadata_updated: proc {},
  music_delivery: proc {},
  notify_main_thread: proc {},
  offline_error: proc {},
  offline_status_updated: proc {},
  play_token_lost: proc {},
  private_session_mode_changed: proc {},
  scrobble_error: proc {},
  start_playback: proc {},
  stop_playback: proc {},
  streaming_error: proc {},
  userinfo_updated: proc {},
}

Instance Method Summary collapse

Methods inherited from Struct

enclosing_module, #initialize, #to_h, #to_s

Methods included from TypeSafety

#to_native, #type_class

Constructor Details

This class inherits a constructor from Spotify::Struct

Instance Method Details

#connection_error(session, error) ⇒ Object

Parameters:



71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
# File 'lib/spotify/structs/session_callbacks.rb', line 71

class SessionCallbacks < Spotify::Struct
  layout :logged_in => callback([ Session, APIError ], :void),
         :logged_out => callback([ Session ], :void),
         :metadata_updated => callback([ Session ], :void),
         :connection_error => callback([ Session, APIError ], :void),
         :message_to_user => callback([ Session, UTF8String ], :void),
         :notify_main_thread => callback([ Session ], :void),
         :music_delivery => callback([ Session, AudioFormat.by_ref, :frames, :int ], :int),
         :play_token_lost => callback([ Session ], :void),
         :log_message => callback([ Session, UTF8String ], :void),
         :end_of_track => callback([ Session ], :void),
         :streaming_error => callback([ Session, APIError ], :void),
         :userinfo_updated => callback([ Session ], :void),
         :start_playback => callback([ Session ], :void),
         :stop_playback => callback([ Session ], :void),
         :get_audio_buffer_stats => callback([ Session, AudioBufferStats.by_ref ], :void),
         :offline_status_updated => callback([ Session ], :void),
         :offline_error => callback([ Session, APIError ], :void),
         :credentials_blob_updated => callback([ Session, :string ], :void),
         :connectionstate_updated => callback([ Session ], :void),
         :scrobble_error => callback([ Session, APIError ], :void),
         :private_session_mode_changed => callback([ Session, :bool ], :void)

  # Sane defaults, to avoid {Spotify::API#session_logout} segfaulting.
  DEFAULTS = {
    connection_error: proc {},
    connectionstate_updated: proc {},
    credentials_blob_updated: proc {},
    end_of_track: proc {},
    get_audio_buffer_stats: proc {},
    log_message: proc {},
    logged_in: proc {},
    logged_out: proc {},
    message_to_user: proc {},
    metadata_updated: proc {},
    music_delivery: proc {},
    notify_main_thread: proc {},
    offline_error: proc {},
    offline_status_updated: proc {},
    play_token_lost: proc {},
    private_session_mode_changed: proc {},
    scrobble_error: proc {},
    start_playback: proc {},
    stop_playback: proc {},
    streaming_error: proc {},
    userinfo_updated: proc {},
  }
end

#connectionstate_updated(session) ⇒ Object

Parameters:



71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
# File 'lib/spotify/structs/session_callbacks.rb', line 71

class SessionCallbacks < Spotify::Struct
  layout :logged_in => callback([ Session, APIError ], :void),
         :logged_out => callback([ Session ], :void),
         :metadata_updated => callback([ Session ], :void),
         :connection_error => callback([ Session, APIError ], :void),
         :message_to_user => callback([ Session, UTF8String ], :void),
         :notify_main_thread => callback([ Session ], :void),
         :music_delivery => callback([ Session, AudioFormat.by_ref, :frames, :int ], :int),
         :play_token_lost => callback([ Session ], :void),
         :log_message => callback([ Session, UTF8String ], :void),
         :end_of_track => callback([ Session ], :void),
         :streaming_error => callback([ Session, APIError ], :void),
         :userinfo_updated => callback([ Session ], :void),
         :start_playback => callback([ Session ], :void),
         :stop_playback => callback([ Session ], :void),
         :get_audio_buffer_stats => callback([ Session, AudioBufferStats.by_ref ], :void),
         :offline_status_updated => callback([ Session ], :void),
         :offline_error => callback([ Session, APIError ], :void),
         :credentials_blob_updated => callback([ Session, :string ], :void),
         :connectionstate_updated => callback([ Session ], :void),
         :scrobble_error => callback([ Session, APIError ], :void),
         :private_session_mode_changed => callback([ Session, :bool ], :void)

  # Sane defaults, to avoid {Spotify::API#session_logout} segfaulting.
  DEFAULTS = {
    connection_error: proc {},
    connectionstate_updated: proc {},
    credentials_blob_updated: proc {},
    end_of_track: proc {},
    get_audio_buffer_stats: proc {},
    log_message: proc {},
    logged_in: proc {},
    logged_out: proc {},
    message_to_user: proc {},
    metadata_updated: proc {},
    music_delivery: proc {},
    notify_main_thread: proc {},
    offline_error: proc {},
    offline_status_updated: proc {},
    play_token_lost: proc {},
    private_session_mode_changed: proc {},
    scrobble_error: proc {},
    start_playback: proc {},
    stop_playback: proc {},
    streaming_error: proc {},
    userinfo_updated: proc {},
  }
end

#credentials_blob_updated(session, blob) ⇒ Object

Parameters:



71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
# File 'lib/spotify/structs/session_callbacks.rb', line 71

class SessionCallbacks < Spotify::Struct
  layout :logged_in => callback([ Session, APIError ], :void),
         :logged_out => callback([ Session ], :void),
         :metadata_updated => callback([ Session ], :void),
         :connection_error => callback([ Session, APIError ], :void),
         :message_to_user => callback([ Session, UTF8String ], :void),
         :notify_main_thread => callback([ Session ], :void),
         :music_delivery => callback([ Session, AudioFormat.by_ref, :frames, :int ], :int),
         :play_token_lost => callback([ Session ], :void),
         :log_message => callback([ Session, UTF8String ], :void),
         :end_of_track => callback([ Session ], :void),
         :streaming_error => callback([ Session, APIError ], :void),
         :userinfo_updated => callback([ Session ], :void),
         :start_playback => callback([ Session ], :void),
         :stop_playback => callback([ Session ], :void),
         :get_audio_buffer_stats => callback([ Session, AudioBufferStats.by_ref ], :void),
         :offline_status_updated => callback([ Session ], :void),
         :offline_error => callback([ Session, APIError ], :void),
         :credentials_blob_updated => callback([ Session, :string ], :void),
         :connectionstate_updated => callback([ Session ], :void),
         :scrobble_error => callback([ Session, APIError ], :void),
         :private_session_mode_changed => callback([ Session, :bool ], :void)

  # Sane defaults, to avoid {Spotify::API#session_logout} segfaulting.
  DEFAULTS = {
    connection_error: proc {},
    connectionstate_updated: proc {},
    credentials_blob_updated: proc {},
    end_of_track: proc {},
    get_audio_buffer_stats: proc {},
    log_message: proc {},
    logged_in: proc {},
    logged_out: proc {},
    message_to_user: proc {},
    metadata_updated: proc {},
    music_delivery: proc {},
    notify_main_thread: proc {},
    offline_error: proc {},
    offline_status_updated: proc {},
    play_token_lost: proc {},
    private_session_mode_changed: proc {},
    scrobble_error: proc {},
    start_playback: proc {},
    stop_playback: proc {},
    streaming_error: proc {},
    userinfo_updated: proc {},
  }
end

#end_of_track(session) ⇒ Object

Parameters:



71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
# File 'lib/spotify/structs/session_callbacks.rb', line 71

class SessionCallbacks < Spotify::Struct
  layout :logged_in => callback([ Session, APIError ], :void),
         :logged_out => callback([ Session ], :void),
         :metadata_updated => callback([ Session ], :void),
         :connection_error => callback([ Session, APIError ], :void),
         :message_to_user => callback([ Session, UTF8String ], :void),
         :notify_main_thread => callback([ Session ], :void),
         :music_delivery => callback([ Session, AudioFormat.by_ref, :frames, :int ], :int),
         :play_token_lost => callback([ Session ], :void),
         :log_message => callback([ Session, UTF8String ], :void),
         :end_of_track => callback([ Session ], :void),
         :streaming_error => callback([ Session, APIError ], :void),
         :userinfo_updated => callback([ Session ], :void),
         :start_playback => callback([ Session ], :void),
         :stop_playback => callback([ Session ], :void),
         :get_audio_buffer_stats => callback([ Session, AudioBufferStats.by_ref ], :void),
         :offline_status_updated => callback([ Session ], :void),
         :offline_error => callback([ Session, APIError ], :void),
         :credentials_blob_updated => callback([ Session, :string ], :void),
         :connectionstate_updated => callback([ Session ], :void),
         :scrobble_error => callback([ Session, APIError ], :void),
         :private_session_mode_changed => callback([ Session, :bool ], :void)

  # Sane defaults, to avoid {Spotify::API#session_logout} segfaulting.
  DEFAULTS = {
    connection_error: proc {},
    connectionstate_updated: proc {},
    credentials_blob_updated: proc {},
    end_of_track: proc {},
    get_audio_buffer_stats: proc {},
    log_message: proc {},
    logged_in: proc {},
    logged_out: proc {},
    message_to_user: proc {},
    metadata_updated: proc {},
    music_delivery: proc {},
    notify_main_thread: proc {},
    offline_error: proc {},
    offline_status_updated: proc {},
    play_token_lost: proc {},
    private_session_mode_changed: proc {},
    scrobble_error: proc {},
    start_playback: proc {},
    stop_playback: proc {},
    streaming_error: proc {},
    userinfo_updated: proc {},
  }
end

#get_audio_buffer_stats(session, stats) ⇒ Object

Parameters:



71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
# File 'lib/spotify/structs/session_callbacks.rb', line 71

class SessionCallbacks < Spotify::Struct
  layout :logged_in => callback([ Session, APIError ], :void),
         :logged_out => callback([ Session ], :void),
         :metadata_updated => callback([ Session ], :void),
         :connection_error => callback([ Session, APIError ], :void),
         :message_to_user => callback([ Session, UTF8String ], :void),
         :notify_main_thread => callback([ Session ], :void),
         :music_delivery => callback([ Session, AudioFormat.by_ref, :frames, :int ], :int),
         :play_token_lost => callback([ Session ], :void),
         :log_message => callback([ Session, UTF8String ], :void),
         :end_of_track => callback([ Session ], :void),
         :streaming_error => callback([ Session, APIError ], :void),
         :userinfo_updated => callback([ Session ], :void),
         :start_playback => callback([ Session ], :void),
         :stop_playback => callback([ Session ], :void),
         :get_audio_buffer_stats => callback([ Session, AudioBufferStats.by_ref ], :void),
         :offline_status_updated => callback([ Session ], :void),
         :offline_error => callback([ Session, APIError ], :void),
         :credentials_blob_updated => callback([ Session, :string ], :void),
         :connectionstate_updated => callback([ Session ], :void),
         :scrobble_error => callback([ Session, APIError ], :void),
         :private_session_mode_changed => callback([ Session, :bool ], :void)

  # Sane defaults, to avoid {Spotify::API#session_logout} segfaulting.
  DEFAULTS = {
    connection_error: proc {},
    connectionstate_updated: proc {},
    credentials_blob_updated: proc {},
    end_of_track: proc {},
    get_audio_buffer_stats: proc {},
    log_message: proc {},
    logged_in: proc {},
    logged_out: proc {},
    message_to_user: proc {},
    metadata_updated: proc {},
    music_delivery: proc {},
    notify_main_thread: proc {},
    offline_error: proc {},
    offline_status_updated: proc {},
    play_token_lost: proc {},
    private_session_mode_changed: proc {},
    scrobble_error: proc {},
    start_playback: proc {},
    stop_playback: proc {},
    streaming_error: proc {},
    userinfo_updated: proc {},
  }
end

#log_message(session, message) ⇒ Object

Parameters:

  • session (Session)
  • message (String)


71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
# File 'lib/spotify/structs/session_callbacks.rb', line 71

class SessionCallbacks < Spotify::Struct
  layout :logged_in => callback([ Session, APIError ], :void),
         :logged_out => callback([ Session ], :void),
         :metadata_updated => callback([ Session ], :void),
         :connection_error => callback([ Session, APIError ], :void),
         :message_to_user => callback([ Session, UTF8String ], :void),
         :notify_main_thread => callback([ Session ], :void),
         :music_delivery => callback([ Session, AudioFormat.by_ref, :frames, :int ], :int),
         :play_token_lost => callback([ Session ], :void),
         :log_message => callback([ Session, UTF8String ], :void),
         :end_of_track => callback([ Session ], :void),
         :streaming_error => callback([ Session, APIError ], :void),
         :userinfo_updated => callback([ Session ], :void),
         :start_playback => callback([ Session ], :void),
         :stop_playback => callback([ Session ], :void),
         :get_audio_buffer_stats => callback([ Session, AudioBufferStats.by_ref ], :void),
         :offline_status_updated => callback([ Session ], :void),
         :offline_error => callback([ Session, APIError ], :void),
         :credentials_blob_updated => callback([ Session, :string ], :void),
         :connectionstate_updated => callback([ Session ], :void),
         :scrobble_error => callback([ Session, APIError ], :void),
         :private_session_mode_changed => callback([ Session, :bool ], :void)

  # Sane defaults, to avoid {Spotify::API#session_logout} segfaulting.
  DEFAULTS = {
    connection_error: proc {},
    connectionstate_updated: proc {},
    credentials_blob_updated: proc {},
    end_of_track: proc {},
    get_audio_buffer_stats: proc {},
    log_message: proc {},
    logged_in: proc {},
    logged_out: proc {},
    message_to_user: proc {},
    metadata_updated: proc {},
    music_delivery: proc {},
    notify_main_thread: proc {},
    offline_error: proc {},
    offline_status_updated: proc {},
    play_token_lost: proc {},
    private_session_mode_changed: proc {},
    scrobble_error: proc {},
    start_playback: proc {},
    stop_playback: proc {},
    streaming_error: proc {},
    userinfo_updated: proc {},
  }
end

#logged_in(session, error) ⇒ Object

Parameters:



71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
# File 'lib/spotify/structs/session_callbacks.rb', line 71

class SessionCallbacks < Spotify::Struct
  layout :logged_in => callback([ Session, APIError ], :void),
         :logged_out => callback([ Session ], :void),
         :metadata_updated => callback([ Session ], :void),
         :connection_error => callback([ Session, APIError ], :void),
         :message_to_user => callback([ Session, UTF8String ], :void),
         :notify_main_thread => callback([ Session ], :void),
         :music_delivery => callback([ Session, AudioFormat.by_ref, :frames, :int ], :int),
         :play_token_lost => callback([ Session ], :void),
         :log_message => callback([ Session, UTF8String ], :void),
         :end_of_track => callback([ Session ], :void),
         :streaming_error => callback([ Session, APIError ], :void),
         :userinfo_updated => callback([ Session ], :void),
         :start_playback => callback([ Session ], :void),
         :stop_playback => callback([ Session ], :void),
         :get_audio_buffer_stats => callback([ Session, AudioBufferStats.by_ref ], :void),
         :offline_status_updated => callback([ Session ], :void),
         :offline_error => callback([ Session, APIError ], :void),
         :credentials_blob_updated => callback([ Session, :string ], :void),
         :connectionstate_updated => callback([ Session ], :void),
         :scrobble_error => callback([ Session, APIError ], :void),
         :private_session_mode_changed => callback([ Session, :bool ], :void)

  # Sane defaults, to avoid {Spotify::API#session_logout} segfaulting.
  DEFAULTS = {
    connection_error: proc {},
    connectionstate_updated: proc {},
    credentials_blob_updated: proc {},
    end_of_track: proc {},
    get_audio_buffer_stats: proc {},
    log_message: proc {},
    logged_in: proc {},
    logged_out: proc {},
    message_to_user: proc {},
    metadata_updated: proc {},
    music_delivery: proc {},
    notify_main_thread: proc {},
    offline_error: proc {},
    offline_status_updated: proc {},
    play_token_lost: proc {},
    private_session_mode_changed: proc {},
    scrobble_error: proc {},
    start_playback: proc {},
    stop_playback: proc {},
    streaming_error: proc {},
    userinfo_updated: proc {},
  }
end

#logged_out(session) ⇒ Object

Parameters:



71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
# File 'lib/spotify/structs/session_callbacks.rb', line 71

class SessionCallbacks < Spotify::Struct
  layout :logged_in => callback([ Session, APIError ], :void),
         :logged_out => callback([ Session ], :void),
         :metadata_updated => callback([ Session ], :void),
         :connection_error => callback([ Session, APIError ], :void),
         :message_to_user => callback([ Session, UTF8String ], :void),
         :notify_main_thread => callback([ Session ], :void),
         :music_delivery => callback([ Session, AudioFormat.by_ref, :frames, :int ], :int),
         :play_token_lost => callback([ Session ], :void),
         :log_message => callback([ Session, UTF8String ], :void),
         :end_of_track => callback([ Session ], :void),
         :streaming_error => callback([ Session, APIError ], :void),
         :userinfo_updated => callback([ Session ], :void),
         :start_playback => callback([ Session ], :void),
         :stop_playback => callback([ Session ], :void),
         :get_audio_buffer_stats => callback([ Session, AudioBufferStats.by_ref ], :void),
         :offline_status_updated => callback([ Session ], :void),
         :offline_error => callback([ Session, APIError ], :void),
         :credentials_blob_updated => callback([ Session, :string ], :void),
         :connectionstate_updated => callback([ Session ], :void),
         :scrobble_error => callback([ Session, APIError ], :void),
         :private_session_mode_changed => callback([ Session, :bool ], :void)

  # Sane defaults, to avoid {Spotify::API#session_logout} segfaulting.
  DEFAULTS = {
    connection_error: proc {},
    connectionstate_updated: proc {},
    credentials_blob_updated: proc {},
    end_of_track: proc {},
    get_audio_buffer_stats: proc {},
    log_message: proc {},
    logged_in: proc {},
    logged_out: proc {},
    message_to_user: proc {},
    metadata_updated: proc {},
    music_delivery: proc {},
    notify_main_thread: proc {},
    offline_error: proc {},
    offline_status_updated: proc {},
    play_token_lost: proc {},
    private_session_mode_changed: proc {},
    scrobble_error: proc {},
    start_playback: proc {},
    stop_playback: proc {},
    streaming_error: proc {},
    userinfo_updated: proc {},
  }
end

#message_to_user(session, message) ⇒ Object

Parameters:

  • session (Session)
  • message (String)


71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
# File 'lib/spotify/structs/session_callbacks.rb', line 71

class SessionCallbacks < Spotify::Struct
  layout :logged_in => callback([ Session, APIError ], :void),
         :logged_out => callback([ Session ], :void),
         :metadata_updated => callback([ Session ], :void),
         :connection_error => callback([ Session, APIError ], :void),
         :message_to_user => callback([ Session, UTF8String ], :void),
         :notify_main_thread => callback([ Session ], :void),
         :music_delivery => callback([ Session, AudioFormat.by_ref, :frames, :int ], :int),
         :play_token_lost => callback([ Session ], :void),
         :log_message => callback([ Session, UTF8String ], :void),
         :end_of_track => callback([ Session ], :void),
         :streaming_error => callback([ Session, APIError ], :void),
         :userinfo_updated => callback([ Session ], :void),
         :start_playback => callback([ Session ], :void),
         :stop_playback => callback([ Session ], :void),
         :get_audio_buffer_stats => callback([ Session, AudioBufferStats.by_ref ], :void),
         :offline_status_updated => callback([ Session ], :void),
         :offline_error => callback([ Session, APIError ], :void),
         :credentials_blob_updated => callback([ Session, :string ], :void),
         :connectionstate_updated => callback([ Session ], :void),
         :scrobble_error => callback([ Session, APIError ], :void),
         :private_session_mode_changed => callback([ Session, :bool ], :void)

  # Sane defaults, to avoid {Spotify::API#session_logout} segfaulting.
  DEFAULTS = {
    connection_error: proc {},
    connectionstate_updated: proc {},
    credentials_blob_updated: proc {},
    end_of_track: proc {},
    get_audio_buffer_stats: proc {},
    log_message: proc {},
    logged_in: proc {},
    logged_out: proc {},
    message_to_user: proc {},
    metadata_updated: proc {},
    music_delivery: proc {},
    notify_main_thread: proc {},
    offline_error: proc {},
    offline_status_updated: proc {},
    play_token_lost: proc {},
    private_session_mode_changed: proc {},
    scrobble_error: proc {},
    start_playback: proc {},
    stop_playback: proc {},
    streaming_error: proc {},
    userinfo_updated: proc {},
  }
end

#metadata_updated(session) ⇒ Object

Parameters:



71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
# File 'lib/spotify/structs/session_callbacks.rb', line 71

class SessionCallbacks < Spotify::Struct
  layout :logged_in => callback([ Session, APIError ], :void),
         :logged_out => callback([ Session ], :void),
         :metadata_updated => callback([ Session ], :void),
         :connection_error => callback([ Session, APIError ], :void),
         :message_to_user => callback([ Session, UTF8String ], :void),
         :notify_main_thread => callback([ Session ], :void),
         :music_delivery => callback([ Session, AudioFormat.by_ref, :frames, :int ], :int),
         :play_token_lost => callback([ Session ], :void),
         :log_message => callback([ Session, UTF8String ], :void),
         :end_of_track => callback([ Session ], :void),
         :streaming_error => callback([ Session, APIError ], :void),
         :userinfo_updated => callback([ Session ], :void),
         :start_playback => callback([ Session ], :void),
         :stop_playback => callback([ Session ], :void),
         :get_audio_buffer_stats => callback([ Session, AudioBufferStats.by_ref ], :void),
         :offline_status_updated => callback([ Session ], :void),
         :offline_error => callback([ Session, APIError ], :void),
         :credentials_blob_updated => callback([ Session, :string ], :void),
         :connectionstate_updated => callback([ Session ], :void),
         :scrobble_error => callback([ Session, APIError ], :void),
         :private_session_mode_changed => callback([ Session, :bool ], :void)

  # Sane defaults, to avoid {Spotify::API#session_logout} segfaulting.
  DEFAULTS = {
    connection_error: proc {},
    connectionstate_updated: proc {},
    credentials_blob_updated: proc {},
    end_of_track: proc {},
    get_audio_buffer_stats: proc {},
    log_message: proc {},
    logged_in: proc {},
    logged_out: proc {},
    message_to_user: proc {},
    metadata_updated: proc {},
    music_delivery: proc {},
    notify_main_thread: proc {},
    offline_error: proc {},
    offline_status_updated: proc {},
    play_token_lost: proc {},
    private_session_mode_changed: proc {},
    scrobble_error: proc {},
    start_playback: proc {},
    stop_playback: proc {},
    streaming_error: proc {},
    userinfo_updated: proc {},
  }
end

#music_delivery(session, audio_format, frames_pointer, frames_length) ⇒ Integer

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

Parameters:

  • session (Session)
  • audio_format (AudioFormat)
  • frames_pointer (FFI::Pointer)
  • frames_length (Integer)

Returns:

  • (Integer)

    number of consumed frames, 0..frames_length



71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
# File 'lib/spotify/structs/session_callbacks.rb', line 71

class SessionCallbacks < Spotify::Struct
  layout :logged_in => callback([ Session, APIError ], :void),
         :logged_out => callback([ Session ], :void),
         :metadata_updated => callback([ Session ], :void),
         :connection_error => callback([ Session, APIError ], :void),
         :message_to_user => callback([ Session, UTF8String ], :void),
         :notify_main_thread => callback([ Session ], :void),
         :music_delivery => callback([ Session, AudioFormat.by_ref, :frames, :int ], :int),
         :play_token_lost => callback([ Session ], :void),
         :log_message => callback([ Session, UTF8String ], :void),
         :end_of_track => callback([ Session ], :void),
         :streaming_error => callback([ Session, APIError ], :void),
         :userinfo_updated => callback([ Session ], :void),
         :start_playback => callback([ Session ], :void),
         :stop_playback => callback([ Session ], :void),
         :get_audio_buffer_stats => callback([ Session, AudioBufferStats.by_ref ], :void),
         :offline_status_updated => callback([ Session ], :void),
         :offline_error => callback([ Session, APIError ], :void),
         :credentials_blob_updated => callback([ Session, :string ], :void),
         :connectionstate_updated => callback([ Session ], :void),
         :scrobble_error => callback([ Session, APIError ], :void),
         :private_session_mode_changed => callback([ Session, :bool ], :void)

  # Sane defaults, to avoid {Spotify::API#session_logout} segfaulting.
  DEFAULTS = {
    connection_error: proc {},
    connectionstate_updated: proc {},
    credentials_blob_updated: proc {},
    end_of_track: proc {},
    get_audio_buffer_stats: proc {},
    log_message: proc {},
    logged_in: proc {},
    logged_out: proc {},
    message_to_user: proc {},
    metadata_updated: proc {},
    music_delivery: proc {},
    notify_main_thread: proc {},
    offline_error: proc {},
    offline_status_updated: proc {},
    play_token_lost: proc {},
    private_session_mode_changed: proc {},
    scrobble_error: proc {},
    start_playback: proc {},
    stop_playback: proc {},
    streaming_error: proc {},
    userinfo_updated: proc {},
  }
end

#notify_main_thread(session) ⇒ Object

Parameters:



71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
# File 'lib/spotify/structs/session_callbacks.rb', line 71

class SessionCallbacks < Spotify::Struct
  layout :logged_in => callback([ Session, APIError ], :void),
         :logged_out => callback([ Session ], :void),
         :metadata_updated => callback([ Session ], :void),
         :connection_error => callback([ Session, APIError ], :void),
         :message_to_user => callback([ Session, UTF8String ], :void),
         :notify_main_thread => callback([ Session ], :void),
         :music_delivery => callback([ Session, AudioFormat.by_ref, :frames, :int ], :int),
         :play_token_lost => callback([ Session ], :void),
         :log_message => callback([ Session, UTF8String ], :void),
         :end_of_track => callback([ Session ], :void),
         :streaming_error => callback([ Session, APIError ], :void),
         :userinfo_updated => callback([ Session ], :void),
         :start_playback => callback([ Session ], :void),
         :stop_playback => callback([ Session ], :void),
         :get_audio_buffer_stats => callback([ Session, AudioBufferStats.by_ref ], :void),
         :offline_status_updated => callback([ Session ], :void),
         :offline_error => callback([ Session, APIError ], :void),
         :credentials_blob_updated => callback([ Session, :string ], :void),
         :connectionstate_updated => callback([ Session ], :void),
         :scrobble_error => callback([ Session, APIError ], :void),
         :private_session_mode_changed => callback([ Session, :bool ], :void)

  # Sane defaults, to avoid {Spotify::API#session_logout} segfaulting.
  DEFAULTS = {
    connection_error: proc {},
    connectionstate_updated: proc {},
    credentials_blob_updated: proc {},
    end_of_track: proc {},
    get_audio_buffer_stats: proc {},
    log_message: proc {},
    logged_in: proc {},
    logged_out: proc {},
    message_to_user: proc {},
    metadata_updated: proc {},
    music_delivery: proc {},
    notify_main_thread: proc {},
    offline_error: proc {},
    offline_status_updated: proc {},
    play_token_lost: proc {},
    private_session_mode_changed: proc {},
    scrobble_error: proc {},
    start_playback: proc {},
    stop_playback: proc {},
    streaming_error: proc {},
    userinfo_updated: proc {},
  }
end

#offline_error(session, error) ⇒ Object

Parameters:



71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
# File 'lib/spotify/structs/session_callbacks.rb', line 71

class SessionCallbacks < Spotify::Struct
  layout :logged_in => callback([ Session, APIError ], :void),
         :logged_out => callback([ Session ], :void),
         :metadata_updated => callback([ Session ], :void),
         :connection_error => callback([ Session, APIError ], :void),
         :message_to_user => callback([ Session, UTF8String ], :void),
         :notify_main_thread => callback([ Session ], :void),
         :music_delivery => callback([ Session, AudioFormat.by_ref, :frames, :int ], :int),
         :play_token_lost => callback([ Session ], :void),
         :log_message => callback([ Session, UTF8String ], :void),
         :end_of_track => callback([ Session ], :void),
         :streaming_error => callback([ Session, APIError ], :void),
         :userinfo_updated => callback([ Session ], :void),
         :start_playback => callback([ Session ], :void),
         :stop_playback => callback([ Session ], :void),
         :get_audio_buffer_stats => callback([ Session, AudioBufferStats.by_ref ], :void),
         :offline_status_updated => callback([ Session ], :void),
         :offline_error => callback([ Session, APIError ], :void),
         :credentials_blob_updated => callback([ Session, :string ], :void),
         :connectionstate_updated => callback([ Session ], :void),
         :scrobble_error => callback([ Session, APIError ], :void),
         :private_session_mode_changed => callback([ Session, :bool ], :void)

  # Sane defaults, to avoid {Spotify::API#session_logout} segfaulting.
  DEFAULTS = {
    connection_error: proc {},
    connectionstate_updated: proc {},
    credentials_blob_updated: proc {},
    end_of_track: proc {},
    get_audio_buffer_stats: proc {},
    log_message: proc {},
    logged_in: proc {},
    logged_out: proc {},
    message_to_user: proc {},
    metadata_updated: proc {},
    music_delivery: proc {},
    notify_main_thread: proc {},
    offline_error: proc {},
    offline_status_updated: proc {},
    play_token_lost: proc {},
    private_session_mode_changed: proc {},
    scrobble_error: proc {},
    start_playback: proc {},
    stop_playback: proc {},
    streaming_error: proc {},
    userinfo_updated: proc {},
  }
end

#offline_status_updated(session) ⇒ Object

Parameters:



71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
# File 'lib/spotify/structs/session_callbacks.rb', line 71

class SessionCallbacks < Spotify::Struct
  layout :logged_in => callback([ Session, APIError ], :void),
         :logged_out => callback([ Session ], :void),
         :metadata_updated => callback([ Session ], :void),
         :connection_error => callback([ Session, APIError ], :void),
         :message_to_user => callback([ Session, UTF8String ], :void),
         :notify_main_thread => callback([ Session ], :void),
         :music_delivery => callback([ Session, AudioFormat.by_ref, :frames, :int ], :int),
         :play_token_lost => callback([ Session ], :void),
         :log_message => callback([ Session, UTF8String ], :void),
         :end_of_track => callback([ Session ], :void),
         :streaming_error => callback([ Session, APIError ], :void),
         :userinfo_updated => callback([ Session ], :void),
         :start_playback => callback([ Session ], :void),
         :stop_playback => callback([ Session ], :void),
         :get_audio_buffer_stats => callback([ Session, AudioBufferStats.by_ref ], :void),
         :offline_status_updated => callback([ Session ], :void),
         :offline_error => callback([ Session, APIError ], :void),
         :credentials_blob_updated => callback([ Session, :string ], :void),
         :connectionstate_updated => callback([ Session ], :void),
         :scrobble_error => callback([ Session, APIError ], :void),
         :private_session_mode_changed => callback([ Session, :bool ], :void)

  # Sane defaults, to avoid {Spotify::API#session_logout} segfaulting.
  DEFAULTS = {
    connection_error: proc {},
    connectionstate_updated: proc {},
    credentials_blob_updated: proc {},
    end_of_track: proc {},
    get_audio_buffer_stats: proc {},
    log_message: proc {},
    logged_in: proc {},
    logged_out: proc {},
    message_to_user: proc {},
    metadata_updated: proc {},
    music_delivery: proc {},
    notify_main_thread: proc {},
    offline_error: proc {},
    offline_status_updated: proc {},
    play_token_lost: proc {},
    private_session_mode_changed: proc {},
    scrobble_error: proc {},
    start_playback: proc {},
    stop_playback: proc {},
    streaming_error: proc {},
    userinfo_updated: proc {},
  }
end

#play_token_lost(session) ⇒ Object

Parameters:



71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
# File 'lib/spotify/structs/session_callbacks.rb', line 71

class SessionCallbacks < Spotify::Struct
  layout :logged_in => callback([ Session, APIError ], :void),
         :logged_out => callback([ Session ], :void),
         :metadata_updated => callback([ Session ], :void),
         :connection_error => callback([ Session, APIError ], :void),
         :message_to_user => callback([ Session, UTF8String ], :void),
         :notify_main_thread => callback([ Session ], :void),
         :music_delivery => callback([ Session, AudioFormat.by_ref, :frames, :int ], :int),
         :play_token_lost => callback([ Session ], :void),
         :log_message => callback([ Session, UTF8String ], :void),
         :end_of_track => callback([ Session ], :void),
         :streaming_error => callback([ Session, APIError ], :void),
         :userinfo_updated => callback([ Session ], :void),
         :start_playback => callback([ Session ], :void),
         :stop_playback => callback([ Session ], :void),
         :get_audio_buffer_stats => callback([ Session, AudioBufferStats.by_ref ], :void),
         :offline_status_updated => callback([ Session ], :void),
         :offline_error => callback([ Session, APIError ], :void),
         :credentials_blob_updated => callback([ Session, :string ], :void),
         :connectionstate_updated => callback([ Session ], :void),
         :scrobble_error => callback([ Session, APIError ], :void),
         :private_session_mode_changed => callback([ Session, :bool ], :void)

  # Sane defaults, to avoid {Spotify::API#session_logout} segfaulting.
  DEFAULTS = {
    connection_error: proc {},
    connectionstate_updated: proc {},
    credentials_blob_updated: proc {},
    end_of_track: proc {},
    get_audio_buffer_stats: proc {},
    log_message: proc {},
    logged_in: proc {},
    logged_out: proc {},
    message_to_user: proc {},
    metadata_updated: proc {},
    music_delivery: proc {},
    notify_main_thread: proc {},
    offline_error: proc {},
    offline_status_updated: proc {},
    play_token_lost: proc {},
    private_session_mode_changed: proc {},
    scrobble_error: proc {},
    start_playback: proc {},
    stop_playback: proc {},
    streaming_error: proc {},
    userinfo_updated: proc {},
  }
end

#private_session_mode_changed(session, is_private) ⇒ Object

Parameters:

  • session (Session)
  • is_private (Boolean)


71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
# File 'lib/spotify/structs/session_callbacks.rb', line 71

class SessionCallbacks < Spotify::Struct
  layout :logged_in => callback([ Session, APIError ], :void),
         :logged_out => callback([ Session ], :void),
         :metadata_updated => callback([ Session ], :void),
         :connection_error => callback([ Session, APIError ], :void),
         :message_to_user => callback([ Session, UTF8String ], :void),
         :notify_main_thread => callback([ Session ], :void),
         :music_delivery => callback([ Session, AudioFormat.by_ref, :frames, :int ], :int),
         :play_token_lost => callback([ Session ], :void),
         :log_message => callback([ Session, UTF8String ], :void),
         :end_of_track => callback([ Session ], :void),
         :streaming_error => callback([ Session, APIError ], :void),
         :userinfo_updated => callback([ Session ], :void),
         :start_playback => callback([ Session ], :void),
         :stop_playback => callback([ Session ], :void),
         :get_audio_buffer_stats => callback([ Session, AudioBufferStats.by_ref ], :void),
         :offline_status_updated => callback([ Session ], :void),
         :offline_error => callback([ Session, APIError ], :void),
         :credentials_blob_updated => callback([ Session, :string ], :void),
         :connectionstate_updated => callback([ Session ], :void),
         :scrobble_error => callback([ Session, APIError ], :void),
         :private_session_mode_changed => callback([ Session, :bool ], :void)

  # Sane defaults, to avoid {Spotify::API#session_logout} segfaulting.
  DEFAULTS = {
    connection_error: proc {},
    connectionstate_updated: proc {},
    credentials_blob_updated: proc {},
    end_of_track: proc {},
    get_audio_buffer_stats: proc {},
    log_message: proc {},
    logged_in: proc {},
    logged_out: proc {},
    message_to_user: proc {},
    metadata_updated: proc {},
    music_delivery: proc {},
    notify_main_thread: proc {},
    offline_error: proc {},
    offline_status_updated: proc {},
    play_token_lost: proc {},
    private_session_mode_changed: proc {},
    scrobble_error: proc {},
    start_playback: proc {},
    stop_playback: proc {},
    streaming_error: proc {},
    userinfo_updated: proc {},
  }
end

#scrobble_error(session, error) ⇒ Object

Parameters:



71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
# File 'lib/spotify/structs/session_callbacks.rb', line 71

class SessionCallbacks < Spotify::Struct
  layout :logged_in => callback([ Session, APIError ], :void),
         :logged_out => callback([ Session ], :void),
         :metadata_updated => callback([ Session ], :void),
         :connection_error => callback([ Session, APIError ], :void),
         :message_to_user => callback([ Session, UTF8String ], :void),
         :notify_main_thread => callback([ Session ], :void),
         :music_delivery => callback([ Session, AudioFormat.by_ref, :frames, :int ], :int),
         :play_token_lost => callback([ Session ], :void),
         :log_message => callback([ Session, UTF8String ], :void),
         :end_of_track => callback([ Session ], :void),
         :streaming_error => callback([ Session, APIError ], :void),
         :userinfo_updated => callback([ Session ], :void),
         :start_playback => callback([ Session ], :void),
         :stop_playback => callback([ Session ], :void),
         :get_audio_buffer_stats => callback([ Session, AudioBufferStats.by_ref ], :void),
         :offline_status_updated => callback([ Session ], :void),
         :offline_error => callback([ Session, APIError ], :void),
         :credentials_blob_updated => callback([ Session, :string ], :void),
         :connectionstate_updated => callback([ Session ], :void),
         :scrobble_error => callback([ Session, APIError ], :void),
         :private_session_mode_changed => callback([ Session, :bool ], :void)

  # Sane defaults, to avoid {Spotify::API#session_logout} segfaulting.
  DEFAULTS = {
    connection_error: proc {},
    connectionstate_updated: proc {},
    credentials_blob_updated: proc {},
    end_of_track: proc {},
    get_audio_buffer_stats: proc {},
    log_message: proc {},
    logged_in: proc {},
    logged_out: proc {},
    message_to_user: proc {},
    metadata_updated: proc {},
    music_delivery: proc {},
    notify_main_thread: proc {},
    offline_error: proc {},
    offline_status_updated: proc {},
    play_token_lost: proc {},
    private_session_mode_changed: proc {},
    scrobble_error: proc {},
    start_playback: proc {},
    stop_playback: proc {},
    streaming_error: proc {},
    userinfo_updated: proc {},
  }
end

#start_playback(session) ⇒ Object

Parameters:



71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
# File 'lib/spotify/structs/session_callbacks.rb', line 71

class SessionCallbacks < Spotify::Struct
  layout :logged_in => callback([ Session, APIError ], :void),
         :logged_out => callback([ Session ], :void),
         :metadata_updated => callback([ Session ], :void),
         :connection_error => callback([ Session, APIError ], :void),
         :message_to_user => callback([ Session, UTF8String ], :void),
         :notify_main_thread => callback([ Session ], :void),
         :music_delivery => callback([ Session, AudioFormat.by_ref, :frames, :int ], :int),
         :play_token_lost => callback([ Session ], :void),
         :log_message => callback([ Session, UTF8String ], :void),
         :end_of_track => callback([ Session ], :void),
         :streaming_error => callback([ Session, APIError ], :void),
         :userinfo_updated => callback([ Session ], :void),
         :start_playback => callback([ Session ], :void),
         :stop_playback => callback([ Session ], :void),
         :get_audio_buffer_stats => callback([ Session, AudioBufferStats.by_ref ], :void),
         :offline_status_updated => callback([ Session ], :void),
         :offline_error => callback([ Session, APIError ], :void),
         :credentials_blob_updated => callback([ Session, :string ], :void),
         :connectionstate_updated => callback([ Session ], :void),
         :scrobble_error => callback([ Session, APIError ], :void),
         :private_session_mode_changed => callback([ Session, :bool ], :void)

  # Sane defaults, to avoid {Spotify::API#session_logout} segfaulting.
  DEFAULTS = {
    connection_error: proc {},
    connectionstate_updated: proc {},
    credentials_blob_updated: proc {},
    end_of_track: proc {},
    get_audio_buffer_stats: proc {},
    log_message: proc {},
    logged_in: proc {},
    logged_out: proc {},
    message_to_user: proc {},
    metadata_updated: proc {},
    music_delivery: proc {},
    notify_main_thread: proc {},
    offline_error: proc {},
    offline_status_updated: proc {},
    play_token_lost: proc {},
    private_session_mode_changed: proc {},
    scrobble_error: proc {},
    start_playback: proc {},
    stop_playback: proc {},
    streaming_error: proc {},
    userinfo_updated: proc {},
  }
end

#stop_playback(session) ⇒ Object

Parameters:



71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
# File 'lib/spotify/structs/session_callbacks.rb', line 71

class SessionCallbacks < Spotify::Struct
  layout :logged_in => callback([ Session, APIError ], :void),
         :logged_out => callback([ Session ], :void),
         :metadata_updated => callback([ Session ], :void),
         :connection_error => callback([ Session, APIError ], :void),
         :message_to_user => callback([ Session, UTF8String ], :void),
         :notify_main_thread => callback([ Session ], :void),
         :music_delivery => callback([ Session, AudioFormat.by_ref, :frames, :int ], :int),
         :play_token_lost => callback([ Session ], :void),
         :log_message => callback([ Session, UTF8String ], :void),
         :end_of_track => callback([ Session ], :void),
         :streaming_error => callback([ Session, APIError ], :void),
         :userinfo_updated => callback([ Session ], :void),
         :start_playback => callback([ Session ], :void),
         :stop_playback => callback([ Session ], :void),
         :get_audio_buffer_stats => callback([ Session, AudioBufferStats.by_ref ], :void),
         :offline_status_updated => callback([ Session ], :void),
         :offline_error => callback([ Session, APIError ], :void),
         :credentials_blob_updated => callback([ Session, :string ], :void),
         :connectionstate_updated => callback([ Session ], :void),
         :scrobble_error => callback([ Session, APIError ], :void),
         :private_session_mode_changed => callback([ Session, :bool ], :void)

  # Sane defaults, to avoid {Spotify::API#session_logout} segfaulting.
  DEFAULTS = {
    connection_error: proc {},
    connectionstate_updated: proc {},
    credentials_blob_updated: proc {},
    end_of_track: proc {},
    get_audio_buffer_stats: proc {},
    log_message: proc {},
    logged_in: proc {},
    logged_out: proc {},
    message_to_user: proc {},
    metadata_updated: proc {},
    music_delivery: proc {},
    notify_main_thread: proc {},
    offline_error: proc {},
    offline_status_updated: proc {},
    play_token_lost: proc {},
    private_session_mode_changed: proc {},
    scrobble_error: proc {},
    start_playback: proc {},
    stop_playback: proc {},
    streaming_error: proc {},
    userinfo_updated: proc {},
  }
end

#streaming_error(session, error) ⇒ Object

Parameters:



71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
# File 'lib/spotify/structs/session_callbacks.rb', line 71

class SessionCallbacks < Spotify::Struct
  layout :logged_in => callback([ Session, APIError ], :void),
         :logged_out => callback([ Session ], :void),
         :metadata_updated => callback([ Session ], :void),
         :connection_error => callback([ Session, APIError ], :void),
         :message_to_user => callback([ Session, UTF8String ], :void),
         :notify_main_thread => callback([ Session ], :void),
         :music_delivery => callback([ Session, AudioFormat.by_ref, :frames, :int ], :int),
         :play_token_lost => callback([ Session ], :void),
         :log_message => callback([ Session, UTF8String ], :void),
         :end_of_track => callback([ Session ], :void),
         :streaming_error => callback([ Session, APIError ], :void),
         :userinfo_updated => callback([ Session ], :void),
         :start_playback => callback([ Session ], :void),
         :stop_playback => callback([ Session ], :void),
         :get_audio_buffer_stats => callback([ Session, AudioBufferStats.by_ref ], :void),
         :offline_status_updated => callback([ Session ], :void),
         :offline_error => callback([ Session, APIError ], :void),
         :credentials_blob_updated => callback([ Session, :string ], :void),
         :connectionstate_updated => callback([ Session ], :void),
         :scrobble_error => callback([ Session, APIError ], :void),
         :private_session_mode_changed => callback([ Session, :bool ], :void)

  # Sane defaults, to avoid {Spotify::API#session_logout} segfaulting.
  DEFAULTS = {
    connection_error: proc {},
    connectionstate_updated: proc {},
    credentials_blob_updated: proc {},
    end_of_track: proc {},
    get_audio_buffer_stats: proc {},
    log_message: proc {},
    logged_in: proc {},
    logged_out: proc {},
    message_to_user: proc {},
    metadata_updated: proc {},
    music_delivery: proc {},
    notify_main_thread: proc {},
    offline_error: proc {},
    offline_status_updated: proc {},
    play_token_lost: proc {},
    private_session_mode_changed: proc {},
    scrobble_error: proc {},
    start_playback: proc {},
    stop_playback: proc {},
    streaming_error: proc {},
    userinfo_updated: proc {},
  }
end

#userinfo_updated(session) ⇒ Object

Parameters:



71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
# File 'lib/spotify/structs/session_callbacks.rb', line 71

class SessionCallbacks < Spotify::Struct
  layout :logged_in => callback([ Session, APIError ], :void),
         :logged_out => callback([ Session ], :void),
         :metadata_updated => callback([ Session ], :void),
         :connection_error => callback([ Session, APIError ], :void),
         :message_to_user => callback([ Session, UTF8String ], :void),
         :notify_main_thread => callback([ Session ], :void),
         :music_delivery => callback([ Session, AudioFormat.by_ref, :frames, :int ], :int),
         :play_token_lost => callback([ Session ], :void),
         :log_message => callback([ Session, UTF8String ], :void),
         :end_of_track => callback([ Session ], :void),
         :streaming_error => callback([ Session, APIError ], :void),
         :userinfo_updated => callback([ Session ], :void),
         :start_playback => callback([ Session ], :void),
         :stop_playback => callback([ Session ], :void),
         :get_audio_buffer_stats => callback([ Session, AudioBufferStats.by_ref ], :void),
         :offline_status_updated => callback([ Session ], :void),
         :offline_error => callback([ Session, APIError ], :void),
         :credentials_blob_updated => callback([ Session, :string ], :void),
         :connectionstate_updated => callback([ Session ], :void),
         :scrobble_error => callback([ Session, APIError ], :void),
         :private_session_mode_changed => callback([ Session, :bool ], :void)

  # Sane defaults, to avoid {Spotify::API#session_logout} segfaulting.
  DEFAULTS = {
    connection_error: proc {},
    connectionstate_updated: proc {},
    credentials_blob_updated: proc {},
    end_of_track: proc {},
    get_audio_buffer_stats: proc {},
    log_message: proc {},
    logged_in: proc {},
    logged_out: proc {},
    message_to_user: proc {},
    metadata_updated: proc {},
    music_delivery: proc {},
    notify_main_thread: proc {},
    offline_error: proc {},
    offline_status_updated: proc {},
    play_token_lost: proc {},
    private_session_mode_changed: proc {},
    scrobble_error: proc {},
    start_playback: proc {},
    stop_playback: proc {},
    streaming_error: proc {},
    userinfo_updated: proc {},
  }
end