mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-09-02 10:21:04 +02:00
zapit/src/femanager.cpp: add cached have_sat/cable flags
Origin commit data
------------------
Branch: ni/coolstream
Commit: 6753630b68
Author: [CST] Focus <focus.cst@gmail.com>
Date: 2013-04-02 (Tue, 02 Apr 2013)
------------------
No further description and justification available within origin commit message!
------------------
This commit was generated by Migit
This commit is contained in:
@@ -82,6 +82,8 @@ class CFEManager
|
||||
common_fe_config_t config;
|
||||
bool config_exist;
|
||||
|
||||
bool have_sat;
|
||||
bool have_cable;
|
||||
bool have_locked;
|
||||
OpenThreads::Mutex mutex;
|
||||
|
||||
@@ -136,9 +138,9 @@ class CFEManager
|
||||
bool lockDemux(int i, transponder_id_t id);
|
||||
void unlockDemux(int i);
|
||||
bool haveFreeDemux();
|
||||
bool haveSat();
|
||||
bool haveCable();
|
||||
bool satOnly() { return (haveSat() && !haveCable()); }
|
||||
bool cableOnly() { return (haveCable() && !haveSat()); }
|
||||
bool haveSat() { return have_sat; }
|
||||
bool haveCable() { return have_cable; }
|
||||
bool satOnly() { return (have_sat && !have_cable); }
|
||||
bool cableOnly() { return (have_cable && !have_sat); }
|
||||
};
|
||||
#endif /* __femanager_h__ */
|
||||
|
@@ -90,6 +90,7 @@ bool CFEManager::Init()
|
||||
unsigned short fekey;
|
||||
|
||||
OpenThreads::ScopedLock<OpenThreads::Mutex> m_lock(mutex);
|
||||
have_sat = have_cable = false;
|
||||
for(int i = 0; i < MAX_ADAPTERS; i++) {
|
||||
for(int j = 0; j < MAX_FE; j++) {
|
||||
fe = new CFrontend(j, i);
|
||||
@@ -99,6 +100,10 @@ bool CFEManager::Init()
|
||||
INFO("add fe %d", fe->fenumber);
|
||||
if(livefe == NULL)
|
||||
livefe = fe;
|
||||
if (fe->getInfo()->type == FE_QPSK)
|
||||
have_sat = true;
|
||||
else if (fe->getInfo()->type == FE_QAM)
|
||||
have_cable = true;
|
||||
} else
|
||||
delete fe;
|
||||
}
|
||||
@@ -751,26 +756,6 @@ bool CFEManager::haveFreeFrontend()
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CFEManager::haveSat()
|
||||
{
|
||||
for(fe_map_iterator_t it = femap.begin(); it != femap.end(); it++) {
|
||||
CFrontend * fe = it->second;
|
||||
if (fe->getInfo()->type == FE_QPSK)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool CFEManager::haveCable()
|
||||
{
|
||||
for(fe_map_iterator_t it = femap.begin(); it != femap.end(); it++) {
|
||||
CFrontend * fe = it->second;
|
||||
if (fe->getInfo()->type == FE_QAM)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
int CFEManager::getEnabledCount()
|
||||
{
|
||||
OpenThreads::ScopedLock<OpenThreads::Mutex> m_lock(mutex);
|
||||
|
Reference in New Issue
Block a user