コード例 #1
0
        /// <summary>
        /// If parental controls are enabled make sure the user is not up to no good.
        /// </summary>
        private bool VerifyParentalControls()
        {
            if (MovingPicturesCore.Settings.ParentalControlsEnabled && !MovingPicturesGUI.ValidatePin(GetID))
            {
                GUIWindowManager.ShowPreviousWindow();
                return(false);
            }

            return(true);
        }
コード例 #2
0
        /// <summary>
        /// Checks that the current skin supports the importer. Backs out if it does not.
        /// </summary>
        private bool VerifySkinSupport()
        {
            bool skinSupported = allFilesListControl != null && pendingFilesListControl != null && completedFileListControl != null;

            if (!skinSupported)
            {
                GUIWindowManager.ShowPreviousWindow();
                MovingPicturesGUI.ShowMessage("Moving Pictures", Translation.SkinDoesNotSupportImporter, GetID);
                return(false);
            }

            return(true);
        }
コード例 #3
0
        /// <summary>
        /// Check if the importer is meant to run in the GUI, if not let the user know. Backs out if the user keeps the importer off.
        /// </summary>
        private bool VerifyImporterEnabled()
        {
            if (MovingPicturesCore.Settings.EnableImporterInGUI)
            {
                return(true);
            }

            bool enable = MovingPicturesGUI.ShowCustomYesNo(Translation.ImporterDisabled, Translation.ImporterDisabledMessage, null, null, false, GetID);

            MovingPicturesCore.Settings.EnableImporterInGUI = enable;

            if (enable)
            {
                MovingPicturesCore.Importer.Start();
            }
            else
            {
                GUIWindowManager.ShowPreviousWindow();
            }

            return(enable);
        }
コード例 #4
0
        public MoviePlayer(MovingPicturesGUI gui)
        {
            _gui = gui;

            // external player handlers
            Util.Utils.OnStartExternal += new Util.Utils.UtilEventHandler(onStartExternal);
            Util.Utils.OnStopExternal  += new Util.Utils.UtilEventHandler(onStopExternal);

            // default player handlers
            g_Player.PlayBackStarted += new g_Player.StartedHandler(onPlaybackStarted);
            g_Player.PlayBackEnded   += new g_Player.EndedHandler(onPlayBackEnded);
            g_Player.PlayBackStopped += new g_Player.StoppedHandler(onPlayBackStoppedOrChanged);

            try {
                // This is a handler added in RC4 - if we are using an older mediaportal version
                // this would throw an exception.
                g_Player.PlayBackChanged += new g_Player.ChangedHandler(onPlayBackStoppedOrChanged);
            }
            catch (Exception) {
                logger.Warn("Running MediaPortal 1.0 RC3 or earlier. Unexpected behavior may occur when starting playback of a new movie without stopping previous movie. Please upgrade for better performance.");
            }

            logger.Info("Movie Player initialized.");
        }