Ejemplo n.º 1
0
        protected override void OnPageLoad()
        {
            if (firstLoad)
            {
                firstLoad = false;

                GUIPropertyManager.SetProperty("#Emulators2.PreviewVideo.playing", "no");
                //Image Handlers
                backdrop = new ImageSwapper();
                backdrop.ImageResource.Delay = Options.Instance.GetIntOption("fanartdelay");
                backdrop.PropertyOne         = "#Emulators2.CurrentItem.fanartpath";
                backdrop.PropertyTwo         = "#Emulators2.CurrentItem.fanartpath2";

                newGUIHandler = new GUIPresenter();
                newGUIHandler.OnSortAscendingChanged      += new GUIPresenter.SortAscendingChanged(newGUIHandler_OnSortAscendingChanged);
                newGUIHandler.OnPreviewVideoStatusChanged += new GUIPresenter.PreviewVideoStatusChanged(newGUIHandler_OnPreviewVideoStatusChanged);
                GUIPropertyManager.SetProperty("#Emulators2.plugintitle", Options.Instance.GetStringOption("shownname"));

                onVideoStopped = new g_Player.StoppedHandler(g_Player_PlayBackStopped);
                onVideoEnded   = new g_Player.EndedHandler(g_Player_PlayBackEnded);
            }

            base.OnPageLoad();
            DBItem startupItem = null;
            bool   launch      = false;

            getStartupSettings(ref startupItem, ref launch);

            if (buttonSort != null)
            {
                buttonSort.IsAscending  = newGUIHandler.SortAscending;
                buttonSort.SortChanged += new SortEventHandler(newGUIHandler.OnSort);
            }

            if (Options.Instance.GetBoolOption("showfanart"))
            {
                backdrop.GUIImageOne = fanartControl1;
                backdrop.GUIImageTwo = fanartControl2;
            }

            if (gameArtEnabled != null)
            {
                gameArtEnabled.Visible = Options.Instance.GetBoolOption("showgameart"); //update gameart dummy control visibility
            }
            if (Options.Instance.GetBoolOption("showvideopreview"))
            {
                if (videoPreviewEnabled != null)
                {
                    videoPreviewEnabled.Visible = true; //videoPreview dummy
                }
            }

            g_Player.PlayBackStopped += onVideoStopped;
            g_Player.PlayBackEnded   += onVideoEnded;

            newGUIHandler.Load(facade, backdrop, startupItem, launch, showVideoPreviewControl, goodmergeList, details_play);
        }
Ejemplo n.º 2
0
        void doLoad()
        {
            MP1Options options = MP1Utils.Options;
            options.EnterReadLock();
            if (firstLoad)
            {
                firstLoad = false;

                GUIPropertyManager.SetProperty("#Emulators2.PreviewVideo.playing", "no");
                //Image Handlers
                backdrop = new ImageSwapper();
                backdrop.ImageResource.Delay = options.FanartDelay;
                backdrop.PropertyOne = "#Emulators2.CurrentItem.fanartpath";
                backdrop.PropertyTwo = "#Emulators2.CurrentItem.fanartpath2";

                guiHandler = new GUIPresenter();
                guiHandler.OnSortAscendingChanged += new GUIPresenter.SortAscendingChanged(newGUIHandler_OnSortAscendingChanged);
                guiHandler.OnPreviewVideoStatusChanged += new GUIPresenter.PreviewVideoStatusChanged(newGUIHandler_OnPreviewVideoStatusChanged);
                GUIPropertyManager.SetProperty("#Emulators2.plugintitle", options.PluginDisplayName);

                onVideoStopped = new g_Player.StoppedHandler(g_Player_PlayBackStopped);
                onVideoEnded = new g_Player.EndedHandler(g_Player_PlayBackEnded);
            }
            
            DBItem startupItem = null;
            bool launch = false;
            getStartupSettings(ref startupItem, ref launch);

            if (buttonSort != null)
            {
                buttonSort.IsAscending = guiHandler.SortAscending;
                buttonSort.SortChanged += new SortEventHandler(guiHandler.OnSort);
            }

            if (options.ShowFanart)
            {
                backdrop.GUIImageOne = fanartControl1;
                backdrop.GUIImageTwo = fanartControl2;
            }

            if (gameArtEnabled != null)
                gameArtEnabled.Visible = options.ShowVideoPreview; //update gameart dummy control visibility

            if (options.ShowVideoPreview)
            {
                if (videoPreviewEnabled != null)
                    videoPreviewEnabled.Visible = true; //videoPreview dummy
            }

            options.ExitReadLock();

            g_Player.PlayBackStopped += onVideoStopped;
            g_Player.PlayBackEnded += onVideoEnded;

            guiHandler.Load(facade, backdrop, startupItem, launch, showVideoPreviewControl, goodmergeList, details_play);
        }