diff --git a/src/zapit/include/zapit/femanager.h b/src/zapit/include/zapit/femanager.h index d7fa6a679..56220b31a 100644 --- a/src/zapit/include/zapit/femanager.h +++ b/src/zapit/include/zapit/femanager.h @@ -84,6 +84,7 @@ class CFEManager bool have_sat; bool have_cable; + bool have_terr; bool have_locked; OpenThreads::ReentrantMutex mutex; @@ -140,10 +141,11 @@ class CFEManager bool haveFreeDemux(); bool haveSat() { return have_sat; } bool haveCable() { return have_cable; } - bool satOnly() { return (have_sat && !have_cable); } - bool cableOnly() { return (have_cable && !have_sat); } + bool haveTerr() { return have_terr; } + bool satOnly() { return (have_sat && !have_cable && !have_terr); } + bool cableOnly() { return (have_cable && !have_sat && ! have_terr); } + bool terrOnly() { return (have_terr && !have_sat && ! have_cable); } void Lock() { mutex.lock(); } void Unlock() { mutex.unlock(); } - }; #endif /* __femanager_h__ */ diff --git a/src/zapit/include/zapit/frontend_c.h b/src/zapit/include/zapit/frontend_c.h index 1ff0e8b3a..3155f1383 100644 --- a/src/zapit/include/zapit/frontend_c.h +++ b/src/zapit/include/zapit/frontend_c.h @@ -262,6 +262,7 @@ class CFrontend } bool isCable() { return (info.type == FE_QAM); } bool isSat() { return (info.type == FE_QPSK); } + bool isTerr() { return (info.type == FE_OFDM); } fe_type_t getType() { return info.type; } }; #endif /* __zapit_frontend_h__ */ diff --git a/src/zapit/src/femanager.cpp b/src/zapit/src/femanager.cpp index b8841c50a..fc3e4be0f 100644 --- a/src/zapit/src/femanager.cpp +++ b/src/zapit/src/femanager.cpp @@ -92,7 +92,7 @@ bool CFEManager::Init() unsigned short fekey; OpenThreads::ScopedLock m_lock(mutex); - have_sat = have_cable = false; + have_sat = have_cable = have_terr = false; for(int i = 0; i < MAX_ADAPTERS; i++) { for(int j = 0; j < MAX_FE; j++) { fe = new CFrontend(j, i); @@ -106,6 +106,8 @@ bool CFEManager::Init() have_sat = true; else if (fe->getInfo()->type == FE_QAM) have_cable = true; + else if (fe->isTerr()) + have_terr = true; } else delete fe; } @@ -227,6 +229,7 @@ bool CFEManager::loadSettings() } bool fsat = true; //bool fcable = true; + bool fterr = true; for(fe_map_iterator_t it = femap.begin(); it != femap.end(); it++) { CFrontend * fe = it->second; frontend_config_t & fe_config = fe->getConfig(); @@ -260,6 +263,14 @@ bool CFEManager::loadSettings() #endif def_mode = CFrontend::FE_MODE_INDEPENDENT; } + if (fe->isTerr()) { + if (fterr) { + fterr = false; + def_mode = def_mode0; + } + if (def_mode > CFrontend::FE_MODE_INDEPENDENT) + def_mode = CFrontend::FE_MODE_INDEPENDENT; + } if (femap.size() == 1) def_mode = CFrontend::FE_MODE_INDEPENDENT; @@ -694,11 +705,16 @@ CFrontend * CFEManager::getScanFrontend(t_satellite_position satellitePosition) CFrontend * frontend = NULL; for(fe_map_iterator_t it = femap.begin(); it != femap.end(); it++) { CFrontend * mfe = it->second; - if(mfe->isCable()) { + if (mfe->isCable()) { if ((mfe->getMode() != CFrontend::FE_MODE_UNUSED) && ((satellitePosition & 0xF00) == 0xF00)) { frontend = mfe; break; } + } else if (mfe->isTerr()) { + if ((mfe->getMode() != CFrontend::FE_MODE_UNUSED) && (satellitePosition & 0xF00) == 0xE00) { + frontend = mfe; + break; + } } else { if (mfe->getMode() == CFrontend::FE_MODE_UNUSED || CFrontend::linked(mfe->getMode())) continue;