当前位置: 首页>>代码示例>>C#>>正文


C# TvServer.IsRecording方法代码示例

本文整理汇总了C#中TvControl.TvServer.IsRecording方法的典型用法代码示例。如果您正苦于以下问题:C# TvServer.IsRecording方法的具体用法?C# TvServer.IsRecording怎么用?C# TvServer.IsRecording使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TvControl.TvServer的用法示例。


在下文中一共展示了TvServer.IsRecording方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OnRecordProgram

 private void OnRecordProgram(Program program)
 {
   if (program == null)
   {
     return;
   }
   Log.Debug("TVProgammInfo.OnRecordProgram - programm = {0}", program.ToString());
   Schedule recordingSchedule;
   if (!anyUpcomingEpisodesRecording && currentSchedule != null)
   {
     CancelProgram(program, currentSchedule, GetID);
   }
   else if (IsRecordingProgram(program, out recordingSchedule, true)) // check if schedule is already existing
   {
     CancelProgram(program, recordingSchedule, GetID);
   }
   else
   {
     TvServer server = new TvServer();
     VirtualCard card;
     if (TVHome.Navigator.Channel.IdChannel == program.IdChannel &&
         server.IsRecording(TVHome.Navigator.Channel.IdChannel, out card))
     {
       Schedule schedFromDB = Schedule.Retrieve(card.RecordingScheduleId);
       if (schedFromDB.IsManual)
       {
         Schedule sched = Schedule.Retrieve(card.RecordingScheduleId);
         TVUtil.DeleteRecAndSchedWithPrompt(sched, program.IdChannel);
       }
       else
       {
         CreateProgram(program, (int)ScheduleRecordingType.Once, GetID);
       }
     }
     else
     {
       CreateProgram(program, (int)ScheduleRecordingType.Once, GetID);
     }
   }
   Update();
 }
开发者ID:sanyaade-embedded-systems,项目名称:MediaPortal-1,代码行数:41,代码来源:TVProgramInfo.cs

示例2: ManualRecord

    public static bool ManualRecord(Channel channel, int dialogId)
    {
      if (GUIWindowManager.ActiveWindowEx == (int)(int)Window.WINDOW_TVFULLSCREEN)
      {
        Log.Info("send message to fullscreen tv");
        GUIMessage msg = new GUIMessage(GUIMessage.MessageType.GUI_MSG_RECORD, GUIWindowManager.ActiveWindow, 0, 0, 0, 0,
                                        null);
        msg.SendToTargetWindow = true;
        msg.TargetWindowId = (int)(int)Window.WINDOW_TVFULLSCREEN;
        GUIGraphicsContext.SendMessage(msg);
        return false;
      }

      Log.Info("TVHome:Record action");
      var server = new TvServer();

      VirtualCard card = null;
      Program prog = channel.CurrentProgram;
      bool isRecording;
      bool hasProgram = (prog != null);
      if (hasProgram)
      {
        prog.Refresh();//refresh the states from db
        isRecording = (prog.IsRecording || prog.IsRecordingOncePending);
      }
      else
      {
        isRecording = server.IsRecording(channel.IdChannel, out card);
      }

      if (!isRecording)
      {
        if (hasProgram)
        {
          GUIDialogMenuBottomRight pDlgOK =
            (GUIDialogMenuBottomRight)GUIWindowManager.GetWindow((int)Window.WINDOW_DIALOG_MENU_BOTTOM_RIGHT);
          if (pDlgOK != null)
          {
            pDlgOK.Reset();
            pDlgOK.SetHeading(605); //my tv
            pDlgOK.AddLocalizedString(875); //current program

            bool doesManuelScheduleAlreadyExist = DoesManualScheduleAlreadyExist(channel);
            if (!doesManuelScheduleAlreadyExist)
            {
              pDlgOK.AddLocalizedString(876); //till manual stop
            }
            pDlgOK.DoModal(GUIWindowManager.ActiveWindow);
            switch (pDlgOK.SelectedId)
            {
              case 875:
                //record current program                  
                TVProgramInfo.CreateProgram(prog, (int)ScheduleRecordingType.Once, dialogId);
                GUIMessage msgManualRecord = new GUIMessage(GUIMessage.MessageType.GUI_MSG_MANUAL_RECORDING_STARTED, 0, 0, 0, 0, 0, null);
                GUIWindowManager.SendMessage(msgManualRecord);
                return true;

              case 876:
                //manual
                StartRecordingSchedule(channel, true);
                return true;
             }
          }
        }
        else
        {
          //manual record
          StartRecordingSchedule(channel, true);
          return true;
        }
      }
      else
      {
        Schedule s = null;
        int idChannel = 0;
        if (hasProgram)
        {
          TVProgramInfo.IsRecordingProgram(prog, out s, false);
          if (s != null)
          {
            idChannel = s.ReferencedChannel().IdChannel;
          }
        }
        else
        {
          s = Schedule.Retrieve(card.RecordingScheduleId);
          idChannel = card.IdChannel;
        }

        if (s != null && idChannel > 0)
        {
          TVUtil.StopRecAndSchedWithPrompt(s, idChannel);
        }
      }
      return false;
    }
