Exemple #1
0
PVR_ERROR PVRClientMythTV::AddTimer(const PVR_TIMER &timer)
{
  if(g_bExtraDebug)
    XBMC->Log(LOG_DEBUG,"%s - title: %s, start: %i, end: %i, chanID: %i",__FUNCTION__,timer.strTitle,timer.startTime,timer.iClientChannelUid);
  MythTimer mt;
  m_con.DefaultTimer(mt);
  CStdString category=Genre(timer.iGenreType);
  mt.Category(category);
  mt.ChanID(timer.iClientChannelUid);
  mt.Callsign(m_channels.at(timer.iClientChannelUid).Callsign());
  mt.Description(timer.strSummary);
  mt.EndOffset(timer.iMarginEnd);
  mt.EndTime(timer.endTime);
  mt.Inactive(timer.state == PVR_TIMER_STATE_ABORTED ||timer.state ==  PVR_TIMER_STATE_CANCELLED);
  mt.Priority(timer.iPriority);
  mt.StartOffset(timer.iMarginStart);
  mt.StartTime(timer.startTime);
  mt.Title(timer.strTitle,true);
  CStdString title=mt.Title(false);
  mt.SearchType(m_db.FindProgram(timer.startTime,timer.iClientChannelUid,title,NULL)?MythTimer::NoSearch:MythTimer::ManualSearch);
  mt.Type(timer.bIsRepeating? (timer.iWeekdays==127? MythTimer::TimeslotRecord : MythTimer::WeekslotRecord) : MythTimer::SingleRecord);
  int id=m_db.AddTimer(mt);
  if(id<0)
    return PVR_ERROR_NOT_POSSIBLE;
  if(!m_con.UpdateSchedules(id))
    return PVR_ERROR_NOT_POSSIBLE;
  if(g_bExtraDebug)
    XBMC->Log(LOG_DEBUG,"%s - Done - %i",__FUNCTION__,id);
  //PVR->TriggerTimerUpdate();
  return PVR_ERROR_NO_ERROR;
}
Exemple #2
0
void PVRClientMythTV::PVRtoMythTimer(const PVR_TIMER timer, MythTimer& mt)
{
  CStdString category=Genre(timer.iGenreType);
  mt.Category(category);
  mt.ChanID(timer.iClientChannelUid);
  mt.Callsign(m_channels.at(timer.iClientChannelUid).Callsign());
  mt.Description(timer.strSummary);
  mt.EndOffset(timer.iMarginEnd);
  mt.EndTime(timer.endTime);
  mt.Inactive(timer.state == PVR_TIMER_STATE_ABORTED ||timer.state ==  PVR_TIMER_STATE_CANCELLED);
  mt.Priority(timer.iPriority);
  mt.StartOffset(timer.iMarginStart);
  mt.StartTime(timer.startTime);
  mt.Title(timer.strTitle,true);
  CStdString title=mt.Title(false);
  mt.SearchType(m_db.FindProgram(timer.startTime,timer.iClientChannelUid,title,NULL)?MythTimer::NoSearch:MythTimer::ManualSearch);
  mt.Type(timer.bIsRepeating? (timer.iWeekdays==127? MythTimer::TimeslotRecord : MythTimer::WeekslotRecord) : MythTimer::SingleRecord);
  mt.RecordID(timer.iClientIndex);
}