本文整理汇总了C++中ZapitChannelList::empty方法的典型用法代码示例。如果您正苦于以下问题:C++ ZapitChannelList::empty方法的具体用法?C++ ZapitChannelList::empty怎么用?C++ ZapitChannelList::empty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ZapitChannelList
的用法示例。
在下文中一共展示了ZapitChannelList::empty方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: func_get_bouquets_as_dropdown
//-------------------------------------------------------------------------
// y-func : get_bouquets_as_dropdown [<bouquet>] <doshowhidden>
//-------------------------------------------------------------------------
std::string CNeutrinoYParser::func_get_bouquets_as_dropdown(CyhookHandler *, std::string para)
{
std::string yresult, sel, nr_str, do_show_hidden;
int nr=1;
ySplitString(para," ",nr_str, do_show_hidden);
if(nr_str != "")
nr = atoi(nr_str.c_str());
int mode = NeutrinoAPI->Zapit->getMode();
for (int i = 0; i < (int) g_bouquetManager->Bouquets.size(); i++) {
//ZapitChannelList &channels = mode == CZapitClient::MODE_RADIO ? g_bouquetManager->Bouquets[i]->radioChannels : g_bouquetManager->Bouquets[i]->tvChannels;
ZapitChannelList channels;
if (mode == CZapitClient::MODE_RADIO)
g_bouquetManager->Bouquets[i]->getRadioChannels(channels);
else
g_bouquetManager->Bouquets[i]->getTvChannels(channels);
sel=(nr==(i+1)) ? "selected=\"selected\"" : "";
if(!channels.empty() && (!g_bouquetManager->Bouquets[i]->bHidden || do_show_hidden == "true"))
yresult += string_printf("<option value=%u %s>%s</option>\n", i + 1, sel.c_str(),
std::string(g_bouquetManager->Bouquets[i]->bFav ? g_Locale->getText(LOCALE_FAVORITES_BOUQUETNAME) :g_bouquetManager->Bouquets[i]->Name.c_str()).c_str());
//yresult += string_printf("<option value=%u %s>%s</option>\n", i + 1, sel.c_str(), (encodeString(std::string(g_bouquetManager->Bouquets[i]->Name.c_str()))).c_str());
}
return yresult;
}
示例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: 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());
}
示例4: func_get_bouquets_as_templatelist
//-------------------------------------------------------------------------
// y-func : get_bouquets_as_templatelist <tempalte> [~<do_show_hidden>]
// TODO: select actual Bouquet
//-------------------------------------------------------------------------
std::string CNeutrinoYParser::func_get_bouquets_as_templatelist(CyhookHandler *, std::string para)
{
std::string yresult, ytemplate, do_show_hidden;
ySplitString(para,"~",ytemplate, do_show_hidden);
//ytemplate += "\n"; //FIXME add newline to printf
int mode = NeutrinoAPI->Zapit->getMode();
for (int i = 0; i < (int) g_bouquetManager->Bouquets.size(); i++) {
//ZapitChannelList &channels = mode == CZapitClient::MODE_RADIO ? g_bouquetManager->Bouquets[i]->radioChannels : g_bouquetManager->Bouquets[i]->tvChannels;
ZapitChannelList channels;
if (mode == CZapitClient::MODE_RADIO)
g_bouquetManager->Bouquets[i]->getRadioChannels(channels);
else
g_bouquetManager->Bouquets[i]->getTvChannels(channels);
#if HAVE_DUCKBOX_HARDWARE
if(!channels.empty() && (!g_bouquetManager->Bouquets[i]->bHidden || do_show_hidden == "true") && g_bouquetManager->Bouquets[i]->bUser) {
#else
if(!channels.empty() && (!g_bouquetManager->Bouquets[i]->bHidden || do_show_hidden == "true")) {
#endif
yresult += string_printf(ytemplate.c_str(), i + 1, g_bouquetManager->Bouquets[i]->bFav ? g_Locale->getText(LOCALE_FAVORITES_BOUQUETNAME) : g_bouquetManager->Bouquets[i]->Name.c_str());
yresult += "\r\n";
}
}
return yresult;
}
//-------------------------------------------------------------------------
// y-func : get_actual_bouquet_number
//-------------------------------------------------------------------------
std::string CNeutrinoYParser::func_get_actual_bouquet_number(CyhookHandler *, std::string)
{
int actual=0;
for (int i = 0; i < (int) g_bouquetManager->Bouquets.size(); i++) {
if(g_bouquetManager->existsChannelInBouquet(i, CZapit::getInstance()->GetCurrentChannelID())) {
actual=i+1;
break;
}
}
return std::string(itoa(actual));
}
示例5: 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;
}
示例6: func_bouquet_editor_main
//-------------------------------------------------------------------------
// func: Bouquet Editor List
//-------------------------------------------------------------------------
std::string CNeutrinoYParser::func_bouquet_editor_main(CyhookHandler *hh, std::string para)
{
std::string yresult;
int selected = -1;
if (hh->ParamList["saved"] == "1")
hh->ParamList["have_saved"]="true";
if (hh->ParamList["selected"] != "")
selected = atoi(hh->ParamList["selected"].c_str());
int bouquetSize = (int) g_bouquetManager->Bouquets.size();
int mode = NeutrinoAPI->Zapit->getMode();
for (int i = 0; i < (int) g_bouquetManager->Bouquets.size(); i++) {
ZapitChannelList * channels = mode == CZapitClient::MODE_RADIO ? &g_bouquetManager->Bouquets[i]->radioChannels : &g_bouquetManager->Bouquets[i]->tvChannels;
if(!channels->empty() || g_bouquetManager->Bouquets[i]->bUser){
CZapitBouquet * bouquet = g_bouquetManager->Bouquets[i];
char classname = ((i & 1) == 0) ? 'a' : 'b';
classname = (selected == (int) i + 1)?'c':classname;
std::string akt = (selected == (int) (i + 1)) ? "<a name=\"akt\"></a>" : "";
// lock/unlock
std::string lock_action = (bouquet->bLocked) ? "unlock" : "lock";
std::string lock_img = (bouquet->bLocked) ? "lock" : "unlock";
std::string lock_alt = (bouquet->bLocked) ? "unlock" : "lock";
// hide/show
std::string hidden_action= (bouquet->bHidden) ? "show" : "hide";
std::string hidden_img = (bouquet->bHidden) ? "hidden" : "visible";
std::string hidden_alt = (bouquet->bHidden) ? "hide" : "show";
// move down
std::string down_show = (i + 1 < bouquetSize) ? "visible" : "hidden";
//move up
std::string up_show = (i > 0) ? "visible" : "hidden";
// build from template
yresult += string_printf(para.c_str(), classname, akt.c_str(),
i + 1, lock_action.c_str(), lock_img.c_str(), lock_alt.c_str(), //lock
i + 1, hidden_action.c_str(), hidden_img.c_str(), hidden_alt.c_str(), //hhidden
i + 1, bouquet->Name.c_str(), bouquet->Name.c_str(), //link
i + 1, bouquet->Name.c_str(), //rename
i + 1, bouquet->Name.c_str(), //delete
down_show.c_str(), i + 1, //down arrow
up_show.c_str(), i + 1); //up arrow
}
}
return yresult;
}
示例7: func_get_bouquets_as_templatelist
//-------------------------------------------------------------------------
// y-func : get_bouquets_as_templatelist <tempalte> [~<do_show_hidden>]
// TODO: select actual Bouquet
//-------------------------------------------------------------------------
std::string CNeutrinoYParser::func_get_bouquets_as_templatelist(CyhookHandler *, std::string para)
{
std::string yresult, ytemplate, do_show_hidden;
ySplitString(para,"~",ytemplate, do_show_hidden);
//ytemplate += "\n"; //FIXME add newline to printf
int mode = NeutrinoAPI->Zapit->getMode();
for (int i = 0; i < (int) g_bouquetManager->Bouquets.size(); i++) {
//ZapitChannelList &channels = mode == CZapitClient::MODE_RADIO ? g_bouquetManager->Bouquets[i]->radioChannels : g_bouquetManager->Bouquets[i]->tvChannels;
ZapitChannelList channels;
if (mode == CZapitClient::MODE_RADIO)
g_bouquetManager->Bouquets[i]->getRadioChannels(channels);
else
g_bouquetManager->Bouquets[i]->getTvChannels(channels);
if(!channels.empty() && (!g_bouquetManager->Bouquets[i]->bHidden || do_show_hidden == "true")) {
yresult += string_printf(ytemplate.c_str(), i + 1, g_bouquetManager->Bouquets[i]->bFav ? g_Locale->getText(LOCALE_FAVORITES_BOUQUETNAME) : g_bouquetManager->Bouquets[i]->Name.c_str());
yresult += "\r\n";
}
}
return yresult;
}