+bool eDVBResourceManager::frontendIsCompatible(int index, const char *type)
+{
+ for (eSmartPtrList<eDVBRegisteredFrontend>::iterator i(m_frontend.begin()); i != m_frontend.end(); ++i)
+ {
+ if (i->m_frontend->getSlotID() == index)
+ {
+ if (!strcmp(type, "DVB-S2"))
+ {
+ return i->m_frontend->supportsDeliverySystem(SYS_DVBS2, false);
+ }
+ else if (!strcmp(type, "DVB-S"))
+ {
+ return i->m_frontend->supportsDeliverySystem(SYS_DVBS, false);
+ }
+ else if (!strcmp(type, "DVB-T2"))
+ {
+ return i->m_frontend->supportsDeliverySystem(SYS_DVBT2, false);
+ }
+ else if (!strcmp(type, "DVB-T"))
+ {
+ return i->m_frontend->supportsDeliverySystem(SYS_DVBT, false);
+ }
+ else if (!strcmp(type, "DVB-C"))
+ {
+#if defined SYS_DVBC_ANNEX_A
+ return i->m_frontend->supportsDeliverySystem(SYS_DVBC_ANNEX_A, false);
+#else
+ return i->m_frontend->supportsDeliverySystem(SYS_DVBC_ANNEX_AC, false);
+#endif
+ }
+ }
+ }
+ return false;
+}
+
+void eDVBResourceManager::setFrontendType(int index, const char *type)
+{
+ eDebug("[eDVBResourceManager::setFrontendType] index : %d, type : %s", index, type);
+
+ for (eSmartPtrList<eDVBRegisteredFrontend>::iterator i(m_frontend.begin()); i != m_frontend.end(); ++i)
+ {
+ if (i->m_frontend->getSlotID() == index)
+ {
+ std::vector<fe_delivery_system_t> whitelist;
+ if (!strcmp(type, "DVB-S2") || !strcmp(type, "DVB-S"))
+ {
+ whitelist.push_back(SYS_DVBS);
+ whitelist.push_back(SYS_DVBS2);
+ }
+ else if (!strcmp(type, "DVB-T2") || !strcmp(type, "DVB-T"))
+ {
+ whitelist.push_back(SYS_DVBT);
+ whitelist.push_back(SYS_DVBT2);
+ }
+ else if (!strcmp(type, "DVB-C"))
+ {
+#if defined SYS_DVBC_ANNEX_A
+ whitelist.push_back(SYS_DVBC_ANNEX_A);
+#else
+ whitelist.push_back(SYS_DVBC_ANNEX_AC);
+#endif
+ }
+ i->m_frontend->setDeliverySystemWhitelist(whitelist);
+ break;
+ }
+ }
+}
+