MythTV  master
Macros | Enumerations | Functions | Variables
mythtv/programs/mythcommflag/main.cpp File Reference
#include <unistd.h>
#include <sys/time.h>
#include <cstdlib>
#include <cstdio>
#include <ctime>
#include <cmath>
#include <string>
#include <iostream>
#include <fstream>
#include <QCoreApplication>
#include <QString>
#include <QRegExp>
#include <QDir>
#include <QEvent>
#include "mythmiscutil.h"
#include "mythdate.h"
#include "exitcodes.h"
#include "mythcontext.h"
#include "mythdb.h"
#include "mythversion.h"
#include "mythcommflagplayer.h"
#include "programinfo.h"
#include "remoteutil.h"
#include "remotefile.h"
#include "tvremoteutil.h"
#include "jobqueue.h"
#include "remoteencoder.h"
#include "ringbuffer.h"
#include "commandlineparser.h"
#include "mythtranslation.h"
#include "loggingserver.h"
#include "mythlogging.h"
#include "signalhandling.h"
#include "cleanupguard.h"
#include "CommDetectorBase.h"
#include "CommDetectorFactory.h"
#include "SlotRelayer.h"
#include "CustomEventRelayer.h"
Include dependency graph for mythtv/programs/mythcommflag/main.cpp:

Go to the source code of this file.

Macros

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

Enumerations

enum  OutputMethod { kOutputMethodEssentials = 1, kOutputMethodFull }
 

Functions

static QMap< QString, SkipType > * init_skip_types ()
 
static QMap< QString, OutputMethod > * init_output_types ()
 
static QString get_filename (ProgramInfo *program_info)
 
static int QueueCommFlagJob (uint chanid, const QDateTime &starttime, bool rebuild)
 
static int CopySkipListToCutList (uint chanid, const QDateTime &starttime)
 
static int ClearSkipList (uint chanid, const QDateTime &starttime)
 
static int SetCutList (uint chanid, const QDateTime &starttime, QString newCutList)
 
static int GetMarkupList (const QString &list, uint chanid, const QDateTime &starttime)
 
static void streamOutCommercialBreakList (ostream &output, const frm_dir_map_t &commercialBreakList)
 
static void print_comm_flag_output (const ProgramInfo *program_info, const frm_dir_map_t &commBreakList, uint64_t frame_count, const CommDetectorBase *commDetect, const QString &output_filename)
 
static void commDetectorBreathe ()
 
static void commDetectorStatusUpdate (const QString &status)
 
static void commDetectorGotNewCommercialBreakList (void)
 
static void incomingCustomEvent (QEvent *e)
 
static int DoFlagCommercials (ProgramInfo *program_info, bool showPercentage, bool fullSpeed, int jobid, MythCommFlagPlayer *cfp, SkipType commDetectMethod, const QString &outputfilename, bool useDB)
 
static qint64 GetFileSize (ProgramInfo *program_info)
 
static bool DoesFileExist (ProgramInfo *program_info)
 
static void UpdateFileSize (ProgramInfo *program_info)
 
static bool IsMarked (uint chanid, const QDateTime &starttime)
 
static int FlagCommercials (ProgramInfo *program_info, int jobid, const QString &outputfilename, bool useDB, bool fullSpeed)
 
static int FlagCommercials (uint chanid, const QDateTime &starttime, int jobid, const QString &outputfilename, bool fullSpeed)
 
static int FlagCommercials (const QString &filename, int jobid, const QString &outputfilename, bool useDB, bool fullSpeed)
 
static int RebuildSeekTable (ProgramInfo *pginfo, int jobid, bool writefile=false)
 
static int RebuildSeekTable (const QString &filename, int jobid, bool writefile=false)
 
static int RebuildSeekTable (uint chanid, const QDateTime &starttime, int jobid, bool writefile=false)
 
int main (int argc, char *argv[])
 

Variables

int quiet = 0
 
bool progress = true
 
bool force = false
 
MythCommFlagCommandLineParser cmdline
 
bool watchingRecording = false
 
CommDetectorBasecommDetector = nullptr
 
RemoteEncoderrecorder = nullptr
 
ProgramInfoglobal_program_info = nullptr
 
int recorderNum = -1
 
int jobID = -1
 
int lastCmd = -1
 
QMap< QString, SkipType > * skipTypes = init_skip_types()
 
