00001 #ifndef SCHEDULEDRECORDING_H
00002 #define SCHEDULEDRECORDING_H
00003
00004 #include "settings.h"
00005 #include "recordingtypes.h"
00006 #include <qdatetime.h>
00007 #include <list>
00008
00009
00010 using namespace std;
00011
00012 class ProgramInfo;
00013
00014 class RootSRGroup;
00015 class RecOptDialog;
00016
00017 class SRInactive;
00018 class SRRecordingType;
00019 class SRRecSearchType;
00020 class SRProfileSelector;
00021 class SRDupIn;
00022 class SRDupMethod;
00023 class SRAutoTranscode;
00024 class SRTranscoderSelector;
00025 class SRAutoCommFlag;
00026 class SRAutoUserJob1;
00027 class SRAutoUserJob2;
00028 class SRAutoUserJob3;
00029 class SRAutoUserJob4;
00030 class SRAutoExpire;
00031 class SRStartOffset;
00032 class SREndOffset;
00033 class SRMaxEpisodes;
00034 class SRMaxNewest;
00035 class SRChannel;
00036 class SRStation;
00037 class SRTitle;
00038 class SRSubtitle;
00039 class SRDescription;
00040 class SRStartTime;
00041 class SRStartDate;
00042 class SREndTime;
00043 class SREndDate;
00044 class SRCategory;
00045 class SRRecPriority;
00046 class SRRecGroup;
00047 class SRStorageGroup;
00048 class SRPlayGroup;
00049 class SRInput;
00050 class SRSeriesid;
00051 class SRProgramid;
00052 class SRFindDay;
00053 class SRFindTime;
00054 class SRFindId;
00055 class SRParentId;
00056
00057 class MPUBLIC ScheduledRecording : public ConfigurationGroup
00058 {
00059 Q_OBJECT
00060
00061 friend class SimpleSRStorage;
00062
00063 public:
00064 ScheduledRecording();
00065 ScheduledRecording(const ScheduledRecording& other);
00066
00067 void deleteLater();
00068
00069 virtual void load();
00070
00071 void makeOverride(void);
00072 const ProgramInfo* getProgramInfo() const { return m_pginfo; }
00073 QGuardedPtr<RootSRGroup> getRootGroup(void) { return rootGroup; }
00074
00075 RecordingType getRecordingType(void) const;
00076 void setRecordingType(RecordingType);
00077 RecSearchType getSearchType(void) const;
00078 void setSearchType(RecSearchType);
00079
00080 int GetAutoExpire(void) const;
00081 void SetAutoExpire(int expire);
00082
00083 int GetMaxEpisodes(void) const;
00084 bool GetMaxNewest(void) const;
00085
00086 int GetTranscoder(void) const;
00087
00088 int GetAutoRunJobs(void) const;
00089
00090 void setStart(const QDateTime& start);
00091 void setEnd(const QDateTime& end);
00092 void setEndOffset(int endminutes);
00093 int getRecPriority(void) const;
00094 void setRecPriority(int recpriority);
00095 void setRecGroup(const QString& newrecgroup);
00096 void setStorageGroup(const QString& newstoragegroup);
00097 void setPlayGroup(const QString& newplaygroup);
00098
00099 virtual void save(void);
00100 virtual void save(bool send_reschedule_signal);
00101 virtual void save(QString);
00102
00103 virtual void loadByID(int id);
00104 virtual void loadByProgram(const ProgramInfo* proginfo);
00105 virtual void loadBySearch(RecSearchType lsearch,
00106 QString textname, QString forwhat);
00107 virtual void loadBySearch(RecSearchType lsearch, QString textname,
00108 QString from, QString forwhat);
00109 virtual void modifyPowerSearchByID(int rid,
00110 QString textname, QString forwhat);
00111 virtual void modifyPowerSearchByID(int rid, QString textname,
00112 QString from, QString forwhat);
00113
00114 virtual DialogCode exec(bool saveOnExec = true, bool doLoad = false);
00115
00116 void remove();
00117 int getRecordID(void) const { return id->intValue(); };
00118 QString getRecordTitle(void) const;
00119 QString getRecordSubTitle(void) const;
00120 QString getRecordDescription(void) const;
00121 QString getProfileName(void) const;
00122 QString GetRecGroup(void) const;
00123 QString GetStorageGroup(void) const;
00124
00125 void findMatchingPrograms(list<ProgramInfo*>& proglist);
00126
00127
00128
00129 void doneRecording(ProgramInfo& proginfo);
00130
00131 static void fillSelections(SelectSetting* setting);
00132
00133 static void signalChange(int recordid);
00134
00135
00136
00137
00138
00139 void setInactiveObj(SRInactive* val) {inactive = val;}
00140 void setRecTypeObj(SRRecordingType* val) {type = val;}
00141 void setSearchTypeObj(SRRecSearchType* val) {search = val;}
00142 void setProfileObj( SRProfileSelector* val) {profile = val;}
00143 void setDupInObj(SRDupIn* val) {dupin = val;}
00144 void setDupMethodObj(SRDupMethod* val) {dupmethod = val;}
00145 void setAutoTranscodeObj(SRAutoTranscode* val) {autotranscode = val;}
00146 void setTranscoderObj(SRTranscoderSelector* val) {transcoder = val;}
00147 void setAutoCommFlagObj(SRAutoCommFlag* val) {autocommflag = val;}
00148 void setAutoUserJob1Obj(SRAutoUserJob1* val) {autouserjob1 = val;}
00149 void setAutoUserJob2Obj(SRAutoUserJob2* val) {autouserjob2 = val;}
00150 void setAutoUserJob3Obj(SRAutoUserJob3* val) {autouserjob3 = val;}
00151 void setAutoUserJob4Obj(SRAutoUserJob4* val) {autouserjob4 = val;}
00152 void setAutoExpireObj(SRAutoExpire* val) {autoexpire = val;}
00153 void setStartOffsetObj(SRStartOffset* val) {startoffset = val;}
00154 void setEndOffsetObj(SREndOffset* val) {endoffset = val;}
00155 void setMaxEpisodesObj(SRMaxEpisodes* val) {maxepisodes = val;}
00156 void setMaxNewestObj(SRMaxNewest* val) {maxnewest = val;}
00157 void setChannelObj(SRChannel* val) {channel = val;}
00158 void setStationObj(SRStation* val) {station = val;}
00159 void setTitleObj(SRTitle* val) {title = val;}
00160 void setSubTitleObj(SRSubtitle* val) {subtitle = val;}
00161 void setDescriptionObj(SRDescription* val) {description = val;}
00162 void setStartTimeObj(SRStartTime* val) {startTime = val;}
00163 void setStartDateObj(SRStartDate* val) {startDate = val;}
00164 void setEndTimeObj(SREndTime* val) {endTime = val;}
00165 void setEndDateObj(SREndDate* val) {endDate = val;}
00166 void setCategoryObj(SRCategory* val) {category = val;}
00167 void setRecPriorityObj(SRRecPriority* val) {recpriority = val;}
00168 void setRecGroupObj(SRRecGroup* val) {recgroup = val;}
00169 void setStorageGroupObj(SRStorageGroup* val) {storagegroup = val;}
00170 void setPlayGroupObj(SRPlayGroup* val) {playgroup = val;}
00171 void setInputObj(SRInput* val) {prefinput = val;}
00172 void setSeriesIDObj(SRSeriesid* val) {seriesid = val;}
00173 void setProgramIDObj(SRProgramid* val) {programid = val;}
00174 void setFindDayObj(SRFindDay* val) {findday = val;}
00175 void setFindTimeObj(SRFindTime* val) {findtime = val;}
00176 void setFindIdObj(SRFindId* val) {findid = val;}
00177 void setParentIdObj(SRParentId* val) {parentid = val;}
00178
00179 void ToMap(QMap<QString, QString>& infoMap);
00180
00181 QString ChannelText(QString format);
00182
00183 public slots:
00184 void runTitleList();
00185 void runRuleList();
00186 void runPrevList();
00187 void testRecording();
00188
00189 protected slots:
00190 void runShowDetails();
00191
00192 protected:
00193 virtual void setDefault(bool haschannel);
00194 virtual void setProgram(const ProgramInfo *proginfo);
00195 void fetchChannelInfo();
00196
00197
00198 ~ScheduledRecording();
00199
00200 class ID : public AutoIncrementDBSetting
00201 {
00202 public:
00203 ID()
00204 : AutoIncrementDBSetting("record", "recordid")
00205 {
00206 setName("RecordID");
00207 setVisible(false);
00208 }
00209 };
00210
00211 ID* id;
00212 class SRInactive* inactive;
00213 class SRRecordingType* type;
00214 class SRRecSearchType* search;
00215 class SRProfileSelector* profile;
00216 class SRDupIn* dupin;
00217 class SRDupMethod* dupmethod;
00218 class SRAutoTranscode* autotranscode;
00219 class SRTranscoderSelector* transcoder;
00220 class SRAutoCommFlag* autocommflag;
00221 class SRAutoUserJob1* autouserjob1;
00222 class SRAutoUserJob2* autouserjob2;
00223 class SRAutoUserJob3* autouserjob3;
00224 class SRAutoUserJob4* autouserjob4;
00225 class SRAutoExpire* autoexpire;
00226 class SRStartOffset* startoffset;
00227 class SREndOffset* endoffset;
00228 class SRMaxEpisodes* maxepisodes;
00229 class SRMaxNewest* maxnewest;
00230 class SRChannel* channel;
00231 class SRStation* station;
00232 class SRTitle* title;
00233 class SRSubtitle* subtitle;
00234 class SRDescription* description;
00235 class SRStartTime* startTime;
00236 class SRStartDate* startDate;
00237 class SREndTime* endTime;
00238 class SREndDate* endDate;
00239 class SRCategory* category;
00240 class SRRecPriority* recpriority;
00241 class SRRecGroup* recgroup;
00242 class SRStorageGroup* storagegroup;
00243 class SRPlayGroup* playgroup;
00244 class SRInput* prefinput;
00245 class SRSeriesid* seriesid;
00246 class SRProgramid* programid;
00247 class SRFindDay* findday;
00248 class SRFindTime* findtime;
00249 class SRFindId* findid;
00250 class SRParentId* parentid;
00251
00252 const ProgramInfo* m_pginfo;
00253 QGuardedPtr<RootSRGroup> rootGroup;
00254 QString chanstr;
00255 QString chansign;
00256 QString channame;
00257 QString searchForWhat;
00258 QString searchType;
00259
00260 QString channelFormat;
00261 QString longChannelFormat;
00262 QString timeFormat;
00263 QString dateFormat;
00264 QString shortDateFormat;
00265
00266 class ScheduledRecordingDialog* dialog;
00267 };
00268
00269 class ScheduledRecordingEditor :
00270 public QObject, public ConfigurationDialog
00271 {
00272 Q_OBJECT
00273
00274 public:
00275 ScheduledRecordingEditor() : listbox(new ListBoxSetting(this))
00276 { addChild(listbox); }
00277
00278 virtual DialogCode exec(void);
00279 virtual void load();
00280 virtual void save() { };
00281
00282 protected slots:
00283 void open(int id);
00284
00285 private:
00286 ListBoxSetting *listbox;
00287 };
00288
00289
00290 #endif
00291
00292
00293