本文整理汇总了C++中ZapitChannelList类的典型用法代码示例。如果您正苦于以下问题:C++ ZapitChannelList类的具体用法?C++ ZapitChannelList怎么用?C++ ZapitChannelList使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ZapitChannelList类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: printf
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);
}
示例3: ySplitString
//-------------------------------------------------------------------------
// 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;
}
示例4: 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);
}
示例5: 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);
}
示例6: 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);
}
示例7: 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());
}
示例8: 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;
}
}
示例9: 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;
}
示例10: mctv
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;
}
示例11: atoi
//-------------------------------------------------------------------------
// 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;
}
示例12: switch
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);
}
}
示例13: 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());
}
}
示例14: find
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;
}
}
}
示例15: ySplitString
//-------------------------------------------------------------------------
// 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));
}