Esempio n. 1
0
        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);
        }
Esempio n. 2
0
 internal Exception(Error code)
     : base(LibSpotify.ReadUtf8(LibSpotify.sp_error_message_r(code)))
 {
     ErrorCode = code;
 }
Esempio n. 3
0
 private void OnMessageChanged(IntPtr playlist, int position, IntPtr message, IntPtr state)
 {
     Internal.EventDispatcher.Dispatch(this, playlist, TrackMessageChanged,
                                       new PlaylistTrackMessageChangedEventArgs(position, LibSpotify.ReadUtf8(message)));
 }
Esempio n. 4
0
 private void OnDescriptionChanged(IntPtr playlist, IntPtr description, IntPtr state)
 {
     Internal.EventDispatcher.Dispatch(this, playlist, DescriptionChanged,
                                       new PlaylistDescriptionChangedEventArgs(LibSpotify.ReadUtf8(description)));
 }
Esempio n. 5
0
 public string GetTrackMessage(Track t)
 {
     return(LibSpotify.ReadUtf8(LibSpotify.sp_playlist_track_message_r(Handle, t.Index)));
 }
Esempio n. 6
0
 public override string ToString()
 {
     return(LibSpotify.ReadUtf8(Handle, LibSpotify.sp_link_as_string_r));
 }