public override void Initialize()
        {
            lock (Spotify.Mutex)
            {
                Spotify.sp_track_add_ref(Handle);
            }

            _artists = new Lazy <IArray <IArtist> >(() => new DelegateArray <IArtist>(GetArtistCount, GetArtistIndex));
            _album   = new Lazy <IAlbum>(() =>
            {
                AssertHandle();

                if (this.WaitUntilLoaded())
                {
                    lock (Spotify.Mutex)
                    {
                        if (Error == Error.OK)
                        {
                            return(AlbumManager.Get(Session, Spotify.sp_track_album(Handle)));
                        }
                    }
                }

                if (Error == Error.OtherPermanent)
                {
                    return(null);
                }

                throw new InvalidOperationException("Track not loaded yet");
            });
        }
        protected IAlbum GetAlbumIndex(int index)
        {
            AssertHandle();

            lock (Spotify.Mutex)
            {
                return(AlbumManager.Get(Session, Spotify.sp_search_album(Handle, index)));
            }
        }
Exemple #3
0
        private IAlbum GetAlbumAtIndex(int index)
        {
            AssertHandle();

            lock (Spotify.Mutex)
            {
                return(AlbumManager.Get(Session, Spotify.sp_toplistbrowse_album(Handle, index)));
            }
        }
Exemple #4
0
        public override void Initialize()
        {
            _album = new Lazy <IAlbum>(
                () =>
            {
                AssertHandle();

                lock (Spotify.Mutex)
                {
                    return(AlbumManager.Get(Session, Spotify.sp_link_as_album(Handle)));
                }
            });
        }