internal bool RadioSearch(int fromYear, int toYear, sp_radio_genre genre, object state) { lock (libspotify.Mutex) { int id = GetUserStateId(); states[id] = state; IntPtr browsePtr = libspotify.sp_radio_search_create(sessionPtr, fromYear, toYear, genre, Marshal.GetFunctionPointerForDelegate(search_complete_cb), new IntPtr(id)); return(browsePtr != IntPtr.Zero); } }
internal Search RadioSearchSync(int fromYear, int toYear, sp_radio_genre genre, TimeSpan timeout) { ManualResetEvent waitHandle = new ManualResetEvent(false); int id = GetInternalStateId(); lock (libspotify.Mutex) { states[id] = waitHandle; if (libspotify.sp_radio_search_create(sessionPtr, fromYear, toYear, genre, Marshal.GetFunctionPointerForDelegate(search_complete_cb), new IntPtr(id)) == IntPtr.Zero) { waitHandle.Close(); states.Remove(id); return(null); } } return(GetSyncResponse(id, waitHandle, timeout) as Search); }
internal static extern IntPtr sp_radio_search_create(IntPtr sessionPtr, int from_year, int to_year, sp_radio_genre genres, IntPtr callbackPtr, IntPtr userDataPtr);
internal Search RadioSearchSync(int fromYear, int toYear, sp_radio_genre genre, TimeSpan timeout) { ManualResetEvent waitHandle = new ManualResetEvent(false); int id = GetInternalStateId(); lock (libspotify.Mutex) { states[id] = waitHandle; if (libspotify.sp_radio_search_create(sessionPtr, fromYear, toYear, genre, Marshal.GetFunctionPointerForDelegate(search_complete_cb), new IntPtr(id)) == IntPtr.Zero) { waitHandle.Close(); states.Remove(id); return null; } } return GetSyncResponse(id, waitHandle, timeout) as Search; }
internal bool RadioSearch(int fromYear, int toYear, sp_radio_genre genre, object state) { lock (libspotify.Mutex) { int id = GetUserStateId(); states[id] = state; IntPtr browsePtr = libspotify.sp_radio_search_create(sessionPtr, fromYear, toYear, genre, Marshal.GetFunctionPointerForDelegate(search_complete_cb), new IntPtr(id)); return browsePtr != IntPtr.Zero; } }