mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-27 07:23:09 +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,7 +172,7 @@ void CChannelList::updateEvents(unsigned int from, unsigned int to)
|
||||
if (displayNext) {
|
||||
time_t atime = time(NULL);
|
||||
unsigned int count;
|
||||
for (count = from; count < to; count++){
|
||||
for (count = from; count < to; count++) {
|
||||
events.clear();
|
||||
sectionsd_getEventsServiceKey(chanlist[count]->channel_id, events);
|
||||
chanlist[count]->nextEvent.startTime = (long)0x7fffffff;
|
||||
@@ -225,7 +225,7 @@ struct CmpChannelBySat: public binary_function <const CZapitChannel * const, con
|
||||
return std::lexicographical_compare(c1->getName().begin(), c1->getName().end(), c2->getName().begin(), c2->getName().end(), comparetolower);
|
||||
else
|
||||
return c1->getSatellitePosition() < c2->getSatellitePosition();
|
||||
;
|
||||
;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -242,7 +242,7 @@ struct CmpChannelByFreq: public binary_function <const CZapitChannel * const, co
|
||||
return std::lexicographical_compare(c1->getName().begin(), c1->getName().end(), c2->getName().begin(), c2->getName().end(), comparetolower);
|
||||
else
|
||||
return c1->getFreqId() < c2->getFreqId();
|
||||
;
|
||||
;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -263,7 +263,7 @@ void CChannelList::SortTP(void)
|
||||
|
||||
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)
|
||||
return chanlist[i];
|
||||
}
|
||||
@@ -272,7 +272,7 @@ CZapitChannel* CChannelList::getChannel(int number)
|
||||
|
||||
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)
|
||||
return chanlist[i];
|
||||
}
|
||||
@@ -356,7 +356,7 @@ int CChannelList::doChannelMenu(void)
|
||||
old_selected = select;
|
||||
channel_id = chanlist[selected]->channel_id;
|
||||
switch(select) {
|
||||
case 0:{
|
||||
case 0: {
|
||||
hide();
|
||||
int result = ShowMsgUTF ( LOCALE_BOUQUETEDITOR_DELETE, g_Locale->getText(LOCALE_BOUQUETEDITOR_DELETE_QUESTION), CMessageBox::mbrNo, CMessageBox::mbYes | CMessageBox::mbNo );
|
||||
|
||||
@@ -559,10 +559,10 @@ int CChannelList::show()
|
||||
}
|
||||
else if ( ( msg == CRCInput::RC_timeout ) || ( msg == (neutrino_msg_t)g_settings.key_channelList_cancel) ) {
|
||||
res = -1;
|
||||
if(!actzap){
|
||||
if(!actzap) {
|
||||
selected = oldselected;
|
||||
}
|
||||
else{
|
||||
else {
|
||||
res = -4;
|
||||
selected = selected_in_new_mode;
|
||||
}
|
||||
@@ -618,13 +618,19 @@ int CChannelList::show()
|
||||
selected=0;
|
||||
liststart = (selected/listmaxshow)*listmaxshow;
|
||||
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) {
|
||||
selected=chanlist.size()-1;
|
||||
liststart = (selected/listmaxshow)*listmaxshow;
|
||||
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)
|
||||
{
|
||||
@@ -650,7 +656,10 @@ int CChannelList::show()
|
||||
showChannelLogo();
|
||||
}
|
||||
|
||||
if(this->new_mode_active && SameTP()) { actzap = true; zapTo(selected); }
|
||||
if(this->new_mode_active && SameTP()) {
|
||||
actzap = true;
|
||||
zapTo(selected);
|
||||
}
|
||||
//paintHead();
|
||||
}
|
||||
else if (msg == CRCInput::RC_down || (int) msg == g_settings.key_channelList_pagedown)
|
||||
@@ -679,7 +688,10 @@ int CChannelList::show()
|
||||
showChannelLogo();
|
||||
}
|
||||
|
||||
if(this->new_mode_active && SameTP()) { actzap = true; zapTo(selected); }
|
||||
if(this->new_mode_active && SameTP()) {
|
||||
actzap = true;
|
||||
zapTo(selected);
|
||||
}
|
||||
//paintHead();
|
||||
}
|
||||
|
||||
@@ -741,16 +753,36 @@ int CChannelList::show()
|
||||
else if (CRCInput::isNumeric(msg) && (this->historyMode || g_settings.sms_channel)) {
|
||||
if (this->historyMode) { //numeric zap
|
||||
switch (msg) {
|
||||
case CRCInput::RC_0:selected = 0;break;
|
||||
case CRCInput::RC_1:selected = 1;break;
|
||||
case CRCInput::RC_2:selected = 2;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;
|
||||
case CRCInput::RC_0:
|
||||
selected = 0;
|
||||
break;
|
||||
case CRCInput::RC_1:
|
||||
selected = 1;
|
||||
break;
|
||||
case CRCInput::RC_2:
|
||||
selected = 2;
|
||||
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;
|
||||
loop = false;
|
||||
@@ -932,7 +964,7 @@ int CChannelList::handleMsg(const neutrino_msg_t msg, neutrino_msg_data_t data)
|
||||
delete zapProtection;
|
||||
zapProtection = NULL;
|
||||
|
||||
out:
|
||||
out:
|
||||
if (startvideo)
|
||||
g_RemoteControl->startvideo();
|
||||
|
||||
@@ -946,7 +978,8 @@ bool CChannelList::adjustToChannelID(const t_channel_id channel_id, bool bToo)
|
||||
unsigned int i;
|
||||
|
||||
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++) {
|
||||
if(chanlist[i] == NULL) {
|
||||
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)
|
||||
new_mode = LIST_MODE_PROV;
|
||||
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;
|
||||
}
|
||||
has_channel = TVsatList->adjustToChannelID(channel_id);
|
||||
@@ -1001,7 +1034,7 @@ printf("CChannelList::adjustToChannelID me %p [%s] list size %d channel_id %llx\
|
||||
#if 0
|
||||
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)
|
||||
return(i);
|
||||
}
|
||||
@@ -1011,7 +1044,7 @@ int CChannelList::hasChannel(int nChannelNr)
|
||||
|
||||
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) {
|
||||
printf("CChannelList::hasChannelID REPORT BUG !! ******************************** %d is NULL !!\n", i);
|
||||
continue;
|
||||
@@ -1034,7 +1067,7 @@ void CChannelList::setSelected( int nChannelNr)
|
||||
// -- Zap to channel with 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++) {
|
||||
if (chanlist[i]->channel_id == channel_id) {
|
||||
zapTo (i);
|
||||
@@ -1057,7 +1090,7 @@ void CChannelList::zapTo(int pos, bool /* forceStoreToLastChannels */)
|
||||
}
|
||||
|
||||
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 ) {
|
||||
tuned = pos;
|
||||
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;
|
||||
|
||||
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) {
|
||||
selected_chid = chan->channel_id;
|
||||
@@ -1414,7 +1447,7 @@ void CChannelList::quickZap(int key, bool cycle)
|
||||
int bactive = bouquetList->getActiveBouquetNumber();
|
||||
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(cactive == 0)
|
||||
@@ -1441,7 +1474,7 @@ printf("CChannelList::quickZap: selected %d total %d active bouquet %d total %d\
|
||||
} else
|
||||
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
|
||||
CNeutrinoApp::getInstance()->channelList->zapTo(bouquetList->Bouquets[bactive]->channelList->getKey(cactive)-1);
|
||||
#else
|
||||
@@ -1548,7 +1581,7 @@ void CChannelList::paintDetails(int index)
|
||||
}
|
||||
char buf[128] = {0};
|
||||
int len = 0;
|
||||
if(g_settings.channellist_foot == 0){
|
||||
if(g_settings.channellist_foot == 0) {
|
||||
transponder_id_t ct = chanlist[index]->getTransponderId();
|
||||
transponder_list_t::iterator tpI = transponders.find(ct);
|
||||
len = snprintf(buf, sizeof(buf), "%d ", chanlist[index]->getFreqId());
|
||||
@@ -1581,10 +1614,10 @@ 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);
|
||||
}
|
||||
else if( !displayNext && g_settings.channellist_foot == 1){ // next Event
|
||||
else if( !displayNext && g_settings.channellist_foot == 1) { // next Event
|
||||
CSectionsdClient::CurrentNextInfo 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);
|
||||
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());
|
||||
@@ -1602,7 +1635,7 @@ void CChannelList::clearItem2DetailsLine ()
|
||||
|
||||
void CChannelList::paintItem2DetailsLine (int pos, int /*ch_index*/)
|
||||
{
|
||||
#define ConnectLineBox_Width 16
|
||||
#define ConnectLineBox_Width 16
|
||||
|
||||
int xpos = x - ConnectLineBox_Width;
|
||||
int ypos1 = y + theight+0 + pos*fheight;
|
||||
@@ -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);
|
||||
|
||||
std::string lname;
|
||||
if(g_PicViewer->GetLogoName(chanlist[selected]->channel_id, chanlist[selected]->name, lname, &logo_w, &logo_h)){
|
||||
if(logo_h > theight){
|
||||
if((theight/(logo_h-theight))>1){
|
||||
if(g_PicViewer->GetLogoName(chanlist[selected]->channel_id, chanlist[selected]->name, lname, &logo_w, &logo_h)) {
|
||||
if(logo_h > theight) {
|
||||
if((theight/(logo_h-theight))>1) {
|
||||
logo_w -= (logo_w/(theight/(logo_h-theight)));
|
||||
}
|
||||
logo_h = theight;
|
||||
@@ -1735,7 +1768,7 @@ void CChannelList::paintItem(int pos)
|
||||
if ((int) ch_desc_len > max_desc_len)
|
||||
ch_desc_len = max_desc_len;
|
||||
|
||||
if(g_settings.channellist_extended){
|
||||
if(g_settings.channellist_extended) {
|
||||
if(displayNext)
|
||||
{
|
||||
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);
|
||||
if (g_settings.channellist_epgtext_align_right){
|
||||
if (g_settings.channellist_epgtext_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);
|
||||
}
|
||||
else{
|
||||
else {
|
||||
// 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);
|
||||
}
|
||||
}
|
||||
else {
|
||||
if(g_settings.channellist_extended){
|
||||
if(g_settings.channellist_extended) {
|
||||
int pbz_activeCol, pbz_passiveCol;
|
||||
if (liststart + pos != selected) {
|
||||
pbz_activeCol = COL_MENUCONTENT_PLUS_1;
|
||||
@@ -1825,7 +1858,7 @@ void CChannelList::paintHead()
|
||||
|
||||
bool gotTime = g_Sectionsd->getIsTimeSet();
|
||||
|
||||
if(gotTime){
|
||||
if(gotTime) {
|
||||
strftime(timestr, 10, "%H:%M", tm);
|
||||
timestr_len = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getRenderWidth(timestr, true); // UTF-8
|
||||
}
|
||||
|
@@ -53,7 +53,7 @@ enum {
|
||||
|
||||
class CChannelList
|
||||
{
|
||||
private:
|
||||
private:
|
||||
CFrameBuffer *frameBuffer;
|
||||
unsigned int selected, selected_in_new_mode;
|
||||
t_channel_id selected_chid;
|
||||
@@ -91,7 +91,7 @@ class CChannelList
|
||||
void hide();
|
||||
void showChannelLogo();
|
||||
|
||||
public:
|
||||
public:
|
||||
CChannelList(const char * const Name, bool historyMode = false, bool _vlist = false, bool new_mode_active = false );
|
||||
~CChannelList();
|
||||
|
||||
@@ -101,11 +101,19 @@ class CChannelList
|
||||
|
||||
CZapitChannel* getChannel(int number);
|
||||
CZapitChannel* getChannel(t_channel_id channel_id);
|
||||
CZapitChannel* getChannelFromIndex( uint32_t index) { if (chanlist.size() > index) return chanlist[index]; else return NULL;};
|
||||
CZapitChannel* operator[]( uint32_t index) { if (chanlist.size() > index) return chanlist[index]; else return NULL;};
|
||||
CZapitChannel* getChannelFromIndex( uint32_t index) {
|
||||
if (chanlist.size() > index) return chanlist[index];
|
||||
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 {
|
||||
return name.c_str();
|
||||
};
|
||||
const std::string & getActiveChannelName (void) const; // UTF-8
|
||||
t_satellite_position getActiveSatellitePosition(void) const;
|
||||
int getActiveChannelNumber (void) const;
|
||||
|
Reference in New Issue
Block a user