|
From: <fa...@us...> - 2007-04-18 22:15:13
|
Revision: 341
http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=341&view=rev
Author: falkyre
Date: 2007-04-18 15:14:47 -0700 (Wed, 18 Apr 2007)
Log Message:
-----------
Added Paths:
-----------
trunk/plugins/MyShowTimes/
trunk/plugins/MyShowTimes/MediaPortal ShowTimes Plugins Suite.doc
trunk/plugins/MyShowTimes/ShowTimesGUI/
trunk/plugins/MyShowTimes/ShowTimesGUI/AssemblyInfo.cs
trunk/plugins/MyShowTimes/ShowTimesGUI/MovieInfo.cs
trunk/plugins/MyShowTimes/ShowTimesGUI/PluginSettings.cs
trunk/plugins/MyShowTimes/ShowTimesGUI/ShowTimesGUI.cs
trunk/plugins/MyShowTimes/ShowTimesGUI/ShowTimesGUI.csproj
trunk/plugins/MyShowTimes/ShowTimesGUI/ShowTimesGUI.csproj.user
trunk/plugins/MyShowTimes/ShowTimesGUI/ShowTimesGUI.sln
trunk/plugins/MyShowTimes/ShowTimesGUI/ShowTimesGUI.suo
trunk/plugins/MyShowTimes/ShowTimesGUI/TheaterInfo.cs
trunk/plugins/MyShowTimes/ShowTimesGUI/skin/
trunk/plugins/MyShowTimes/ShowTimesGUI/skin/Blue Two/
trunk/plugins/MyShowTimes/ShowTimesGUI/skin/Blue Two/ShowTimesGUI.xml
trunk/plugins/MyShowTimes/ShowTimesGUI/skin/MePo Wide/
trunk/plugins/MyShowTimes/ShowTimesGUI/skin/MePo Wide/ShowTimesGUI.xml
trunk/plugins/MyShowTimes/ShowTimesGrabber/
trunk/plugins/MyShowTimes/ShowTimesGrabber/ShowTimes/
trunk/plugins/MyShowTimes/ShowTimesGrabber/ShowTimes/PluginSettings.cs
trunk/plugins/MyShowTimes/ShowTimesGrabber/ShowTimes/PluginSetup.cs
trunk/plugins/MyShowTimes/ShowTimesGrabber/ShowTimes/Properties/
trunk/plugins/MyShowTimes/ShowTimesGrabber/ShowTimes/Properties/AssemblyInfo.cs
trunk/plugins/MyShowTimes/ShowTimesGrabber/ShowTimes/ShowTimes.csproj
trunk/plugins/MyShowTimes/ShowTimesGrabber/ShowTimes/showtimes.cs
trunk/plugins/MyShowTimes/ShowTimesGrabber/ShowTimes/showtimesSetup.Designer.cs
trunk/plugins/MyShowTimes/ShowTimesGrabber/ShowTimes/showtimesSetup.cs
trunk/plugins/MyShowTimes/ShowTimesGrabber/ShowTimes/showtimesSetup.resx
trunk/plugins/MyShowTimes/ShowTimesGrabber/ShowTimes.sln
trunk/plugins/MyShowTimes/ShowTimesGrabber/ShowTimes.suo
Added: trunk/plugins/MyShowTimes/MediaPortal ShowTimes Plugins Suite.doc
===================================================================
(Binary files differ)
Property changes on: trunk/plugins/MyShowTimes/MediaPortal ShowTimes Plugins Suite.doc
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/plugins/MyShowTimes/ShowTimesGUI/AssemblyInfo.cs
===================================================================
--- trunk/plugins/MyShowTimes/ShowTimesGUI/AssemblyInfo.cs (rev 0)
+++ trunk/plugins/MyShowTimes/ShowTimesGUI/AssemblyInfo.cs 2007-04-18 22:14:47 UTC (rev 341)
@@ -0,0 +1,58 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+
+//
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+//
+[assembly: AssemblyTitle("ShowTimesGUI")]
+[assembly: AssemblyDescription("GUI for the ShowTimes Grabber")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("")]
+[assembly: AssemblyCopyright("")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+//
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Revision and Build Numbers
+// by using the '*' as shown below:
+
+[assembly: AssemblyVersion("1.0.*")]
+
+//
+// In order to sign your assembly you must specify a key to use. Refer to the
+// Microsoft .NET Framework documentation for more information on assembly signing.
+//
+// Use the attributes below to control which key is used for signing.
+//
+// Notes:
+// (*) If no key is specified, the assembly is not signed.
+// (*) KeyName refers to a key that has been installed in the Crypto Service
+// Provider (CSP) on your machine. KeyFile refers to a file which contains
+// a key.
+// (*) If the KeyFile and the KeyName values are both specified, the
+// following processing occurs:
+// (1) If the KeyName can be found in the CSP, that key is used.
+// (2) If the KeyName does not exist and the KeyFile does exist, the key
+// in the KeyFile is installed into the CSP and used.
+// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
+// When specifying the KeyFile, the location of the KeyFile should be
+// relative to the project output directory which is
+// %Project Directory%\obj\<configuration>. For example, if your KeyFile is
+// located in the project directory, you would specify the AssemblyKeyFile
+// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
+// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
+// documentation for more information on this.
+//
+[assembly: AssemblyDelaySign(false)]
+[assembly: AssemblyKeyFile("")]
+[assembly: AssemblyKeyName("")]
Added: trunk/plugins/MyShowTimes/ShowTimesGUI/MovieInfo.cs
===================================================================
--- trunk/plugins/MyShowTimes/ShowTimesGUI/MovieInfo.cs (rev 0)
+++ trunk/plugins/MyShowTimes/ShowTimesGUI/MovieInfo.cs 2007-04-18 22:14:47 UTC (rev 341)
@@ -0,0 +1,256 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Xml;
+using MediaPortal.GUI.Library;
+
+namespace ShowTimesGUI
+{
+ class MovieInfo
+ {
+ public static string[] Movies = new string[200]; //strings for all movies
+ public static int NumMovies; //number of movies
+
+ public static string GetMovieName(int index)
+ {
+
+ string nodeselect = String.Format("/MediaLibrary/Media[MediaID=\"{0}\"]/Name", index.ToString());
+
+ //XmlDocument XmlDoc = new XmlDocument();
+
+ //XmlDoc.Load(ShowTimesGUI.MOVIEDATA);
+
+ XmlNode MovieName = ShowTimesGUI.movieXML.SelectSingleNode(nodeselect);
+
+ if (MovieName == null)
+ return "NA";
+ else
+ return MovieName.InnerText;
+ }
+
+ public static int GetMovieID(string MovieName)
+ {
+
+ string nodeselect = String.Format("/MediaLibrary/Media[contains(Name,\"{0}\")]/MediaID", MovieName);
+
+ XmlNode MovieID = ShowTimesGUI.movieXML.SelectSingleNode(nodeselect);
+
+ if (MovieID == null)
+ return -1;
+ else
+ return int.Parse(MovieID.InnerText);
+ }
+
+ public static void GetAllMovies()
+ {
+ int i = 0;
+
+ Array.Resize(ref Movies, 200);
+
+ XmlNodeList MovieNames = ShowTimesGUI.movieXML.SelectNodes("/MediaLibrary/Media/Name");
+
+ NumMovies = MovieNames.Count;
+
+ if (PluginSettings.DebugMode)
+ Log.Debug("Number of movies found = {0}", NumMovies);
+
+ //Create list of Movies
+ foreach (XmlNode node in MovieNames)
+ {
+ // Do anything with node
+ Movies[i] = node.InnerText;
+ i++;
+ }
+
+ Movies[i] = null;
+
+ Array.Resize(ref Movies, i);
+ Movies = ShowTimesGUI.RemoveDups(Movies, true);
+ if (PluginSettings.DebugMode)
+ Log.Debug("GetAllMovies::Num Movies = {0} after dup = {1}", NumMovies,Movies.Length);
+ //Array.Resize(ref Movies, i);
+
+ }
+
+
+ public static string GetPosterImage(string MovieName)
+ {
+ string nodeselect;
+
+ //XmlDocument XmlDoc = new XmlDocument();
+
+ //XmlDoc.Load(ShowTimesGUI.MOVIEDATA);
+
+ nodeselect = String.Format("/MediaLibrary/Media[contains(Name,\"{0}\")]/image", MovieName);
+
+ XmlNode PosterImage = ShowTimesGUI.movieXML.SelectSingleNode(nodeselect);
+
+ if (PluginSettings.DebugMode)
+ {
+ if (PosterImage != null)
+ Log.Debug("Poster Image = {0}", PosterImage.InnerText);
+ else
+ Log.Debug("Poster Image = Not found");
+ }
+
+ if (PosterImage == null)
+ return "NA";
+ else
+ return PosterImage.InnerText;
+ }
+
+ public static string GetRating(string MovieName)
+ {
+ string nodeselect;
+
+ //XmlDocument XmlDoc = new XmlDocument();
+
+ //XmlDoc.Load(ShowTimesGUI.MOVIEDATA);
+
+ nodeselect = String.Format("/MediaLibrary/Media[contains(Name,\"{0}\")]/Rating", MovieName);
+
+ XmlNode Rating = ShowTimesGUI.movieXML.SelectSingleNode(nodeselect);
+
+ if (Rating == null)
+ return "NA";
+ else
+ return Rating.InnerText;
+ }
+
+ public static string GetRunTime(string MovieName)
+ {
+ string nodeselect;
+
+ //XmlDocument XmlDoc = new XmlDocument();
+
+ //XmlDoc.Load(ShowTimesGUI.MOVIEDATA);
+
+ nodeselect = String.Format("/MediaLibrary/Media[contains(Name,\"{0}\")]/Runtime", MovieName);
+
+ XmlNode RunTime = ShowTimesGUI.movieXML.SelectSingleNode(nodeselect);
+
+ if (RunTime == null)
+ return "NA";
+ else
+ return RunTime.InnerText;
+ }
+
+ public static string GetIMDBRating(string MovieName)
+ {
+ string nodeselect;
+
+ nodeselect = String.Format("/MediaLibrary/Media[contains(Name,\"{0}\")]/ImdbUserReview", MovieName);
+
+ XmlNode IMDB = ShowTimesGUI.movieXML.SelectSingleNode(nodeselect);
+
+ if (IMDB == null)
+ return "NA";
+ else
+ return IMDB.InnerText;
+ }
+
+ public static string GetReleaseDate(string MovieName)
+ {
+ string nodeselect;
+
+ //XmlDocument XmlDoc = new XmlDocument();
+
+ //XmlDoc.Load(ShowTimesGUI.MOVIEDATA);
+
+ nodeselect = String.Format("/MediaLibrary/Media[contains(Name,\"{0}\")]/ReleaseDate", MovieName);
+
+ XmlNode ReleaseDate = ShowTimesGUI.movieXML.SelectSingleNode(nodeselect);
+
+ if (ReleaseDate == null)
+ return "NA";
+ else
+ return ReleaseDate.InnerText;
+ }
+
+ public static string GetActors(string MovieName)
+ {
+ string nodeselect;
+
+ nodeselect = String.Format("/MediaLibrary/Media[contains(Name,\"{0}\")]/Actors", MovieName);
+
+ XmlNode Actors = ShowTimesGUI.movieXML.SelectSingleNode(nodeselect);
+
+ if (Actors == null)
+ return "NA";
+ else
+ return Actors.InnerText;
+ }
+
+ public static string GetDirector(string MovieName)
+ {
+ string nodeselect;
+
+ nodeselect = String.Format("/MediaLibrary/Media[contains(Name,\"{0}\")]/Director", MovieName);
+
+ XmlNode Director = ShowTimesGUI.movieXML.SelectSingleNode(nodeselect);
+
+ if (Director == null)
+ return "NA";
+ else
+ return Director.InnerText;
+ }
+
+ public static string GetPlot(string MovieName)
+ {
+ string nodeselect;
+
+ nodeselect = String.Format("/MediaLibrary/Media[contains(Name,\"{0}\")]/PlotSummary", MovieName);
+
+ XmlNode Plot = ShowTimesGUI.movieXML.SelectSingleNode(nodeselect);
+
+ if (Plot == null)
+ return "NA";
+ else
+ return Plot.InnerText;
+ }
+
+ public static string GetGenre(string MovieName)
+ {
+ string nodeselect;
+
+ nodeselect = String.Format("/MediaLibrary/Media[contains(Name,\"{0}\")]/Genre", MovieName);
+
+ XmlNode Genre = ShowTimesGUI.movieXML.SelectSingleNode(nodeselect);
+
+ if (Genre == null)
+ return "NA";
+ else
+ return Genre.InnerText;
+ }
+
+ public static string GetTrailerExists(string MovieName)
+ {
+ string nodeselect;
+
+ nodeselect = String.Format("/MediaLibrary/Media[contains(Name,\"{0}\")]/Trailer", MovieName);
+
+ XmlNode Trailers = ShowTimesGUI.movieXML.SelectSingleNode(nodeselect);
+
+ if (Trailers == null)
+ return "NA";
+ else
+ return Trailers.InnerText;
+ }
+
+ public static string GetTrailerLoc(string MovieName)
+ {
+ string nodeselect;
+
+ nodeselect = String.Format("/MediaLibrary/Media[contains(Name,\"{0}\")]/location", MovieName);
+
+ XmlNode TrailerLoc = ShowTimesGUI.movieXML.SelectSingleNode(nodeselect);
+
+ if (TrailerLoc == null)
+ return "NA";
+ else
+ return TrailerLoc.InnerText;
+ }
+
+
+ }
+}
Added: trunk/plugins/MyShowTimes/ShowTimesGUI/PluginSettings.cs
===================================================================
--- trunk/plugins/MyShowTimes/ShowTimesGUI/PluginSettings.cs (rev 0)
+++ trunk/plugins/MyShowTimes/ShowTimesGUI/PluginSettings.cs 2007-04-18 22:14:47 UTC (rev 341)
@@ -0,0 +1,95 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Text;
+using System.Reflection;
+using System.Threading;
+using System.Windows.Forms;
+using MediaPortal.GUI.Library;
+
+namespace ShowTimesGUI
+{
+ public static class PluginSettings
+ {
+ // The Cached MediaPortal Settings Configuration file
+ static private MediaPortal.Profile.Settings mpSettings = new MediaPortal.Profile.Settings("MediaPortal.xml", true);
+
+
+ #region Configuration Properties
+
+ /// <summary>
+ /// Gets or sets the next poll time.
+ /// </summary>
+ /// <value>The next poll.</value>
+ static public DateTime NextPoll
+ {
+ get { return DateTime.Parse(mpSettings.GetValueAsString(ShowTimesGUI.PLUGIN_NAME, "NextPoll", DateTime.Now.ToString("s"))); }
+ set { mpSettings.SetValue(ShowTimesGUI.PLUGIN_NAME, "NextPoll", value.ToString("s")); }
+ }
+
+ /// <summary>
+ /// Gets or sets the location of the grabber (mtsa.exe) config.xml.
+ /// </summary>
+ /// <value>full path of the mtsa.exe config.xml file</value>
+ static public string grabberCfgXml
+ {
+ get { return mpSettings.GetValueAsString(ShowTimesGUI.PLUGIN_NAME, "grabberCfgXml", System.IO.Path.GetDirectoryName(System.Windows.Forms.Application.ExecutablePath) + "\\config.xml"); }
+ set { mpSettings.SetValue(ShowTimesGUI.PLUGIN_NAME, "grabberCfgXml", value); }
+ }
+
+
+ /// <summary>
+ /// Gets or sets the number of days between downloads of showtimes.
+ /// </summary>
+ /// <value>The update days.</value>
+ static public int UpdateDays
+ {
+ get { return mpSettings.GetValueAsInt(ShowTimesGUI.PLUGIN_NAME, "UpdateDays", 5); }
+ set { mpSettings.SetValue(ShowTimesGUI.PLUGIN_NAME, "UpdateDays", value); }
+ }
+
+ /// <summary>
+ /// Gets or sets the location of the grabber (mtsa.exe) files.
+ /// </summary>
+ /// <value>full path of the directory to be used by mtsa.exe</value>
+ static public string grabberFiles
+ {
+ get { return mpSettings.GetValueAsString(ShowTimesGUI.PLUGIN_NAME, "grabberFiles", System.IO.Path.GetDirectoryName(System.Windows.Forms.Application.ExecutablePath)); }
+ set { mpSettings.SetValue(ShowTimesGUI.PLUGIN_NAME, "grabberFiles", value); }
+ }
+
+
+ /// <summary>
+ /// Gets or sets a value indicating whether debug mode is enabled.
+ /// </summary>
+ /// <value><c>true</c> if [debug mode]; otherwise, <c>false</c>.</value>
+ static public bool DebugMode
+ {
+ get { return mpSettings.GetValueAsBool(ShowTimesGUI.PLUGIN_NAME, "DebugMode", false); }
+ set { mpSettings.SetValueAsBool(ShowTimesGUI.PLUGIN_NAME, "DebugMode", value); }
+ }
+
+
+ /// <summary>
+ /// Gets or sets a value indicating whether the user wants to be notified when the import is complete.
+ /// </summary>
+ /// <value><c>true</c> if [notify on completion]; otherwise, <c>false</c>.</value>
+ static public bool NotifyOnCompletion
+ {
+ get { return mpSettings.GetValueAsBool(ShowTimesGUI.PLUGIN_NAME, "NotifyOnCompletion", true); }
+ set { mpSettings.SetValueAsBool(ShowTimesGUI.PLUGIN_NAME, "NotifyOnCompletion", value); }
+ }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether the user wants to force update on MP start.
+ /// </summary>
+ /// <value><c>true</c> if [force on start]; otherwise, <c>false</c>.</value>
+ static public bool ForceUpdate
+ {
+ get { return mpSettings.GetValueAsBool(ShowTimesGUI.PLUGIN_NAME, "ForceUpdate", true); }
+ set { mpSettings.SetValueAsBool(ShowTimesGUI.PLUGIN_NAME, "ForceUpdate", value); }
+ }
+
+ #endregion
+ }
+}
Added: trunk/plugins/MyShowTimes/ShowTimesGUI/ShowTimesGUI.cs
===================================================================
--- trunk/plugins/MyShowTimes/ShowTimesGUI/ShowTimesGUI.cs (rev 0)
+++ trunk/plugins/MyShowTimes/ShowTimesGUI/ShowTimesGUI.cs 2007-04-18 22:14:47 UTC (rev 341)
@@ -0,0 +1,1270 @@
+#region Copyright (C) 2005-2007 Team MediaPortal
+
+/*
+ * Copyright (C) 2005-2007 Team MediaPortal
+ * http://www.team-mediaportal.com
+ *
+ * This Program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This Program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Make; see the file COPYING. If not, write to
+ * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ */
+
+#endregion
+
+using System;
+using System.Windows.Forms;
+using System.Collections;
+using MediaPortal.GUI.Library;
+using MediaPortal.Dialogs;
+using MediaPortal.Player;
+using System.Xml;
+using System.Xml.Serialization;
+
+
+
+namespace ShowTimesGUI
+{
+ /// <summary>
+ /// GUI for the ShowTimes process plugin to show information and showtimes on movies playing in your local theater.
+ /// </summary>
+ public class ShowTimesGUI : GUIWindow, ISetupForm, IPlugin
+ {
+
+ #region MapSettings class
+ [Serializable]
+ public class MapSettings
+ {
+ protected int _SortBy;
+ protected int _ViewAs;
+ protected bool _SortAscending;
+
+ public MapSettings()
+ {
+ // Set default view
+ _SortBy = (int)SortMethod.Name;
+ _ViewAs = (int)View.BigIcons;
+ _SortAscending = true;
+ }
+
+ [XmlElement("SortBy")]
+ public int SortBy
+ {
+ get { return _SortBy; }
+ set { _SortBy = value; }
+ }
+
+ [XmlElement("ViewAs")]
+ public int ViewAs
+ {
+ get { return _ViewAs; }
+ set { _ViewAs = value; }
+ }
+
+ [XmlElement("SortAscending")]
+ public bool SortAscending
+ {
+ get { return _SortAscending; }
+ set { _SortAscending = value; }
+ }
+ }
+
+ enum SortMethod
+ {
+ Name = 0,
+ Date = 1,
+ Size = 2
+ }
+
+ enum View
+ {
+ List = 0,
+ Icons = 1,
+ BigIcons = 2,
+ Albums = 3,
+ Filmstrip = 4,
+ MovieDates = 5,
+ }
+ #endregion
+
+ #region SkinControlAttributes
+
+
+
+ [SkinControlAttribute(2)]
+ protected GUIButtonControl buttonOne = null;
+ [SkinControlAttribute(3)]
+ protected GUIButtonControl btnMovieTheaters = null;
+
+ [SkinControlAttribute(0)] protected GUIImage posterBorder = null;
+ [SkinControlAttribute(24)] protected GUIImage poster = null;
+ [SkinControlAttribute(25)] protected GUILabelControl RatingCtrl = null;
+ [SkinControlAttribute(26)] protected GUILabelControl RunTimeCtrl = null;
+ [SkinControlAttribute(27)] protected GUILabelControl TrailerCtrl = null;
+ [SkinControlAttribute(28)] protected GUILabelControl StarringLabel = null;
+ [SkinControlAttribute(29)] protected GUITextControl StarringCtrl = null;
+ [SkinControlAttribute(30)] protected GUILabelControl DirectorLabel = null;
+ [SkinControlAttribute(31)] protected GUITextControl DirectorCtrl = null;
+ [SkinControlAttribute(32)] protected GUILabelControl IMDBCtrl = null;
+ [SkinControlAttribute(33)] protected GUILabelControl PlotLabel = null;
+ [SkinControlAttribute(34)] protected GUITextScrollUpControl plotarea = null;
+ [SkinControlAttribute(35)] protected GUILabelControl GenreLabel = null;
+ [SkinControlAttribute(36)] protected GUIFadeLabel GenreCtrl = null;
+ [SkinControlAttribute(44)] protected GUIFadeLabel SelectedTheaterCtrl = null;
+
+ [SkinControlAttribute(40)] protected GUIButtonControl btnShowTimes = null;
+ [SkinControlAttribute(41)] protected GUIButtonControl btnPlayTrailer = null;
+ [SkinControlAttribute(42)] protected GUIButtonControl btnNextMovie = null;
+ [SkinControlAttribute(43)] protected GUIButtonControl btnPreviousMovie = null;
+ [SkinControlAttribute(45)] protected GUILabelControl NextRefreshLabel = null;
+
+
+ [SkinControlAttribute(50)] protected GUIFacadeControl facadeView = null;
+
+ #endregion
+
+ #region Variables
+
+ internal const string PLUGIN_NAME = "ShowTimes Grabber";
+ internal const string GUI_PLUGIN_NAME = "ShowTimes GUI";
+ public static string POSTER_LOC;
+ public static string TRAILER_LOC;
+ public static string LOCFILE;
+ public static string MOVIEDATA;
+ public static XmlDocument movieXML;
+ private static bool xmlLoaded = false;
+ private static bool movOrTheater = false;
+ private static bool theaterDatesShown = false;
+ private static bool showMoviesForTheater = false;
+ private static bool getShowTimes = false;
+ public static int selectedItem = 0;
+ public static string selectedMovieName;
+ public static string selectedTheaterName;
+ public static string selectedMovieDate;
+
+
+ //string backgroundposter = null;
+
+ MapSettings mapSettings = new MapSettings();
+ #endregion
+
+
+ public ShowTimesGUI()
+ {
+ //
+ // TODO: Add constructor logic here
+ //
+
+
+ }
+ #region IPlugin Members
+ public void Start()
+ {
+
+ }
+
+ public void Stop()
+ {
+
+ }
+
+ #endregion
+
+ #region ISetupForm Members
+
+ // Returns the name of the plugin which is shown in the plugin menu
+ public string PluginName()
+ {
+ return "My ShowTimes";
+ }
+
+ // Returns the description of the plugin is shown in the plugin menu
+ public string Description()
+ {
+ return "ShowTimes GUI";
+ }
+
+ // Returns the author of the plugin which is shown in the plugin menu
+ public string Author()
+ {
+ return "Falkyre";
+ }
+
+ // show the setup dialog
+ public void ShowPlugin()
+ {
+ MessageBox.Show("Configuration done using the ShowTimes Grabber Plugin");
+ }
+
+ // Indicates whether plugin can be enabled/disabled
+ public bool CanEnable()
+ {
+ return true;
+ }
+
+ // get ID of windowplugin belonging to this setup
+ public int GetWindowId()
+ {
+ return 7111992;
+ }
+
+ // Indicates if plugin is enabled by default;
+ public bool DefaultEnabled()
+ {
+ return true;
+ }
+ // indicates if a plugin has its own setup screen
+ public bool HasSetup()
+ {
+ return true;
+ }
+
+ /// <summary>
+ /// If the plugin should have its own button on the main menu of Mediaportal then it
+ /// should return true to this method, otherwise if it should not be on home
+ /// it should return false
+ /// </summary>
+ /// <param name="strButtonText">text the button should have</param>
+ /// <param name="strButtonImage">image for the button, or empty for default</param>
+ /// <param name="strButtonImageFocus">image for the button, or empty for default</param>
+ /// <param name="strPictureImage">subpicture for the button or empty for none</param>
+ /// <returns>true : plugin needs its own button on home
+ /// false : plugin does not need its own button on home</returns>
+ public bool GetHome(out string strButtonText, out string strButtonImage, out string strButtonImageFocus, out string strPictureImage)
+ {
+ //strButtonText = PluginName();
+ using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings("MediaPortal.xml"))
+ {
+ strButtonText = ((string)xmlreader.GetValueAsString("ShowTimes Grabber", "pluginName", PluginName())).ToString();
+ }
+ strButtonImage = String.Empty;
+ strButtonImageFocus = String.Empty;
+ strPictureImage = "hover_my trailers.png";
+ return true;
+ }
+
+
+ public override int GetID
+ {
+ get
+ {
+ return 7111992;
+ }
+ set
+ {
+ }
+ }
+ #endregion
+
+ public override bool Init()
+ {
+ GUIPropertyManager.OnPropertyChanged += new GUIPropertyManager.OnPropertyChangedHandler(OnPropertyChanged);
+ loadXML(true);
+
+ return Load(GUIGraphicsContext.Skin + @"\ShowTimesGUI.xml");
+
+ }
+
+ protected override void OnPreviousWindow()
+ {
+ if (PluginSettings.DebugMode)
+ {
+ Log.Debug("OnPageDestroy::Selected {0},{1},{2},{3}", selectedItem, selectedMovieName, selectedMovieDate, selectedTheaterName);
+ Log.Debug("OnPageDestroy::Properties {0},{1},{2},{3}", selectedItem, GUIPropertyManager.GetProperty("#st_title"), GUIPropertyManager.GetProperty("#st_theater"), GUIPropertyManager.GetProperty("#st_moviedate"));
+ Log.Debug("OnPageDestroy::Selected movOrTheater={0},theaterDatesShown={1},showMoviesForTheater={2},getShowTimes={3}", movOrTheater, theaterDatesShown, showMoviesForTheater, getShowTimes);
+ Log.Debug("OnPageDestroy::mapSettings.ViewAs = {0}", mapSettings.ViewAs);
+
+ }
+
+ if (g_Player.Playing)
+ {
+ Log.Debug("in OnPreviousWindow and g_player is playing");
+ }
+
+ //Store movie name in property so we can reset
+
+ GUIPropertyManager.SetProperty("#st_title",selectedMovieName);
+ GUIPropertyManager.SetProperty("#st_theater",selectedTheaterName);
+ GUIPropertyManager.SetProperty("#st_moviedate", selectedMovieDate);
+
+ //reset the values if we were selecting theaters so that we always go back to all the movies
+ /*
+ if (showMoviesForTheater || theaterDatesShown || getShowTimes)
+ {
+ showMoviesForTheater = false;
+ theaterDatesShown = false;
+ getShowTimes = false;
+ movOrTheater = true;
+ }*/
+
+ base.OnPreviousWindow();
+ }
+
+ protected override void OnPageLoad()
+ {
+ base.OnPageLoad();
+
+ //loadXML(false);
+ //check the current date and see if it is greater than the PluginSettings.NextPoll date
+ //if it is, run mtsa.exe (this will handle situations where the computer is in hibernation
+ //and the grabber plugin missed its update time)
+ //The grabber checks the same thing upon MP start, this checks while MP is running
+
+ TimeSpan numdays = DateTime.Now - PluginSettings.NextPoll;
+
+ if (numdays.Days > PluginSettings.UpdateDays + 1)
+ {
+ if ((GUIPropertyManager.GetProperty("#showtimes_grabber_running") == "no" || String.IsNullOrEmpty(GUIPropertyManager.GetProperty("#showtimes_grabber_running"))))
+ GUIPropertyManager.SetProperty("#showtimes_update","true");
+
+ }
+
+ GUIPropertyManager.SetProperty("#currentmodule", "ShowTimesGUI");
+
+ if (PluginSettings.DebugMode)
+ {
+ Log.Debug("OnPageLoad::Selected {0},{1},{2},{3}", selectedItem, selectedMovieName, selectedMovieDate, selectedTheaterName);
+ Log.Debug("OnPageLoad::Properties {0},{1},{2},{3}", selectedItem, GUIPropertyManager.GetProperty("#st_title"), GUIPropertyManager.GetProperty("#st_theater"), GUIPropertyManager.GetProperty("#st_moviedate"));
+ Log.Debug("OnPageLoad::Selected movOrTheater={0},theaterDatesShown={1},showMoviesForTheater={2},getShowTimes={3}", movOrTheater, theaterDatesShown, showMoviesForTheater, getShowTimes);
+ }
+
+ if (xmlLoaded)
+ {
+
+ if (!String.IsNullOrEmpty(GUIPropertyManager.GetProperty("#st_title")))
+ selectedMovieName = GUIPropertyManager.GetProperty("#st_title");
+
+ if (getShowTimes)
+ {
+ if (!String.IsNullOrEmpty(GUIPropertyManager.GetProperty("#st_theater")))
+ selectedTheaterName = GUIPropertyManager.GetProperty("#st_theater");
+
+ if (!String.IsNullOrEmpty(GUIPropertyManager.GetProperty("#st_moviedate")))
+ selectedMovieDate = GUIPropertyManager.GetProperty("#st_moviedate");
+ }
+
+ TheaterInfo.GetTheaters();
+ MovieInfo.GetAllMovies();
+
+ //HideMovieControls();
+
+ //if (theaterDatesShown && getShowTimes && showMoviesForTheater)
+ // showMoviesForTheater = false;
+
+
+ //We selected Show Theaters and a theater, then when back to home, re display the dates
+ if (!movOrTheater && theaterDatesShown && !getShowTimes && showMoviesForTheater)
+ {
+ //movOrTheater=False,theaterDatesShown=True,showMoviesForTheater=True,getShowTimes=False
+ if (PluginSettings.DebugMode)
+ Log.Debug("OnPageLoad::Calling OnMovieTheaters");
+ //movOrTheater=False,theaterDatesShown=False,showMoviesForTheater=True,getShowTimes=False
+ theaterDatesShown = false;
+ getShowTimes = false;
+
+ //OnMovieTheaters();
+ //get_ShowTimes();
+ OnClick(selectedItem);
+ }
+ else if (!movOrTheater && !theaterDatesShown && !getShowTimes && showMoviesForTheater)
+ {
+ //movOrTheater=False,theaterDatesShown=False,showMoviesForTheater=True,getShowTimes=False
+ showMoviesForTheater = false;
+ //getShowTimes = true;
+ movOrTheater = true;
+ if (PluginSettings.DebugMode)
+ Log.Debug("OnPageLoad::Calling get_ShowTimes for theaters");
+
+ //get_ShowTimes();
+ //OnClick(selectedItem);
+ OnMovieTheaters();
+ }
+ else if (movOrTheater && !theaterDatesShown && !getShowTimes && showMoviesForTheater)
+ {
+ if (PluginSettings.DebugMode)
+ Log.Debug("OnPageLoad::Calling OnClick mapSettings.ViewAs = {0}",mapSettings.ViewAs);
+
+ //To display theaters after date selection
+ //before pagedestroy
+ //movOrTheater=False,theaterDatesShown=True,showMoviesForTheater=True,getShowTimes=False
+ //after page destroy
+ //movOrTheater=True,theaterDatesShown=False,showMoviesForTheater=True,getShowTimes=False
+ if (mapSettings.ViewAs != 5)
+ movOrTheater = false;
+ theaterDatesShown = true;
+ //showMoviesForTheater = false;
+ //getShowTimes = true;
+
+ OnClick(selectedItem);
+ }
+ else if (!movOrTheater && !theaterDatesShown && getShowTimes && !showMoviesForTheater)
+ {
+ //movOrTheater=False,theaterDatesShown=False,showMoviesForTheater=False,getShowTimes=True
+ if (PluginSettings.DebugMode)
+ Log.Debug("OnPageLoad::Calling get_ShowTimes");
+
+ get_ShowTimes();
+ }
+ else if (!movOrTheater && theaterDatesShown && getShowTimes && !showMoviesForTheater)
+ {
+ //movOrTheater=False,theaterDatesShown=True,showMoviesForTheater=False,getShowTimes=True
+ if (PluginSettings.DebugMode)
+ Log.Debug("OnPageLoad::Calling OnClick to get the movie dates to pick for {0}", selectedTheaterName);
+
+ theaterDatesShown = false;
+
+ OnClick(selectedItem);
+ }
+ else if (!movOrTheater && theaterDatesShown && getShowTimes && showMoviesForTheater)
+ {
+ //movOrTheater=False,theaterDatesShown=True,showMoviesForTheater=True,getShowTimes=True
+ //We already have all of the information, change to only view the movie
+ if (PluginSettings.DebugMode)
+ Log.Debug("OnPageLoad::Calling OnClick to view the movie data for {0},{1},{2}", selectedMovieName,selectedTheaterName,selectedMovieDate);
+ showMoviesForTheater = false;
+ OnClick(selectedItem);
+ }
+ else if (movOrTheater && !theaterDatesShown && !getShowTimes && !showMoviesForTheater)
+ {
+ HideMovieControls(true);
+
+ GUIControl.ShowControl(GetID, buttonOne.GetID);
+ GUIControl.ShowControl(GetID, btnMovieTheaters.GetID);
+ GUIControl.ShowControl(GetID, NextRefreshLabel.GetID);
+
+ GUIControl.EnableControl(GetID, buttonOne.GetID);
+ GUIControl.EnableControl(GetID, btnMovieTheaters.GetID);
+ GUIControl.SetControlLabel(GetID, btnMovieTheaters.GetID, "Show Theaters");
+
+ GUIControl.ShowControl(GetID, facadeView.GetID);
+ ShowListView(MovieInfo.Movies, true);
+
+ GUIControl.SetControlLabel(GetID, buttonOne.GetID, "View:Big Icons");
+ if (!String.IsNullOrEmpty(GUIPropertyManager.GetProperty("#showtimes_nextupdate")))
+ GUIControl.SetControlLabel(GetID, NextRefreshLabel.GetID, GUIPropertyManager.GetProperty("#showtimes_nextupdate"));
+ else
+ GUIControl.SetControlLabel(GetID, NextRefreshLabel.GetID, "Next ShowTimes Refresh\n" + PluginSettings.NextPoll.ToLongDateString() + "\n@" + PluginSettings.NextPoll.ToShortTimeString());
+
+ facadeView.View = GUIFacadeControl.ViewMode.SmallIcons;
+ mapSettings.ViewAs = 1;
+ GUIControl.FocusControl(GetID, facadeView.GetID);
+ }
+
+ else
+ {
+ GUIPropertyManager.SetProperty("#selecteditem", selectedMovieName);
+ GUIPropertyManager.SetProperty("#st_title", selectedMovieName);
+
+
+ /*if (!showMoviesForTheater)
+ {
+ movOrTheater = true;
+ getShowTimes = true;
+ }
+ if (showMoviesForTheater)
+ {
+ //Start the process of selecting the theaters again
+ movOrTheater = true;
+ OnMovieTheaters();
+ }
+ else
+ {
+ movOrTheater = true;
+ OnClick(selectedItem);
+ }*/
+ movOrTheater = true;
+ OnClick(selectedItem);
+ }
+
+ }
+ else
+ {
+ if (PluginSettings.DebugMode)
+ Log.Info("OnPageLoad::Missing XML files {0} {1} {2}", PluginSettings.grabberCfgXml, LOCFILE,MOVIEDATA);
+ //Display dialog stating that we can't load the xml files
+
+ okDialog("Unable to load some required XML files", "Can't load " + PluginSettings.grabberCfgXml, "or " + LOCFILE,"or " + MOVIEDATA);
+
+ }
+
+
+ }
+
+
+ protected override void OnClicked(int controlId, GUIControl control, MediaPortal.GUI.Library.Action.ActionType actionType)
+ {
+
+ if (control == buttonOne)
+ OnButtonOne();
+
+ if (control == btnMovieTheaters)
+ OnMovieTheaters();
+
+ if (control == btnPlayTrailer)
+
+ OnPlayTrailer(selectedMovieName);
+
+ if (control == btnNextMovie)
+ {
+ movOrTheater = true;
+
+ if (showMoviesForTheater && getShowTimes == false)
+ {
+ if (selectedItem < TheaterInfo.NumMovies - 1)
+ selectedItem++;
+ else
+ selectedItem = 0;
+
+ selectedMovieName = TheaterInfo.Movies[selectedItem];
+ }
+ else
+ {
+ getShowTimes = false;
+ theaterDatesShown = false;
+ showMoviesForTheater = false;
+
+ selectedItem = Array.IndexOf(MovieInfo.Movies, selectedMovieName);
+ if (selectedItem < MovieInfo.NumMovies - 1)
+ selectedItem++;
+ else
+ selectedItem = 0;
+
+ selectedMovieName = MovieInfo.Movies[selectedItem];
+ }
+
+ GUIPropertyManager.SetProperty("#selecteditem", selectedMovieName);
+ GUIPropertyManager.SetProperty("#st_title", selectedMovieName);
+
+ OnClick(selectedItem);
+ }
+
+ if (control == btnPreviousMovie)
+ {
+ movOrTheater = true;
+
+ if (showMoviesForTheater && getShowTimes == false)
+ {
+ if (selectedItem > 0)
+ selectedItem--;
+ else
+ selectedItem = TheaterInfo.NumMovies - 1;
+
+ selectedMovieName = TheaterInfo.Movies[selectedItem];
+
+ }
+ else
+ {
+ getShowTimes = false;
+ theaterDatesShown = false;
+ showMoviesForTheater = false;
+
+ selectedItem = Array.IndexOf(MovieInfo.Movies, selectedMovieName);
+
+ if (selectedItem > 0)
+ selectedItem--;
+ else
+ selectedItem = MovieInfo.NumMovies - 1;
+
+ selectedMovieName = MovieInfo.Movies[selectedItem];
+ }
+
+ GUIPropertyManager.SetProperty("#selecteditem", selectedMovieName);
+ GUIPropertyManager.SetProperty("#st_title", selectedMovieName);
+
+ OnClick(selectedItem);
+ }
+
+ //Display showtimes for selected movie and all theaters
+ if (control == btnShowTimes)
+ {
+ get_ShowTimes();
+ }
+
+ if (control == facadeView)
+ {
+ GUIMessage msg = new GUIMessage(GUIMessage.MessageType.GUI_MSG_ITEM_SELECTED, GetID, 0, controlId, 0, 0, null);
+ OnMessage(msg);
+
+ int itemIndex = (int)msg.Param1;
+
+ if (actionType == Action.ActionType.ACTION_SELECT_ITEM)
+ {
+ GUIListItem item = GUIControl.GetSelectedListItem(GetID, controlId);
+
+ selectedItem = itemIndex;
+
+ if (movOrTheater)
+ selectedMovieName = item.Label;
+
+ //if (getShowTimes)
+ // selectedTheaterName = item.Label;
+
+ if (theaterDatesShown)
+ selectedMovieDate = item.Label;
+
+ if (PluginSettings.DebugMode)
+ {
+ Log.Debug("facadeView::Selected {0},{1},{2},{3}", selectedItem, selectedMovieName, selectedMovieDate, selectedTheaterName);
+ Log.Debug("facadeView::Selected movOrTheater={0},theaterDatesShown={1},showMoviesForTheater={2},getShowTimes={3}", movOrTheater,theaterDatesShown,showMoviesForTheater,getShowTimes);
+ }
+
+ OnClick(itemIndex);
+ }
+ }
+
+ base.OnClicked(controlId, control, actionType);
+ }
+
+ private void OnClick(int itemindex) //When something is pressed in the listview
+ {
+
+ if (PluginSettings.DebugMode)
+ {
+ Log.Debug("OnClick::Movie = {0}; Theater = {1}, Date = {2}", selectedMovieName, selectedTheaterName, selectedMovieDate);
+ Log.Debug("OnClick::Selected movOrTheater={0},theaterDatesShown={1},showMoviesForTheater={2},getShowTimes={3}", movOrTheater, theaterDatesShown, showMoviesForTheater, getShowTimes);
+ }
+
+ if (getShowTimes && theaterDatesShown)
+ {
+ movOrTheater = true;
+ showMoviesForTheater = true;
+ }
+
+ if (movOrTheater)
+ {
+ //Hide facadeView
+ GUIControl.HideControl(GetID, facadeView.GetID);
+
+ //Hide the Movie Theater name
+ if (!showMoviesForTheater)
+ GUIControl.HideControl(GetID, SelectedTheaterCtrl.GetID);
+
+ //Disable View button
+ GUIControl.DisableControl(GetID, buttonOne.GetID);
+ GUIControl.SetControlLabel(GetID, btnMovieTheaters.GetID, "Show All Movies");
+
+ //Get Filename of currently selected item
+ string posterFileName = MovieInfo.GetPosterImage(selectedMovieName);
+ //Show Poster Image
+ if (posterFileName.Equals("NA"))
+ poster.SetFileName(GUIGraphicsContext.Skin + @"\media\defaultvideobig.png");
+ else
+ poster.SetFileName(posterFileName);
+
+ //Get Rating
+ GUIControl.SetControlLabel(GetID,RatingCtrl.GetID,"Rating: " + MovieInfo.GetRating(selectedMovieName));
+
+ //Get Runtime
+ GUIControl.SetControlLabel(GetID, RunTimeCtrl.GetID, "Runtime: " + MovieInfo.GetRunTime(selectedMovieName));
+
+ //Get the Genre
+ GUIControl.SetControlLabel(GetID, GenreCtrl.GetID, MovieInfo.GetGenre(selectedMovieName));
+
+ string playtrailer = MovieInfo.GetTrailerExists(selectedMovieName);
+ //Get Trailer
+ //GUIControl.SetControlLabel(GetID, TrailerCtrl.GetID, "Trailer: " + playtrailer);
+
+ //Disable Play Trailer button if no trailer available or reenable if one available
+ if (playtrailer.Equals("No"))
+ GUIControl.DisableControl(GetID, btnPlayTrailer.GetID);
+ else
+ GUIControl.EnableControl(GetID, btnPlayTrailer.GetID);
+
+ //Get the Actors
+ GUIControl.SetControlLabel(GetID, StarringCtrl.GetID, MovieInfo.GetActors(selectedMovieName));
+
+ //Get the Director
+ GUIControl.SetControlLabel(GetID, DirectorCtrl.GetID, MovieInfo.GetDirector(selectedMovieName));
+
+ //Get the IMDB
+ GUIControl.SetControlLabel(GetID, IMDBCtrl.GetID, "IMDB Rating: " + MovieInfo.GetIMDBRating(selectedMovieName));
+
+ //Get the Plot
+ GUIControl.SetControlLabel(GetID, plotarea.GetID, MovieInfo.GetPlot(selectedMovieName));
+
+ ShowMovieControls();
+
+ if (showMoviesForTheater || getShowTimes)
+ {
+ SelectedTheaterCtrl.Label = selectedTheaterName;
+ GUIControl.ShowControl(GetID, SelectedTheaterCtrl.GetID);
+ GUIPropertyManager.SetProperty("#selecteditem", selectedMovieName + " " + selectedMovieDate + "@" + TheaterInfo.GetShowTimes(selectedMovieName, selectedTheaterName, selectedMovieDate));
+ TheaterInfo.GetMoviesByTheater(selectedTheaterName,selectedMovieDate);
+ GUIPropertyManager.SetProperty("#st_theater", selectedTheaterName);
+ /*if (getShowTimes)
+ {
+ showMoviesForTheater = false;
+ getShowTimes = false;
+ theaterDatesShown = false;
+ }*/
+ //Hide next/previous and disable get showtimes button
+ if (getShowTimes)
+ {
+ if (PluginSettings.DebugMode)
+ Log.Debug("OnClick::Hide Next/Prev movOrTheater={0},theaterDatesShown={1},showMoviesForTheater={2},getShowTimes={3}", movOrTheater, theaterDatesShown, showMoviesForTheater, getShowTimes);
+ GUIControl.HideControl(GetID, btnNextMovie.GetID);
+ GUIControl.HideControl(GetID, btnPreviousMovie.GetID);
+ GUIControl.DisableControl(GetID, btnShowTimes.GetID);
+ }
+ mapSettings.ViewAs = 5;
+ }
+
+ if (!showMoviesForTheater)
+ movOrTheater = false;
+
+ }
+ else
+ {
+ if (theaterDatesShown)
+ {
+ //We have a list of dates, display the movies for the theater on the date selected
+
+ if (facadeView.Focus)
+ {
+ if (PluginSettings.DebugMode)
+ Log.Debug("OnClick::Getting movies for {0} on date {1}", selectedTheaterName, selectedMovieDate);
+ selectedMovieDate = facadeView.ListView.SelectedListItem.Label;
+ GUIPropertyManager.SetProperty("#st_moviedate", selectedMovieDate);
+ }
+
+ if (PluginSettings.DebugMode)
+ Log.Debug("Getting movies for {0} on date {1}", selectedTheaterName, selectedMovieDate);
+
+ TheaterInfo.GetMoviesByTheater(selectedTheaterName,selectedMovieDate);
+
+ GUIControl.SetControlLabel(GetID, buttonOne.GetID, "View:Big Icons");
+ facadeView.View = GUIFacadeControl.ViewMode.SmallIcons;
+ mapSettings.ViewAs = 1;
+
+ GUIControl.EnableControl(GetID, buttonOne.GetID);
+ GUIControl.EnableControl(GetID, btnMovieTheaters.GetID);
+
+ theaterDatesShown = false;
+ showMoviesForTheater = true;
+ movOrTheater = true;
+
+
+ ShowTheaterMoviesView();
+
+ //OnClick(selectedItem);
+
+
+ }
+ else
+ {
+ //We have a list of Theaters, display the dates we have to allow the user to see what's playing on that date
+
+ if (PluginSettings.DebugMode)
+ Log.Debug("OnClick::Selecting dates for {1} at theater {0}", selectedTheaterName, selectedMovieName);
+
+
+ if (facadeView.Focus)
+ {
+ if (PluginSettings.DebugMode)
+ Log.Debug("OnClick::Getting movies for {0} on date {1}", selectedTheaterName, selectedMovieDate);
+
+ selectedTheaterName = facadeView.ListView.SelectedListItem.Label;
+ GUIPropertyManager.SetProperty("#st_theater", selectedTheaterName);
+ } else
+ Log.Debug("facadeView::Not loaded");
+
+ if (PluginSettings.DebugMode)
+ Log.Debug("Theater item index {0} selected {1}", itemindex, selectedTheaterName);
+
+ //selectedTheaterName = TheaterInfo.Theaters[itemindex];
+
+
+ SelectedTheaterCtrl.Label = selectedTheaterName;
+ GUIControl.ShowControl(GetID, SelectedTheaterCtrl.GetID);
+
+ //GUIControl.SetControlLabel(GetID, buttonOne.GetID, "View:List");
+ facadeView.View = GUIFacadeControl.ViewMode.List;
+ //mapSettings.ViewAs = 0;
+
+
+ ShowTheaterDatesView(TheaterInfo.GetUniqueShowDates(TheaterInfo.Theaters[itemindex]));
+
+
+ //GUIControl.EnableControl(GetID, buttonOne.GetID);
+ GUIControl.SetControlLabel(GetID, btnMovieTheaters.GetID, "Show All Movies");
+
+ theaterDatesShown = true;
+ //movOrTheater = true;
+ }
+
+ }
+
+ }
+
+ private void HideMovieControls(bool hideposter)
+ {
+
+ if (hideposter)
+ {
+ GUIControl.HideControl(GetID, poster.GetID);
+ GUIControl.HideControl(GetID, posterBorder.GetID);
+ }
+
+ GUIControl.HideControl(GetID, RatingCtrl.GetID);
+ GUIControl.HideControl(GetID, RunTimeCtrl.GetID);
+ //GUIControl.HideControl(GetID, TrailerCtrl.GetID);
+ GUIControl.HideControl(GetID, GenreLabel.GetID);
+ GUIControl.HideControl(GetID, GenreCtrl.GetID);
+ GUIControl.HideControl(GetID, StarringLabel.GetID);
+ GUIControl.HideControl(GetID, StarringCtrl.GetID);
+ GUIControl.HideControl(GetID, DirectorLabel.GetID);
+ GUIControl.HideControl(GetID, DirectorCtrl.GetID);
+ GUIControl.HideControl(GetID, IMDBCtrl.GetID);
+ GUIControl.HideControl(GetID, PlotLabel.GetID);
+ GUIControl.HideControl(GetID, plotarea.GetID);
+ GUIControl.HideControl(GetID, btnShowTimes.GetID);
+ GUIControl.HideControl(GetID, btnPlayTrailer.GetID);
+ GUIControl.HideControl(GetID, btnNextMovie.GetID);
+ GUIControl.HideControl(GetID, btnPreviousMovie.GetID);
+ GUIControl.HideControl(GetID, SelectedTheaterCtrl.GetID);
+ }
+
+ private void ShowMovieControls()
+ {
+ GUIControl.ShowControl(GetID, poster.GetID);
+ GUIControl.ShowControl(GetID, posterBorder.GetID);
+ GUIControl.ShowControl(GetID, RatingCtrl.GetID);
+ GUIControl.ShowControl(GetID, RunTimeCtrl.GetID);
+ //GUIControl.ShowControl(GetID, TrailerCtrl.GetID);
+ GUIControl.ShowControl(GetID, GenreLabel.GetID);
+ GUIControl.ShowControl(GetID, GenreCtrl.GetID);
+ GUIControl.ShowControl(GetID, StarringLabel.GetID);
+ GUIControl.ShowControl(GetID, StarringCtrl.GetID);
+ GUIControl.ShowControl(GetID, DirectorLabel.GetID);
+ GUIControl.ShowControl(GetID, DirectorCtrl.GetID);
+ GUIControl.ShowControl(GetID, IMDBCtrl.GetID);
+ //GUIControl.ShowControl(GetID, PlotLabel.GetID);
+ GUIControl.ShowControl(GetID, plotarea.GetID);
+ GUIControl.ShowControl(GetID, btnShowTimes .GetID);
+ GUIControl.ShowControl(GetID, btnPlayTrailer.GetID);
+ GUIControl.ShowControl(GetID, btnNextMovie.GetID);
+ GUIControl.ShowControl(GetID, btnPreviousMovie.GetID);
+ }
+
+
+ private void OnButtonOne()
+ {
+ if (mapSettings.ViewAs == 1)
+ {
+ GUIControl.SetControlLabel(GetID, buttonOne.GetID, "View:List");
+ facadeView.View = GUIFacadeControl.ViewMode.LargeIcons;
+ mapSettings.ViewAs = 2;
+ }
+ else if (mapSettings.ViewAs == 2)
+ {
+ GUIControl.SetControlLabel(GetID, buttonOne.GetID, "View:Small Icons");
+ facadeView.View = GUIFacadeControl.ViewMode.List;
+ mapSettings.ViewAs = 0;
+ }
+ else
+ {
+ GUIControl.SetControlLabel(GetID, buttonOne.GetID, "View:Big Icons");
+ facadeView.View = GUIFacadeControl.ViewMode.SmallIcons;
+ mapSettings.ViewAs = 1;
+ }
+ }
+
+ private void OnMovieTheaters()
+ {
+ HideMovieControls(true);
+
+
+ if (showMoviesForTheater)
+ movOrTheater = false;
+
+ if (movOrTheater)
+ {
+ facadeView.View = GUIFacadeControl.ViewMode.List;
+ GUIControl.SetControlLabel(GetID, btnMovieTheaters.GetID, "Show All Movies");
+ GUIControl.DisableControl(GetID, btnMovieTheaters.GetID);
+ GUIControl.DisableControl(GetID, buttonOne.GetID);
+ GUIControl.DisableControl(GetID, btnShowTimes.GetID);
+ GUIControl.FocusControl(GetID, facadeView.GetID);
+
+ ShowTheatersView(TheaterInfo.Theaters);
+
+ if (PluginSettings.DebugMode)
+ Log.Debug("Movies Changed to Theaters");
+
+ getShowTimes = false;
+ showMoviesForTheater = true;
+ movOrTheater = false;
+
+ }
+ else
+ {
+
+ GUIControl.EnableControl(GetID, buttonOne.GetID);
+ GUIControl.EnableControl(GetID, btnShowTimes.GetID);
+ GUIControl.SetControlLabel(GetID, btnMovieTheaters.GetID, "Show Theaters");
+
+ if (mapSettings.ViewAs == 5) mapSettings.ViewAs = 1;
+
+ if (mapSettings.ViewAs == 0)
+ {
+ GUIControl.SetControlLabel(GetID, buttonOne.GetID, "View:Small Icons");
+ facadeView.View = GUIFacadeControl.ViewMode.List;
+ mapSettings.ViewAs = 0;
+ }
+ else if (mapSettings.ViewAs == 1)
+ {
+ GUIControl.SetControlLabel(GetID, buttonOne.GetID, "View:Big Icons");
+ facadeView.View = GUIFacadeControl.ViewMode.SmallIcons;
+ mapSettings.ViewAs = 1;
+ }
+ else
+ {
+ GUIControl.SetControlLabel(GetID, buttonOne.GetID, "View:List");
+ facadeView.View = GUIFacadeControl.ViewMode.LargeIcons;
+ mapSettings.ViewAs = 2;
+ }
+
+ MovieInfo.GetAllMovies();
+
+
+
+ //GUIControl.HideControl(GetID, SelectedTheaterCtrl.GetID);
+
+ movOrTheater = true;
+
+ selectedMovieDate = String.Empty;
+ selectedMovieName = String.Empty;
+ selectedTheaterName = String.Empty;
+
+ theaterDatesShown = false;
+ getShowTimes = false;
+ showMoviesForTheater = false;
+
+ ShowListView(MovieInfo.Movies, false);
+
+ if (PluginSettings.DebugMode)
+ Log.Debug("Theaters Changed to Movies");
+ }
+
+ }
+
+ private void OnPlayTrailer(string MovieName)
+ {
+ //Get the trailer location (can be a URL or location on disk)
+ GUIGraphicsContext.IsFullScreenVideo = true;
+ GUIWindowManager.ActivateWindow((int)GUIWindow.Window.WINDOW_FULLSCREEN_VIDEO);
+ g_Player.FullScreen = true;
+
+ g_Player.Play(MovieInfo.GetTrailerLoc(MovieName),g_Player.MediaType.Video);
+ //If we are downloading a stream and dont't have an actual file to play
+ //g_Player.Play(@"http://movies.apple.com/movies/mgm/arthurandtheinvisibles/arthurandtheinvisibles_h320.mov");
+
+
+ }
+
+ public void ShowListView(string[] _List, bool show_poster)
+ {
+ int i = 0;
+ if (show_poster == false)
+ //poster.SetFileName(GUIGraphicsContext.Skin + @"\media\" + backgroundposter);
+
+ GUIControl.ClearControl(GetID, facadeView.GetID);
+
+ if (PluginSettings.DebugMode)
+ Log.Debug("ShowListView::List size {0}", _List.Length.ToString());
+
+ //while (_List[i] != null)
+ while (i<_List.Length)
+ {
+ GUIListItem item = new GUIListItem();
+
+ item.Label = _List[i];
+ item.OnRetrieveArt += new MediaPortal.GUI.Library.GUIListItem.RetrieveCoverArtHandler(OnRetrieveCoverArt);
+ facadeView.Add(item);
+ if (PluginSettings.DebugMode)
+ Log.Debug("Adding {0} to facadeView", _List[i]);
+ i++;
+ }
+
+ }
+
+ public void ShowTheatersView(string[] _Theaters)
+ {
+ GUIControl.ClearControl(GetID, facadeView.GetID);
+
+ if (PluginSettings.DebugMode)
+ Log.Debug("Theater List size {0}", _Theaters.Length.ToString());
+
+ ...
[truncated message content] |