static PlaylistContainer() { lock (libspotify.Mutex) { callbacks = new libspotify.sp_playlistcontainer_callbacks(); callbacks.playlist_added = Marshal.GetFunctionPointerForDelegate(playlist_added); callbacks.playlist_moved = Marshal.GetFunctionPointerForDelegate(playlist_moved); callbacks.playlist_removed = Marshal.GetFunctionPointerForDelegate(playlist_removed); callbacks.container_loaded = Marshal.GetFunctionPointerForDelegate(container_loaded); int size = Marshal.SizeOf(callbacks); callbacksPtr = Marshal.AllocHGlobal(size); Marshal.StructureToPtr(callbacks, callbacksPtr, true); } }
static PlaylistContainer() { lock(libspotify.Mutex) { callbacks = new libspotify.sp_playlistcontainer_callbacks(); callbacks.playlist_added = Marshal.GetFunctionPointerForDelegate(playlist_added); callbacks.playlist_moved = Marshal.GetFunctionPointerForDelegate(playlist_moved); callbacks.playlist_removed = Marshal.GetFunctionPointerForDelegate(playlist_removed); callbacks.container_loaded = Marshal.GetFunctionPointerForDelegate(container_loaded); int size = Marshal.SizeOf(callbacks); callbacksPtr = Marshal.AllocHGlobal(size); Marshal.StructureToPtr(callbacks, callbacksPtr, true); } }