本文整理汇总了C++中ZapitChannelList::size方法的典型用法代码示例。如果您正苦于以下问题:C++ ZapitChannelList::size方法的具体用法?C++ ZapitChannelList::size怎么用?C++ ZapitChannelList::size使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ZapitChannelList
的用法示例。
在下文中一共展示了ZapitChannelList::size方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getChannelByChannelID
// -- servicetype 0 queries TV and Radio Channels
CZapitChannel* CZapitBouquet::getChannelByChannelID(const t_channel_id channel_id, const unsigned char serviceType)
{
CZapitChannel* result = NULL;
ZapitChannelList* channels = &tvChannels;
switch (serviceType) {
case ST_RESERVED: // ?
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;
}
unsigned int i;
for (i = 0; (i < channels->size()) && ((*channels)[i]->getChannelID() != channel_id); i++)
{};
if (i<channels->size())
result = (*channels)[i];
if ((serviceType == ST_RESERVED) && (result == NULL)) {
result = getChannelByChannelID(channel_id, ST_DIGITAL_RADIO_SOUND_SERVICE);
}
return result;
}
示例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: setBouquetLock
void CBouquetManager::setBouquetLock(CZapitBouquet* bouquet, bool state)
{
bouquet->bLocked = state;
int add = bouquet->bLocked * 2 - 1;
ZapitChannelList *channels = &bouquet->tvChannels;
for(unsigned int i = 0; i < channels->size(); i++)
((*channels)[i])->bLockCount += add;
channels = &bouquet->radioChannels;
for(unsigned int i = 0; i < channels->size(); i++)
((*channels)[i])->bLockCount += add;
}
示例4: func_get_channels_as_dropdown
//-------------------------------------------------------------------------
// y-func : get_channel_dropdown [<bouquet_nr> [<channel_id>]]
//-------------------------------------------------------------------------
std::string CNeutrinoYParser::func_get_channels_as_dropdown(CyhookHandler *, std::string para)
{
std::string abouquet, achannel_id, yresult, sel;
int bnumber = 1;
int mode = NeutrinoAPI->Zapit->getMode();
ySplitString(para," ",abouquet, achannel_id);
if(abouquet != "")
bnumber = atoi(abouquet.c_str());
if(bnumber > 0) {
bnumber--;
ZapitChannelList channels;
//channels = mode == CZapitClient::MODE_RADIO ? g_bouquetManager->Bouquets[bnumber]->radioChannels : g_bouquetManager->Bouquets[bnumber]->tvChannels;
if (mode == CZapitClient::MODE_RADIO)
g_bouquetManager->Bouquets[bnumber]->getRadioChannels(channels);
else
g_bouquetManager->Bouquets[bnumber]->getTvChannels(channels);
for(int j = 0; j < (int) channels.size(); j++) {
CEPGData epg;
CZapitChannel * channel = channels[j];
char buf[100],id[20];
sprintf(id,PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS,channel->channel_id);
std::string _sid = std::string(id);
sel = (_sid == achannel_id) ? "selected=\"selected\"" : "";
CEitManager::getInstance()->getActualEPGServiceKey(channel->channel_id, &epg);
sprintf(buf,"<option value="PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS" %s>%.20s - %.30s</option>\n", channel->channel_id, sel.c_str(), channel->getName().c_str(),epg.title.c_str());
yresult += buf;
}
}
return yresult;
}
示例5: 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);
}
示例6: 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);
}
示例7: 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);
}
示例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) {
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";
}
示例9: deleteBouquet
void CBouquetManager::deleteBouquet(const CZapitBouquet* bouquet)
{
if (bouquet != NULL) {
BouquetList::iterator it = find(Bouquets.begin(), Bouquets.end(), bouquet);
if (it != Bouquets.end()) {
if ((*it)->bLocked) {
ZapitChannelList *channels = &(*it)->tvChannels;
for(unsigned int i = 0; i < channels->size(); i++)
((*channels)[i])->bLockCount--;
channels = &(*it)->radioChannels;
for(unsigned int i = 0; i < channels->size(); i++)
((*channels)[i])->bLockCount--;
}
Bouquets.erase(it);
delete bouquet;
}
}
}
示例10: 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";
}
示例11: InitZapitChannelHelper
int CSelectChannelWidget::InitZapitChannelHelper(CZapitClient::channelsMode mode)
{
std::vector<CMenuWidget *> toDelete;
CMenuWidget mctv(LOCALE_TIMERLIST_BOUQUETSELECT, NEUTRINO_ICON_SETTINGS, width);
mctv.addIntroItems();
for (int i = 0; i < (int) g_bouquetManager->Bouquets.size(); i++) {
CMenuWidget* mwtv = new CMenuWidget(LOCALE_TIMERLIST_CHANNELSELECT, NEUTRINO_ICON_SETTINGS, width);
toDelete.push_back(mwtv);
mwtv->addIntroItems();
ZapitChannelList channels;
if (mode == CZapitClient::MODE_RADIO)
g_bouquetManager->Bouquets[i]->getRadioChannels(channels);
else
g_bouquetManager->Bouquets[i]->getTvChannels(channels);
for(int j = 0; j < (int) channels.size(); j++) {
CZapitChannel * channel = channels[j];
char cChannelId[60] = {0};
snprintf(cChannelId, sizeof(cChannelId), "ZC%c:%d|%" PRIx64 "#", (mode==CZapitClient::MODE_TV)?'T':'R', channel->number, channel->channel_id);
CMenuForwarder * chan_item = new CMenuForwarder(channel->getName(), true, NULL, this,
(std::string(cChannelId) + channel->getName()).c_str(), CRCInput::RC_nokey, NULL,
channel->scrambled ? NEUTRINO_ICON_SCRAMBLED: (channel->getUrl().empty() ? NULL : NEUTRINO_ICON_STREAMING));
chan_item->setItemButton(NEUTRINO_ICON_BUTTON_OKAY, true);
mwtv->addItem(chan_item);
}
#if 1 // FIXME, probably unneeded by now --martii
if (g_bouquetManager->Bouquets[i]->Name == "extra.zapit_bouquetname_others"
|| g_bouquetManager->Bouquets[i]->Name == "extra.zapit_bouquetname_newchannels")
continue;
#endif
if(!channels.empty() && (!g_bouquetManager->Bouquets[i]->bHidden ))
{
mctv.addItem(new CMenuForwarder(g_bouquetManager->Bouquets[i]->Name, true, NULL, mwtv));
}
}
int res = mctv.exec (NULL, "");
// delete dynamic created objects
for(unsigned int count=0;count<toDelete.size();count++)
{
delete toDelete[count];
}
toDelete.clear();
return res;
}
示例12: 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,
//.........这里部分代码省略.........
示例13: doMenu
int CBouquetList::doMenu()
{
int i = 0, ret = 0;
int select = -1;
static int old_selected = 0;
signed int bouquet_id;
char cnt[5];
CZapitBouquet * tmp, * zapitBouquet;
ZapitChannelList* channels;
if(Bouquets.empty() || g_settings.minimode)
return 0;
zapitBouquet = Bouquets[selected]->zapitBouquet;
/* zapitBouquet not NULL only on real bouquets, satellitePosition is set for providers or SAT */
if(!zapitBouquet && Bouquets[selected]->satellitePosition == INVALID_SAT_POSITION)
return 0;
CMenuWidget* menu = new CMenuWidget(LOCALE_CHANNELLIST_EDIT, NEUTRINO_ICON_SETTINGS);
menu->enableFade(false);
menu->enableSaveScreen(true);
CMenuSelectorTarget * selector = new CMenuSelectorTarget(&select);
int old_epg = zapitBouquet ? zapitBouquet->bScanEpg : 0;
int old_ci = zapitBouquet ? zapitBouquet->bUseCI : 0;
sprintf(cnt, "%d", i);
/* FIXME menu centered different than bouquet list ??? */
/* provider bouquet */
if (zapitBouquet && !zapitBouquet->bUser) {
menu->addItem(new CMenuForwarder(LOCALE_FAVORITES_COPY, true, NULL, selector, cnt, CRCInput::RC_blue), old_selected == i ++);
if (!zapitBouquet->bWebtv && g_settings.epg_scan == CEpgScan::SCAN_SEL)
menu->addItem(new CMenuOptionChooser(LOCALE_MISCSETTINGS_EPG_SCAN, &zapitBouquet->bScanEpg, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true));
if (!zapitBouquet->bWebtv)
menu->addItem(new CMenuOptionChooser(LOCALE_CI_USE, &zapitBouquet->bUseCI, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true));
menu->exec(NULL, "");
delete menu;
delete selector;
printf("CBouquetList::doMenu: %d selected\n", select);
if (old_epg != zapitBouquet->bScanEpg) {
save_bouquets = true;
CNeutrinoApp::getInstance()->MarkBouquetsChanged();
ret = -1;
}
if (old_ci != zapitBouquet->bUseCI) {
channels = &zapitBouquet->tvChannels;
for(int li = 0; li < (int) channels->size(); li++)
(*channels)[li]->bUseCI = zapitBouquet->bUseCI;
channels = &zapitBouquet->radioChannels;
for(int li = 0; li < (int) channels->size(); li++)
(*channels)[li]->bUseCI = zapitBouquet->bUseCI;
CServiceManager::getInstance()->SetCIFilter();
save_bouquets = true;
CNeutrinoApp::getInstance()->MarkBouquetsChanged();
ret = -1;
}
if(select >= 0) {
bool added = false;
old_selected = select;
switch(select) {
case 0: // copy to favorites
hide();
bouquet_id = g_bouquetManager->existsUBouquet(Bouquets[selected]->channelList->getName());
if(bouquet_id < 0) {
tmp = g_bouquetManager->addBouquet(Bouquets[selected]->channelList->getName(), true);
bouquet_id = g_bouquetManager->existsUBouquet(Bouquets[selected]->channelList->getName());
} else
tmp = g_bouquetManager->Bouquets[bouquet_id];
if(bouquet_id < 0)
return 0;
channels = &zapitBouquet->tvChannels;
for(int li = 0; li < (int) channels->size(); li++) {
if (!g_bouquetManager->existsChannelInBouquet(bouquet_id, ((*channels)[li])->getChannelID())) {
added = true;
tmp->addService((*channels)[li]);
}
}
channels = &zapitBouquet->radioChannels;
for(int li = 0; li < (int) channels->size(); li++) {
if (!g_bouquetManager->existsChannelInBouquet(bouquet_id, ((*channels)[li])->getChannelID())) {
added = true;
tmp->addService((*channels)[li]);
}
}
if (added) {
CNeutrinoApp::getInstance()->MarkFavoritesChanged();
CNeutrinoApp::getInstance()->MarkChannelsInit();
return 1;
}
break;
default:
break;
}
}
} else {
/* user or satellite bouquet */
//.........这里部分代码省略.........
示例14: doMenu
int CBouquetList::doMenu()
{
int i = 0;
int select = -1;
static int old_selected = 0;
int ret = menu_return::RETURN_NONE;
signed int bouquet_id;
char cnt[5];
CZapitBouquet * tmp, * zapitBouquet;
ZapitChannelList* channels;
if(!Bouquets.size() || g_settings.minimode)
return 0;
zapitBouquet = Bouquets[selected]->zapitBouquet;
/* zapitBouquet not NULL only on real bouquets, not on virtual SAT or HD */
if(!zapitBouquet)
return 0;
CMenuWidget* menu = new CMenuWidget(LOCALE_CHANNELLIST_EDIT, NEUTRINO_ICON_SETTINGS);
CMenuSelectorTarget * selector = new CMenuSelectorTarget(&select);
sprintf(cnt, "%d", i);
if(!zapitBouquet->bUser) {
menu->addItem(new CMenuForwarder(LOCALE_FAVORITES_COPY, true, NULL, selector, cnt, CRCInput::RC_blue, NEUTRINO_ICON_BUTTON_BLUE), old_selected == i ++);
ret = menu->exec(NULL, "");
delete menu;
delete selector;
printf("CBouquetList::doMenu: %d selected\n", select);
if(select >= 0) {
old_selected = select;
switch(select) {
case 0:
hide();
bouquet_id = g_bouquetManager->existsUBouquet(Bouquets[selected]->channelList->getName());
if(bouquet_id < 0) {
tmp = g_bouquetManager->addBouquet(Bouquets[selected]->channelList->getName(), true);
} else
tmp = g_bouquetManager->Bouquets[bouquet_id];
channels = &zapitBouquet->tvChannels;
for(int i = 0; i < (int) channels->size(); i++)
tmp->addService((*channels)[i]);
return 1;
break;
default:
break;
}
}
} else {
menu->addItem(new CMenuForwarder(LOCALE_BOUQUETEDITOR_DELETE, true, NULL, selector, cnt, CRCInput::RC_blue, NEUTRINO_ICON_BUTTON_BLUE), old_selected == i ++);
ret = menu->exec(NULL, "");
delete menu;
delete selector;
printf("CBouquetList::doMenu: %d selected\n", select);
if(select >= 0) {
old_selected = select;
switch(select) {
case 0:
hide();
bouquet_id = g_bouquetManager->existsUBouquet(Bouquets[selected]->channelList->getName());
if(bouquet_id >= 0) {
g_bouquetManager->deleteBouquet(bouquet_id);
return 1;
}
break;
default:
break;
}
}
}
return 0;
}