void MythConnection::DefaultTimer(MythTimer &timer) { timer.SetAutoTranscode(atoi(GetSetting("NULL", "AutoTranscode").c_str()) > 0); timer.SetUserJob(1, atoi(GetSetting("NULL", "AutoRunUserJob1").c_str()) > 0); timer.SetUserJob(2, atoi(GetSetting("NULL", "AutoRunUserJob2").c_str()) > 0); timer.SetUserJob(3, atoi(GetSetting("NULL", "AutoRunUserJob3").c_str()) > 0); timer.SetUserJob(4, atoi(GetSetting("NULL", "AutoRunUserJob4").c_str()) > 0); timer.SetAutoCommFlag(atoi(GetSetting("NULL", "AutoCommercialFlag").c_str()) > 0); timer.SetAutoExpire(atoi(GetSetting("NULL", "AutoExpireDefault").c_str()) > 0); timer.SetTranscoder(atoi(GetSetting("NULL", "DefaultTranscoder").c_str())); timer.SetStartOffset(atoi(GetSetting("NULL", "DefaultStartOffset").c_str())); timer.SetStartOffset(atoi(GetSetting("NULL", "DefaultEndOffset").c_str())); }
void PVRClientMythTV::PVRtoMythTimer(const PVR_TIMER timer, MythTimer &mt) { CStdString category = m_categories.Category(timer.iGenreType); mt.SetCategory(category); mt.SetChannelID(timer.iClientChannelUid); mt.SetCallsign(m_channels.at(timer.iClientChannelUid).Callsign()); mt.SetDescription(timer.strSummary); mt.SetEndOffset(timer.iMarginEnd); mt.SetEndTime(timer.endTime); mt.SetInactive(timer.state == PVR_TIMER_STATE_ABORTED ||timer.state == PVR_TIMER_STATE_CANCELLED); mt.SetPriority(timer.iPriority); mt.SetStartOffset(timer.iMarginStart); mt.SetStartTime(timer.startTime); mt.SetTitle(timer.strTitle,true); CStdString title = mt.Title(false); mt.SetSearchType(m_db.FindProgram(timer.startTime, timer.iClientChannelUid, title, NULL) ? MythTimer::NoSearch : MythTimer::ManualSearch); mt.SetType(timer.bIsRepeating ? (timer.iWeekdays == 127 ? MythTimer::TimeslotRecord : MythTimer::WeekslotRecord) : MythTimer::SingleRecord); mt.SetRecordID(timer.iClientIndex); }
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 = m_categories.Category(timer.iGenreType); mt.SetCategory(category); mt.SetChannelID(timer.iClientChannelUid); mt.SetCallsign(m_channels.at(timer.iClientChannelUid).Callsign()); mt.SetDescription(timer.strSummary); mt.SetEndOffset(timer.iMarginEnd); mt.SetEndTime(timer.endTime); mt.SetInactive(timer.state == PVR_TIMER_STATE_ABORTED ||timer.state == PVR_TIMER_STATE_CANCELLED); mt.SetPriority(timer.iPriority); mt.SetStartOffset(timer.iMarginStart); mt.SetStartTime(timer.startTime); mt.SetTitle(timer.strTitle, true); CStdString title = mt.Title(false); mt.SetSearchType(m_db.FindProgram(timer.startTime, timer.iClientChannelUid, title, NULL) ? MythTimer::NoSearch : MythTimer::ManualSearch); mt.SetType(timer.bIsRepeating ? (timer.iWeekdays == 127 ? MythTimer::TimeslotRecord : MythTimer::WeekslotRecord) : MythTimer::SingleRecord); int id = m_db.AddTimer(mt); if (id<0) return PVR_ERROR_FAILED; if (!m_con.UpdateSchedules(id)) return PVR_ERROR_FAILED; if (g_bExtraDebug) XBMC->Log(LOG_DEBUG, "%s - Done - %i", __FUNCTION__, id); // Completion of the scheduling will be signaled by a SCHEDULE_CHANGE event. // Thus no need to call TriggerTimerUpdate(). return PVR_ERROR_NO_ERROR; }