mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-27 15:32:59 +02:00
format channellist.cpp/.h with astyle
git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@1232 e54a6e83-5905-42d5-8d5c-058d10e6a962
This commit is contained in:
@@ -172,13 +172,13 @@ void CChannelList::updateEvents(unsigned int from, unsigned int to)
|
|||||||
if (displayNext) {
|
if (displayNext) {
|
||||||
time_t atime = time(NULL);
|
time_t atime = time(NULL);
|
||||||
unsigned int count;
|
unsigned int count;
|
||||||
for (count = from; count < to; count++){
|
for (count = from; count < to; count++) {
|
||||||
events.clear();
|
events.clear();
|
||||||
sectionsd_getEventsServiceKey(chanlist[count]->channel_id, events);
|
sectionsd_getEventsServiceKey(chanlist[count]->channel_id, events);
|
||||||
chanlist[count]->nextEvent.startTime = (long)0x7fffffff;
|
chanlist[count]->nextEvent.startTime = (long)0x7fffffff;
|
||||||
for ( CChannelEventList::iterator e= events.begin(); e != events.end(); ++e ) {
|
for ( CChannelEventList::iterator e= events.begin(); e != events.end(); ++e ) {
|
||||||
if ((long)e->startTime > atime &&
|
if ((long)e->startTime > atime &&
|
||||||
(e->startTime < (long)chanlist[count]->nextEvent.startTime))
|
(e->startTime < (long)chanlist[count]->nextEvent.startTime))
|
||||||
{
|
{
|
||||||
chanlist[count]->nextEvent = *e;
|
chanlist[count]->nextEvent = *e;
|
||||||
break; //max: FIXME no sense to continue ?
|
break; //max: FIXME no sense to continue ?
|
||||||
@@ -214,36 +214,36 @@ void CChannelList::updateEvents(unsigned int from, unsigned int to)
|
|||||||
|
|
||||||
struct CmpChannelBySat: public binary_function <const CZapitChannel * const, const CZapitChannel * const, bool>
|
struct CmpChannelBySat: public binary_function <const CZapitChannel * const, const CZapitChannel * const, bool>
|
||||||
{
|
{
|
||||||
static bool comparetolower(const char a, const char b)
|
static bool comparetolower(const char a, const char b)
|
||||||
{
|
{
|
||||||
return tolower(a) < tolower(b);
|
return tolower(a) < tolower(b);
|
||||||
};
|
};
|
||||||
|
|
||||||
bool operator() (const CZapitChannel * const c1, const CZapitChannel * const c2)
|
bool operator() (const CZapitChannel * const c1, const CZapitChannel * const c2)
|
||||||
{
|
{
|
||||||
if(c1->getSatellitePosition() == c2->getSatellitePosition())
|
if(c1->getSatellitePosition() == c2->getSatellitePosition())
|
||||||
return std::lexicographical_compare(c1->getName().begin(), c1->getName().end(), c2->getName().begin(), c2->getName().end(), comparetolower);
|
return std::lexicographical_compare(c1->getName().begin(), c1->getName().end(), c2->getName().begin(), c2->getName().end(), comparetolower);
|
||||||
else
|
else
|
||||||
return c1->getSatellitePosition() < c2->getSatellitePosition();
|
return c1->getSatellitePosition() < c2->getSatellitePosition();
|
||||||
;
|
;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
struct CmpChannelByFreq: public binary_function <const CZapitChannel * const, const CZapitChannel * const, bool>
|
struct CmpChannelByFreq: public binary_function <const CZapitChannel * const, const CZapitChannel * const, bool>
|
||||||
{
|
{
|
||||||
static bool comparetolower(const char a, const char b)
|
static bool comparetolower(const char a, const char b)
|
||||||
{
|
{
|
||||||
return tolower(a) < tolower(b);
|
return tolower(a) < tolower(b);
|
||||||
};
|
};
|
||||||
|
|
||||||
bool operator() (const CZapitChannel * const c1, const CZapitChannel * const c2)
|
bool operator() (const CZapitChannel * const c1, const CZapitChannel * const c2)
|
||||||
{
|
{
|
||||||
if(c1->getFreqId() == c2->getFreqId())
|
if(c1->getFreqId() == c2->getFreqId())
|
||||||
return std::lexicographical_compare(c1->getName().begin(), c1->getName().end(), c2->getName().begin(), c2->getName().end(), comparetolower);
|
return std::lexicographical_compare(c1->getName().begin(), c1->getName().end(), c2->getName().begin(), c2->getName().end(), comparetolower);
|
||||||
else
|
else
|
||||||
return c1->getFreqId() < c2->getFreqId();
|
return c1->getFreqId() < c2->getFreqId();
|
||||||
;
|
;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
void CChannelList::SortAlpha(void)
|
void CChannelList::SortAlpha(void)
|
||||||
@@ -263,7 +263,7 @@ void CChannelList::SortTP(void)
|
|||||||
|
|
||||||
CZapitChannel* CChannelList::getChannel(int number)
|
CZapitChannel* CChannelList::getChannel(int number)
|
||||||
{
|
{
|
||||||
for (uint32_t i=0; i< chanlist.size();i++) {
|
for (uint32_t i=0; i< chanlist.size(); i++) {
|
||||||
if (chanlist[i]->number == number)
|
if (chanlist[i]->number == number)
|
||||||
return chanlist[i];
|
return chanlist[i];
|
||||||
}
|
}
|
||||||
@@ -272,7 +272,7 @@ CZapitChannel* CChannelList::getChannel(int number)
|
|||||||
|
|
||||||
CZapitChannel* CChannelList::getChannel(t_channel_id channel_id)
|
CZapitChannel* CChannelList::getChannel(t_channel_id channel_id)
|
||||||
{
|
{
|
||||||
for (uint32_t i=0; i< chanlist.size();i++) {
|
for (uint32_t i=0; i< chanlist.size(); i++) {
|
||||||
if (chanlist[i]->channel_id == channel_id)
|
if (chanlist[i]->channel_id == channel_id)
|
||||||
return chanlist[i];
|
return chanlist[i];
|
||||||
}
|
}
|
||||||
@@ -356,57 +356,12 @@ int CChannelList::doChannelMenu(void)
|
|||||||
old_selected = select;
|
old_selected = select;
|
||||||
channel_id = chanlist[selected]->channel_id;
|
channel_id = chanlist[selected]->channel_id;
|
||||||
switch(select) {
|
switch(select) {
|
||||||
case 0:{
|
case 0: {
|
||||||
hide();
|
hide();
|
||||||
int result = ShowMsgUTF ( LOCALE_BOUQUETEDITOR_DELETE, g_Locale->getText(LOCALE_BOUQUETEDITOR_DELETE_QUESTION), CMessageBox::mbrNo, CMessageBox::mbYes | CMessageBox::mbNo );
|
int result = ShowMsgUTF ( LOCALE_BOUQUETEDITOR_DELETE, g_Locale->getText(LOCALE_BOUQUETEDITOR_DELETE_QUESTION), CMessageBox::mbrNo, CMessageBox::mbYes | CMessageBox::mbNo );
|
||||||
|
|
||||||
if(result == CMessageBox::mbrYes) {
|
|
||||||
bouquet_id = bouquetList->getActiveBouquetNumber();
|
|
||||||
if(!strcmp(bouquetList->Bouquets[bouquet_id]->channelList->getName(), g_Locale->getText(LOCALE_FAVORITES_BOUQUETNAME)))
|
|
||||||
bouquet_id = g_bouquetManager->existsUBouquet(g_Locale->getText(LOCALE_FAVORITES_BOUQUETNAME), true);
|
|
||||||
else
|
|
||||||
bouquet_id = g_bouquetManager->existsBouquet(bouquetList->Bouquets[bouquet_id]->channelList->getName());
|
|
||||||
|
|
||||||
if (bouquet_id == -1)
|
|
||||||
return 0;
|
|
||||||
if(g_bouquetManager->existsChannelInBouquet(bouquet_id, channel_id)) {
|
|
||||||
g_bouquetManager->Bouquets[bouquet_id]->removeService(channel_id);
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 1: // move
|
|
||||||
old_bouquet_id = bouquetList->getActiveBouquetNumber();
|
|
||||||
old_bouquet_id = g_bouquetManager->existsBouquet(bouquetList->Bouquets[old_bouquet_id]->channelList->getName());
|
|
||||||
do {
|
|
||||||
new_bouquet_id = bouquetList->exec(false);
|
|
||||||
} while(new_bouquet_id == -3);
|
|
||||||
|
|
||||||
hide();
|
|
||||||
if(new_bouquet_id < 0)
|
|
||||||
return 0;
|
|
||||||
new_bouquet_id = g_bouquetManager->existsBouquet(bouquetList->Bouquets[new_bouquet_id]->channelList->getName());
|
|
||||||
if ((new_bouquet_id == -1) || (new_bouquet_id == old_bouquet_id))
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
if(!g_bouquetManager->existsChannelInBouquet(new_bouquet_id, channel_id)) {
|
|
||||||
addChannelToBouquet(new_bouquet_id, channel_id);
|
|
||||||
}
|
|
||||||
if(g_bouquetManager->existsChannelInBouquet(old_bouquet_id, channel_id)) {
|
|
||||||
g_bouquetManager->Bouquets[old_bouquet_id]->removeService(channel_id);
|
|
||||||
}
|
|
||||||
return 1;
|
|
||||||
|
|
||||||
break;
|
|
||||||
case 2: // add to
|
|
||||||
do {
|
|
||||||
bouquet_id = bouquetList->exec(false);
|
|
||||||
} while(bouquet_id == -3);
|
|
||||||
hide();
|
|
||||||
if(bouquet_id < 0)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
|
if(result == CMessageBox::mbrYes) {
|
||||||
|
bouquet_id = bouquetList->getActiveBouquetNumber();
|
||||||
if(!strcmp(bouquetList->Bouquets[bouquet_id]->channelList->getName(), g_Locale->getText(LOCALE_FAVORITES_BOUQUETNAME)))
|
if(!strcmp(bouquetList->Bouquets[bouquet_id]->channelList->getName(), g_Locale->getText(LOCALE_FAVORITES_BOUQUETNAME)))
|
||||||
bouquet_id = g_bouquetManager->existsUBouquet(g_Locale->getText(LOCALE_FAVORITES_BOUQUETNAME), true);
|
bouquet_id = g_bouquetManager->existsUBouquet(g_Locale->getText(LOCALE_FAVORITES_BOUQUETNAME), true);
|
||||||
else
|
else
|
||||||
@@ -414,25 +369,70 @@ int CChannelList::doChannelMenu(void)
|
|||||||
|
|
||||||
if (bouquet_id == -1)
|
if (bouquet_id == -1)
|
||||||
return 0;
|
return 0;
|
||||||
if(!g_bouquetManager->existsChannelInBouquet(bouquet_id, channel_id)) {
|
if(g_bouquetManager->existsChannelInBouquet(bouquet_id, channel_id)) {
|
||||||
addChannelToBouquet(bouquet_id, channel_id);
|
g_bouquetManager->Bouquets[bouquet_id]->removeService(channel_id);
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 3: // add to my favorites
|
|
||||||
bouquet_id = g_bouquetManager->existsUBouquet(g_Locale->getText(LOCALE_FAVORITES_BOUQUETNAME), true);
|
|
||||||
if(bouquet_id == -1) {
|
|
||||||
g_bouquetManager->addBouquet(g_Locale->getText(LOCALE_FAVORITES_BOUQUETNAME), true);
|
|
||||||
bouquet_id = g_bouquetManager->existsUBouquet(g_Locale->getText(LOCALE_FAVORITES_BOUQUETNAME), true);
|
|
||||||
}
|
|
||||||
if(!g_bouquetManager->existsChannelInBouquet(bouquet_id, channel_id)) {
|
|
||||||
addChannelToBouquet(bouquet_id, channel_id);
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 1: // move
|
||||||
|
old_bouquet_id = bouquetList->getActiveBouquetNumber();
|
||||||
|
old_bouquet_id = g_bouquetManager->existsBouquet(bouquetList->Bouquets[old_bouquet_id]->channelList->getName());
|
||||||
|
do {
|
||||||
|
new_bouquet_id = bouquetList->exec(false);
|
||||||
|
} while(new_bouquet_id == -3);
|
||||||
|
|
||||||
break;
|
hide();
|
||||||
default:
|
if(new_bouquet_id < 0)
|
||||||
break;
|
return 0;
|
||||||
|
new_bouquet_id = g_bouquetManager->existsBouquet(bouquetList->Bouquets[new_bouquet_id]->channelList->getName());
|
||||||
|
if ((new_bouquet_id == -1) || (new_bouquet_id == old_bouquet_id))
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
if(!g_bouquetManager->existsChannelInBouquet(new_bouquet_id, channel_id)) {
|
||||||
|
addChannelToBouquet(new_bouquet_id, channel_id);
|
||||||
|
}
|
||||||
|
if(g_bouquetManager->existsChannelInBouquet(old_bouquet_id, channel_id)) {
|
||||||
|
g_bouquetManager->Bouquets[old_bouquet_id]->removeService(channel_id);
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
|
||||||
|
break;
|
||||||
|
case 2: // add to
|
||||||
|
do {
|
||||||
|
bouquet_id = bouquetList->exec(false);
|
||||||
|
} while(bouquet_id == -3);
|
||||||
|
hide();
|
||||||
|
if(bouquet_id < 0)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
if(!strcmp(bouquetList->Bouquets[bouquet_id]->channelList->getName(), g_Locale->getText(LOCALE_FAVORITES_BOUQUETNAME)))
|
||||||
|
bouquet_id = g_bouquetManager->existsUBouquet(g_Locale->getText(LOCALE_FAVORITES_BOUQUETNAME), true);
|
||||||
|
else
|
||||||
|
bouquet_id = g_bouquetManager->existsBouquet(bouquetList->Bouquets[bouquet_id]->channelList->getName());
|
||||||
|
|
||||||
|
if (bouquet_id == -1)
|
||||||
|
return 0;
|
||||||
|
if(!g_bouquetManager->existsChannelInBouquet(bouquet_id, channel_id)) {
|
||||||
|
addChannelToBouquet(bouquet_id, channel_id);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 3: // add to my favorites
|
||||||
|
bouquet_id = g_bouquetManager->existsUBouquet(g_Locale->getText(LOCALE_FAVORITES_BOUQUETNAME), true);
|
||||||
|
if(bouquet_id == -1) {
|
||||||
|
g_bouquetManager->addBouquet(g_Locale->getText(LOCALE_FAVORITES_BOUQUETNAME), true);
|
||||||
|
bouquet_id = g_bouquetManager->existsUBouquet(g_Locale->getText(LOCALE_FAVORITES_BOUQUETNAME), true);
|
||||||
|
}
|
||||||
|
if(!g_bouquetManager->existsChannelInBouquet(bouquet_id, channel_id)) {
|
||||||
|
addChannelToBouquet(bouquet_id, channel_id);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
@@ -440,7 +440,7 @@ int CChannelList::doChannelMenu(void)
|
|||||||
|
|
||||||
int CChannelList::exec()
|
int CChannelList::exec()
|
||||||
{
|
{
|
||||||
displayNext = 0; // always start with current events
|
displayNext = 0; // always start with current events
|
||||||
int nNewChannel = show();
|
int nNewChannel = show();
|
||||||
if ( nNewChannel > -1) {
|
if ( nNewChannel > -1) {
|
||||||
#if 1
|
#if 1
|
||||||
@@ -521,7 +521,7 @@ int CChannelList::show()
|
|||||||
|
|
||||||
gettimeofday(&t2, NULL);
|
gettimeofday(&t2, NULL);
|
||||||
fprintf(stderr, "CChannelList::show(): %llu ms to paint channellist\n",
|
fprintf(stderr, "CChannelList::show(): %llu ms to paint channellist\n",
|
||||||
((t2.tv_sec * 1000000ULL + t2.tv_usec) - (t1.tv_sec * 1000000ULL + t1.tv_usec)) / 1000ULL);
|
((t2.tv_sec * 1000000ULL + t2.tv_usec) - (t1.tv_sec * 1000000ULL + t1.tv_usec)) / 1000ULL);
|
||||||
|
|
||||||
int oldselected = selected;
|
int oldselected = selected;
|
||||||
int zapOnExit = false;
|
int zapOnExit = false;
|
||||||
@@ -559,10 +559,10 @@ int CChannelList::show()
|
|||||||
}
|
}
|
||||||
else if ( ( msg == CRCInput::RC_timeout ) || ( msg == (neutrino_msg_t)g_settings.key_channelList_cancel) ) {
|
else if ( ( msg == CRCInput::RC_timeout ) || ( msg == (neutrino_msg_t)g_settings.key_channelList_cancel) ) {
|
||||||
res = -1;
|
res = -1;
|
||||||
if(!actzap){
|
if(!actzap) {
|
||||||
selected = oldselected;
|
selected = oldselected;
|
||||||
}
|
}
|
||||||
else{
|
else {
|
||||||
res = -4;
|
res = -4;
|
||||||
selected = selected_in_new_mode;
|
selected = selected_in_new_mode;
|
||||||
}
|
}
|
||||||
@@ -618,13 +618,19 @@ int CChannelList::show()
|
|||||||
selected=0;
|
selected=0;
|
||||||
liststart = (selected/listmaxshow)*listmaxshow;
|
liststart = (selected/listmaxshow)*listmaxshow;
|
||||||
paint();
|
paint();
|
||||||
if(this->new_mode_active && SameTP()) { actzap = true; zapTo(selected); }
|
if(this->new_mode_active && SameTP()) {
|
||||||
|
actzap = true;
|
||||||
|
zapTo(selected);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (msg == (neutrino_msg_t) g_settings.key_list_end) {
|
else if (msg == (neutrino_msg_t) g_settings.key_list_end) {
|
||||||
selected=chanlist.size()-1;
|
selected=chanlist.size()-1;
|
||||||
liststart = (selected/listmaxshow)*listmaxshow;
|
liststart = (selected/listmaxshow)*listmaxshow;
|
||||||
paint();
|
paint();
|
||||||
if(this->new_mode_active && SameTP()) { actzap = true; zapTo(selected); }
|
if(this->new_mode_active && SameTP()) {
|
||||||
|
actzap = true;
|
||||||
|
zapTo(selected);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (msg == CRCInput::RC_up || (int) msg == g_settings.key_channelList_pageup)
|
else if (msg == CRCInput::RC_up || (int) msg == g_settings.key_channelList_pageup)
|
||||||
{
|
{
|
||||||
@@ -650,7 +656,10 @@ int CChannelList::show()
|
|||||||
showChannelLogo();
|
showChannelLogo();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(this->new_mode_active && SameTP()) { actzap = true; zapTo(selected); }
|
if(this->new_mode_active && SameTP()) {
|
||||||
|
actzap = true;
|
||||||
|
zapTo(selected);
|
||||||
|
}
|
||||||
//paintHead();
|
//paintHead();
|
||||||
}
|
}
|
||||||
else if (msg == CRCInput::RC_down || (int) msg == g_settings.key_channelList_pagedown)
|
else if (msg == CRCInput::RC_down || (int) msg == g_settings.key_channelList_pagedown)
|
||||||
@@ -679,7 +688,10 @@ int CChannelList::show()
|
|||||||
showChannelLogo();
|
showChannelLogo();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(this->new_mode_active && SameTP()) { actzap = true; zapTo(selected); }
|
if(this->new_mode_active && SameTP()) {
|
||||||
|
actzap = true;
|
||||||
|
zapTo(selected);
|
||||||
|
}
|
||||||
//paintHead();
|
//paintHead();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -741,16 +753,36 @@ int CChannelList::show()
|
|||||||
else if (CRCInput::isNumeric(msg) && (this->historyMode || g_settings.sms_channel)) {
|
else if (CRCInput::isNumeric(msg) && (this->historyMode || g_settings.sms_channel)) {
|
||||||
if (this->historyMode) { //numeric zap
|
if (this->historyMode) { //numeric zap
|
||||||
switch (msg) {
|
switch (msg) {
|
||||||
case CRCInput::RC_0:selected = 0;break;
|
case CRCInput::RC_0:
|
||||||
case CRCInput::RC_1:selected = 1;break;
|
selected = 0;
|
||||||
case CRCInput::RC_2:selected = 2;break;
|
break;
|
||||||
case CRCInput::RC_3:selected = 3;break;
|
case CRCInput::RC_1:
|
||||||
case CRCInput::RC_4:selected = 4;break;
|
selected = 1;
|
||||||
case CRCInput::RC_5:selected = 5;break;
|
break;
|
||||||
case CRCInput::RC_6:selected = 6;break;
|
case CRCInput::RC_2:
|
||||||
case CRCInput::RC_7:selected = 7;break;
|
selected = 2;
|
||||||
case CRCInput::RC_8:selected = 8;break;
|
break;
|
||||||
case CRCInput::RC_9:selected = 9;break;
|
case CRCInput::RC_3:
|
||||||
|
selected = 3;
|
||||||
|
break;
|
||||||
|
case CRCInput::RC_4:
|
||||||
|
selected = 4;
|
||||||
|
break;
|
||||||
|
case CRCInput::RC_5:
|
||||||
|
selected = 5;
|
||||||
|
break;
|
||||||
|
case CRCInput::RC_6:
|
||||||
|
selected = 6;
|
||||||
|
break;
|
||||||
|
case CRCInput::RC_7:
|
||||||
|
selected = 7;
|
||||||
|
break;
|
||||||
|
case CRCInput::RC_8:
|
||||||
|
selected = 8;
|
||||||
|
break;
|
||||||
|
case CRCInput::RC_9:
|
||||||
|
selected = 9;
|
||||||
|
break;
|
||||||
};
|
};
|
||||||
zapOnExit = true;
|
zapOnExit = true;
|
||||||
loop = false;
|
loop = false;
|
||||||
@@ -839,11 +871,11 @@ int CChannelList::show()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
hide();
|
hide();
|
||||||
if ( fadeIn || fadeOut ) {
|
if ( fadeIn || fadeOut ) {
|
||||||
g_RCInput->killTimer(fadeTimer);
|
g_RCInput->killTimer(fadeTimer);
|
||||||
fadeTimer = 0;
|
fadeTimer = 0;
|
||||||
frameBuffer->setBlendLevel(FADE_RESET, g_settings.gtx_alpha2);
|
frameBuffer->setBlendLevel(FADE_RESET, g_settings.gtx_alpha2);
|
||||||
}
|
}
|
||||||
if (bShowBouquetList) {
|
if (bShowBouquetList) {
|
||||||
res = bouquetList->exec(true);
|
res = bouquetList->exec(true);
|
||||||
printf("CChannelList:: bouquetList->exec res %d\n", res);
|
printf("CChannelList:: bouquetList->exec res %d\n", res);
|
||||||
@@ -866,7 +898,7 @@ int CChannelList::show()
|
|||||||
void CChannelList::hide()
|
void CChannelList::hide()
|
||||||
{
|
{
|
||||||
frameBuffer->paintBackgroundBoxRel(x, y, width, height+ info_height+ 5);
|
frameBuffer->paintBackgroundBoxRel(x, y, width, height+ info_height+ 5);
|
||||||
clearItem2DetailsLine ();
|
clearItem2DetailsLine ();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CChannelList::showInfo(int pos, int epgpos)
|
bool CChannelList::showInfo(int pos, int epgpos)
|
||||||
@@ -932,7 +964,7 @@ int CChannelList::handleMsg(const neutrino_msg_t msg, neutrino_msg_data_t data)
|
|||||||
delete zapProtection;
|
delete zapProtection;
|
||||||
zapProtection = NULL;
|
zapProtection = NULL;
|
||||||
|
|
||||||
out:
|
out:
|
||||||
if (startvideo)
|
if (startvideo)
|
||||||
g_RemoteControl->startvideo();
|
g_RemoteControl->startvideo();
|
||||||
|
|
||||||
@@ -946,7 +978,8 @@ bool CChannelList::adjustToChannelID(const t_channel_id channel_id, bool bToo)
|
|||||||
unsigned int i;
|
unsigned int i;
|
||||||
|
|
||||||
selected_chid = channel_id;
|
selected_chid = channel_id;
|
||||||
printf("CChannelList::adjustToChannelID me %p [%s] list size %d channel_id %llx\n", this, getName(), chanlist.size(), channel_id);fflush(stdout);
|
printf("CChannelList::adjustToChannelID me %p [%s] list size %d channel_id %llx\n", this, getName(), chanlist.size(), channel_id);
|
||||||
|
fflush(stdout);
|
||||||
for (i = 0; i < chanlist.size(); i++) {
|
for (i = 0; i < chanlist.size(); i++) {
|
||||||
if(chanlist[i] == NULL) {
|
if(chanlist[i] == NULL) {
|
||||||
printf("CChannelList::adjustToChannelID REPORT BUG !! ******************************** %d is NULL !!\n", i);
|
printf("CChannelList::adjustToChannelID REPORT BUG !! ******************************** %d is NULL !!\n", i);
|
||||||
@@ -966,7 +999,7 @@ printf("CChannelList::adjustToChannelID me %p [%s] list size %d channel_id %llx\
|
|||||||
if(!has_channel && old_mode == LIST_MODE_FAV)
|
if(!has_channel && old_mode == LIST_MODE_FAV)
|
||||||
new_mode = LIST_MODE_PROV;
|
new_mode = LIST_MODE_PROV;
|
||||||
has_channel = TVbouquetList->adjustToChannelID(channel_id);
|
has_channel = TVbouquetList->adjustToChannelID(channel_id);
|
||||||
if(!has_channel && old_mode == LIST_MODE_PROV){
|
if(!has_channel && old_mode == LIST_MODE_PROV) {
|
||||||
new_mode = LIST_MODE_SAT;
|
new_mode = LIST_MODE_SAT;
|
||||||
}
|
}
|
||||||
has_channel = TVsatList->adjustToChannelID(channel_id);
|
has_channel = TVsatList->adjustToChannelID(channel_id);
|
||||||
@@ -1001,7 +1034,7 @@ printf("CChannelList::adjustToChannelID me %p [%s] list size %d channel_id %llx\
|
|||||||
#if 0
|
#if 0
|
||||||
int CChannelList::hasChannel(int nChannelNr)
|
int CChannelList::hasChannel(int nChannelNr)
|
||||||
{
|
{
|
||||||
for (uint32_t i=0;i<chanlist.size();i++) {
|
for (uint32_t i=0; i<chanlist.size(); i++) {
|
||||||
if (getKey(i) == nChannelNr)
|
if (getKey(i) == nChannelNr)
|
||||||
return(i);
|
return(i);
|
||||||
}
|
}
|
||||||
@@ -1011,7 +1044,7 @@ int CChannelList::hasChannel(int nChannelNr)
|
|||||||
|
|
||||||
int CChannelList::hasChannelID(t_channel_id channel_id)
|
int CChannelList::hasChannelID(t_channel_id channel_id)
|
||||||
{
|
{
|
||||||
for (uint32_t i=0; i < chanlist.size();i++) {
|
for (uint32_t i=0; i < chanlist.size(); i++) {
|
||||||
if(chanlist[i] == NULL) {
|
if(chanlist[i] == NULL) {
|
||||||
printf("CChannelList::hasChannelID REPORT BUG !! ******************************** %d is NULL !!\n", i);
|
printf("CChannelList::hasChannelID REPORT BUG !! ******************************** %d is NULL !!\n", i);
|
||||||
continue;
|
continue;
|
||||||
@@ -1034,7 +1067,7 @@ void CChannelList::setSelected( int nChannelNr)
|
|||||||
// -- Zap to channel with channel_id
|
// -- Zap to channel with channel_id
|
||||||
bool CChannelList::zapTo_ChannelID(const t_channel_id channel_id)
|
bool CChannelList::zapTo_ChannelID(const t_channel_id channel_id)
|
||||||
{
|
{
|
||||||
printf("**************************** CChannelList::zapTo_ChannelID %llx\n", channel_id);
|
printf("**************************** CChannelList::zapTo_ChannelID %llx\n", channel_id);
|
||||||
for (unsigned int i=0; i<chanlist.size(); i++) {
|
for (unsigned int i=0; i<chanlist.size(); i++) {
|
||||||
if (chanlist[i]->channel_id == channel_id) {
|
if (chanlist[i]->channel_id == channel_id) {
|
||||||
zapTo (i);
|
zapTo (i);
|
||||||
@@ -1057,7 +1090,7 @@ void CChannelList::zapTo(int pos, bool /* forceStoreToLastChannels */)
|
|||||||
}
|
}
|
||||||
|
|
||||||
CZapitChannel* chan = chanlist[pos];
|
CZapitChannel* chan = chanlist[pos];
|
||||||
printf("**************************** CChannelList::zapTo me %p %s tuned %d new %d %s -> %llx\n", this, name.c_str(), tuned, pos, chan->name.c_str(), chan->channel_id);
|
printf("**************************** CChannelList::zapTo me %p %s tuned %d new %d %s -> %llx\n", this, name.c_str(), tuned, pos, chan->name.c_str(), chan->channel_id);
|
||||||
if ( pos!=(int)tuned ) {
|
if ( pos!=(int)tuned ) {
|
||||||
tuned = pos;
|
tuned = pos;
|
||||||
g_RemoteControl->zapTo_ChannelID(chan->channel_id, chan->name, !chan->bAlwaysLocked); // UTF-8
|
g_RemoteControl->zapTo_ChannelID(chan->channel_id, chan->name, !chan->bAlwaysLocked); // UTF-8
|
||||||
@@ -1094,7 +1127,7 @@ void CChannelList::NewZap(t_channel_id channel_id)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
CZapitChannel* chan = &it->second;
|
CZapitChannel* chan = &it->second;
|
||||||
printf("**************************** CChannelList::NewZap me %p %s tuned %d new %s -> %llx\n", this, name.c_str(), tuned, chan->name.c_str(), chan->channel_id);
|
printf("**************************** CChannelList::NewZap me %p %s tuned %d new %s -> %llx\n", this, name.c_str(), tuned, chan->name.c_str(), chan->channel_id);
|
||||||
|
|
||||||
if(selected_chid != chan->channel_id) {
|
if(selected_chid != chan->channel_id) {
|
||||||
selected_chid = chan->channel_id;
|
selected_chid = chan->channel_id;
|
||||||
@@ -1294,114 +1327,114 @@ int CChannelList::numericZap(int key)
|
|||||||
|
|
||||||
void CChannelList::virtual_zap_mode(bool up)
|
void CChannelList::virtual_zap_mode(bool up)
|
||||||
{
|
{
|
||||||
neutrino_msg_t msg;
|
neutrino_msg_t msg;
|
||||||
neutrino_msg_data_t data;
|
neutrino_msg_data_t data;
|
||||||
|
|
||||||
if (chanlist.empty()) {
|
if (chanlist.empty()) {
|
||||||
DisplayErrorMessage(g_Locale->getText(LOCALE_CHANNELLIST_NONEFOUND)); // UTF-8
|
DisplayErrorMessage(g_Locale->getText(LOCALE_CHANNELLIST_NONEFOUND)); // UTF-8
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
int chn = getActiveChannelNumber() + (up ? 1 : -1);
|
int chn = getActiveChannelNumber() + (up ? 1 : -1);
|
||||||
if (chn > (int)chanlist.size())
|
if (chn > (int)chanlist.size())
|
||||||
chn = 1;
|
chn = 1;
|
||||||
if (chn == 0)
|
if (chn == 0)
|
||||||
chn = (int)chanlist.size();
|
chn = (int)chanlist.size();
|
||||||
|
|
||||||
int lastchan= -1;
|
int lastchan= -1;
|
||||||
bool doZap = true;
|
bool doZap = true;
|
||||||
bool showEPG = false;
|
bool showEPG = false;
|
||||||
int epgpos = 0;
|
int epgpos = 0;
|
||||||
|
|
||||||
while(1)
|
while(1)
|
||||||
{
|
{
|
||||||
if (lastchan != chn || (epgpos != 0))
|
if (lastchan != chn || (epgpos != 0))
|
||||||
{
|
{
|
||||||
showInfo(chn- 1, epgpos);
|
showInfo(chn- 1, epgpos);
|
||||||
lastchan= chn;
|
lastchan= chn;
|
||||||
}
|
}
|
||||||
epgpos = 0;
|
epgpos = 0;
|
||||||
g_RCInput->getMsg( &msg, &data, 15*10 ); // 15 seconds, not user changable
|
g_RCInput->getMsg( &msg, &data, 15*10 ); // 15 seconds, not user changable
|
||||||
//printf("########### %u ### %u #### %u #######\n", msg, NeutrinoMessages::EVT_TIMER, CRCInput::RC_timeout);
|
//printf("########### %u ### %u #### %u #######\n", msg, NeutrinoMessages::EVT_TIMER, CRCInput::RC_timeout);
|
||||||
|
|
||||||
if ( msg == CRCInput::RC_ok )
|
if ( msg == CRCInput::RC_ok )
|
||||||
{
|
{
|
||||||
if ( ( chn > (signed int) chanlist.size() ) || ( chn == 0 ) )
|
if ( ( chn > (signed int) chanlist.size() ) || ( chn == 0 ) )
|
||||||
{
|
{
|
||||||
chn = tuned + 1;
|
chn = tuned + 1;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
else if ( msg == CRCInput::RC_left )
|
else if ( msg == CRCInput::RC_left )
|
||||||
{
|
{
|
||||||
if ( chn == 1 )
|
if ( chn == 1 )
|
||||||
chn = chanlist.size();
|
chn = chanlist.size();
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
chn--;
|
chn--;
|
||||||
|
|
||||||
if (chn > (int)chanlist.size())
|
if (chn > (int)chanlist.size())
|
||||||
chn = (int)chanlist.size();
|
chn = (int)chanlist.size();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if ( msg == CRCInput::RC_right )
|
else if ( msg == CRCInput::RC_right )
|
||||||
{
|
{
|
||||||
chn++;
|
chn++;
|
||||||
|
|
||||||
if (chn > (int)chanlist.size())
|
if (chn > (int)chanlist.size())
|
||||||
chn = 1;
|
chn = 1;
|
||||||
}
|
}
|
||||||
else if ( msg == CRCInput::RC_up )
|
else if ( msg == CRCInput::RC_up )
|
||||||
{
|
{
|
||||||
epgpos = -1;
|
epgpos = -1;
|
||||||
}
|
}
|
||||||
else if ( msg == CRCInput::RC_down )
|
else if ( msg == CRCInput::RC_down )
|
||||||
{
|
{
|
||||||
epgpos = 1;
|
epgpos = 1;
|
||||||
}
|
}
|
||||||
else if ( ( msg == CRCInput::RC_home ) || ( msg == CRCInput::RC_timeout ) )
|
else if ( ( msg == CRCInput::RC_home ) || ( msg == CRCInput::RC_timeout ) )
|
||||||
{
|
{
|
||||||
// Abbruch ohne Channel zu wechseln
|
// Abbruch ohne Channel zu wechseln
|
||||||
doZap = false;
|
doZap = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
else if ( msg == CRCInput::RC_red )
|
else if ( msg == CRCInput::RC_red )
|
||||||
{
|
{
|
||||||
// Rote Taste zeigt EPG fuer gewaehlten Kanal an
|
// Rote Taste zeigt EPG fuer gewaehlten Kanal an
|
||||||
if ( ( chn <= (signed int) chanlist.size() ) && ( chn != 0 ) )
|
if ( ( chn <= (signed int) chanlist.size() ) && ( chn != 0 ) )
|
||||||
{
|
{
|
||||||
doZap = false;
|
doZap = false;
|
||||||
showEPG = true;
|
showEPG = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if ( CNeutrinoApp::getInstance()->handleMsg( msg, data ) & messages_return::cancel_all )
|
else if ( CNeutrinoApp::getInstance()->handleMsg( msg, data ) & messages_return::cancel_all )
|
||||||
{
|
{
|
||||||
doZap = false;
|
doZap = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
g_InfoViewer->clearVirtualZapMode();
|
g_InfoViewer->clearVirtualZapMode();
|
||||||
|
|
||||||
chn--;
|
chn--;
|
||||||
if (chn<0)
|
if (chn<0)
|
||||||
chn=0;
|
chn=0;
|
||||||
if ( doZap )
|
if ( doZap )
|
||||||
{
|
{
|
||||||
if(g_settings.timing[SNeutrinoSettings::TIMING_INFOBAR] == 0)
|
if(g_settings.timing[SNeutrinoSettings::TIMING_INFOBAR] == 0)
|
||||||
g_InfoViewer->killTitle();
|
g_InfoViewer->killTitle();
|
||||||
if(SameTP(chanlist[chn]->channel_id))
|
if(SameTP(chanlist[chn]->channel_id))
|
||||||
zapTo( chn );
|
zapTo( chn );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
showInfo(tuned);
|
showInfo(tuned);
|
||||||
g_InfoViewer->killTitle();
|
g_InfoViewer->killTitle();
|
||||||
|
|
||||||
// Rote Taste zeigt EPG fuer gewaehlten Kanal an
|
// Rote Taste zeigt EPG fuer gewaehlten Kanal an
|
||||||
if ( showEPG )
|
if ( showEPG )
|
||||||
g_EventList->exec(chanlist[chn]->channel_id, chanlist[chn]->name);
|
g_EventList->exec(chanlist[chn]->channel_id, chanlist[chn]->name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CChannelList::quickZap(int key, bool cycle)
|
void CChannelList::quickZap(int key, bool cycle)
|
||||||
@@ -1414,7 +1447,7 @@ void CChannelList::quickZap(int key, bool cycle)
|
|||||||
int bactive = bouquetList->getActiveBouquetNumber();
|
int bactive = bouquetList->getActiveBouquetNumber();
|
||||||
size_t cactive = selected;
|
size_t cactive = selected;
|
||||||
|
|
||||||
printf("CChannelList::quickZap: selected %d total %d active bouquet %d total %d\n", cactive, chanlist.size(), bactive, bsize);
|
printf("CChannelList::quickZap: selected %d total %d active bouquet %d total %d\n", cactive, chanlist.size(), bactive, bsize);
|
||||||
if ( (key==g_settings.key_quickzap_down) || (key == CRCInput::RC_left))
|
if ( (key==g_settings.key_quickzap_down) || (key == CRCInput::RC_left))
|
||||||
{
|
{
|
||||||
if(cactive == 0)
|
if(cactive == 0)
|
||||||
@@ -1441,7 +1474,7 @@ printf("CChannelList::quickZap: selected %d total %d active bouquet %d total %d\
|
|||||||
} else
|
} else
|
||||||
selected = cactive;
|
selected = cactive;
|
||||||
}
|
}
|
||||||
printf("CChannelList::quickZap: new selected %d total %d active bouquet %d total %d\n", cactive, bouquetList->Bouquets[bactive]->channelList->getSize(), bactive, bsize);
|
printf("CChannelList::quickZap: new selected %d total %d active bouquet %d total %d\n", cactive, bouquetList->Bouquets[bactive]->channelList->getSize(), bactive, bsize);
|
||||||
#if 1
|
#if 1
|
||||||
CNeutrinoApp::getInstance()->channelList->zapTo(bouquetList->Bouquets[bactive]->channelList->getKey(cactive)-1);
|
CNeutrinoApp::getInstance()->channelList->zapTo(bouquetList->Bouquets[bactive]->channelList->getKey(cactive)-1);
|
||||||
#else
|
#else
|
||||||
@@ -1533,7 +1566,7 @@ void CChannelList::paintDetails(int index)
|
|||||||
text2 = text2.substr( 1 );
|
text2 = text2.substr( 1 );
|
||||||
text2 = text2.substr( 0, text2.find('\n') );
|
text2 = text2.substr( 0, text2.find('\n') );
|
||||||
int pos = 0;
|
int pos = 0;
|
||||||
while ( ( pos != -1 ) && (g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->getRenderWidth(text2, true) > (width - 30 - noch_len) ) ) {
|
while ( ( pos != -1 ) && (g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->getRenderWidth(text2, true) > (width - 30 - noch_len) ) ) {
|
||||||
pos = text2.find_last_of(" ");
|
pos = text2.find_last_of(" ");
|
||||||
|
|
||||||
if ( pos!=-1 )
|
if ( pos!=-1 )
|
||||||
@@ -1548,7 +1581,7 @@ void CChannelList::paintDetails(int index)
|
|||||||
}
|
}
|
||||||
char buf[128] = {0};
|
char buf[128] = {0};
|
||||||
int len = 0;
|
int len = 0;
|
||||||
if(g_settings.channellist_foot == 0){
|
if(g_settings.channellist_foot == 0) {
|
||||||
transponder_id_t ct = chanlist[index]->getTransponderId();
|
transponder_id_t ct = chanlist[index]->getTransponderId();
|
||||||
transponder_list_t::iterator tpI = transponders.find(ct);
|
transponder_list_t::iterator tpI = transponders.find(ct);
|
||||||
len = snprintf(buf, sizeof(buf), "%d ", chanlist[index]->getFreqId());
|
len = snprintf(buf, sizeof(buf), "%d ", chanlist[index]->getFreqId());
|
||||||
@@ -1581,12 +1614,12 @@ void CChannelList::paintDetails(int index)
|
|||||||
}
|
}
|
||||||
g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ 10, y+ height+ 5+ 3*fheight, width - 30, buf, COL_MENUCONTENTDARK, 0, true);
|
g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ 10, y+ height+ 5+ 3*fheight, width - 30, buf, COL_MENUCONTENTDARK, 0, true);
|
||||||
}
|
}
|
||||||
else if( !displayNext && g_settings.channellist_foot == 1){ // next Event
|
else if( !displayNext && g_settings.channellist_foot == 1) { // next Event
|
||||||
CSectionsdClient::CurrentNextInfo CurrentNext;
|
CSectionsdClient::CurrentNextInfo CurrentNext;
|
||||||
sectionsd_getCurrentNextServiceKey(chanlist[index]->channel_id & 0xFFFFFFFFFFFFULL, CurrentNext);
|
sectionsd_getCurrentNextServiceKey(chanlist[index]->channel_id & 0xFFFFFFFFFFFFULL, CurrentNext);
|
||||||
if (!CurrentNext.next_name.empty()){
|
if (!CurrentNext.next_name.empty()) {
|
||||||
struct tm *pStartZeit = localtime (& CurrentNext.next_zeit.startzeit);
|
struct tm *pStartZeit = localtime (& CurrentNext.next_zeit.startzeit);
|
||||||
len = snprintf(buf, sizeof(buf), "%s %02d:%02d ",g_Locale->getText(LOCALE_WORD_FROM),pStartZeit->tm_hour, pStartZeit->tm_min );
|
len = snprintf(buf, sizeof(buf), "%s %02d:%02d ",g_Locale->getText(LOCALE_WORD_FROM),pStartZeit->tm_hour, pStartZeit->tm_min );
|
||||||
len += snprintf(&buf[len], sizeof(buf) - len, "%s", CurrentNext.next_name.c_str());
|
len += snprintf(&buf[len], sizeof(buf) - len, "%s", CurrentNext.next_name.c_str());
|
||||||
|
|
||||||
g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->RenderString(x+ 10, y+ height+ 5+ 3*fheight, width - 30, buf, COL_MENUCONTENTDARK, 0, true);
|
g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->RenderString(x+ 10, y+ height+ 5+ 3*fheight, width - 30, buf, COL_MENUCONTENTDARK, 0, true);
|
||||||
@@ -1597,12 +1630,12 @@ void CChannelList::paintDetails(int index)
|
|||||||
|
|
||||||
void CChannelList::clearItem2DetailsLine ()
|
void CChannelList::clearItem2DetailsLine ()
|
||||||
{
|
{
|
||||||
paintItem2DetailsLine (-1, 0);
|
paintItem2DetailsLine (-1, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CChannelList::paintItem2DetailsLine (int pos, int /*ch_index*/)
|
void CChannelList::paintItem2DetailsLine (int pos, int /*ch_index*/)
|
||||||
{
|
{
|
||||||
#define ConnectLineBox_Width 16
|
#define ConnectLineBox_Width 16
|
||||||
|
|
||||||
int xpos = x - ConnectLineBox_Width;
|
int xpos = x - ConnectLineBox_Width;
|
||||||
int ypos1 = y + theight+0 + pos*fheight;
|
int ypos1 = y + theight+0 + pos*fheight;
|
||||||
@@ -1617,7 +1650,7 @@ void CChannelList::paintItem2DetailsLine (int pos, int /*ch_index*/)
|
|||||||
|
|
||||||
// paint Line if detail info (and not valid list pos)
|
// paint Line if detail info (and not valid list pos)
|
||||||
if (pos >= 0) { //pos >= 0 && chanlist[ch_index]->currentEvent.description != "") {
|
if (pos >= 0) { //pos >= 0 && chanlist[ch_index]->currentEvent.description != "") {
|
||||||
if(1) // FIXME why -> ? (!g_settings.channellist_extended)
|
if(1) // FIXME why -> ? (!g_settings.channellist_extended)
|
||||||
{
|
{
|
||||||
int fh = fheight > 10 ? fheight - 10: 5;
|
int fh = fheight > 10 ? fheight - 10: 5;
|
||||||
frameBuffer->paintBoxRel(xpos+ConnectLineBox_Width-4, ypos1+5, 4, fh, col1);
|
frameBuffer->paintBoxRel(xpos+ConnectLineBox_Width-4, ypos1+5, 4, fh, col1);
|
||||||
@@ -1649,9 +1682,9 @@ void CChannelList::showChannelLogo()
|
|||||||
frameBuffer->paintBoxRel(x + width - logo_off - logo_w, y+(theight-logo_h)/2, logo_w, logo_h, COL_MENUHEAD_PLUS_0);
|
frameBuffer->paintBoxRel(x + width - logo_off - logo_w, y+(theight-logo_h)/2, logo_w, logo_h, COL_MENUHEAD_PLUS_0);
|
||||||
|
|
||||||
std::string lname;
|
std::string lname;
|
||||||
if(g_PicViewer->GetLogoName(chanlist[selected]->channel_id, chanlist[selected]->name, lname, &logo_w, &logo_h)){
|
if(g_PicViewer->GetLogoName(chanlist[selected]->channel_id, chanlist[selected]->name, lname, &logo_w, &logo_h)) {
|
||||||
if(logo_h > theight){
|
if(logo_h > theight) {
|
||||||
if((theight/(logo_h-theight))>1){
|
if((theight/(logo_h-theight))>1) {
|
||||||
logo_w -= (logo_w/(theight/(logo_h-theight)));
|
logo_w -= (logo_w/(theight/(logo_h-theight)));
|
||||||
}
|
}
|
||||||
logo_h = theight;
|
logo_h = theight;
|
||||||
@@ -1735,7 +1768,7 @@ void CChannelList::paintItem(int pos)
|
|||||||
if ((int) ch_desc_len > max_desc_len)
|
if ((int) ch_desc_len > max_desc_len)
|
||||||
ch_desc_len = max_desc_len;
|
ch_desc_len = max_desc_len;
|
||||||
|
|
||||||
if(g_settings.channellist_extended){
|
if(g_settings.channellist_extended) {
|
||||||
if(displayNext)
|
if(displayNext)
|
||||||
{
|
{
|
||||||
struct tm *pStartZeit = localtime(&p_event->startTime);
|
struct tm *pStartZeit = localtime(&p_event->startTime);
|
||||||
@@ -1773,17 +1806,17 @@ void CChannelList::paintItem(int pos)
|
|||||||
}
|
}
|
||||||
|
|
||||||
g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ 5+ numwidth+ 10+prg_offset, ypos+ fheight, width- numwidth- 40- 15-prg_offset, nameAndDescription, color, 0, true);
|
g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ 5+ numwidth+ 10+prg_offset, ypos+ fheight, width- numwidth- 40- 15-prg_offset, nameAndDescription, color, 0, true);
|
||||||
if (g_settings.channellist_epgtext_align_right){
|
if (g_settings.channellist_epgtext_align_right) {
|
||||||
// align right
|
// align right
|
||||||
g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->RenderString(x + width - 20 - ch_desc_len - 28, ypos + fheight, ch_desc_len, p_event->description, (curr == selected)?COL_MENUCONTENTSELECTED:(!displayNext ? COL_MENUCONTENT : COL_MENUCONTENTINACTIVE) , 0, true);
|
g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->RenderString(x + width - 20 - ch_desc_len - 28, ypos + fheight, ch_desc_len, p_event->description, (curr == selected)?COL_MENUCONTENTSELECTED:(!displayNext ? COL_MENUCONTENT : COL_MENUCONTENTINACTIVE) , 0, true);
|
||||||
}
|
}
|
||||||
else{
|
else {
|
||||||
// align left
|
// align left
|
||||||
g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->RenderString(x+ 5+ numwidth+ 10+ ch_name_len+ 5+prg_offset, ypos+ fheight, ch_desc_len, p_event->description, (curr == selected)?COL_MENUCONTENTSELECTED:(!displayNext ? COL_MENUCONTENT : COL_MENUCONTENTINACTIVE) , 0, true);
|
g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->RenderString(x+ 5+ numwidth+ 10+ ch_name_len+ 5+prg_offset, ypos+ fheight, ch_desc_len, p_event->description, (curr == selected)?COL_MENUCONTENTSELECTED:(!displayNext ? COL_MENUCONTENT : COL_MENUCONTENTINACTIVE) , 0, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if(g_settings.channellist_extended){
|
if(g_settings.channellist_extended) {
|
||||||
int pbz_activeCol, pbz_passiveCol;
|
int pbz_activeCol, pbz_passiveCol;
|
||||||
if (liststart + pos != selected) {
|
if (liststart + pos != selected) {
|
||||||
pbz_activeCol = COL_MENUCONTENT_PLUS_1;
|
pbz_activeCol = COL_MENUCONTENT_PLUS_1;
|
||||||
@@ -1800,7 +1833,7 @@ void CChannelList::paintItem(int pos)
|
|||||||
if (curr == selected) {
|
if (curr == selected) {
|
||||||
if (!(chan->currentEvent.description.empty())) {
|
if (!(chan->currentEvent.description.empty())) {
|
||||||
snprintf(nameAndDescription, sizeof(nameAndDescription), "%s - %s",
|
snprintf(nameAndDescription, sizeof(nameAndDescription), "%s - %s",
|
||||||
chan->name.c_str(), p_event->description.c_str());
|
chan->name.c_str(), p_event->description.c_str());
|
||||||
CVFD::getInstance()->showMenuText(0, nameAndDescription, -1, true); // UTF-8
|
CVFD::getInstance()->showMenuText(0, nameAndDescription, -1, true); // UTF-8
|
||||||
} else
|
} else
|
||||||
CVFD::getInstance()->showMenuText(0, chan->name.c_str(), -1, true); // UTF-8
|
CVFD::getInstance()->showMenuText(0, chan->name.c_str(), -1, true); // UTF-8
|
||||||
@@ -1825,7 +1858,7 @@ void CChannelList::paintHead()
|
|||||||
|
|
||||||
bool gotTime = g_Sectionsd->getIsTimeSet();
|
bool gotTime = g_Sectionsd->getIsTimeSet();
|
||||||
|
|
||||||
if(gotTime){
|
if(gotTime) {
|
||||||
strftime(timestr, 10, "%H:%M", tm);
|
strftime(timestr, 10, "%H:%M", tm);
|
||||||
timestr_len = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getRenderWidth(timestr, true); // UTF-8
|
timestr_len = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getRenderWidth(timestr, true); // UTF-8
|
||||||
}
|
}
|
||||||
@@ -1841,8 +1874,8 @@ void CChannelList::paintHead()
|
|||||||
frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_HELP, x + width - iw1 - 4, y, theight); //y+ 5 );
|
frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_HELP, x + width - iw1 - 4, y, theight); //y+ 5 );
|
||||||
frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_DBOX, x + width - iw1 - iw2 - 8, y, theight);//y + 5); // icon for bouquet list button
|
frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_DBOX, x + width - iw1 - iw2 - 8, y, theight);//y + 5); // icon for bouquet list button
|
||||||
frameBuffer->paintIcon(this->new_mode_active ?
|
frameBuffer->paintIcon(this->new_mode_active ?
|
||||||
NEUTRINO_ICON_BUTTON_MUTE_ZAP_ACTIVE : NEUTRINO_ICON_BUTTON_MUTE_ZAP_INACTIVE,
|
NEUTRINO_ICON_BUTTON_MUTE_ZAP_ACTIVE : NEUTRINO_ICON_BUTTON_MUTE_ZAP_INACTIVE,
|
||||||
x + width - iw1 - iw2 - iw3 - 12, y, theight);
|
x + width - iw1 - iw2 - iw3 - 12, y, theight);
|
||||||
|
|
||||||
if (gotTime) {
|
if (gotTime) {
|
||||||
g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->RenderString(x + width - iw1 - iw2 - iw3 - 16 -timestr_len,
|
g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->RenderString(x + width - iw1 - iw2 - iw3 - 16 -timestr_len,
|
||||||
|
@@ -53,91 +53,99 @@ enum {
|
|||||||
|
|
||||||
class CChannelList
|
class CChannelList
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
CFrameBuffer *frameBuffer;
|
CFrameBuffer *frameBuffer;
|
||||||
unsigned int selected, selected_in_new_mode;
|
unsigned int selected, selected_in_new_mode;
|
||||||
t_channel_id selected_chid;
|
t_channel_id selected_chid;
|
||||||
CLastChannel lastChList;
|
CLastChannel lastChList;
|
||||||
unsigned int liststart;
|
unsigned int liststart;
|
||||||
unsigned int listmaxshow;
|
unsigned int listmaxshow;
|
||||||
unsigned int numwidth;
|
unsigned int numwidth;
|
||||||
int fheight; // Fonthoehe Channellist-Inhalt
|
int fheight; // Fonthoehe Channellist-Inhalt
|
||||||
int theight; // Fonthoehe Channellist-Titel
|
int theight; // Fonthoehe Channellist-Titel
|
||||||
int footerHeight;
|
int footerHeight;
|
||||||
|
|
||||||
std::string name;
|
std::string name;
|
||||||
ZapitChannelList chanlist;
|
ZapitChannelList chanlist;
|
||||||
CZapProtection* zapProtection;
|
CZapProtection* zapProtection;
|
||||||
|
|
||||||
int width;
|
int width;
|
||||||
int height;
|
int height;
|
||||||
int x;
|
int x;
|
||||||
int y;
|
int y;
|
||||||
int logo_off;
|
int logo_off;
|
||||||
|
|
||||||
bool historyMode;
|
bool historyMode;
|
||||||
bool vlist; // "virtual" list, not bouquet
|
bool vlist; // "virtual" list, not bouquet
|
||||||
bool displayNext;
|
bool displayNext;
|
||||||
|
|
||||||
int info_height;
|
int info_height;
|
||||||
bool new_mode_active;
|
bool new_mode_active;
|
||||||
|
|
||||||
void paintDetails(int index);
|
void paintDetails(int index);
|
||||||
void clearItem2DetailsLine ();
|
void clearItem2DetailsLine ();
|
||||||
void paintItem2DetailsLine (int pos, int ch_index);
|
void paintItem2DetailsLine (int pos, int ch_index);
|
||||||
void paintItem(int pos);
|
void paintItem(int pos);
|
||||||
void paint();
|
void paint();
|
||||||
void paintHead();
|
void paintHead();
|
||||||
void hide();
|
void hide();
|
||||||
void showChannelLogo();
|
void showChannelLogo();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CChannelList(const char * const Name, bool historyMode = false, bool _vlist = false, bool new_mode_active = false );
|
CChannelList(const char * const Name, bool historyMode = false, bool _vlist = false, bool new_mode_active = false );
|
||||||
~CChannelList();
|
~CChannelList();
|
||||||
|
|
||||||
void SetChannelList(ZapitChannelList* channels);
|
void SetChannelList(ZapitChannelList* channels);
|
||||||
void addChannel(CZapitChannel* chan, int num = 0);
|
void addChannel(CZapitChannel* chan, int num = 0);
|
||||||
void putChannel(CZapitChannel* chan);
|
void putChannel(CZapitChannel* chan);
|
||||||
|
|
||||||
CZapitChannel* getChannel(int number);
|
CZapitChannel* getChannel(int number);
|
||||||
CZapitChannel* getChannel(t_channel_id channel_id);
|
CZapitChannel* getChannel(t_channel_id channel_id);
|
||||||
CZapitChannel* getChannelFromIndex( uint32_t index) { if (chanlist.size() > index) return chanlist[index]; else return NULL;};
|
CZapitChannel* getChannelFromIndex( uint32_t index) {
|
||||||
CZapitChannel* operator[]( uint32_t index) { if (chanlist.size() > index) return chanlist[index]; else return NULL;};
|
if (chanlist.size() > index) return chanlist[index];
|
||||||
int getKey(int);
|
else return NULL;
|
||||||
|
};
|
||||||
|
CZapitChannel* operator[]( uint32_t index) {
|
||||||
|
if (chanlist.size() > index) return chanlist[index];
|
||||||
|
else return NULL;
|
||||||
|
};
|
||||||
|
int getKey(int);
|
||||||
|
|
||||||
const char * getName (void) const { return name.c_str(); };
|
const char * getName (void) const {
|
||||||
const std::string & getActiveChannelName (void) const; // UTF-8
|
return name.c_str();
|
||||||
t_satellite_position getActiveSatellitePosition(void) const;
|
};
|
||||||
int getActiveChannelNumber (void) const;
|
const std::string & getActiveChannelName (void) const; // UTF-8
|
||||||
t_channel_id getActiveChannel_ChannelID(void) const;
|
t_satellite_position getActiveSatellitePosition(void) const;
|
||||||
|
int getActiveChannelNumber (void) const;
|
||||||
|
t_channel_id getActiveChannel_ChannelID(void) const;
|
||||||
|
|
||||||
void zapTo(int pos, bool forceStoreToLastChannels = false);
|
void zapTo(int pos, bool forceStoreToLastChannels = false);
|
||||||
void NewZap(t_channel_id channel_id);
|
void NewZap(t_channel_id channel_id);
|
||||||
void virtual_zap_mode(bool up);
|
void virtual_zap_mode(bool up);
|
||||||
bool zapTo_ChannelID(const t_channel_id channel_id);
|
bool zapTo_ChannelID(const t_channel_id channel_id);
|
||||||
bool adjustToChannelID(const t_channel_id channel_id, bool bToo = true);
|
bool adjustToChannelID(const t_channel_id channel_id, bool bToo = true);
|
||||||
bool showInfo(int pos, int epgpos = 0);
|
bool showInfo(int pos, int epgpos = 0);
|
||||||
void updateEvents(unsigned int from, unsigned int to);
|
void updateEvents(unsigned int from, unsigned int to);
|
||||||
int numericZap(int key);
|
int numericZap(int key);
|
||||||
int show();
|
int show();
|
||||||
int exec();
|
int exec();
|
||||||
void quickZap(int key, bool cycle = false);
|
void quickZap(int key, bool cycle = false);
|
||||||
//int hasChannel(int nChannelNr);
|
//int hasChannel(int nChannelNr);
|
||||||
int hasChannelID(t_channel_id channel_id);
|
int hasChannelID(t_channel_id channel_id);
|
||||||
void setSelected( int nChannelNr); // for adjusting bouquet's channel list after numzap or quickzap
|
void setSelected( int nChannelNr); // for adjusting bouquet's channel list after numzap or quickzap
|
||||||
|
|
||||||
int handleMsg(const neutrino_msg_t msg, neutrino_msg_data_t data);
|
int handleMsg(const neutrino_msg_t msg, neutrino_msg_data_t data);
|
||||||
|
|
||||||
int getSize() const;
|
int getSize() const;
|
||||||
int getSelectedChannelIndex() const;
|
int getSelectedChannelIndex() const;
|
||||||
void setSize(int newsize);
|
void setSize(int newsize);
|
||||||
unsigned int tuned;
|
unsigned int tuned;
|
||||||
int doChannelMenu(void);
|
int doChannelMenu(void);
|
||||||
void SortAlpha(void);
|
void SortAlpha(void);
|
||||||
void SortSat(void);
|
void SortSat(void);
|
||||||
void SortTP(void);
|
void SortTP(void);
|
||||||
void ClearList(void);
|
void ClearList(void);
|
||||||
bool SameTP(t_channel_id channel_id = 0);
|
bool SameTP(t_channel_id channel_id = 0);
|
||||||
//friend class CZapitChannel;
|
//friend class CZapitChannel;
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user