コード例 #1
0
        private void HideZapOSD()
        {
            ChannelNumberOrIndex = string.Empty;
            IScreenManager screenManager = ServiceRegistration.Get <IScreenManager>();

            screenManager.SetSuperLayer(null);
        }
コード例 #2
0
        protected void DoHideSuperLayer(object state)
        {
            _currentSuperLayerName = null;
            _superLayerEndTime     = null;
            IScreenManager screenManager = ServiceRegistration.Get <IScreenManager>();

            screenManager.SetSuperLayer(null);
        }
コード例 #3
0
        public void ShowBusyScreen()
        {
            lock (_syncObj)
            {
                _busyScreenRequests++;
                if (_busyScreenRequests != 1)
                {
                    return;
                }
            }
            IScreenManager screenManager = ServiceRegistration.Get <IScreenManager>();

            screenManager.SetSuperLayer(BUSY_CURSOR_SCREEN_NAME);
        }
コード例 #4
0
        private void OnApplicationIdle(object sender, EventArgs e)
        {
            try
            {
                // Screen saver
                IInputManager inputManager = ServiceRegistration.Get <IInputManager>();
                // Remember old state, calls to IScreenManager are only required on state changes
                bool wasScreenSaverActive = _isScreenSaverActive;
                if (_isScreenSaverEnabled)
                {
                    IPlayerManager        playerManager        = ServiceRegistration.Get <IPlayerManager>();
                    IPlayerContextManager playerContextManager = ServiceRegistration.Get <IPlayerContextManager>();
                    IPlayer primaryPlayer     = playerManager[PlayerManagerConsts.PRIMARY_SLOT];
                    IMediaPlaybackControl mbc = primaryPlayer as IMediaPlaybackControl;
                    bool preventScreenSaver   = ((primaryPlayer is IVideoPlayer || primaryPlayer is IImagePlayer) && (mbc == null || !mbc.IsPaused)) ||
                                                playerContextManager.IsFullscreenContentWorkflowStateActive;

                    _isScreenSaverActive = !preventScreenSaver &&
                                           SkinContext.FrameRenderingStartTime - inputManager.LastMouseUsageTime > _screenSaverTimeOut &&
                                           SkinContext.FrameRenderingStartTime - inputManager.LastInputTime > _screenSaverTimeOut;

                    if (_screenSaverController != null)
                    {
                        bool?activeOverride = _screenSaverController.IsScreenSaverActiveOverride;
                        if (activeOverride.HasValue)
                        {
                            _isScreenSaverActive = activeOverride.Value;
                        }
                    }
                }
                else
                {
                    _isScreenSaverActive = false;
                }
                if (wasScreenSaverActive != _isScreenSaverActive)
                {
                    IScreenManager superLayerManager = ServiceRegistration.Get <IScreenManager>();
                    superLayerManager.SetSuperLayer(_isScreenSaverActive ? SCREEN_SAVER_SCREEN : null);
                }

                // If we are in fullscreen mode, we may control the mouse cursor, else reset it to visible state, if state was switched
                ShowMouseCursor(!IsFullScreen || inputManager.IsMouseUsed);
            }
            catch (Exception ex)
            {
                ServiceRegistration.Get <ILogger>().Error("SkinEngine MainForm: Error occured in Idle handler", ex);
            }
        }
コード例 #5
0
        public void HideBusyScreen()
        {
            lock (_syncObj)
            {
                _busyScreenRequests--;
                if (_busyScreenRequests < 0)
                {
                    _busyScreenRequests = 0;
                    throw new IllegalCallException("Busy screen should be hidden but is not visible");
                }
                if (_busyScreenRequests != 0)
                {
                    return;
                }
            }
            IScreenManager screenManager = ServiceRegistration.Get <IScreenManager>();

            screenManager.SetSuperLayer(_currentSuperLayerName);
        }
コード例 #6
0
        public void ShowSuperLayer(string superLayerScreenName, TimeSpan duration)
        {
            bool changeLayer = false;

            lock (_syncObj)
            {
                if (superLayerScreenName != _currentSuperLayerName)
                {
                    changeLayer            = true;
                    _currentSuperLayerName = superLayerScreenName;
                }
                _superLayerEndTime = DateTime.Now + duration;
                _superLayerHideTimer.Change(duration, INFINITE_PERIOD);
            }

            if (changeLayer)
            {
                IScreenManager screenManager = ServiceRegistration.Get <IScreenManager>();
                screenManager.SetSuperLayer(superLayerScreenName);
            }
        }
コード例 #7
0
        private static void HideSkipOSD()
        {
            IScreenManager screenManager = ServiceRegistration.Get <IScreenManager>();

            screenManager.SetSuperLayer(null);
        }