Пример #1
0
 internal Track(IntPtr trackPtr, Session session)
 {
     this.session = session;
     TrackPtr = trackPtr;
     Wait.For(IsLoaded);
     SetTrackMetaData();
 }
Пример #2
0
        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);
        }
Пример #3
0
        internal PlaylistContainer(Session session)
        {
            this.session = session;

            PlaylistContainerPtr = libspotify.sp_session_playlistcontainer(session.SessionPtr);
            AddCallbacks();
            Wait.For(() => libspotify.sp_playlistcontainer_is_loaded(PlaylistContainerPtr));

            LoadPlaylists();
        }
Пример #4
0
        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);
        }
Пример #5
0
        public SpotSharp(byte[] appkey)
        {
            session = new Session(this, appkey);

            new Task(StartMainSpotifyThread).Start();
        }