MythTV  master
Macros | Functions | Variables
scheduler.cpp File Reference
#include <algorithm>
#include <chrono>
#include <iostream>
#include <list>
#include <thread>
#include <sys/param.h>
#include <sys/stat.h>
#include <sys/time.h>
#include <sys/types.h>
#include <QStringList>
#include <QDateTime>
#include <QString>
#include <QMutex>
#include <QFile>
#include <QMap>
#include "libmyth/mythcontext.h"
#include "libmythbase/compat.h"
#include "libmythbase/exitcodes.h"
#include "libmythbase/mythdate.h"
#include "libmythbase/mythdb.h"
#include "libmythbase/mythlogging.h"
#include "libmythbase/mythmiscutil.h"
#include "libmythbase/mythsystemlegacy.h"
#include "libmythbase/remoteutil.h"
#include "libmythbase/storagegroup.h"
#include "libmythtv/cardutil.h"
#include "libmythtv/jobqueue.h"
#include "libmythtv/mythsystemevent.h"
#include "libmythtv/recordinginfo.h"
#include "libmythtv/recordingrule.h"
#include "libmythtv/scheduledrecording.h"
#include "libmythtv/tv_rec.h"
#include "encoderlink.h"
#include "mainserver.h"
#include "recordingextender.h"
#include "scheduler.h"
Include dependency graph for scheduler.cpp:

Go to the source code of this file.

Macros

#define LOC   QString("Scheduler: ")
 
#define LOC_WARN   QString("Scheduler, Warning: ")
 
#define LOC_ERR   QString("Scheduler, Error: ")
 

Functions

static bool Recording (const RecordingInfo *p)
 
static bool comp_overlap (RecordingInfo *a, RecordingInfo *b)
 
static bool comp_redundant (RecordingInfo *a, RecordingInfo *b)
 
static bool comp_recstart (RecordingInfo *a, RecordingInfo *b)
 
static bool comp_priority (RecordingInfo *a, RecordingInfo *b)
 
static bool comp_retry (RecordingInfo *a, RecordingInfo *b)
 
static void erase_nulls (RecList &reclist)
 
static bool comp_storage_combination (FileSystemInfo *a, FileSystemInfo *b)
 
static bool comp_storage_perc_free_space (FileSystemInfo *a, FileSystemInfo *b)
 
static bool comp_storage_free_space (FileSystemInfo *a, FileSystemInfo *b)
 
static bool comp_storage_disk_io (FileSystemInfo *a, FileSystemInfo *b)
 

Variables

static constexpr int64_t kProgramInUseInterval {61LL * 60}
 
bool debugConflicts = false
 
static QString progdupinit
 
static QString progfindid
 

Macro Definition Documentation

◆ LOC

#define LOC   QString("Scheduler: ")

Definition at line 54 of file scheduler.cpp.

◆ LOC_WARN

#define LOC_WARN   QString("Scheduler, Warning: ")

Definition at line 55 of file scheduler.cpp.

◆ LOC_ERR

#define LOC_ERR   QString("Scheduler, Error: ")

Definition at line 56 of file scheduler.cpp.

Function Documentation

◆ Recording()

static bool Recording ( const RecordingInfo p)
inlinestatic

◆ comp_overlap()

static bool comp_overlap ( RecordingInfo a,
RecordingInfo b 
)
static

Definition at line 230 of file scheduler.cpp.

Referenced by Scheduler::FillRecordList().

◆ comp_redundant()

static bool comp_redundant ( RecordingInfo a,
RecordingInfo b 
)
static

Definition at line 272 of file scheduler.cpp.

Referenced by Scheduler::FillRecordList().

◆ comp_recstart()

static bool comp_recstart ( RecordingInfo a,
RecordingInfo b 
)
static

Definition at line 295 of file scheduler.cpp.

Referenced by Scheduler::FillRecordList().

◆ comp_priority()

