|
From: <mis...@us...> - 2007-04-12 07:31:31
|
Revision: 314
http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=314&view=rev
Author: misterd_sf
Date: 2007-04-12 00:31:26 -0700 (Thu, 12 Apr 2007)
Log Message:
-----------
MPlayer: Removed old VirtualWebKeyboard, because it doesn't work proberly with latest SVN.
Modified Paths:
--------------
trunk/plugins/My MPlayer/MPlayer_GUIPlugin/MPlayer_GUIPlugin.cs
trunk/plugins/My MPlayer/MPlayer_GUIPlugin/MPlayer_GUIPlugin.csproj
Removed Paths:
-------------
trunk/plugins/My MPlayer/MPlayer_GUIPlugin/VirtualWebKeyboard.cs
Modified: trunk/plugins/My MPlayer/MPlayer_GUIPlugin/MPlayer_GUIPlugin.cs
===================================================================
--- trunk/plugins/My MPlayer/MPlayer_GUIPlugin/MPlayer_GUIPlugin.cs 2007-04-11 19:10:20 UTC (rev 313)
+++ trunk/plugins/My MPlayer/MPlayer_GUIPlugin/MPlayer_GUIPlugin.cs 2007-04-12 07:31:26 UTC (rev 314)
@@ -45,872 +45,872 @@
using MediaPortal.Configuration;
namespace MPlayer {
+ /// <summary>
+ /// Window plugin for the MPlayer External player plugin
+ /// </summary>
+ public class MPlayer_GUIPlugin : GUIWindow, IShowPlugin, ISetupForm {
+ #region enum
/// <summary>
- /// Window plugin for the MPlayer External player plugin
+ /// Possible View
/// </summary>
- public class MPlayer_GUIPlugin : GUIWindow, IShowPlugin, ISetupForm {
- #region enum
- /// <summary>
- /// Possible View
- /// </summary>
- public enum View {
- /// <summary>
- /// List view
- /// </summary>
- List = 0,
- /// <summary>
- /// Icon view
- /// </summary>
- Icons = 1,
- /// <summary>
- /// Large icon view
- /// </summary>
- LargeIcons = 2,
- /// <summary>
- /// Filmstrip view
- /// </summary>
- FilmStrip = 3
- }
- #endregion
+ public enum View {
+ /// <summary>
+ /// List view
+ /// </summary>
+ List = 0,
+ /// <summary>
+ /// Icon view
+ /// </summary>
+ Icons = 1,
+ /// <summary>
+ /// Large icon view
+ /// </summary>
+ LargeIcons = 2,
+ /// <summary>
+ /// Filmstrip view
+ /// </summary>
+ FilmStrip = 3
+ }
+ #endregion
- #region variables
- /// <summary>
- /// Virutal Directory
- /// </summary>
- private VirtualDirectory m_directory = new VirtualDirectory();
+ #region variables
+ /// <summary>
+ /// Virutal Directory
+ /// </summary>
+ private VirtualDirectory m_directory = new VirtualDirectory();
- /// <summary>
- /// ViewAs Button
- /// </summary>
- [SkinControlAttribute(2)]
- private GUIButtonControl btnViewAs = null;
+ /// <summary>
+ /// ViewAs Button
+ /// </summary>
+ [SkinControlAttribute(2)]
+ private GUIButtonControl btnViewAs = null;
- /// <summary>
- /// SortBy Button
- /// </summary>
- [SkinControlAttribute(3)]
- private GUISortButtonControl btnSortBy = null;
+ /// <summary>
+ /// SortBy Button
+ /// </summary>
+ [SkinControlAttribute(3)]
+ private GUISortButtonControl btnSortBy = null;
- /// <summary>
- /// PlayStream Button
- /// </summary>
- [SkinControlAttribute(5)]
- private GUIButtonControl btnPlayStream = null;
+ /// <summary>
+ /// PlayStream Button
+ /// </summary>
+ [SkinControlAttribute(5)]
+ private GUIButtonControl btnPlayStream = null;
- /// <summary>
- /// PlayDisc Button
- /// </summary>
- [SkinControlAttribute(6)]
- private GUIButtonControl btnPlayDisc = null;
+ /// <summary>
+ /// PlayDisc Button
+ /// </summary>
+ [SkinControlAttribute(6)]
+ private GUIButtonControl btnPlayDisc = null;
- /// <summary>
- /// Delete Button
- /// </summary>
- [SkinControlAttribute(7)]
- private GUIButtonControl btnDelete = null;
+ /// <summary>
+ /// Delete Button
+ /// </summary>
+ [SkinControlAttribute(7)]
+ private GUIButtonControl btnDelete = null;
- /// <summary>
- /// FacadeView
- /// </summary>
- [SkinControlAttribute(50)]
- private GUIFacadeControl facadeView = null;
+ /// <summary>
+ /// FacadeView
+ /// </summary>
+ [SkinControlAttribute(50)]
+ private GUIFacadeControl facadeView = null;
- /// <summary>
- /// Current view mode
- /// </summary>
- private View currentView;
+ /// <summary>
+ /// Current view mode
+ /// </summary>
+ private View currentView;
- /// <summary>
- /// Current sort method
- /// </summary>
- private VideoSort.SortMethod currentSortMethod;
+ /// <summary>
+ /// Current sort method
+ /// </summary>
+ private VideoSort.SortMethod currentSortMethod;
- /// <summary>
- /// Indicator, if ascending sort is selected
- /// </summary>
- private bool m_bSortAscending;
+ /// <summary>
+ /// Indicator, if ascending sort is selected
+ /// </summary>
+ private bool m_bSortAscending;
- /// <summary>
- /// Playlistplayer instance
- /// </summary>
- private static PlayListPlayer playlistPlayer;
+ /// <summary>
+ /// Playlistplayer instance
+ /// </summary>
+ private static PlayListPlayer playlistPlayer;
- /// <summary>
- /// Current virtual Path
- /// </summary>
- private string virtualPath;
+ /// <summary>
+ /// Current virtual Path
+ /// </summary>
+ private string virtualPath;
- /// <summary>
- /// Display name of the plugin
- /// </summary>
- private string displayName;
- /// <summary>
- /// Indicates if the my video Shares are used
- /// </summary>
- private bool useMyVideoShares;
- /// <summary>
- /// Indicates if the my music Shares are used
- /// </summary>
- private bool useMyMusicShares;
- /// <summary>
- /// List of path of all shares
- /// </summary>
- private List<String> sharePaths;
- #endregion
+ /// <summary>
+ /// Display name of the plugin
+ /// </summary>
+ private string displayName;
+ /// <summary>
+ /// Indicates if the my video Shares are used
+ /// </summary>
+ private bool useMyVideoShares;
+ /// <summary>
+ /// Indicates if the my music Shares are used
+ /// </summary>
+ private bool useMyMusicShares;
+ /// <summary>
+ /// List of path of all shares
+ /// </summary>
+ private List<String> sharePaths;
+ #endregion
- #region ctor
- /// <summary>
- /// Static Constructor for the Playlistplayer instance
- /// </summary>
- static MPlayer_GUIPlugin() {
- playlistPlayer = PlayListPlayer.SingletonPlayer;
- }
+ #region ctor
+ /// <summary>
+ /// Static Constructor for the Playlistplayer instance
+ /// </summary>
+ static MPlayer_GUIPlugin() {
+ playlistPlayer = PlayListPlayer.SingletonPlayer;
+ }
- /// <summary>
- /// Standard constructor which set the WindowID
- /// </summary>
- public MPlayer_GUIPlugin() {
- GetID = 9533;
- virtualPath = String.Empty;
- using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) {
- displayName = xmlreader.GetValueAsString("mplayer", "displayNameOfGUI", "My MPlayer");
- useMyVideoShares = xmlreader.GetValueAsBool("mplayer", "useMyVideoShares", true);
- useMyMusicShares = xmlreader.GetValueAsBool("mplayer", "useMyMusicShares", true);
- }
- }
- #endregion
+ /// <summary>
+ /// Standard constructor which set the WindowID
+ /// </summary>
+ public MPlayer_GUIPlugin() {
+ GetID = 9533;
+ virtualPath = String.Empty;
+ using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) {
+ displayName = xmlreader.GetValueAsString("mplayer", "displayNameOfGUI", "My MPlayer");
+ useMyVideoShares = xmlreader.GetValueAsBool("mplayer", "useMyVideoShares", true);
+ useMyMusicShares = xmlreader.GetValueAsBool("mplayer", "useMyMusicShares", true);
+ }
+ }
+ #endregion
- #region GUI methods
- /// <summary>
- /// Gets/Sets the current view mode
- /// </summary>
- protected virtual View CurrentView {
- get { return currentView; }
- set { currentView = value; }
- }
+ #region GUI methods
+ /// <summary>
+ /// Gets/Sets the current view mode
+ /// </summary>
+ protected virtual View CurrentView {
+ get { return currentView; }
+ set { currentView = value; }
+ }
- /// <summary>
- /// Gets/Sets the current sort method
- /// </summary>
- protected virtual VideoSort.SortMethod CurrentSortMethod {
- get { return currentSortMethod; }
- set { currentSortMethod = value; }
- }
+ /// <summary>
+ /// Gets/Sets the current sort method
+ /// </summary>
+ protected virtual VideoSort.SortMethod CurrentSortMethod {
+ get { return currentSortMethod; }
+ set { currentSortMethod = value; }
+ }
- /// <summary>
- /// Gets/Sets the current sorting direction
- /// </summary>
- protected virtual bool CurrentSortAsc {
- get { return m_bSortAscending; }
- set { m_bSortAscending = value; }
- }
+ /// <summary>
+ /// Gets/Sets the current sorting direction
+ /// </summary>
+ protected virtual bool CurrentSortAsc {
+ get { return m_bSortAscending; }
+ set { m_bSortAscending = value; }
+ }
- /// <summary>
- /// Inits the window plugin
- /// </summary>
- /// <returns>true, if init was successful</returns>
- public override bool Init() {
- bool bResult = Load(GUIGraphicsContext.Skin + @"\myMPlayer.xml");
- initializeVirtualDirectory();
- return bResult;
+ /// <summary>
+ /// Inits the window plugin
+ /// </summary>
+ /// <returns>true, if init was successful</returns>
+ public override bool Init() {
+ bool bResult = Load(GUIGraphicsContext.Skin + @"\myMPlayer.xml");
+ initializeVirtualDirectory();
+ return bResult;
+ }
+
+ /// <summary>
+ /// Handler for the GUIMessage of the MP System
+ /// </summary>
+ /// <param name="message">Message of MP</param>
+ /// <returns>Result</returns>
+ public override bool OnMessage(GUIMessage message) {
+ if (message.Message == GUIMessage.MessageType.GUI_MSG_WINDOW_INIT) {
+ bool mplayerPlayerAvailable = false;
+ using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) {
+ mplayerPlayerAvailable = xmlreader.GetValueAsBool("plugins", "MPlayer", false);
}
- /// <summary>
- /// Handler for the GUIMessage of the MP System
- /// </summary>
- /// <param name="message">Message of MP</param>
- /// <returns>Result</returns>
- public override bool OnMessage(GUIMessage message) {
- if (message.Message == GUIMessage.MessageType.GUI_MSG_WINDOW_INIT) {
- bool mplayerPlayerAvailable = false;
- using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) {
- mplayerPlayerAvailable = xmlreader.GetValueAsBool("plugins", "MPlayer", false);
- }
-
- mplayerPlayerAvailable = (mplayerPlayerAvailable & System.IO.File.Exists(Config.GetFile(Config.Dir.Plugins, "ExternalPlayers", "MPlayer_ExtPlayer.dll")));
- if (!mplayerPlayerAvailable) {
- GUIDialogOK dlgOk = (GUIDialogOK)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_OK);
- dlgOk.SetHeading("My MPlayer GUI");
- dlgOk.SetLine(1, "MPlayer External Player not available!");
- dlgOk.SetLine(2, "Please activate it in the Setup");
- dlgOk.DoModal(GetID);
- GUIWindowManager.ShowPreviousWindow();
- }
- }
- return base.OnMessage(message);
+ mplayerPlayerAvailable = (mplayerPlayerAvailable & System.IO.File.Exists(Config.GetFile(Config.Dir.Plugins, "ExternalPlayers", "MPlayer_ExtPlayer.dll")));
+ if (!mplayerPlayerAvailable) {
+ GUIDialogOK dlgOk = (GUIDialogOK)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_OK);
+ dlgOk.SetHeading("My MPlayer GUI");
+ dlgOk.SetLine(1, "MPlayer External Player not available!");
+ dlgOk.SetLine(2, "Please activate it in the Setup");
+ dlgOk.DoModal(GetID);
+ GUIWindowManager.ShowPreviousWindow();
}
+ }
+ return base.OnMessage(message);
+ }
- /// <summary>
- /// Tries to start the playback of an disc
- /// </summary>
- /// <returns>true, if successful</returns>
- private bool OnPlayDisc() {
- String url = "";
- string[] drives = Environment.GetLogicalDrives();
- bool discFound = false;
- foreach (string driveElement in drives) {
- if (Utils.getDriveType(driveElement) == 5) {
- string driveLetter = driveElement.Substring(0, 1);
- if (System.IO.File.Exists(String.Format(@"{0}:\VIDEO_TS\VIDEO_TS.IFO", driveLetter))) {
- url = "dvd://" + driveLetter + ":.mplayer";
- discFound = true;
- break;
- } else if (System.IO.File.Exists(String.Format(@"{0}:\MPEGAV\AVSEQ01.DAT", driveLetter))) {
- url = "vcd://" + String.Format(@"{0}:\MPEGAV\AVSEQ01.DAT", driveLetter) + ".mplayer";
- discFound = true;
- break;
- } else if (System.IO.File.Exists(String.Format(@"{0}:\MPEG2\AVSEQ01.MPG", driveLetter))) {
- url = "svcd://" + String.Format(@"{0}:\MPEG2\AVSEQ01.MPG", driveLetter) + ".mplayer";
- discFound = true;
- break;
- } else if (System.IO.File.Exists(String.Format(@"{0}:\MPEG2\AVSEQ01.MPEG", driveLetter))) {
- url = "svcd://" + String.Format(@"{0}:\MPEG2\AVSEQ01.MPEG", driveLetter) + ".mplayer";
- discFound = true;
- break;
- }
+ /// <summary>
+ /// Tries to start the playback of an disc
+ /// </summary>
+ /// <returns>true, if successful</returns>
+ private bool OnPlayDisc() {
+ String url = "";
+ string[] drives = Environment.GetLogicalDrives();
+ bool discFound = false;
+ foreach (string driveElement in drives) {
+ if (Utils.getDriveType(driveElement) == 5) {
+ string driveLetter = driveElement.Substring(0, 1);
+ if (System.IO.File.Exists(String.Format(@"{0}:\VIDEO_TS\VIDEO_TS.IFO", driveLetter))) {
+ url = "dvd://" + driveLetter + ":.mplayer";
+ discFound = true;
+ break;
+ } else if (System.IO.File.Exists(String.Format(@"{0}:\MPEGAV\AVSEQ01.DAT", driveLetter))) {
+ url = "vcd://" + String.Format(@"{0}:\MPEGAV\AVSEQ01.DAT", driveLetter) + ".mplayer";
+ discFound = true;
+ break;
+ } else if (System.IO.File.Exists(String.Format(@"{0}:\MPEG2\AVSEQ01.MPG", driveLetter))) {
+ url = "svcd://" + String.Format(@"{0}:\MPEG2\AVSEQ01.MPG", driveLetter) + ".mplayer";
+ discFound = true;
+ break;
+ } else if (System.IO.File.Exists(String.Format(@"{0}:\MPEG2\AVSEQ01.MPEG", driveLetter))) {
+ url = "svcd://" + String.Format(@"{0}:\MPEG2\AVSEQ01.MPEG", driveLetter) + ".mplayer";
+ discFound = true;
+ break;
+ }
- }
- }
- if (discFound) {
- if (g_Player.Playing) {
- g_Player.Stop();
- }
- g_Player.Play(url);
- GUIGraphicsContext.IsFullScreenVideo = true;
- GUIWindowManager.ActivateWindow((int)GUIWindow.Window.WINDOW_FULLSCREEN_VIDEO);
- return true;
- }
- //no disc in drive...
- GUIDialogOK dlgOk = (GUIDialogOK)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_OK);
- dlgOk.SetHeading(3);//my videos
- dlgOk.SetLine(1, 219);//no disc
- dlgOk.DoModal(GetID);
- return false;
}
-
- /// <summary>
- /// Tries to start the playback of an internet stream
- /// </summary>
- /// <returns>true, if successful</returns>
- private bool OnPlayStream() {
- VirtualWebKeyboard keyboard = (VirtualWebKeyboard)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_VIRTUAL_WEB_KEYBOARD);
- if (null == keyboard) return false;
- keyboard.Reset();
- keyboard.Text = String.Empty;
- keyboard.DoModal(GUIWindowManager.ActiveWindow);
- if (keyboard.IsConfirmed) {
- if (!keyboard.Text.Equals(String.Empty)) {
- if (g_Player.Playing) {
- g_Player.Stop();
- }
- String url = keyboard.Text + ".mplayer";
- if (url.StartsWith("rtsp:")) {
- url = "ZZZZ:" + url.Remove(0, 5);
- }
-
- g_Player.Play(url);
- if (g_Player.Player != null && g_Player.IsVideo) {
- GUIGraphicsContext.IsFullScreenVideo = true;
- GUIWindowManager.ActivateWindow((int)GUIWindow.Window.WINDOW_FULLSCREEN_VIDEO);
- }
- }
- }
- return false;
+ }
+ if (discFound) {
+ if (g_Player.Playing) {
+ g_Player.Stop();
}
+ g_Player.Play(url);
+ GUIGraphicsContext.IsFullScreenVideo = true;
+ GUIWindowManager.ActivateWindow((int)GUIWindow.Window.WINDOW_FULLSCREEN_VIDEO);
+ return true;
+ }
+ //no disc in drive...
+ GUIDialogOK dlgOk = (GUIDialogOK)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_OK);
+ dlgOk.SetHeading(3);//my videos
+ dlgOk.SetLine(1, 219);//no disc
+ dlgOk.DoModal(GetID);
+ return false;
+ }
- /// <summary>
- /// Handles click events of GUI controls
- /// </summary>
- /// <param name="controlId">ID of the GUI control</param>
- /// <param name="control">Control Object</param>
- /// <param name="actionType">Performed ActionType</param>
- protected override void OnClicked(int controlId, GUIControl control, Action.ActionType actionType) {
- if (control == btnViewAs) {
- bool shouldContinue = false;
- do {
- shouldContinue = false;
- switch (CurrentView) {
- case View.List:
- CurrentView = View.Icons;
- if (facadeView.ThumbnailView == null)
- shouldContinue = true;
- else
- facadeView.View = GUIFacadeControl.ViewMode.SmallIcons;
- break;
- case View.Icons:
- CurrentView = View.LargeIcons;
- if (facadeView.ThumbnailView == null)
- shouldContinue = true;
- else
- facadeView.View = GUIFacadeControl.ViewMode.LargeIcons;
- break;
- case View.LargeIcons:
- CurrentView = View.FilmStrip;
- if (facadeView.FilmstripView == null)
- shouldContinue = true;
- else
- facadeView.View = GUIFacadeControl.ViewMode.Filmstrip;
- break;
- case View.FilmStrip:
- CurrentView = View.List;
- if (facadeView.ListView == null)
- shouldContinue = true;
- else
- facadeView.View = GUIFacadeControl.ViewMode.List;
- break;
- }
- } while (shouldContinue);
- SelectCurrentItem();
- GUIControl.FocusControl(GetID, controlId);
- return;
- }
+ /// <summary>
+ /// Tries to start the playback of an internet stream
+ /// </summary>
+ /// <returns>true, if successful</returns>
+ private bool OnPlayStream() {
+ VirtualKeyboard keyboard = (VirtualKeyboard)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_VIRTUAL_KEYBOARD);
+ if (null == keyboard) return false;
+ keyboard.Reset();
+ keyboard.Text = String.Empty;
+ keyboard.DoModal(GUIWindowManager.ActiveWindow);
+ if (keyboard.IsConfirmed) {
+ if (!keyboard.Text.Equals(String.Empty)) {
+ if (g_Player.Playing) {
+ g_Player.Stop();
+ }
+ String url = keyboard.Text + ".mplayer";
+ if (url.StartsWith("rtsp:")) {
+ url = "ZZZZ:" + url.Remove(0, 5);
+ }
- if (control == btnSortBy) {
- bool shouldContinue = false;
- do {
- shouldContinue = false;
- switch (CurrentSortMethod) {
- case VideoSort.SortMethod.Name:
- CurrentSortMethod = VideoSort.SortMethod.Date;
- break;
- case VideoSort.SortMethod.Date:
- CurrentSortMethod = VideoSort.SortMethod.Size;
- break;
- case VideoSort.SortMethod.Size:
- CurrentSortMethod = VideoSort.SortMethod.Name;
- break;
- }
- } while (shouldContinue);
- OnSort();
- GUIControl.FocusControl(GetID, control.GetID);
- }
- if (control == btnPlayDisc) {
- OnPlayDisc();
- return;
- }
- if (control == btnPlayStream) {
- OnPlayStream();
- return;
- }
- if (control == facadeView) {
- GUIMessage msg = new GUIMessage(GUIMessage.MessageType.GUI_MSG_ITEM_SELECTED, GetID, 0, controlId, 0, 0, null);
- OnMessage(msg);
- int iItem = (int)msg.Param1;
- if (actionType == Action.ActionType.ACTION_SHOW_INFO) {
- //OnInfo(iItem);
- facadeView.RefreshCoverArt();
- }
- if (actionType == Action.ActionType.ACTION_SELECT_ITEM) {
- OnClick();
- }
- if (actionType == Action.ActionType.ACTION_QUEUE_ITEM) {
- //OnQueueItem(iItem);
- }
- }
- if(control == btnDelete){
- OnAction(new Action(Action.ActionType.ACTION_DELETE_ITEM,0,0));
- }
+ g_Player.Play(url);
+ if (g_Player.Player != null && g_Player.IsVideo) {
+ GUIGraphicsContext.IsFullScreenVideo = true;
+ GUIWindowManager.ActivateWindow((int)GUIWindow.Window.WINDOW_FULLSCREEN_VIDEO);
+ }
}
+ }
+ return false;
+ }
- /// <summary>
- /// Handles the click in the facadeview
- /// </summary>
- private void OnClick() {
- GUIListItem item = facadeView.SelectedListItem;
- if (item == null) return;
- bool isFolderAMovie = false;
- string path = item.Path;
- if (item.IsFolder && !item.IsRemote) {
- // Check if folder is actually a DVD. If so don't browse this folder, but play the DVD!
- if ((System.IO.File.Exists(path + @"\VIDEO_TS\VIDEO_TS.IFO")) && (item.Label != "..")) {
- isFolderAMovie = true;
- path = "dvd://" + path;
- //path = item.Path + @"\VIDEO_TS\VIDEO_TS.IFO";
- } else if ((System.IO.File.Exists(path + @"\MPEGAV\AVSEQ01.DAT")) && (item.Label != "..")) {
- isFolderAMovie = true;
- path = "vcd://" + String.Format(@"{0}\MPEGAV\AVSEQ01.DAT", item.Path);
- } else if ((System.IO.File.Exists(path + @"\MPEG2\AVSEQ01.MPG")) && (item.Label != "..")) {
- isFolderAMovie = true;
- path = "svcd://" + String.Format(@"{0}\MPEG2\AVSEQ01.MPG", item.Path);
- } else if ((System.IO.File.Exists(path + @"\MPEG2\AVSEQ01.MPEG")) && (item.Label != "..")) {
- isFolderAMovie = true;
- path = "svcd://" + String.Format(@"{0}\MPEG2\AVSEQ01.MPEG", item.Path);
- } else {
- isFolderAMovie = false;
- }
- }
+ /// <summary>
+ /// Handles click events of GUI controls
+ /// </summary>
+ /// <param name="controlId">ID of the GUI control</param>
+ /// <param name="control">Control Object</param>
+ /// <param name="actionType">Performed ActionType</param>
+ protected override void OnClicked(int controlId, GUIControl control, Action.ActionType actionType) {
+ if (control == btnViewAs) {
+ bool shouldContinue = false;
+ do {
+ shouldContinue = false;
+ switch (CurrentView) {
+ case View.List:
+ CurrentView = View.Icons;
+ if (facadeView.ThumbnailView == null)
+ shouldContinue = true;
+ else
+ facadeView.View = GUIFacadeControl.ViewMode.SmallIcons;
+ break;
+ case View.Icons:
+ CurrentView = View.LargeIcons;
+ if (facadeView.ThumbnailView == null)
+ shouldContinue = true;
+ else
+ facadeView.View = GUIFacadeControl.ViewMode.LargeIcons;
+ break;
+ case View.LargeIcons:
+ CurrentView = View.FilmStrip;
+ if (facadeView.FilmstripView == null)
+ shouldContinue = true;
+ else
+ facadeView.View = GUIFacadeControl.ViewMode.Filmstrip;
+ break;
+ case View.FilmStrip:
+ CurrentView = View.List;
+ if (facadeView.ListView == null)
+ shouldContinue = true;
+ else
+ facadeView.View = GUIFacadeControl.ViewMode.List;
+ break;
+ }
+ } while (shouldContinue);
+ SelectCurrentItem();
+ GUIControl.FocusControl(GetID, controlId);
+ return;
+ }
- if ((item.IsFolder) && (!isFolderAMovie)) {
- //currentSelectedItem = -1;
- virtualPath = path;
- LoadDirectory(path);
- } else {
- string movieFileName = path + ".mplayer";
- if (movieFileName.StartsWith("rtsp:")) {
- movieFileName = "ZZZZ:" + movieFileName.Remove(0, 5);
- }
- movieFileName = m_directory.GetLocalFilename(movieFileName);
- if (PlayListFactory.IsPlayList(movieFileName)) {
- LoadPlayList(movieFileName);
- return;
- }
- g_Player.Play(movieFileName);
- if (g_Player.IsVideo) {
- GUIGraphicsContext.IsFullScreenVideo = true;
- GUIWindowManager.ActivateWindow((int)GUIWindow.Window.WINDOW_FULLSCREEN_VIDEO);
- }
- return;
- }
+ if (control == btnSortBy) {
+ bool shouldContinue = false;
+ do {
+ shouldContinue = false;
+ switch (CurrentSortMethod) {
+ case VideoSort.SortMethod.Name:
+ CurrentSortMethod = VideoSort.SortMethod.Date;
+ break;
+ case VideoSort.SortMethod.Date:
+ CurrentSortMethod = VideoSort.SortMethod.Size;
+ break;
+ case VideoSort.SortMethod.Size:
+ CurrentSortMethod = VideoSort.SortMethod.Name;
+ break;
+ }
+ } while (shouldContinue);
+ OnSort();
+ GUIControl.FocusControl(GetID, control.GetID);
+ }
+ if (control == btnPlayDisc) {
+ OnPlayDisc();
+ return;
+ }
+ if (control == btnPlayStream) {
+ OnPlayStream();
+ return;
+ }
+ if (control == facadeView) {
+ GUIMessage msg = new GUIMessage(GUIMessage.MessageType.GUI_MSG_ITEM_SELECTED, GetID, 0, controlId, 0, 0, null);
+ OnMessage(msg);
+ int iItem = (int)msg.Param1;
+ if (actionType == Action.ActionType.ACTION_SHOW_INFO) {
+ //OnInfo(iItem);
+ facadeView.RefreshCoverArt();
}
+ if (actionType == Action.ActionType.ACTION_SELECT_ITEM) {
+ OnClick();
+ }
+ if (actionType == Action.ActionType.ACTION_QUEUE_ITEM) {
+ //OnQueueItem(iItem);
+ }
+ }
+ if (control == btnDelete) {
+ OnAction(new Action(Actio...
[truncated message content] |