开发者ID:splatterpop,项目名称:MediaPortal-1,代码行数:96,代码来源:TVHome.cs

示例3: UpdateStateOfRecButton

    /// <summary>
    /// Update the state of the following buttons    
    /// - record now
    /// </summary>
    private void UpdateStateOfRecButton()
    {
      if (!Connected)
      {
        btnTvOnOff.Selected = false;
        return;
      }
      bool isTimeShifting = Card.IsTimeShifting;

      //are we recording a tv program?      
      if (Navigator.Channel != null && Card != null)
      {
        string label;
        TvServer server = new TvServer();
        VirtualCard vc;
        if (server.IsRecording(Navigator.Channel.IdChannel, out vc))
        {
          if (!isTimeShifting)
          {
            Card = vc;
          }
          //yes then disable the timeshifting on/off buttons
          //and change the Record Now button into Stop Record
          label = GUILocalizeStrings.Get(629); //stop record
        }
        else
        {
          //nop. then change the Record Now button
          //to Record Now
          label = GUILocalizeStrings.Get(601); // record
        }
        if (label != btnRecord.Label)
        {
          btnRecord.Label = label;
        }
      }
    }
开发者ID:splatterpop,项目名称:MediaPortal-1,代码行数:41,代码来源:TVHome.cs

示例4: SetRecorderStatus

    private void SetRecorderStatus(bool forced)
    {
      if (imgRecIcon != null)
      {
        TimeSpan ts = DateTime.Now - _RecIconLastCheck;
        if (ts.TotalSeconds > 15 || forced)
        {
          bool isRecording = false;
          VirtualCard card;
          TvServer server = new TvServer();

          if (GetChannel() != null)
          {
            if (server.IsRecording(GetChannel().IdChannel, out card))
            {
              if (g_Player.IsTVRecording)
              {
                Recording rec = TvRecorded.ActiveRecording();
                if (rec != null)
                {
                  isRecording = TvRecorded.IsLiveRecording();
                }
              }
              else
              {
                isRecording = true;
              }
            }
          }

          imgRecIcon.Visible = isRecording;
          _RecIconLastCheck = DateTime.Now;
          Log.Info("OSD.SetRecorderStatus = {0}", imgRecIcon.Visible);
        }
      }
    }
开发者ID:cmendozac,项目名称:MediaPortal-1,代码行数:36,代码来源:TvOSD.cs

