MythTV  master
scheduledrecording.cpp
Go to the documentation of this file.
1 #include "scheduledrecording.h"
2 #include "mythcorecontext.h"
3 
4 void ScheduledRecording::SendReschedule(const QStringList &request)
5 {
6  if (gCoreContext->IsBackend())
7  {
8  MythEvent me(QString("RESCHEDULE_RECORDINGS"), request);
10  }
11  else
12  {
13  QStringList slist;
14  slist << QString("RESCHEDULE_RECORDINGS");
15  slist << request;
17  {
18  LOG(VB_GENERAL, LOG_ERR,
19  QString("Error rescheduling %1 in "
20  "ScheduledRecording::SendReschedule").arg(request[0]));
21  }
22  }
23 }
24 
26  uint sourceid, uint mplexid, const QDateTime &maxstarttime,
27  const QString &why)
28 {
29  return QStringList(QString("MATCH %1 %2 %3 %4 %5")
30  .arg(recordid).arg(sourceid).arg(mplexid)
31  .arg(maxstarttime.isValid() ?
32  maxstarttime.toString(Qt::ISODate) :
33  "-")
34  .arg(why));
35 };
36 
38  const QString &why)
39 {
40  return QStringList(QString("CHECK %1 %2 %3 %4")
41  .arg(recinfo.GetRecordingStatus())
42  .arg(recinfo.GetParentRecordingRuleID() ?
43  recinfo.GetParentRecordingRuleID() :
44  recinfo.GetRecordingRuleID())
45  .arg(recinfo.GetFindID())
46  .arg(why))
47  << recinfo.GetTitle()
48  << recinfo.GetSubtitle()
49  << recinfo.GetDescription()
50  << recinfo.GetProgramID();
51 };
52 
53 QStringList ScheduledRecording::BuildPlaceRequest(const QString &why)
54 {
55  return QStringList(QString("PLACE %1").arg(why));
56 };
57 
58 /* vim: set expandtab tabstop=4 shiftwidth=4: */
MythCoreContext::SendReceiveStringList
bool SendReceiveStringList(QStringList &strlist, bool quickTimeout=false, bool block=true)
Send a message to the backend and wait for a response.
Definition: mythcorecontext.cpp:1380
RecordingInfo
Holds information on a TV Program one might wish to record.
Definition: recordinginfo.h:35
MythEvent
This class is used as a container for messages.
Definition: mythevent.h:17
arg
arg(title).arg(filename).arg(doDelete))
LOG
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
Definition: mythlogging.h:23
ProgramInfo::GetRecordingStatus
RecStatus::Type GetRecordingStatus(void) const
Definition: programinfo.h:445
ProgramInfo::GetTitle
QString GetTitle(void) const
Definition: programinfo.h:359
ProgramInfo::GetDescription
QString GetDescription(void) const
Definition: programinfo.h:363
scheduledrecording.h
ProgramInfo::GetFindID
uint GetFindID(void) const
Definition: programinfo.h:468
uint
unsigned int uint
Definition: compat.h:141
gCoreContext
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
Definition: mythcorecontext.cpp:60
ScheduledRecording::BuildMatchRequest
static QStringList BuildMatchRequest(uint recordid, uint sourceid, uint mplexid, const QDateTime &maxstarttime, const QString &why)
Definition: scheduledrecording.cpp:25
ScheduledRecording::BuildPlaceRequest
static QStringList BuildPlaceRequest(const QString &why)
Definition: scheduledrecording.cpp:53
mythcorecontext.h
MythCoreContext::IsBackend
bool IsBackend(void) const
is this process a backend process
Definition: mythcorecontext.cpp:665
MythDate::ISODate
@ ISODate
Default UTC.
Definition: mythdate.h:14
ProgramInfo::GetProgramID
QString GetProgramID(void) const
Definition: programinfo.h:434
ProgramInfo::GetParentRecordingRuleID
uint GetParentRecordingRuleID(void) const
Definition: programinfo.h:448
ProgramInfo::GetRecordingRuleID
uint GetRecordingRuleID(void) const
Definition: programinfo.h:447
ScheduledRecording::BuildCheckRequest
static QStringList BuildCheckRequest(const RecordingInfo &recinfo, const QString &why)
Definition: scheduledrecording.cpp:37
MythCoreContext::dispatch
void dispatch(const MythEvent &event)
Definition: mythcorecontext.cpp:1734
ProgramInfo::GetSubtitle
QString GetSubtitle(void) const
Definition: programinfo.h:361
ScheduledRecording::SendReschedule
static void SendReschedule(const QStringList &request)
Definition: scheduledrecording.cpp:4