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, QString textname, QString forwhat, QString joininfo="", ProgramInfo *pginfo=nullptr)
 Load a recording rule based on search parameters. More...
 
bool LoadTemplate (QString category, QString categoryType="Default")
 
bool ModifyPowerSearchByID (int rid, 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, QString table="record_tmp")
 
void ToMap (InfoMap &infoMap) const
 
AutoExpireType GetAutoExpire (void) const
 
bool IsValid (QString &text)
 

Static Public Member Functions

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

Public Attributes

int m_recordID
 
int m_parentRecID
 Unique Recording Rule ID. More...
 
bool m_isInactive
 
QString m_title
 Recording rule is enabled? More...
 
QString m_sortTitle
 
QString m_subtitle
 
QString m_sortSubtitle
 
QString m_description
 
uint m_season
 
uint m_episode
 
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
 
QString m_station
 
int m_findday
 callsign? More...
 
QTime m_findtime
 Day of the week for once per week etc. More...
 
int m_findid
 Time for timeslot rules. More...
 
RecordingType m_type
 
RecSearchType m_searchType
 
int m_recPriority
 
int m_prefInput
 
int m_startOffset
 
int m_endOffset
 
RecordingDupMethodType m_dupMethod
 
RecordingDupInType m_dupIn
 
unsigned m_filter
 
QString m_recProfile
 
uint m_recGroupID
 
QString m_storageGroup
 
QString m_playGroup
 
bool m_autoExpire
 
int m_maxEpisodes
 
bool m_maxNewest
 
bool m_autoCommFlag
 
bool m_autoTranscode
 
int m_transcoder
 
bool m_autoUserJob1
 
bool m_autoUserJob2
 
bool m_autoUserJob3
 
bool m_autoUserJob4
 
bool m_autoMetadataLookup
 
QDateTime m_nextRecording
 
QDateTime m_lastRecorded
 
QDateTime m_lastDeleted
 
int m_averageDelay
 
QString m_recordTable
 
int m_tempID
 
bool m_isOverride
 
bool m_isTemplate
 

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
 
bool m_loaded
 

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 31 of file recordingrule.h.

Constructor & Destructor Documentation

◆ RecordingRule()

RecordingRule::RecordingRule ( )

Definition at line 27 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 88 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,
QString  textname,
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 datadirect genre.
pginfoA pointer to an existing ProgramInfo structure.
Returns
True if search data was successfully loaded.

Definition at line 263 of file recordingrule.cpp.

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

◆ LoadTemplate()

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

◆ ModifyPowerSearchByID()

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

Definition at line 386 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,
QString  table = "record_tmp" 
)

Definition at line 714 of file recordingrule.cpp.

Referenced by ScheduleEditor::ShowPreview().

◆ GetDefaultFilter()

unsigned RecordingRule::GetDefaultFilter ( void  )
static

Definition at line 824 of file recordingrule.cpp.

Referenced by doUpgradeTVDatabaseSchema().

◆ ToMap()

void RecordingRule::ToMap ( InfoMap infoMap) const

Definition at line 588 of file recordingrule.cpp.

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

◆ GetAutoExpire()

AutoExpireType RecordingRule::GetAutoExpire ( void  ) const
inline

Definition at line 62 of file recordingrule.h.

Referenced by TVRec::TuningRestartRecorder().

◆ IsValid()

bool RecordingRule::IsValid ( QString &  text)

Definition at line 896 of file recordingrule.cpp.

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

◆ SearchTypeToString()

QString RecordingRule::SearchTypeToString ( const RecSearchType  searchType)
static

Definition at line 843 of file recordingrule.cpp.

Referenced by LoadBySearch(), and ToMap().

◆ GetTemplateNames()

QStringList RecordingRule::GetTemplateNames ( void  )
static

Definition at line 872 of file recordingrule.cpp.

Referenced by ScheduleEditor::showTemplateMenu().

◆ AssignProgramInfo()

void RecordingRule::AssignProgramInfo ( )
private

