- bouquetlist: formatting code using astyle; some manual code nicenings

Signed-off-by: Thilo Graf <dbt@novatux.de>
This commit is contained in:
svenhoefer
2021-12-14 11:11:25 +01:00
committed by Thilo Graf
parent 265d7e462c
commit 62253613e1
2 changed files with 290 additions and 206 deletions

View File

@@ -33,7 +33,6 @@
#include <gui/color.h> #include <gui/color.h>
#include <gui/eventlist.h> #include <gui/eventlist.h>
#include <gui/infoviewer.h> #include <gui/infoviewer.h>
#include <gui/components/cc.h> #include <gui/components/cc.h>
#include <gui/widget/menue.h> #include <gui/widget/menue.h>
#include <gui/widget/menue_options.h> #include <gui/widget/menue_options.h>
@@ -62,14 +61,14 @@
extern CBouquetManager *g_bouquetManager; extern CBouquetManager *g_bouquetManager;
CBouquetList::CBouquetList(const char * const Name) CBouquetList::CBouquetList(const char *const Name)
{ {
frameBuffer = CFrameBuffer::getInstance(); frameBuffer = CFrameBuffer::getInstance();
selected = 0; selected = 0;
liststart = 0; liststart = 0;
favonly = false; favonly = false;
save_bouquets = false; save_bouquets = false;
if(Name == NULL) if (Name == NULL)
name = g_Locale->getText(LOCALE_BOUQUETLIST_HEAD); name = g_Locale->getText(LOCALE_BOUQUETLIST_HEAD);
else else
name = Name; name = Name;
@@ -83,31 +82,33 @@ CBouquetList::~CBouquetList()
Bouquets.clear(); Bouquets.clear();
} }
CBouquet* CBouquetList::addBouquet(CZapitBouquet * zapitBouquet) CBouquet *CBouquetList::addBouquet(CZapitBouquet *zapitBouquet)
{ {
int BouquetKey= Bouquets.size();//FIXME not used ? int BouquetKey = Bouquets.size(); // FIXME not used ?
CBouquet* tmp = new CBouquet(BouquetKey, zapitBouquet->bName.c_str(), zapitBouquet->bLocked, !zapitBouquet->bUser); CBouquet *tmp = new CBouquet(BouquetKey, zapitBouquet->bName.c_str(), zapitBouquet->bLocked, !zapitBouquet->bUser);
tmp->zapitBouquet = zapitBouquet; tmp->zapitBouquet = zapitBouquet;
Bouquets.push_back(tmp); Bouquets.push_back(tmp);
return tmp; return tmp;
} }
CBouquet* CBouquetList::addBouquet(const char * const pname, int BouquetKey, bool locked) CBouquet *CBouquetList::addBouquet(const char *const pname, int BouquetKey, bool locked)
{ {
if ( BouquetKey==-1 ) if (BouquetKey == -1)
BouquetKey= Bouquets.size(); BouquetKey = Bouquets.size();
CBouquet* tmp = new CBouquet( BouquetKey, pname, locked, true); CBouquet *tmp = new CBouquet(BouquetKey, pname, locked, true);
Bouquets.push_back(tmp); Bouquets.push_back(tmp);
return(tmp); return (tmp);
} }
void CBouquetList::deleteBouquet(CBouquet*bouquet) void CBouquetList::deleteBouquet(CBouquet *bouquet)
{ {
if (bouquet != NULL) { if (bouquet != NULL)
{
std::vector<CBouquet *>::iterator it = find(Bouquets.begin(), Bouquets.end(), bouquet); std::vector<CBouquet *>::iterator it = find(Bouquets.begin(), Bouquets.end(), bouquet);
if (it != Bouquets.end()) { if (it != Bouquets.end())
{
Bouquets.erase(it); Bouquets.erase(it);
delete bouquet; delete bouquet;
} }
@@ -120,11 +121,13 @@ t_bouquet_id CBouquetList::getActiveBouquetNumber()
} }
#if 0 #if 0
void CBouquetList::adjustToChannel( int nChannelNr) void CBouquetList::adjustToChannel(int nChannelNr)
{ {
for (uint32_t i=0; i<Bouquets.size(); i++) { for (uint32_t i = 0; i < Bouquets.size(); i++)
{
int nChannelPos = Bouquets[i]->channelList->hasChannel(nChannelNr); int nChannelPos = Bouquets[i]->channelList->hasChannel(nChannelNr);
if (nChannelPos > -1) { if (nChannelPos > -1)
{
selected = i; selected = i;
Bouquets[i]->channelList->setSelected(nChannelPos); Bouquets[i]->channelList->setSelected(nChannelPos);
return; return;
@@ -132,9 +135,11 @@ void CBouquetList::adjustToChannel( int nChannelNr)
} }
} }
#endif #endif
bool CBouquetList::hasChannelID(t_channel_id channel_id) bool CBouquetList::hasChannelID(t_channel_id channel_id)
{ {
for (uint32_t i = 0; i < Bouquets.size(); i++) { for (uint32_t i = 0; i < Bouquets.size(); i++)
{
int nChannelPos = Bouquets[i]->channelList->hasChannelID(channel_id); int nChannelPos = Bouquets[i]->channelList->hasChannelID(channel_id);
if (nChannelPos > -1) if (nChannelPos > -1)
return true; return true;
@@ -144,21 +149,25 @@ bool CBouquetList::hasChannelID(t_channel_id channel_id)
bool CBouquetList::adjustToChannelID(t_channel_id channel_id) bool CBouquetList::adjustToChannelID(t_channel_id channel_id)
{ {
//printf("CBouquetList::adjustToChannelID [%s] to %llx, selected %d size %d\n", name.c_str(), channel_id, selected, Bouquets.size()); //printf("CBouquetList::adjustToChannelID [%s] to %llx, selected %d size %d\n", name.c_str(), channel_id, selected, Bouquets.size());
if(selected < Bouquets.size()) { if (selected < Bouquets.size())
{
int nChannelPos = Bouquets[selected]->channelList->hasChannelID(channel_id); int nChannelPos = Bouquets[selected]->channelList->hasChannelID(channel_id);
if(nChannelPos > -1) { if (nChannelPos > -1)
//printf("CBouquetList::adjustToChannelID [%s] to %llx -> not needed\n", name.c_str(), channel_id); {
//printf("CBouquetList::adjustToChannelID [%s] to %llx -> not needed\n", name.c_str(), channel_id);
Bouquets[selected]->channelList->setSelected(nChannelPos); Bouquets[selected]->channelList->setSelected(nChannelPos);
return true; return true;
} }
} }
//printf("CBouquetList::adjustToChannelID [%s] to %llx\n", name.c_str(), channel_id); //printf("CBouquetList::adjustToChannelID [%s] to %llx\n", name.c_str(), channel_id);
for (uint32_t i=0; i < Bouquets.size(); i++) { for (uint32_t i = 0; i < Bouquets.size(); i++)
if(i == selected) {
if (i == selected)
continue; continue;
int nChannelPos = Bouquets[i]->channelList->hasChannelID(channel_id); int nChannelPos = Bouquets[i]->channelList->hasChannelID(channel_id);
if (nChannelPos > -1) { if (nChannelPos > -1)
{
selected = i; selected = i;
Bouquets[i]->channelList->setSelected(nChannelPos); Bouquets[i]->channelList->setSelected(nChannelPos);
return true; return true;
@@ -166,47 +175,50 @@ bool CBouquetList::adjustToChannelID(t_channel_id channel_id)
} }
return false; return false;
} }
/* used in channellist to switch bouquets up/down */
int CBouquetList::showChannelList( int nBouquet) // used in channellist to switch bouquets up/down
int CBouquetList::showChannelList(int nBouquet)
{ {
if ((nBouquet < 0)|| (nBouquet >= (int) Bouquets.size())) if ((nBouquet < 0) || (nBouquet >= (int) Bouquets.size()))
nBouquet = selected; nBouquet = selected;
int nNewChannel = Bouquets[nBouquet]->channelList->exec(); int nNewChannel = Bouquets[nBouquet]->channelList->exec();
if (nNewChannel > -1) { if (nNewChannel > -1)
{
selected = nBouquet; selected = nBouquet;
nNewChannel = -2; nNewChannel = -2;
} }
return nNewChannel; return nNewChannel;
} }
/* bShowChannelList default to false , return seems not checked anywhere */
int CBouquetList::activateBouquet( int id, bool bShowChannelList) // bShowChannelList default to false , return seems not checked anywhere
int CBouquetList::activateBouquet(int id, bool bShowChannelList)
{ {
int res = -1; int res = -1;
if((id >= 0) && (id < (int) Bouquets.size())) if ((id >= 0) && (id < (int) Bouquets.size()))
selected = id; selected = id;
if (bShowChannelList) { if (bShowChannelList)
{
res = Bouquets[selected]->channelList->exec(); res = Bouquets[selected]->channelList->exec();
if(res > -1) if (res > -1)
res = -2; res = -2;
} }
return res; return res;
} }
int CBouquetList::exec( bool bShowChannelList) int CBouquetList::exec(bool bShowChannelList)
{ {
/* select bouquet to show */
int res = show(bShowChannelList); int res = show(bShowChannelList);
//printf("Bouquet-exec: res %d bShowChannelList %d\n", res, bShowChannelList); fflush(stdout); //printf("Bouquet-exec: res %d bShowChannelList %d\n", res, bShowChannelList); fflush(stdout);
if(!bShowChannelList) if (!bShowChannelList)
return res; return res;
/* if >= 0, call activateBouquet to show channel list */
if ( res > -1) { if (res > -1)
return activateBouquet(selected, bShowChannelList); return activateBouquet(selected, bShowChannelList);
}
return res; return res;
} }
@@ -217,28 +229,31 @@ int CBouquetList::doMenu()
static int old_selected = 0; static int old_selected = 0;
signed int bouquet_id; signed int bouquet_id;
char cnt[5]; char cnt[5];
CZapitBouquet * tmp, * zapitBouquet; CZapitBouquet *tmp, *zapitBouquet;
ZapitChannelList* channels; ZapitChannelList *channels;
if(Bouquets.empty() || g_settings.minimode) if (Bouquets.empty() || g_settings.minimode)
return 0; return 0;
zapitBouquet = Bouquets[selected]->zapitBouquet; 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) // zapitBouquet not NULL only on real bouquets, satellitePosition is set for providers or SAT
if (!zapitBouquet && Bouquets[selected]->satellitePosition == INVALID_SAT_POSITION)
return 0; return 0;
CMenuWidget* menu = new CMenuWidget(LOCALE_CHANNELLIST_EDIT, NEUTRINO_ICON_SETTINGS); CMenuWidget *menu = new CMenuWidget(LOCALE_CHANNELLIST_EDIT, NEUTRINO_ICON_SETTINGS);
menu->enableFade(false); menu->enableFade(false);
menu->enableSaveScreen(true); menu->enableSaveScreen(true);
CMenuSelectorTarget * selector = new CMenuSelectorTarget(&select); CMenuSelectorTarget *selector = new CMenuSelectorTarget(&select);
int old_epg = zapitBouquet ? zapitBouquet->bScanEpg : 0; int old_epg = zapitBouquet ? zapitBouquet->bScanEpg : 0;
int old_ci = zapitBouquet ? zapitBouquet->bUseCI : 0; int old_ci = zapitBouquet ? zapitBouquet->bUseCI : 0;
sprintf(cnt, "%d", i); sprintf(cnt, "%d", i);
/* FIXME menu centered different than bouquet list ??? */
/* provider bouquet */ // FIXME menu centered different than bouquet list ???
if (zapitBouquet && !zapitBouquet->bUser) { // provider bouquet
if (zapitBouquet && !zapitBouquet->bUser)
{
menu->addItem(new CMenuForwarder(LOCALE_FAVORITES_COPY, true, NULL, selector, cnt, CRCInput::RC_blue), old_selected == i ++); menu->addItem(new CMenuForwarder(LOCALE_FAVORITES_COPY, true, NULL, selector, cnt, CRCInput::RC_blue), old_selected == i ++);
if ((!zapitBouquet->bWebtv && !zapitBouquet->bWebradio) && g_settings.epg_scan == CEpgScan::SCAN_SEL) if ((!zapitBouquet->bWebtv && !zapitBouquet->bWebradio) && 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)); menu->addItem(new CMenuOptionChooser(LOCALE_MISCSETTINGS_EPG_SCAN, &zapitBouquet->bScanEpg, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true));
@@ -248,18 +263,20 @@ int CBouquetList::doMenu()
delete menu; delete menu;
delete selector; delete selector;
printf("CBouquetList::doMenu: %d selected\n", select); printf("CBouquetList::doMenu: %d selected\n", select);
if (old_epg != zapitBouquet->bScanEpg) { if (old_epg != zapitBouquet->bScanEpg)
{
save_bouquets = true; save_bouquets = true;
CNeutrinoApp::getInstance()->MarkBouquetsChanged(); CNeutrinoApp::getInstance()->MarkBouquetsChanged();
ret = -1; ret = -1;
} }
if (old_ci != zapitBouquet->bUseCI) { if (old_ci != zapitBouquet->bUseCI)
{
channels = &zapitBouquet->tvChannels; channels = &zapitBouquet->tvChannels;
for(int li = 0; li < (int) channels->size(); li++) for (int li = 0; li < (int) channels->size(); li++)
(*channels)[li]->bUseCI = zapitBouquet->bUseCI; (*channels)[li]->bUseCI = zapitBouquet->bUseCI;
channels = &zapitBouquet->radioChannels; channels = &zapitBouquet->radioChannels;
for(int li = 0; li < (int) channels->size(); li++) for (int li = 0; li < (int) channels->size(); li++)
(*channels)[li]->bUseCI = zapitBouquet->bUseCI; (*channels)[li]->bUseCI = zapitBouquet->bUseCI;
CServiceManager::getInstance()->SetCIFilter(); CServiceManager::getInstance()->SetCIFilter();
@@ -268,37 +285,47 @@ int CBouquetList::doMenu()
ret = -1; ret = -1;
} }
if(select >= 0) { if (select >= 0)
{
bool added = false; bool added = false;
old_selected = select; old_selected = select;
switch(select) { switch (select)
case 0: // copy to favorites {
// copy to favorites
case 0:
hide(); hide();
bouquet_id = g_bouquetManager->existsUBouquet(Bouquets[selected]->channelList->getName()); bouquet_id = g_bouquetManager->existsUBouquet(Bouquets[selected]->channelList->getName());
if(bouquet_id < 0) { if (bouquet_id < 0)
{
tmp = g_bouquetManager->addBouquet(Bouquets[selected]->channelList->getName(), true); tmp = g_bouquetManager->addBouquet(Bouquets[selected]->channelList->getName(), true);
bouquet_id = g_bouquetManager->existsUBouquet(Bouquets[selected]->channelList->getName()); bouquet_id = g_bouquetManager->existsUBouquet(Bouquets[selected]->channelList->getName());
} else }
else
tmp = g_bouquetManager->Bouquets[bouquet_id]; tmp = g_bouquetManager->Bouquets[bouquet_id];
if(bouquet_id < 0) if (bouquet_id < 0)
return 0; return 0;
channels = &zapitBouquet->tvChannels; channels = &zapitBouquet->tvChannels;
for(int li = 0; li < (int) channels->size(); li++) { for (int li = 0; li < (int) channels->size(); li++)
if (!g_bouquetManager->existsChannelInBouquet(bouquet_id, ((*channels)[li])->getChannelID())) { {
if (!g_bouquetManager->existsChannelInBouquet(bouquet_id, ((*channels)[li])->getChannelID()))
{
added = true; added = true;
tmp->addService((*channels)[li]); tmp->addService((*channels)[li]);
} }
} }
channels = &zapitBouquet->radioChannels; channels = &zapitBouquet->radioChannels;
for(int li = 0; li < (int) channels->size(); li++) { for (int li = 0; li < (int) channels->size(); li++)
if (!g_bouquetManager->existsChannelInBouquet(bouquet_id, ((*channels)[li])->getChannelID())) { {
if (!g_bouquetManager->existsChannelInBouquet(bouquet_id, ((*channels)[li])->getChannelID()))
{
added = true; added = true;
tmp->addService((*channels)[li]); tmp->addService((*channels)[li]);
} }
} }
if (added) { if (added)
{
CNeutrinoApp::getInstance()->MarkFavoritesChanged(); CNeutrinoApp::getInstance()->MarkFavoritesChanged();
CNeutrinoApp::getInstance()->MarkChannelsInit(); CNeutrinoApp::getInstance()->MarkChannelsInit();
return 1; return 1;
@@ -308,8 +335,10 @@ int CBouquetList::doMenu()
break; break;
} }
} }
} else { }
/* user or satellite bouquet */ else
{
// user or satellite bouquet
menu->addItem(new CMenuForwarder(LOCALE_BOUQUETEDITOR_DELETE, true, NULL, selector, cnt, CRCInput::RC_red), old_selected == i ++); menu->addItem(new CMenuForwarder(LOCALE_BOUQUETEDITOR_DELETE, true, NULL, selector, cnt, CRCInput::RC_red), old_selected == i ++);
if (zapitBouquet && (!zapitBouquet->bWebtv && !zapitBouquet->bWebradio) && (g_settings.epg_scan == CEpgScan::SCAN_SEL)) if (zapitBouquet && (!zapitBouquet->bWebtv && !zapitBouquet->bWebradio) && (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)); menu->addItem(new CMenuOptionChooser(LOCALE_MISCSETTINGS_EPG_SCAN, &zapitBouquet->bScanEpg, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true));
@@ -319,18 +348,20 @@ int CBouquetList::doMenu()
menu->exec(NULL, ""); menu->exec(NULL, "");
delete menu; delete menu;
delete selector; delete selector;
if (zapitBouquet && (old_epg != zapitBouquet->bScanEpg)) { if (zapitBouquet && (old_epg != zapitBouquet->bScanEpg))
{
save_bouquets = true; save_bouquets = true;
CNeutrinoApp::getInstance()->MarkFavoritesChanged(); CNeutrinoApp::getInstance()->MarkFavoritesChanged();
ret = -1; ret = -1;
} }
if (zapitBouquet && (old_ci != zapitBouquet->bUseCI)) { if (zapitBouquet && (old_ci != zapitBouquet->bUseCI))
{
channels = &zapitBouquet->tvChannels; channels = &zapitBouquet->tvChannels;
for(int li = 0; li < (int) channels->size(); li++) for (int li = 0; li < (int) channels->size(); li++)
(*channels)[li]->bUseCI = zapitBouquet->bUseCI; (*channels)[li]->bUseCI = zapitBouquet->bUseCI;
channels = &zapitBouquet->radioChannels; channels = &zapitBouquet->radioChannels;
for(int li = 0; li < (int) channels->size(); li++) for (int li = 0; li < (int) channels->size(); li++)
(*channels)[li]->bUseCI = zapitBouquet->bUseCI; (*channels)[li]->bUseCI = zapitBouquet->bUseCI;
CServiceManager::getInstance()->SetCIFilter(); CServiceManager::getInstance()->SetCIFilter();
@@ -340,22 +371,27 @@ int CBouquetList::doMenu()
} }
printf("CBouquetList::doMenu: %d selected\n", select); printf("CBouquetList::doMenu: %d selected\n", select);
if(select >= 0) { if (select >= 0)
{
old_selected = select; old_selected = select;
int result = ShowMsg ( LOCALE_BOUQUETEDITOR_DELETE, Bouquets[selected]->channelList->getName(), CMsgBox::mbrNo, CMsgBox::mbYes | CMsgBox::mbNo ); int result = ShowMsg(LOCALE_BOUQUETEDITOR_DELETE, Bouquets[selected]->channelList->getName(), CMsgBox::mbrNo, CMsgBox::mbYes | CMsgBox::mbNo);
if(result != CMsgBox::mbrYes) if (result != CMsgBox::mbrYes)
return 0; return 0;
if (zapitBouquet) { if (zapitBouquet)
{
bouquet_id = g_bouquetManager->existsUBouquet(Bouquets[selected]->channelList->getName()); bouquet_id = g_bouquetManager->existsUBouquet(Bouquets[selected]->channelList->getName());
if(bouquet_id >= 0) { if (bouquet_id >= 0)
{
g_bouquetManager->deleteBouquet(bouquet_id); g_bouquetManager->deleteBouquet(bouquet_id);
CNeutrinoApp::getInstance()->MarkFavoritesChanged(); CNeutrinoApp::getInstance()->MarkFavoritesChanged();
CNeutrinoApp::getInstance()->MarkChannelsInit(); CNeutrinoApp::getInstance()->MarkChannelsInit();
return 1; return 1;
} }
} else { }
else
{
CServiceManager::getInstance()->RemovePosition(Bouquets[selected]->satellitePosition); CServiceManager::getInstance()->RemovePosition(Bouquets[selected]->satellitePosition);
g_bouquetManager->loadBouquets(); g_bouquetManager->loadBouquets();
g_bouquetManager->deletePosition(Bouquets[selected]->satellitePosition); g_bouquetManager->deletePosition(Bouquets[selected]->satellitePosition);
@@ -379,24 +415,26 @@ const struct button_label CBouquetListButtons[4] =
void CBouquetList::updateSelection(int newpos) void CBouquetList::updateSelection(int newpos)
{ {
if (newpos < 0) /* to avoid all callers having to check */ if (newpos < 0) // to avoid all callers having to check
return; return;
if((int) selected != newpos) { if ((int) selected != newpos)
{
int prev_selected = selected; int prev_selected = selected;
unsigned int oldliststart = liststart; unsigned int oldliststart = liststart;
selected = newpos; selected = newpos;
liststart = (selected/listmaxshow)*listmaxshow; liststart = (selected / listmaxshow) * listmaxshow;
if (oldliststart != liststart) if (oldliststart != liststart)
paint(); paint();
else { else
{
paintItem(prev_selected - liststart); paintItem(prev_selected - liststart);
paintItem(selected - liststart); paintItem(selected - liststart);
} }
} }
} }
/* bShowChannelList default to true, returns new bouquet or -1/-2 */ // bShowChannelList default to true, returns new bouquet or -1/-2
int CBouquetList::show(bool bShowChannelList) int CBouquetList::show(bool bShowChannelList)
{ {
neutrino_msg_t msg; neutrino_msg_t msg;
@@ -408,7 +446,7 @@ int CBouquetList::show(bool bShowChannelList)
int h_max_icon = 0; int h_max_icon = 0;
favonly = !bShowChannelList; favonly = !bShowChannelList;
for (unsigned int count = 0; count < sizeof(CBouquetListButtons)/sizeof(CBouquetListButtons[0]); count++) for (unsigned int count = 0; count < sizeof(CBouquetListButtons) / sizeof(CBouquetListButtons[0]); count++)
{ {
int w_text = g_Font[SNeutrinoSettings::FONT_TYPE_BUTTON_TEXT]->getRenderWidth(g_Locale->getText(CBouquetListButtons[count].locale)); int w_text = g_Font[SNeutrinoSettings::FONT_TYPE_BUTTON_TEXT]->getRenderWidth(g_Locale->getText(CBouquetListButtons[count].locale));
w_max_text = std::max(w_max_text, w_text) + OFFSET_INNER_SMALL; w_max_text = std::max(w_max_text, w_text) + OFFSET_INNER_SMALL;
@@ -425,20 +463,20 @@ int CBouquetList::show(bool bShowChannelList)
It would be better to get the needed width from It would be better to get the needed width from
CComponententsFooter class. CComponententsFooter class.
*/ */
width = (sizeof(CBouquetListButtons)/sizeof(CBouquetListButtons[0]))*(w_max_icon + w_max_text + 2*OFFSET_INNER_MID); width = (sizeof(CBouquetListButtons) / sizeof(CBouquetListButtons[0])) * (w_max_icon + w_max_text + 2 * OFFSET_INNER_MID);
height = 16*item_height; height = 16 * item_height;
header_height = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight(); header_height = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight();
footer_height = header_height; footer_height = header_height;
listmaxshow = (height - header_height - footer_height)/item_height; listmaxshow = (height - header_height - footer_height) / item_height;
height = header_height + footer_height + listmaxshow*item_height; // recalc height height = header_height + footer_height + listmaxshow * item_height; // recalc height
x = getScreenStartX(width); x = getScreenStartX(width);
y = getScreenStartY(height); y = getScreenStartY(height);
int lmaxpos= 1; int lmaxpos = 1;
int i= Bouquets.size(); int i = Bouquets.size();
while ((i= i/10)!=0) while ((i = i / 10) != 0)
lmaxpos++; lmaxpos++;
CVFD::getInstance()->setMode(CVFD::MODE_MENU_UTF8, ""); CVFD::getInstance()->setMode(CVFD::MODE_MENU_UTF8, "");
@@ -450,87 +488,111 @@ int CBouquetList::show(bool bShowChannelList)
paint(); paint();
int oldselected = selected; int oldselected = selected;
int firstselected = selected+ 1; int firstselected = selected + 1;
int zapOnExit = false; int zapOnExit = false;
unsigned int chn= 0; unsigned int chn = 0;
int pos= lmaxpos; int pos = lmaxpos;
int timeout = g_settings.timing[SNeutrinoSettings::TIMING_CHANLIST]; int timeout = g_settings.timing[SNeutrinoSettings::TIMING_CHANLIST];
uint64_t timeoutEnd = CRCInput::calcTimeoutEnd(timeout); uint64_t timeoutEnd = CRCInput::calcTimeoutEnd(timeout);
bool loop=true; bool loop = true;
while (loop) { while (loop)
g_RCInput->getMsgAbsoluteTimeout( &msg, &data, &timeoutEnd ); {
g_RCInput->getMsgAbsoluteTimeout(&msg, &data, &timeoutEnd);
if ( msg <= CRCInput::RC_MaxRC ) if (msg <= CRCInput::RC_MaxRC)
timeoutEnd = CRCInput::calcTimeoutEnd(timeout); timeoutEnd = CRCInput::calcTimeoutEnd(timeout);
if((msg == NeutrinoMessages::EVT_TIMER) && (data == fader.GetFadeTimer())) { if ((msg == NeutrinoMessages::EVT_TIMER) && (data == fader.GetFadeTimer()))
if(fader.FadeDone()) {
if (fader.FadeDone())
loop = false; loop = false;
} }
else if ((msg == CRCInput::RC_timeout ) || else if ((msg == CRCInput::RC_timeout) || (msg == (neutrino_msg_t) g_settings.key_channelList_cancel) ||
(msg == (neutrino_msg_t) g_settings.key_channelList_cancel) ||
((msg == (neutrino_msg_t) g_settings.key_favorites) && (CNeutrinoApp::getInstance()->GetChannelMode() == LIST_MODE_FAV))) ((msg == (neutrino_msg_t) g_settings.key_favorites) && (CNeutrinoApp::getInstance()->GetChannelMode() == LIST_MODE_FAV)))
{ {
selected = oldselected; selected = oldselected;
if(fader.StartFadeOut()) { if (fader.StartFadeOut())
{
timeoutEnd = CRCInput::calcTimeoutEnd(1); timeoutEnd = CRCInput::calcTimeoutEnd(1);
msg = 0; msg = 0;
} else
loop=false;
} }
else if(msg == CRCInput::RC_red || msg == (neutrino_msg_t) g_settings.key_favorites) { else
if (!favonly && CNeutrinoApp::getInstance()->GetChannelMode() != LIST_MODE_FAV) { loop = false;
}
else if (msg == CRCInput::RC_red || msg == (neutrino_msg_t) g_settings.key_favorites)
{
if (!favonly && CNeutrinoApp::getInstance()->GetChannelMode() != LIST_MODE_FAV)
{
CNeutrinoApp::getInstance()->SetChannelMode(LIST_MODE_FAV); CNeutrinoApp::getInstance()->SetChannelMode(LIST_MODE_FAV);
hide(); hide();
return CHANLIST_CHANGE_MODE; return CHANLIST_CHANGE_MODE;
} }
} else if(msg == CRCInput::RC_green) { }
if (!favonly && CNeutrinoApp::getInstance()->GetChannelMode() != LIST_MODE_PROV) { else if (msg == CRCInput::RC_green)
{
if (!favonly && CNeutrinoApp::getInstance()->GetChannelMode() != LIST_MODE_PROV)
{
CNeutrinoApp::getInstance()->SetChannelMode(LIST_MODE_PROV); CNeutrinoApp::getInstance()->SetChannelMode(LIST_MODE_PROV);
hide(); hide();
return CHANLIST_CHANGE_MODE; return CHANLIST_CHANGE_MODE;
} }
} else if(msg == CRCInput::RC_yellow || msg == CRCInput::RC_sat) { }
if(!favonly && bShowChannelList && CNeutrinoApp::getInstance()->GetChannelMode() != LIST_MODE_SAT) { else if (msg == CRCInput::RC_yellow || msg == CRCInput::RC_sat)
{
if (!favonly && bShowChannelList && CNeutrinoApp::getInstance()->GetChannelMode() != LIST_MODE_SAT)
{
CNeutrinoApp::getInstance()->SetChannelMode(LIST_MODE_SAT); CNeutrinoApp::getInstance()->SetChannelMode(LIST_MODE_SAT);
hide(); hide();
return CHANLIST_CHANGE_MODE; return CHANLIST_CHANGE_MODE;
} }
} else if(msg == CRCInput::RC_blue) { }
if(!favonly && bShowChannelList && CNeutrinoApp::getInstance()->GetChannelMode() != LIST_MODE_ALL) { else if (msg == CRCInput::RC_blue)
{
if (!favonly && bShowChannelList && CNeutrinoApp::getInstance()->GetChannelMode() != LIST_MODE_ALL)
{
CNeutrinoApp::getInstance()->SetChannelMode(LIST_MODE_ALL); CNeutrinoApp::getInstance()->SetChannelMode(LIST_MODE_ALL);
hide(); hide();
return CHANLIST_CHANGE_MODE; return CHANLIST_CHANGE_MODE;
} }
} else if(msg == CRCInput::RC_www) { }
if(!favonly && bShowChannelList && CNeutrinoApp::getInstance()->GetChannelMode() != LIST_MODE_WEB) { else if (msg == CRCInput::RC_www)
{
if (!favonly && bShowChannelList && CNeutrinoApp::getInstance()->GetChannelMode() != LIST_MODE_WEB)
{
CNeutrinoApp::getInstance()->SetChannelMode(LIST_MODE_WEB); CNeutrinoApp::getInstance()->SetChannelMode(LIST_MODE_WEB);
hide(); hide();
return CHANLIST_CHANGE_MODE; return CHANLIST_CHANGE_MODE;
} }
} }
else if ( msg == CRCInput::RC_setup) { else if (msg == CRCInput::RC_setup)
if (!favonly && !Bouquets.empty()) { {
if (!favonly && !Bouquets.empty())
{
int ret = doMenu(); int ret = doMenu();
if(ret > 0) { if (ret > 0)
{
res = CHANLIST_NO_RESTORE; res = CHANLIST_NO_RESTORE;
loop = false; loop = false;
} else if(ret < 0) { }
else if (ret < 0)
{
paintHead(); paintHead();
paint(); paint();
} }
} }
} }
else if ( msg == (neutrino_msg_t) g_settings.key_list_start ) { else if (msg == (neutrino_msg_t) g_settings.key_list_start)
{
if (!Bouquets.empty()) if (!Bouquets.empty())
updateSelection(0); updateSelection(0);
} }
else if ( msg == (neutrino_msg_t) g_settings.key_list_end ) { else if (msg == (neutrino_msg_t) g_settings.key_list_end)
{
if (!Bouquets.empty()) if (!Bouquets.empty())
updateSelection(Bouquets.size()-1); updateSelection(Bouquets.size() - 1);
} }
else if (msg == CRCInput::RC_up || (int) msg == g_settings.key_pageup || else if (msg == CRCInput::RC_up || (int) msg == g_settings.key_pageup ||
msg == CRCInput::RC_down || (int) msg == g_settings.key_pagedown) msg == CRCInput::RC_down || (int) msg == g_settings.key_pagedown)
@@ -538,41 +600,54 @@ int CBouquetList::show(bool bShowChannelList)
int new_selected = UpDownKey(Bouquets, msg, listmaxshow, selected); int new_selected = UpDownKey(Bouquets, msg, listmaxshow, selected);
updateSelection(new_selected); updateSelection(new_selected);
} }
else if(msg == (neutrino_msg_t)g_settings.key_bouquet_up || msg == (neutrino_msg_t)g_settings.key_bouquet_down) { else if (msg == (neutrino_msg_t)g_settings.key_bouquet_up || msg == (neutrino_msg_t)g_settings.key_bouquet_down)
if(bShowChannelList) { {
if (bShowChannelList)
{
int mode = CNeutrinoApp::getInstance()->GetChannelMode(); int mode = CNeutrinoApp::getInstance()->GetChannelMode();
mode += (msg == (neutrino_msg_t)g_settings.key_bouquet_down) ? -1 : 1; mode += (msg == (neutrino_msg_t)g_settings.key_bouquet_down) ? -1 : 1;
if(mode < 0) if (mode < 0)
mode = LIST_MODE_LAST - 1; mode = LIST_MODE_LAST - 1;
else if(mode >= LIST_MODE_LAST) else if (mode >= LIST_MODE_LAST)
mode = 0; mode = 0;
CNeutrinoApp::getInstance()->SetChannelMode(mode); CNeutrinoApp::getInstance()->SetChannelMode(mode);
hide(); hide();
return CHANLIST_CHANGE_MODE; return CHANLIST_CHANGE_MODE;
} }
} }
else if ( msg == CRCInput::RC_ok ) { else if (msg == CRCInput::RC_ok)
if(!Bouquets.empty() /* && (!bShowChannelList || !Bouquets[selected]->channelList->isEmpty())*/) { {
if (!Bouquets.empty() /*&& (!bShowChannelList || !Bouquets[selected]->channelList->isEmpty())*/)
{
zapOnExit = true; zapOnExit = true;
loop=false; loop = false;
} }
} }
else if (CRCInput::isNumeric(msg)) { else if (CRCInput::isNumeric(msg))
if (!Bouquets.empty()) { {
if (pos == lmaxpos) { if (!Bouquets.empty())
if (msg == CRCInput::RC_0) { {
if (pos == lmaxpos)
{
if (msg == CRCInput::RC_0)
{
chn = firstselected; chn = firstselected;
pos = lmaxpos; pos = lmaxpos;
} else { }
else
{
chn = CRCInput::getNumericValue(msg); chn = CRCInput::getNumericValue(msg);
pos = 1; pos = 1;
} }
} else { }
chn = chn*10 + CRCInput::getNumericValue(msg); else
{
chn = chn * 10 + CRCInput::getNumericValue(msg);
pos++; pos++;
} }
if (chn > Bouquets.size()) { if (chn > Bouquets.size())
{
chn = firstselected; chn = firstselected;
pos = lmaxpos; pos = lmaxpos;
} }
@@ -580,12 +655,17 @@ int CBouquetList::show(bool bShowChannelList)
int new_selected = (chn - 1) % Bouquets.size(); // is % necessary (i.e. can firstselected be > Bouquets.size()) ? int new_selected = (chn - 1) % Bouquets.size(); // is % necessary (i.e. can firstselected be > Bouquets.size()) ?
updateSelection(new_selected); updateSelection(new_selected);
} }
} else if (msg == NeutrinoMessages::EVT_SERVICESCHANGED || msg == NeutrinoMessages::EVT_BOUQUETSCHANGED) { }
else if (msg == NeutrinoMessages::EVT_SERVICESCHANGED || msg == NeutrinoMessages::EVT_BOUQUETSCHANGED)
{
g_RCInput->postMsg(msg, data); g_RCInput->postMsg(msg, data);
loop = false; loop = false;
res = CHANLIST_CANCEL_ALL; res = CHANLIST_CANCEL_ALL;
} else { }
if ( CNeutrinoApp::getInstance()->handleMsg( msg, data ) & messages_return::cancel_all ) { else
{
if (CNeutrinoApp::getInstance()->handleMsg(msg, data) & messages_return::cancel_all)
{
loop = false; loop = false;
res = CHANLIST_CANCEL_ALL; res = CHANLIST_CANCEL_ALL;
} }
@@ -604,14 +684,17 @@ int CBouquetList::show(bool bShowChannelList)
CVFD::getInstance()->setMode(CVFD::MODE_TVRADIO); CVFD::getInstance()->setMode(CVFD::MODE_TVRADIO);
if (save_bouquets) { if (save_bouquets)
{
save_bouquets = false; save_bouquets = false;
#if 0 #if 0
if (CNeutrinoApp::getInstance()->GetChannelMode() == LIST_MODE_FAV) if (CNeutrinoApp::getInstance()->GetChannelMode() == LIST_MODE_FAV)
g_bouquetManager->saveUBouquets(); g_bouquetManager->saveUBouquets();
else else
g_bouquetManager->saveBouquets(); g_bouquetManager->saveBouquets();
#endif #endif
if (g_settings.epg_scan == CEpgScan::SCAN_SEL) if (g_settings.epg_scan == CEpgScan::SCAN_SEL)
CEpgScan::getInstance()->Start(); CEpgScan::getInstance()->Start();
} }
@@ -630,10 +713,10 @@ void CBouquetList::hide()
void CBouquetList::paintItem(int pos) void CBouquetList::paintItem(int pos)
{ {
int ypos = y + header_height + pos*item_height; int ypos = y + header_height + pos * item_height;
bool iscurrent = true; bool iscurrent = true;
int npos = liststart + pos; int npos = liststart + pos;
const char * lname = NULL; const char *lname = NULL;
bool i_selected = npos == (int) selected; bool i_selected = npos == (int) selected;
int i_radius = RADIUS_NONE; int i_radius = RADIUS_NONE;
@@ -655,47 +738,52 @@ void CBouquetList::paintItem(int pos)
if (i_selected) if (i_selected)
{ {
if(npos < (int) Bouquets.size()) if (npos < (int) Bouquets.size())
CVFD::getInstance()->showMenuText(0, lname, -1, true); CVFD::getInstance()->showMenuText(0, lname, -1, true);
#ifdef ENABLE_GRAPHLCD #ifdef ENABLE_GRAPHLCD
if(g_settings.glcd_enable) if (g_settings.glcd_enable)
cGLCD::lockChannel(g_Locale->getText(LOCALE_BOUQUETLIST_HEAD), lname, 0); cGLCD::lockChannel(g_Locale->getText(LOCALE_BOUQUETLIST_HEAD), lname, 0);
#endif #endif
#ifdef ENABLE_LCD4LINUX #ifdef ENABLE_LCD4LINUX
if(g_settings.lcd4l_support) if (g_settings.lcd4l_support)
CLCD4l::getInstance()->CreateMenuFile(lname, g_settings.lcd4l_convert); CLCD4l::getInstance()->CreateMenuFile(lname, g_settings.lcd4l_convert);
#endif #endif
} }
else else
{ {
if(!favonly && (npos < (int) Bouquets.size())) if (!favonly && (npos < (int) Bouquets.size()))
iscurrent = !Bouquets[npos]->channelList->isEmpty(); iscurrent = !Bouquets[npos]->channelList->isEmpty();
if (!iscurrent) if (!iscurrent)
{ {
//inactive colors? Is this correct? // inactive colors? Is this correct?
color = COL_MENUCONTENTINACTIVE_TEXT; color = COL_MENUCONTENTINACTIVE_TEXT;
//bgcolor = COL_MENUCONTENTINACTIVE_PLUS_0; //bgcolor = COL_MENUCONTENTINACTIVE_PLUS_0;
} }
} }
if (npos < (int) Bouquets.size()) { if (npos < (int) Bouquets.size())
{
char num[12]; char num[12];
snprintf(num, sizeof(num), "%d", npos + 1); snprintf(num, sizeof(num), "%d", npos + 1);
int iw = 0, ih = 0; int iw = 0, ih = 0;
if ((g_settings.epg_scan == CEpgScan::SCAN_SEL) && if ((g_settings.epg_scan == CEpgScan::SCAN_SEL) &&
Bouquets[npos]->zapitBouquet && Bouquets[npos]->zapitBouquet->bScanEpg) { Bouquets[npos]->zapitBouquet && Bouquets[npos]->zapitBouquet->bScanEpg)
{
frameBuffer->getIconSize(NEUTRINO_ICON_MARKER_EPG, &iw, &ih); frameBuffer->getIconSize(NEUTRINO_ICON_MARKER_EPG, &iw, &ih);
if (iw && ih) { if (iw && ih)
{
int icon_x = x + width - SCROLLBAR_WIDTH - OFFSET_INNER_MID - iw; int icon_x = x + width - SCROLLBAR_WIDTH - OFFSET_INNER_MID - iw;
frameBuffer->paintIcon(NEUTRINO_ICON_MARKER_EPG, icon_x, ypos, item_height); frameBuffer->paintIcon(NEUTRINO_ICON_MARKER_EPG, icon_x, ypos, item_height);
iw = iw + OFFSET_INNER_MID; iw = iw + OFFSET_INNER_MID;
} }
} }
if (Bouquets[npos]->zapitBouquet && Bouquets[npos]->zapitBouquet->bUseCI) { if (Bouquets[npos]->zapitBouquet && Bouquets[npos]->zapitBouquet->bUseCI)
{
int iw2 = 0; int iw2 = 0;
frameBuffer->getIconSize(NEUTRINO_ICON_MARKER_SCRAMBLED, &iw2, &ih); frameBuffer->getIconSize(NEUTRINO_ICON_MARKER_SCRAMBLED, &iw2, &ih);
if (iw2 && ih) { if (iw2 && ih)
{
int icon_x = x + width - SCROLLBAR_WIDTH - OFFSET_INNER_MID - iw - iw2; int icon_x = x + width - SCROLLBAR_WIDTH - OFFSET_INNER_MID - iw - iw2;
frameBuffer->paintIcon(NEUTRINO_ICON_MARKER_SCRAMBLED, icon_x, ypos, item_height); frameBuffer->paintIcon(NEUTRINO_ICON_MARKER_SCRAMBLED, icon_x, ypos, item_height);
iw = iw + iw2 + OFFSET_INNER_MID; iw = iw + iw2 + OFFSET_INNER_MID;
@@ -705,7 +793,7 @@ void CBouquetList::paintItem(int pos)
int numpos = x + OFFSET_INNER_MID + numwidth - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_NUMBER]->getRenderWidth(num); int numpos = x + OFFSET_INNER_MID + numwidth - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_NUMBER]->getRenderWidth(num);
g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_NUMBER]->RenderString(numpos, ypos + item_height, numwidth + OFFSET_INNER_SMALL, num, color, item_height); g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_NUMBER]->RenderString(numpos, ypos + item_height, numwidth + OFFSET_INNER_SMALL, num, color, item_height);
g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x + OFFSET_INNER_MID + numwidth + OFFSET_INNER_MID, ypos + item_height, width - numwidth - 2*OFFSET_INNER_MID - iw - SCROLLBAR_WIDTH, lname, color); g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x + OFFSET_INNER_MID + numwidth + OFFSET_INNER_MID, ypos + item_height, width - numwidth - 2 * OFFSET_INNER_MID - iw - SCROLLBAR_WIDTH, lname, color);
//CVFD::getInstance()->showMenuText(0, bouq->channelList->getName(), -1, true); //CVFD::getInstance()->showMenuText(0, bouq->channelList->getName(), -1, true);
} }
} }
@@ -714,21 +802,22 @@ void CBouquetList::paintHead()
{ {
std::string icon(""); std::string icon("");
CComponentsHeader header(x, y, width, header_height, name, icon, CComponentsHeader::CC_BTN_LEFT | CComponentsHeader::CC_BTN_RIGHT | CComponentsHeader::CC_BTN_MENU); CComponentsHeader header(x, y, width, header_height, name, icon, CComponentsHeader::CC_BTN_LEFT | CComponentsHeader::CC_BTN_RIGHT | CComponentsHeader::CC_BTN_MENU);
header.enableShadow( CC_SHADOW_RIGHT | CC_SHADOW_CORNER_TOP_RIGHT | CC_SHADOW_CORNER_BOTTOM_RIGHT, -1, true); header.enableShadow(CC_SHADOW_RIGHT | CC_SHADOW_CORNER_TOP_RIGHT | CC_SHADOW_CORNER_BOTTOM_RIGHT, -1, true);
header.paint(CC_SAVE_SCREEN_NO); header.paint(CC_SAVE_SCREEN_NO);
} }
void CBouquetList::paint() void CBouquetList::paint()
{ {
//ensure stop info clock before paint this window // ensure stop info clock before paint this window
CInfoClock::getInstance()->block(); CInfoClock::getInstance()->block();
liststart = (selected/listmaxshow)*listmaxshow; liststart = (selected / listmaxshow) * listmaxshow;
int lastnum = liststart + listmaxshow; int lastnum = liststart + listmaxshow;
numwidth = 0; numwidth = 0;
int maxDigitWidth = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_NUMBER]->getMaxDigitWidth(); int maxDigitWidth = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_NUMBER]->getMaxDigitWidth();
int _lastnum = lastnum; int _lastnum = lastnum;
while (_lastnum) { while (_lastnum)
{
numwidth += maxDigitWidth; numwidth += maxDigitWidth;
_lastnum /= 10; _lastnum /= 10;
} }
@@ -736,7 +825,7 @@ void CBouquetList::paint()
frameBuffer->paintBoxRel(x, y + header_height, width, height - header_height - footer_height, COL_MENUCONTENT_PLUS_0); frameBuffer->paintBoxRel(x, y + header_height, width, height - header_height - footer_height, COL_MENUCONTENT_PLUS_0);
// no buttons in favonly mode // no buttons in favonly mode
int numButtons = (favonly) ? 0 : sizeof(CBouquetListButtons)/sizeof(CBouquetListButtons[0]); int numButtons = (favonly) ? 0 : sizeof(CBouquetListButtons) / sizeof(CBouquetListButtons[0]);
CComponentsFooter footer; CComponentsFooter footer;
footer.enableShadow(CC_SHADOW_ON, -1, true); footer.enableShadow(CC_SHADOW_ON, -1, true);
@@ -745,13 +834,11 @@ void CBouquetList::paint()
if (!Bouquets.empty()) if (!Bouquets.empty())
{ {
for (unsigned int count = 0; count < listmaxshow; count++) for (unsigned int count = 0; count < listmaxshow; count++)
{
paintItem(count); paintItem(count);
} }
}
int total_pages; int total_pages;
int current_page; int current_page;
getScrollBarData(&total_pages, &current_page, Bouquets.size(), listmaxshow, selected); getScrollBarData(&total_pages, &current_page, Bouquets.size(), listmaxshow, selected);
paintScrollBar(x + width - SCROLLBAR_WIDTH, y + header_height, SCROLLBAR_WIDTH, item_height*listmaxshow, total_pages, current_page, CC_SHADOW_RIGHT_CORNER_ALL); paintScrollBar(x + width - SCROLLBAR_WIDTH, y + header_height, SCROLLBAR_WIDTH, item_height * listmaxshow, total_pages, current_page, CC_SHADOW_RIGHT_CORNER_ALL);
} }

View File

@@ -29,7 +29,6 @@
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
#ifndef __bouquetlist__ #ifndef __bouquetlist__
#define __bouquetlist__ #define __bouquetlist__
@@ -52,15 +51,14 @@ typedef enum bouquetSwitchMode
class CBouquet class CBouquet
{ {
public: public:
int unique_key; int unique_key;
bool bLocked; bool bLocked;
CChannelList* channelList; CChannelList *channelList;
CZapitBouquet * zapitBouquet; CZapitBouquet *zapitBouquet;
t_satellite_position satellitePosition; t_satellite_position satellitePosition;
CBouquet(const int Unique_key, const char * const Name, const bool locked, bool vlist = false) CBouquet(const int Unique_key, const char *const Name, const bool locked, bool vlist = false)
{ {
zapitBouquet = NULL; zapitBouquet = NULL;
unique_key = Unique_key; unique_key = Unique_key;
@@ -107,23 +105,22 @@ class CBouquetList : public CListHelpers
void updateSelection(int newpos); void updateSelection(int newpos);
public: public:
CBouquetList(const char * const Name = NULL); CBouquetList(const char *const Name = NULL);
~CBouquetList(); ~CBouquetList();
std::vector<CBouquet*> Bouquets; std::vector<CBouquet *> Bouquets;
CBouquet* addBouquet(const char * const name, int BouquetKey=-1, bool locked=false ); CBouquet *addBouquet(const char *const name, int BouquetKey = -1, bool locked = false);
CBouquet* addBouquet(CZapitBouquet * zapitBouquet); CBouquet *addBouquet(CZapitBouquet *zapitBouquet);
void deleteBouquet(CBouquet* bouquet); void deleteBouquet(CBouquet *bouquet);
t_bouquet_id getActiveBouquetNumber(); t_bouquet_id getActiveBouquetNumber();
int activateBouquet(int id, bool bShowChannelList); int activateBouquet(int id, bool bShowChannelList);
int show(bool bShowChannelList = true); int show(bool bShowChannelList = true);
int showChannelList(int nBouquet = -1); int showChannelList(int nBouquet = -1);
//void adjustToChannel(int nChannelNr); //void adjustToChannel(int nChannelNr);
bool adjustToChannelID(t_channel_id channel_id); bool adjustToChannelID(t_channel_id channel_id);
int exec( bool bShowChannelList); int exec(bool bShowChannelList);
bool hasChannelID(t_channel_id channel_id); bool hasChannelID(t_channel_id channel_id);
}; };
#endif #endif