vector<InputInfo> PlaybackSock::GetFreeInputs(int capturecardnum, const vector<uint> &excluded_cardids) { QStringList strlist(QString("QUERY_REMOTEENCODER %1").arg(capturecardnum)); strlist << "GET_FREE_INPUTS"; for (uint i = 0; i < excluded_cardids.size(); i++) strlist << QString::number(excluded_cardids[i]); SendReceiveStringList(strlist); vector<InputInfo> list; QStringList::const_iterator it = strlist.begin(); if ((it == strlist.end()) || (*it == "EMPTY_LIST")) return list; while (it != strlist.end()) { InputInfo info; if (!info.FromStringList(it, strlist.end())) break; list.push_back(info); } return list; }
vector<InputInfo> RemoteRequestFreeInputList( uint cardid, const vector<uint> &excluded_cardids) { vector<InputInfo> list; QStringList strlist(QString("QUERY_RECORDER %1").arg(cardid)); strlist << "GET_FREE_INPUTS"; for (uint i = 0; i < excluded_cardids.size(); i++) strlist << QString::number(excluded_cardids[i]); if (!gCoreContext->SendReceiveStringList(strlist)) return list; QStringList::const_iterator it = strlist.begin(); if ((it == strlist.end()) || (*it == "EMPTY_LIST")) return list; while (it != strlist.end()) { InputInfo info; if (!info.FromStringList(it, strlist.end())) break; list.push_back(info); } return list; }
bool RemoteIsBusy(uint cardid, InputInfo &busy_input) { #if 0 LOG(VB_GENERAL, LOG_DEBUG, QString("RemoteIsBusy(%1) %2") .arg(cardid).arg(gCoreContext->IsBackend() ? "be" : "fe")); #endif busy_input.Clear(); if (gCoreContext->IsBackend()) { const TVRec *rec = TVRec::GetTVRec(cardid); if (rec) return rec->IsBusy(&busy_input); } QStringList strlist(QString("QUERY_REMOTEENCODER %1").arg(cardid)); strlist << "IS_BUSY"; if (!gCoreContext->SendReceiveStringList(strlist) || strlist.empty()) return true; QStringList::const_iterator it = strlist.begin(); bool state = (*it).toInt(); ++it; if (!busy_input.FromStringList(it, strlist.end())) state = true; // if there was an error pretend that the input is busy. return state; }
InputInfo RemoteRequestBusyInputID(uint cardid) { InputInfo blank; QStringList strlist(QString("QUERY_RECORDER %1").arg(cardid)); strlist << "GET_BUSY_INPUT"; if (!gCoreContext->SendReceiveStringList(strlist)) return blank; QStringList::const_iterator it = strlist.begin(); if ((it == strlist.end()) || (*it == "EMPTY_LIST")) return blank; InputInfo info; if (info.FromStringList(it, strlist.end())) return info; return blank; }