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


C++ MythProgramInfo::IsNull方法代码示例

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


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

示例1:

bool MythProgramInfo::operator ==(const MythProgramInfo &other)
{
    if (!this->IsNull() && !other.IsNull())
    {
        if (this->m_proginfo->channel.chanId == other.m_proginfo->channel.chanId &&
                this->m_proginfo->recording.startTs == other.m_proginfo->recording.startTs)
            return true;
    }
    return false;
}
开发者ID:jshattoc,项目名称:pvr.mythtv,代码行数:10,代码来源:MythProgramInfo.cpp

示例2: GetScheduledPrograms

ProgramInfoMap MythConnection::GetScheduledPrograms()
{
  Lock();

  ProgramInfoMap retval;
  cmyth_proglist_t proglist = NULL;
  CMYTH_CONN_CALL_REF(proglist, proglist == NULL, cmyth_proglist_get_all_scheduled(*m_conn_t));
  int len = cmyth_proglist_get_count(proglist);
  for (int i = 0; i < len; i++)
  {
    MythProgramInfo prog = cmyth_proglist_get_item(proglist, i);
    if (!prog.IsNull()) {
      retval.insert(std::pair<CStdString, MythProgramInfo>(prog.UID().c_str(), prog));
    }
  }
  ref_release(proglist);

  Unlock();

  return retval;
}
开发者ID:Alloyed,项目名称:xbmc-pvr-addons,代码行数:21,代码来源:MythConnection.cpp

示例3:

void MythEventHandler::MythEventHandlerPrivate::HandleAskRecording(const CStdString &databuf, MythProgramInfo &programInfo)
{
  // ASK_RECORDING <card id> <time until> <has rec> <has later>[]:[]<program info>
  // Example: ASK_RECORDING 9 29 0 1[]:[]<program>

  // The scheduled recording will hang in MythTV if ASK_RECORDING is just ignored.
  // - Stop recorder (and blocked for time until seconds)
  // - Skip the recording by sending CANCEL_NEXT_RECORDING(true)

  unsigned int cardid;
  int timeuntil, hasrec, haslater;
  if (sscanf(databuf.c_str(), "%d %d %d %d", &cardid, &timeuntil, &hasrec, &haslater) == 4)
    XBMC->Log(LOG_NOTICE, "%s: Event ASK_RECORDING: rec=%d timeuntil=%d hasrec=%d haslater=%d", __FUNCTION__, cardid, timeuntil, hasrec, haslater);
  else
    XBMC->Log(LOG_ERROR, "%s: Incorrect ASK_RECORDING event: rec=%d timeuntil=%d hasrec=%d haslater=%d", __FUNCTION__, cardid, timeuntil, hasrec, haslater);

  CStdString title;
  if (!programInfo.IsNull())
    title = programInfo.Title();
  XBMC->Log(LOG_NOTICE, "%s: Event ASK_RECORDING: title=%s", __FUNCTION__, title.c_str());

  if (timeuntil >= 0 && !m_recorder.IsNull() && m_recorder.ID() == cardid)
  {
    if (g_iLiveTVConflictStrategy == LIVETV_CONFLICT_STRATEGY_CANCELREC ||
      (g_iLiveTVConflictStrategy == LIVETV_CONFLICT_STRATEGY_HASLATER && haslater))
    {
      XBMC->QueueNotification(QUEUE_WARNING, XBMC->GetLocalizedString(30307), title.c_str()); // Canceling conflicting recording: %s
      m_recorder.CancelNextRecording(true);
    }
    else // LIVETV_CONFLICT_STRATEGY_STOPTV
    {
      XBMC->QueueNotification(QUEUE_WARNING, XBMC->GetLocalizedString(30308), title.c_str()); // Stopping Live TV due to conflicting recording: %s
      if (m_observer)
        m_observer->CloseLiveStream();
    }
  }
}
开发者ID:koz4,项目名称:xbmc-pvr-addons,代码行数:37,代码来源:MythEventHandler.cpp

示例4: if

