mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-09-02 18:31:12 +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;
|
common_fe_config_t config;
|
||||||
bool config_exist;
|
bool config_exist;
|
||||||
|
|
||||||
|
bool have_sat;
|
||||||
|
bool have_cable;
|
||||||
bool have_locked;
|
bool have_locked;
|
||||||
OpenThreads::Mutex mutex;
|
OpenThreads::Mutex mutex;
|
||||||
|
|
||||||
@@ -136,9 +138,9 @@ class CFEManager
|
|||||||
bool lockDemux(int i, transponder_id_t id);
|
bool lockDemux(int i, transponder_id_t id);
|
||||||
void unlockDemux(int i);
|
void unlockDemux(int i);
|
||||||
bool haveFreeDemux();
|
bool haveFreeDemux();
|
||||||
bool haveSat();
|
bool haveSat() { return have_sat; }
|
||||||
bool haveCable();
|
bool haveCable() { return have_cable; }
|
||||||
bool satOnly() { return (haveSat() && !haveCable()); }
|
bool satOnly() { return (have_sat && !have_cable); }
|
||||||
bool cableOnly() { return (haveCable() && !haveSat()); }
|
bool cableOnly() { return (have_cable && !have_sat); }
|
||||||
};
|
};
|
||||||
#endif /* __femanager_h__ */
|
#endif /* __femanager_h__ */
|
||||||
|
@@ -90,6 +90,7 @@ bool CFEManager::Init()
|
|||||||
unsigned short fekey;
|
unsigned short fekey;
|
||||||
|
|
||||||
OpenThreads::ScopedLock<OpenThreads::Mutex> m_lock(mutex);
|
OpenThreads::ScopedLock<OpenThreads::Mutex> m_lock(mutex);
|
||||||
|
have_sat = have_cable = false;
|
||||||
for(int i = 0; i < MAX_ADAPTERS; i++) {
|
for(int i = 0; i < MAX_ADAPTERS; i++) {
|
||||||
for(int j = 0; j < MAX_FE; j++) {
|
for(int j = 0; j < MAX_FE; j++) {
|
||||||
fe = new CFrontend(j, i);
|
fe = new CFrontend(j, i);
|
||||||
@@ -99,6 +100,10 @@ bool CFEManager::Init()
|
|||||||
INFO("add fe %d", fe->fenumber);
|
INFO("add fe %d", fe->fenumber);
|
||||||
if(livefe == NULL)
|
if(livefe == NULL)
|
||||||
livefe = fe;
|
livefe = fe;
|
||||||
|
if (fe->getInfo()->type == FE_QPSK)
|
||||||
|
have_sat = true;
|
||||||
|
else if (fe->getInfo()->type == FE_QAM)
|
||||||
|
have_cable = true;
|
||||||
} else
|
} else
|
||||||
delete fe;
|
delete fe;
|
||||||
}
|
}
|
||||||
@@ -751,26 +756,6 @@ bool CFEManager::haveFreeFrontend()
|
|||||||
return true;
|
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()
|
int CFEManager::getEnabledCount()
|
||||||
{
|
{
|
||||||
OpenThreads::ScopedLock<OpenThreads::Mutex> m_lock(mutex);
|
OpenThreads::ScopedLock<OpenThreads::Mutex> m_lock(mutex);
|
||||||
|
Reference in New Issue
Block a user