00001 #ifndef RECORDING_RULE_H
00002 #define RECORDING_RULE_H
00003
00004
00005 #include <QDateTime>
00006 #include <QDate>
00007 #include <QTime>
00008 #include <QStringList>
00009
00010
00011 #include "mythtvexp.h"
00012
00013
00014 #include "programinfo.h"
00015
00016
00017 #include "programtypes.h"
00018 #include "recordingtypes.h"
00019
00030 class MTV_PUBLIC RecordingRule
00031 {
00032
00033 public:
00034 static const int kNumFilters = 12;
00035
00036 RecordingRule();
00037 ~RecordingRule() {};
00038
00039 bool Load(bool asTemplate = false);
00040 bool LoadByProgram(const ProgramInfo* proginfo);
00041 bool LoadBySearch(RecSearchType lsearch, QString textname, QString forwhat,
00042 QString from = "");
00043 bool LoadTemplate(QString category, QString categoryType = "Default");
00044
00045 bool ModifyPowerSearchByID(int rid, QString textname, QString forwhat,
00046 QString from = "");
00047 bool MakeOverride(void);
00048 bool MakeTemplate(QString category);
00049
00050 bool Save(bool sendSig = true);
00051 bool Delete(bool sendSig = true);
00052
00053 bool IsLoaded() const { return m_loaded; }
00054 void UseTempTable(bool usetemp, QString table = "record_tmp");
00055 static unsigned GetDefaultFilter(void);
00056
00057 void ToMap(InfoMap &infoMap) const;
00058
00059 AutoExpireType GetAutoExpire(void) const
00060 { return m_autoExpire ? kNormalAutoExpire : kDisableAutoExpire; }
00061
00062 static QString SearchTypeToString(const RecSearchType searchType);
00063 static QStringList GetTemplateNames(void);
00064
00065 int m_recordID;
00066 int m_parentRecID;
00067
00068 bool m_isInactive;
00069
00070
00071 QString m_title;
00072 QString m_subtitle;
00073 QString m_description;
00074 uint m_season;
00075 uint m_episode;
00076 QString m_category;
00077
00078 QTime m_starttime;
00079 QDate m_startdate;
00080 QTime m_endtime;
00081 QDate m_enddate;
00082
00083 QString m_seriesid;
00084 QString m_programid;
00085 QString m_inetref;
00086
00087
00088 int m_channelid;
00089 QString m_station;
00090 int m_findday;
00091 QTime m_findtime;
00092 int m_findid;
00093
00094
00095 RecordingType m_type;
00096 RecSearchType m_searchType;
00097 int m_recPriority;
00098 int m_prefInput;
00099 int m_startOffset;
00100 int m_endOffset;
00101 RecordingDupMethodType m_dupMethod;
00102 RecordingDupInType m_dupIn;
00103 unsigned m_filter;
00104
00105
00106
00107 QString m_recProfile;
00108 QString m_recGroup;
00109 QString m_storageGroup;
00110 QString m_playGroup;
00111
00112 bool m_autoExpire;
00113 int m_maxEpisodes;
00114 bool m_maxNewest;
00115
00116
00117 bool m_autoCommFlag;
00118 bool m_autoTranscode;
00119 int m_transcoder;
00120 bool m_autoUserJob1;
00121 bool m_autoUserJob2;
00122 bool m_autoUserJob3;
00123 bool m_autoUserJob4;
00124 bool m_autoMetadataLookup;
00125
00126
00127
00128 QDateTime m_nextRecording;
00129 QDateTime m_lastRecorded;
00130 QDateTime m_lastDeleted;
00131 int m_averageDelay;
00132
00133
00134 QString m_recordTable;
00135 int m_tempID;
00136
00137
00138
00139 bool m_isOverride;
00140
00141
00142
00143 bool m_isTemplate;
00144
00145 private:
00146
00147 void AssignProgramInfo();
00148
00149
00150 QString m_template;
00151
00152
00153
00154 const ProgramInfo *m_progInfo;
00155
00156
00157
00158 bool m_loaded;
00159 };
00160
00161 Q_DECLARE_METATYPE(RecordingRule*)
00162
00163 #endif