mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-09-02 02:11:04 +02:00
remove global allchans
* add helpers for reused code
* change renumber channels code
git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-beta@1656 e54a6e83-5905-42d5-8d5c-058d10e6a962
Origin commit data
------------------
Branch: ni/coolstream
Commit: 14a40b425a
Author: [CST] Focus <focus.cst@gmail.com>
Date: 2011-09-01 (Thu, 01 Sep 2011)
Origin message was:
------------------
* remove global allchans
* add helpers for reused code
* change renumber channels code
git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-beta@1656 e54a6e83-5905-42d5-8d5c-058d10e6a962
------------------
This commit was generated by Migit
This commit is contained in:
@@ -24,6 +24,7 @@ typedef map<t_channel_id, CZapitChannel> tallchans;
|
|||||||
typedef tallchans::iterator tallchans_iterator;
|
typedef tallchans::iterator tallchans_iterator;
|
||||||
|
|
||||||
typedef vector<CZapitChannel*> ZapitChannelList;
|
typedef vector<CZapitChannel*> ZapitChannelList;
|
||||||
|
typedef ZapitChannelList::iterator zapit_list_it_t;
|
||||||
|
|
||||||
class CZapitBouquet
|
class CZapitBouquet
|
||||||
{
|
{
|
||||||
@@ -51,6 +52,7 @@ class CZapitBouquet
|
|||||||
size_t recModeTVSize (const transponder_id_t transponder_id);
|
size_t recModeTVSize (const transponder_id_t transponder_id);
|
||||||
CZapitChannel* getChannelByChannelID(const t_channel_id channel_id, const unsigned char serviceType = ST_RESERVED);
|
CZapitChannel* getChannelByChannelID(const t_channel_id channel_id, const unsigned char serviceType = ST_RESERVED);
|
||||||
void sortBouquet(void);
|
void sortBouquet(void);
|
||||||
|
void sortBouquetByNumber(void);
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef vector<CZapitBouquet *> BouquetList;
|
typedef vector<CZapitBouquet *> BouquetList;
|
||||||
@@ -60,11 +62,14 @@ class CBouquetManager
|
|||||||
private:
|
private:
|
||||||
CZapitBouquet * remainChannels;
|
CZapitBouquet * remainChannels;
|
||||||
|
|
||||||
|
void renumChannels(ZapitChannelList &list, int &counter, char * pname = NULL);
|
||||||
void makeRemainingChannelsBouquet(void);
|
void makeRemainingChannelsBouquet(void);
|
||||||
void parseBouquetsXml (const char * fname, bool ub = false);
|
void parseBouquetsXml (const char * fname, bool ub = false);
|
||||||
void writeBouquetHeader (FILE * bouq_fd, uint32_t i, const char * bouquetName);
|
void writeBouquetHeader (FILE * bouq_fd, uint32_t i, const char * bouquetName);
|
||||||
void writeBouquetFooter (FILE * bouq_fd);
|
void writeBouquetFooter (FILE * bouq_fd);
|
||||||
void writeBouquetChannels (FILE * bouq_fd, uint32_t i, bool bUser = false);
|
void writeBouquetChannels (FILE * bouq_fd, uint32_t i, bool bUser = false);
|
||||||
|
void writeChannels(FILE * bouq_fd, ZapitChannelList &list);
|
||||||
|
void writeBouquet(FILE * bouq_fd, uint32_t i);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CBouquetManager() { remainChannels = NULL; };
|
CBouquetManager() { remainChannels = NULL; };
|
||||||
@@ -107,9 +112,7 @@ class CBouquetManager
|
|||||||
|
|
||||||
void clearAll();
|
void clearAll();
|
||||||
|
|
||||||
CZapitChannel* findChannelByChannelID(const t_channel_id channel_id);
|
|
||||||
void sortBouquets(void);
|
void sortBouquets(void);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -147,4 +150,13 @@ struct CmpBouquetByChName: public binary_function <const CZapitBouquet * const,
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct CmpChannelByChNum: public binary_function <const CZapitChannel * const, const CZapitChannel * const, bool>
|
||||||
|
{
|
||||||
|
bool operator() (const CZapitChannel * const c1, const CZapitChannel * const c2)
|
||||||
|
{
|
||||||
|
return c1->number < c2->number;
|
||||||
|
;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
#endif /* __bouquets_h__ */
|
#endif /* __bouquets_h__ */
|
||||||
|
@@ -30,34 +30,16 @@
|
|||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
/* tuxbox headers */
|
|
||||||
#include <configfile.h>
|
|
||||||
|
|
||||||
#include <zapit/bouquets.h>
|
#include <zapit/bouquets.h>
|
||||||
#include <zapit/debug.h>
|
#include <zapit/debug.h>
|
||||||
#include <zapit/getservices.h> /* LoadServices */
|
#include <zapit/getservices.h>
|
||||||
#include <zapit/sdt.h>
|
#include <zapit/sdt.h>
|
||||||
#include <zapit/settings.h>
|
#include <zapit/settings.h>
|
||||||
|
#include <zapit/zapit.h>
|
||||||
#include <xmlinterface.h>
|
#include <xmlinterface.h>
|
||||||
|
|
||||||
extern tallchans allchans; // defined in zapit.cpp
|
|
||||||
extern CConfigFile config; // defined in zapit.cpp
|
|
||||||
//extern std::map<std::string, t_satellite_position>satellitePositions;
|
|
||||||
extern CBouquetManager *g_bouquetManager;
|
extern CBouquetManager *g_bouquetManager;
|
||||||
|
|
||||||
char *getFrontendName(void);
|
|
||||||
void cp(char * from, char * to);
|
|
||||||
|
|
||||||
#define TIMER_START() \
|
|
||||||
static struct timeval tv, tv2; \
|
|
||||||
static unsigned int msec; \
|
|
||||||
gettimeofday(&tv, NULL)
|
|
||||||
|
|
||||||
#define TIMER_STOP(label) \
|
|
||||||
gettimeofday(&tv2, NULL); \
|
|
||||||
msec = ((tv2.tv_sec - tv.tv_sec) * 1000) + ((tv2.tv_usec - tv.tv_usec) / 1000); \
|
|
||||||
printf("%s: %u msec\n", label, msec)
|
|
||||||
|
|
||||||
#define GET_ATTR(node, name, fmt, arg) \
|
#define GET_ATTR(node, name, fmt, arg) \
|
||||||
do { \
|
do { \
|
||||||
char * ptr = xmlGetAttribute(node, name); \
|
char * ptr = xmlGetAttribute(node, name); \
|
||||||
@@ -103,12 +85,16 @@ CZapitChannel* CZapitBouquet::getChannelByChannelID(const t_channel_id channel_i
|
|||||||
|
|
||||||
void CZapitBouquet::sortBouquet(void)
|
void CZapitBouquet::sortBouquet(void)
|
||||||
{
|
{
|
||||||
//printf("*************** sorting %s TV\n", Name.c_str());fflush(stdout);//FIXME
|
|
||||||
sort(tvChannels.begin(), tvChannels.end(), CmpChannelByChName());
|
sort(tvChannels.begin(), tvChannels.end(), CmpChannelByChName());
|
||||||
//printf("*************** sorting %s RADIO\n", Name.c_str());
|
|
||||||
sort(radioChannels.begin(), radioChannels.end(), CmpChannelByChName());
|
sort(radioChannels.begin(), radioChannels.end(), CmpChannelByChName());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CZapitBouquet::sortBouquetByNumber(void)
|
||||||
|
{
|
||||||
|
sort(tvChannels.begin(), tvChannels.end(), CmpChannelByChNum());
|
||||||
|
sort(radioChannels.begin(), radioChannels.end(), CmpChannelByChNum());
|
||||||
|
}
|
||||||
|
|
||||||
void CZapitBouquet::addService(CZapitChannel* newChannel)
|
void CZapitBouquet::addService(CZapitChannel* newChannel)
|
||||||
{
|
{
|
||||||
switch (newChannel->getServiceType())
|
switch (newChannel->getServiceType())
|
||||||
@@ -140,6 +126,7 @@ void CZapitBouquet::removeService(CZapitChannel* oldChannel)
|
|||||||
channels = &radioChannels;
|
channels = &radioChannels;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
(*channels).erase(remove(channels->begin(), channels->end(), oldChannel), channels->end());
|
(*channels).erase(remove(channels->begin(), channels->end(), oldChannel), channels->end());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -204,47 +191,23 @@ void CBouquetManager::writeBouquetFooter(FILE * bouq_fd)
|
|||||||
fprintf(bouq_fd, "\t</Bouquet>\n");
|
fprintf(bouq_fd, "\t</Bouquet>\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CBouquetManager::writeChannels(FILE * bouq_fd, ZapitChannelList &list)
|
||||||
|
{
|
||||||
|
for(zapit_list_it_t it = list.begin(); it != list.end(); it++)
|
||||||
|
(*it)->dumpBouquetXml(bouq_fd);
|
||||||
|
}
|
||||||
|
|
||||||
void CBouquetManager::writeBouquetChannels(FILE * bouq_fd, uint32_t i, bool /*bUser*/)
|
void CBouquetManager::writeBouquetChannels(FILE * bouq_fd, uint32_t i, bool /*bUser*/)
|
||||||
{
|
{
|
||||||
//bool write_names = bUser ? true : config.getBool("writeChannelsNames", true);
|
writeChannels(bouq_fd, Bouquets[i]->tvChannels);
|
||||||
bool write_names = 1;
|
writeChannels(bouq_fd, Bouquets[i]->radioChannels);
|
||||||
|
}
|
||||||
|
|
||||||
for ( unsigned int j = 0; j < Bouquets[i]->tvChannels.size(); j++) {
|
void CBouquetManager::writeBouquet(FILE * bouq_fd, uint32_t i)
|
||||||
if(write_names) {
|
{
|
||||||
fprintf(bouq_fd, "\t\t<S i=\"%x\" n=\"%s\" t=\"%x\" on=\"%x\" s=\"%hd\" frq=\"%hd\"/>\n",
|
writeBouquetHeader(bouq_fd, i, convert_UTF8_To_UTF8_XML(Bouquets[i]->Name.c_str()).c_str());
|
||||||
Bouquets[i]->tvChannels[j]->getServiceId(),
|
writeBouquetChannels(bouq_fd, i);
|
||||||
convert_UTF8_To_UTF8_XML(Bouquets[i]->tvChannels[j]->getName().c_str()).c_str(),
|
writeBouquetFooter(bouq_fd);
|
||||||
Bouquets[i]->tvChannels[j]->getTransportStreamId(),
|
|
||||||
Bouquets[i]->tvChannels[j]->getOriginalNetworkId(),
|
|
||||||
Bouquets[i]->tvChannels[j]->getSatellitePosition(),
|
|
||||||
Bouquets[i]->tvChannels[j]->getFreqId());
|
|
||||||
} else {
|
|
||||||
fprintf(bouq_fd, "\t\t<S i=\"%x\" t=\"%x\" on=\"%x\" s=\"%hd\" frq=\"%hd\"/>\n",
|
|
||||||
Bouquets[i]->tvChannels[j]->getServiceId(),
|
|
||||||
Bouquets[i]->tvChannels[j]->getTransportStreamId(),
|
|
||||||
Bouquets[i]->tvChannels[j]->getOriginalNetworkId(),
|
|
||||||
Bouquets[i]->tvChannels[j]->getSatellitePosition(),
|
|
||||||
Bouquets[i]->tvChannels[j]->getFreqId());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for ( unsigned int j = 0; j < Bouquets[i]->radioChannels.size(); j++) {
|
|
||||||
if(write_names) {
|
|
||||||
fprintf(bouq_fd, "\t\t<S i=\"%x\" n=\"%s\" t=\"%x\" on=\"%x\" s=\"%hd\" frq=\"%hd\"/>\n",
|
|
||||||
Bouquets[i]->radioChannels[j]->getServiceId(),
|
|
||||||
convert_UTF8_To_UTF8_XML(Bouquets[i]->radioChannels[j]->getName().c_str()).c_str(),
|
|
||||||
Bouquets[i]->radioChannels[j]->getTransportStreamId(),
|
|
||||||
Bouquets[i]->radioChannels[j]->getOriginalNetworkId(),
|
|
||||||
Bouquets[i]->radioChannels[j]->getSatellitePosition(),
|
|
||||||
Bouquets[i]->radioChannels[j]->getFreqId());
|
|
||||||
} else {
|
|
||||||
fprintf(bouq_fd, "\t\t<S i=\"%x\" t=\"%x\" on=\"%x\" s=\"%hd\" frq=\"%hd\"/>\n",
|
|
||||||
Bouquets[i]->radioChannels[j]->getServiceId(),
|
|
||||||
Bouquets[i]->radioChannels[j]->getTransportStreamId(),
|
|
||||||
Bouquets[i]->radioChannels[j]->getOriginalNetworkId(),
|
|
||||||
Bouquets[i]->radioChannels[j]->getSatellitePosition(),
|
|
||||||
Bouquets[i]->radioChannels[j]->getFreqId());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**** class CBouquetManager *************************************************/
|
/**** class CBouquetManager *************************************************/
|
||||||
@@ -258,9 +221,7 @@ void CBouquetManager::saveBouquets(void)
|
|||||||
if (Bouquets[i] != remainChannels) {
|
if (Bouquets[i] != remainChannels) {
|
||||||
DBG("save Bouquets: name %s user: %d\n", Bouquets[i]->Name.c_str(), Bouquets[i]->bUser);
|
DBG("save Bouquets: name %s user: %d\n", Bouquets[i]->Name.c_str(), Bouquets[i]->bUser);
|
||||||
if(!Bouquets[i]->bUser) {
|
if(!Bouquets[i]->bUser) {
|
||||||
writeBouquetHeader(bouq_fd, i, convert_UTF8_To_UTF8_XML(Bouquets[i]->Name.c_str()).c_str());
|
writeBouquet(bouq_fd, i);
|
||||||
writeBouquetChannels(bouq_fd, i);
|
|
||||||
writeBouquetFooter(bouq_fd);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -279,9 +240,7 @@ void CBouquetManager::saveUBouquets(void)
|
|||||||
for (unsigned int i = 0; i < Bouquets.size(); i++) {
|
for (unsigned int i = 0; i < Bouquets.size(); i++) {
|
||||||
if (Bouquets[i] != remainChannels) {
|
if (Bouquets[i] != remainChannels) {
|
||||||
if(Bouquets[i]->bUser) {
|
if(Bouquets[i]->bUser) {
|
||||||
writeBouquetHeader(ubouq_fd, i, convert_UTF8_To_UTF8_XML(Bouquets[i]->Name.c_str()).c_str());
|
writeBouquet(ubouq_fd, i);
|
||||||
writeBouquetChannels(ubouq_fd, i, true);
|
|
||||||
writeBouquetFooter(ubouq_fd);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -378,7 +337,7 @@ void CBouquetManager::parseBouquetsXml(const char *fname, bool bUser)
|
|||||||
char * name = xmlGetAttribute(search, "name");
|
char * name = xmlGetAttribute(search, "name");
|
||||||
if(name == NULL)
|
if(name == NULL)
|
||||||
name = const_cast<char*>("Unknown");
|
name = const_cast<char*>("Unknown");
|
||||||
//CZapitBouquet* newBouquet = addBouquet(xmlGetAttribute(search, "name"), bUser);
|
|
||||||
CZapitBouquet* newBouquet = addBouquet(name, bUser);
|
CZapitBouquet* newBouquet = addBouquet(name, bUser);
|
||||||
char* hidden = xmlGetAttribute(search, "hidden");
|
char* hidden = xmlGetAttribute(search, "hidden");
|
||||||
char* locked = xmlGetAttribute(search, "locked");
|
char* locked = xmlGetAttribute(search, "locked");
|
||||||
@@ -393,14 +352,11 @@ void CBouquetManager::parseBouquetsXml(const char *fname, bool bUser)
|
|||||||
GET_ATTR(channel_node, "s", SCANF_SATELLITE_POSITION_TYPE, satellitePosition);
|
GET_ATTR(channel_node, "s", SCANF_SATELLITE_POSITION_TYPE, satellitePosition);
|
||||||
GET_ATTR(channel_node, "t", SCANF_TRANSPORT_STREAM_ID_TYPE, transport_stream_id);
|
GET_ATTR(channel_node, "t", SCANF_TRANSPORT_STREAM_ID_TYPE, transport_stream_id);
|
||||||
GET_ATTR(channel_node, "frq", SCANF_SATELLITE_POSITION_TYPE, freq);
|
GET_ATTR(channel_node, "frq", SCANF_SATELLITE_POSITION_TYPE, freq);
|
||||||
if(freq > 20000) freq = freq/1000;
|
if(freq > 20000)
|
||||||
|
freq = freq/1000;
|
||||||
|
|
||||||
CZapitChannel* chan;
|
CZapitChannel* chan = CServiceManager::getInstance()->FindChannel(CREATE_CHANNEL_ID64);
|
||||||
|
|
||||||
chan = findChannelByChannelID(CREATE_CHANNEL_ID64);
|
|
||||||
//printf("Bouquet Channel-ID freq %d pos %d id %llx\n", freq, satellitePosition, CREATE_CHANNEL_ID64);
|
|
||||||
if (chan != NULL) {
|
if (chan != NULL) {
|
||||||
//printf("found\n");
|
|
||||||
DBG("%04x %04x %04x %s\n", transport_stream_id, original_network_id, service_id, xmlGetAttribute(channel_node, "n"));
|
DBG("%04x %04x %04x %s\n", transport_stream_id, original_network_id, service_id, xmlGetAttribute(channel_node, "n"));
|
||||||
#if 0
|
#if 0
|
||||||
if(bUser && (name2.length() > 1))
|
if(bUser && (name2.length() > 1))
|
||||||
@@ -427,6 +383,7 @@ DBG("%04x %04x %04x %s\n", transport_stream_id, original_network_id, service_id,
|
|||||||
void CBouquetManager::loadBouquets(bool ignoreBouquetFile)
|
void CBouquetManager::loadBouquets(bool ignoreBouquetFile)
|
||||||
{
|
{
|
||||||
TIMER_START();
|
TIMER_START();
|
||||||
|
clearAll();
|
||||||
if (ignoreBouquetFile == false) {
|
if (ignoreBouquetFile == false) {
|
||||||
parseBouquetsXml(BOUQUETS_XML, false);
|
parseBouquetsXml(BOUQUETS_XML, false);
|
||||||
sortBouquets();
|
sortBouquets();
|
||||||
@@ -437,59 +394,54 @@ TIMER_START();
|
|||||||
TIMER_STOP("[zapit] bouquet loading took");
|
TIMER_STOP("[zapit] bouquet loading took");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CBouquetManager::renumChannels(ZapitChannelList &list, int & counter, char * pname)
|
||||||
|
{
|
||||||
|
for(zapit_list_it_t it = list.begin(); it != list.end(); it++) {
|
||||||
|
if(!(*it)->number)
|
||||||
|
(*it)->number = counter++;
|
||||||
|
|
||||||
|
if(!(*it)->pname && pname)
|
||||||
|
(*it)->pname = pname;
|
||||||
|
|
||||||
|
(*it)->has_bouquet = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void CBouquetManager::makeRemainingChannelsBouquet(void)
|
void CBouquetManager::makeRemainingChannelsBouquet(void)
|
||||||
{
|
{
|
||||||
ZapitChannelList unusedChannels;
|
ZapitChannelList unusedChannels;
|
||||||
set<t_channel_id> chans_processed;
|
bool tomake = CZapit::getInstance()->makeRemainingChannelsBouquet();
|
||||||
bool tomake = config.getBool("makeRemainingChannelsBouquet", true);
|
|
||||||
|
|
||||||
for (tallchans::iterator it = allchans.begin(); it != allchans.end(); it++)
|
/* reset channel number and has_bouquet flag */
|
||||||
it->second.number = 0;
|
CServiceManager::getInstance()->ResetChannelNumbers();
|
||||||
|
|
||||||
int i = 1, j = 1;
|
int i = 1, j = 1;
|
||||||
for (vector<CZapitBouquet*>::const_iterator it = Bouquets.begin(); it != Bouquets.end(); it++) {
|
for (vector<CZapitBouquet*>::const_iterator it = Bouquets.begin(); it != Bouquets.end(); it++) {
|
||||||
for (vector<CZapitChannel*>::iterator jt = (*it)->tvChannels.begin(); jt != (*it)->tvChannels.end(); jt++) {
|
renumChannels((*it)->tvChannels, i, (*it)->bUser ? NULL : (char *) (*it)->Name.c_str());
|
||||||
if(tomake) chans_processed.insert((*jt)->getChannelID());
|
renumChannels((*it)->radioChannels, j, (*it)->bUser ? NULL : (char *) (*it)->Name.c_str());
|
||||||
if(!(*jt)->number) (*jt)->number = i++;
|
|
||||||
if(!(*jt)->pname && !(*it)->bUser) (*jt)->pname = (char *) (*it)->Name.c_str();
|
|
||||||
}
|
}
|
||||||
for (vector<CZapitChannel*>::iterator jt = (*it) ->radioChannels.begin(); jt != (*it)->radioChannels.end(); jt++) {
|
|
||||||
if(tomake) chans_processed.insert((*jt)->getChannelID());
|
if(!tomake || CServiceManager::getInstance()->GetAllUnusedChannels(unusedChannels) == false)
|
||||||
if(!(*jt)->number) (*jt)->number = j++;
|
|
||||||
if(!(*jt)->pname && !(*it)->bUser) (*jt)->pname = (char *) (*it)->Name.c_str();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(!tomake)
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
sort(unusedChannels.begin(), unusedChannels.end(), CmpChannelByChName());
|
||||||
|
|
||||||
// TODO: use locales
|
// TODO: use locales
|
||||||
remainChannels = addBouquet((Bouquets.size() == 0) ? "All Channels" : "Other", false); // UTF-8 encoded
|
remainChannels = addBouquet((Bouquets.size() == 0) ? "All Channels" : "Other", false); // UTF-8 encoded
|
||||||
|
|
||||||
for (tallchans::iterator it = allchans.begin(); it != allchans.end(); it++)
|
|
||||||
if (chans_processed.find(it->first) == chans_processed.end())
|
|
||||||
unusedChannels.push_back(&(it->second));
|
|
||||||
|
|
||||||
sort(unusedChannels.begin(), unusedChannels.end(), CmpChannelByChName());
|
|
||||||
|
|
||||||
for (ZapitChannelList::const_iterator it = unusedChannels.begin(); it != unusedChannels.end(); it++) {
|
for (ZapitChannelList::const_iterator it = unusedChannels.begin(); it != unusedChannels.end(); it++) {
|
||||||
remainChannels->addService(findChannelByChannelID((*it)->getChannelID()));
|
remainChannels->addService(*it);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((remainChannels->tvChannels.empty()) && (remainChannels->radioChannels.empty())) {
|
renumChannels(remainChannels->tvChannels, i);
|
||||||
deleteBouquet(remainChannels);
|
renumChannels(remainChannels->radioChannels, j);
|
||||||
remainChannels = NULL;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
for (vector<CZapitChannel*>::iterator jt = remainChannels->tvChannels.begin(); jt != remainChannels->tvChannels.end(); jt++)
|
|
||||||
if(!(*jt)->number) (*jt)->number = i++;
|
|
||||||
for (vector<CZapitChannel*>::iterator jt = remainChannels->radioChannels.begin(); jt != remainChannels->radioChannels.end(); jt++)
|
|
||||||
if(!(*jt)->number) (*jt)->number = j++;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CBouquetManager::renumServices()
|
void CBouquetManager::renumServices()
|
||||||
{
|
{
|
||||||
if(remainChannels)
|
if(remainChannels)
|
||||||
deleteBouquet(remainChannels);
|
deleteBouquet(remainChannels);
|
||||||
|
|
||||||
remainChannels = NULL;
|
remainChannels = NULL;
|
||||||
|
|
||||||
makeRemainingChannelsBouquet();
|
makeRemainingChannelsBouquet();
|
||||||
@@ -648,15 +600,6 @@ void CBouquetManager::clearAll()
|
|||||||
remainChannels = NULL;
|
remainChannels = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
CZapitChannel* CBouquetManager::findChannelByChannelID(const t_channel_id channel_id)
|
|
||||||
{
|
|
||||||
tallchans_iterator itChannel = allchans.find(channel_id);
|
|
||||||
if (itChannel != allchans.end())
|
|
||||||
return &(itChannel->second);
|
|
||||||
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
CBouquetManager::ChannelIterator::ChannelIterator(CBouquetManager* owner, const bool TV)
|
CBouquetManager::ChannelIterator::ChannelIterator(CBouquetManager* owner, const bool TV)
|
||||||
{
|
{
|
||||||
Owner = owner;
|
Owner = owner;
|
||||||
|
Reference in New Issue
Block a user