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  LOG(VB_GENERAL, LOG_ERR,
18  QString("Error rescheduling %1 in "
19  "ScheduledRecording::SendReschedule").arg(request[0]));
20  }
21 }
22 
24  uint sourceid, uint mplexid, const QDateTime &maxstarttime,
25  const QString &why)
26 {
27  return QStringList(QString("MATCH %1 %2 %3 %4 %5")
28  .arg(recordid).arg(sourceid).arg(mplexid)
29  .arg(maxstarttime.isValid() ?
30  maxstarttime.toString(Qt::ISODate) :
31  "-")
32  .arg(why));
33 };
34 
36  const QString &why)
37 {
38  return QStringList(QString("CHECK %1 %2 %3 %4")
39  .arg(recinfo.GetRecordingStatus())
40  .arg(recinfo.GetParentRecordingRuleID() ?
41  recinfo.GetParentRecordingRuleID() :
42  recinfo.GetRecordingRuleID())
43  .arg(recinfo.GetFindID())
44  .arg(why))
45  << recinfo.GetTitle()
46  << recinfo.GetSubtitle()
47  << recinfo.GetDescription()
48  << recinfo.GetProgramID();
49 };
50 
51 QStringList ScheduledRecording::BuildPlaceRequest(const QString &why)
52 {
53  return QStringList(QString("PLACE %1").arg(why));
54 };
55 
56 /* vim: set expandtab tabstop=4 shiftwidth=4: */
uint GetParentRecordingRuleID(void) const
Definition: programinfo.h:442
QString GetTitle(void) const
Definition: programinfo.h:353
Holds information on a TV Program one might wish to record.
Definition: recordinginfo.h:34
static void SendReschedule(const QStringList &request)
unsigned int uint
Definition: compat.h:140
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
static QStringList BuildCheckRequest(const RecordingInfo &recinfo, const QString &why)
bool SendReceiveStringList(QStringList &strlist, bool quickTimeout=false, bool block=true)
Send a message to the backend and wait for a response.
static QStringList BuildMatchRequest(uint recordid, uint sourceid, uint mplexid, const QDateTime &maxstarttime, const QString &why)
This class is used as a container for messages.
Definition: mythevent.h:16
QString GetDescription(void) const
Definition: programinfo.h:357
QString GetSubtitle(void) const
Definition: programinfo.h:355
void dispatch(const MythEvent &event)
bool IsBackend(void) const
is this process a backend process
#define LOG(_MASK_, _LEVEL_, _STRING_)
Definition: mythlogging.h:41
RecStatus::Type GetRecordingStatus(void) const
Definition: programinfo.h:439
static QStringList BuildPlaceRequest(const QString &why)
uint GetRecordingRuleID(void) const
Definition: programinfo.h:441
QString GetProgramID(void) const
Definition: programinfo.h:428
uint GetFindID(void) const
Definition: programinfo.h:462
Default UTC.
Definition: mythdate.h:14