예제 #1
0
        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");
            });
        }
예제 #2
0
        protected IAlbum GetAlbumIndex(int index)
        {
            AssertHandle();

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

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

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