public TopList(libspotify.sp_toplisttype type, int region, Session session) { _session = session; try { ToplistType = type; toplistbrowse_complete_cb_delegate d = new toplistbrowse_complete_cb_delegate(toplistbrowse_complete); IntPtr callbackPtr = Marshal.GetFunctionPointerForDelegate(d); _browsePtr = libspotify.sp_toplistbrowse_create(_session.GetSessionPtr(), type, region, IntPtr.Zero, callbackPtr, IntPtr.Zero); } catch (Exception ex) { throw ex; } }
public static TopList BeginBrowse(libspotify.sp_toplisttype type, int region) { try { TopList t = new TopList(); t.ToplistType = type; toplistbrowse_complete_cb_delegate d = new toplistbrowse_complete_cb_delegate(t.toplistbrowse_complete); IntPtr callbackPtr = Marshal.GetFunctionPointerForDelegate(d); t._browsePtr = libspotify.sp_toplistbrowse_create(Session.GetSessionPtr(), type, region, IntPtr.Zero, callbackPtr, IntPtr.Zero); return(t); } catch (Exception ex) { Logger.WriteDebug("TopList.BeginBrowse() failed: {0}", ex.Message); return(null); } }
public static TopList BeginBrowse(libspotify.sp_toplisttype type, int region) { try { TopList t = new TopList(); t.ToplistType = type; toplistbrowse_complete_cb_delegate d = new toplistbrowse_complete_cb_delegate(t.toplistbrowse_complete); IntPtr callbackPtr = Marshal.GetFunctionPointerForDelegate(d); t._browsePtr = libspotify.sp_toplistbrowse_create(Session.GetSessionPtr(), type, region, IntPtr.Zero, callbackPtr, IntPtr.Zero); return t; } catch (Exception ex) { Log.Warning(Plugin.LOG_MODULE, "TopList.BeginBrowse() failed: {0}", ex.Message); return null; } }