void *MythEventHandler::MythEventHandlerPrivate::Process()
{
  const char *events[] = {
    "CMYTH_EVENT_UNKNOWN",
    "CMYTH_EVENT_CLOSE",
    "CMYTH_EVENT_RECORDING_LIST_CHANGE",
    "CMYTH_EVENT_RECORDING_LIST_CHANGE_ADD",
    "CMYTH_EVENT_RECORDING_LIST_CHANGE_UPDATE",
    "CMYTH_EVENT_RECORDING_LIST_CHANGE_DELETE",
    "CMYTH_EVENT_SCHEDULE_CHANGE",
    "CMYTH_EVENT_DONE_RECORDING",
    "CMYTH_EVENT_QUIT_LIVETV",
    "CMYTH_EVENT_LIVETV_WATCH",
    "CMYTH_EVENT_LIVETV_CHAIN_UPDATE",
    "CMYTH_EVENT_SIGNAL",
    "CMYTH_EVENT_ASK_RECORDING",
    "CMYTH_EVENT_SYSTEM_EVENT",
    "CMYTH_EVENT_UPDATE_FILE_SIZE",
    "CMYTH_EVENT_GENERATED_PIXMAP",
    "CMYTH_EVENT_CLEAR_SETTINGS_CACHE"
  };
  cmyth_event_t myth_event;
  char databuf[2049];
  databuf[0] = 0;
  bool triggerRecordingUpdate = false;
  unsigned int recordingChangeCount = 0;
  timeval timeout;
  timeout.tv_sec = 0;
  timeout.tv_usec = 100000;

  while (!IsStopped())
  {
    bool recordingChange = false;
    int select = 0;
    m_conn_t->Lock();
    select = cmyth_event_select(*m_conn_t, &timeout);
    m_conn_t->Unlock();

    if (select > 0)
    {
      cmyth_proginfo_t proginfo = NULL;
      m_conn_t->Lock();
      myth_event = cmyth_event_get_message(*m_conn_t, databuf, 2048, &proginfo);
      m_conn_t->Unlock();

      if (g_bExtraDebug)
        XBMC->Log(LOG_DEBUG, "%s - EVENT ID: %s, EVENT databuf: %s", __FUNCTION__, events[myth_event], databuf);

      if (myth_event == CMYTH_EVENT_UPDATE_FILE_SIZE)
      {
        if (g_bExtraDebug)
          XBMC->Log(LOG_NOTICE,"%s - Event file size update: %s", __FUNCTION__, databuf);
        HandleUpdateFileSize(databuf);
      }

      else if (myth_event == CMYTH_EVENT_LIVETV_CHAIN_UPDATE)
      {
        Lock();
        if (!m_recorder.IsNull())
        {
          bool retval = m_recorder.LiveTVChainUpdate(databuf);
          if (g_bExtraDebug)
            XBMC->Log(LOG_NOTICE, "%s - Event chain update: %s", __FUNCTION__, (retval ? "true" : "false"));
        }
        else
          if (g_bExtraDebug)
            XBMC->Log(LOG_NOTICE, "%s - Event chain update: No recorder", __FUNCTION__);
        Unlock();
      }

      else if (myth_event == CMYTH_EVENT_LIVETV_WATCH)
      {
        if (g_bExtraDebug)
          XBMC->Log(LOG_NOTICE,"%s: Event LIVETV_WATCH: recoder %s", __FUNCTION__, databuf);

        Lock();
        if (!m_recorder.IsNull())
        {
          bool retval = m_recorder.LiveTVWatch(databuf);
          if (g_bExtraDebug)
            XBMC->Log(LOG_NOTICE, "%s: Event LIVETV_WATCH: %s", __FUNCTION__, (retval) ? "true " : "false");
        }
        else
          if (g_bExtraDebug)
            XBMC->Log(LOG_NOTICE, "%s: Event LIVETV_WATCH: No recorder", __FUNCTION__);
        Unlock();
      }

      else if(myth_event == CMYTH_EVENT_DONE_RECORDING)
      {
        if (g_bExtraDebug)
          XBMC->Log(LOG_NOTICE, "%s: Event DONE_RECORDING: recorder %s", __FUNCTION__, databuf);

        Lock();
        if (!m_recorder.IsNull())
        {
          bool retval = m_recorder.LiveTVDoneRecording(databuf);
          if (g_bExtraDebug)
            XBMC->Log(LOG_NOTICE, "%s: Event DONE_RECORDING: %s", __FUNCTION__, (retval) ? "true" : "false");
        }
//.........这里部分代码省略.........
开发者ID:koz4,项目名称:xbmc-pvr-addons,代码行数:101,代码来源:MythEventHandler.cpp


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