MythTV  0.25-pre
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Protected Member Functions | Static Protected Attributes | Private Attributes
RecordingInfo Class Reference

Holds information on a TV Program one might wish to record. More...

#include <recordinginfo.h>

Inheritance diagram for RecordingInfo:
ProgramInfo ProgramRecPriorityInfo

List of all members.

Public Types

enum  LoadStatus { kNoProgram = 0, kFoundProgram = 1, kFakedLiveTVProgram = 2, kFakedZeroMinProgram = 3 }

Public Member Functions

 RecordingInfo (void)
 RecordingInfo (const RecordingInfo &other)
 RecordingInfo (const ProgramInfo &other)
 RecordingInfo (uint _chanid, const QDateTime &_recstartts)
 RecordingInfo (QStringList::const_iterator &it, QStringList::const_iterator end)
 RecordingInfo (const QString &title, const QString &subtitle, const QString &description, uint season, uint episode, const QString &category, uint chanid, const QString &chanstr, const QString &chansign, const QString &channame, const QString &recgroup, const QString &playgroup, const QString &hostname, const QString &storagegroup, uint year, const QString &seriesid, const QString &programid, const QString &inetref, const QString &catType, int recpriority, const QDateTime &startts, const QDateTime &endts, const QDateTime &recstartts, const QDateTime &recendts, float stars, const QDate &originalAirDate, bool repeat, RecStatusType oldrecstatus, bool reactivate, uint recordid, uint parentid, RecordingType rectype, RecordingDupInType dupin, RecordingDupMethodType dupmethod, uint sourceid, uint inputid, uint cardid, uint findid, bool commfree, uint subtitleType, uint videoproperties, uint audioproperties, bool future)
 Create RecordingInfo from 'program'+'record'+'channel' tables, used in scheduler.cpp @ ~ 3296.
 RecordingInfo (const QString &title, const QString &subtitle, const QString &description, uint season, uint episode, const QString &category, uint chanid, const QString &chanstr, const QString &chansign, const QString &channame, const QString &recgroup, const QString &playgroup, const QString &seriesid, const QString &programid, const QString &inetref, int recpriority, const QDateTime &startts, const QDateTime &endts, const QDateTime &recstartts, const QDateTime &recendts, RecStatusType recstatus, uint recordid, RecordingType rectype, RecordingDupInType dupin, RecordingDupMethodType dupmethod, uint findid, bool commfree)
 Create RecordingInfo from 'record'+'channel' tables, user in scheduler.cpp @ ~ 3566 & ~ 3643.
 RecordingInfo (uint _chanid, const QDateTime &desiredts, bool genUnknown, uint maxHours=0, LoadStatus *status=NULL)
 Fills RecordingInfo for the program that airs at "desiredts" on "chanid".
RecordingInfooperator= (const RecordingInfo &other)
RecordingInfooperator= (const ProgramInfo &other)
 Copies important fields from other ProgramInfo.
virtual void clone (const RecordingInfo &other, bool ignore_non_serialized_data=false)
 Copies important fields from other RecordingInfo.
virtual void clone (const ProgramInfo &other, bool ignore_non_serialized_data=false)
 Copies important fields from ProgramInfo.
virtual void clear (void)
virtual ~RecordingInfo ()
 Destructor deletes "record" if it exists.
virtual void SubstituteMatches (QString &str)
 Replace MATCH% vars in the specified string.
QString MakeUniqueSchedulerKey (void) const
 Creates a unique string that can be used to identify a scheduled recording.
RecordingRuleGetRecordingRule (void)
 Returns the "record" field, creating it if necessary.
int getRecordID (void)
 Returns a record id, creating "record" it if necessary.
int GetAutoRunJobs (void) const
 Returns a bitmap of which jobs are attached to this RecordingInfo.
RecordingType GetProgramRecordingStatus (void)
 Returns the recording type for this RecordingInfo, creating "record" field if necessary.
QString GetProgramRecordingProfile (void) const
 Returns recording profile name that will be, or was used, for this program, creating "record" field if necessary.
void ApplyRecordStateChange (RecordingType newstate, bool save=true)
 Sets RecordingType of "record", creating "record" if it does not exist.
void ApplyRecordRecPriorityChange (int)
 Sets recording priority of "record", creating "record" if it does not exist.
void ToggleRecord (void)
 Cycles through recording types.
void AddHistory (bool resched=true, bool forcedup=false, bool future=false)
 Adds recording history, creating "record" it if necessary.
void DeleteHistory (void)
 Deletes recording history, creating "record" it if necessary.
void ForgetHistory (void)
 Forget the recording of a program so it will be recorded again.
