static Session() { lock (libspotify.Mutex) { callbacks = new libspotify.sp_session_callbacks(); callbacks.connection_error = Marshal.GetFunctionPointerForDelegate(connection_error); callbacks.logged_in = Marshal.GetFunctionPointerForDelegate(logged_in); callbacks.logged_out = Marshal.GetFunctionPointerForDelegate(logged_out); callbacks.log_message = Marshal.GetFunctionPointerForDelegate(log_message); callbacks.message_to_user = Marshal.GetFunctionPointerForDelegate(message_to_user); callbacks.metadata_updated = Marshal.GetFunctionPointerForDelegate(metadata_updated); callbacks.music_delivery = Marshal.GetFunctionPointerForDelegate(music_delivery); callbacks.notify_main_thread = Marshal.GetFunctionPointerForDelegate(notify_main_thread); callbacks.play_token_lost = Marshal.GetFunctionPointerForDelegate(play_token_lost); callbacks.end_of_track = Marshal.GetFunctionPointerForDelegate(end_of_track); callbacks.streaming_error = Marshal.GetFunctionPointerForDelegate(streaming_error); callbacks.userinfo_updated = Marshal.GetFunctionPointerForDelegate(userinfo_updated); } }
static Session() { lock(libspotify.Mutex) { callbacks = new libspotify.sp_session_callbacks(); callbacks.connection_error = Marshal.GetFunctionPointerForDelegate(connection_error); callbacks.logged_in = Marshal.GetFunctionPointerForDelegate(logged_in); callbacks.logged_out = Marshal.GetFunctionPointerForDelegate(logged_out); callbacks.log_message = Marshal.GetFunctionPointerForDelegate(log_message); callbacks.message_to_user = Marshal.GetFunctionPointerForDelegate(message_to_user); callbacks.metadata_updated = Marshal.GetFunctionPointerForDelegate(metadata_updated); callbacks.music_delivery = Marshal.GetFunctionPointerForDelegate(music_delivery); callbacks.notify_main_thread = Marshal.GetFunctionPointerForDelegate(notify_main_thread); callbacks.play_token_lost = Marshal.GetFunctionPointerForDelegate(play_token_lost); callbacks.end_of_track = Marshal.GetFunctionPointerForDelegate(end_of_track); callbacks.streaming_error = Marshal.GetFunctionPointerForDelegate(streaming_error); callbacks.userinfo_updated = Marshal.GetFunctionPointerForDelegate(userinfo_updated); } }