public static IntPtr[] GetAlbumTracks(IntPtr albumPtr) { using (Album album = new Album(albumPtr)) { if(!waitFor(delegate { return libspotify.sp_album_is_loaded(album.AlbumPtr); }, REQUEST_TIMEOUT)) Log.Debug(Plugin.LOG_MODULE, "GetAlbumTracks() TIMEOUT waiting for album to load"); if (album.BeginBrowse()) { if (!waitFor(delegate() { return album.IsBrowseComplete; }, REQUEST_TIMEOUT)) Log.Debug(Plugin.LOG_MODULE, "GetAlbumTracks() TIMEOUT waiting for browse to complete"); } if (album.TrackPtrs == null) return null; return album.TrackPtrs.ToArray(); } }
public IntPtr[] GetAlbumTracks(IntPtr albumPtr) { using (Album album = new Album(albumPtr, _session)) { if(!waitFor(delegate { return libspotify.sp_album_is_loaded(album.AlbumPtr); }, REQUEST_TIMEOUT)) if (album.BeginBrowse()) { if (!waitFor(delegate() { return album.IsBrowseComplete; }, REQUEST_TIMEOUT)) throw new Exception("Timeout"); } if (album.TrackPtrs == null) return null; return album.TrackPtrs.ToArray(); } }