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


C++ MythProgramInfo类代码示例

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


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

示例1: lock

int PVRClientMythTV::GetCurrentClientChannel()
{
  if (g_bExtraDebug)
    XBMC->Log(LOG_DEBUG, "%s", __FUNCTION__);

  CLockObject lock(m_lock);

  if (m_rec.IsNull())
    return -1;

  MythProgramInfo currentProgram = m_rec.GetCurrentProgram();
  return currentProgram.ChannelID();
}
开发者ID:dteirney,项目名称:xbmc-pvr-addons,代码行数:13,代码来源:pvrclient-mythtv.cpp

示例2: IsRecordingVisible

bool PVRClientMythTV::IsRecordingVisible(MythProgramInfo &recording)
{
  // Filter out recordings of special storage groups (like LiveTV or Deleted)

  // When  deleting a recording, it might not be deleted immediately but marked as 'pending delete'.
  // Depending on the protocol version the recording is moved to the group Deleted or
  // the 'delete pending' flag is set
  if (recording.RecordingGroup() == "LiveTV" || recording.RecordingGroup() == "Deleted" || recording.IsDeletePending())
  {
    XBMC->Log(LOG_DEBUG, "%s: Ignoring recording %s", __FUNCTION__, recording.Path().c_str());
    return false;
  }

  return true;
}
开发者ID:dteirney,项目名称:xbmc-pvr-addons,代码行数:15,代码来源:pvrclient-mythtv.cpp

示例3:

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

示例4: Lock

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

示例5:

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

示例6: GetRecordingFrameRate

float PVRClientMythTV::GetRecordingFrameRate(MythProgramInfo &recording)
{
  // MythTV uses frame offsets whereas XBMC expects a time offset.
  // This function can be used to convert the frame offsets to time offsets and back.
  // The average frameRate is calculated by: frameRate = frameCount / duration.
  float frameRate = 0.0f;

  if (g_bExtraDebug)
  {
    XBMC->Log(LOG_DEBUG, "%s - Getting Framerate for: %s)", __FUNCTION__, recording.Title(false).c_str());
  }

  // cmyth_get_bookmark_mark returns the appropriate frame offset for the given byte offset (recordedseek table)
  // This can be used to determine the frame count (by querying the max byte offset)
  long long frameCount = m_db.GetBookmarkMark(recording, LLONG_MAX, 0);
  if (frameCount > 0)
  {
    if (g_bExtraDebug)
    {
      XBMC->Log(LOG_DEBUG, "%s - FrameCount: %lld)", __FUNCTION__, frameCount);
      XBMC->Log(LOG_DEBUG, "%s - Duration: %d)", __FUNCTION__, recording.Duration());
    }

    if (recording.Duration() > 0)
    {
      // Calculate frameRate
      frameRate = (float)frameCount / (float)recording.Duration();

      if (g_bExtraDebug)
      {
        XBMC->Log(LOG_DEBUG, "%s - FrameRate: %f)", __FUNCTION__, frameRate);
      }
    }
  }
  return frameRate;
}
开发者ID:dteirney,项目名称:xbmc-pvr-addons,代码行数:36,代码来源:pvrclient-mythtv.cpp

示例7: while


