MythTV  master
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Private Member Functions | Private Attributes | List of all members
RecordingRule Class Reference

Internal representation of a recording rule, mirrors the record table. More...

#include <recordingrule.h>

Collaboration diagram for RecordingRule:
Collaboration graph

Public Member Functions

 RecordingRule ()
 ~RecordingRule ()=default
void ensureSortFields (void)
 Ensure that the sortTitle and sortSubtitle fields are set. More...
bool Load (bool asTemplate=false)
 Load a single rule from the recorded table. More...
bool LoadByProgram (const ProgramInfo *proginfo)
bool LoadBySearch (RecSearchType lsearch, const QString &textname, const QString &forwhat, QString joininfo="", ProgramInfo *pginfo=nullptr)
 Load a recording rule based on search parameters. More...
bool LoadTemplate (const QString &category, const QString &categoryType="Default")
bool ModifyPowerSearchByID (int rid, const QString &textname, QString forwhat, QString joininfo="")
bool MakeOverride (void)
bool MakeTemplate (QString category)
bool Save (bool sendSig=true)
bool Delete (bool sendSig=true)
bool IsLoaded () const
void UseTempTable (bool usetemp, const QString &table="record_tmp")
void ToMap (InfoMap &infoMap, uint date_format=0) const
AutoExpireType GetAutoExpire (void) const
bool IsValid (QString &msg) const

Static Public Member Functions

static unsigned GetDefaultFilter (void)
static QString SearchTypeToString (RecSearchType searchType)
static QStringList GetTemplateNames (void)

Public Attributes

int m_recordID {-1}
 Unique Recording Rule ID. More...
int m_parentRecID {0}
bool m_isInactive {false}
 Recording rule is enabled? More...
QString m_title
QString m_sortTitle
QString m_subtitle
QString m_sortSubtitle
QString m_description
QString m_category
QString m_seriesid
QString m_programid
QString m_inetref
QDate m_startdate
QDate m_enddate
QTime m_starttime
QTime m_endtime
uint m_season {0}
uint m_episode {0}
QString m_station
int m_channelid {0}
 callsign? More...
QTime m_findtime
 Time for timeslot rules. More...
int m_findid
int m_findday {0}
 Day of the week for once per week etc. More...
int m_recPriority {0}
int m_prefInput {0}
int m_startOffset {0}
int m_endOffset {0}
RecordingType m_type {kNotRecording}
RecSearchType m_searchType {kNoSearch}
RecordingDupMethodType m_dupMethod {kDupCheckSubThenDesc}
RecordingDupInType m_dupIn {kDupsInAll}
unsigned m_filter {0}
AutoExtendType m_autoExtend {AutoExtendType::None}
QString m_recProfile {tr("Default")}
QString m_storageGroup {tr("Default")}
QString m_playGroup {tr("Default")}
uint m_recGroupID {RecordingInfo::kDefaultRecGroup}
int m_maxEpisodes {0}
bool m_autoExpire {false}
bool m_maxNewest {false}
int m_transcoder
bool m_autoCommFlag {true}
bool m_autoTranscode {false}
bool m_autoUserJob1 {false}
bool m_autoUserJob2 {false}
bool m_autoUserJob3 {false}
bool m_autoUserJob4 {false}
bool m_autoMetadataLookup {true}
int m_averageDelay {100}
QDateTime m_nextRecording
QDateTime m_lastRecorded
QDateTime m_lastDeleted
QString m_recordTable {"record"}
int m_tempID {0}
bool m_isOverride {false}
bool m_isTemplate {false}

Static Public Attributes

static const int kNumFilters = 16

Private Member Functions

void AssignProgramInfo ()

Private Attributes

QString m_template
const ProgramInfom_progInfo {nullptr}
bool m_loaded {false}

Detailed Description

Internal representation of a recording rule, mirrors the record table.

Please keep clean and tidy, don't let this class become a dumping ground for single use utility functions, UI related stuff or anything which has a tenuous link to recording rules. See RecordingInfo or ProgramInfo instead.

Definition at line 32 of file recordingrule.h.

Constructor & Destructor Documentation

◆ RecordingRule()

RecordingRule::RecordingRule ( )

Definition at line 29 of file recordingrule.cpp.

◆ ~RecordingRule()

RecordingRule::~RecordingRule ( )

Member Function Documentation


RecordingRule::Q_DECLARE_TR_FUNCTIONS ( RecordingRule  )

◆ ensureSortFields()

void RecordingRule::ensureSortFields ( void  )

Ensure that the sortTitle and sortSubtitle fields are set.

Definition at line 45 of file recordingrule.cpp.

Referenced by AssignProgramInfo(), Load(), LoadByProgram(), LoadBySearch(), ModifyPowerSearchByID(), and RecordingRule().

◆ Load()

bool RecordingRule::Load ( bool  asTemplate = false)

◆ LoadByProgram()

bool RecordingRule::LoadByProgram ( const ProgramInfo proginfo)

◆ LoadBySearch()

bool RecordingRule::LoadBySearch ( RecSearchType  lsearch,
const QString &  textname,
const QString &  forwhat,
QString  joininfo = "",
ProgramInfo pginfo = nullptr 

Load a recording rule based on search parameters.

lsearchThe type of search.
textnameUnused. This is the raw text from a power search box, or the title from a custom search box.
forwhatSql describing the program search. I.E. Somthing like "program.title LIKE '%title%'".
joininfoSql used to join additional tables into the search. It is inserted into a query after the FROM clause and before the WHERE clause. For an example, see the text inserted when matching on a genre.
pginfoA pointer to an existing ProgramInfo structure.
True if search data was successfully loaded.

Definition at line 215 of file recordingrule.cpp.

◆ LoadTemplate()

bool RecordingRule::LoadTemplate ( const QString &  category,
const QString &  categoryType = "Default" 

◆ ModifyPowerSearchByID()

bool RecordingRule::ModifyPowerSearchByID ( int  rid,
const QString &  textname,
QString  forwhat,
QString  joininfo = "" 

Definition at line 341 of file recordingrule.cpp.

◆ MakeOverride()

bool RecordingRule::MakeOverride ( void  )

◆ MakeTemplate()

bool RecordingRule::MakeTemplate ( QString  category)

Definition at line 313 of file recordingrule.cpp.

Referenced by doUpgradeTVDatabaseSchema().

◆ Save()

bool RecordingRule::Save ( bool  sendSig = true)

◆ Delete()

bool RecordingRule::Delete ( bool  sendSig = true)

◆ IsLoaded()

bool RecordingRule::IsLoaded ( ) const

◆ UseTempTable()

void RecordingRule::UseTempTable ( bool  usetemp,
const QString &  table = "record_tmp" 

Definition at line 669 of file recordingrule.cpp.

Referenced by ScheduleEditor::ShowPreview().

◆ GetDefaultFilter()

unsigned RecordingRule::GetDefaultFilter ( void  )

Definition at line 779 of file recordingrule.cpp.

Referenced by doUpgradeTVDatabaseSchema().

◆ ToMap()

void RecordingRule::ToMap ( InfoMap infoMap,
uint  date_format = 0 
) const

Definition at line 546 of file recordingrule.cpp.

Referenced by ScheduleEditor::Load(), and SchedEditChild::SetTextFromMaps().

◆ GetAutoExpire()

AutoExpireType RecordingRule::GetAutoExpire ( void  ) const

Definition at line 63 of file recordingrule.h.

Referenced by TVRec::TuningRestartRecorder().

◆ IsValid()

bool RecordingRule::IsValid ( QString &  msg) const

◆ SearchTypeToString()

QString RecordingRule::SearchTypeToString ( RecSearchType  searchType)

Definition at line 798 of file recordingrule.cpp.

Referenced by LoadBySearch(), and ToMap().

◆ GetTemplateNames()

QStringList RecordingRule::GetTemplateNames ( void  )

Definition at line 827 of file recordingrule.cpp.

Referenced by ScheduleEditor::showTemplateMenu().

◆ AssignProgramInfo()

void RecordingRule::AssignProgramInfo ( )

Definition at line 729 of file recordingrule.cpp.

Referenced by LoadByProgram(), and MakeOverride().

Member Data Documentation

◆ kNumFilters

const int RecordingRule::kNumFilters = 16

Definition at line 37 of file recordingrule.h.

Referenced by GetDefaultFilter(), IsValid(), and Scheduler::UpdateMatches().

◆ m_recordID

int RecordingRule::m_recordID {-1}

◆ m_parentRecID

int RecordingRule::m_parentRecID {0}

◆ m_isInactive

bool RecordingRule::m_isInactive {false}

◆ m_title

QString RecordingRule::m_title

◆ m_sortTitle

QString RecordingRule::m_sortTitle

◆ m_subtitle

QString RecordingRule::m_subtitle

◆ m_sortSubtitle

QString RecordingRule::m_sortSubtitle

◆ m_description

QString RecordingRule::m_description

◆ m_category

QString RecordingRule::m_category

◆ m_seriesid

QString RecordingRule::m_seriesid

◆ m_programid

QString RecordingRule::m_programid

◆ m_inetref

QString RecordingRule::m_inetref

◆ m_startdate

QDate RecordingRule::m_startdate

◆ m_enddate

QDate RecordingRule::m_enddate

◆ m_starttime

QTime RecordingRule::m_starttime

◆ m_endtime

QTime RecordingRule::m_endtime

◆ m_season

uint RecordingRule::m_season {0}

◆ m_episode

uint RecordingRule::m_episode {0}

◆ m_station

QString RecordingRule::m_station

◆ m_channelid

int RecordingRule::m_channelid {0}

◆ m_findtime

QTime RecordingRule::m_findtime

◆ m_findid

int RecordingRule::m_findid

Definition at line 104 of file recordingrule.h.

Referenced by AssignProgramInfo(), Load(), LoadBySearch(), and Save().

◆ m_findday

int RecordingRule::m_findday {0}

◆ m_recPriority

int RecordingRule::m_recPriority {0}

◆ m_prefInput

int RecordingRule::m_prefInput {0}

◆ m_startOffset

int RecordingRule::m_startOffset {0}

◆ m_endOffset

int RecordingRule::m_endOffset {0}

◆ m_type

RecordingType RecordingRule::m_type {kNotRecording}

◆ m_searchType

RecSearchType RecordingRule::m_searchType {kNoSearch}

◆ m_dupMethod

RecordingDupMethodType RecordingRule::m_dupMethod {kDupCheckSubThenDesc}

◆ m_dupIn

RecordingDupInType RecordingRule::m_dupIn {kDupsInAll}

◆ m_filter

unsigned RecordingRule::m_filter {0}

◆ m_autoExtend

AutoExtendType RecordingRule::m_autoExtend {AutoExtendType::None}

◆ m_recProfile

QString RecordingRule::m_recProfile {tr("Default")}

◆ m_storageGroup

QString RecordingRule::m_storageGroup {tr("Default")}

◆ m_playGroup

QString RecordingRule::m_playGroup {tr("Default")}

◆ m_recGroupID

uint RecordingRule::m_recGroupID {RecordingInfo::kDefaultRecGroup}

◆ m_maxEpisodes

int RecordingRule::m_maxEpisodes {0}

◆ m_autoExpire

bool RecordingRule::m_autoExpire {false}

◆ m_maxNewest

bool RecordingRule::m_maxNewest {false}

◆ m_transcoder

int RecordingRule::m_transcoder

◆ m_autoCommFlag

bool RecordingRule::m_autoCommFlag {true}

◆ m_autoTranscode

bool RecordingRule::m_autoTranscode {false}

◆ m_autoUserJob1

bool RecordingRule::m_autoUserJob1 {false}

◆ m_autoUserJob2

bool RecordingRule::m_autoUserJob2 {false}

◆ m_autoUserJob3

bool RecordingRule::m_autoUserJob3 {false}

◆ m_autoUserJob4

bool RecordingRule::m_autoUserJob4 {false}

◆ m_autoMetadataLookup

bool RecordingRule::m_autoMetadataLookup {true}

◆ m_averageDelay

int RecordingRule::m_averageDelay {100}

Definition at line 143 of file recordingrule.h.

Referenced by FillRecRuleInfo(), Load(), Save(), and V2FillRecRuleInfo().

◆ m_nextRecording

QDateTime RecordingRule::m_nextRecording

Definition at line 144 of file recordingrule.h.

Referenced by FillRecRuleInfo(), Load(), Save(), ToMap(), and V2FillRecRuleInfo().

◆ m_lastRecorded

QDateTime RecordingRule::m_lastRecorded

◆ m_lastDeleted

QDateTime RecordingRule::m_lastDeleted

Definition at line 146 of file recordingrule.h.

Referenced by FillRecRuleInfo(), Load(), Save(), ToMap(), and V2FillRecRuleInfo().

◆ m_recordTable

QString RecordingRule::m_recordTable {"record"}

Definition at line 149 of file recordingrule.h.

Referenced by Save(), and UseTempTable().

◆ m_tempID

int RecordingRule::m_tempID {0}

Definition at line 150 of file recordingrule.h.

Referenced by Save(), ScheduleEditor::ShowPreview(), and UseTempTable().

◆ m_isOverride

bool RecordingRule::m_isOverride {false}

Definition at line 154 of file recordingrule.h.

Referenced by Load(), ScheduleEditor::Load(), and MakeOverride().

◆ m_isTemplate

bool RecordingRule::m_isTemplate {false}

◆ m_template

QString RecordingRule::m_template

Definition at line 165 of file recordingrule.h.

Referenced by Load(), and ToMap().

◆ m_progInfo

const ProgramInfo* RecordingRule::m_progInfo {nullptr}

Definition at line 169 of file recordingrule.h.

Referenced by AssignProgramInfo(), and LoadByProgram().

◆ m_loaded

bool RecordingRule::m_loaded {false}

The documentation for this class was generated from the following files: