Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Services: Add RecStatusToDescription() and RecTypeToString() methods …

…to DVR
  • Loading branch information...
commit 55614a6ae668ebb6e8292a583d7f60116d11f71b 1 parent 4b60dcd
@stuartm stuartm authored
View
7 mythtv/libs/libmythservicecontracts/services/dvrServices.h
@@ -40,7 +40,7 @@
class SERVICE_PUBLIC DvrServices : public Service //, public QScriptable ???
{
Q_OBJECT
- Q_CLASSINFO( "version" , "2.1" );
+ Q_CLASSINFO( "version" , "2.2" );
Q_CLASSINFO( "RemoveRecordedItem_Method", "POST" )
Q_CLASSINFO( "AddRecordSchedule_Method", "POST" )
Q_CLASSINFO( "RemoveRecordSchedule_Method", "POST" )
@@ -207,6 +207,11 @@ class SERVICE_PUBLIC DvrServices : public Service //, public QScriptable ???
virtual QString RecStatusToString ( int RecStatus ) = 0;
+ virtual QString RecStatusToDescription ( int RecStatus,
+ int RecType,
+ const QDateTime &StartTime ) = 0;
+
+ virtual QString RecTypeToString ( int RecType ) = 0;
};
#endif
View
18 mythtv/programs/mythbackend/services/dvr.cpp
@@ -39,6 +39,8 @@
#include "remoteutil.h"
#include "mythdate.h"
#include "recordinginfo.h"
+#include "programtypes.h"
+#include "recordingtypes.h"
#include "serviceUtil.h"
#include <mythscheduler.h>
@@ -978,3 +980,19 @@ QString Dvr::RecStatusToString(int RecStatus)
RecStatusType type = static_cast<RecStatusType>(RecStatus);
return toString(type);
}
+
+QString Dvr::RecStatusToDescription(int RecStatus, int recType,
+ const QDateTime &StartTime)
+{
+ //if (!StartTime.isValid())
+ // throw QString("StartTime appears invalid.");
+ RecStatusType rsType = static_cast<RecStatusType>(RecStatus);
+ RecordingType recordingType = static_cast<RecordingType>(recType);
+ return toDescription(rsType, recordingType, StartTime);
+}
+
+QString Dvr::RecTypeToString(int recType)
+{
+ RecordingType type = static_cast<RecordingType>(recType);
+ return toString(type);
+}
View
19 mythtv/programs/mythbackend/services/dvr.h
@@ -184,6 +184,12 @@ class Dvr : public DvrServices
bool DisableRecordSchedule( uint RecordId );
QString RecStatusToString ( int RecStatus );
+
+ QString RecStatusToDescription ( int RecStatus,
+ int RecType,
+ const QDateTime &StartTime );
+
+ QString RecTypeToString ( int RecType );
};
// --------------------------------------------------------------------------
@@ -375,6 +381,19 @@ class ScriptableDvr : public QObject
return m_obj.RecStatusToString(RecStatus);
}
+ QString RecStatusToDescription( int RecStatus,
+ int RecType,
+ const QDateTime &StartTime )
+ {
+ return m_obj.RecStatusToDescription(RecStatus,
+ RecType,
+ StartTime );
+ }
+
+ QString RecTypeToString( int RecType )
+ {
+ return m_obj.RecTypeToString( RecType );
+ }
};
Q_SCRIPT_DECLARE_QMETAOBJECT( ScriptableDvr, QObject*);
Please sign in to comment.
Something went wrong with that request. Please try again.