internal Track(IntPtr trackPtr, Session session) { this.session = session; TrackPtr = trackPtr; Wait.For(IsLoaded); SetTrackMetaData(); }
internal AlbumCover(IntPtr albumPtr, Session session) { var coverPtr = libspotify.sp_album_cover(albumPtr, libspotify.sp_image_size.SP_IMAGE_SIZE_LARGE); var ptr = libspotify.sp_image_create(session.SessionPtr, coverPtr); ImagePtr = ptr; // sp_image_loaded seems to always be returning true, check for bytes returned Wait.For(LoadImageBytes); }
internal PlaylistContainer(Session session) { this.session = session; PlaylistContainerPtr = libspotify.sp_session_playlistcontainer(session.SessionPtr); AddCallbacks(); Wait.For(() => libspotify.sp_playlistcontainer_is_loaded(PlaylistContainerPtr)); LoadPlaylists(); }
internal Playlist(IntPtr playlistPtr, Session session) { this.session = session; if (playlistPtr == IntPtr.Zero) { throw new InvalidOperationException("Invalid playlist pointer."); } PlaylistPtr = playlistPtr; Wait.For(() => libspotify.sp_playlist_is_loaded(PlaylistPtr)); SetPlaylistInfo(playlistPtr); }
public SpotSharp(byte[] appkey) { session = new Session(this, appkey); new Task(StartMainSpotifyThread).Start(); }