void SetDupHistory (void)
 Set the duplicate flag in oldrecorded.
void StartedRecording (QString ext)
 Inserts this RecordingInfo into the database as an existing recording.
void FinishedRecording (bool allowReRecord)
 If not a premature stop, adds program to history of recorded programs.
void UpdateRecordingEnd (void)
 Update information in the recorded table when the end-time of a recording is changed.
void ReactivateRecording (void)
 Asks the scheduler to restart this recording if possible.
void ApplyRecordRecID (void)
 Sets recordid to match RecordingRule recordid.
void ApplyRecordRecGroupChange (const QString &newrecgroup)
 Sets the recording group, both in this RecordingInfo and in the database.
void ApplyRecordPlayGroupChange (const QString &newrecgroup)
 Sets the recording group, both in this RecordingInfo and in the database.
void ApplyStorageGroupChange (const QString &newstoragegroup)
 Sets the storage group, both in this RecordingInfo and in the database.
void ApplyRecordRecTitleChange (const QString &newTitle, const QString &newSubtitle, const QString &newDescription)
 Sets the recording title, subtitle, and description both in this RecordingInfo and in the database.
void ApplyTranscoderProfileChange (const QString &profile) const
 Sets the transcoder profile for a recording.
void ApplyTranscoderProfileChangeById (int)

Static Public Member Functions

static void signalChange (int recordid)

Public Attributes

RecStatusType oldrecstatus
RecStatusType savedrecstatus
bool future

Static Protected Member Functions

static bool InsertProgram (const RecordingInfo *pg, const RecordingRule *rule)

Static Protected Attributes

static QString unknownTitle

Private Attributes

class RecordingRulerecord

Detailed Description

Holds information on a TV Program one might wish to record.

This class exxtends ProgramInfo with additional information about scheduled recordings and contains helper methods to aid in the scheduling of recordings.

Definition at line 29 of file recordinginfo.h.


Member Enumeration Documentation

Enumerator:
kNoProgram 
kFoundProgram 
kFakedLiveTVProgram 
kFakedZeroMinProgram 

Definition at line 165 of file recordinginfo.h.


Constructor & Destructor Documentation

Definition at line 32 of file recordinginfo.h.

RecordingInfo::RecordingInfo ( const RecordingInfo other) [inline]

Definition at line 37 of file recordinginfo.h.

RecordingInfo::RecordingInfo ( const ProgramInfo other) [inline]

Definition at line 43 of file recordinginfo.h.

RecordingInfo::RecordingInfo ( uint  _chanid,
const QDateTime &  _recstartts 
) [inline]

Definition at line 49 of file recordinginfo.h.

RecordingInfo::RecordingInfo ( QStringList::const_iterator &  it,
QStringList::const_iterator  end 
) [inline]

Definition at line 55 of file recordinginfo.h.

RecordingInfo::RecordingInfo ( const QString &  title,
const QString &  subtitle,
const QString &  description,
uint  season,
uint  episode,
const QString &  category,
uint  chanid,
const QString &  chanstr,
const QString &  chansign,
const QString &  channame,
const QString &  recgroup,
const QString &  playgroup,
const QString &  hostname,
const QString &  storagegroup,
uint  year,
const QString &  seriesid,
const QString &  programid,
const QString &  inetref,
const QString &  catType,
int  recpriority,
const QDateTime &  startts,
const QDateTime &  endts,
const QDateTime &  recstartts,
const QDateTime &  recendts,
float  stars,
const QDate &  originalAirDate,
bool  repeat,
RecStatusType  oldrecstatus,
bool  reactivate,
uint  recordid,
uint  parentid,
RecordingType  rectype,
RecordingDupInType  dupin,
RecordingDupMethodType  dupmethod,
uint  sourceid,
uint  inputid,
uint  cardid,
uint  findid,
bool  commfree,
uint  subtitleType,
uint  videoproperties,
uint  audioproperties,
bool  future 
)

Create RecordingInfo from 'program'+'record'+'channel' tables, used in scheduler.cpp @ ~ 3296.

Definition at line 45 of file recordinginfo.cpp.

RecordingInfo::RecordingInfo ( const QString &  title,
const QString &  subtitle,
const QString &  description,
uint  season,
uint  episode,
const QString &  category,
uint  chanid,
const QString &  chanstr,
const QString &  chansign,
const QString &  channame,
const QString &  recgroup,
const QString &  playgroup,
const QString &  seriesid,
const QString &  programid,
const QString &  inetref,
int  recpriority,
const QDateTime &  startts,
const QDateTime &  endts,
const QDateTime &  recstartts,
const QDateTime &  recendts,
RecStatusType  recstatus,
uint  recordid,
RecordingType  rectype,
RecordingDupInType  dupin,
RecordingDupMethodType  dupmethod,
uint  findid,
bool  commfree 
)

