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
17 #include "filesysteminfo.h"
18 #include "recordinginfo.h"
19 #include "remoteutil.h"
20 #include "mythdeque.h"
21 #include "mythscheduler.h"
22 #include "mthread.h"
23 #include "scheduledrecording.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  vector<uint> m_groupInputs;
41  vector<uint> 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; }
56 
57  void Reschedule(const QStringList &request);
58  void RescheduleMatch(uint recordid, uint sourceid, uint mplexid,
59  const QDateTime &maxstarttime, const QString &why)
61  mplexid, maxstarttime, why)); };
62  void RescheduleCheck(const RecordingInfo &recinfo, const QString &why)
64  void ReschedulePlace(const QString &why)
66 
67  void AddRecording(const RecordingInfo &pi);
68  void AddRecording(const ProgramInfo& prog)
69  { AddRecording(RecordingInfo(prog)); };
70  void FillRecordListFromDB(uint recordid = 0);
71  void FillRecordListFromMaster(void);
72 
73  void UpdateRecStatus(RecordingInfo *pginfo);
74  void UpdateRecStatus(uint cardid, uint chanid,
75  const QDateTime &startts, RecStatus::Type recstatus,
76  const QDateTime &recendts);
77  // Returns a list of all pending recordings and returns
78  // true iff there are conflicts
79  bool GetAllPending(RecList &retList, int recRuleId = 0) const;
80  bool GetAllPending(ProgramList &retList, int recRuleId = 0) const;
81  void GetAllPending(QStringList &strList) const override; // MythScheduler
82  QMap<QString,ProgramInfo*> GetRecording(void) const override; // MythScheduler
83 
86  static void GetAllScheduled(QStringList &strList,
87  SchedSortColumn sortBy = kSortTitle,
88  bool ascending = true);
89  static void GetAllScheduled(RecList &proglist,
90  SchedSortColumn sortBy = kSortTitle,
91  bool ascending = true);
92 
93  void getConflicting(RecordingInfo *pginfo, QStringList &strlist);
94  void getConflicting(RecordingInfo *pginfo, RecList *retlist);
95 
96  void PrintList(bool onlyFutureRecordings = false)
97  { PrintList(m_recList, onlyFutureRecordings); };
98  static void PrintList(const RecList &list, bool onlyFutureRecordings = false);
99  static void PrintRec(const RecordingInfo *p, const QString &prefix = "");
100 
101  void SetMainServer(MainServer *ms);
102 
103  void SlaveConnected(const RecordingList &slavelist);
104  void SlaveDisconnected(uint cardid);
105 
106  void DisableScheduling(void) { m_schedulingEnabled = false; }
107  void EnableScheduling(void) { m_schedulingEnabled = true; }
108  void GetNextLiveTVDir(uint cardid);
109  void ResetIdleTime(void);
110 
111  static bool WasStartedAutomatically();
112 
114 
115  int GetError(void) const { return m_error; }
116 
117  void AddChildInput(uint parentid, uint inputid);
118  void DelayShutdown();
119 
120  protected:
121  void run(void) override; // MThread
122 
123  private:
124  enum OpenEndType {
127  openEndAlways = 2
128  };
129 
130  QString m_recordTable;
132 
133  static bool VerifyCards(void);
134 
135  bool InitInputInfoMap(void);
136  void CreateTempTables(void);
137  void DeleteTempTables(void);
138  void UpdateDuplicates(void);
139  bool FillRecordList(void);
140  void UpdateMatches(uint recordid, uint sourceid, uint mplexid,
141  const QDateTime &maxstarttime);
142  void UpdateManuals(uint recordid);
143  void BuildWorkList(void);
144  bool ClearWorkList(void);
145  void AddNewRecords(void);
146  void AddNotListed(void);
147  void BuildNewRecordsQueries(uint recordid, QStringList &from,
148  QStringList &where, MSqlBindings &bindings);
149  void PruneOverlaps(void);
150  void BuildListMaps(void);
151  void ClearListMaps(void);
152 
153  bool IsBusyRecording(const RecordingInfo *rcinfo);
154 
155  bool IsSameProgram(const RecordingInfo *a, const RecordingInfo *b) const;
156 
157  bool FindNextConflict(const RecList &cardlist,
158  const RecordingInfo *p, RecConstIter &iter,
159  OpenEndType openEnd = openEndNever,
160  uint *paffinity = nullptr,
161  bool ignoreinput = false) const;
163  OpenEndType openEnd = openEndNever,
164  uint *affinity = nullptr,
165  bool checkAll = false)
166  const;
168  void MarkShowingsList(const RecList &showinglist, RecordingInfo *p);
169  void BackupRecStatus(void);
170  void RestoreRecStatus(void);
171  bool TryAnotherShowing(RecordingInfo *p, bool samePriority,
172  bool livetv = false);
173  void SchedNewRecords(void);
174  void SchedNewFirstPass(RecIter &start, const RecIter& end,
175  int recpriority, int recpriority2);
176  void SchedNewRetryPass(const RecIter& start, const RecIter& end,
177  bool samePriority, bool livetv = false);
178  void SchedLiveTV(void);
179  void PruneRedundants(void);
180  void UpdateNextRecord(void);
181 
183 
184  static bool CheckShutdownServer(int prerollseconds, QDateTime &idleSince,
185  bool &blockShutdown, uint logmask);
186  void ShutdownServer(int prerollseconds, QDateTime &idleSince);
187  void PutInactiveSlavesToSleep(void);
188  bool WakeUpSlave(const QString& slaveHostname, bool setWakingStatus = true);
189  void WakeUpSlaves(void);
190 
191  int FillRecordingDir(const QString &title,
192  const QString &hostname,
193  const QString &storagegroup,
194  const QDateTime &recstartts,
195  const QDateTime &recendts,
196  uint cardid,
197  QString &recording_dir,
198  const RecList &reclist);
199  void FillDirectoryInfoCache(void);
200 
201  void OldRecordedFixups(void);
202  void ResetDuplicates(uint recordid, uint findid, const QString &title,
203  const QString &subtitle, const QString &descrip,
204  const QString &programid);
205  bool HandleReschedule(void);
207  int prerollseconds, int idleWaitForRecordingTime);
208  void HandleWakeSlave(RecordingInfo &ri, int prerollseconds);
209  bool HandleRecording(RecordingInfo &ri, bool &statuschanged,
210  QDateTime &nextStartTime, QDateTime &nextWakeTime,
211  int prerollseconds);
213  RecordingInfo &ri, RecStatus::Type recStatus, const QString &details);
214  bool AssignGroupInput(RecordingInfo &ri, int prerollseconds);
215  void HandleIdleShutdown(
216  bool &blockShutdown, QDateTime &idleSince, int prerollseconds,
218  const bool &statuschanged);
219 
220  void EnqueueMatch(uint recordid, uint sourceid, uint mplexid,
221  const QDateTime &maxstarttime, const QString &why)
223  sourceid, mplexid, maxstarttime, why)); };
224  void EnqueueCheck(const RecordingInfo &recinfo, const QString &why)
226  why)); };
227  void EnqueuePlace(const QString &why)
229 
231  { return !m_reschedQueue.empty(); };
232  void ClearRequestQueue(void)
233  { m_reschedQueue.clear(); };
234 
235  bool CreateConflictLists(void);
236 
238  mutable QMutex m_schedLock;
240  QWaitCondition m_reschedWait;
244  QMap<uint, SchedInputInfo> m_sinputInfoMap;
245  vector<RecList *> m_conflictLists;
246  QMap<uint, RecList> m_recordIdListMap;
247  QMap<QString, RecList> m_titleListMap;
248 
249  QDateTime m_schedTime;
250  bool m_recListChanged {false};
251 
253  bool m_schedulingEnabled {true};
254  QMap<int, bool> m_schedAfterStartMap;
255 
256  QMap<int, EncoderLink *> *m_tvList {nullptr};
257  AutoExpire *m_expirer {nullptr};
258 
259  QSet<uint> m_schedOrderWarned;
260 
261  bool m_doRun;
262 
264 
266  bool m_resetIdleTime {false};
267 
268  bool m_isShuttingDown {false};
270 
271  QMap<QString, FileSystemInfo> m_fsInfoCache;
272 
273  int m_error {0};
274 
275  std::array<QSet<QString>,4> m_sysEvents;
276 
277  // Try to avoid LiveTV sessions until this time
278  QDateTime m_livetvTime;
279 
280  QDateTime m_lastPrepareTime;
281  // Delay shutdown util this time (ms since epoch);
282  int64_t m_delayShutdownTime {0};
283 
285 
286  // cache IsSameProgram()
287  using IsSameKey = std::pair<const RecordingInfo*,const RecordingInfo*>;
288  using IsSameCacheType = QMap<IsSameKey,bool>;
290  int m_tmLastLog {0};
291 };
292 
293 #endif
filesysteminfo.h
MSqlBindings
QMap< QString, QVariant > MSqlBindings
typedef for a map of string -> string bindings for generic queries.
Definition: mythdbcon.h:98
Scheduler
Definition: scheduler.h:46
Scheduler::ClearWorkList
bool ClearWorkList(void)
Definition: scheduler.cpp:940
Scheduler::kSortNextRecording
@ kSortNextRecording
Definition: scheduler.h:84
RecStatus::Type
Type
Definition: recStatus.h:16
Scheduler::FindConflict
const RecordingInfo * FindConflict(const RecordingInfo *p, OpenEndType openEnd=openEndNever, uint *affinity=nullptr, bool checkAll=false) const
Definition: scheduler.cpp:1170
Scheduler::AddRecording
void AddRecording(const RecordingInfo &pi)
Definition: scheduler.cpp:1850
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:288
Scheduler::GetNextLiveTVDir
void GetNextLiveTVDir(uint cardid)
Definition: scheduler.cpp:5046
Scheduler::GetError
int GetError(void) const
Definition: scheduler.h:115
RecConstIter
RecList::const_iterator RecConstIter
Definition: mythscheduler.h:16
Scheduler::MarkShowingsList
void MarkShowingsList(const RecList &showinglist, RecordingInfo *p)
Definition: scheduler.cpp:1209
Scheduler::m_recordMatchLock
QMutex m_recordMatchLock
Definition: scheduler.h:239
MythScheduler
This is an generic interface to a program scheduler.
Definition: mythscheduler.h:21
Scheduler::RestoreRecStatus
void RestoreRecStatus(void)
Definition: scheduler.cpp:1242
Scheduler::PrintRec
static void PrintRec(const RecordingInfo *p, const QString &prefix="")
Definition: scheduler.cpp:613
Scheduler::m_schedTime
QDateTime m_schedTime
Definition: scheduler.h:249
Scheduler::kSortPriority
@ kSortPriority
Definition: scheduler.h:85
Scheduler::SlaveConnected
void SlaveConnected(const RecordingList &slavelist)
Definition: scheduler.cpp:823
Scheduler::ReschedulePlace
void ReschedulePlace(const QString &why)
Definition: scheduler.h:64
Scheduler::PruneRedundants
void PruneRedundants(void)
Definition: scheduler.cpp:1555
title
QString title
Definition: mythplugins/mytharchive/mytharchivehelper/main.cpp:636
Scheduler::GetAllScheduled
static void GetAllScheduled(QStringList &strList, SchedSortColumn sortBy=kSortTitle, bool ascending=true)
Returns all scheduled programs serialized into a QStringList.
Definition: scheduler.cpp:1825
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:240
Scheduler::m_recList
RecList m_recList
Definition: scheduler.h:241
Scheduler::CreateConflictLists
bool CreateConflictLists(void)
Definition: scheduler.cpp:5690
Scheduler::IsSameProgram
bool IsSameProgram(const RecordingInfo *a, const RecordingInfo *b) const
Definition: scheduler.cpp:1053
Scheduler::DelayShutdown
void DelayShutdown()
Definition: scheduler.cpp:3042
tvList
QMap< int, EncoderLink * > tvList
Definition: backendcontext.cpp:7
Scheduler::WakeUpSlaves
void WakeUpSlaves(void)
Definition: scheduler.cpp:3633
Scheduler::FillRecordListFromDB
void FillRecordListFromDB(uint recordid=0)
Definition: scheduler.cpp:487
Scheduler::TryAnotherShowing
bool TryAnotherShowing(RecordingInfo *p, bool samePriority, bool livetv=false)
Definition: scheduler.cpp:1250
SchedInputInfo::m_conflictList
RecList * m_conflictList
Definition: scheduler.h:42
SchedInputInfo::m_conflictingInputs
vector< uint > m_conflictingInputs
Definition: scheduler.h:41
Scheduler::m_recListChanged
bool m_recListChanged
Definition: scheduler.h:250
Scheduler::ResetDuplicates
void ResetDuplicates(uint recordid, uint findid, const QString &title, const QString &subtitle, const QString &descrip, const QString &programid)
Definition: scheduler.cpp:2212
MainServer
Definition: mainserver.h:114
AutoExpire
Used to expire recordings to make space for new recordings.
Definition: autoexpire.h:61
Scheduler::DisableScheduling
void DisableScheduling(void)
Definition: scheduler.h:106
Scheduler::AssignGroupInput
bool AssignGroupInput(RecordingInfo &ri, int prerollseconds)
Definition: scheduler.cpp:2905
Scheduler::FillDirectoryInfoCache
void FillDirectoryInfoCache(void)
Definition: scheduler.cpp:5569
Scheduler::SchedLiveTV
void SchedLiveTV(void)
Definition: scheduler.cpp:5591
Scheduler::PutInactiveSlavesToSleep
void PutInactiveSlavesToSleep(void)
Definition: scheduler.cpp:3443
Scheduler::SlaveDisconnected
void SlaveDisconnected(uint cardid)
Definition: scheduler.cpp:898
Scheduler::OldRecordedFixups
void OldRecordedFixups(void)
Definition: scheduler.cpp:1968
Scheduler::IsBusyRecording
bool IsBusyRecording(const RecordingInfo *rcinfo)
Definition: scheduler.cpp:1891
Scheduler::m_schedLock
QMutex m_schedLock
Definition: scheduler.h:238
Scheduler::m_resetIdleTimeLock
QMutex m_resetIdleTimeLock
Definition: scheduler.h:265
Scheduler::m_dbConn
MSqlQueryInfo m_dbConn
Definition: scheduler.h:269
remoteutil.h
mythdeque.h
Scheduler::AddChildInput
void AddChildInput(uint parentid, uint inputid)
Definition: scheduler.cpp:5823
hardwareprofile.distros.mythtv_data.data_mythtv.prefix
string prefix
Definition: data_mythtv.py:40
Scheduler::openEndDiffChannel
@ openEndDiffChannel
Definition: scheduler.h:126
Scheduler::m_sinputInfoMap
QMap< uint, SchedInputInfo > m_sinputInfoMap
Definition: scheduler.h:244
Scheduler::ResetIdleTime
void ResetIdleTime(void)
Definition: scheduler.cpp:146
Scheduler::m_resetIdleTime
bool m_resetIdleTime
Definition: scheduler.h:266
Scheduler::m_schedOrderWarned
QSet< uint > m_schedOrderWarned
Definition: scheduler.h:259
Scheduler::m_expirer
AutoExpire * m_expirer
Definition: scheduler.h:257
RecIter
RecList::iterator RecIter
Definition: mythscheduler.h:17
Scheduler::m_isShuttingDown
bool m_isShuttingDown
Definition: scheduler.h:268
idleTimeoutSecs
static GlobalSpinBoxSetting * idleTimeoutSecs()
Definition: backendsettings.cpp:470
Scheduler::AddNotListed
void AddNotListed(void)
Definition: scheduler.cpp:4725
Scheduler::DeleteTempTables
void DeleteTempTables(void)
Definition: scheduler.cpp:4177
Scheduler::m_livetvList
RecList m_livetvList
Definition: scheduler.h:243
Scheduler::SchedNewFirstPass
void SchedNewFirstPass(RecIter &start, const RecIter &end, int recpriority, int recpriority2)
Definition: scheduler.cpp:1427
Scheduler::HandleIdleShutdown
void HandleIdleShutdown(bool &blockShutdown, QDateTime &idleSince, int prerollseconds, int idleTimeoutSecs, int idleWaitForRecordingTime, const bool &statuschanged)
Definition: scheduler.cpp:3047
Scheduler::m_mainServer
MainServer * m_mainServer
Definition: scheduler.h:263
SchedInputInfo::m_sgroupId
uint m_sgroupId
Definition: scheduler.h:38
Scheduler::VerifyCards
static bool VerifyCards(void)
Definition: scheduler.cpp:153
MSqlQueryInfo
MSqlDatabase Info, used by MSqlQuery. Do not use directly.
Definition: mythdbcon.h:91
Scheduler::AddRecording
void AddRecording(const ProgramInfo &prog)
Definition: scheduler.h:68
Scheduler::kSortType
@ kSortType
Definition: scheduler.h:85
hardwareprofile.config.p
p
Definition: config.py:33
Scheduler::m_conflictLists
vector< RecList * > m_conflictLists
Definition: scheduler.h:245
Scheduler::ClearListMaps
void ClearListMaps(void)
Definition: scheduler.cpp:1044
Scheduler::kSortLastRecorded
@ kSortLastRecorded
Definition: scheduler.h:84
Scheduler::~Scheduler
~Scheduler() override
Definition: scheduler.cpp:98
Scheduler::ChangeRecordingEnd
bool ChangeRecordingEnd(RecordingInfo *oldp, RecordingInfo *newp)
Definition: scheduler.cpp:746
Scheduler::m_specSched
bool m_specSched
Definition: scheduler.h:252
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:134
Scheduler::EnableScheduling
void EnableScheduling(void)
Definition: scheduler.h:107
Scheduler::m_recordIdListMap
QMap< uint, RecList > m_recordIdListMap
Definition: scheduler.h:246
Scheduler::SetExpirer
void SetExpirer(AutoExpire *autoExpirer)
Definition: scheduler.h:55
Scheduler::HandleWakeSlave
void HandleWakeSlave(RecordingInfo &ri, int prerollseconds)
Definition: scheduler.cpp:2520
Scheduler::m_reschedQueue
MythDeque< QStringList > m_reschedQueue
Definition: scheduler.h:237
Scheduler::kSortTitle
@ kSortTitle
Definition: scheduler.h:84
Scheduler::m_delayShutdownTime
int64_t m_delayShutdownTime
Definition: scheduler.h:282
scheduledrecording.h
Scheduler::m_tmLastLog
int m_tmLastLog
Definition: scheduler.h:290
Scheduler::RescheduleMatch
void RescheduleMatch(uint recordid, uint sourceid, uint mplexid, const QDateTime &maxstarttime, const QString &why)
Definition: scheduler.h:58
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:5073
Scheduler::WasStartedAutomatically
static bool WasStartedAutomatically()
Definition: scheduler.cpp:5643
Scheduler::GetRecording
QMap< QString, ProgramInfo * > GetRecording(void) const override
Definition: scheduler.cpp:1772
Scheduler::IsSameKey
std::pair< const RecordingInfo *, const RecordingInfo * > IsSameKey
Definition: scheduler.h:287
Scheduler::Reschedule
void Reschedule(const QStringList &request)
Definition: scheduler.cpp:1843
Scheduler::m_titleListMap
QMap< QString, RecList > m_titleListMap
Definition: scheduler.h:247
Scheduler::m_priorityTable
QString m_priorityTable
Definition: scheduler.h:131
Scheduler::IsSameCacheType
QMap< IsSameKey, bool > IsSameCacheType
Definition: scheduler.h:288
Scheduler::SchedSortColumn
SchedSortColumn
Definition: scheduler.h:84
Scheduler::HandleReschedule
bool HandleReschedule(void)
Definition: scheduler.cpp:2289
Scheduler::SetMainServer
void SetMainServer(MainServer *ms)
Definition: scheduler.cpp:141
Scheduler::PrintList
void PrintList(bool onlyFutureRecordings=false)
Definition: scheduler.h:96
Scheduler::getConflicting
void getConflicting(RecordingInfo *pginfo, QStringList &strlist)
Definition: scheduler.cpp:1703
Scheduler::m_sysEvents
std::array< QSet< QString >, 4 > m_sysEvents
Definition: scheduler.h:275
Scheduler::UpdateNextRecord
void UpdateNextRecord(void)
Definition: scheduler.cpp:1636
Scheduler::ShutdownServer
void ShutdownServer(int prerollseconds, QDateTime &idleSince)
Definition: scheduler.cpp:3331
uint
unsigned int uint
Definition: compat.h:140
Scheduler::AddNewRecords
void AddNewRecords(void)
Definition: scheduler.cpp:4301
Scheduler::m_lastPrepareTime
QDateTime m_lastPrepareTime
Definition: scheduler.h:280
Scheduler::HandleRecording
bool HandleRecording(RecordingInfo &ri, bool &statuschanged, QDateTime &nextStartTime, QDateTime &nextWakeTime, int prerollseconds)
Definition: scheduler.cpp:2622
Scheduler::EnqueueCheck
void EnqueueCheck(const RecordingInfo &recinfo, const QString &why)
Definition: scheduler.h:224
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:1069
AutoDeleteDeque< ProgramInfo * >
Scheduler::openEndAlways
@ openEndAlways
Definition: scheduler.h:127
Scheduler::HandleRunSchedulerStartup
bool HandleRunSchedulerStartup(int prerollseconds, int idleWaitForRecordingTime)
Definition: scheduler.cpp:2469
Scheduler::RescheduleCheck
void RescheduleCheck(const RecordingInfo &recinfo, const QString &why)
Definition: scheduler.h:62
recordinginfo.h
Scheduler::UpdateDuplicates
void UpdateDuplicates(void)
Definition: scheduler.cpp:4193
Scheduler::m_recordTable
QString m_recordTable
Definition: scheduler.h:130
Scheduler::BackupRecStatus
void BackupRecStatus(void)
Definition: scheduler.cpp:1234
SchedInputInfo
Definition: scheduler.h:32
ProgramInfo
Holds information on recordings and videos.
Definition: programinfo.h:68
Scheduler::m_fsInfoCache
QMap< QString, FileSystemInfo > m_fsInfoCache
Definition: scheduler.h:271
Scheduler::EnqueuePlace
void EnqueuePlace(const QString &why)
Definition: scheduler.h:227
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:1009
ScheduledRecording::BuildPlaceRequest
static QStringList BuildPlaceRequest(const QString &why)
Definition: scheduledrecording.cpp:53
mythscheduler.h
Scheduler::ClearRequestQueue
void ClearRequestQueue(void)
Definition: scheduler.h:232
Scheduler::CreateTempTables
void CreateTempTables(void)
Definition: scheduler.cpp:4129
Scheduler::m_workList
RecList m_workList
Definition: scheduler.h:242
Scheduler::EnqueueMatch
void EnqueueMatch(uint recordid, uint sourceid, uint mplexid, const QDateTime &maxstarttime, const QString &why)
Definition: scheduler.h:220
MythDeque< QStringList >
Scheduler::MarkOtherShowings
void MarkOtherShowings(RecordingInfo *p)
Definition: scheduler.cpp:1190
Scheduler::UpdateRecStatus
void UpdateRecStatus(RecordingInfo *pginfo)
Definition: scheduler.cpp:641
Scheduler::BuildWorkList
void BuildWorkList(void)
Definition: scheduler.cpp:928
Scheduler::m_schedAfterStartMap
QMap< int, bool > m_schedAfterStartMap
Definition: scheduler.h:254
Scheduler::OpenEndType
OpenEndType
Definition: scheduler.h:124
Scheduler::m_cacheIsSameProgram
IsSameCacheType m_cacheIsSameProgram
Definition: scheduler.h:289
Scheduler::m_error
int m_error
Definition: scheduler.h:273
SchedInputInfo::m_groupInputs
vector< uint > m_groupInputs
Definition: scheduler.h:40
RecList
std::deque< RecordingInfo * > RecList
Definition: mythscheduler.h:12
MThread
This is a wrapper around QThread that does several additional things.
Definition: mthread.h:49
mthread.h
Scheduler::m_livetvTime
QDateTime m_livetvTime
Definition: scheduler.h:278
Scheduler::PruneOverlaps
void PruneOverlaps(void)
Definition: scheduler.cpp:985
Scheduler::GetRecStatus
RecStatus::Type GetRecStatus(const ProgramInfo &pginfo)
Definition: scheduler.cpp:1788
Scheduler::CheckShutdownServer
static bool CheckShutdownServer(int prerollseconds, QDateTime &idleSince, bool &blockShutdown, uint logmask)
Definition: scheduler.cpp:3273
Scheduler::WakeUpSlave
bool WakeUpSlave(const QString &slaveHostname, bool setWakingStatus=true)
Definition: scheduler.cpp:3586
Scheduler::SchedNewRetryPass
void SchedNewRetryPass(const RecIter &start, const RecIter &end, bool samePriority, bool livetv=false)
Definition: scheduler.cpp:1505
Scheduler::GetAllPending
bool GetAllPending(RecList &retList, int recRuleId=0) const
Definition: scheduler.cpp:1733
Scheduler::UpdateManuals
void UpdateManuals(uint recordid)
Definition: scheduler.cpp:3663
Scheduler::m_tvList
QMap< int, EncoderLink * > * m_tvList
Definition: scheduler.h:256
Scheduler::HaveQueuedRequests
bool HaveQueuedRequests(void)
Definition: scheduler.h:230
musicbrainzngs.caa.hostname
string hostname
Definition: caa.py:17
Scheduler::SchedNewRecords
void SchedNewRecords(void)
Definition: scheduler.cpp:1358
Scheduler::BuildNewRecordsQueries
void BuildNewRecordsQueries(uint recordid, QStringList &from, QStringList &where, MSqlBindings &bindings)
Definition: scheduler.cpp:3794
MThread::wait
bool wait(unsigned long time=ULONG_MAX)
Wait for the MThread to exit, with a maximum timeout.
Definition: mthread.cpp:305
MythDeque::enqueue
void enqueue(T d)
Adds item to the back of the list. O(1).
Definition: mythdeque.h:42
Scheduler::m_doRun
bool m_doRun
Definition: scheduler.h:261
Scheduler::FillRecordList
bool FillRecordList(void)
Definition: scheduler.cpp:436
Scheduler::HandleRecordingStatusChange
void HandleRecordingStatusChange(RecordingInfo &ri, RecStatus::Type recStatus, const QString &details)
Definition: scheduler.cpp:2867
SchedInputInfo::~SchedInputInfo
~SchedInputInfo(void)=default
Scheduler::m_schedulingEnabled
bool m_schedulingEnabled
Definition: scheduler.h:253
ScheduledRecording::BuildCheckRequest
static QStringList BuildCheckRequest(const RecordingInfo &recinfo, const QString &why)
Definition: scheduledrecording.cpp:37
Scheduler::FillRecordListFromMaster
void FillRecordListFromMaster(void)
Definition: scheduler.cpp:576
Scheduler::Wait
void Wait(void)
Definition: scheduler.h:53
Scheduler::m_openEnd
OpenEndType m_openEnd
Definition: scheduler.h:284
idleWaitForRecordingTime
static GlobalSpinBoxSetting * idleWaitForRecordingTime()
Definition: backendsettings.cpp:481
Scheduler::Scheduler
Scheduler(bool runthread, QMap< int, EncoderLink * > *tvList, const QString &tmptable="record", Scheduler *master_sched=nullptr)
Definition: scheduler.cpp:56
Scheduler::openEndNever
@ openEndNever
Definition: scheduler.h:125
Scheduler::UpdateMatches
void UpdateMatches(uint recordid, uint sourceid, uint mplexid, const QDateTime &maxstarttime)
Definition: scheduler.cpp:3956
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:2013
Scheduler::InitInputInfoMap
bool InitInputInfoMap(void)
Definition: scheduler.cpp:5780