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  void GetNextLiveTVDir(uint cardid);
112  void ResetIdleTime(void);
113 
114  static bool WasStartedAutomatically();
115 
117 
118  int GetError(void) const { return m_error; }
119 
120  void AddChildInput(uint parentid, uint childid);
121  void DelayShutdown();
122 
123  protected:
124  void run(void) override; // MThread
125 
126  private:
127  enum OpenEndType {
131  };
132 
133  QString m_recordTable;
135 
136  static bool VerifyCards(void);
137 
138  bool InitInputInfoMap(void);
139  void CreateTempTables(void);
140  void DeleteTempTables(void);
141  void UpdateDuplicates(void);
142  bool FillRecordList(void);
143  void UpdateMatches(uint recordid, uint sourceid, uint mplexid,
144  const QDateTime &maxstarttime);
145  void UpdateManuals(uint recordid);
146  void BuildWorkList(void);
147  bool ClearWorkList(void);
148  void AddNewRecords(void);
149  void AddNotListed(void);
150  void BuildNewRecordsQueries(uint recordid, QStringList &from,
151  QStringList &where, MSqlBindings &bindings);
152  void PruneOverlaps(void);
153  void BuildListMaps(void);
154  void ClearListMaps(void);
155 
156  bool IsBusyRecording(const RecordingInfo *rcinfo);
157 
158  bool IsSameProgram(const RecordingInfo *a, const RecordingInfo *b) const;
159 
160  bool FindNextConflict(const RecList &cardlist,
161  const RecordingInfo *p, RecConstIter &iter,
162  OpenEndType openEnd = openEndNever,
163  uint *paffinity = nullptr,
164  bool ignoreinput = false) const;
166  OpenEndType openEnd = openEndNever,
167  uint *affinity = nullptr,
168  bool checkAll = false)
169  const;
171  void MarkShowingsList(const RecList &showinglist, RecordingInfo *p);
172  void BackupRecStatus(void);
173  void RestoreRecStatus(void);
174  bool TryAnotherShowing(RecordingInfo *p, bool samePriority,
175  bool livetv = false);
176  void SchedNewRecords(void);
177  void SchedNewFirstPass(RecIter &start, const RecIter& end,
178  int recpriority, int recpriority2);
179  void SchedNewRetryPass(const RecIter& start, const RecIter& end,
180  bool samePriority, bool livetv = false);
181  void SchedLiveTV(void);
182  void PruneRedundants(void);
183  void UpdateNextRecord(void);
184 
186 
187  static bool CheckShutdownServer(std::chrono::seconds prerollseconds, QDateTime &idleSince,
188  bool &blockShutdown, uint logmask);
189  void ShutdownServer(std::chrono::seconds prerollseconds, QDateTime &idleSince);
190  void PutInactiveSlavesToSleep(void);
191  bool WakeUpSlave(const QString& slaveHostname, bool setWakingStatus = true);
192  void WakeUpSlaves(void);
193 
194  int FillRecordingDir(const QString &title,
195  const QString &hostname,
196  const QString &storagegroup,
197  const QDateTime &recstartts,
198  const QDateTime &recendts,
199  uint cardid,
200  QString &recording_dir,
201  const RecList &reclist);
202  void FillDirectoryInfoCache(void);
203 
204  void OldRecordedFixups(void);
205  void ResetDuplicates(uint recordid, uint findid, const QString &title,
206  const QString &subtitle, const QString &descrip,
207  const QString &programid);
208  bool HandleReschedule(void);
210  std::chrono::seconds prerollseconds, std::chrono::minutes idleWaitForRecordingTime);
211  void HandleWakeSlave(RecordingInfo &ri, std::chrono::seconds prerollseconds);
212  bool HandleRecording(RecordingInfo &ri, bool &statuschanged,
213  QDateTime &nextStartTime, QDateTime &nextWakeTime,
214  std::chrono::seconds prerollseconds);
216  RecordingInfo &ri, RecStatus::Type recStatus, const QString &details);
217  bool AssignGroupInput(RecordingInfo &ri, std::chrono::seconds prerollseconds);
218  void HandleIdleShutdown(
219  bool &blockShutdown, QDateTime &idleSince, std::chrono::seconds prerollseconds,
220  std::chrono::seconds idleTimeoutSecs, std::chrono::minutes idleWaitForRecordingTime,
221  bool statuschanged);
222 
223  void EnqueueMatch(uint recordid, uint sourceid, uint mplexid,
224  const QDateTime &maxstarttime, const QString &why)
226  sourceid, mplexid, maxstarttime, why)); };
227  void EnqueueCheck(const RecordingInfo &recinfo, const QString &why)
229  why)); };
230  void EnqueuePlace(const QString &why)
232 
234  { return !m_reschedQueue.empty(); };
235  void ClearRequestQueue(void)
236  { m_reschedQueue.clear(); };
237 
238  bool CreateConflictLists(void);
239 
241  mutable QMutex m_schedLock;
243  QWaitCondition m_reschedWait;
247  QMap<uint, SchedInputInfo> m_sinputInfoMap;
248  std::vector<RecList *> m_conflictLists;
249  QMap<uint, RecList> m_recordIdListMap;
250  QMap<QString, RecList> m_titleListMap;
251 
252  QDateTime m_schedTime;
253  bool m_recListChanged {false};
254 
256  bool m_schedulingEnabled {true};
257  QMap<int, bool> m_schedAfterStartMap;
258 
259  QMap<int, EncoderLink *> *m_tvList {nullptr};
260  AutoExpire *m_expirer {nullptr};
261 
262  QSet<uint> m_schedOrderWarned;
263 
264  bool m_doRun;
265 
267 
269  bool m_resetIdleTime {false};
270 
271  bool m_isShuttingDown {false};
273 
274  QMap<QString, FileSystemInfo> m_fsInfoCache;
275 
276  int m_error {0};
277 
278  std::array<QSet<QString>,4> m_sysEvents;
279 
280  // Try to avoid LiveTV sessions until this time
281  QDateTime m_livetvTime;
282 
283  QDateTime m_lastPrepareTime;
284  // Delay shutdown util this time (ms since epoch);
285  std::chrono::milliseconds m_delayShutdownTime {0ms};
286 
288 
289  // cache IsSameProgram()
290  using IsSameKey = std::pair<const RecordingInfo*,const RecordingInfo*>;
291  using IsSameCacheType = QMap<IsSameKey,bool>;
293  int m_tmLastLog {0};
294 };
295 
296 #endif
filesysteminfo.h
MSqlBindings
QMap< QString, QVariant > MSqlBindings
typedef for a map of string -> string bindings for generic queries.
Definition: mythdbcon.h:101
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:16
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:5076
Scheduler::GetError
int GetError(void) const
Definition: scheduler.h:118
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:242
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:3288
Scheduler::m_schedTime
QDateTime m_schedTime
Definition: scheduler.h:252
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:243
Scheduler::m_recList
RecList m_recList
Definition: scheduler.h:244
Scheduler::CreateConflictLists
bool CreateConflictLists(void)
Definition: scheduler.cpp:5718
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:3058
Scheduler::WakeUpSlaves
void WakeUpSlaves(void)
Definition: scheduler.cpp:3651
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:285
SchedInputInfo::m_conflictList
RecList * m_conflictList
Definition: scheduler.h:42
Scheduler::m_recListChanged
bool m_recListChanged
Definition: scheduler.h:253
Scheduler::ResetDuplicates
void ResetDuplicates(uint recordid, uint findid, const QString &title, const QString &subtitle, const QString &descrip, const QString &programid)
Definition: scheduler.cpp:2228
MainServer
Definition: mainserver.h:115
Scheduler::HandleRecording
bool HandleRecording(RecordingInfo &ri, bool &statuschanged, QDateTime &nextStartTime, QDateTime &nextWakeTime, std::chrono::seconds prerollseconds)
Definition: scheduler.cpp:2633
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:5598
Scheduler::SchedLiveTV
void SchedLiveTV(void)
Definition: scheduler.cpp:5620
Scheduler::PutInactiveSlavesToSleep
void PutInactiveSlavesToSleep(void)
Definition: scheduler.cpp:3460
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:248
Scheduler::IsBusyRecording
bool IsBusyRecording(const RecordingInfo *rcinfo)
Definition: scheduler.cpp:1909
Scheduler::m_schedLock
QMutex m_schedLock
Definition: scheduler.h:241
Scheduler::m_resetIdleTimeLock
QMutex m_resetIdleTimeLock
Definition: scheduler.h:268
Scheduler::m_dbConn
MSqlQueryInfo m_dbConn
Definition: scheduler.h:272
remoteutil.h
mythdeque.h
hardwareprofile.distros.mythtv_data.data_mythtv.prefix
string prefix
Definition: data_mythtv.py:40
Scheduler::openEndDiffChannel
@ openEndDiffChannel
Definition: scheduler.h:129
Scheduler::m_sinputInfoMap
QMap< uint, SchedInputInfo > m_sinputInfoMap
Definition: scheduler.h:247
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:269
Scheduler::m_schedOrderWarned
QSet< uint > m_schedOrderWarned
Definition: scheduler.h:262
Scheduler::m_expirer
AutoExpire * m_expirer
Definition: scheduler.h:260
RecIter
RecList::iterator RecIter
Definition: mythscheduler.h:14
Scheduler::m_isShuttingDown
bool m_isShuttingDown
Definition: scheduler.h:271
idleTimeoutSecs
static GlobalSpinBoxSetting * idleTimeoutSecs()
Definition: backendsettings.cpp:481
Scheduler::AddNotListed
void AddNotListed(void)
Definition: scheduler.cpp:4757
Scheduler::DeleteTempTables
void DeleteTempTables(void)
Definition: scheduler.cpp:4192
Scheduler::m_livetvList
RecList m_livetvList
Definition: scheduler.h:246
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:266
Scheduler::AddChildInput
void AddChildInput(uint parentid, uint childid)
Definition: scheduler.cpp:5851
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:93
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:255
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:249
Scheduler::SetExpirer
void SetExpirer(AutoExpire *autoExpirer)
Definition: scheduler.h:55
Scheduler::m_reschedQueue
MythDeque< QStringList > m_reschedQueue
Definition: scheduler.h:240
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:3063
scheduledrecording.h
Scheduler::m_tmLastLog
int m_tmLastLog
Definition: scheduler.h:293
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:5103
Scheduler::WasStartedAutomatically
static bool WasStartedAutomatically()
Definition: scheduler.cpp:5672
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:290
Scheduler::Reschedule
void Reschedule(const QStringList &request)
Definition: scheduler.cpp:1861
Scheduler::m_titleListMap
QMap< QString, RecList > m_titleListMap
Definition: scheduler.h:250
Scheduler::m_priorityTable
QString m_priorityTable
Definition: scheduler.h:134
Scheduler::IsSameCacheType
QMap< IsSameKey, bool > IsSameCacheType
Definition: scheduler.h:291
Scheduler::SchedSortColumn
SchedSortColumn
Definition: scheduler.h:86
Scheduler::HandleReschedule
bool HandleReschedule(void)
Definition: scheduler.cpp:2305
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:278
Scheduler::UpdateNextRecord
void UpdateNextRecord(void)
Definition: scheduler.cpp:1644
Scheduler::AssignGroupInput
bool AssignGroupInput(RecordingInfo &ri, std::chrono::seconds prerollseconds)
Definition: scheduler.cpp:2919
uint
unsigned int uint
Definition: compat.h:79
Scheduler::AddNewRecords
void AddNewRecords(void)
Definition: scheduler.cpp:4316
Scheduler::m_lastPrepareTime
QDateTime m_lastPrepareTime
Definition: scheduler.h:283
Scheduler::EnqueueCheck
void EnqueueCheck(const RecordingInfo &recinfo, const QString &why)
Definition: scheduler.h:227
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:130
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:4208
Scheduler::m_recordTable
QString m_recordTable
Definition: scheduler.h:133
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:274
Scheduler::EnqueuePlace
void EnqueuePlace(const QString &why)
Definition: scheduler.h:230
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:235
Scheduler::CreateTempTables
void CreateTempTables(void)
Definition: scheduler.cpp:4144
Scheduler::m_workList
RecList m_workList
Definition: scheduler.h:245
Scheduler::EnqueueMatch
void EnqueueMatch(uint recordid, uint sourceid, uint mplexid, const QDateTime &maxstarttime, const QString &why)
Definition: scheduler.h:223
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:257
Scheduler::OpenEndType
OpenEndType
Definition: scheduler.h:127
Scheduler::m_cacheIsSameProgram
IsSameCacheType m_cacheIsSameProgram
Definition: scheduler.h:292
Scheduler::m_error
int m_error
Definition: scheduler.h:276
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:2531
mthread.h
Scheduler::m_livetvTime
QDateTime m_livetvTime
Definition: scheduler.h:281
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:3604
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:3681
Scheduler::m_tvList
QMap< int, EncoderLink * > * m_tvList
Definition: scheduler.h:259
Scheduler::HaveQueuedRequests
bool HaveQueuedRequests(void)
Definition: scheduler.h:233
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:2479
Scheduler::BuildNewRecordsQueries
void BuildNewRecordsQueries(uint recordid, QStringList &from, QStringList &where, MSqlBindings &bindings)
Definition: scheduler.cpp:3812
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:264
Scheduler::FillRecordList
bool FillRecordList(void)
Definition: scheduler.cpp:440
Scheduler::HandleRecordingStatusChange
void HandleRecordingStatusChange(RecordingInfo &ri, RecStatus::Type recStatus, const QString &details)
Definition: scheduler.cpp:2881
SchedInputInfo::~SchedInputInfo
~SchedInputInfo(void)=default
Scheduler::m_schedulingEnabled
bool m_schedulingEnabled
Definition: scheduler.h:256
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:287
idleWaitForRecordingTime
static GlobalSpinBoxSetting * idleWaitForRecordingTime()
Definition: backendsettings.cpp:492
Scheduler::openEndNever
@ openEndNever
Definition: scheduler.h:128
Scheduler::ShutdownServer
void ShutdownServer(std::chrono::seconds prerollseconds, QDateTime &idleSince)
Definition: scheduler.cpp:3347
Scheduler::UpdateMatches
void UpdateMatches(uint recordid, uint sourceid, uint mplexid, const QDateTime &maxstarttime)
Definition: scheduler.cpp:3974
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:5808