Create RecordingInfo from 'record'+'channel' tables, user in scheduler.cpp @ ~ 3566 & ~ 3643.

Definition at line 159 of file recordinginfo.cpp.

RecordingInfo::RecordingInfo ( uint  _chanid,
const QDateTime &  desiredts,
bool  genUnknown,
uint  maxHours = 0,
LoadStatus status = NULL 
)

Fills RecordingInfo for the program that airs at "desiredts" on "chanid".

Parameters:
chanidChannel ID on which to search for program.
desiredtsDate and Time for which we desire the program.
genUnknownGenerate a full entry for live-tv if unknown
maxHoursClamp the maximum time to X hours from dtime.
Returns:
LoadStatus describing what happened.

Definition at line 230 of file recordinginfo.cpp.

Destructor deletes "record" if it exists.

Definition at line 421 of file recordinginfo.cpp.


Member Function Documentation

RecordingInfo& RecordingInfo::operator= ( const RecordingInfo other) [inline]

Reimplemented in ProgramRecPriorityInfo.

Definition at line 176 of file recordinginfo.h.

RecordingInfo& RecordingInfo::operator= ( const ProgramInfo other) [inline]

Copies important fields from other ProgramInfo.

Reimplemented from ProgramInfo.

Reimplemented in ProgramRecPriorityInfo.

Definition at line 178 of file recordinginfo.h.

void RecordingInfo::clone ( const RecordingInfo other,
bool  ignore_non_serialized_data = false 
) [virtual]

Copies important fields from other RecordingInfo.

Definition at line 357 of file recordinginfo.cpp.

Referenced by clone().

void RecordingInfo::clone ( const ProgramInfo other,
bool  ignore_non_serialized_data = false 
) [virtual]

Copies important fields from ProgramInfo.

Reimplemented from ProgramInfo.

Definition at line 383 of file recordinginfo.cpp.

void RecordingInfo::clear ( void  ) [virtual]

Reimplemented from ProgramInfo.

Reimplemented in ProgramRecPriorityInfo.

Definition at line 405 of file recordinginfo.cpp.

void RecordingInfo::SubstituteMatches ( QString &  str) [virtual]

Replace MATCH% vars in the specified string.

Parameters:
strQString containing matches to be substituted

Reimplemented from ProgramInfo.

Definition at line 1357 of file recordinginfo.cpp.

QString RecordingInfo::MakeUniqueSchedulerKey ( void  ) const [inline]

Creates a unique string that can be used to identify a scheduled recording.

Definition at line 196 of file recordinginfo.h.

Referenced by Scheduler::HandleRecording(), Scheduler::SchedNewRecords(), and Scheduler::TryAnotherShowing().

Returns a record id, creating "record" it if necessary.

Definition at line 843 of file recordinginfo.cpp.

Referenced by ApplyRecordRecID(), ProgramRecPriority::scheduleChanged(), and SubstituteMatches().

Returns a bitmap of which jobs are attached to this RecordingInfo.

See also:
JobTypes, GetProgramFlags()

Definition at line 462 of file recordinginfo.cpp.

Referenced by init_jobs(), main(), and JobQueue::QueueRecordingJobs().

Returns the recording type for this RecordingInfo, creating "record" field if necessary.

See also:
RecordingType, RecordingRule

Definition at line 432 of file recordinginfo.cpp.

Referenced by ApplyRecordRecPriorityChange(), ApplyRecordStateChange(), FinishedRecording(), getRecordID(), GetRecordingRule(), and ToggleRecord().

Returns recording profile name that will be, or was used, for this program, creating "record" field if necessary.

See also:
RecordingRule

Definition at line 448 of file recordinginfo.cpp.

Referenced by FillProgramInfo(), and HttpStatus::FillProgramInfo().

Sets RecordingType of "record", creating "record" if it does not exist.

Parameters:
newstateState to apply to "record" RecordingType.

Definition at line 526 of file recordinginfo.cpp.

Referenced by ScheduleCommon::customEvent(), and ToggleRecord().

Sets recording priority of "record", creating "record" if it does not exist.

Parameters:
newrecpriorityNew recording priority.

Definition at line 547 of file recordinginfo.cpp.

Referenced by ProgramRecPriority::saveRecPriority().

Cycles through recording types.

If the program recording status is kNotRecording, ApplyRecordStateChange(kSingleRecord) is called. If the program recording status is kSingleRecording, ApplyRecordStateChange(kFindOneRecord) is called.
etc...

