예제 #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);
        }
예제 #2
0
 internal Exception(Error code)
     : base(LibSpotify.ReadUtf8(LibSpotify.sp_error_message_r(code)))
 {
     ErrorCode = code;
 }
예제 #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)));
 }
예제 #4
0
 private void OnDescriptionChanged(IntPtr playlist, IntPtr description, IntPtr state)
 {
     Internal.EventDispatcher.Dispatch(this, playlist, DescriptionChanged,
                                       new PlaylistDescriptionChangedEventArgs(LibSpotify.ReadUtf8(description)));
 }
예제 #5
0
 public string GetTrackMessage(Track t)
 {
     return(LibSpotify.ReadUtf8(LibSpotify.sp_playlist_track_message_r(Handle, t.Index)));
 }
예제 #6
0
파일: Link.cs 프로젝트: gladish/Spotify.NET
 public override string ToString()
 {
     return(LibSpotify.ReadUtf8(Handle, LibSpotify.sp_link_as_string_r));
 }