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
[legend]

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) const
 
AutoExpireType GetAutoExpire (void) const
 
bool IsValid (QString &msg)
 

Static Public Member Functions

static unsigned GetDefaultFilter (void)
 
static QString SearchTypeToString (const 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
 
uint m_season {0}
 
uint m_episode {0}
 
QString m_category
 
QTime m_starttime
 
QDate m_startdate
 
QTime m_endtime
 
QDate m_enddate
 
QString m_seriesid
 
QString m_programid
 
QString m_inetref
 
int m_channelid {0}
 
QString m_station
 
int m_findday {0}
 callsign? More...
 
QTime m_findtime
 Time for timeslot rules. More...
 
int m_findid
 
RecordingType m_type {kNotRecording}
 
RecSearchType m_searchType {kNoSearch}
 
int m_recPriority {0}
 
int m_prefInput {0}
 
int m_startOffset {0}
 
int m_endOffset {0}
 
RecordingDupMethodType m_dupMethod {kDupCheckSubThenDesc}
 
RecordingDupInType m_dupIn {kDupsInAll}
 
unsigned m_filter {0}
 
QString m_recProfile {tr("Default")}
 
uint m_recGroupID {RecordingInfo::kDefaultRecGroup}
 
QString m_storageGroup {tr("Default")}
 
QString m_playGroup {tr("Default")}
 
bool m_autoExpire {false}
 
int m_maxEpisodes {0}
 
bool m_maxNewest {false}
 
bool m_autoCommFlag {true}
 
bool m_autoTranscode {false}
 
int m_transcoder
 
bool m_autoUserJob1 {false}
 
bool m_autoUserJob2 {false}
 
bool m_autoUserJob3 {false}
 
bool m_autoUserJob4 {false}
 
bool m_autoMetadataLookup {true}
 
QDateTime m_nextRecording
 
QDateTime m_lastRecorded
 
QDateTime m_lastDeleted
 
int m_averageDelay {100}
 
QString m_recordTable {"record"}
 
int m_tempID {0}
 
bool m_isOverride {false}
 
bool m_isTemplate {false}
 

Static Public Attributes

static const int kNumFilters = 12
 

Private Member Functions

 Q_DECLARE_TR_FUNCTIONS (RecordingRule)
 
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 ( )
default

Member Function Documentation

◆ Q_DECLARE_TR_FUNCTIONS()

RecordingRule::Q_DECLARE_TR_FUNCTIONS ( RecordingRule  )
private

◆ 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.

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.
Returns
True if search data was successfully loaded.

Definition at line 220 of file recordingrule.cpp.

Referenced by CustomEdit::recordClicked(), PhrasePopup::recordClicked(), and PowerSearchPopup::recordClicked().

◆ 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 343 of file recordingrule.cpp.

Referenced by CustomEdit::recordClicked().

◆ MakeOverride()

bool RecordingRule::MakeOverride ( void  )

◆ MakeTemplate()

bool RecordingRule::MakeTemplate ( QString  category)

◆ Save()

bool RecordingRule::Save ( bool  sendSig = true)

◆ Delete()

bool RecordingRule::Delete ( bool  sendSig = true)

◆ IsLoaded()

bool RecordingRule::IsLoaded ( ) const
inline

◆ UseTempTable()

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

Definition at line 671 of file recordingrule.cpp.

Referenced by ScheduleEditor::ShowPreview().

◆ GetDefaultFilter()

unsigned RecordingRule::GetDefaultFilter ( void  )
static

Definition at line 781 of file recordingrule.cpp.

Referenced by doUpgradeTVDatabaseSchema().

◆ ToMap()

void RecordingRule::ToMap ( InfoMap infoMap) const

Definition at line 545 of file recordingrule.cpp.

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

◆ GetAutoExpire()

AutoExpireType RecordingRule::GetAutoExpire ( void  ) const
inline

Definition at line 63 of file recordingrule.h.

Referenced by TVRec::TuningRestartRecorder().

◆ IsValid()

bool RecordingRule::IsValid ( QString &  msg)

Definition at line 853 of file recordingrule.cpp.

Referenced by Dvr::AddRecordSchedule(), and Dvr::UpdateRecordSchedule().

◆ SearchTypeToString()

QString RecordingRule::SearchTypeToString ( const RecSearchType  searchType)
static

Definition at line 800 of file recordingrule.cpp.

Referenced by LoadBySearch(), and ToMap().

◆ GetTemplateNames()

QStringList RecordingRule::GetTemplateNames ( void  )
static

Definition at line 829 of file recordingrule.cpp.

Referenced by ScheduleEditor::showTemplateMenu().

◆ AssignProgramInfo()

void RecordingRule::AssignProgramInfo ( )
private

Definition at line 731 of file recordingrule.cpp.

Referenced by LoadByProgram(), and MakeOverride().

Member Data Documentation

◆ kNumFilters

const int RecordingRule::kNumFilters = 12
static

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_season

uint RecordingRule::m_season {0}

◆ m_episode

uint RecordingRule::m_episode {0}

◆ m_category

QString RecordingRule::m_category

◆ m_starttime

QTime RecordingRule::m_starttime

◆ m_startdate

QDate RecordingRule::m_startdate

◆ m_endtime

QTime RecordingRule::m_endtime

◆ m_enddate

QDate RecordingRule::m_enddate

◆ m_seriesid

QString RecordingRule::m_seriesid

◆ m_programid

QString RecordingRule::m_programid

◆ m_inetref

QString RecordingRule::m_inetref

◆ m_channelid

int RecordingRule::m_channelid {0}

◆ m_station

QString RecordingRule::m_station

◆ m_findday

int RecordingRule::m_findday {0}

callsign?

Day of the week for once per week etc

Definition at line 102 of file recordingrule.h.

Referenced by Dvr::AddRecordSchedule(), AssignProgramInfo(), FillRecRuleInfo(), Load(), LoadBySearch(), Save(), ToMap(), and Dvr::UpdateRecordSchedule().

◆ m_findtime

QTime RecordingRule::m_findtime

◆ m_findid

int RecordingRule::m_findid

Definition at line 105 of file recordingrule.h.

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

◆ m_type

RecordingType RecordingRule::m_type {kNotRecording}

◆ m_searchType

RecSearchType RecordingRule::m_searchType {kNoSearch}

◆ 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_dupMethod

RecordingDupMethodType RecordingRule::m_dupMethod {kDupCheckSubThenDesc}

◆ m_dupIn

RecordingDupInType RecordingRule::m_dupIn {kDupsInAll}

◆ m_filter

unsigned RecordingRule::m_filter {0}

◆ m_recProfile

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

◆ m_recGroupID

uint RecordingRule::m_recGroupID {RecordingInfo::kDefaultRecGroup}

◆ m_storageGroup

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

◆ m_playGroup

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

◆ m_autoExpire

bool RecordingRule::m_autoExpire {false}

◆ m_maxEpisodes

int RecordingRule::m_maxEpisodes {0}

◆ m_maxNewest

bool RecordingRule::m_maxNewest {false}

◆ m_autoCommFlag

bool RecordingRule::m_autoCommFlag {true}

◆ m_autoTranscode

bool RecordingRule::m_autoTranscode {false}

◆ m_transcoder

int RecordingRule::m_transcoder

◆ 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_nextRecording

QDateTime RecordingRule::m_nextRecording

Definition at line 141 of file recordingrule.h.

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

◆ m_lastRecorded

QDateTime RecordingRule::m_lastRecorded

◆ m_lastDeleted

QDateTime RecordingRule::m_lastDeleted

Definition at line 143 of file recordingrule.h.

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

◆ m_averageDelay

int RecordingRule::m_averageDelay {100}

Definition at line 144 of file recordingrule.h.

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

◆ m_recordTable

QString RecordingRule::m_recordTable {"record"}

Definition at line 147 of file recordingrule.h.

Referenced by Save(), and UseTempTable().

◆ m_tempID

int RecordingRule::m_tempID {0}

Definition at line 148 of file recordingrule.h.

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

◆ m_isOverride

bool RecordingRule::m_isOverride {false}

Definition at line 152 of file recordingrule.h.

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

◆ m_isTemplate

bool RecordingRule::m_isTemplate {false}

◆ m_template

QString RecordingRule::m_template
private

Definition at line 163 of file recordingrule.h.

Referenced by Load(), and ToMap().

◆ m_progInfo

const ProgramInfo* RecordingRule::m_progInfo {nullptr}
private

Definition at line 167 of file recordingrule.h.

Referenced by AssignProgramInfo(), and LoadByProgram().

◆ m_loaded

bool RecordingRule::m_loaded {false}
private

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