The states in order are: kNotRecording, kSingleRecord, kFindOneRecord, kWeekslotRecord, kFindWeeklyRecord, kTimeslotRecord, kFindDailyRecord, kChannelRecord, kAllRecord.
And: kOverrideRecord, kDontRecord.

That is if you the recording is in any of the first set of states, we cycle through those, if not we toggle between kOverrideRecord and kDontRecord.

Definition at line 763 of file recordinginfo.cpp.

Referenced by ProgFinder::getInfo(), GuideGrid::quickRecord(), ProgLister::RecordSelected(), and TV::ToggleRecord().

void RecordingInfo::AddHistory ( bool  resched = true,
bool  forcedup = false,
bool  future = false 
)

Deletes recording history, creating "record" it if necessary.

Definition at line 1232 of file recordinginfo.cpp.

Forget the recording of a program so it will be recorded again.

The duplicate flags in both the recorded and old recorded tables are set to 0. This causes these records to be skipped in the left join in the BUSQ In addition, any "Never Record" fake entries are removed from the oldrecorded table and any entries in the oldfind table are removed.

Definition at line 1271 of file recordinginfo.cpp.

Referenced by ScheduleCommon::customEvent(), ProgLister::customEvent(), MainServer::customEvent(), PlaybackBox::doAllowRerecord(), MainServer::DoHandleDeleteRecording(), and MainServer::HandleForgetRecording().

Set the duplicate flag in oldrecorded.

Definition at line 1330 of file recordinginfo.cpp.

Referenced by ProgLister::customEvent().

Inserts this RecordingInfo into the database as an existing recording.

This method, of course, only works if a recording has been scheduled and started.

Parameters:
extFile extension for recording

Definition at line 858 of file recordinginfo.cpp.

Referenced by TVRec::StartedRecording().

If not a premature stop, adds program to history of recorded programs.

Parameters:
prematurestopIf true, we only fetch the recording status.

Definition at line 1080 of file recordinginfo.cpp.

Referenced by TVRec::FinishedRecording().

Update information in the recorded table when the end-time of a recording is changed.

Definition at line 1123 of file recordinginfo.cpp.

Referenced by TVRec::StartRecording().

Asks the scheduler to restart this recording if possible.

Definition at line 1143 of file recordinginfo.cpp.

Referenced by ScheduleCommon::customEvent().

Sets recordid to match RecordingRule recordid.

Definition at line 494 of file recordinginfo.cpp.

Referenced by TVRec::NotifySchedulerOfRecording().

void RecordingInfo::ApplyRecordRecGroupChange ( const QString &  newrecgroup)
void RecordingInfo::ApplyRecordPlayGroupChange ( const QString &  newplaygroup)

Sets the recording group, both in this RecordingInfo and in the database.

Parameters:
newplaygroupNew recording group.

Definition at line 584 of file recordinginfo.cpp.

Referenced by PlaybackBox::setPlayGroup().

void RecordingInfo::ApplyStorageGroupChange ( const QString &  newstoragegroup)

Sets the storage group, both in this RecordingInfo and in the database.

Parameters:
newstoragegroupNew storage group.

Definition at line 609 of file recordinginfo.cpp.

void RecordingInfo::ApplyRecordRecTitleChange ( const QString &  newTitle,
const QString &  newSubtitle,
const QString &  newDescription 
)

Sets the recording title, subtitle, and description both in this RecordingInfo and in the database.

Parameters:
newTitleNew recording title.
newSubtitleNew recording subtitle
newDescriptionNew recording description

Definition at line 636 of file recordinginfo.cpp.

Referenced by PlaybackBox::saveRecMetadata().

void RecordingInfo::ApplyTranscoderProfileChange ( const QString &  profile) const

Sets the transcoder profile for a recording.

Parameters:
profileDescriptive name of the profile. ie: Autodetect

Definition at line 688 of file recordinginfo.cpp.

Referenced by TV::DoQueueTranscode(), and QueueTranscodeJob().

Definition at line 668 of file recordinginfo.cpp.

Referenced by PlaybackBox::changeProfileAndTranscode().

static void RecordingInfo::signalChange ( int  recordid) [static]
bool RecordingInfo::InsertProgram ( const RecordingInfo pg,
const RecordingRule rule 
) [static, protected]

Definition at line 938 of file recordinginfo.cpp.

Referenced by StartedRecording().


Member Data Documentation

QString RecordingInfo::unknownTitle [static, protected]

Definition at line 244 of file recordinginfo.h.

Referenced by RecordingInfo().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends