Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add a RecStatusToString method to the DVR class. This may be replaced…

… with a better approach later so I'm not bumping the service version.
  • Loading branch information...
commit feb008bce33f356d06fdc17ff5e94b1d89e51971 1 parent ecfc2f9
@stuartm stuartm authored
View
4 mythtv/libs/libmyth/programtypes.cpp
@@ -81,7 +81,7 @@ QString toUIState(RecStatusType recstatus)
return "warning";
}
-/// \brief Converts "recstatus" into a human readable string.
+/// \brief Converts "recstatus" into a short (unreadable) string.
QString toString(RecStatusType recstatus, uint id)
{
QString ret = "-";
@@ -172,7 +172,7 @@ QString toString(RecStatusType recstatus, uint id)
return (ret.isEmpty()) ? QString("-") : ret;
}
-/// \brief Converts "recstatus" into a short human readable description.
+/// \brief Converts "recstatus" into a human readable string
QString toString(RecStatusType recstatus, RecordingType rectype)
{
if (recstatus == rsUnknown && rectype == kNotRecording)
View
2  mythtv/libs/libmyth/programtypes.h
@@ -238,7 +238,7 @@ typedef enum RecStatusTypes {
} RecStatusType; // note stored in int8_t in ProgramInfo
MPUBLIC QString toUIState(RecStatusType);
MPUBLIC QString toString(RecStatusType, uint id);
-MPUBLIC QString toString(RecStatusType, RecordingType);
+MPUBLIC QString toString(RecStatusType, RecordingType type = kNotRecording);
MPUBLIC QString toDescription(RecStatusType, RecordingType,
const QDateTime &recstartts);
View
2  mythtv/libs/libmythservicecontracts/services/dvrServices.h
@@ -195,6 +195,8 @@ class SERVICE_PUBLIC DvrServices : public Service //, public QScriptable ???
virtual bool DisableRecordSchedule ( uint RecordId ) = 0;
+ virtual QString RecStatusToString ( int RecStatus ) = 0;
+
};
#endif
View
5 mythtv/programs/mythbackend/services/dvr.cpp
@@ -938,3 +938,8 @@ bool Dvr::DisableRecordSchedule( uint nRecordId )
return bResult;
}
+QString Dvr::RecStatusToString(int RecStatus)
+{
+ RecStatusType type = static_cast<RecStatusType>(RecStatus);
+ return toString(type);
+}
View
7 mythtv/programs/mythbackend/services/dvr.h
@@ -172,6 +172,8 @@ class Dvr : public DvrServices
bool EnableRecordSchedule ( uint RecordId );
bool DisableRecordSchedule( uint RecordId );
+
+ QString RecStatusToString ( int RecStatus );
};
// --------------------------------------------------------------------------
@@ -327,6 +329,11 @@ class ScriptableDvr : public QObject
return m_obj.DisableRecordSchedule(RecordId);
}
+ QString RecStatusToString( int RecStatus )
+ {
+ return m_obj.RecStatusToString(RecStatus);
+ }
+
};
Q_SCRIPT_DECLARE_QMETAOBJECT( ScriptableDvr, QObject*);
Please sign in to comment.
Something went wrong with that request. Please try again.