static bool comp_priority ( RecordingInfo a,
RecordingInfo b 
)
static

Definition at line 312 of file scheduler.cpp.

Referenced by Scheduler::FillRecordList().

◆ comp_retry()

static bool comp_retry ( RecordingInfo a,
RecordingInfo b 
)
static

Definition at line 378 of file scheduler.cpp.

Referenced by Scheduler::SchedNewRetryPass().

◆ erase_nulls()

static void erase_nulls ( RecList reclist)
static

Definition at line 979 of file scheduler.cpp.

Referenced by Scheduler::PruneOverlaps(), and Scheduler::PruneRedundants().

◆ comp_storage_combination()

static bool comp_storage_combination ( FileSystemInfo a,
FileSystemInfo b 
)
static

Definition at line 5088 of file scheduler.cpp.

Referenced by Scheduler::FillRecordingDir().

◆ comp_storage_perc_free_space()

static bool comp_storage_perc_free_space ( FileSystemInfo a,
FileSystemInfo b 
)
static

Definition at line 5125 of file scheduler.cpp.

Referenced by Scheduler::FillRecordingDir().

◆ comp_storage_free_space()

static bool comp_storage_free_space ( FileSystemInfo a,
FileSystemInfo b 
)
static

Definition at line 5141 of file scheduler.cpp.

Referenced by Scheduler::FillRecordingDir().

◆ comp_storage_disk_io()

static bool comp_storage_disk_io ( FileSystemInfo a,
FileSystemInfo b 
)
static

Definition at line 5148 of file scheduler.cpp.

Referenced by Scheduler::FillRecordingDir().

Variable Documentation

◆ kProgramInUseInterval

constexpr int64_t kProgramInUseInterval {61LL * 60}
staticconstexpr

Definition at line 58 of file scheduler.cpp.

Referenced by Scheduler::PutInactiveSlavesToSleep().

◆ debugConflicts

bool debugConflicts = false

Definition at line 60 of file scheduler.cpp.

Referenced by Scheduler::FindNextConflict(), and Scheduler::Scheduler().

◆ progdupinit

QString progdupinit
static
Initial value:
= QString(
"(CASE "
" WHEN RECTABLE.type IN (%1, %2, %3) THEN 0 "
" WHEN RECTABLE.type IN (%4, %5, %6) THEN -1 "
" ELSE (program.generic - 1) "
" END) ")

Definition at line 4011 of file scheduler.cpp.

Referenced by Scheduler::UpdateMatches().

◆ progfindid

QString progfindid
static
Initial value:
= QString(
"(CASE RECTABLE.type "
" WHEN %1 "
" THEN RECTABLE.findid "
" WHEN %2 "
" THEN to_days(date_sub(convert_tz(program.starttime, 'UTC', 'SYSTEM'), "
" interval time_format(RECTABLE.findtime, '%H:%i') hour_minute)) "
" WHEN %3 "
" THEN floor((to_days(date_sub(convert_tz(program.starttime, 'UTC', "
" 'SYSTEM'), interval time_format(RECTABLE.findtime, '%H:%i') "
" hour_minute)) - RECTABLE.findday)/7) * 7 + RECTABLE.findday "
" WHEN %4 "
" THEN RECTABLE.findid "
" ELSE 0 "
" END) ")
.arg(kOneRecord)

Definition at line 4020 of file scheduler.cpp.

Referenced by Scheduler::UpdateMatches().

kWeeklyRecord
@ kWeeklyRecord
Definition: recordingtypes.h:26
kSingleRecord
@ kSingleRecord
Definition: recordingtypes.h:22
kDontRecord
@ kDontRecord
Definition: recordingtypes.h:29
kOneRecord
@ kOneRecord
Definition: recordingtypes.h:27
kOverrideRecord
@ kOverrideRecord
Definition: recordingtypes.h:28
kDailyRecord
@ kDailyRecord
Definition: recordingtypes.h:23