private static IList <string> MarshalPlaylistSubscribers(IntPtr playlist) { List <string> subscribers = new List <string>(); IntPtr p = LibSpotify.sp_playlist_subscribers_r(playlist); if (p != IntPtr.Zero) { int n = Marshal.ReadInt32(p); int offset = Marshal.SizeOf(typeof(Int32)); for (int i = 0; i < n; ++i) { subscribers.Add(LibSpotify.ReadUtf8(Marshal.ReadIntPtr(p, offset))); offset += Marshal.SizeOf(typeof(IntPtr)); } LibSpotify.sp_playlist_subscribers_free_r(p); } return(subscribers); }
internal Exception(Error code) : base(LibSpotify.ReadUtf8(LibSpotify.sp_error_message_r(code))) { ErrorCode = code; }
private void OnMessageChanged(IntPtr playlist, int position, IntPtr message, IntPtr state) { Internal.EventDispatcher.Dispatch(this, playlist, TrackMessageChanged, new PlaylistTrackMessageChangedEventArgs(position, LibSpotify.ReadUtf8(message))); }
private void OnDescriptionChanged(IntPtr playlist, IntPtr description, IntPtr state) { Internal.EventDispatcher.Dispatch(this, playlist, DescriptionChanged, new PlaylistDescriptionChangedEventArgs(LibSpotify.ReadUtf8(description))); }
public string GetTrackMessage(Track t) { return(LibSpotify.ReadUtf8(LibSpotify.sp_playlist_track_message_r(Handle, t.Index))); }
public override string ToString() { return(LibSpotify.ReadUtf8(Handle, LibSpotify.sp_link_as_string_r)); }