/* * cmyth_recordingrule_init() * * Scope: PUBLIC * * Description * * Initialize a new recording schedule structure. The structure is initialized * to default values. * Before forgetting the reference to this recording schedule structure * the caller must call ref_release(). * * Return Value: * * Success: A non-NULL cmyth_recordingrule_t (this type is a pointer) * * Failure: NULL */ cmyth_recordingrule_t cmyth_recordingrule_init(void) { cmyth_recordingrule_t rr = cmyth_recordingrule_create(); if (!rr) { cmyth_dbg(CMYTH_DBG_ERROR,"%s: cmyth_recordingrule_create failed\n", __FUNCTION__); return NULL; } cmyth_recordingrule_set_recordid(rr, 0); cmyth_recordingrule_set_chanid(rr, 0); cmyth_recordingrule_set_callsign(rr, ""); cmyth_recordingrule_set_starttime(rr, 0); cmyth_recordingrule_set_endtime(rr, 0); cmyth_recordingrule_set_title(rr, ""); cmyth_recordingrule_set_description(rr, ""); cmyth_recordingrule_set_type(rr, RRULE_NOT_RECORDING); cmyth_recordingrule_set_category(rr, ""); cmyth_recordingrule_set_subtitle(rr, ""); cmyth_recordingrule_set_recpriority(rr, 0); cmyth_recordingrule_set_startoffset(rr, 0); cmyth_recordingrule_set_endoffset(rr, 0); cmyth_recordingrule_set_searchtype(rr, RRULE_NO_SEARCH); cmyth_recordingrule_set_inactive(rr, 0); cmyth_recordingrule_set_dupmethod(rr, RRULE_CHECK_NONE); cmyth_recordingrule_set_dupin(rr, RRULE_IN_RECORDED); cmyth_recordingrule_set_recgroup(rr, "Default"); cmyth_recordingrule_set_storagegroup(rr, "Default"); cmyth_recordingrule_set_playgroup(rr, "Default"); cmyth_recordingrule_set_autotranscode(rr, 0); cmyth_recordingrule_set_userjobs(rr, 0); cmyth_recordingrule_set_autocommflag(rr, 0); cmyth_recordingrule_set_autoexpire(rr, 0); cmyth_recordingrule_set_maxepisodes(rr, 0); cmyth_recordingrule_set_maxnewest(rr, 0); cmyth_recordingrule_set_transcoder(rr, 0); cmyth_recordingrule_set_parentid(rr, 0); cmyth_recordingrule_set_profile(rr, "Default"); cmyth_recordingrule_set_prefinput(rr, 0); cmyth_recordingrule_set_programid(rr, ""); cmyth_recordingrule_set_seriesid(rr, ""); cmyth_recordingrule_set_autometadata(rr, 0); cmyth_recordingrule_set_inetref(rr, ""); cmyth_recordingrule_set_season(rr, 0); cmyth_recordingrule_set_episode(rr, 0); cmyth_recordingrule_set_filter(rr, 0); return rr; }
/* * cmyth_recordingrule_dup() * * Scope: PUBLIC * * Description * * Duplicate a recording rule. * Before forgetting the reference to this recording schedule structure * the caller must call ref_release(). * * Return Value: * * Success: A non-NULL cmyth_recordingrule_t (this type is a pointer) * * Failure: NULL */ cmyth_recordingrule_t cmyth_recordingrule_dup(cmyth_recordingrule_t rule) { cmyth_recordingrule_t rr = cmyth_recordingrule_create(); if (!rr) { cmyth_dbg(CMYTH_DBG_ERROR, "%s: cmyth_recordingrule_create failed\n", __FUNCTION__); return NULL; } cmyth_recordingrule_set_recordid(rr, rule->recordid); cmyth_recordingrule_set_chanid(rr, rule->chanid); cmyth_recordingrule_set_callsign(rr, rule->callsign); cmyth_recordingrule_set_starttime(rr, cmyth_timestamp_to_unixtime(rule->starttime)); cmyth_recordingrule_set_endtime(rr, cmyth_timestamp_to_unixtime(rule->endtime)); cmyth_recordingrule_set_title(rr, rule->title); cmyth_recordingrule_set_description(rr, rule->description); cmyth_recordingrule_set_type(rr, rule->type); cmyth_recordingrule_set_category(rr, rule->category); cmyth_recordingrule_set_subtitle(rr, rule->subtitle); cmyth_recordingrule_set_recpriority(rr, rule->recpriority); cmyth_recordingrule_set_startoffset(rr, rule->startoffset); cmyth_recordingrule_set_endoffset(rr, rule->endoffset); cmyth_recordingrule_set_searchtype(rr, rule->searchtype); cmyth_recordingrule_set_inactive(rr, rule->inactive); cmyth_recordingrule_set_dupmethod(rr, rule->dupmethod); cmyth_recordingrule_set_dupin(rr, rule->dupin); cmyth_recordingrule_set_recgroup(rr, rule->recgroup); cmyth_recordingrule_set_storagegroup(rr, rule->storagegroup); cmyth_recordingrule_set_playgroup(rr, rule->playgroup); cmyth_recordingrule_set_autotranscode(rr, rule->autotranscode); cmyth_recordingrule_set_userjobs(rr, rule->userjobs); cmyth_recordingrule_set_autocommflag(rr, rule->autocommflag); cmyth_recordingrule_set_autoexpire(rr, rule->autoexpire); cmyth_recordingrule_set_maxepisodes(rr, rule->maxepisodes); cmyth_recordingrule_set_maxnewest(rr, rule->maxnewest); cmyth_recordingrule_set_transcoder(rr, rule->transcoder); cmyth_recordingrule_set_parentid(rr, rule->parentid); cmyth_recordingrule_set_profile(rr, rule->profile); cmyth_recordingrule_set_prefinput(rr, rule->prefinput); cmyth_recordingrule_set_programid(rr, rule->programid); cmyth_recordingrule_set_seriesid(rr, rule->seriesid); cmyth_recordingrule_set_autometadata(rr, rule->autometadata); cmyth_recordingrule_set_inetref(rr, rule->inetref); cmyth_recordingrule_set_season(rr, rule->season); cmyth_recordingrule_set_episode(rr, rule->episode); cmyth_recordingrule_set_filter(rr, rule->filter); return rr; }
void MythRecordingRule::SetSearchType(MythRecordingRule::RuleSearchType searchtype) { cmyth_recordingrule_set_searchtype(*m_recordingrule_t, searchtype); }