コード例 #1
0
    public override void Process()
    {
      CheckTimeOuts();
      if (ScreenStateChanged())
      {
        UpdateGUI();
      }

      if ((_statusVisible || _stepSeekVisible || (!_isOsdVisible && g_Player.Speed != 1) ||
           (!_isOsdVisible && _isPauseOsdVisible)) || _isOsdVisible)
      {
        TVHome.UpdateProgressPercentageBar();
      }
      else
      {
        // in fullscreen TV we still have to update the properties - since external displays depend on these.
        // one update per. minute should be enough
        TimeSpan tsProgressBar = DateTime.Now - _updateTimerProgressbar;

        if (tsProgressBar.TotalMilliseconds > 60000)
        {
          TVHome.UpdateProgressPercentageBar();
          _updateTimerProgressbar = DateTime.Now;
        }
      }

      if (!VideoRendererStatistics.IsVideoFound)
      {
        if ((lastChannelWithNoSignal != TVHome.Navigator.Channel.IdChannel) ||
            (videoState != VideoRendererStatistics.VideoState))
        {
          if (!_zapOsdVisible)
          {
            GUIMessage message = new GUIMessage(GUIMessage.MessageType.GUI_MSG_NOTIFY, GetID, GetID, 0, 5, 0, null);
            switch (VideoRendererStatistics.VideoState)
            {
              case VideoRendererStatistics.State.NoSignal:
                message.Label = GUILocalizeStrings.Get(1034);
                break;
              case VideoRendererStatistics.State.Scrambled:
                message.Label = GUILocalizeStrings.Get(1035);
                break;
              case VideoRendererStatistics.State.Signal:
                message.Label = GUILocalizeStrings.Get(1036);
                break;
              default:
                message.Label = GUILocalizeStrings.Get(1036);
                break;
            }
            lastChannelWithNoSignal = TVHome.Navigator.Channel.IdChannel;
            videoState = VideoRendererStatistics.VideoState;
            OnMessage(message);
          }
        }
      }
      else
      {
        lastChannelWithNoSignal = -1;
        videoState = VideoRendererStatistics.State.VideoPresent;
      }

      //check if the tv recording has reached the end ...if so, stop it.
      if (g_Player.IsTVRecording && !TvRecorded.IsLiveRecording())
      {
        double currentPosition = (double)(g_Player.CurrentPosition);
        double duration = (double)(g_Player.Duration);

        if (currentPosition > duration)
        {
          g_Player.Stop();
        }
      }
      
      TVHome.ShowCiMenu();

      if (!g_Player.Playing && !TVHome.DoingChannelChange())
      {
          Log.Debug("Tvfullscreen:not viewing anymore");
          GUIWindowManager.ShowPreviousWindow();
      }
      else
        GUIGraphicsContext.IsFullScreenVideo = true;
    }
コード例 #2
0
        public override void Process()
        {
            CheckTimeOuts();
            if (ScreenStateChanged())
            {
                UpdateGUI();
            }

            if ((_statusVisible || _stepSeekVisible || (!_isOsdVisible && g_Player.Speed != 1) ||
                 (!_isOsdVisible && _isPauseOsdVisible)) || _isOsdVisible)
            {
                TvHome.UpdateProgressPercentageBar();
            }
            else
            {
                // in fullscreen TV we still have to update the properties - since external displays depend on these.
                // one update per. minute should be enough
                TimeSpan tsProgressBar = DateTime.Now - _updateTimerProgressbar;

                if (tsProgressBar.TotalMilliseconds > 30000)
                {
                    TvHome.UpdateProgressPercentageBar();
                    _updateTimerProgressbar = DateTime.Now;
                }
            }

            if (!VideoRendererStatistics.IsVideoFound)
            {
                if (_lastChannelWithNoSignalId != PluginMain.Navigator.CurrentChannel.ChannelId
                    || videoState != VideoRendererStatistics.VideoState)
                {
                    if (!_zapOsdVisible)
                    {
                        GUIMessage message = new GUIMessage(GUIMessage.MessageType.GUI_MSG_NOTIFY, GetID, GetID, 0, 5, 0, null);
                        switch (VideoRendererStatistics.VideoState)
                        {
                            case VideoRendererStatistics.State.NoSignal:
                                message.Label = GUILocalizeStrings.Get(1034);
                                break;
                            case VideoRendererStatistics.State.Scrambled:
                                message.Label = GUILocalizeStrings.Get(1035);
                                break;
                            case VideoRendererStatistics.State.Signal:
                                message.Label = GUILocalizeStrings.Get(1036);
                                break;
                            default:
                                message.Label = GUILocalizeStrings.Get(1036);
                                break;
                        }
                        _lastChannelWithNoSignalId = PluginMain.Navigator.CurrentChannel.ChannelId;
                        videoState = VideoRendererStatistics.VideoState;
                        OnMessage(message);
                    }
                }
            }
            else
            {
                _lastChannelWithNoSignalId = Guid.Empty;
                videoState = VideoRendererStatistics.State.VideoPresent;
            }

            //check if the tv recording has reached the end ...if so, stop it.
            if (g_Player.IsTVRecording)
            {
                Recording rec = TvRecorded.GetPlayingRecording();
                bool isLiveRecording = (rec != null && PluginMain.IsRecordingStillActive(rec.RecordingId));
                if (!isLiveRecording)
                {
                    double currentPosition = (double)(g_Player.CurrentPosition);
                    double duration = (double)(g_Player.Duration);

                    if (currentPosition > duration)
                    {
                        g_Player.Stop();
                    }
                }
            }

            //TVHome.ShowCiMenu();

            if (!g_Player.Playing && !PluginMain.Navigator.LastChannelChangeFailed)
            {
                Log.Debug("Tvfullscreen:not viewing anymore");
                if (GUIWindowManager.GetPreviousActiveWindow() == (int)GUIWindow.Window.WINDOW_TV_TUNING_DETAILS)
                {
                    GUIWindowManager.ActivateWindow(WindowId.TvHome);
                }
                else
                {
                    GUIWindowManager.ShowPreviousWindow();
                }
            }
            else
                GUIGraphicsContext.IsFullScreenVideo = true;
        }