コード例 #1
0
ファイル: TopList.cs プロジェクト: EdgarVerona/SpotifyBox
        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;
            }
        }
コード例 #2
0
        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);
            }
        }
コード例 #3
0
ファイル: TopList.cs プロジェクト: EraYaN/Moonstone
        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;

            }
        }