Definition at line 774 of file recordingrule.cpp.

Referenced by LoadByProgram(), and MakeOverride().

Member Data Documentation

◆ kNumFilters

const int RecordingRule::kNumFilters = 12
static

Definition at line 36 of file recordingrule.h.

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

◆ m_recordID

int RecordingRule::m_recordID

◆ m_parentRecID

int RecordingRule::m_parentRecID

Unique Recording Rule ID.

Definition at line 71 of file recordingrule.h.

Referenced by Dvr::AddRecordSchedule(), FillRecRuleInfo(), IsValid(), Load(), MakeOverride(), and Save().

◆ m_isInactive

bool RecordingRule::m_isInactive

◆ 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

◆ m_episode

uint RecordingRule::m_episode

◆ 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

◆ m_station

QString RecordingRule::m_station

◆ m_findday

int RecordingRule::m_findday

◆ m_findtime

QTime RecordingRule::m_findtime

Day of the week for once per week etc.

Definition at line 98 of file recordingrule.h.

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

◆ m_findid

int RecordingRule::m_findid

Time for timeslot rules.

Definition at line 99 of file recordingrule.h.

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

◆ m_type

RecordingType RecordingRule::m_type

◆ m_searchType

RecSearchType RecordingRule::m_searchType

◆ m_recPriority

int RecordingRule::m_recPriority

◆ m_prefInput

int RecordingRule::m_prefInput

◆ m_startOffset

int RecordingRule::m_startOffset

◆ m_endOffset

int RecordingRule::m_endOffset

◆ m_dupMethod

RecordingDupMethodType RecordingRule::m_dupMethod

◆ m_dupIn

RecordingDupInType RecordingRule::m_dupIn

◆ m_filter

unsigned RecordingRule::m_filter

◆ m_recProfile

QString RecordingRule::m_recProfile

◆ m_recGroupID

uint RecordingRule::m_recGroupID

◆ m_storageGroup

QString RecordingRule::m_storageGroup

◆ m_playGroup

QString RecordingRule::m_playGroup

◆ m_autoExpire

bool RecordingRule::m_autoExpire

◆ m_maxEpisodes

int RecordingRule::m_maxEpisodes

◆ m_maxNewest

bool RecordingRule::m_maxNewest

◆ m_autoCommFlag

bool RecordingRule::m_autoCommFlag

◆ m_autoTranscode

bool RecordingRule::m_autoTranscode

◆ m_transcoder

int RecordingRule::m_transcoder

◆ m_autoUserJob1

bool RecordingRule::m_autoUserJob1

◆ m_autoUserJob2

bool RecordingRule::m_autoUserJob2

◆ m_autoUserJob3

bool RecordingRule::m_autoUserJob3

◆ m_autoUserJob4

bool RecordingRule::m_autoUserJob4

◆ m_autoMetadataLookup

bool RecordingRule::m_autoMetadataLookup

◆ m_nextRecording

QDateTime RecordingRule::m_nextRecording

Definition at line 135 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 137 of file recordingrule.h.

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

◆ m_averageDelay

int RecordingRule::m_averageDelay

Definition at line 138 of file recordingrule.h.

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

◆ m_recordTable

QString RecordingRule::m_recordTable

Definition at line 141 of file recordingrule.h.

Referenced by Save(), and UseTempTable().

◆ m_tempID

int RecordingRule::m_tempID

Definition at line 142 of file recordingrule.h.

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

◆ m_isOverride

bool RecordingRule::m_isOverride

Definition at line 146 of file recordingrule.h.

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

◆ m_isTemplate

bool RecordingRule::m_isTemplate

◆ m_template

QString RecordingRule::m_template
private

Definition at line 157 of file recordingrule.h.

Referenced by Load(), and ToMap().

◆ m_progInfo

const ProgramInfo* RecordingRule::m_progInfo
private

Definition at line 161 of file recordingrule.h.

Referenced by AssignProgramInfo(), and LoadByProgram().

◆ m_loaded

bool RecordingRule::m_loaded
private

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