本文整理汇总了C++中ZapitChannelList::begin方法的典型用法代码示例。如果您正苦于以下问题:C++ ZapitChannelList::begin方法的具体用法?C++ ZapitChannelList::begin怎么用?C++ ZapitChannelList::begin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ZapitChannelList
的用法示例。
在下文中一共展示了ZapitChannelList::begin方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: makeRemainingChannelsBouquet
void CBouquetManager::makeRemainingChannelsBouquet(void)
{
ZapitChannelList unusedChannels;
//FIXME services loaded before config.
//bool tomake = CZapit::getInstance()->makeRemainingChannelsBouquet();
/* reset channel number and has_bouquet flag */
CServiceManager::getInstance()->ResetChannelNumbers();
//int i = 1, j = 1;
int i = CServiceManager::getInstance()->GetMaxNumber(false);
int j = CServiceManager::getInstance()->GetMaxNumber(true);
/* FIXME temp debug */
printf("############## CBouquetManager::makeRemainingChannelsBouquet: numbers start at: tv %d radio %d ############\n", i, j);
for (vector<CZapitBouquet*>::const_iterator it = Bouquets.begin(); it != Bouquets.end(); ++it) {
renumChannels((*it)->tvChannels, i, (*it)->bUser ? NULL : (char *) (*it)->Name.c_str());
renumChannels((*it)->radioChannels, j, (*it)->bUser ? NULL : (char *) (*it)->Name.c_str());
}
if(/*!tomake ||*/ CServiceManager::getInstance()->GetAllUnusedChannels(unusedChannels) == false)
return;
sort(unusedChannels.begin(), unusedChannels.end(), CmpChannelByChName());
// TODO: use locales
remainChannels = addBouquet( Bouquets.empty() ? "All Channels" : "Other", false); // UTF-8 encoded
remainChannels->bOther = true;
for (ZapitChannelList::const_iterator it = unusedChannels.begin(); it != unusedChannels.end(); ++it) {
remainChannels->addService(*it);
}
renumChannels(remainChannels->tvChannels, i);
renumChannels(remainChannels->radioChannels, j);
}
示例2: moveService
void CZapitBouquet::moveService(const unsigned int oldPosition, const unsigned int newPosition, const unsigned char serviceType)
{
ZapitChannelList* channels = &tvChannels;
switch (serviceType) {
case ST_DIGITAL_TELEVISION_SERVICE:
case ST_NVOD_REFERENCE_SERVICE:
case ST_NVOD_TIME_SHIFTED_SERVICE:
channels = &tvChannels;
break;
case ST_DIGITAL_RADIO_SOUND_SERVICE:
channels = &radioChannels;
break;
}
if ((oldPosition < channels->size()) && (newPosition < channels->size())) {
ZapitChannelList::iterator it = channels->begin();
advance(it, oldPosition);
CZapitChannel* tmp = *it;
channels->erase(it);
it = channels->begin();
advance(it, newPosition);
channels->insert(it, tmp);
}
}
示例3: makeRemainingChannelsBouquet
void CBouquetManager::makeRemainingChannelsBouquet(void)
{
ZapitChannelList unusedChannels;
set<t_channel_id> chans_processed;
bool tomake = config.getBool("makeRemainingChannelsBouquet", true);
for (tallchans::iterator it = allchans.begin(); it != allchans.end(); it++)
it->second.number = 0;
int i = 1, j = 1;
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++) {
if(tomake) chans_processed.insert((*jt)->getChannelID());
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(!(*jt)->number) (*jt)->number = j++;
if(!(*jt)->pname && !(*it)->bUser) (*jt)->pname = (char *) (*it)->Name.c_str();
}
}
if(!tomake)
return;
// TODO: use locales
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++) {
remainChannels->addService(findChannelByChannelID((*it)->getChannelID()));
}
if ((remainChannels->tvChannels.empty()) && (remainChannels->radioChannels.empty())) {
deleteBouquet(remainChannels);
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++;
}
示例4: getChannels
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());
}
示例5: renumChannels
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;
if ((*it)->pname)
(*it)->has_bouquet = true;
}
}
示例6: removeService
void CZapitBouquet::removeService(CZapitChannel* oldChannel)
{
if (oldChannel != NULL) {
ZapitChannelList* channels = &tvChannels;
switch (oldChannel->getServiceType()) {
case ST_DIGITAL_TELEVISION_SERVICE:
case ST_NVOD_REFERENCE_SERVICE:
case ST_NVOD_TIME_SHIFTED_SERVICE:
channels = &tvChannels;
break;
case ST_DIGITAL_RADIO_SOUND_SERVICE:
channels = &radioChannels;
break;
}
(*channels).erase(remove(channels->begin(), channels->end(), oldChannel), channels->end());
}
}
示例7: func_set_bouquet_edit_form
//-------------------------------------------------------------------------
// func: Bouquet Edit
//-------------------------------------------------------------------------
std::string CNeutrinoYParser::func_set_bouquet_edit_form(CyhookHandler *hh, std::string)
{
if (!(hh->ParamList["selected"].empty()))
{
int selected = atoi(hh->ParamList["selected"].c_str()) - 1;
int mode = NeutrinoAPI->Zapit->getMode();
ZapitChannelList* channels = mode == CZapitClient::MODE_TV ? &(g_bouquetManager->Bouquets[selected]->tvChannels) : &(g_bouquetManager->Bouquets[selected]->radioChannels);
for(int j = 0; j < (int) channels->size(); j++) {
hh->ParamList["bouquet_channels"] +=
string_printf("<option value=\""
PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS
"\">%s</option>\n",
(*channels)[j]->channel_id,
(*channels)[j]->getName().c_str());
}
ZapitChannelList Channels;
Channels.clear();
if (mode == CZapitClient::MODE_RADIO) {
for (tallchans_iterator it = allchans.begin(); it != allchans.end(); it++)
if (it->second.getServiceType() == ST_DIGITAL_RADIO_SOUND_SERVICE)
Channels.push_back(&(it->second));
} else {
for (tallchans_iterator it = allchans.begin(); it != allchans.end(); it++)
if (it->second.getServiceType() != ST_DIGITAL_RADIO_SOUND_SERVICE)
Channels.push_back(&(it->second));
}
sort(Channels.begin(), Channels.end(), CmpChannelByChName());
for (int i = 0; i < (int) Channels.size(); i++) {
if (!g_bouquetManager->existsChannelInBouquet(selected, Channels[i]->channel_id)){
hh->ParamList["all_channels"] +=
string_printf("<option value=\""
PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS
"\">%s</option>\n",
Channels[i]->channel_id,
Channels[i]->getName().c_str());
}
}
return "";
}
else
return "No Bouquet selected";
}
示例8: func_set_bouquet_edit_form
//-------------------------------------------------------------------------
// func: Bouquet Edit
//-------------------------------------------------------------------------
std::string CNeutrinoYParser::func_set_bouquet_edit_form(CyhookHandler *hh, std::string)
{
if (!(hh->ParamList["selected"].empty()))
{
int selected = atoi(hh->ParamList["selected"].c_str()) - 1;
int mode = NeutrinoAPI->Zapit->getMode();
ZapitChannelList* channels = mode == CZapitClient::MODE_TV ? &(g_bouquetManager->Bouquets[selected]->tvChannels) : &(g_bouquetManager->Bouquets[selected]->radioChannels);
for(int j = 0; j < (int) channels->size(); j++) {
hh->ParamList["bouquet_channels"] +=
string_printf("<option value=\""
PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS
"\">%s</option>\n",
(*channels)[j]->channel_id,
(*channels)[j]->getName().c_str());
}
ZapitChannelList Channels;
Channels.clear();
if (mode == CZapitClient::MODE_RADIO)
CServiceManager::getInstance()->GetAllRadioChannels(Channels);
else
CServiceManager::getInstance()->GetAllTvChannels(Channels);
sort(Channels.begin(), Channels.end(), CmpChannelByChName());
for (int i = 0; i < (int) Channels.size(); i++) {
if (!g_bouquetManager->existsChannelInBouquet(selected, Channels[i]->channel_id)){
hh->ParamList["all_channels"] +=
string_printf("<option value=\""
PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS
"\">%s</option>\n",
Channels[i]->channel_id,
Channels[i]->getName().c_str());
}
}
return "";
}
else
return "No Bouquet selected";
}
示例9: writeChannels
void CBouquetManager::writeChannels(FILE * bouq_fd, ZapitChannelList &list)
{
for(zapit_list_it_t it = list.begin(); it != list.end(); it++)
(*it)->dumpBouquetXml(bouq_fd);
}