//.........这里部分代码省略.........
        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");
        }
        else
          if (g_bExtraDebug)
            XBMC->Log(LOG_NOTICE, "%s: Event DONE_RECORDING: No recorder", __FUNCTION__);
        Unlock();
      }

      else if (myth_event == CMYTH_EVENT_ASK_RECORDING)
      {
        MythProgramInfo prog(proginfo);
        HandleAskRecording(databuf, prog);
      }

      else if (myth_event == CMYTH_EVENT_SIGNAL)
      {
        HandleUpdateSignal(databuf);
      }

      if (myth_event == CMYTH_EVENT_SCHEDULE_CHANGE)
      {
        if (g_bExtraDebug)
          XBMC->Log(LOG_NOTICE, "%s - Event schedule change", __FUNCTION__);
        PVR->TriggerTimerUpdate();
      }

      else if (myth_event == CMYTH_EVENT_RECORDING_LIST_CHANGE_ADD)
      {
        //Event data: "4121 2010-03-06T01:06:43[]:[]empty"
        unsigned int chanid;
        char recstartts[20];
        if (strlen(databuf)>=24 && sscanf(databuf, "%u %19s", &chanid, recstartts) == 2) {
          Lock();
          m_recordingChangeEventList.push_back(RecordingChangeEvent(CHANGE_ADD, chanid, recstartts));
          Unlock();
          if (g_bExtraDebug)
            XBMC->Log(LOG_DEBUG,"%s - Event recording list add: CHANID=%u TS=%s", __FUNCTION__, chanid, recstartts);
          recordingChange = true;
        }
      }

      else if (myth_event == CMYTH_EVENT_RECORDING_LIST_CHANGE_UPDATE)
      {
开发者ID:koz4,项目名称:xbmc-pvr-addons,代码行数:67,代码来源:MythEventHandler.cpp

示例8: switch

bool MythScheduleHelper85::FillTimerEntryWithUpcoming(MythTimerEntry& entry, const MythProgramInfo& recording) const
{
  //Only include timers which have an inactive status if the user has requested it (flag m_showNotRecording)
  switch (recording.Status())
  {
    //Upcoming recordings which are disabled due to being lower priority duplicates or already recorded
    case Myth::RS_EARLIER_RECORDING:  //will record earlier
    case Myth::RS_LATER_SHOWING:      //will record later
    case Myth::RS_CURRENT_RECORDING:  //Already in the current library
    case Myth::RS_PREVIOUS_RECORDING: //Previoulsy recorded but no longer in the library
      if (!m_manager->ShowNotRecording())
      {
        XBMC->Log(LOG_DEBUG, "85::%s: Skipping %s:%s on %s because status %d", __FUNCTION__,
                  recording.Title().c_str(), recording.Subtitle().c_str(), recording.ChannelName().c_str(),
                  recording.Status());
        return false;
      }
    default:
      break;
  }

  MythRecordingRuleNodePtr node = m_manager->FindRuleById(recording.RecordID());
  if (node)
  {
    MythRecordingRule rule = node->GetRule();
    // Relate the main rule as parent
    entry.parentIndex = MythScheduleManager::MakeIndex(node->GetMainRule());
    switch (rule.Type())
    {
      case Myth::RT_SingleRecord:
        return false; // Discard upcoming. We show only main rule.
      case Myth::RT_DontRecord:
        entry.recordingStatus = recording.Status();
        entry.timerType = TIMER_TYPE_DONT_RECORD;
        entry.isInactive = rule.Inactive();
        break;
      case Myth::RT_OverrideRecord:
        entry.recordingStatus = recording.Status();
        entry.timerType = TIMER_TYPE_OVERRIDE;
        entry.isInactive = rule.Inactive();
        break;
      default:
        entry.recordingStatus = recording.Status();
        if (node->GetMainRule().SearchType() == Myth::ST_ManualSearch)
          entry.timerType = TIMER_TYPE_UPCOMING_MANUAL;
        else
          entry.timerType = TIMER_TYPE_UPCOMING;
    }
    entry.startOffset = rule.StartOffset();
    entry.endOffset = rule.EndOffset();
    entry.priority = rule.Priority();
    entry.expiration = GetRuleExpirationId(RuleExpiration(rule.AutoExpire(), 0, false));
  }
  else
    entry.timerType = TIMER_TYPE_ZOMBIE;

  switch (entry.timerType)
  {
    case TIMER_TYPE_UPCOMING:
    case TIMER_TYPE_OVERRIDE:
    case TIMER_TYPE_UPCOMING_MANUAL:
      entry.epgCheck = true;
      break;
    default:
      entry.epgCheck = false;
  }

  entry.description = "";
  entry.chanid = recording.ChannelID();
  entry.callsign = recording.Callsign();
  entry.startTime = recording.StartTime();
  entry.endTime = recording.EndTime();
  entry.title.assign(recording.Title());
  if (!recording.Subtitle().empty())
    entry.title.append(" (").append(recording.Subtitle()).append(")");
  if (recording.Season() || recording.Episode())
    entry.title.append(" - ").append(Myth::IntToString(recording.Season())).append(".").append(Myth::IntToString(recording.Episode()));
  entry.recordingGroup = GetRuleRecordingGroupId(recording.RecordingGroup());
  entry.entryIndex = MythScheduleManager::MakeIndex(recording); // upcoming index
  return true;
}
开发者ID:pingram3030,项目名称:pvr.mythtv,代码行数:81,代码来源:MythScheduleHelper85.cpp

示例9:

MythRecordingRule MythScheduleHelper75::MakeOverride(const MythRecordingRule& rule, const MythProgramInfo& recording)
{
  MythRecordingRule modifier = rule.DuplicateRecordingRule();
  // Do the same as backend even we know the modifier will be rejected for manual rule:
  // Don't know if this behavior is a bug issue or desired: cf libmythtv/recordingrule.cpp
  if (modifier.SearchType() != Myth::ST_ManualSearch)
    modifier.SetSearchType(Myth::ST_NoSearch);

  modifier.SetType(Myth::RT_OverrideRecord);
  modifier.SetParentID(modifier.RecordID());
  modifier.SetRecordID(0);
  modifier.SetInactive(false);
  // Assign recording info
  modifier.SetTitle(recording.Title());
  modifier.SetSubtitle(recording.Subtitle());
  modifier.SetDescription(recording.Description());
  modifier.SetChannelID(recording.ChannelID());
  modifier.SetCallsign(recording.Callsign());
  modifier.SetStartTime(recording.StartTime());
  modifier.SetEndTime(recording.EndTime());
  modifier.SetSeriesID(recording.SerieID());
  modifier.SetProgramID(recording.ProgramID());
  modifier.SetCategory(recording.Category());
  if (rule.InetRef().empty())
  {
    modifier.SetInerRef(recording.Inetref());
    modifier.SetSeason(recording.Season());
    modifier.SetEpisode(recording.Episode());
  }
  return modifier;
}
开发者ID:kabili207,项目名称:pvr.mythtv,代码行数:31,代码来源:MythScheduleHelper75.cpp


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