本文整理汇总了C++中ZapitChannelList类的典型用法代码示例。如果您正苦于以下问题:C++ ZapitChannelList类的具体用法?C++ ZapitChannelList怎么用?C++ ZapitChannelList使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ZapitChannelList类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
开发者ID:benny-ua,项目名称:martiis-neutrino-mp,代码行数:33,代码来源:bouquets.cpp
示例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);
}
开发者ID:benny-ua,项目名称:martiis-neutrino-mp,代码行数:35,代码来源:bouquets.cpp
示例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;
}
开发者ID:Coolstreamto,项目名称:Coolto,代码行数:28,代码来源:neutrinoyparser.cpp
示例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);
}
开发者ID:FFTEAM,项目名称:evolux-spark-sh4,代码行数:9,代码来源:getservices.cpp
示例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);
}
开发者ID:FFTEAM,项目名称:evolux-spark-sh4,代码行数:9,代码来源:getservices.cpp
示例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);
}
开发者ID:FFTEAM,项目名称:evolux-spark-sh4,代码行数:9,代码来源:getservices.cpp
示例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());
}
开发者ID:benny-ua,项目名称:martiis-neutrino-mp,代码行数:9,代码来源:bouquets.cpp
示例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;
}
}
开发者ID:benny-ua,项目名称:martiis-neutrino-mp,代码行数:13,代码来源:bouquets.cpp
示例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;
}
开发者ID:FFTEAM,项目名称:neutrino-mp-cst-next,代码行数:14,代码来源:bouquets.cpp
示例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;
}
开发者ID:benny-ua,项目名称:martiis-neutrino-mp,代码行数:47,代码来源:zapit_setup.cpp
示例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;
}
开发者ID:Coolstreamto,项目名称:Coolto,代码行数:49,代码来源:neutrinoyparser.cpp
示例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);
}
}
开发者ID:benny-ua,项目名称:martiis-neutrino-mp,代码行数:26,代码来源:bouquets.cpp
示例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());
}
}
开发者ID:Firmeware,项目名称:max-tdt,代码行数:18,代码来源:bouquets.cpp
示例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;
}
}
}
开发者ID:FFTEAM,项目名称:neutrino-mp-cst-next,代码行数:21,代码来源:bouquets.cpp
示例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));
}
开发者ID:redblue-pkt,项目名称:neutrino-mp-cst-next,代码行数:43,代码来源:neutrinoyparser.cpp
示例16: atoi
//-------------------------------------------------------------------------
// 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";
}
开发者ID:FFTEAM,项目名称:evolux-spark-sh4,代码行数:46,代码来源:neutrinoyparser.cpp
示例17: 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());
}
开发者ID:FFTEAM,项目名称:neutrino-mp-cst-next,代码行数:10,代码来源:bouquets.cpp
示例18: addBouquet
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++;
}
开发者ID:Firmeware,项目名称:max-tdt,代码行数:48,代码来源:bouquets.cpp
示例19: 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,
//.........这里部分代码省略.........
开发者ID:Coolstreamto,项目名称:Coolto,代码行数:101,代码来源:neutrinoyparser.cpp
示例20: 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;
}
开发者ID:FFTEAM,项目名称:evolux-spark-sh4,代码行数:73,代码来源:bouquetlist.cpp
注:本文中的ZapitChannelList类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论