OutputMethod outputMethod = kOutputMethodEssentials
 
QMap< QString, OutputMethod > * outputTypes = init_output_types()
 

Macro Definition Documentation

◆ LOC

#define LOC   QString("MythCommFlag: ")

Definition at line 52 of file mythtv/programs/mythcommflag/main.cpp.

◆ LOC_WARN

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

Definition at line 53 of file mythtv/programs/mythcommflag/main.cpp.

◆ LOC_ERR

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

Definition at line 54 of file mythtv/programs/mythcommflag/main.cpp.

Enumeration Type Documentation

◆ OutputMethod

Enumerator
kOutputMethodEssentials 
kOutputMethodFull 

Definition at line 105 of file mythtv/programs/mythcommflag/main.cpp.

Function Documentation

◆ init_skip_types()

static QMap< QString, SkipType > * init_skip_types ( void  )
static

Definition at line 84 of file mythtv/programs/mythcommflag/main.cpp.

◆ init_output_types()

static QMap< QString, OutputMethod > * init_output_types ( void  )
static

Definition at line 115 of file mythtv/programs/mythcommflag/main.cpp.

◆ get_filename()

static QString get_filename ( ProgramInfo program_info)
static

◆ QueueCommFlagJob()

static int QueueCommFlagJob ( uint  chanid,
const QDateTime &  starttime,
bool  rebuild 
)
static

Definition at line 131 of file mythtv/programs/mythcommflag/main.cpp.

Referenced by main().

◆ CopySkipListToCutList()

static int CopySkipListToCutList ( uint  chanid,
const QDateTime &  starttime 
)
static

Definition at line 180 of file mythtv/programs/mythcommflag/main.cpp.

Referenced by main().

◆ ClearSkipList()

static int ClearSkipList ( uint  chanid,
const QDateTime &  starttime 
)
static

Definition at line 207 of file mythtv/programs/mythcommflag/main.cpp.

Referenced by main().

◆ SetCutList()

static int SetCutList ( uint  chanid,
const QDateTime &  starttime,
QString  newCutList 
)
static

Definition at line 228 of file mythtv/programs/mythcommflag/main.cpp.

Referenced by main().

◆ GetMarkupList()

static int GetMarkupList ( const QString &  list,
uint  chanid,
const QDateTime &  starttime 
)
static

Definition at line 261 of file mythtv/programs/mythcommflag/main.cpp.

Referenced by main().

◆ streamOutCommercialBreakList()

static void streamOutCommercialBreakList ( ostream &  output,
const frm_dir_map_t commercialBreakList 
)
static

Definition at line 320 of file mythtv/programs/mythcommflag/main.cpp.

Referenced by print_comm_flag_output().

◆ print_comm_flag_output()

static void print_comm_flag_output ( const ProgramInfo program_info,
const frm_dir_map_t commBreakList,
uint64_t  frame_count,
const CommDetectorBase commDetect,
const QString &  output_filename 
)
static

Definition at line 345 of file mythtv/programs/mythcommflag/main.cpp.

Referenced by DoFlagCommercials().

◆ commDetectorBreathe()

static void commDetectorBreathe ( )
static

Definition at line 394 of file mythtv/programs/mythcommflag/main.cpp.

Referenced by DoFlagCommercials().

◆ commDetectorStatusUpdate()

static void commDetectorStatusUpdate ( const QString &  status)
static

Definition at line 433 of file mythtv/programs/mythcommflag/main.cpp.

Referenced by DoFlagCommercials().

◆ commDetectorGotNewCommercialBreakList()

static void commDetectorGotNewCommercialBreakList ( void  )
static

Definition at line 442 of file mythtv/programs/mythcommflag/main.cpp.

Referenced by DoFlagCommercials().

◆ incomingCustomEvent()

static void incomingCustomEvent ( QEvent *  e)
static

Definition at line 468 of file mythtv/programs/mythcommflag/main.cpp.

Referenced by DoFlagCommercials().

◆ DoFlagCommercials()

static int DoFlagCommercials ( ProgramInfo program_info,
bool  showPercentage,
bool  fullSpeed,
int  jobid,
MythCommFlagPlayer cfp,
SkipType  commDetectMethod,
const QString &  outputfilename,
bool  useDB 
)
static

Definition at line 521 of file mythtv/programs/mythcommflag/main.cpp.

