public static ArtistBrowse Create(SpotifySession session, Artist artist, ArtistBrowseType type, ArtistBrowseComplete callback, object userdata) { IntPtr listenerToken = ListenerTable.PutUniqueObject(callback, userdata); IntPtr ptr = NativeMethods.sp_artistbrowse_create(session._handle, artist._handle, type, ArtistBrowseCompleteDelegate, listenerToken); ArtistBrowse browse = BrowseTable.GetUniqueObject(ptr); browse.ListenerToken = listenerToken; return(browse); }
public static void PrintArtistBrowse(SpotifySession aSession, ArtistBrowse aArtistBrowse) { Console.WriteLine("Artist browse of \"{0}\"", aArtistBrowse.Artist().Name()); for (int i = 0; i != aArtistBrowse.NumSimilarArtists(); ++i) { Console.WriteLine(" Similar artist: {0}", aArtistBrowse.SimilarArtist(i).Name()); } Console.WriteLine(" Portraits: {0}", aArtistBrowse.NumPortraits()); Console.WriteLine(" Tracks: {0}", aArtistBrowse.NumTracks()); Console.WriteLine(" Biography: {0}", Truncate(aArtistBrowse.Biography(),60)); Console.WriteLine(); for (int i = 0; i != aArtistBrowse.NumTracks(); ++i) { PrintTrack(aSession, aArtistBrowse.Track(i)); } Console.WriteLine(); }
void PrintArtistBrowse(ArtistBrowse aArtistBrowse) { Printing.PrintArtistBrowse(iSession, aArtistBrowse); }
void BrowseArtistCallback(ArtistBrowse aResult, object aUserdata) { try { aResult.Error(); PrintArtistBrowse(aResult); } catch (SpotifyException e) { Console.Error.WriteLine("Failed to browse artist: {0}", e.Message); } aResult.Dispose(); iConsoleReader.RequestInput("> "); }