MythTV  master
scheduledrecording.cpp
Go to the documentation of this file.
1 #include "scheduledrecording.h"
4 
5 void ScheduledRecording::SendReschedule(const QStringList &request)
6 {
7  if (gCoreContext->IsBackend())
8  {
9  MythEvent me(QString("RESCHEDULE_RECORDINGS"), request);
11  }
12  else
13  {
14  QStringList slist;
15  slist << QString("RESCHEDULE_RECORDINGS");
16  slist << request;
18  {
19  LOG(VB_GENERAL, LOG_ERR,
20  QString("Error rescheduling %1 in "
21  "ScheduledRecording::SendReschedule").arg(request[0]));
22  }
23  }
24 }
25 
27  uint sourceid, uint mplexid, const QDateTime &maxstarttime,
28  const QString &why)
29 {
30  return QStringList(QString("MATCH %1 %2 %3 %4 %5")
31  .arg(recordid).arg(sourceid).arg(mplexid)
32  .arg(maxstarttime.isValid()
33  ? maxstarttime.toString(Qt::ISODate)
34  : "-",
35  why));
36 };
37 
39  const QString &why)
40 {
41  return QStringList(QString("CHECK %1 %2 %3 %4")
42  .arg(recinfo.GetRecordingStatus())
43  .arg(recinfo.GetParentRecordingRuleID() ?
44  recinfo.GetParentRecordingRuleID() :
45  recinfo.GetRecordingRuleID())
46  .arg(recinfo.GetFindID())
47  .arg(why))
48  << recinfo.GetTitle()
49  << recinfo.GetSubtitle()
50  << recinfo.GetDescription()
51  << recinfo.GetProgramID();
52 };
53 
54 QStringList ScheduledRecording::BuildPlaceRequest(const QString &why)
55 {
56  return QStringList(QString("PLACE %1").arg(why));
57 };
58 
59 /* 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:1381
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:16
LOG
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
Definition: mythlogging.h:39
mythlogging.h
ProgramInfo::GetRecordingStatus
RecStatus::Type GetRecordingStatus(void) const
Definition: programinfo.h:451
ProgramInfo::GetTitle
QString GetTitle(void) const
Definition: programinfo.h:362
ProgramInfo::GetDescription
QString GetDescription(void) const
Definition: programinfo.h:366
scheduledrecording.h
ProgramInfo::GetFindID
uint GetFindID(void) const
Definition: programinfo.h:472
gCoreContext
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
Definition: mythcorecontext.cpp:57
ScheduledRecording::BuildMatchRequest
static QStringList BuildMatchRequest(uint recordid, uint sourceid, uint mplexid, const QDateTime &maxstarttime, const QString &why)
Definition: scheduledrecording.cpp:26
ScheduledRecording::BuildPlaceRequest
static QStringList BuildPlaceRequest(const QString &why)
Definition: scheduledrecording.cpp:54
mythcorecontext.h
MythCoreContext::IsBackend
bool IsBackend(void) const
is this process a backend process
Definition: mythcorecontext.cpp:650
MythDate::ISODate
@ ISODate
Default UTC.
Definition: mythdate.h:17
ProgramInfo::GetProgramID
QString GetProgramID(void) const
Definition: programinfo.h:440
ProgramInfo::GetParentRecordingRuleID
uint GetParentRecordingRuleID(void) const
Definition: programinfo.h:454
ProgramInfo::GetRecordingRuleID
uint GetRecordingRuleID(void) const
Definition: programinfo.h:453
ScheduledRecording::BuildCheckRequest
static QStringList BuildCheckRequest(const RecordingInfo &recinfo, const QString &why)
Definition: scheduledrecording.cpp:38
MythCoreContext::dispatch
void dispatch(const MythEvent &event)
Definition: mythcorecontext.cpp:1729
uint
unsigned int uint
Definition: freesurround.h:24
ProgramInfo::GetSubtitle
QString GetSubtitle(void) const
Definition: programinfo.h:364
ScheduledRecording::SendReschedule
static void SendReschedule(const QStringList &request)
Definition: scheduledrecording.cpp:5