mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-29 00:11:14 +02:00
Neutrino: Channel list: add method isEmpty() and use it, ported from tuxbox cvs (THX Gaucho316)
This commit is contained in:
@@ -498,7 +498,7 @@ int CBouquetList::show(bool bShowChannelList)
|
|||||||
}
|
}
|
||||||
|
|
||||||
else if ( msg == CRCInput::RC_ok ) {
|
else if ( msg == CRCInput::RC_ok ) {
|
||||||
if(!bShowChannelList || Bouquets[selected]->channelList->getSize() > 0) {
|
if(!bShowChannelList || !Bouquets[selected]->channelList->isEmpty()) {
|
||||||
zapOnExit = true;
|
zapOnExit = true;
|
||||||
loop=false;
|
loop=false;
|
||||||
}
|
}
|
||||||
@@ -577,7 +577,7 @@ void CBouquetList::paintItem(int pos)
|
|||||||
CVFD::getInstance()->showMenuText(0, lname, -1, true);
|
CVFD::getInstance()->showMenuText(0, lname, -1, true);
|
||||||
} else {
|
} else {
|
||||||
if(npos < (int) Bouquets.size())
|
if(npos < (int) Bouquets.size())
|
||||||
iscurrent = Bouquets[npos]->channelList->getSize() > 0;
|
iscurrent = !Bouquets[npos]->channelList->isEmpty();
|
||||||
color = iscurrent ? COL_MENUCONTENT : COL_MENUCONTENTINACTIVE;
|
color = iscurrent ? COL_MENUCONTENT : COL_MENUCONTENTINACTIVE;
|
||||||
bgcolor = iscurrent ? COL_MENUCONTENT_PLUS_0 : COL_MENUCONTENTINACTIVE_PLUS_0;
|
bgcolor = iscurrent ? COL_MENUCONTENT_PLUS_0 : COL_MENUCONTENTINACTIVE_PLUS_0;
|
||||||
frameBuffer->paintBoxRel(x, ypos, width- 15, fheight, bgcolor);
|
frameBuffer->paintBoxRel(x, ypos, width- 15, fheight, bgcolor);
|
||||||
|
@@ -689,11 +689,11 @@ int CChannelList::show()
|
|||||||
if (!bouquetList->Bouquets.empty()) {
|
if (!bouquetList->Bouquets.empty()) {
|
||||||
bool found = true;
|
bool found = true;
|
||||||
uint32_t nNext = (bouquetList->getActiveBouquetNumber()+1) % bouquetList->Bouquets.size();
|
uint32_t nNext = (bouquetList->getActiveBouquetNumber()+1) % bouquetList->Bouquets.size();
|
||||||
if(bouquetList->Bouquets[nNext]->channelList->getSize() <= 0) {
|
if(bouquetList->Bouquets[nNext]->channelList->isEmpty() ) {
|
||||||
found = false;
|
found = false;
|
||||||
nNext = nNext < bouquetList->Bouquets.size()-1 ? nNext+1 : 0;
|
nNext = nNext < bouquetList->Bouquets.size()-1 ? nNext+1 : 0;
|
||||||
for(uint32_t i = nNext; i < bouquetList->Bouquets.size(); i++) {
|
for(uint32_t i = nNext; i < bouquetList->Bouquets.size(); i++) {
|
||||||
if(bouquetList->Bouquets[i]->channelList->getSize() > 0) {
|
if( !bouquetList->Bouquets[i]->channelList->isEmpty() ) {
|
||||||
found = true;
|
found = true;
|
||||||
nNext = i;
|
nNext = i;
|
||||||
break;
|
break;
|
||||||
@@ -711,11 +711,11 @@ int CChannelList::show()
|
|||||||
if (!bouquetList->Bouquets.empty()) {
|
if (!bouquetList->Bouquets.empty()) {
|
||||||
bool found = true;
|
bool found = true;
|
||||||
int nNext = (bouquetList->getActiveBouquetNumber()+bouquetList->Bouquets.size()-1) % bouquetList->Bouquets.size();
|
int nNext = (bouquetList->getActiveBouquetNumber()+bouquetList->Bouquets.size()-1) % bouquetList->Bouquets.size();
|
||||||
if(bouquetList->Bouquets[nNext]->channelList->getSize() <= 0) {
|
if(bouquetList->Bouquets[nNext]->channelList->isEmpty() ) {
|
||||||
found = false;
|
found = false;
|
||||||
nNext = nNext > 0 ? nNext-1 : bouquetList->Bouquets.size()-1;
|
nNext = nNext > 0 ? nNext-1 : bouquetList->Bouquets.size()-1;
|
||||||
for(int i = nNext; i > 0; i--) {
|
for(int i = nNext; i > 0; i--) {
|
||||||
if(bouquetList->Bouquets[i]->channelList->getSize() > 0) {
|
if(!bouquetList->Bouquets[i]->channelList->isEmpty()) {
|
||||||
found = true;
|
found = true;
|
||||||
nNext = i;
|
nNext = i;
|
||||||
break;
|
break;
|
||||||
@@ -1186,7 +1186,7 @@ int CChannelList::numericZap(int key)
|
|||||||
channelList->addChannel(orgList->chanlist[i]);
|
channelList->addChannel(orgList->chanlist[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (channelList->getSize() != 0) {
|
if ( !channelList->isEmpty()) {
|
||||||
channelList->adjustToChannelID(orgList->getActiveChannel_ChannelID(), false);
|
channelList->adjustToChannelID(orgList->getActiveChannel_ChannelID(), false);
|
||||||
this->frameBuffer->paintBackground();
|
this->frameBuffer->paintBackground();
|
||||||
res = channelList->exec();
|
res = channelList->exec();
|
||||||
@@ -1206,7 +1206,7 @@ int CChannelList::numericZap(int key)
|
|||||||
if(channel) channelList->addChannel(channel);
|
if(channel) channelList->addChannel(channel);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (channelList->getSize() != 0) {
|
if ( !channelList->isEmpty() ) {
|
||||||
this->frameBuffer->paintBackground();
|
this->frameBuffer->paintBackground();
|
||||||
res = channelList->exec();
|
res = channelList->exec();
|
||||||
CVFD::getInstance()->setMode(CVFD::MODE_TVRADIO);
|
CVFD::getInstance()->setMode(CVFD::MODE_TVRADIO);
|
||||||
@@ -1968,6 +1968,11 @@ void CChannelList::paint()
|
|||||||
showChannelLogo();
|
showChannelLogo();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool CChannelList::isEmpty() const
|
||||||
|
{
|
||||||
|
return this->chanlist.empty();
|
||||||
|
}
|
||||||
|
|
||||||
int CChannelList::getSize() const
|
int CChannelList::getSize() const
|
||||||
{
|
{
|
||||||
return this->chanlist.size();
|
return this->chanlist.size();
|
||||||
|
@@ -146,6 +146,7 @@ public:
|
|||||||
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;
|
||||||
|
bool isEmpty() const;
|
||||||
int getSelectedChannelIndex() const;
|
int getSelectedChannelIndex() const;
|
||||||
void setSize(int newsize);
|
void setSize(int newsize);
|
||||||
int doChannelMenu(void);
|
int doChannelMenu(void);
|
||||||
|
@@ -883,11 +883,11 @@ int EpgPlus::exec (CChannelList * pchannelList, int selectedChannelIndex, CBouqu
|
|||||||
bool found = true;
|
bool found = true;
|
||||||
uint32_t nNext = (bouquetList->getActiveBouquetNumber()+1) % bouquetList->Bouquets.size();
|
uint32_t nNext = (bouquetList->getActiveBouquetNumber()+1) % bouquetList->Bouquets.size();
|
||||||
//printf("**************************** EpgPlus::exec current bouquet %d new %d\n", bouquetList->getActiveBouquetNumber(), nNext);
|
//printf("**************************** EpgPlus::exec current bouquet %d new %d\n", bouquetList->getActiveBouquetNumber(), nNext);
|
||||||
if(bouquetList->Bouquets[nNext]->channelList->getSize() <= 0) {
|
if(bouquetList->Bouquets[nNext]->channelList->isEmpty() ) {
|
||||||
found = false;
|
found = false;
|
||||||
nNext = nNext < bouquetList->Bouquets.size()-1 ? nNext+1 : 0;
|
nNext = nNext < bouquetList->Bouquets.size()-1 ? nNext+1 : 0;
|
||||||
for(uint32_t i = nNext; i < bouquetList->Bouquets.size(); i++) {
|
for(uint32_t i = nNext; i < bouquetList->Bouquets.size(); i++) {
|
||||||
if(bouquetList->Bouquets[i]->channelList->getSize() > 0) {
|
if(!bouquetList->Bouquets[i]->channelList->isEmpty() ) {
|
||||||
found = true;
|
found = true;
|
||||||
nNext = i;
|
nNext = i;
|
||||||
break;
|
break;
|
||||||
@@ -909,11 +909,11 @@ int EpgPlus::exec (CChannelList * pchannelList, int selectedChannelIndex, CBouqu
|
|||||||
if (!bouquetList->Bouquets.empty()) {
|
if (!bouquetList->Bouquets.empty()) {
|
||||||
bool found = true;
|
bool found = true;
|
||||||
int nNext = (bouquetList->getActiveBouquetNumber()+bouquetList->Bouquets.size()-1) % bouquetList->Bouquets.size();
|
int nNext = (bouquetList->getActiveBouquetNumber()+bouquetList->Bouquets.size()-1) % bouquetList->Bouquets.size();
|
||||||
if(bouquetList->Bouquets[nNext]->channelList->getSize() <= 0) {
|
if(bouquetList->Bouquets[nNext]->channelList->isEmpty()) {
|
||||||
found = false;
|
found = false;
|
||||||
nNext = nNext > 0 ? nNext-1 : bouquetList->Bouquets.size()-1;
|
nNext = nNext > 0 ? nNext-1 : bouquetList->Bouquets.size()-1;
|
||||||
for(int i = nNext; i > 0; i--) {
|
for(int i = nNext; i > 0; i--) {
|
||||||
if(bouquetList->Bouquets[i]->channelList->getSize() > 0) {
|
if(!bouquetList->Bouquets[i]->channelList->isEmpty()) {
|
||||||
found = true;
|
found = true;
|
||||||
nNext = i;
|
nNext = i;
|
||||||
break;
|
break;
|
||||||
@@ -1261,7 +1261,7 @@ int CEPGplusHandler::exec (CMenuTarget * parent, const std::string & /*actionKey
|
|||||||
//channelList = CNeutrinoApp::getInstance()->channelList;
|
//channelList = CNeutrinoApp::getInstance()->channelList;
|
||||||
int bnum = bouquetList->getActiveBouquetNumber();
|
int bnum = bouquetList->getActiveBouquetNumber();
|
||||||
current_bouquet = bnum;
|
current_bouquet = bnum;
|
||||||
if(!bouquetList->Bouquets.empty() && bouquetList->Bouquets[bnum]->channelList->getSize() > 0)
|
if(!bouquetList->Bouquets.empty() && !bouquetList->Bouquets[bnum]->channelList->isEmpty() )
|
||||||
channelList = bouquetList->Bouquets[bnum]->channelList;
|
channelList = bouquetList->Bouquets[bnum]->channelList;
|
||||||
else
|
else
|
||||||
channelList = CNeutrinoApp::getInstance()->channelList;
|
channelList = CNeutrinoApp::getInstance()->channelList;
|
||||||
|
Reference in New Issue
Block a user