本文整理汇总了C++中ZapitChannelList::push_back方法的典型用法代码示例。如果您正苦于以下问题:C++ ZapitChannelList::push_back方法的具体用法?C++ ZapitChannelList::push_back怎么用?C++ ZapitChannelList::push_back使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ZapitChannelList
的用法示例。
在下文中一共展示了ZapitChannelList::push_back方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetAllSatelliteChannels
bool CServiceManager::GetAllSatelliteChannels(ZapitChannelList &list, t_satellite_position position)
{
list.clear();
for (channel_map_iterator_t it = allchans.begin(); it != allchans.end(); it++) {
if(it->second.getSatellitePosition() == position)
list.push_back(&(it->second));
}
return (list.size() != 0);
}
示例2: getRadioChannels
bool CZapitBouquet::getRadioChannels(ZapitChannelList &list, int flags)
{
list.clear();
for (ZapitChannelList::iterator it = radioChannels.begin(); it != radioChannels.end(); ++it) {
if ((*it)->flags & flags)
list.push_back(*it);
}
return (!list.empty());
}
示例3: GetAllNewChannels
bool CServiceManager::GetAllNewChannels(ZapitChannelList &list)
{
list.clear();
for (channel_map_iterator_t it = allchans.begin(); it != allchans.end(); it++) {
if (it->second.isNewChannel)
list.push_back(&(it->second));
}
return (list.size() != 0);
}
示例4: GetAllTvChannels
bool CServiceManager::GetAllTvChannels(ZapitChannelList &list)
{
list.clear();
for (channel_map_iterator_t it = allchans.begin(); it != allchans.end(); it++) {
if (it->second.getServiceType() != ST_DIGITAL_RADIO_SOUND_SERVICE)
list.push_back(&(it->second));
}
return (list.size() != 0);
}
示例5: 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";
}
示例6: 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());
}
示例7: 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++;
}
示例8: func_get_bouquets_with_epg
//-------------------------------------------------------------------------
// TODO: clean up code
// use templates?
//-------------------------------------------------------------------------
std::string CNeutrinoYParser::func_get_bouquets_with_epg(CyhookHandler *hh, std::string para)
{
int BouquetNr = 0;
std::string abnumber, tmp,yresult;
ZapitChannelList channels;
//int num;
int mode = NeutrinoAPI->Zapit->getMode();
ySplitString(para," ",abnumber, tmp);
if(abnumber != "")
BouquetNr = atoi(abnumber.c_str());
if (BouquetNr > 0) {
BouquetNr--;
#if 0
channels = mode == CZapitClient::MODE_RADIO ? g_bouquetManager->Bouquets[BouquetNr]->radioChannels : g_bouquetManager->Bouquets[BouquetNr]->tvChannels;
num = 1 + (mode == CZapitClient::MODE_RADIO ? g_bouquetManager->radioChannelsBegin().getNrofFirstChannelofBouquet(BouquetNr) : g_bouquetManager->tvChannelsBegin().getNrofFirstChannelofBouquet(BouquetNr)) ;
#endif
if (mode == CZapitClient::MODE_RADIO)
g_bouquetManager->Bouquets[BouquetNr]->getRadioChannels(channels);
else
g_bouquetManager->Bouquets[BouquetNr]->getTvChannels(channels);
} else {
CBouquetManager::ChannelIterator cit = mode == CZapitClient::MODE_RADIO ? g_bouquetManager->radioChannelsBegin() : g_bouquetManager->tvChannelsBegin();
for (; !(cit.EndOfChannels()); cit++)
channels.push_back(*cit);
//num = 1;
}
NeutrinoAPI->GetChannelEvents();
int i = 1;
char classname;
t_channel_id current_channel = CZapit::getInstance()->GetCurrentChannelID();
int prozent = 100;
CSectionsdClient::responseGetCurrentNextInfoChannelID currentNextInfo;
std::string timestr;
bool have_logos = false;
if(hh->WebserverConfigList["Tuxbox.LogosURL"] != "")
have_logos = true;
for(int j = 0; j < (int) channels.size(); j++)
{
CZapitChannel * channel = channels[j];
CChannelEvent *event;
event = NeutrinoAPI->ChannelListEvents[channel->channel_id];
classname = (i++ & 1) ? 'a' : 'b';
if (channel->channel_id == current_channel)
classname = 'c';
std::string bouquetstr = (BouquetNr >= 0) ? ("&bouquet=" + itoa(BouquetNr)) : "";
yresult += "<tr>";
if(have_logos)
yresult += string_printf("<td class=\"%c\" width=\"44\" rowspan=\"2\"><a href=\"javascript:do_zap('"
PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS
"')\"><img class=\"channel_logo\" src=\"%s\"/></a></td>", classname, channel->channel_id,
(NeutrinoAPI->getLogoFile(hh->WebserverConfigList["Tuxbox.LogosURL"], channel->channel_id)).c_str());
/* timer slider */
if(event && event->duration > 0)
{
prozent = 100 * (time(NULL) - event->startTime) / event->duration;
yresult += string_printf("<td class=\"%c\"><table border=\"0\" cellspacing=\"0\" cellpadding=\"3\"><tr><td>\n"
"\t<table border=\"0\" rules=\"none\" class=\"cslider cslider_table\">"
"<tr>"
"<td class=\"cslider cslider_used\" width=\"%d\"></td>"
"<td class=\"cslider cslider_free\" width=\"%d\"></td>"
"</tr>"
"</table>\n</td>\n"
, classname
, (prozent / 10) * 3
, (10 - (prozent / 10))*3
);
}
else
{
yresult += string_printf("<td class=\"%c\"><table border=\"0\" cellspacing=\"0\" cellpadding=\"3\"><tr><td>\n"
"\t<table border=\"0\" rules=\"none\" class=\"cslider cslider_table\">"
"<tr>"
"<td class=\"cslider cslider_noepg\"></td>"
"</tr>"
"</table>\n</td>\n"
, classname
);
}
/* channel name and buttons */
yresult += string_printf("<td>\n%s<a class=\"clist\" href=\"javascript:do_zap('"
PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS
"')\"> %d. %s%s</a> <a href=\"javascript:do_epg('"
PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS
"','"
PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS
"')\">%s</a>\n",
((channel->channel_id == current_channel) ? "<a name=\"akt\"></a>" : " "),
channel->channel_id,
//.........这里部分代码省略.........