示例5: OnMessage

    public override bool OnMessage(GUIMessage message)
    {
      _needToClearScreen = true;

      #region case GUI_MSG_RECORD

      if (message.Message == GUIMessage.MessageType.GUI_MSG_RECORD)
      {
        if (_isDialogVisible)
        {
          return false;
        }

        Channel channel = TVHome.Navigator.Channel;

        if (channel == null)
        {
          return true;
        }

        TvBusinessLayer layer = new TvBusinessLayer();

        Program prog = channel.CurrentProgram;
        VirtualCard card;
        TvServer server = new TvServer();
        if (server.IsRecording(channel.IdChannel, out card))
        {
          _dlgYesNo = (GUIDialogYesNo)GUIWindowManager.GetWindow((int)Window.WINDOW_DIALOG_YES_NO);
          _dlgYesNo.SetHeading(1449); // stop recording
          _dlgYesNo.SetLine(1, 1450); // are you sure to stop recording?
          if (prog != null)
          {
            _dlgYesNo.SetLine(2, prog.Title);
          }
          _dialogYesNoVisible = true;
          _dlgYesNo.DoModal(GetID);
          _dialogYesNoVisible = false;

          if (!_dlgYesNo.IsConfirmed)
          {
            return true;
          }

          Schedule s = Schedule.Retrieve(card.RecordingScheduleId);
          TVUtil.DeleteRecAndSchedQuietly(s, card.IdChannel);          

          GUIDialogNotify dlgNotify = (GUIDialogNotify)GUIWindowManager.GetWindow((int)Window.WINDOW_DIALOG_NOTIFY);
          if (dlgNotify == null)
          {
            return true;
          }
          string logo = Utils.GetCoverArt(Thumbs.TVChannel, channel.DisplayName);
          dlgNotify.Reset();
          dlgNotify.ClearAll();
          dlgNotify.SetImage(logo);
          dlgNotify.SetHeading(GUILocalizeStrings.Get(1447)); //recording stopped
          if (prog != null)
          {
            dlgNotify.SetText(String.Format("{0} {1}-{2}",
                                            prog.Title,
                                            prog.StartTime.ToString("t", CultureInfo.CurrentCulture.DateTimeFormat),
                                            prog.EndTime.ToString("t", CultureInfo.CurrentCulture.DateTimeFormat)));
          }
          else
          {
            dlgNotify.SetText(GUILocalizeStrings.Get(736)); //no tvguide data available
          }
          dlgNotify.TimeOut = 5;

          _notifyDialogVisible = true;
          dlgNotify.DoModal(GUIWindowManager.ActiveWindow);
          TvNotifyManager.ForceUpdate();
          _notifyDialogVisible = false;
          return true;
        }
        else
        {
          if (prog != null)
          {
            _dialogBottomMenu =
              (GUIDialogMenuBottomRight)GUIWindowManager.GetWindow((int)Window.WINDOW_DIALOG_MENU_BOTTOM_RIGHT);
            if (_dialogBottomMenu != null)
            {
              _dialogBottomMenu.Reset();
              _dialogBottomMenu.SetHeading(605); //my tv
              //_dialogBottomMenu.SetHeadingRow2(prog.Title);              

              _dialogBottomMenu.AddLocalizedString(875); //current program
              _dialogBottomMenu.AddLocalizedString(876); //till manual stop
              _bottomDialogMenuVisible = true;

              _dialogBottomMenu.DoModal(GetID);

              _bottomDialogMenuVisible = false;
              switch (_dialogBottomMenu.SelectedId)
              {
                case 875:
                  //record current program
                  _isStartingTSForRecording = !g_Player.IsTimeShifting;

//.........这里部分代码省略.........
开发者ID:npcomplete111,项目名称:MediaPortal-1,代码行数:101,代码来源:TvFullScreen.cs

示例6: UpdateGUI

    private void UpdateGUI()
    {
      // Set recorder status
      VirtualCard card;
      var server = new TvServer();
      if (server.IsRecording(TVHome.Navigator.Channel.IdChannel, out card))
      {
        ShowControl(GetID, (int)Control.REC_LOGO);
      }
      else
      {
        HideControl(GetID, (int)Control.REC_LOGO);
      }

      int speed = g_Player.Speed;
      HideControl(GetID, (int)Control.IMG_2X);
      HideControl(GetID, (int)Control.IMG_4X);
      HideControl(GetID, (int)Control.IMG_8X);
      HideControl(GetID, (int)Control.IMG_16X);
      HideControl(GetID, (int)Control.IMG_32X);
      HideControl(GetID, (int)Control.IMG_MIN2X);
      HideControl(GetID, (int)Control.IMG_MIN4X);
      HideControl(GetID, (int)Control.IMG_MIN8X);
      HideControl(GetID, (int)Control.IMG_MIN16X);
      HideControl(GetID, (int)Control.IMG_MIN32X);

      switch (speed)
      {
        case 2:
          ShowControl(GetID, (int)Control.IMG_2X);
          break;
        case 4:
          ShowControl(GetID, (int)Control.IMG_4X);
          break;
        case 8:
          ShowControl(GetID, (int)Control.IMG_8X);
          break;
        case 16:
          ShowControl(GetID, (int)Control.IMG_16X);
          break;
        case 32:
          ShowControl(GetID, (int)Control.IMG_32X);
          break;
        case -2:
          ShowControl(GetID, (int)Control.IMG_MIN2X);
          break;
        case -4:
          ShowControl(GetID, (int)Control.IMG_MIN4X);
          break;
        case -8:
          ShowControl(GetID, (int)Control.IMG_MIN8X);
          break;
        case -16:
          ShowControl(GetID, (int)Control.IMG_MIN16X);
          break;
        case -32:
          ShowControl(GetID, (int)Control.IMG_MIN32X);
          break;
      }

      HideControl(GetID, (int)Control.LABEL_ROW1);
      HideControl(GetID, (int)Control.LABEL_ROW2);
      HideControl(GetID, (int)Control.LABEL_ROW3);
      HideControl(GetID, (int)Control.BLUE_BAR);
      if (_screenState.SeekStep != 0)
      {
        ShowControl(GetID, (int)Control.BLUE_BAR);
        ShowControl(GetID, (int)Control.LABEL_ROW1);
      }
      if (_statusVisible)
      {
        ShowControl(GetID, (int)Control.BLUE_BAR);
        ShowControl(GetID, (int)Control.LABEL_ROW1);
      }
      if (_groupVisible)
      {
        ShowControl(GetID, (int)Control.BLUE_BAR);
        ShowControl(GetID, (int)Control.LABEL_ROW1);
      }
      //if (_channelInputVisible)
      //{
      //  ShowControl(GetID, (int)Control.LABEL_ROW1);
      //}
      HideControl(GetID, (int)Control.MSG_BOX);
      HideControl(GetID, (int)Control.MSG_BOX_LABEL1);
      HideControl(GetID, (int)Control.MSG_BOX_LABEL2);
      HideControl(GetID, (int)Control.MSG_BOX_LABEL3);
      HideControl(GetID, (int)Control.MSG_BOX_LABEL4);

      if (_messageBoxVisible)
      {
        ShowControl(GetID, (int)Control.MSG_BOX);
        ShowControl(GetID, (int)Control.MSG_BOX_LABEL1);
        ShowControl(GetID, (int)Control.MSG_BOX_LABEL2);
        ShowControl(GetID, (int)Control.MSG_BOX_LABEL3);
        ShowControl(GetID, (int)Control.MSG_BOX_LABEL4);
      }

      RenderVolume(_isVolumeVisible);
    }
开发者ID:npcomplete111,项目名称:MediaPortal-1,代码行数:100,代码来源:TvFullScreen.cs

示例7: ShowContextMenu

    private void ShowContextMenu()
    {
      if (dlg == null)
      {
        dlg = (GUIDialogMenu)GUIWindowManager.GetWindow((int)Window.WINDOW_DIALOG_MENU);
      }
      if (dlg == null)
      {
        return;
      }
      dlg.Reset();
      dlg.SetHeading(924); // menu

      if (!g_Player.IsTVRecording && GUIGraphicsContext.DBLClickAsRightClick)
      {
        dlg.AddLocalizedString(10104); // TV MiniEPG
      }

      //dlg.AddLocalizedString(915); // TV Channels
      if (!g_Player.IsTVRecording)
      {
        dlg.AddLocalizedString(4); // TV Guide}
      }

      TvBusinessLayer layer = new TvBusinessLayer();
      IList<ChannelLinkageMap> linkages = null;
      if (!g_Player.IsTVRecording)
      {
        linkages = layer.GetLinkagesForChannel(TVHome.Navigator.Channel);
        if (linkages != null)
        {
          if (linkages.Count > 0)
          {
            dlg.AddLocalizedString(200042); // Linked Channels
          }
        }
      }

    /*if (TVHome.Navigator.Groups.Count > 1)
        dlg.AddLocalizedString(971); // Group*/
      if (!g_Player.IsTVRecording && TVHome.Card.HasTeletext)
      {
        dlg.AddLocalizedString(1441); // Fullscreen teletext
      }
      dlg.AddLocalizedString(941); // Change aspect ratio

      // msn related can be removed
      //if (PluginManager.IsPluginNameEnabled("MSN Messenger"))
      //{
      //  dlg.AddLocalizedString(12902); // MSN Messenger
      //  dlg.AddLocalizedString(902); // MSN Online contacts
      //}

      //IAudioStream[] streams = TVHome.Card.AvailableAudioStreams;
      //if (streams != null && streams.Length > 0)
      if (g_Player.AudioStreams > 0)
      {
        dlg.AddLocalizedString(492); // Audio language menu
      }

      eAudioDualMonoMode dualMonoMode = g_Player.GetAudioDualMonoMode();
      if (dualMonoMode != eAudioDualMonoMode.UNSUPPORTED)
      {
        dlg.AddLocalizedString(200059); // Audio dual mono mode menu
      }

      // SubTitle stream, show only when there exists any streams,
      //    dialog shows then the streams and an item to disable them
      if (g_Player.SubtitleStreams > 0 || g_Player.SupportsCC)
      {
        dlg.AddLocalizedString(462);
      }

      // If the decoder supports postprocessing features (FFDShow)
      if (g_Player.HasPostprocessing)
      {
        dlg.AddLocalizedString(200073);
      }

      dlg.AddLocalizedString(11000); // Crop settings

      if (!g_Player.IsTVRecording)
      {
        dlg.AddLocalizedString(100748); // Program Information
      }

      if (!g_Player.IsTVRecording && Utils.FileExistsInCache(GUIGraphicsContext.Skin + @"\mytvtuningdetails.xml"))
      {
        dlg.AddLocalizedString(200041); // tuning details
      }

      TvServer server = new TvServer();
      if (!g_Player.IsTVRecording)
      {
        VirtualCard vc;
        if (server.IsRecording(TVHome.Navigator.Channel.IdChannel, out vc))
        {
          dlg.AddLocalizedString(265); //stop rec.
        }
        else
//.........这里部分代码省略.........
开发者ID:npcomplete111,项目名称:MediaPortal-1,代码行数:101,代码来源:TvFullScreen.cs

示例8: ShowPrograms

    private void ShowPrograms()
    {
      if (lblOnTvNow != null)
      {
        lblOnTvNow.EnableUpDown = false;
        lblOnTvNow.Clear();
      }
      if (lblOnTvNext != null)
      {
        lblOnTvNext.EnableUpDown = false;
        lblOnTvNext.Clear();
      }

      // Set recorder status
      if (imgRecIcon != null)
      {
        VirtualCard card;
        TvServer server = new TvServer();
        imgRecIcon.IsVisible = server.IsRecording(idChannel, out card);
      }
      
      if (lblZapToCannelNo != null)
      {
        lblZapToCannelNo.Label = channelNr;
        lblZapToCannelNo.Visible = !string.IsNullOrEmpty(channelNr);
      }
      if (LastError != null)
      {        
        lblStartTime.Label = "";
        lblEndTime.Label = "";
        if (LastError.FailingChannel != null)
        {
          lblCurrentChannel.Label = LastError.FailingChannel.DisplayName;
        }
        if (LastError.Messages.Count > 0)
        {
          lblOnTvNow.Label = LastError.Messages[0]; // first line in "NOW"
          if (LastError.Messages.Count > 1)
          {
            lblOnTvNext.Label = String.Join(", ", LastError.Messages.ToArray(), 1, LastError.Messages.Count - 1);
            // 2nd and later in "NEXT"
          }
        }
        m_lastError = null; // reset member only, not the failing channel info in Navigator
      }
      else
      {
        if (lblCurrentChannel != null)
        {
          lblCurrentChannel.Label = channelName;
        }
        Channel chan = TVHome.Navigator.GetChannel(idChannel, true);
        Program prog = chan.GetProgramAt(m_dateTime);
        if (prog != null)
        {
          string strTime = String.Format("{0}-{1}",
                                         prog.StartTime.ToString("t", CultureInfo.CurrentCulture.DateTimeFormat),
                                         prog.EndTime.ToString("t", CultureInfo.CurrentCulture.DateTimeFormat));

          if (lblCurrentTime != null)
          {
            lblCurrentTime.Label = strTime;
          }

          if (lblOnTvNow != null)
          {
            lblOnTvNow.Label = prog.Title;
          }
          if (lblStartTime != null)
          {
            strTime = String.Format("{0}", prog.StartTime.ToString("t", CultureInfo.CurrentCulture.DateTimeFormat));
            lblStartTime.Label = strTime;
          }
          if (lblEndTime != null)
          {
            strTime = String.Format("{0} ", prog.EndTime.ToString("t", CultureInfo.CurrentCulture.DateTimeFormat));
            lblEndTime.Label = strTime;
          }

          // next program
          prog = chan.GetProgramAt(prog.EndTime.AddMinutes(1));
          //prog = TVHome.Navigator.GetChannel(channelName).GetProgramAt(prog.EndTime.AddMinutes(1));
          if (prog != null)
          {
            if (lblOnTvNext != null)
            {
              lblOnTvNext.Label = prog.Title;
            }
          }
        }
        else
        {
          lblOnTvNow.Label = GUILocalizeStrings.Get(736); // no epg for this channel

          if (lblStartTime != null)
          {
            lblStartTime.Label = String.Empty;
          }
          if (lblEndTime != null)
          {
//.........这里部分代码省略.........
开发者ID:arangas,项目名称:MediaPortal-1,代码行数:101,代码来源:TVZapOSD.cs


注:本文中的TvControl.TvServer.IsRecording方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。