Referenced by FlagCommercials().

◆ GetFileSize()

static qint64 GetFileSize ( ProgramInfo program_info)
static

Definition at line 605 of file mythtv/programs/mythcommflag/main.cpp.

Referenced by DoesFileExist(), and UpdateFileSize().

◆ DoesFileExist()

static bool DoesFileExist ( ProgramInfo program_info)
static

Definition at line 627 of file mythtv/programs/mythcommflag/main.cpp.

Referenced by FlagCommercials(), and RebuildSeekTable().

◆ UpdateFileSize()

static void UpdateFileSize ( ProgramInfo program_info)
static

Definition at line 649 of file mythtv/programs/mythcommflag/main.cpp.

Referenced by RebuildSeekTable().

◆ IsMarked()

static bool IsMarked ( uint  chanid,
const QDateTime &  starttime 
)
static

Definition at line 657 of file mythtv/programs/mythcommflag/main.cpp.

Referenced by main().

◆ FlagCommercials() [1/3]

static int FlagCommercials ( ProgramInfo program_info,
int  jobid,
const QString &  outputfilename,
bool  useDB,
bool  fullSpeed 
)
static

Definition at line 711 of file mythtv/programs/mythcommflag/main.cpp.

Referenced by FlagCommercials(), and main().

◆ FlagCommercials() [2/3]

static int FlagCommercials ( uint  chanid,
const QDateTime &  starttime,
int  jobid,
const QString &  outputfilename,
bool  fullSpeed 
)
static

Definition at line 932 of file mythtv/programs/mythcommflag/main.cpp.

◆ FlagCommercials() [3/3]

static int FlagCommercials ( const QString &  filename,
int  jobid,
const QString &  outputfilename,
bool  useDB,
bool  fullSpeed 
)
static

Definition at line 973 of file mythtv/programs/mythcommflag/main.cpp.

◆ RebuildSeekTable() [1/3]

static int RebuildSeekTable ( ProgramInfo pginfo,
int  jobid,
bool  writefile = false 
)
static

Definition at line 988 of file mythtv/programs/mythcommflag/main.cpp.

Referenced by main(), and RebuildSeekTable().

◆ RebuildSeekTable() [2/3]

static int RebuildSeekTable ( const QString &  filename,
int  jobid,
bool  writefile = false 
)
static

Definition at line 1053 of file mythtv/programs/mythcommflag/main.cpp.

◆ RebuildSeekTable() [3/3]

static int RebuildSeekTable ( uint  chanid,
const QDateTime &  starttime,
int  jobid,
bool  writefile = false 
)
static

Definition at line 1064 of file mythtv/programs/mythcommflag/main.cpp.

◆ main()

int main ( int  argc,
char *  argv[] 
)

Definition at line 1079 of file mythtv/programs/mythcommflag/main.cpp.

Variable Documentation

◆ quiet

int quiet = 0

◆ progress

bool progress = true

◆ force

bool force = false

◆ cmdline

◆ watchingRecording

bool watchingRecording = false

Definition at line 72 of file mythtv/programs/mythcommflag/main.cpp.

Referenced by FlagCommercials(), and incomingCustomEvent().

◆ commDetector

CommDetectorBase* commDetector = nullptr

◆ recorder

RemoteEncoder* recorder = nullptr

◆ global_program_info

ProgramInfo* global_program_info = nullptr

◆ recorderNum

int recorderNum = -1

Definition at line 76 of file mythtv/programs/mythcommflag/main.cpp.

Referenced by FlagCommercials(), and incomingCustomEvent().

◆ jobID

int jobID = -1

◆ lastCmd

int lastCmd = -1

Definition at line 79 of file mythtv/programs/mythcommflag/main.cpp.

Referenced by commDetectorBreathe().

◆ skipTypes

QMap<QString,SkipType>* skipTypes = init_skip_types()

Definition at line 82 of file mythtv/programs/mythcommflag/main.cpp.

Referenced by FlagCommercials().

◆ outputMethod

Definition at line 110 of file mythtv/programs/mythcommflag/main.cpp.

Referenced by DoFlagCommercials(), and main().

◆ outputTypes

QMap<QString,OutputMethod>* outputTypes = init_output_types()

Definition at line 113 of file mythtv/programs/mythcommflag/main.cpp.

Referenced by main().