Exemplo n.º 1
0
 protected override void OnClicked(int controlId, GUIControl control, Action.ActionType actionType)
 {
     base.OnClicked(controlId, control, actionType);
     if (control == btnShuffle)
     {
         OnShufflePlayList();
     }
     else if (control == btnSave)
     {
         OnSavePlayList();
     }
     else if (control == btnClear)
     {
         OnClearPlayList();
     }
     else if (control == btnPlay)
     {
         GUIListItem item = facadeLayout.SelectedListItem;
         // If the file is an image file, it should be mounted before playing
         if (VirtualDirectory.IsImageFile(System.IO.Path.GetExtension(item.Path)))
         {
             if (!GUIVideoFiles.MountImageFile(GUIWindowManager.ActiveWindow, item.Path, true))
             {
                 return;
             }
         }
         playlistPlayer.CurrentPlaylistType = PlayListType.PLAYLIST_VIDEO;
         playlistPlayer.Reset();
         playlistPlayer.Play(facadeLayout.SelectedListItemIndex);
         UpdateButtonStates();
     }
     else if (control == btnNext)
     {
         playlistPlayer.CurrentPlaylistType = PlayListType.PLAYLIST_VIDEO;
         GUIVideoFiles.PlayMovieFromPlayList(true, true);
     }
     else if (control == btnPrevious)
     {
         playlistPlayer.CurrentPlaylistType = PlayListType.PLAYLIST_VIDEO;
         playlistPlayer.PlayPrevious();
     }
     else if ((btnRepeatPlaylist != null) && (control == btnRepeatPlaylist))
     {
         playlistPlayer.RepeatPlaylist = btnRepeatPlaylist.Selected;
     }
 }