mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-29 16:31:11 +02:00
driver/scanepg.cpp: add support to scan all favorites
This commit is contained in:
@@ -37,12 +37,14 @@
|
|||||||
|
|
||||||
#include <driver/scanepg.h>
|
#include <driver/scanepg.h>
|
||||||
|
|
||||||
extern CBouquetList * bouquetList;
|
extern CBouquetList * bouquetList;
|
||||||
|
extern CBouquetList * TVfavList;
|
||||||
|
|
||||||
CEpgScan::CEpgScan()
|
CEpgScan::CEpgScan()
|
||||||
{
|
{
|
||||||
current_bnum = -1;
|
current_bnum = -1;
|
||||||
next_chid = 0;
|
next_chid = 0;
|
||||||
|
current_mode = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
CEpgScan::~CEpgScan()
|
CEpgScan::~CEpgScan()
|
||||||
@@ -74,18 +76,37 @@ void CEpgScan::handleMsg(const neutrino_msg_t msg, neutrino_msg_data_t data)
|
|||||||
if(bouquetList->Bouquets.empty())
|
if(bouquetList->Bouquets.empty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (current_bnum != bouquetList->getActiveBouquetNumber()) {
|
if (current_mode != g_settings.epg_scan) {
|
||||||
scanmap.clear();
|
current_mode = g_settings.epg_scan;
|
||||||
current_bnum = bouquetList->getActiveBouquetNumber();
|
Clear();
|
||||||
CChannelList * clist = bouquetList->Bouquets[current_bnum]->channelList;
|
}
|
||||||
int lsize = clist->Size();
|
if (g_settings.epg_scan == 1) {
|
||||||
for (int i = 0; i < lsize; i++) {
|
/* current bouquet mode */
|
||||||
CZapitChannel * chan = clist->getChannelFromIndex(i);
|
if (current_bnum != bouquetList->getActiveBouquetNumber()) {
|
||||||
/* TODO: add interval check to clear scanned ? */
|
scanmap.clear();
|
||||||
if (scanned.find(chan->getTransponderId()) == scanned.end())
|
current_bnum = bouquetList->getActiveBouquetNumber();
|
||||||
scanmap.insert(eit_scanmap_pair_t(chan->getTransponderId(), chan->getChannelID()));
|
CChannelList * clist = bouquetList->Bouquets[current_bnum]->channelList;
|
||||||
|
for (unsigned i = 0; i < clist->Size(); i++) {
|
||||||
|
CZapitChannel * chan = clist->getChannelFromIndex(i);
|
||||||
|
/* TODO: add interval check to clear scanned ? */
|
||||||
|
if (scanned.find(chan->getTransponderId()) == scanned.end())
|
||||||
|
scanmap.insert(eit_scanmap_pair_t(chan->getTransponderId(), chan->getChannelID()));
|
||||||
|
}
|
||||||
|
INFO("EVT_ZAP_COMPLETE, scan map size: %d\n", scanmap.size());
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
/* all favorites mode */
|
||||||
|
if (scanmap.empty()) {
|
||||||
|
for (unsigned j = 0; j < TVfavList->Bouquets.size(); ++j) {
|
||||||
|
CChannelList * clist = TVfavList->Bouquets[j]->channelList;
|
||||||
|
for (unsigned i = 0; i < clist->Size(); i++) {
|
||||||
|
CZapitChannel * chan = clist->getChannelFromIndex(i);
|
||||||
|
if (scanned.find(chan->getTransponderId()) == scanned.end())
|
||||||
|
scanmap.insert(eit_scanmap_pair_t(chan->getTransponderId(), chan->getChannelID()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
INFO("EVT_ZAP_COMPLETE, scan map size: %d\n", scanmap.size());
|
||||||
}
|
}
|
||||||
INFO("EVT_ZAP_COMPLETE, scan map size: %d\n", scanmap.size());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (msg == NeutrinoMessages::EVT_EIT_COMPLETE) {
|
else if (msg == NeutrinoMessages::EVT_EIT_COMPLETE) {
|
||||||
|
@@ -30,6 +30,7 @@ class CEpgScan
|
|||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
int current_bnum;
|
int current_bnum;
|
||||||
|
int current_mode;
|
||||||
eit_scanmap_t scanmap;
|
eit_scanmap_t scanmap;
|
||||||
t_channel_id next_chid;
|
t_channel_id next_chid;
|
||||||
std::set<transponder_id_t> scanned;
|
std::set<transponder_id_t> scanned;
|
||||||
|
Reference in New Issue
Block a user