#include <scheduler.h>
Definition at line 34 of file scheduler.h.
Public Member Functions | |
| Scheduler (bool runthread, QMap< int, EncoderLink * > *tvList, QString recordTbl="record", Scheduler *master_sched=NULL) | |
| ~Scheduler () | |
| void | SetExpirer (AutoExpire *autoExpirer) |
| void | Reschedule (int recordid) |
| void | AddRecording (const ProgramInfo &) |
| void | FillRecordListFromDB (int recordid=-1) |
| void | FillRecordListFromMaster (void) |
| void | UpdateRecStatus (ProgramInfo *pginfo) |
| void | UpdateRecStatus (int cardid, const QString &chanid, const QDateTime &startts, RecStatusType recstatus, const QDateTime &recendts) |
| bool | getAllPending (RecList *retList) |
| void | getAllPending (QStringList &strList) |
| void | getAllScheduled (QStringList &strList) |
| void | getConflicting (ProgramInfo *pginfo, QStringList &strlist) |
| void | getConflicting (ProgramInfo *pginfo, RecList *retlist) |
| void | PrintList (bool onlyFutureRecordings=false) |
| void | PrintList (RecList &list, bool onlyFutureRecordings=false) |
| void | PrintRec (const ProgramInfo *p, const char *prefix=NULL) |
| void | SetMainServer (MainServer *ms) |
| void | SlaveConnected (ProgramList &slavelist) |
| void | SlaveDisconnected (int cardid) |
| void | DisableScheduling (void) |
| void | EnableScheduling (void) |
| void | GetNextLiveTVDir (int cardid) |
| void | ResetIdleTime (void) |
Protected Member Functions | |
| void | RunScheduler (void) |
Static Protected Member Functions | |
| static void * | SchedulerThread (void *param) |
Private Types | |
| typedef pair< const ProgramInfo *, const ProgramInfo * > | IsSameKey |
| typedef QMap< IsSameKey, bool > | IsSameCacheType |
Private Member Functions | |
| void | verifyCards (void) |
| bool | FillRecordList (void) |
| void | UpdateMatches (int recordid) |
| void | UpdateManuals (int recordid) |
| void | BuildWorkList (void) |
| bool | ClearWorkList (void) |
| void | AddNewRecords (void) |
| void | AddNotListed (void) |
| void | BuildNewRecordsQueries (int recordid, QStringList &from, QStringList &where, MSqlBindings &bindings) |
| void | PruneOverlaps (void) |
| void | BuildListMaps (void) |
| void | ClearListMaps (void) |
| bool | IsBusyRecording (const ProgramInfo *rcinfo) |
| bool | IsSameProgram (const ProgramInfo *a, const ProgramInfo *b) const |
| bool | FindNextConflict (const RecList &cardlist, const ProgramInfo *p, RecConstIter &iter, bool openEnd=false) const |
| const ProgramInfo * | FindConflict (const QMap< int, RecList > &reclists, const ProgramInfo *p, bool openEnd=false) const |
| void | MarkOtherShowings (ProgramInfo *p) |
| void | MarkShowingsList (RecList &showinglist, ProgramInfo *p) |
| void | BackupRecStatus (void) |
| void | RestoreRecStatus (void) |
| bool | TryAnotherShowing (ProgramInfo *p, bool samePriority, bool preserveLive=false) |
| void | SchedNewRecords (void) |
| void | MoveHigherRecords (bool move_this=true) |
| void | SchedPreserveLiveTV (void) |
| void | PruneRedundants (void) |
| void | UpdateNextRecord (void) |
| bool | ChangeRecordingEnd (ProgramInfo *oldp, ProgramInfo *newp) |
| void | findAllScheduledPrograms (RecList &proglist) |
| bool | CheckShutdownServer (int prerollseconds, QDateTime &idleSince, bool &blockShutdown) |
| void | ShutdownServer (int prerollseconds, QDateTime &idleSince) |
| bool | WasStartedAutomatically () |
| int | FillRecordingDir (ProgramInfo *pginfo, RecList &reclist) |
| void | FillDirectoryInfoCache (bool force=false) |
Private Attributes | |
| QString | recordTable |
| QString | priorityTable |
| QValueList< int > | reschedQueue |
| QMutex | reschedLock |
| QMutex | recordmatchLock |
| QWaitCondition | reschedWait |
| RecList | reclist |
| RecList | worklist |
| RecList | retrylist |
| QMap< int, RecList > | cardlistmap |
| QMap< int, RecList > | recordidlistmap |
| QMap< QString, RecList > | titlelistmap |
| InputGroupMap | igrp |
| QMutex * | reclist_lock |
| bool | reclist_changed |
| bool | specsched |
| bool | schedMoveHigher |
| bool | schedulingEnabled |
| QMap< int, bool > | schedAfterStartMap |
| QMap< int, EncoderLink * > * | m_tvList |
| AutoExpire * | expirer |
| QMap< QString, bool > | recPendingList |
| pthread_t | schedThread |
| bool | threadrunning |
| MainServer * | m_mainServer |
| QMutex | resetIdleTime_lock |
| bool | resetIdleTime |
| bool | m_isShuttingDown |
| MSqlQueryInfo | dbConn |
| QDateTime | fsInfoCacheFillTime |
| QMap< QString, FileSystemInfo > | fsInfoCache |
| QDateTime | livetvTime |
| int | livetvpriority |
| int | prefinputpri |
| QMap< QString, bool > | hasLaterList |
| IsSameCacheType | cache_is_same_program |
typedef pair<const ProgramInfo*,const ProgramInfo*> Scheduler::IsSameKey [private] |
Definition at line 178 of file scheduler.h.
typedef QMap<IsSameKey,bool> Scheduler::IsSameCacheType [private] |
Definition at line 179 of file scheduler.h.
| Scheduler::Scheduler | ( | bool | runthread, | |
| QMap< int, EncoderLink * > * | tvList, | |||
| QString | recordTbl = "record", |
|||
| Scheduler * | master_sched = NULL | |||
| ) |
Definition at line 43 of file scheduler.cpp.
| Scheduler::~Scheduler | ( | ) |
Definition at line 100 of file scheduler.cpp.
| void Scheduler::SetExpirer | ( | AutoExpire * | autoExpirer | ) | [inline] |
| void Scheduler::Reschedule | ( | int | recordid | ) |
Definition at line 1413 of file scheduler.cpp.
Referenced by MainServer::connectionClosed(), MainServer::customEvent(), MainServer::HandleAnnounce(), MainServer::HandleFreeTuner(), MainServer::HandleLockTuner(), MainServer::HandleRescheduleRecordings(), and RunScheduler().
| void Scheduler::AddRecording | ( | const ProgramInfo & | pi | ) |
| void Scheduler::FillRecordListFromDB | ( | int | recordid = -1 |
) |
| recordid | Record ID of recording that has changed, or -1 if anything might have been changed. |
Definition at line 353 of file scheduler.cpp.
Referenced by MainServer::HandleGetPendingRecordings(), and main().
| void Scheduler::FillRecordListFromMaster | ( | void | ) |
| void Scheduler::UpdateRecStatus | ( | ProgramInfo * | pginfo | ) |
Definition at line 483 of file scheduler.cpp.
Referenced by MainServer::customEvent(), MainServer::DoHandleDeleteRecording(), and MainServer::DoHandleStopRecording().
| void Scheduler::UpdateRecStatus | ( | int | cardid, | |
| const QString & | chanid, | |||
| const QDateTime & | startts, | |||
| RecStatusType | recstatus, | |||
| const QDateTime & | recendts | |||
| ) |
Definition at line 504 of file scheduler.cpp.
Definition at line 1359 of file scheduler.cpp.
Referenced by HttpStatus::FillStatusXML(), getAllPending(), MythXML::GetProgramDetails(), MythXML::GetProgramGuide(), MythXML::GetRecorded(), MainServer::HandleGetPendingRecordings(), MainServer::HandleQueryRecordings(), and Scheduler().
| void Scheduler::getAllPending | ( | QStringList & | strList | ) |
Definition at line 1379 of file scheduler.cpp.
| void Scheduler::getAllScheduled | ( | QStringList & | strList | ) |
Definition at line 1396 of file scheduler.cpp.
Referenced by MainServer::HandleGetScheduledRecordings().
| void Scheduler::getConflicting | ( | ProgramInfo * | pginfo, | |
| QStringList & | strlist | |||
| ) |
Definition at line 1331 of file scheduler.cpp.
Referenced by MainServer::HandleGetConflictingRecordings().
| void Scheduler::getConflicting | ( | ProgramInfo * | pginfo, | |
| RecList * | retlist | |||
| ) |
Definition at line 1347 of file scheduler.cpp.
| void Scheduler::PrintList | ( | bool | onlyFutureRecordings = false |
) | [inline] |
Definition at line 428 of file scheduler.cpp.
| void Scheduler::PrintRec | ( | const ProgramInfo * | p, | |
| const char * | prefix = NULL | |||
| ) |
Definition at line 455 of file scheduler.cpp.
Referenced by MoveHigherRecords(), PrintList(), SchedNewRecords(), and TryAnotherShowing().
| void Scheduler::SetMainServer | ( | MainServer * | ms | ) |
| void Scheduler::SlaveConnected | ( | ProgramList & | slavelist | ) |
| void Scheduler::SlaveDisconnected | ( | int | cardid | ) |
| void Scheduler::DisableScheduling | ( | void | ) | [inline] |
| void Scheduler::EnableScheduling | ( | void | ) | [inline] |
Definition at line 72 of file scheduler.h.
| void Scheduler::GetNextLiveTVDir | ( | int | cardid | ) |
| void Scheduler::ResetIdleTime | ( | void | ) |
| void Scheduler::RunScheduler | ( | void | ) | [protected] |
| void * Scheduler::SchedulerThread | ( | void * | param | ) | [static, protected] |
| void Scheduler::verifyCards | ( | void | ) | [private] |
| bool Scheduler::FillRecordList | ( | void | ) | [private] |
Definition at line 308 of file scheduler.cpp.
Referenced by FillRecordListFromDB(), and RunScheduler().
| void Scheduler::UpdateMatches | ( | int | recordid | ) | [private] |
Definition at line 2325 of file scheduler.cpp.
Referenced by FillRecordListFromDB(), and RunScheduler().
| void Scheduler::UpdateManuals | ( | int | recordid | ) | [private] |
| void Scheduler::BuildWorkList | ( | void | ) | [private] |
| bool Scheduler::ClearWorkList | ( | void | ) | [private] |
| void Scheduler::AddNewRecords | ( | void | ) | [private] |
| void Scheduler::AddNotListed | ( | void | ) | [private] |
| void Scheduler::BuildNewRecordsQueries | ( | int | recordid, | |
| QStringList & | from, | |||
| QStringList & | where, | |||
| MSqlBindings & | bindings | |||
| ) | [private] |
| void Scheduler::PruneOverlaps | ( | void | ) | [private] |
| void Scheduler::BuildListMaps | ( | void | ) | [private] |
| void Scheduler::ClearListMaps | ( | void | ) | [private] |
| bool Scheduler::IsBusyRecording | ( | const ProgramInfo * | rcinfo | ) | [private] |
| bool Scheduler::IsSameProgram | ( | const ProgramInfo * | a, | |
| const ProgramInfo * | b | |||
| ) | const [private] |
Definition at line 780 of file scheduler.cpp.
Referenced by MarkShowingsList(), and TryAnotherShowing().
| bool Scheduler::FindNextConflict | ( | const RecList & | cardlist, | |
| const ProgramInfo * | p, | |||
| RecConstIter & | iter, | |||
| bool | openEnd = false | |||
| ) | const [private] |
Definition at line 796 of file scheduler.cpp.
Referenced by FindConflict(), getConflicting(), MoveHigherRecords(), and TryAnotherShowing().
| const ProgramInfo * Scheduler::FindConflict | ( | const QMap< int, RecList > & | reclists, | |
| const ProgramInfo * | p, | |||
| bool | openEnd = false | |||
| ) | const [private] |
Definition at line 873 of file scheduler.cpp.
Referenced by SchedNewRecords(), and TryAnotherShowing().
| void Scheduler::MarkOtherShowings | ( | ProgramInfo * | p | ) | [private] |
Definition at line 900 of file scheduler.cpp.
Referenced by MoveHigherRecords(), SchedNewRecords(), and TryAnotherShowing().
| void Scheduler::MarkShowingsList | ( | RecList & | showinglist, | |
| ProgramInfo * | p | |||
| ) | [private] |
| void Scheduler::BackupRecStatus | ( | void | ) | [private] |
| void Scheduler::RestoreRecStatus | ( | void | ) | [private] |
| bool Scheduler::TryAnotherShowing | ( | ProgramInfo * | p, | |
| bool | samePriority, | |||
| bool | preserveLive = false | |||
| ) | [private] |
| void Scheduler::SchedNewRecords | ( | void | ) | [private] |
| void Scheduler::MoveHigherRecords | ( | bool | move_this = true |
) | [private] |
Definition at line 1138 of file scheduler.cpp.
Referenced by SchedNewRecords(), and SchedPreserveLiveTV().
| void Scheduler::SchedPreserveLiveTV | ( | void | ) | [private] |
| void Scheduler::PruneRedundants | ( | void | ) | [private] |
| void Scheduler::UpdateNextRecord | ( | void | ) | [private] |
| bool Scheduler::ChangeRecordingEnd | ( | ProgramInfo * | oldp, | |
| ProgramInfo * | newp | |||
| ) | [private] |
| void Scheduler::findAllScheduledPrograms | ( | RecList & | proglist | ) | [private] |
| void Scheduler::ShutdownServer | ( | int | prerollseconds, | |
| QDateTime & | idleSince | |||
| ) | [private] |
| bool Scheduler::WasStartedAutomatically | ( | ) | [private] |
| int Scheduler::FillRecordingDir | ( | ProgramInfo * | pginfo, | |
| RecList & | reclist | |||
| ) | [private] |
Definition at line 3285 of file scheduler.cpp.
Referenced by GetNextLiveTVDir(), and RunScheduler().
| void Scheduler::FillDirectoryInfoCache | ( | bool | force = false |
) | [private] |
QString Scheduler::recordTable [private] |
Definition at line 81 of file scheduler.h.
Referenced by AddNewRecords(), AddNotListed(), BuildNewRecordsQueries(), findAllScheduledPrograms(), Scheduler(), UpdateManuals(), and UpdateMatches().
QString Scheduler::priorityTable [private] |
QValueList<int> Scheduler::reschedQueue [private] |
QMutex Scheduler::reschedLock [private] |
QMutex Scheduler::recordmatchLock [private] |
Definition at line 134 of file scheduler.h.
Referenced by FillRecordListFromDB(), and RunScheduler().
QWaitCondition Scheduler::reschedWait [private] |
RecList Scheduler::reclist [private] |
Definition at line 136 of file scheduler.h.
Referenced by AddRecording(), BuildWorkList(), ChangeRecordingEnd(), ClearWorkList(), FillRecordListFromDB(), FillRecordListFromMaster(), getAllPending(), getConflicting(), GetNextLiveTVDir(), PrintList(), RunScheduler(), Scheduler(), ShutdownServer(), SlaveConnected(), SlaveDisconnected(), UpdateNextRecord(), UpdateRecStatus(), and ~Scheduler().
RecList Scheduler::worklist [private] |
Definition at line 137 of file scheduler.h.
Referenced by AddNewRecords(), AddNotListed(), BackupRecStatus(), BuildListMaps(), BuildWorkList(), ClearWorkList(), FillRecordList(), PruneOverlaps(), PruneRedundants(), RestoreRecStatus(), SchedNewRecords(), and ~Scheduler().
RecList Scheduler::retrylist [private] |
Definition at line 138 of file scheduler.h.
Referenced by MoveHigherRecords(), SchedNewRecords(), SchedPreserveLiveTV(), and TryAnotherShowing().
QMap<int, RecList> Scheduler::cardlistmap [private] |
Definition at line 139 of file scheduler.h.
Referenced by BuildListMaps(), ClearListMaps(), MoveHigherRecords(), SchedNewRecords(), and TryAnotherShowing().
QMap<int, RecList> Scheduler::recordidlistmap [private] |
Definition at line 140 of file scheduler.h.
Referenced by BuildListMaps(), ClearListMaps(), MarkOtherShowings(), and TryAnotherShowing().
QMap<QString, RecList> Scheduler::titlelistmap [private] |
Definition at line 141 of file scheduler.h.
Referenced by BuildListMaps(), ClearListMaps(), MarkOtherShowings(), and TryAnotherShowing().
InputGroupMap Scheduler::igrp [private] |
Definition at line 142 of file scheduler.h.
Referenced by FindNextConflict(), IsBusyRecording(), and TryAnotherShowing().
QMutex* Scheduler::reclist_lock [private] |
Definition at line 144 of file scheduler.h.
Referenced by AddRecording(), BuildWorkList(), ChangeRecordingEnd(), ClearWorkList(), FillRecordListFromMaster(), getAllPending(), getConflicting(), GetNextLiveTVDir(), RunScheduler(), Scheduler(), SlaveConnected(), SlaveDisconnected(), UpdateRecStatus(), and ~Scheduler().
bool Scheduler::reclist_changed [private] |
Definition at line 145 of file scheduler.h.
Referenced by AddRecording(), BuildWorkList(), ChangeRecordingEnd(), ClearWorkList(), SlaveConnected(), SlaveDisconnected(), and UpdateRecStatus().
bool Scheduler::specsched [private] |
Definition at line 147 of file scheduler.h.
Referenced by AddNewRecords(), ChangeRecordingEnd(), Scheduler(), and UpdateNextRecord().
bool Scheduler::schedMoveHigher [private] |
Definition at line 148 of file scheduler.h.
Referenced by FillRecordList(), and MoveHigherRecords().
bool Scheduler::schedulingEnabled [private] |
Definition at line 149 of file scheduler.h.
Referenced by DisableScheduling(), EnableScheduling(), RunScheduler(), and Scheduler().
QMap<int, bool> Scheduler::schedAfterStartMap [private] |
QMap<int, EncoderLink *>* Scheduler::m_tvList [private] |
Definition at line 152 of file scheduler.h.
Referenced by AddNewRecords(), FillDirectoryInfoCache(), IsBusyRecording(), RunScheduler(), SchedPreserveLiveTV(), and Scheduler().
AutoExpire* Scheduler::expirer [private] |
Definition at line 153 of file scheduler.h.
Referenced by FillRecordingDir(), GetNextLiveTVDir(), RunScheduler(), Scheduler(), and SetExpirer().
QMap<QString, bool> Scheduler::recPendingList [private] |
pthread_t Scheduler::schedThread [private] |
bool Scheduler::threadrunning [private] |
Definition at line 158 of file scheduler.h.
Referenced by AddNewRecords(), Scheduler(), and ~Scheduler().
MainServer* Scheduler::m_mainServer [private] |
Definition at line 160 of file scheduler.h.
Referenced by RunScheduler(), Scheduler(), SetMainServer(), and ShutdownServer().
QMutex Scheduler::resetIdleTime_lock [private] |
bool Scheduler::resetIdleTime [private] |
Definition at line 163 of file scheduler.h.
Referenced by ResetIdleTime(), RunScheduler(), and Scheduler().
bool Scheduler::m_isShuttingDown [private] |
Definition at line 165 of file scheduler.h.
Referenced by RunScheduler(), Scheduler(), and ShutdownServer().
MSqlQueryInfo Scheduler::dbConn [private] |
Definition at line 166 of file scheduler.h.
Referenced by AddNewRecords(), AddNotListed(), BuildNewRecordsQueries(), FillRecordListFromDB(), RunScheduler(), Scheduler(), UpdateManuals(), UpdateMatches(), UpdateNextRecord(), and verifyCards().
QDateTime Scheduler::fsInfoCacheFillTime [private] |
Definition at line 168 of file scheduler.h.
Referenced by FillDirectoryInfoCache(), RunScheduler(), and Scheduler().
QMap<QString, FileSystemInfo> Scheduler::fsInfoCache [private] |
Definition at line 169 of file scheduler.h.
Referenced by FillDirectoryInfoCache(), and FillRecordingDir().
QDateTime Scheduler::livetvTime [private] |
Definition at line 172 of file scheduler.h.
Referenced by RunScheduler(), SchedNewRecords(), and SchedPreserveLiveTV().
int Scheduler::livetvpriority [private] |
Definition at line 173 of file scheduler.h.
Referenced by SchedPreserveLiveTV(), and TryAnotherShowing().
int Scheduler::prefinputpri [private] |
QMap<QString, bool> Scheduler::hasLaterList [private] |
IsSameCacheType Scheduler::cache_is_same_program [mutable, private] |
1.5.5