예제 #1
0
파일: Spotify.cs 프로젝트: EraYaN/Moonstone
        public static IntPtr[] GetArtistAlbums(IntPtr artistPtr)
        {
            using (Artist artist = new Artist(artistPtr)) {

                if (!waitFor(delegate {
                    return libspotify.sp_artist_is_loaded(artist.ArtistPtr);
                }, REQUEST_TIMEOUT))
                    Log.Debug(Plugin.LOG_MODULE, "GetArtistAlbums() TIMEOUT waiting for artist to load");

                if (artist.BeginBrowse()) {

                    if (!waitFor(delegate() {
                        return artist.IsBrowseComplete;
                    }, REQUEST_TIMEOUT))
                        Log.Debug(Plugin.LOG_MODULE, "GetArtistAlbums() TIMEOUT waiting for browse to complete");

                }

                if (artist.AlbumPtrs == null)
                    return null;

                return artist.AlbumPtrs.ToArray();

            }
        }
예제 #2
0
        public IntPtr[] GetArtistAlbums(IntPtr artistPtr)
        {
            using (Artist artist = new Artist(artistPtr, _session))
            {

                if (!waitFor(delegate {
                    return libspotify.sp_artist_is_loaded(artist.ArtistPtr);
                }, REQUEST_TIMEOUT))

                if (artist.BeginBrowse()) {

                    if (!waitFor(delegate()
                    {
                        return artist.IsBrowseComplete;
                    }, REQUEST_TIMEOUT))
                        throw new Exception("Timeout");
                }

                if (artist.AlbumPtrs == null)
                    return null;

                return artist.AlbumPtrs.ToArray();

            }
        }