mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-09-03 19:01:13 +02:00
zapit/src/bouquets.cpp: add getChannels() with mode param, add fopen error check
Origin commit data
------------------
Branch: ni/coolstream
Commit: c605141b98
Author: [CST] Focus <focus.cst@gmail.com>
Date: 2014-10-10 (Fri, 10 Oct 2014)
------------------
No further description and justification available within origin commit message!
------------------
This commit was generated by Migit
This commit is contained in:
@@ -60,6 +60,7 @@ class CZapitBouquet
|
|||||||
void sortBouquetByNumber(void);
|
void sortBouquetByNumber(void);
|
||||||
bool getTvChannels(ZapitChannelList &list, int flags = CZapitChannel::PRESENT);
|
bool getTvChannels(ZapitChannelList &list, int flags = CZapitChannel::PRESENT);
|
||||||
bool getRadioChannels(ZapitChannelList &list, int flags = CZapitChannel::PRESENT);
|
bool getRadioChannels(ZapitChannelList &list, int flags = CZapitChannel::PRESENT);
|
||||||
|
bool getChannels(ZapitChannelList &list, bool tv, int flags = CZapitChannel::PRESENT);
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef vector<CZapitBouquet *> BouquetList;
|
typedef vector<CZapitBouquet *> BouquetList;
|
||||||
|
@@ -183,6 +183,16 @@ bool CZapitBouquet::getRadioChannels(ZapitChannelList &list, int flags)
|
|||||||
return (!list.empty());
|
return (!list.empty());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool CZapitBouquet::getChannels(ZapitChannelList &list, bool tv, int flags)
|
||||||
|
{
|
||||||
|
list.clear();
|
||||||
|
ZapitChannelList *current = tv ? &tvChannels : &radioChannels;
|
||||||
|
for (ZapitChannelList::iterator it = current->begin(); it != current->end(); ++it) {
|
||||||
|
if ((*it)->flags & flags)
|
||||||
|
list.push_back(*it);
|
||||||
|
}
|
||||||
|
return (!list.empty());
|
||||||
|
}
|
||||||
#if 0
|
#if 0
|
||||||
size_t CZapitBouquet::recModeRadioSize(const transponder_id_t transponder_id)
|
size_t CZapitBouquet::recModeRadioSize(const transponder_id_t transponder_id)
|
||||||
{
|
{
|
||||||
@@ -248,7 +258,12 @@ void CBouquetManager::saveBouquets(void)
|
|||||||
{
|
{
|
||||||
FILE * bouq_fd;
|
FILE * bouq_fd;
|
||||||
|
|
||||||
|
printf("CBouquetManager::saveBouquets: %s\n", BOUQUETS_XML);
|
||||||
bouq_fd = fopen(BOUQUETS_XML, "w");
|
bouq_fd = fopen(BOUQUETS_XML, "w");
|
||||||
|
if (!bouq_fd) {
|
||||||
|
perror(BOUQUETS_XML);
|
||||||
|
return;
|
||||||
|
}
|
||||||
fprintf(bouq_fd, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<zapit>\n");
|
fprintf(bouq_fd, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<zapit>\n");
|
||||||
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) {
|
||||||
@@ -268,7 +283,12 @@ void CBouquetManager::saveUBouquets(void)
|
|||||||
{
|
{
|
||||||
FILE * ubouq_fd;
|
FILE * ubouq_fd;
|
||||||
|
|
||||||
|
printf("CBouquetManager::saveUBouquets: %s\n", UBOUQUETS_XML);
|
||||||
ubouq_fd = fopen(UBOUQUETS_XML, "w");
|
ubouq_fd = fopen(UBOUQUETS_XML, "w");
|
||||||
|
if (!ubouq_fd) {
|
||||||
|
perror(BOUQUETS_XML);
|
||||||
|
return;
|
||||||
|
}
|
||||||
fprintf(ubouq_fd, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<zapit>\n");
|
fprintf(ubouq_fd, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<zapit>\n");
|
||||||
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) {
|
||||||
|
Reference in New Issue
Block a user