23 QStringList strlist(QString(
"QUERY_REMOTEENCODER %1").arg(inputid));
24 strlist <<
"GET_FLAGS";
28 return strlist[0].toInt();
41 QStringList strlist(QString(
"QUERY_REMOTEENCODER %1").arg(inputid));
42 strlist <<
"GET_STATE";
46 return strlist[0].toInt();
51 std::chrono::seconds secsleft,
bool hasLater)
64 QStringList strlist(QString(
"QUERY_REMOTEENCODER %1").arg(inputid));
65 strlist <<
"RECORD_PENDING";
66 strlist << QString::number(secsleft.count());
67 strlist << QString::number(static_cast<int>(hasLater));
73 return strlist[0].toUpper() ==
"OK";
89 QStringList strlist(QString(
"QUERY_REMOTEENCODER %1").arg(inputid));
90 strlist <<
"STOP_LIVETV";
95 return strlist[0].toUpper() ==
"OK";
111 QStringList strlist(QString(
"QUERY_REMOTEENCODER %1").arg(inputid));
112 strlist <<
"STOP_RECORDING";
117 return strlist[0].toUpper() ==
"OK";
122 QStringList strlist(QString(
"STOP_RECORDING"));
130 QStringList strlist(QString(
"QUERY_RECORDER %1").arg(inputid));
131 strlist <<
"CANCEL_NEXT_RECORDING";
132 strlist << QString::number((cancel) ? 1 : 0);
139 LOG(VB_CHANNEL, LOG_INFO,
140 QString(
"RemoteRequestFreeInputInfo excluding input %1")
141 .arg(excluded_input));
143 std::vector<InputInfo> inputs;
145 QStringList strlist(QString(
"GET_FREE_INPUT_INFO %1")
146 .arg(excluded_input));
150 QStringList::const_iterator it = strlist.cbegin();
151 while (it != strlist.cend())
154 if (!
info.FromStringList(it, strlist.cend()))
156 inputs.push_back(
info);
157 LOG(VB_CHANNEL, LOG_INFO,
158 QString(
"RemoteRequestFreeInputInfo got input %1 (%2/%3)")
159 .arg(
info.m_inputId).arg(
info.m_chanId).arg(
info.m_mplexId));
162 LOG(VB_CHANNEL, LOG_INFO,
163 QString(
"RemoteRequestFreeInputInfo got %1 inputs")
164 .arg(inputs.size()));
170 LOG(VB_CHANNEL, LOG_INFO, QString(
"RemoteGetFreeRecorderCount"));
172 std::vector<InputInfo> inputs =
175 LOG(VB_CHANNEL, LOG_INFO, QString(
"RemoteGetFreeRecorderCount got %1")
176 .arg(inputs.size()));
177 return inputs.size();
182 LOG(VB_CHANNEL, LOG_INFO,
183 QString(
"RemoteRequestNextFreeRecorder after input %1)")
186 std::vector<InputInfo> inputs =
191 LOG(VB_CHANNEL, LOG_INFO,
192 QString(
"RemoteRequestNextFreeRecorder got no input (after input %1)")
198 for ( ; i < inputs.size(); ++i)
199 if (inputs[i].m_inputId == (
uint)inputid)
202 if (i >= inputs.size())
215 i = (i + 1) % inputs.size();
217 while (i != j && inputs[i].m_displayName == inputs[j].m_displayName);
220 LOG(VB_CHANNEL, LOG_INFO,
221 QString(
"RemoteRequestNextFreeRecorder got input %1")
222 .arg(inputs[i].m_inputId));
229 LOG(VB_CHANNEL, LOG_INFO,
230 QString(
"RemoteRequestFreeRecorderList excluding input %1")
231 .arg(excluded_input));
233 std::vector<InputInfo> inputs =
236 std::vector<uint> inputids;
237 std::transform(inputs.cbegin(), inputs.cend(), std::back_inserter(inputids),
238 [](
const auto & input){ return input.m_inputId; } );
240 LOG(VB_CHANNEL, LOG_INFO,
241 QString(
"RemoteRequestFreeRecorderList got inputs"));
247 LOG(VB_CHANNEL, LOG_INFO,
248 QString(
"RemoteRequestFreeInputList excluding input %1")
249 .arg(excluded_input));
251 std::vector<InputInfo> inputs =
254 std::vector<uint> inputids;
255 std::transform(inputs.cbegin(), inputs.cend(), std::back_inserter(inputids),
256 [](
const auto & input){ return input.m_inputId; } );
258 LOG(VB_CHANNEL, LOG_INFO,
259 QString(
"RemoteRequestFreeInputList got inputs"));
264 (
const QStringList &qualifiedRecorders,
uint excluded_input)
266 LOG(VB_CHANNEL, LOG_INFO,
267 QString(
"RemoteRequestFreeRecorderFromList excluding input %1")
268 .arg(excluded_input));
270 std::vector<InputInfo> inputs =
273 for (
const auto &
recorder : std::as_const(qualifiedRecorders))
276 auto sameinput = [inputid](
const auto & input){
return input.m_inputId == inputid; };
277 if (std::any_of(inputs.cbegin(), inputs.cend(), sameinput))
279 LOG(VB_CHANNEL, LOG_INFO,
280 QString(
"RemoteRequestFreeRecorderFromList got input %1")
286 LOG(VB_CHANNEL, LOG_INFO,
287 QString(
"RemoteRequestFreeRecorderFromList got no input"));
293 LOG(VB_CHANNEL, LOG_INFO,
294 QString(
"RemoteRequestRecorder entered"));
296 std::vector<InputInfo> inputs =
301 LOG(VB_CHANNEL, LOG_INFO,
302 QString(
"RemoteRequestRecorder got no input"));
306 LOG(VB_CHANNEL, LOG_INFO,
307 QString(
"RemoteRequestRecorder got input %1")
308 .arg(inputs[0].m_inputId));
314 LOG(VB_CHANNEL, LOG_INFO,
315 QString(
"RemoteGetExistingRecorder program %1")
318 QStringList strlist(
"GET_RECORDER_NUM" );
323 LOG(VB_CHANNEL, LOG_INFO,
324 QString(
"RemoteGetExistingRecorder got no input"));
328 int num = strlist[0].toInt();
330 int port = strlist[2].toInt();
332 LOG(VB_CHANNEL, LOG_INFO,
333 QString(
"RemoteGetExistingRecorder got input %1").arg(num));
339 LOG(VB_CHANNEL, LOG_INFO,
340 QString(
"RemoteGetExistingRecorder input %1")
343 QStringList strlist(
"GET_RECORDER_FROM_NUM" );
344 strlist << QString(
"%1").arg(recordernum);
348 LOG(VB_CHANNEL, LOG_INFO,
349 QString(
"RemoteGetExistingRecorder got no input"));
354 int port = strlist[1].toInt();
356 LOG(VB_CHANNEL, LOG_INFO,
357 QString(
"RemoteGetExistingRecorder got input %1")
365 LOG(VB_GENERAL, LOG_DEBUG, QString(
"RemoteIsBusy(%1) %2")
375 return rec->
IsBusy(&busy_input);
386 QStringList strlist(QString(
"QUERY_REMOTEENCODER %1").arg(inputid));
387 strlist <<
"IS_BUSY";
391 QStringList::const_iterator it = strlist.cbegin();
392 bool state = (*it).toInt() != 0;
401 std::vector<TunerStatus> *tunerList,
bool list_inactive)
409 for (
uint inputid : inputlist)
412 QString channelName =
"";
414 QString subtitle =
"";
415 QDateTime dtStart = QDateTime();
416 QDateTime dtEnd = QDateTime();
419 QString cmd = QString(
"QUERY_REMOTEENCODER %1").arg(inputid);
423 strlist = QStringList(cmd);
424 strlist <<
"GET_STATE";
430 state = strlist[0].toInt();
432 std::this_thread::sleep_for(5ms);
442 strlist = QStringList(QString(
"QUERY_RECORDER %1").arg(inputid));
443 strlist <<
"GET_RECORDING";
454 else if (!list_inactive)
467 QObject::tr(
"Error querying recorder state") : title;
471 tunerList->push_back(tuner);