MythTV  master
scheduler.h
Go to the documentation of this file.
1 #ifndef SCHEDULER_H_
2 #define SCHEDULER_H_
3 
4 // C++ headers
5 #include <deque>
6 #include <vector>
7 
8 // Qt headers
9 #include <QWaitCondition>
10 #include <QObject>
11 #include <QString>
12 #include <QMutex>
13 #include <QMap>
14 #include <QSet>
15 
16 // MythTV headers
18 #include "libmythbase/mthread.h"
19 #include "libmythbase/mythdeque.h"
21 #include "libmythbase/remoteutil.h"
24 
25 class EncoderLink;
26 class MainServer;
27 class AutoExpire;
28 
29 class Scheduler;
30 
32 {
33  public:
34  SchedInputInfo(void) = default;;
35  ~SchedInputInfo(void) = default;
36 
39  bool m_schedGroup {false};
40  std::vector<unsigned int> m_groupInputs;
41  std::vector<unsigned int> m_conflictingInputs;
42  RecList *m_conflictList {nullptr};
43 };
44 
45 class Scheduler : public MThread, public MythScheduler
46 {
47  public:
48  Scheduler(bool runthread, QMap<int, EncoderLink *> *_tvList,
49  const QString& tmptable = "record", Scheduler *master_sched = nullptr);
50  ~Scheduler() override;
51 
52  void Stop(void);
53  void Wait(void) { MThread::wait(); }
54 
55  void SetExpirer(AutoExpire *autoExpirer) { m_expirer = autoExpirer; }
57 
58  void Reschedule(const QStringList &request);
59  void RescheduleMatch(uint recordid, uint sourceid, uint mplexid,
60  const QDateTime &maxstarttime, const QString &why)
62  mplexid, maxstarttime, why)); };
63  void RescheduleCheck(const RecordingInfo &recinfo, const QString &why)
65  void ReschedulePlace(const QString &why)
67 
68  void AddRecording(const RecordingInfo &pi);
69  void AddRecording(const ProgramInfo& prog)
70  { AddRecording(RecordingInfo(prog)); };
71  void FillRecordListFromDB(uint recordid = 0);
72  void FillRecordListFromMaster(void);
73 
74  void UpdateRecStatus(RecordingInfo *pginfo);
75  void UpdateRecStatus(uint cardid, uint chanid,
76  const QDateTime &startts, RecStatus::Type recstatus,
77  const QDateTime &recendts);
78  // Returns a list of all pending recordings and returns
79  // true iff there are conflicts
80  bool GetAllPending(RecList &retList, int recRuleId = 0) const;
81  bool GetAllPending(ProgramList &retList, int recRuleId = 0) const;
82  void GetAllPending(QStringList &strList) const override; // MythScheduler
83  QMap<QString,ProgramInfo*> GetRecording(void) const override; // MythScheduler
84  RecordingInfo* GetRecording(uint recordedid) const;
85 
88  static void GetAllScheduled(QStringList &strList,
89  SchedSortColumn sortBy = kSortTitle,
90  bool ascending = true);
91  static void GetAllScheduled(RecList &proglist,
92  SchedSortColumn sortBy = kSortTitle,
93  bool ascending = true);
94 
95  void getConflicting(RecordingInfo *pginfo, QStringList &strlist);
96  void getConflicting(RecordingInfo *pginfo, RecList *retlist);
97 
98  void PrintList(bool onlyFutureRecordings = false)
99  { PrintList(m_recList, onlyFutureRecordings); };
100  static void PrintList(const RecList &list, bool onlyFutureRecordings = false);
101  static void PrintRec(const RecordingInfo *p, const QString &prefix = "");
102 
103  void SetMainServer(MainServer *ms);
105 
106  void SlaveConnected(const RecordingList &slavelist);
107  void SlaveDisconnected(uint cardid);
108 
109  void DisableScheduling(void) { m_schedulingEnabled = false; }
110  void EnableScheduling(void) { m_schedulingEnabled = true; }
111  bool QueryScheduling(void) const { return m_schedulingEnabled; }
112  void GetNextLiveTVDir(uint cardid);
113  void ResetIdleTime(void);
114 
115  static bool WasStartedAutomatically();
116 
118 
119  int GetError(void) const { return m_error; }
120 
121  void AddChildInput(uint parentid, uint childid);
122  void DelayShutdown();
123 
124  protected:
125  void run(void) override; // MThread
126 
127  private:
128  enum OpenEndType {
132  };
133 
134  QString m_recordTable;
136 
137  static bool VerifyCards(void);
138 
139  bool InitInputInfoMap(void);
140  void CreateTempTables(void);
141  void DeleteTempTables(void);
142  void UpdateDuplicates(void);
143  bool FillRecordList(void);
144  void UpdateMatches(uint recordid, uint sourceid, uint mplexid,
145  const QDateTime &maxstarttime);
146  void UpdateManuals(uint recordid);
147  void BuildWorkList(void);
148  bool ClearWorkList(void);
149  void AddNewRecords(void);
150  void AddNotListed(void);
151  void BuildNewRecordsQueries(uint recordid, QStringList &from,
152  QStringList &where, MSqlBindings &bindings);
153  void PruneOverlaps(void);
154  void BuildListMaps(void);
155  void ClearListMaps(void);
156 
157  bool IsBusyRecording(const RecordingInfo *rcinfo);
158 
159  bool IsSameProgram(const RecordingInfo *a, const RecordingInfo *b) const;
160 
161  bool FindNextConflict(const RecList &cardlist,
162  const RecordingInfo *p, RecConstIter &iter,
163  OpenEndType openEnd = openEndNever,
164  uint *paffinity = nullptr,
165  bool ignoreinput = false) const;
167  OpenEndType openEnd = openEndNever,
168  uint *affinity = nullptr,
169  bool checkAll = false)
170  const;
172  void MarkShowingsList(const RecList &showinglist, RecordingInfo *p);
173  void BackupRecStatus(void);
174  void RestoreRecStatus(void);
175  bool TryAnotherShowing(RecordingInfo *p, bool samePriority,
176  bool livetv = false);
177  void SchedNewRecords(void);
178  void SchedNewFirstPass(RecIter &start, const RecIter& end,
179  int recpriority, int recpriority2);
180  void SchedNewRetryPass(const RecIter& start, const RecIter& end,
181  bool samePriority, bool livetv = false);
182  void SchedLiveTV(void);
183  void PruneRedundants(void);
184  void UpdateNextRecord(void);
185 
187 
188  static bool CheckShutdownServer(std::chrono::seconds prerollseconds, QDateTime &idleSince,
189  bool &blockShutdown, uint logmask);
190  void ShutdownServer(std::chrono::seconds prerollseconds, QDateTime &idleSince);
191  void PutInactiveSlavesToSleep(void);
192  bool WakeUpSlave(const QString& slaveHostname, bool setWakingStatus = true);
193  void WakeUpSlaves(void);
194 
195  int FillRecordingDir(const QString &title,
196  const QString &hostname,
197  const QString &storagegroup,
198  const QDateTime &recstartts,
199  const QDateTime &recendts,
200  uint cardid,
201  QString &recording_dir,
202  const RecList &reclist);
203  void FillDirectoryInfoCache(void);
204 
205  void OldRecordedFixups(void);
206  void ResetDuplicates(uint recordid, uint findid, const QString &title,
207  const QString &subtitle, const QString &descrip,
208  const QString &programid);
209  bool HandleReschedule(void);
211  std::chrono::seconds prerollseconds, std::chrono::minutes idleWaitForRecordingTime);
212  void HandleWakeSlave(RecordingInfo &ri, std::chrono::seconds prerollseconds);
213  bool HandleRecording(RecordingInfo &ri, bool &statuschanged,
214  QDateTime &nextStartTime, QDateTime &nextWakeTime,
215  std::chrono::seconds prerollseconds);
217  RecordingInfo &ri, RecStatus::Type recStatus, const QString &details);
218  bool AssignGroupInput(RecordingInfo &ri, std::chrono::seconds prerollseconds);
219  void HandleIdleShutdown(
220  bool &blockShutdown, QDateTime &idleSince, std::chrono::seconds prerollseconds,
221  std::chrono::seconds idleTimeoutSecs, std::chrono::minutes idleWaitForRecordingTime,
222  bool statuschanged);
223 
224  void EnqueueMatch(uint recordid, uint sourceid, uint mplexid,
225  const QDateTime &maxstarttime, const QString &why)
227  sourceid, mplexid, maxstarttime, why)); };
228  void EnqueueCheck(const RecordingInfo &recinfo, const QString &why)
230  why)); };
231  void EnqueuePlace(const QString &why)
233 
235  { return !m_reschedQueue.empty(); };
236  void ClearRequestQueue(void)
237  { m_reschedQueue.clear(); };
238 
239  bool CreateConflictLists(void);
240 
242  mutable QMutex m_schedLock;
244  QWaitCondition m_reschedWait;
248  QMap<uint, SchedInputInfo> m_sinputInfoMap;
249  std::vector<RecList *> m_conflictLists;
250  QMap<uint, RecList> m_recordIdListMap;
251  QMap<QString, RecList> m_titleListMap;
252 
253  QDateTime m_schedTime;
254  bool m_recListChanged {false};
255 
257  bool m_schedulingEnabled {true};
258  QMap<int, bool> m_schedAfterStartMap;
259 
260  QMap<int, EncoderLink *> *m_tvList {nullptr};
261  AutoExpire *m_expirer {nullptr};
262 
263  QSet<uint> m_schedOrderWarned;
264 
265  bool m_doRun;
266 
268 
270  bool m_resetIdleTime {false};
271 
272  bool m_isShuttingDown {false};
274 
275  QMap<QString, FileSystemInfo> m_fsInfoCache;
276 
277  int m_error {0};
278 
279  std::array<QSet<QString>,4> m_sysEvents;
280 
281  // Try to avoid LiveTV sessions until this time
282  QDateTime m_livetvTime;
283 
284  QDateTime m_lastPrepareTime;
285  // Delay shutdown util this time (ms since epoch);
286  std::chrono::milliseconds m_delayShutdownTime {0ms};
287 
289 
290  // cache IsSameProgram()
291  using IsSameKey = std::pair<const RecordingInfo*,const RecordingInfo*>;
292  using IsSameCacheType = QMap<IsSameKey,bool>;
294  int m_tmLastLog {0};
295 };
296 
297 #endif
filesysteminfo.h
MSqlBindings
QMap< QString, QVariant > MSqlBindings
typedef for a map of string -> string bindings for generic queries.
Definition: mythdbcon.h:100
Scheduler
Definition: scheduler.h:45
Scheduler::ClearWorkList
bool ClearWorkList(void)
Definition: scheduler.cpp:948
Scheduler::kSortNextRecording
@ kSortNextRecording
Definition: scheduler.h:86
RecStatus::Type
Type
Definition: recordingstatus.h:15
Scheduler::FindConflict
const RecordingInfo * FindConflict(const RecordingInfo *p, OpenEndType openEnd=openEndNever, uint *affinity=nullptr, bool checkAll=false) const
Definition: scheduler.cpp:1178
Scheduler::GetMainServer
MainServer * GetMainServer()
Definition: scheduler.h:104
Scheduler::AddRecording
void AddRecording(const RecordingInfo &pi)
Definition: scheduler.cpp:1868
SchedInputInfo::SchedInputInfo
SchedInputInfo(void)=default
MThread::start
void start(QThread::Priority p=QThread::InheritPriority)
Tell MThread to start running the thread in the near future.
Definition: mthread.cpp:283
Scheduler::GetNextLiveTVDir
void GetNextLiveTVDir(uint cardid)
Definition: scheduler.cpp:5090
Scheduler::GetError
int GetError(void) const
Definition: scheduler.h:119
RecConstIter
RecList::const_iterator RecConstIter
Definition: mythscheduler.h:13
Scheduler::MarkShowingsList
void MarkShowingsList(const RecList &showinglist, RecordingInfo *p)
Definition: scheduler.cpp:1217
Scheduler::m_recordMatchLock
QMutex m_recordMatchLock
Definition: scheduler.h:243
MythScheduler
This is an generic interface to a program scheduler.
Definition: mythscheduler.h:17
Scheduler::RestoreRecStatus
void RestoreRecStatus(void)
Definition: scheduler.cpp:1250
Scheduler::PrintRec
static void PrintRec(const RecordingInfo *p, const QString &prefix="")
Definition: scheduler.cpp:611
Scheduler::CheckShutdownServer
static bool CheckShutdownServer(std::chrono::seconds prerollseconds, QDateTime &idleSince, bool &blockShutdown, uint logmask)
Definition: scheduler.cpp:3303
Scheduler::m_schedTime
QDateTime m_schedTime
Definition: scheduler.h:253
Scheduler::kSortPriority
@ kSortPriority
Definition: scheduler.h:87
Scheduler::SlaveConnected
void SlaveConnected(const RecordingList &slavelist)
Definition: scheduler.cpp:831
Scheduler::ReschedulePlace
void ReschedulePlace(const QString &why)
Definition: scheduler.h:65
Scheduler::PruneRedundants
void PruneRedundants(void)
Definition: scheduler.cpp:1563
MThread::wait
bool wait(std::chrono::milliseconds time=std::chrono::milliseconds::max())
Wait for the MThread to exit, with a maximum timeout.
Definition: mthread.cpp:300
Scheduler::GetAllScheduled
static void GetAllScheduled(QStringList &strList, SchedSortColumn sortBy=kSortTitle, bool ascending=true)
Returns all scheduled programs serialized into a QStringList.
Definition: scheduler.cpp:1843
RecordingInfo
Holds information on a TV Program one might wish to record.
Definition: recordinginfo.h:35
Scheduler::m_reschedWait
QWaitCondition m_reschedWait
Definition: scheduler.h:244
Scheduler::m_recList
RecList m_recList
Definition: scheduler.h:245
Scheduler::CreateConflictLists
bool CreateConflictLists(void)
Definition: scheduler.cpp:5732
SchedInputInfo::m_groupInputs
std::vector< unsigned int > m_groupInputs
Definition: scheduler.h:40
Scheduler::IsSameProgram
bool IsSameProgram(const RecordingInfo *a, const RecordingInfo *b) const
Definition: scheduler.cpp:1061
Scheduler::DelayShutdown
void DelayShutdown()
Definition: scheduler.cpp:3073
Scheduler::WakeUpSlaves
void WakeUpSlaves(void)
Definition: scheduler.cpp:3665
Scheduler::FillRecordListFromDB
void FillRecordListFromDB(uint recordid=0)
Definition: scheduler.cpp:491
Scheduler::TryAnotherShowing
bool TryAnotherShowing(RecordingInfo *p, bool samePriority, bool livetv=false)
Definition: scheduler.cpp:1258
Scheduler::m_delayShutdownTime
std::chrono::milliseconds m_delayShutdownTime
Definition: scheduler.h:286
SchedInputInfo::m_conflictList
RecList * m_conflictList
Definition: scheduler.h:42
Scheduler::m_recListChanged
bool m_recListChanged
Definition: scheduler.h:254
Scheduler::ResetDuplicates
void ResetDuplicates(uint recordid, uint findid, const QString &title, const QString &subtitle, const QString &descrip, const QString &programid)
Definition: scheduler.cpp:2246
MainServer
Definition: mainserver.h:115
Scheduler::HandleRecording
bool HandleRecording(RecordingInfo &ri, bool &statuschanged, QDateTime &nextStartTime, QDateTime &nextWakeTime, std::chrono::seconds prerollseconds)
Definition: scheduler.cpp:2648
AutoExpire
Used to expire recordings to make space for new recordings.
Definition: autoexpire.h:60
Scheduler::DisableScheduling
void DisableScheduling(void)
Definition: scheduler.h:109
Scheduler::FillDirectoryInfoCache
void FillDirectoryInfoCache(void)
Definition: scheduler.cpp:5612
Scheduler::SchedLiveTV
void SchedLiveTV(void)
Definition: scheduler.cpp:5634
Scheduler::PutInactiveSlavesToSleep
void PutInactiveSlavesToSleep(void)
Definition: scheduler.cpp:3474
Scheduler::SlaveDisconnected
void SlaveDisconnected(uint cardid)
Definition: scheduler.cpp:906
Scheduler::OldRecordedFixups
void OldRecordedFixups(void)
Definition: scheduler.cpp:1986
Scheduler::m_conflictLists
std::vector< RecList * > m_conflictLists
Definition: scheduler.h:249
Scheduler::IsBusyRecording
bool IsBusyRecording(const RecordingInfo *rcinfo)
Definition: scheduler.cpp:1909
Scheduler::m_schedLock
QMutex m_schedLock
Definition: scheduler.h:242
Scheduler::m_resetIdleTimeLock
QMutex m_resetIdleTimeLock
Definition: scheduler.h:269
Scheduler::m_dbConn
MSqlQueryInfo m_dbConn
Definition: scheduler.h:273
remoteutil.h
mythdeque.h
hardwareprofile.distros.mythtv_data.data_mythtv.prefix
string prefix
Definition: data_mythtv.py:40
Scheduler::openEndDiffChannel
@ openEndDiffChannel
Definition: scheduler.h:130
Scheduler::m_sinputInfoMap
QMap< uint, SchedInputInfo > m_sinputInfoMap
Definition: scheduler.h:248
Scheduler::ResetIdleTime
void ResetIdleTime(void)
Definition: scheduler.cpp:150
Scheduler::Scheduler
Scheduler(bool runthread, QMap< int, EncoderLink * > *_tvList, const QString &tmptable="record", Scheduler *master_sched=nullptr)
Definition: scheduler.cpp:62
Scheduler::m_resetIdleTime
bool m_resetIdleTime
Definition: scheduler.h:270
Scheduler::m_schedOrderWarned
QSet< uint > m_schedOrderWarned
Definition: scheduler.h:263
Scheduler::m_expirer
AutoExpire * m_expirer
Definition: scheduler.h:261
RecIter
RecList::iterator RecIter
Definition: mythscheduler.h:14
Scheduler::QueryScheduling
bool QueryScheduling(void) const
Definition: scheduler.h:111
Scheduler::m_isShuttingDown
bool m_isShuttingDown
Definition: scheduler.h:272
idleTimeoutSecs
static GlobalSpinBoxSetting * idleTimeoutSecs()
Definition: backendsettings.cpp:523
Scheduler::AddNotListed
void AddNotListed(void)
Definition: scheduler.cpp:4771
Scheduler::DeleteTempTables
void DeleteTempTables(void)
Definition: scheduler.cpp:4206
Scheduler::m_livetvList
RecList m_livetvList
Definition: scheduler.h:247
Scheduler::SchedNewFirstPass
void SchedNewFirstPass(RecIter &start, const RecIter &end, int recpriority, int recpriority2)
Definition: scheduler.cpp:1435
Scheduler::m_mainServer
MainServer * m_mainServer
Definition: scheduler.h:267
Scheduler::AddChildInput
void AddChildInput(uint parentid, uint childid)
Definition: scheduler.cpp:5866
SchedInputInfo::m_sgroupId
uint m_sgroupId
Definition: scheduler.h:38
Scheduler::VerifyCards
static bool VerifyCards(void)
Definition: scheduler.cpp:157
MSqlQueryInfo
MSqlDatabase Info, used by MSqlQuery. Do not use directly.
Definition: mythdbcon.h:92
Scheduler::AddRecording
void AddRecording(const ProgramInfo &prog)
Definition: scheduler.h:69
Scheduler::kSortType
@ kSortType
Definition: scheduler.h:87
hardwareprofile.config.p
p
Definition: config.py:33
Scheduler::ClearListMaps
void ClearListMaps(void)
Definition: scheduler.cpp:1052
Scheduler::kSortLastRecorded
@ kSortLastRecorded
Definition: scheduler.h:86
Scheduler::~Scheduler
~Scheduler() override
Definition: scheduler.cpp:102
Scheduler::ChangeRecordingEnd
bool ChangeRecordingEnd(RecordingInfo *oldp, RecordingInfo *newp)
Definition: scheduler.cpp:754
Scheduler::m_specSched
bool m_specSched
Definition: scheduler.h:256
SchedInputInfo::m_inputId
uint m_inputId
Definition: scheduler.h:37
SchedInputInfo::m_schedGroup
bool m_schedGroup
Definition: scheduler.h:39
Scheduler::Stop
void Stop(void)
Definition: scheduler.cpp:138
Scheduler::EnableScheduling
void EnableScheduling(void)
Definition: scheduler.h:110
Scheduler::m_recordIdListMap
QMap< uint, RecList > m_recordIdListMap
Definition: scheduler.h:250
Scheduler::SetExpirer
void SetExpirer(AutoExpire *autoExpirer)
Definition: scheduler.h:55
Scheduler::m_reschedQueue
MythDeque< QStringList > m_reschedQueue
Definition: scheduler.h:241
Scheduler::kSortTitle
@ kSortTitle
Definition: scheduler.h:86
Scheduler::HandleIdleShutdown
void HandleIdleShutdown(bool &blockShutdown, QDateTime &idleSince, std::chrono::seconds prerollseconds, std::chrono::seconds idleTimeoutSecs, std::chrono::minutes idleWaitForRecordingTime, bool statuschanged)
Definition: scheduler.cpp:3078
scheduledrecording.h
Scheduler::m_tmLastLog
int m_tmLastLog
Definition: scheduler.h:294
Scheduler::RescheduleMatch
void RescheduleMatch(uint recordid, uint sourceid, uint mplexid, const QDateTime &maxstarttime, const QString &why)
Definition: scheduler.h:59
Scheduler::FillRecordingDir
int FillRecordingDir(const QString &title, const QString &hostname, const QString &storagegroup, const QDateTime &recstartts, const QDateTime &recendts, uint cardid, QString &recording_dir, const RecList &reclist)
Definition: scheduler.cpp:5117
Scheduler::WasStartedAutomatically
static bool WasStartedAutomatically()
Definition: scheduler.cpp:5686
Scheduler::GetRecording
QMap< QString, ProgramInfo * > GetRecording(void) const override
Definition: scheduler.cpp:1780
Scheduler::IsSameKey
std::pair< const RecordingInfo *, const RecordingInfo * > IsSameKey
Definition: scheduler.h:291
Scheduler::Reschedule
void Reschedule(const QStringList &request)
Definition: scheduler.cpp:1861
Scheduler::m_titleListMap
QMap< QString, RecList > m_titleListMap
Definition: scheduler.h:251
Scheduler::m_priorityTable
QString m_priorityTable
Definition: scheduler.h:135
Scheduler::IsSameCacheType
QMap< IsSameKey, bool > IsSameCacheType
Definition: scheduler.h:292
Scheduler::SchedSortColumn
SchedSortColumn
Definition: scheduler.h:86
Scheduler::HandleReschedule
bool HandleReschedule(void)
Definition: scheduler.cpp:2323
Scheduler::SetMainServer
void SetMainServer(MainServer *ms)
Definition: scheduler.cpp:145
Scheduler::PrintList
void PrintList(bool onlyFutureRecordings=false)
Definition: scheduler.h:98
Scheduler::getConflicting
void getConflicting(RecordingInfo *pginfo, QStringList &strlist)
Definition: scheduler.cpp:1711
Scheduler::m_sysEvents
std::array< QSet< QString >, 4 > m_sysEvents
Definition: scheduler.h:279
Scheduler::UpdateNextRecord
void UpdateNextRecord(void)
Definition: scheduler.cpp:1644
Scheduler::AssignGroupInput
bool AssignGroupInput(RecordingInfo &ri, std::chrono::seconds prerollseconds)
Definition: scheduler.cpp:2934
uint
unsigned int uint
Definition: compat.h:81
Scheduler::AddNewRecords
void AddNewRecords(void)
Definition: scheduler.cpp:4330
Scheduler::m_lastPrepareTime
QDateTime m_lastPrepareTime
Definition: scheduler.h:284
Scheduler::EnqueueCheck
void EnqueueCheck(const RecordingInfo &recinfo, const QString &why)
Definition: scheduler.h:228
Scheduler::FindNextConflict
bool FindNextConflict(const RecList &cardlist, const RecordingInfo *p, RecConstIter &iter, OpenEndType openEnd=openEndNever, uint *paffinity=nullptr, bool ignoreinput=false) const
Definition: scheduler.cpp:1077
AutoDeleteDeque< ProgramInfo * >
Scheduler::openEndAlways
@ openEndAlways
Definition: scheduler.h:131
Scheduler::GetExpirer
AutoExpire * GetExpirer()
Definition: scheduler.h:56
SchedInputInfo::m_conflictingInputs
std::vector< unsigned int > m_conflictingInputs
Definition: scheduler.h:41
Scheduler::RescheduleCheck
void RescheduleCheck(const RecordingInfo &recinfo, const QString &why)
Definition: scheduler.h:63
recordinginfo.h
Scheduler::UpdateDuplicates
void UpdateDuplicates(void)
Definition: scheduler.cpp:4222
Scheduler::m_recordTable
QString m_recordTable
Definition: scheduler.h:134
Scheduler::BackupRecStatus
void BackupRecStatus(void)
Definition: scheduler.cpp:1242
SchedInputInfo
Definition: scheduler.h:31
ProgramInfo
Holds information on recordings and videos.
Definition: programinfo.h:67
Scheduler::m_fsInfoCache
QMap< QString, FileSystemInfo > m_fsInfoCache
Definition: scheduler.h:275
Scheduler::EnqueuePlace
void EnqueuePlace(const QString &why)
Definition: scheduler.h:231
ScheduledRecording::BuildMatchRequest
static QStringList BuildMatchRequest(uint recordid, uint sourceid, uint mplexid, const QDateTime &maxstarttime, const QString &why)
Definition: scheduledrecording.cpp:25
Scheduler::BuildListMaps
void BuildListMaps(void)
Definition: scheduler.cpp:1017
ScheduledRecording::BuildPlaceRequest
static QStringList BuildPlaceRequest(const QString &why)
Definition: scheduledrecording.cpp:53
mythscheduler.h
Scheduler::ClearRequestQueue
void ClearRequestQueue(void)
Definition: scheduler.h:236
Scheduler::CreateTempTables
void CreateTempTables(void)
Definition: scheduler.cpp:4158
Scheduler::m_workList
RecList m_workList
Definition: scheduler.h:246
Scheduler::EnqueueMatch
void EnqueueMatch(uint recordid, uint sourceid, uint mplexid, const QDateTime &maxstarttime, const QString &why)
Definition: scheduler.h:224
MythDeque< QStringList >
Scheduler::MarkOtherShowings
void MarkOtherShowings(RecordingInfo *p)
Definition: scheduler.cpp:1198
Scheduler::UpdateRecStatus
void UpdateRecStatus(RecordingInfo *pginfo)
Definition: scheduler.cpp:649
Scheduler::BuildWorkList
void BuildWorkList(void)
Definition: scheduler.cpp:936
Scheduler::m_schedAfterStartMap
QMap< int, bool > m_schedAfterStartMap
Definition: scheduler.h:258
Scheduler::OpenEndType
OpenEndType
Definition: scheduler.h:128
Scheduler::m_cacheIsSameProgram
IsSameCacheType m_cacheIsSameProgram
Definition: scheduler.h:293
Scheduler::m_error
int m_error
Definition: scheduler.h:277
RecList
std::deque< RecordingInfo * > RecList
Definition: mythscheduler.h:12
MThread
This is a wrapper around QThread that does several additional things.
Definition: mthread.h:48
Scheduler::HandleWakeSlave
void HandleWakeSlave(RecordingInfo &ri, std::chrono::seconds prerollseconds)
Definition: scheduler.cpp:2545
mthread.h
Scheduler::m_livetvTime
QDateTime m_livetvTime
Definition: scheduler.h:282
Scheduler::PruneOverlaps
void PruneOverlaps(void)
Definition: scheduler.cpp:993
Scheduler::GetRecStatus
RecStatus::Type GetRecStatus(const ProgramInfo &pginfo)
Definition: scheduler.cpp:1806
Scheduler::WakeUpSlave
bool WakeUpSlave(const QString &slaveHostname, bool setWakingStatus=true)
Definition: scheduler.cpp:3618
Scheduler::SchedNewRetryPass
void SchedNewRetryPass(const RecIter &start, const RecIter &end, bool samePriority, bool livetv=false)
Definition: scheduler.cpp:1513
Scheduler::GetAllPending
bool GetAllPending(RecList &retList, int recRuleId=0) const
Definition: scheduler.cpp:1741
Scheduler::UpdateManuals
void UpdateManuals(uint recordid)
Definition: scheduler.cpp:3695
Scheduler::m_tvList
QMap< int, EncoderLink * > * m_tvList
Definition: scheduler.h:260
Scheduler::HaveQueuedRequests
bool HaveQueuedRequests(void)
Definition: scheduler.h:234
musicbrainzngs.caa.hostname
string hostname
Definition: caa.py:17
Scheduler::SchedNewRecords
void SchedNewRecords(void)
Definition: scheduler.cpp:1366
Scheduler::HandleRunSchedulerStartup
bool HandleRunSchedulerStartup(std::chrono::seconds prerollseconds, std::chrono::minutes idleWaitForRecordingTime)
Definition: scheduler.cpp:2493
Scheduler::BuildNewRecordsQueries
void BuildNewRecordsQueries(uint recordid, QStringList &from, QStringList &where, MSqlBindings &bindings)
Definition: scheduler.cpp:3826
MythDeque::enqueue
void enqueue(T d)
Adds item to the back of the list. O(1).
Definition: mythdeque.h:41
Scheduler::m_doRun
bool m_doRun
Definition: scheduler.h:265
Scheduler::FillRecordList
bool FillRecordList(void)
Definition: scheduler.cpp:440
Scheduler::HandleRecordingStatusChange
void HandleRecordingStatusChange(RecordingInfo &ri, RecStatus::Type recStatus, const QString &details)
Definition: scheduler.cpp:2896
SchedInputInfo::~SchedInputInfo
~SchedInputInfo(void)=default
Scheduler::m_schedulingEnabled
bool m_schedulingEnabled
Definition: scheduler.h:257
ScheduledRecording::BuildCheckRequest
static QStringList BuildCheckRequest(const RecordingInfo &recinfo, const QString &why)
Definition: scheduledrecording.cpp:37
Scheduler::FillRecordListFromMaster
void FillRecordListFromMaster(void)
Definition: scheduler.cpp:574
Scheduler::Wait
void Wait(void)
Definition: scheduler.h:53
Scheduler::m_openEnd
OpenEndType m_openEnd
Definition: scheduler.h:288
idleWaitForRecordingTime
static GlobalSpinBoxSetting * idleWaitForRecordingTime()
Definition: backendsettings.cpp:534
Scheduler::openEndNever
@ openEndNever
Definition: scheduler.h:129
Scheduler::ShutdownServer
void ShutdownServer(std::chrono::seconds prerollseconds, QDateTime &idleSince)
Definition: scheduler.cpp:3361
Scheduler::UpdateMatches
void UpdateMatches(uint recordid, uint sourceid, uint mplexid, const QDateTime &maxstarttime)
Definition: scheduler.cpp:3988
Scheduler::run
void run(void) override
Runs the Qt event loop unless we have a QRunnable, in which case we run the runnable run instead.
Definition: scheduler.cpp:2031
Scheduler::InitInputInfoMap
bool InitInputInfoMap(void)
Definition: scheduler.cpp:5822