28 :
Eventing(
"MythFEXML",
"MYTHTV_Event", sSharePath),
29 m_sControlUrl(
"/MythFE")
75 LOG(VB_UPNP, LOG_INFO, QString(
"MythFEXML::ProcessRequest: %1 : %2")
108 int nWidth = pRequest->
m_mapParams[
"width" ].toInt();
109 int nHeight = pRequest->
m_mapParams[
"height" ].toInt();
110 QString sFormat = pRequest->
m_mapParams[
"format" ];
112 if (sFormat.isEmpty())
115 if (sFormat !=
"jpg" && sFormat !=
"png")
117 LOG(VB_GENERAL, LOG_ERR,
"Invalid screen shot format: " + sFormat);
121 LOG(VB_GENERAL, LOG_INFO,
122 QString(
"Screen shot requested (%1x%2), format %3")
123 .arg(nWidth).arg(nHeight).arg(sFormat));
125 QString sFileName = QString(
"/%1/myth-screenshot-XML.%2")
135 " <script type =\"text/javascript\">\n"
136 " function postaction(action) {\n"
137 " var myForm = document.createElement(\"form\");\n"
138 " myForm.method =\"Post\";\n"
139 " myForm.action =\"../Frontend/SendAction?\";\n"
140 " myForm.target =\"post_target\";\n"
141 " var myInput = document.createElement(\"input\");\n"
142 " myInput.setAttribute(\"name\", \"Action\");\n"
143 " myInput.setAttribute(\"value\", action);\n"
144 " myForm.appendChild(myInput);\n"
145 " document.body.appendChild(myForm);\n"
146 " myForm.submit();\n"
147 " document.body.removeChild(myForm);\n"
152 " <iframe id=\"hidden_target\" name=\"post_target\" src=\"\""
153 " style=\"width:0;height:0;border:0px solid #fff;\"></iframe>\n";
160 pRequest->
m_mapRespHeaders[
"Cache-Control" ] =
"no-cache=\"Ext\", max-age = 5000";
171 QStringList actions = contexts.value();
172 for (
const QString &
action : std::as_const(actions))
174 QStringList split =
action.split(
",");
175 if (split.size() == 2)
178 QString(
" <div>%1 <input type=\"button\" value=\"%2\" onClick=\"postaction('%2');\"></input> %3</div>\n")
179 .arg(contexts.key(), split[0], split[1]);
QStringList GetBasePaths() override
static void InitialiseActions(void)
static QHash< QString, QStringList > gActionDescriptions
HttpResponseType m_eResponseType
void FormatFileResponse(const QString &sFileName)
QStringMap m_mapRespHeaders
QString GetSetting(const QString &key, const QString &defaultval="")
static void GetActionListTest(HTTPRequest *pRequest)
QString m_sServiceDescFileName
MythFEXML(UPnpDevice *pDevice, const QString &sSharePath)
QStringList GetBasePaths() override
static void GetScreenShot(HTTPRequest *pRequest)
bool ProcessRequest(HTTPRequest *pRequest) override
static MythFEXMLMethod GetMethod(const QString &sURI)
void RemoteScreenShot(QString Filename, int Width, int Height)
void RegisterService(UPnpDevice *device)
Creates a UPnpService and adds it to the UPnpDevice's list of services.
static void FormatErrorResponse(HTTPRequest *pRequest, UPnPResultCode eCode, const QString &sMsg="")
QString GetValue(const QString &setting)
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
static const QString HIDDEN_IFRAME
static const QString PROCESS_ACTION
@ MFEXML_GetServiceDescription
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
MythMainWindow * GetMythMainWindow(void)
@ UPnPResult_InvalidAction