MythTV  master
Macros | Functions | Variables
scheduler.cpp File Reference
#include <iostream>
#include <algorithm>
#include <list>
#include <chrono>
#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 <QRegExp>
#include <QMutex>
#include <QFile>
#include <QMap>
#include "mythmiscutil.h"
#include "mythsystemlegacy.h"
#include "scheduler.h"
#include "encoderlink.h"
#include "mainserver.h"
#include "remoteutil.h"
#include "mythdate.h"
#include "exitcodes.h"
#include "mythcontext.h"
#include "mythdb.h"
#include "compat.h"
#include "storagegroup.h"
#include "recordinginfo.h"
#include "recordingrule.h"
#include "scheduledrecording.h"
#include "cardutil.h"
#include "mythsystemevent.h"
#include "mythlogging.h"
#include "tv_rec.h"
#include "jobqueue.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

bool debugConflicts = false
 
static QString progdupinit
 
static QString progfindid
 

Macro Definition Documentation

◆ LOC

#define LOC   QString("Scheduler: ")

Definition at line 52 of file scheduler.cpp.

◆ LOC_WARN

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

Definition at line 53 of file scheduler.cpp.

◆ LOC_ERR

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

Definition at line 54 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 372 of file scheduler.cpp.

Referenced by Scheduler::SchedNewRetryPass().

◆ erase_nulls()

static void erase_nulls ( RecList reclist)
static

Definition at line 977 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 4974 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 5011 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 5027 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 5034 of file scheduler.cpp.

Referenced by Scheduler::FillRecordingDir().

Variable Documentation

◆ debugConflicts

bool debugConflicts = false

Definition at line 56 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 3933 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 3942 of file scheduler.cpp.

Referenced by Scheduler::UpdateMatches().