Exemplo n.º 1
0
        /// <summary>
        /// Request the media player's current playlist.
        /// </summary>
        /// <returns>The playlist tree.</returns>
        /// <param name="search">An optional search string.</param>
        public async Task <VlcPlaylistNode[]> GetPlaylist(string search = null)
        {
            string uri = "requests/playlist.xml?search=";

            if (!String.IsNullOrWhiteSpace(search))
            {
                uri += Uri.EscapeDataString(search);
            }

            HttpResponseMessage response = await client.GetAsync(uri);

            // TODO: throw exception?
            if (!response.IsSuccessStatusCode)
            {
                return(null);
            }

            var stream = await response.Content.ReadAsStreamAsync();

            VlcPlaylistResponse pl = (VlcPlaylistResponse)playlistSerializer.Deserialize(stream);

            PlaylistUpdated?.Invoke(this, pl.Items);

            return(pl.Items);
        }
Exemplo n.º 2
0
 internal static void _PlaylistUpdated(string sql)
 {
     if (PlaylistUpdated == null)
     {
         return;
     }
     PlaylistUpdated.Invoke(sql);
 }
Exemplo n.º 3
0
 /// <summary>
 /// Coreより,Core,プラグイン初期化後に呼ばれる.
 /// 初期イベント通知とController部の動作を開始.
 /// </summary>
 internal static void Startup()
 {
     if (onVolumeChange != null)
     {
         onVolumeChange.Invoke();
     }
     if (onPlaybackOrderChange != null)
     {
         onPlaybackOrderChange.Invoke();
     }
     if (PlaylistUpdated != null)
     {
         PlaylistUpdated.Invoke(AppCore.LatestPlaylistQuery);
     }
     if (PlaylistSortOrderChanged != null)
     {
         PlaylistSortOrderChanged.Invoke(AppCore.PlaylistSortColumn, AppCore.PlaylistSortOrder);
     }
 }
Exemplo n.º 4
0
 internal void RaisePlaylistUpdatedEvent(MediaControlPlaylistMode mode, string name, IntPtr playlistHandle)
 {
     PlaylistUpdated?.Invoke(this, new PlaylistUpdatedEventArgs(mode, name, new MediaControlPlaylist(playlistHandle)));
 }