Project "Tuxbox-GIT: apps": The branch, master has been updated via 7c16926b6522d4606d6bf20864f3f627bc2ed1c8 (commit) via 04a3f6b028fa3e95cb8ec2691cc5c8be58249b71 (commit) via 5af5cfb9585c9d43c512b33bd9e8d4ee871e32d8 (commit) via 8f7c5428de4744aff65ea71a9b9d8f0e09dba82b (commit) via fff9161ff226b1718d19db4f7a61721ef4498a0c (commit) via 875575a763345d965cb5b67a2147c2489222396c (commit) via e32ee733bd3d35460c7d8107e8ccd62bc19ab444 (commit) via 88072454e59fe7db1b8e31f194fdb83dc00ad976 (commit) via 9647ddb424b468fe0fefc7b44f2157869992991d (commit) from 2fcfc65a1783740c2162dbd687df5cdee315e628 (commit)
Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 7c16926b6522d4606d6bf20864f3f627bc2ed1c8 Author: Christian Schuett <gaucho...@hotmail.com> Date: Thu Apr 3 20:02:05 2014 +0200 Neutrino EPG viewer: fix width and height calculation of lines if font sizes of EPG info1 and info2 differ, width and height of lines are calculated wrong Signed-off-by: Christian Schuett <gaucho...@hotmail.com> Signed-off-by: Thilo Graf <d...@novatux.de> diff --git a/tuxbox/neutrino/src/gui/channellist.cpp b/tuxbox/neutrino/src/gui/channellist.cpp index 4609d7b..378d3c2 100644 --- a/tuxbox/neutrino/src/gui/channellist.cpp +++ b/tuxbox/neutrino/src/gui/channellist.cpp @@ -1758,7 +1758,7 @@ void CChannelList::processTextToArray(std::string text) // UTF-8 { std::string aktLine = ""; std::string aktWord = ""; - int aktWidth = 0; + int aktWidth = 0, aktWordWidth = 0; text += ' '; char* text_= (char*) text.c_str(); @@ -1769,7 +1769,7 @@ void CChannelList::processTextToArray(std::string text) // UTF-8 if (*text_!='\n') aktWord += *text_; - int aktWordWidth = g_Font[eventFont]->getRenderWidth(aktWord, true); + aktWordWidth = g_Font[eventFont]->getRenderWidth(aktWord, true); if ((aktWordWidth+aktWidth)<=(infozone_width - 20)) {//space ok, add aktWidth += aktWordWidth; diff --git a/tuxbox/neutrino/src/gui/epgview.cpp b/tuxbox/neutrino/src/gui/epgview.cpp index 2a3bdbf..588ee0b 100644 --- a/tuxbox/neutrino/src/gui/epgview.cpp +++ b/tuxbox/neutrino/src/gui/epgview.cpp @@ -139,7 +139,7 @@ void CEpgData::start() oy -= buttonheight; /* this is the text box height - and the height of the scroll bar */ sb = oy - topboxheight - botboxheight; - medlineheight = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->getHeight(); + medlineheight = std::max(g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->getHeight(), g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO2]->getHeight()); medlinecount = sb / medlineheight; toph = topboxheight; @@ -165,9 +165,10 @@ void CEpgData::addTextToArray(const std::string & text, int flag) // UTF-8 void CEpgData::processTextToArray(std::string text, int flag) // UTF-8 { + Font* fnt_epg = g_Font[(flag == EPG_INFO1) ? SNeutrinoSettings::FONT_TYPE_EPG_INFO1 : SNeutrinoSettings::FONT_TYPE_EPG_INFO2]; std::string aktLine = ""; std::string aktWord = ""; - int aktWidth = 0; + int aktWidth = 0, aktWordWidth = 0; text += ' '; char* text_= (char*) text.c_str(); @@ -182,7 +183,7 @@ void CEpgData::processTextToArray(std::string text, int flag) // UTF-8 aktWord += *text_; // check the wordwidth - add to this line if size ok - int aktWordWidth = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO2]->getRenderWidth(aktWord, true); + aktWordWidth = fnt_epg->getRenderWidth(aktWord, true); if((aktWordWidth+aktWidth)<=(ox- 15- 15)) {//space ok, add aktWidth += aktWordWidth; @@ -221,7 +222,7 @@ void CEpgData::processTextToArray(std::string text, int flag) // UTF-8 void CEpgData::showText( int startPos, int ypos ) { // recalculate - medlineheight = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->getHeight(); + medlineheight = std::max(g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->getHeight(), g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO2]->getHeight()); medlinecount = sb / medlineheight; int textSize = epgText.size(); @@ -254,7 +255,7 @@ void CEpgData::showText( int startPos, int ypos ) offset += digi; break; } - g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO2]->RenderString(sx+10+offset, y+medlineheight, ox- 15- 15, + g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO2]->RenderString(sx+10+offset, y+medlineheight, ox- 15- 15- offset, epgText[i].first.substr(pos1, pos2 - pos1), (epgText[i].second == SCREENING_BEFORE) ? COL_MENUCONTENTINACTIVE : COL_MENUCONTENT, 0, true); // UTF-8 commit 04a3f6b028fa3e95cb8ec2691cc5c8be58249b71 Author: GetAway <get-a...@t-online.de> Date: Tue Apr 1 17:55:46 2014 +0200 msgbox: Fix backgound, if using an absolute tab at beginning of the text. dont overwrite subsequent chars when using absolute tabs, push them! Use symbolic constant for FONT Fix warning: suggest parentheses around && within || bump version to 1.71 Signed-off-by: Thilo Graf <d...@novatux.de> diff --git a/tuxbox/tools/msgbox/gfx.c b/tuxbox/tools/msgbox/gfx.c index 8f5cd74..2621eea 100644 --- a/tuxbox/tools/msgbox/gfx.c +++ b/tuxbox/tools/msgbox/gfx.c @@ -34,7 +34,7 @@ void RenderBox(int sx, int sy, int ex, int ey, int rad, int col) if (dxx<0) { - printf("[shellexec] RenderBox called with dx < 0 (%d)\n", dxx); + printf("[msgbox] RenderBox called with dx < 0 (%d)\n", dxx); dxx=0; } diff --git a/tuxbox/tools/msgbox/io.c b/tuxbox/tools/msgbox/io.c index 1b03b49..7e8e2c3 100644 --- a/tuxbox/tools/msgbox/io.c +++ b/tuxbox/tools/msgbox/io.c @@ -26,7 +26,7 @@ int rc_last_key=-1; int lastval=-1; int RCTranslate(int code); -extern int rc; +extern unsigned int rc; time_t t1,t2; clock_t tk1=0, tk2; diff --git a/tuxbox/tools/msgbox/msgbox.c b/tuxbox/tools/msgbox/msgbox.c index 3f1b1a6..3e83886 100644 --- a/tuxbox/tools/msgbox/msgbox.c +++ b/tuxbox/tools/msgbox/msgbox.c @@ -33,7 +33,9 @@ #include <dbox/fb.h> #endif -#define M_VERSION 1.70 +#define M_VERSION 1.71 + +#define FONT "/share/fonts/pakenham.ttf" #define NCF_FILE "/var/tuxbox/config/neutrino.conf" #define ECF_FILE "/var/tuxbox/config/enigma/config" @@ -57,14 +59,14 @@ int rbutt[16],hide=0,radius=0; //static void ShowInfo(void); // Misc -char NOMEM[]="msgbox <Out of memory>\n"; +const char NOMEM[]="msgbox <Out of memory>\n"; char TMP_FILE[64]="/tmp/msgbox.tmp"; -unsigned char FONT[64]= "/share/fonts/pakenham.ttf"; unsigned char *lfb = 0, *lbb = 0, *obb = 0, *hbb = 0, *ibb = 0; unsigned char nstr[BUFSIZE]=""; unsigned char *trstr; -unsigned rc,sc[8]={'a','o','u','A','O','U','z','d'}, tc[8]={0xE4,0xF6,0xFC,0xC4,0xD6,0xDC,0xDF,0xB0}; -char INST_FILE[]="/tmp/rc.locked"; +unsigned char sc[8]={'a','o','u','A','O','U','z','d'}, tc[8]={0xE4,0xF6,0xFC,0xC4,0xD6,0xDC,0xDF,0xB0}; +unsigned int rc; +const char INST_FILE[]="/tmp/rc.locked"; int instance=0; int get_instance(void) @@ -111,7 +113,7 @@ FILE *nfh; char tstr [512], *cfptr=NULL; int rv=-1,styp=0; - if((((nfh=fopen(NCF_FILE,"r"))!=NULL)&&(styp=1))||(((nfh=fopen(ECF_FILE,"r"))!=NULL))&&(styp=2)) + if ( ( ((nfh=fopen(NCF_FILE,"r"))!=NULL) && (styp=1) ) || ( ((nfh=fopen(ECF_FILE,"r"))!=NULL) && (styp=2) ) ) { tstr[0]=0; diff --git a/tuxbox/tools/msgbox/msgbox.h b/tuxbox/tools/msgbox/msgbox.h index 62279e4..8708716 100644 --- a/tuxbox/tools/msgbox/msgbox.h +++ b/tuxbox/tools/msgbox/msgbox.h @@ -50,7 +50,6 @@ #define MAX_BUTTONS 16 #define BUFSIZE 4095 -extern unsigned char FONT[64]; enum {LEFT, CENTER, RIGHT}; enum {SMALL, MED, BIG}; @@ -187,7 +186,7 @@ struct fb_fix_screeninfo fix_screeninfo; struct fb_var_screeninfo var_screeninfo; int startx, starty, sx, ex, sy, ey, debounce, rblock; -extern unsigned sc[8], tc[8]; +extern unsigned char sc[8], tc[8]; extern char *butmsg[MAX_BUTTONS]; extern int buttons,selection; extern int instance; diff --git a/tuxbox/tools/msgbox/text.c b/tuxbox/tools/msgbox/text.c index cafb792..0848214 100644 --- a/tuxbox/tools/msgbox/text.c +++ b/tuxbox/tools/msgbox/text.c @@ -125,10 +125,11 @@ int RenderChar(FT_ULong currentchar, int sx, int sy, int ex, int color) * GetStringLen ******************************************************************************/ -int GetStringLen(int sx, unsigned char *string) +int GetStringLen(int sx, char *string) { int i, found; -int stringlen = 0; +int stringlen = 0, min_length = 0; +int count = 1, count_tilde = 0; //reset kerning @@ -145,6 +146,7 @@ int stringlen = 0; else { string++; + count_tilde++; if(*string=='t') { stringlen=desc.width+TABULATOR*((int)(stringlen/TABULATOR)+1); @@ -157,6 +159,9 @@ int stringlen = 0; { string+=3; stringlen=i-sx; + if (count_tilde == 1 && count == 1) { + min_length = ex-startx-2*i-10; + } } } else @@ -174,9 +179,9 @@ int stringlen = 0; } } string++; + count++; } - - return stringlen; + return ((stringlen > min_length) ? stringlen : min_length); } /****************************************************************************** @@ -261,7 +266,7 @@ int RenderString(char *string, int sx, int sy, int maxwidth, int layout, int siz if(sscanf(rptr+1,"%3d",&i)==1) { rptr+=3; - sx=i; + sx=(i<sx) ? sx : i; } break; } diff --git a/tuxbox/tools/msgbox/text.h b/tuxbox/tools/msgbox/text.h index 2d796be..4d23f63 100644 --- a/tuxbox/tools/msgbox/text.h +++ b/tuxbox/tools/msgbox/text.h @@ -31,7 +31,7 @@ extern int FSIZE_SMALL; FT_Error MyFaceRequester(FTC_FaceID face_id, FT_Library library, FT_Pointer request_data, FT_Face *aface); int RenderString(char *string, int sx, int sy, int maxwidth, int layout, int size, int color); -int GetStringLen(int sx, unsigned char *string); +int GetStringLen(int sx, char *string); void CatchTabs(char *text); #endif diff --git a/tuxbox/tools/msgbox/txtform.c b/tuxbox/tools/msgbox/txtform.c index 7c298b2..3a9a4e7 100644 --- a/tuxbox/tools/msgbox/txtform.c +++ b/tuxbox/tools/msgbox/txtform.c @@ -71,7 +71,7 @@ int just, color=CMCT; case 'l': just=LEFT; break; case 'r': just=RIGHT; break; case 'c': just=CENTER; break; - case 's': + case 's': // vert. line RenderBox(xs, ys-cs/3, xs+xw, ys-cs/3+1, FILL, COL_MENUCONTENT_PLUS_3); RenderBox(xs, ys-cs/3+1, xs+xw, ys-cs/3+2, FILL, COL_MENUCONTENT_PLUS_1); break; @@ -98,7 +98,7 @@ int just, color=CMCT; { if(strlen(rstr)) { - slen=GetStringLen(xs,rstr); + slen=GetStringLen(xs,rstr)-10; if(slen>*x) { *x=slen; commit 5af5cfb9585c9d43c512b33bd9e8d4ee871e32d8 Author: Christian Schuett <gaucho...@hotmail.com> Date: Sun Mar 30 21:12:31 2014 +0200 Neutrino EPG viewer: use enums for the different EPG items Signed-off-by: Christian Schuett <gaucho...@hotmail.com> Signed-off-by: Thilo Graf <d...@novatux.de> diff --git a/tuxbox/neutrino/src/gui/epgview.cpp b/tuxbox/neutrino/src/gui/epgview.cpp index ee3ddb7..2a3bdbf 100644 --- a/tuxbox/neutrino/src/gui/epgview.cpp +++ b/tuxbox/neutrino/src/gui/epgview.cpp @@ -145,7 +145,7 @@ void CEpgData::start() toph = topboxheight; } -void CEpgData::addTextToArray(const std::string & text, int screening) // UTF-8 +void CEpgData::addTextToArray(const std::string & text, int flag) // UTF-8 { //printf("line: >%s<\n", text.c_str() ); if (text==" ") @@ -153,17 +153,17 @@ void CEpgData::addTextToArray(const std::string & text, int screening) // UTF-8 emptyLineCount ++; if(emptyLineCount<2) { - epgText.push_back(epg_pair(text, screening)); + epgText.push_back(epg_pair(text, flag)); } } else { emptyLineCount = 0; - epgText.push_back(epg_pair(text, screening)); + epgText.push_back(epg_pair(text, flag)); } } -void CEpgData::processTextToArray(std::string text, int screening) // UTF-8 +void CEpgData::processTextToArray(std::string text, int flag) // UTF-8 { std::string aktLine = ""; std::string aktWord = ""; @@ -190,7 +190,7 @@ void CEpgData::processTextToArray(std::string text, int screening) // UTF-8 if(*text_=='\n') { //enter-handler - addTextToArray( aktLine, screening); + addTextToArray( aktLine, flag); aktLine = ""; aktWidth= 0; } @@ -198,7 +198,7 @@ void CEpgData::processTextToArray(std::string text, int screening) // UTF-8 } else {//new line needed - addTextToArray( aktLine, screening); + addTextToArray( aktLine, flag); aktLine = aktWord; aktWidth = aktWordWidth; aktWord = ""; @@ -215,7 +215,7 @@ void CEpgData::processTextToArray(std::string text, int screening) // UTF-8 text_++; } //add the rest - addTextToArray( aktLine + aktWord, screening ); + addTextToArray( aktLine + aktWord, flag ); } void CEpgData::showText( int startPos, int ypos ) @@ -239,7 +239,7 @@ void CEpgData::showText( int startPos, int ypos ) frameBuffer->paintBoxRel(sx, y, ox- 15, sb, COL_MENUCONTENT_PLUS_0); // background of the text box for(int i = startPos; i < textSize && i < startPos + medlinecount; i++, y += medlineheight) { - if(epgText[i].second){ + if(epgText[i].second == SCREENING_AFTER || epgText[i].second == SCREENING_BEFORE){ std::string::size_type pos1 = epgText[i].first.find_first_not_of(tok, 0); std::string::size_type pos2 = epgText[i].first.find_first_of(tok, pos1); while( pos2 != string::npos || pos1 != string::npos ){ @@ -254,7 +254,10 @@ void CEpgData::showText( int startPos, int ypos ) offset += digi; break; } - g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO2]->RenderString(sx+10+offset, y+medlineheight, ox- 15- 15, epgText[i].first.substr(pos1, pos2 - pos1), (epgText[i].second==2)? COL_MENUCONTENTINACTIVE: COL_MENUCONTENT, 0, true); // UTF-8 + g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO2]->RenderString(sx+10+offset, y+medlineheight, ox- 15- 15, + epgText[i].first.substr(pos1, pos2 - pos1), + (epgText[i].second == SCREENING_BEFORE) ? COL_MENUCONTENTINACTIVE : COL_MENUCONTENT, + 0, true); // UTF-8 count++; pos1 = epgText[i].first.find_first_not_of(tok, pos2); pos2 = epgText[i].first.find_first_of(tok, pos1); @@ -263,7 +266,8 @@ void CEpgData::showText( int startPos, int ypos ) count = 0; } else{ - g_Font[( i< info1_lines ) ?SNeutrinoSettings::FONT_TYPE_EPG_INFO1:SNeutrinoSettings::FONT_TYPE_EPG_INFO2]->RenderString(sx+10, y+medlineheight, ox- 15- 15, epgText[i].first, COL_MENUCONTENT, 0, true); // UTF-8 + int font_type = (epgText[i].second == EPG_INFO1) ? SNeutrinoSettings::FONT_TYPE_EPG_INFO1 : SNeutrinoSettings::FONT_TYPE_EPG_INFO2; + g_Font[font_type]->RenderString(sx+10, y+medlineheight, ox- 15- 15, epgText[i].first, COL_MENUCONTENT, 0, true); // UTF-8 } } @@ -529,14 +533,12 @@ int CEpgData::show(const t_channel_id channel_id, unsigned long long a_id, time_ } } if (false == bHide) { - processTextToArray(Latin1_to_UTF8(epgData.info1)); + processTextToArray(Latin1_to_UTF8(epgData.info1), EPG_INFO1); } } - info1_lines = epgText.size(); - //scan epg-data - sort to list - if ((epgData.info2.empty()) && (info1_lines == 0)) + if (epgData.info2.empty() && epgText.empty()) processTextToArray(g_Locale->getText(LOCALE_EPGVIEWER_NODETAILED)); // UTF-8 else processTextToArray(Latin1_to_UTF8(strEpisode + epgData.info2)); @@ -970,7 +972,7 @@ void CEpgData::FollowScreenings(const time_t startzeit) CChannelEventList::iterator e; struct tm *tmStartZeit; std::string screening_dates, screening_nodual; - int flag = 1; + int flag = SCREENING_AFTER; char tmpstr[256] = {0}; screening_dates = screening_nodual = ""; @@ -990,7 +992,7 @@ void CEpgData::FollowScreenings(const time_t startzeit) strftime(tmpstr, sizeof(tmpstr), ". %H:%M ", tmStartZeit ); screening_dates += tmpstr; - flag = (e->startTime <= startzeit) ? 2 : 1; + flag = (e->startTime <= startzeit) ? SCREENING_BEFORE : SCREENING_AFTER; if (screening_dates != screening_nodual){ screening_nodual=screening_dates; diff --git a/tuxbox/neutrino/src/gui/epgview.h b/tuxbox/neutrino/src/gui/epgview.h index 43356f2..dc23a5a 100644 --- a/tuxbox/neutrino/src/gui/epgview.h +++ b/tuxbox/neutrino/src/gui/epgview.h @@ -52,6 +52,14 @@ class CEpgData { private: + enum + { + EPG_INFO2, + SCREENING_AFTER, + SCREENING_BEFORE, + EPG_INFO1 + }; + CFrameBuffer *frameBuffer; CChannelEventList evtlist; CChannelEventList followlist; @@ -69,7 +77,7 @@ class CEpgData time_t next_zeit; int ox, oy, sx, sy, toph, sb; - int emptyLineCount, info1_lines; + int emptyLineCount; int textCount; typedef std::pair<std::string,int> epg_pair; std::vector<epg_pair> epgText; @@ -81,8 +89,8 @@ class CEpgData void GetEPGData(const t_channel_id channel_id, unsigned long long id, time_t* startzeit ); void GetPrevNextEPGData( unsigned long long id, time_t* startzeit ); - void addTextToArray( const std::string & text, int screening ); - void processTextToArray(std::string text, int screening = 0); + void addTextToArray( const std::string & text, int flag ); + void processTextToArray(std::string text, int flag = EPG_INFO2); void showText( int startPos, int ypos ); bool hasFollowScreenings(const t_channel_id channel_id, const std::string & title, const time_t startzeit); void FollowScreenings(const time_t startzeit); commit 8f7c5428de4744aff65ea71a9b9d8f0e09dba82b Author: Christian Schuett <gaucho...@hotmail.com> Date: Sun Mar 30 19:28:44 2014 +0200 Neutrino: rename an enum to clarify its purpose Signed-off-by: Christian Schuett <gaucho...@hotmail.com> Signed-off-by: Thilo Graf <d...@novatux.de> diff --git a/tuxbox/neutrino/src/driver/lcdd.cpp b/tuxbox/neutrino/src/driver/lcdd.cpp index 42ac881..1a18f61 100644 --- a/tuxbox/neutrino/src/driver/lcdd.cpp +++ b/tuxbox/neutrino/src/driver/lcdd.cpp @@ -570,7 +570,7 @@ void CLCD::setEPGTitle(const std::string title) showServicename("", false); } -void CLCD::setMoviePlaymode(const AUDIOMODES playmode) +void CLCD::setMoviePlaymode(const PLAYMODES playmode) { movie_playmode = playmode; @@ -809,12 +809,12 @@ void CLCD::showAudioTrack(const std::string & artist, const std::string & title, } -void CLCD::showAudioPlayMode(AUDIOMODES m) +void CLCD::showAudioPlayMode(const PLAYMODES m) { display.draw_fill_rect (-1,51,10,62, CLCDDisplay::PIXEL_OFF); switch(m) { - case AUDIO_MODE_PLAY: + case PLAYMODE_PLAY: { int x=3,y=53; display.draw_line(x ,y ,x ,y+8, CLCDDisplay::PIXEL_ON); @@ -824,16 +824,16 @@ void CLCD::showAudioPlayMode(AUDIOMODES m) display.draw_line(x+4,y+4,x+4,y+4, CLCDDisplay::PIXEL_ON); break; } - case AUDIO_MODE_STOP: + case PLAYMODE_STOP: display.draw_fill_rect (1, 53, 8 ,61, CLCDDisplay::PIXEL_ON); break; - case AUDIO_MODE_PAUSE: + case PLAYMODE_PAUSE: display.draw_line(1,54,1,60, CLCDDisplay::PIXEL_ON); display.draw_line(2,54,2,60, CLCDDisplay::PIXEL_ON); display.draw_line(6,54,6,60, CLCDDisplay::PIXEL_ON); display.draw_line(7,54,7,60, CLCDDisplay::PIXEL_ON); break; - case AUDIO_MODE_FF: + case PLAYMODE_FF: { int x=2,y=55; display.draw_line(x ,y , x , y+4, CLCDDisplay::PIXEL_ON); @@ -844,7 +844,7 @@ void CLCD::showAudioPlayMode(AUDIOMODES m) display.draw_line(x+5 ,y+2 , x+5, y+2, CLCDDisplay::PIXEL_ON); } break; - case AUDIO_MODE_REV: + case PLAYMODE_REV: { int x=2,y=55; display.draw_line(x ,y+2 , x , y+2, CLCDDisplay::PIXEL_ON); @@ -930,7 +930,7 @@ void CLCD::setMode(const MODES m, const char * const title) display.load_screen(&(background[BACKGROUND_LCD])); display.draw_fill_rect(0, 14, LCD_COLS, 48, CLCDDisplay::PIXEL_OFF); - showAudioPlayMode(AUDIO_MODE_STOP); + showAudioPlayMode(PLAYMODE_STOP); showVolume(volume, false); showclock = true; showTime(); /* "showclock = true;" implies that "showTime();" does a "displayUpdate();" */ diff --git a/tuxbox/neutrino/src/driver/lcdd.h b/tuxbox/neutrino/src/driver/lcdd.h index 4228809..41f7f6d 100644 --- a/tuxbox/neutrino/src/driver/lcdd.h +++ b/tuxbox/neutrino/src/driver/lcdd.h @@ -71,13 +71,13 @@ class CLCD MODE_INFOBOX #endif // LCD_UPDATE }; - enum AUDIOMODES + enum PLAYMODES { - AUDIO_MODE_PLAY, - AUDIO_MODE_STOP, - AUDIO_MODE_FF, - AUDIO_MODE_PAUSE, - AUDIO_MODE_REV + PLAYMODE_PLAY, + PLAYMODE_STOP, + PLAYMODE_FF, + PLAYMODE_PAUSE, + PLAYMODE_REV }; enum STATUSLINE { @@ -119,7 +119,7 @@ class CLCD raw_display_t background[LCD_NUMBER_OF_BACKGROUNDS]; MODES mode; - AUDIOMODES movie_playmode; + PLAYMODES movie_playmode; std::string servicename; std::string epg_title; @@ -159,7 +159,7 @@ class CLCD void showServicename(const std::string name, const bool perform_wakeup = true); // UTF-8 void setEPGTitle(const std::string title); - void setMoviePlaymode(const AUDIOMODES playmode); + void setMoviePlaymode(const PLAYMODES playmode); void setMovieInfo(const std::string big, const std::string small); void setMovieAudio(const bool is_ac3); std::string getMenutitle() { return menutitle; }; @@ -170,7 +170,7 @@ class CLCD void showPercentOver(const unsigned char perc, const bool perform_update = true, const MODES m = MODE_TVRADIO); void showMenuText(const int position, const char * text, const int highlight = -1, const bool utf_encoded = false); void showAudioTrack(const std::string & artist, const std::string & title, const std::string & album); - void showAudioPlayMode(AUDIOMODES m=AUDIO_MODE_PLAY); + void showAudioPlayMode(const PLAYMODES m = PLAYMODE_PLAY); void showAudioProgress(const char perc, bool isMuted); void setBrightness(int); int getBrightness(); diff --git a/tuxbox/neutrino/src/gui/audioplayer.cpp b/tuxbox/neutrino/src/gui/audioplayer.cpp index 7c000b0..cfa3e86 100644 --- a/tuxbox/neutrino/src/gui/audioplayer.cpp +++ b/tuxbox/neutrino/src/gui/audioplayer.cpp @@ -2245,11 +2245,11 @@ void CAudioPlayerGui::paintLCD() switch(m_state) { case CAudioPlayerGui::STOP: - CLCD::getInstance()->showAudioPlayMode(CLCD::AUDIO_MODE_STOP); + CLCD::getInstance()->showAudioPlayMode(CLCD::PLAYMODE_STOP); CLCD::getInstance()->showAudioProgress(0, CNeutrinoApp::getInstance()->isMuted()); break; case CAudioPlayerGui::PLAY: - CLCD::getInstance()->showAudioPlayMode(CLCD::AUDIO_MODE_PLAY); + CLCD::getInstance()->showAudioPlayMode(CLCD::PLAYMODE_PLAY); CLCD::getInstance()->showAudioTrack(m_curr_audiofile.MetaData.artist, m_curr_audiofile.MetaData.title, m_curr_audiofile.MetaData.album); @@ -2262,17 +2262,17 @@ void CAudioPlayerGui::paintLCD() #endif /* INCLUDE_UNUSED_STUFF */ break; case CAudioPlayerGui::PAUSE: - CLCD::getInstance()->showAudioPlayMode(CLCD::AUDIO_MODE_PAUSE); + CLCD::getInstance()->showAudioPlayMode(CLCD::PLAYMODE_PAUSE); CLCD::getInstance()->showAudioTrack(m_curr_audiofile.MetaData.artist, m_curr_audiofile.MetaData.title, m_curr_audiofile.MetaData.album); break; case CAudioPlayerGui::FF: - CLCD::getInstance()->showAudioPlayMode(CLCD::AUDIO_MODE_FF); + CLCD::getInstance()->showAudioPlayMode(CLCD::PLAYMODE_FF); CLCD::getInstance()->showAudioTrack(m_curr_audiofile.MetaData.artist, m_curr_audiofile.MetaData.title, m_curr_audiofile.MetaData.album); break; case CAudioPlayerGui::REV: - CLCD::getInstance()->showAudioPlayMode(CLCD::AUDIO_MODE_REV); + CLCD::getInstance()->showAudioPlayMode(CLCD::PLAYMODE_REV); CLCD::getInstance()->showAudioTrack(m_curr_audiofile.MetaData.artist, m_curr_audiofile.MetaData.title, m_curr_audiofile.MetaData.album); break; diff --git a/tuxbox/neutrino/src/gui/movieplayer.cpp b/tuxbox/neutrino/src/gui/movieplayer.cpp index c5a30de..308fe54 100644 --- a/tuxbox/neutrino/src/gui/movieplayer.cpp +++ b/tuxbox/neutrino/src/gui/movieplayer.cpp @@ -1166,7 +1166,7 @@ PlayStreamThread (void *mrl) // pause VLC httpres = sendGetRequest(pauseurl, response); - CLCD::getInstance()->setMoviePlaymode(CLCD::AUDIO_MODE_PAUSE); + CLCD::getInstance()->setMoviePlaymode(CLCD::PLAYMODE_PAUSE); while(g_playstate == CMoviePlayerGui::PAUSE) { @@ -1177,7 +1177,7 @@ PlayStreamThread (void *mrl) // unpause VLC httpres = sendGetRequest(unpauseurl, response); - CLCD::getInstance()->setMoviePlaymode(CLCD::AUDIO_MODE_PLAY); + CLCD::getInstance()->setMoviePlaymode(CLCD::PLAYMODE_PLAY); break; case CMoviePlayerGui::SKIP: { @@ -1348,26 +1348,26 @@ void updateLcd(const std::string & big, const std::string & small) { static int l_playstate = -1; std::string lcd_small = small; - CLCD::AUDIOMODES playmode; + CLCD::PLAYMODES playmode; if(l_playstate == g_playstate) return; switch(g_playstate) { case CMoviePlayerGui::PAUSE: - playmode = CLCD::AUDIO_MODE_PAUSE; + playmode = CLCD::PLAYMODE_PAUSE; break; case CMoviePlayerGui::REW: - playmode = CLCD::AUDIO_MODE_REV; + playmode = CLCD::PLAYMODE_REV; break; case CMoviePlayerGui::FF: - playmode = CLCD::AUDIO_MODE_FF; + playmode = CLCD::PLAYMODE_FF; break; default: - playmode = CLCD::AUDIO_MODE_PLAY; + playmode = CLCD::PLAYMODE_PLAY; break; } StrSearchReplace(lcd_small, "_", " "); @@ -2299,7 +2299,7 @@ static void mp_checkEvent(MP_CTX *ctx) //-- Freeze AV -- mp_freezeAV(ctx); - CLCD::getInstance()->setMoviePlaymode(CLCD::AUDIO_MODE_PAUSE); + CLCD::getInstance()->setMoviePlaymode(CLCD::PLAYMODE_PAUSE); fprintf(stderr, "[mp] pause\n"); while(g_playstate == CMoviePlayerGui::PAUSE) usleep(10000); @@ -2310,7 +2310,7 @@ static void mp_checkEvent(MP_CTX *ctx) //-- but demuxer will be started later. -- //-- (refilling of input buffer not needed) -- mp_unfreezeAV(ctx); - CLCD::getInstance()->setMoviePlaymode(CLCD::AUDIO_MODE_PLAY); + CLCD::getInstance()->setMoviePlaymode(CLCD::PLAYMODE_PLAY); break; //-- next item of program/play-list -- diff --git a/tuxbox/neutrino/src/gui/movieplayer2.cpp b/tuxbox/neutrino/src/gui/movieplayer2.cpp index b723969..100c0e7 100644 --- a/tuxbox/neutrino/src/gui/movieplayer2.cpp +++ b/tuxbox/neutrino/src/gui/movieplayer2.cpp @@ -2212,7 +2212,7 @@ OutputThread(void *arg) switch (g_playstate) { case CMoviePlayerGui::PAUSE: - CLCD::getInstance()->setMoviePlaymode(CLCD::AUDIO_MODE_PAUSE); + CLCD::getInstance()->setMoviePlaymode(CLCD::PLAYMODE_PAUSE); #ifdef HAVE_TRIPLEDRAGON ioctl(adec, AUDIO_STOP); ioctl(dmxa, DMX_STOP); @@ -2253,7 +2253,7 @@ OutputThread(void *arg) perror("AUDIO_SET_MUTE"); #endif #endif - CLCD::getInstance()->setMoviePlaymode(CLCD::AUDIO_MODE_PLAY); + CLCD::getInstance()->setMoviePlaymode(CLCD::PLAYMODE_PLAY); break; case CMoviePlayerGui::SKIP: DBG("requesting buffer reset\n"); @@ -2479,7 +2479,7 @@ void updateLcd(const std::string &big, const std::string &small) { static int l_playstate = -1; std::string lcd_small = small; - CLCD::AUDIOMODES playmode; + CLCD::PLAYMODES playmode; if (l_playstate == g_playstate) return; @@ -2487,10 +2487,10 @@ void updateLcd(const std::string &big, const std::string &small) switch (g_playstate) { case CMoviePlayerGui::PAUSE: - playmode = CLCD::AUDIO_MODE_PAUSE; + playmode = CLCD::PLAYMODE_PAUSE; break; default: - playmode = CLCD::AUDIO_MODE_PLAY; + playmode = CLCD::PLAYMODE_PLAY; break; } StrSearchReplace(lcd_small, "_", " "); commit fff9161ff226b1718d19db4f7a61721ef4498a0c Author: GetAway <get-a...@t-online.de> Date: Fri Mar 28 12:43:31 2014 +0100 input: Fix invalid use of static array. The impact was only seen with newer gcc Use symbolic constant for FONT Fix warning: suggest parentheses around && within || bump version to 1.39 Signed-off-by: Thilo Graf <d...@novatux.de> diff --git a/tuxbox/tools/input/input.c b/tuxbox/tools/input/input.c index 3654f4a..2e227ce 100644 --- a/tuxbox/tools/input/input.c +++ b/tuxbox/tools/input/input.c @@ -36,7 +36,9 @@ #define NCF_FILE "/var/tuxbox/config/neutrino.conf" #define ECF_FILE "/var/tuxbox/config/engima/config" #define BUFSIZE 1024 -#define I_VERSION 1.38 +#define I_VERSION 1.39 + +#define FONT "/share/fonts/pakenham.ttf" void TrimString(char *strg); @@ -45,11 +47,10 @@ char *buffer=NULL; // Misc char NOMEM[]="input <Out of memory>\n"; char TMP_FILE[]="/tmp/input.tmp"; -unsigned char FONT[]= "/share/fonts/pakenham.ttf"; unsigned char *lfb = 0, *lbb = 0, *obb = 0; unsigned char nstr[512]=""; unsigned char *trstr; -static unsigned rc,sc[8]={'a','o','u','A','O','U','z','d'}, tc[8]={'ä','ö','ü','Ä','Ö','Ü','ß','°'}; +unsigned char rc,sc[8]={'a','o','u','A','O','U','z','d'}, tc[8]={'ä','ö','ü','Ä','Ö','Ü','ß','°'}; int radius; static void quit_signal(int sig) @@ -65,7 +66,7 @@ FILE *nfh; char tstr [512], *cfptr=NULL; int rv=-1,styp=0; - if((((nfh=fopen(NCF_FILE,"r"))!=NULL)&&(styp=1))||(((nfh=fopen(ECF_FILE,"r"))!=NULL))&&(styp=2)) + if( ( ((nfh=fopen(NCF_FILE,"r"))!=NULL) && (styp=1) ) || ( ((nfh=fopen(ECF_FILE,"r"))!=NULL) && (styp=2) ) ) { tstr[0]=0; @@ -426,7 +427,7 @@ unsigned int alpha; } use_kerning = FT_HAS_KERNING(face); - desc.face_id = (char*)FONT; + desc.face_id = FONT; desc.flags = FT_LOAD_MONOCHROME; //init backbuffer diff --git a/tuxbox/tools/input/input.h b/tuxbox/tools/input/input.h index 06f7b62..808d446 100644 --- a/tuxbox/tools/input/input.h +++ b/tuxbox/tools/input/input.h @@ -19,9 +19,9 @@ * */ -#ifndef __MSGBOX_H__ +#ifndef __INPUT_H__ -#define __MSGBOX_H__ +#define __INPUT_H__ #include <errno.h> #include <fcntl.h> @@ -43,7 +43,6 @@ #include "color.h" //freetype stuff -extern unsigned char FONT[64]; enum {LEFT, CENTER, RIGHT}; enum {SMALL, MED, BIG}; @@ -91,7 +90,7 @@ struct fb_fix_screeninfo fix_screeninfo; struct fb_var_screeninfo var_screeninfo; int startx, starty, sx, ex, sy, ey; -static unsigned sc[8], tc[8]; +extern unsigned char sc[8], tc[8]; extern char *butmsg[3]; extern int buttons,selection; diff --git a/tuxbox/tools/input/inputd.c b/tuxbox/tools/input/inputd.c index 3c26382..f1b2135 100644 --- a/tuxbox/tools/input/inputd.c +++ b/tuxbox/tools/input/inputd.c @@ -48,7 +48,7 @@ char rstr[512],tstr[512], *format, *estr; int epos=-1,cpos=0,kpos=0,cnt,first=1,hex=0; char kcod[10][13]={"0 _.:,;$@()#","1-+*/", "2abcä", "3def", "4ghi", "5jkl", "6mnoö", "7pqrs", "8tuvü", "9wxyz"}; char hcod[10][13]={"0","1", "2abc", "3def", "4", "5", "6", "7", "8", "9"}; -static unsigned rc,sc[8]={'a','o','u','A','O','U','z','d'}, tc[8]={'ä','ö','ü','Ä','Ö','Ü','ß','°'}; +extern unsigned rc; extern int radius; char INST_FILE[]="/tmp/rc.locked"; int instance=0; commit 875575a763345d965cb5b67a2147c2489222396c Author: Christian Schuett <gaucho...@hotmail.com> Date: Wed Mar 19 19:07:39 2014 +0100 Neutrino: use strncpy() when creating filename for recording Signed-off-by: Christian Schuett <gaucho...@hotmail.com> Signed-off-by: Thilo Graf <d...@novatux.de> diff --git a/tuxbox/neutrino/src/driver/vcrcontrol.cpp b/tuxbox/neutrino/src/driver/vcrcontrol.cpp index 797f728..c3a1a6b 100644 --- a/tuxbox/neutrino/src/driver/vcrcontrol.cpp +++ b/tuxbox/neutrino/src/driver/vcrcontrol.cpp @@ -917,12 +917,12 @@ void CVCRControl::CFileDevice::appendEPGInfo(char *buf, unsigned int size, const else epgInfo = ""; - if (!(epgInfo.empty()) && epgInfo.size() < size) + if (!epgInfo.empty()) { #warning fixme sectionsd should deliver data in UTF-8 format // strcpy(&(filename[pos]), Latin1_to_UTF8(epgdata.title).c_str()); // all characters with code >= 128 will be discarded anyway - strcpy(buf, epgInfo.c_str()); + strncpy(buf, epgInfo.c_str(), size); // buf already terminated correctly in CFileDevice::Record(...) char * p_act = buf; do { p_act += strspn(p_act, FILENAME_ALLOWED_CHARS); @@ -946,12 +946,12 @@ void CVCRControl::CFileDevice::appendEPGTitle(char *buf, unsigned int size, cons else epgTitle = epgTitleTimer; - if (!(epgTitle.empty()) && epgTitle.size() < size) + if (!epgTitle.empty()) { #warning fixme sectionsd should deliver data in UTF-8 format // strcpy(&(filename[pos]), Latin1_to_UTF8(epgdata.title).c_str()); // all characters with code >= 128 will be discarded anyway - strcpy(buf, epgTitle.c_str()); + strncpy(buf, epgTitle.c_str(), size); // buf already terminated correctly in CFileDevice::Record(...) char * p_act = buf; do { p_act += strspn(p_act, FILENAME_ALLOWED_CHARS); @@ -967,9 +967,9 @@ void CVCRControl::CFileDevice::appendChannelName(char *buf, unsigned int size, c if (size > 0) buf[0] = '\0'; std::string ext_channel_name = g_Zapit->getChannelName(channel_id); - if (ext_channel_name.size() < size) + if (!ext_channel_name.empty()) { - strcpy(buf, UTF8_TO_FILESYSTEM_ENCODING(ext_channel_name.c_str())); + strncpy(buf, UTF8_TO_FILESYSTEM_ENCODING(ext_channel_name.c_str()), size); // buf already terminated correctly in CFileDevice::Record(...) char * p_act = buf; do { commit e32ee733bd3d35460c7d8107e8ccd62bc19ab444 Author: Christian Schuett <gaucho...@hotmail.com> Date: Mon Mar 17 18:43:44 2014 +0100 Neutrino: use StrSearchReplace() when creating filename for recording Signed-off-by: Christian Schuett <gaucho...@hotmail.com> Signed-off-by: Thilo Graf <d...@novatux.de> diff --git a/tuxbox/neutrino/src/driver/vcrcontrol.cpp b/tuxbox/neutrino/src/driver/vcrcontrol.cpp index 398a2a3..797f728 100644 --- a/tuxbox/neutrino/src/driver/vcrcontrol.cpp +++ b/tuxbox/neutrino/src/driver/vcrcontrol.cpp @@ -42,6 +42,8 @@ #include <driver/encoding.h> #include <driver/stream2file.h> +#include <system/helper.h> + #include <gui/widget/messagebox.h> #ifdef ENABLE_LIRC @@ -842,57 +844,25 @@ bool CVCRControl::CFileDevice::Record(const t_channel_id channel_id, int mode, c { expandedTemplate = std::string(basename(FilenameTemplate.c_str())); } - std::string::size_type searchPos = std::string::npos; - std::string::size_type startAt = 0; - size_t dataLength = 0; char buf[256]; buf[255] = '\0'; appendChannelName(buf,255,channel_id); - dataLength = strlen(buf); - while ((searchPos = expandedTemplate.find("%C",startAt)) != std::string::npos) { - expandedTemplate.erase(searchPos,2); - expandedTemplate.insert(searchPos,buf); - startAt = searchPos + dataLength; - } + StrSearchReplace(expandedTemplate, "%C", buf); - startAt = 0; appendEPGTitle(buf, 255, epgid, epgTitle); - dataLength = strlen(buf); - while ((searchPos = expandedTemplate.find("%T",startAt)) != std::string::npos) { - expandedTemplate.erase(searchPos,2); - expandedTemplate.insert(searchPos,buf); - startAt = searchPos + dataLength; - } + StrSearchReplace(expandedTemplate, "%T", buf); - startAt = 0; appendEPGInfo(buf, 255, epgid); - dataLength = strlen(buf); - while ((searchPos = expandedTemplate.find("%I",startAt)) != std::string::npos) { - expandedTemplate.erase(searchPos,2); - expandedTemplate.insert(searchPos,buf); - startAt = searchPos + dataLength; - } + StrSearchReplace(expandedTemplate, "%I", buf); strftime(buf,11,"%Y-%m-%d",localtime(&t)); - dataLength = strlen(buf); - startAt = 0; - while ((searchPos = expandedTemplate.find("%d",startAt)) != std::string::npos) { - expandedTemplate.erase(searchPos,2); - expandedTemplate.insert(searchPos,buf); - startAt = searchPos + dataLength; - } + StrSearchReplace(expandedTemplate, "%d", buf); strftime(buf,7,"%H%M%S",localtime(&t)); - dataLength = strlen(buf); - startAt = 0; - while ((searchPos = expandedTemplate.find("%t",startAt)) != std::string::npos) { - expandedTemplate.erase(searchPos,2); - expandedTemplate.insert(searchPos,buf); - startAt = searchPos + dataLength; - } + StrSearchReplace(expandedTemplate, "%t", buf); + //printf("[CFileDevice] filename: %s, expandedTemplate: %s\n",filename,expandedTemplate.c_str()); - strncpy(&(filename[pos]),expandedTemplate.c_str(),511-pos); stream2file_error_msg_t error_msg; diff --git a/tuxbox/neutrino/src/gui/infoviewer.cpp b/tuxbox/neutrino/src/gui/infoviewer.cpp index c698135..167431d 100644 --- a/tuxbox/neutrino/src/gui/infoviewer.cpp +++ b/tuxbox/neutrino/src/gui/infoviewer.cpp @@ -55,7 +55,6 @@ extern CRemoteControl * g_RemoteControl; /* neutrino.cpp */ #include <algorithm> #include <string> #include <system/settings.h> -#include <system/helper.h> #include <time.h> #include <sys/param.h> commit 88072454e59fe7db1b8e31f194fdb83dc00ad976 Author: Christian Schuett <gaucho...@hotmail.com> Date: Sat Mar 8 20:45:21 2014 +0100 nhttpd controlapi and yParser: remove unused variables Signed-off-by: Christian Schuett <gaucho...@hotmail.com> Signed-off-by: Thilo Graf <d...@novatux.de> diff --git a/tuxbox/neutrino/daemons/nhttpd/tuxboxapi/controlapi.cpp b/tuxbox/neutrino/daemons/nhttpd/tuxboxapi/controlapi.cpp index 088f2d1..cdaeadd 100644 --- a/tuxbox/neutrino/daemons/nhttpd/tuxboxapi/controlapi.cpp +++ b/tuxbox/neutrino/daemons/nhttpd/tuxboxapi/controlapi.cpp @@ -1019,7 +1019,7 @@ void CControlAPI::GetBouquetCGI(CyhookHandler *hh) //hh->printf("%u %s\n", (NeutrinoAPI->BouquetList[i].bouquet_nr) + 1, NeutrinoAPI->BouquetList[i].name); bouquet = NeutrinoAPI->GetBouquet((NeutrinoAPI->BouquetList[i].bouquet_nr) + 1, mode); CZapitClient::BouquetChannelList::iterator channel = bouquet->begin(); - for (unsigned int j = 0; channel != bouquet->end() && actual == 0; ++channel, j++) + for (; channel != bouquet->end() && actual == 0; ++channel) { if (channel->channel_id == current_channel_id) actual = i + 1; @@ -1037,7 +1037,7 @@ void CControlAPI::GetBouquetCGI(CyhookHandler *hh) t_channel_id current_channel_id = NeutrinoAPI->Zapit->getCurrentServiceID(); CZapitClient::BouquetChannelList::iterator channel = bouquet->begin(); - for (unsigned int i = 0; channel != bouquet->end(); ++channel, i++) + for (; channel != bouquet->end(); ++channel) { hh->WriteLn("<channel>"); hh->printf("\t<number>%u</number>\n\t<id>" @@ -1107,7 +1107,7 @@ void CControlAPI::GetBouquetCGI(CyhookHandler *hh) bouquet = NeutrinoAPI->GetBouquet(atoi(hh->ParamList["bouquet"].c_str()), mode); CZapitClient::BouquetChannelList::iterator channel = bouquet->begin(); - for (unsigned int i = 0; channel != bouquet->end(); ++channel, i++) + for (; channel != bouquet->end(); ++channel) hh->printf("%u " PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS " %s\n", @@ -1603,12 +1603,10 @@ void CControlAPI::LCDAction(CyhookHandler *hh) //------------------------------------------------------------------------- void CControlAPI::SendEventList(CyhookHandler *hh, t_channel_id channel_id) { - int pos; - NeutrinoAPI->eList = NeutrinoAPI->Sectionsd->getEventsServiceKey(channel_id); CChannelEventList::iterator eventIterator; - for (eventIterator = NeutrinoAPI->eList.begin(); eventIterator != NeutrinoAPI->eList.end(); ++eventIterator, pos++) + for (eventIterator = NeutrinoAPI->eList.begin(); eventIterator != NeutrinoAPI->eList.end(); ++eventIterator) hh->printf("%llu %ld %d %s\n", eventIterator->eventID, eventIterator->startTime, eventIterator->duration, eventIterator->description.c_str()); } diff --git a/tuxbox/neutrino/daemons/nhttpd/tuxboxapi/neutrinoyparser.cpp b/tuxbox/neutrino/daemons/nhttpd/tuxboxapi/neutrinoyparser.cpp index 363f1c9..38542af 100644 --- a/tuxbox/neutrino/daemons/nhttpd/tuxboxapi/neutrinoyparser.cpp +++ b/tuxbox/neutrino/daemons/nhttpd/tuxboxapi/neutrinoyparser.cpp @@ -197,7 +197,7 @@ std::string CNeutrinoYParser::func_mount_set_values(CyhookHandler *hh, std::str //------------------------------------------------------------------------- std::string CNeutrinoYParser::func_get_bouquets_as_dropdown(CyhookHandler */*hh*/, std::string para) { - std::string ynr, yresult, sel, nr_str, do_show_hidden; + std::string yresult, sel, nr_str, do_show_hidden; unsigned int nr=1; ySplitString(para," ",nr_str, do_show_hidden); @@ -247,7 +247,7 @@ std::string CNeutrinoYParser::func_get_actual_bouquet_number(CyhookHandler */*h { bouquet = NeutrinoAPI->GetBouquet((NeutrinoAPI->BouquetList[i].bouquet_nr) + 1, mode); CZapitClient::BouquetChannelList::iterator channel = bouquet->begin(); - for (unsigned int j = 0; channel != bouquet->end() && actual == 0; ++channel, j++) + for (; channel != bouquet->end() && actual == 0; ++channel) { if (channel->channel_id == current_channel_id) actual = i + 1; @@ -277,7 +277,7 @@ std::string CNeutrinoYParser::func_get_channels_as_dropdown(CyhookHandler */*hh CZapitClient::BouquetChannelList::iterator channel = bouquet->begin(); CEPGData epg; - for (unsigned int i = 0; channel != bouquet->end(); ++channel, i++) + for (; channel != bouquet->end(); ++channel) { sid = string_printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS,channel->channel_id); sel = (sid == achannel_id) ? "selected=\"selected\"" : ""; @@ -322,8 +322,7 @@ std::string CNeutrinoYParser::func_get_bouquets_with_epg(CyhookHandler *hh, std: CZapitClient::BouquetChannelList::iterator channel = channellist->begin(); for (; channel != channellist->end(); ++channel) { - CChannelEvent *event; - event = NeutrinoAPI->ChannelListEvents[channel->channel_id]; + CChannelEvent *event = NeutrinoAPI->ChannelListEvents[channel->channel_id]; classname = (i++ & 1) ? 'a' : 'b'; if (channel->channel_id == current_channel) @@ -602,7 +601,7 @@ std::string CNeutrinoYParser::func_get_audio_pids_as_dropdown(CyhookHandler */* //------------------------------------------------------------------------- std::string CNeutrinoYParser::func_unmount_get_list(CyhookHandler */*hh*/, std::string /*para*/) { - std::string ysel, ymount, ylocal_dir, yfstype, ynr, yresult, mounts; + std::string ysel, ymount, ylocal_dir, yfstype, yresult, mounts; std::ifstream in; in.open("/proc/mounts", std::ifstream::in); @@ -800,7 +799,6 @@ std::string CNeutrinoYParser::func_get_timer_list(CyhookHandler */*hh*/, std::s { sAddData += separator; sAddData += "AC3"; - separator = "/"; } sAddData += ')'; } diff --git a/tuxbox/neutrino/src/gui/timerlist.cpp b/tuxbox/neutrino/src/gui/timerlist.cpp index 88aed8e..2d40b99 100644 --- a/tuxbox/neutrino/src/gui/timerlist.cpp +++ b/tuxbox/neutrino/src/gui/timerlist.cpp @@ -645,7 +645,6 @@ void CTimerList::paintItem(int pos) { zAddData += sep; zAddData += "AC3"; - sep = "/"; } zAddData += ')'; } commit 9647ddb424b468fe0fefc7b44f2157869992991d Author: Christian Schuett <gaucho...@hotmail.com> Date: Sat Mar 8 20:43:21 2014 +0100 Neutrino CMenuWidget: remove an unnecessary if statement Signed-off-by: Christian Schuett <gaucho...@hotmail.com> Signed-off-by: Thilo Graf <d...@novatux.de> diff --git a/tuxbox/neutrino/src/gui/widget/menue.cpp b/tuxbox/neutrino/src/gui/widget/menue.cpp index 6b62684..f90d6ed 100644 --- a/tuxbox/neutrino/src/gui/widget/menue.cpp +++ b/tuxbox/neutrino/src/gui/widget/menue.cpp @@ -716,17 +716,16 @@ void CMenuWidget::addIntroItems(neutrino_locale_t subhead_text, neutrino_locale_ addItem(GenericMenuSeparator); - if (buttontype != BTN_TYPE_NO) + switch (buttontype) { - switch (buttontype) - { - case BTN_TYPE_BACK: - addItem(GenericMenuBack); - break; - case BTN_TYPE_CANCEL: - addItem(GenericMenuCancel); - break; - } + case BTN_TYPE_BACK: + addItem(GenericMenuBack); + break; + case BTN_TYPE_CANCEL: + addItem(GenericMenuCancel); + break; + default: + break; } if (section_text != NONEXISTANT_LOCALE) @@ -1194,14 +1193,9 @@ void CMenuForwarder::setText(const char * const Text) int CMenuForwarder::exec(CMenuTarget* parent) { - if(jumpTarget) - { + if (jumpTarget) return jumpTarget->exec(parent, actionKey); - } - else - { - return menu_return::RETURN_EXIT; - } + return menu_return::RETURN_EXIT; } const char * CMenuForwarder::getOption(void) @@ -1254,16 +1248,14 @@ int CMenuSeparator::getHeight(void) const { if (separator_text.empty() && text == NONEXISTANT_LOCALE) return 10; - else - return g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight(); + return g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight(); } const char * CMenuSeparator::getString(void) { if (!separator_text.empty()) return separator_text.c_str(); - else - return g_Locale->getText(text); + return g_Locale->getText(text); } void CMenuSeparator::setString(const std::string& s_text) ----------------------------------------------------------------------- Summary of changes: .../daemons/nhttpd/tuxboxapi/controlapi.cpp | 10 ++-- .../daemons/nhttpd/tuxboxapi/neutrinoyparser.cpp | 12 ++--- tuxbox/neutrino/src/driver/lcdd.cpp | 16 +++--- tuxbox/neutrino/src/driver/lcdd.h | 18 +++--- tuxbox/neutrino/src/driver/vcrcontrol.cpp | 58 +++++--------------- tuxbox/neutrino/src/gui/audioplayer.cpp | 10 ++-- tuxbox/neutrino/src/gui/channellist.cpp | 4 +- tuxbox/neutrino/src/gui/epgview.cpp | 43 ++++++++------- tuxbox/neutrino/src/gui/epgview.h | 14 ++++- tuxbox/neutrino/src/gui/infoviewer.cpp | 1 - tuxbox/neutrino/src/gui/movieplayer.cpp | 18 +++--- tuxbox/neutrino/src/gui/movieplayer2.cpp | 10 ++-- tuxbox/neutrino/src/gui/timerlist.cpp | 1 - tuxbox/neutrino/src/gui/widget/menue.cpp | 34 +++++------- tuxbox/tools/input/input.c | 11 ++-- tuxbox/tools/input/input.h | 7 +-- tuxbox/tools/input/inputd.c | 2 +- tuxbox/tools/msgbox/gfx.c | 2 +- tuxbox/tools/msgbox/io.c | 2 +- tuxbox/tools/msgbox/msgbox.c | 14 +++-- tuxbox/tools/msgbox/msgbox.h | 3 +- tuxbox/tools/msgbox/text.c | 15 ++++-- tuxbox/tools/msgbox/text.h | 2 +- tuxbox/tools/msgbox/txtform.c | 4 +- 24 files changed, 142 insertions(+), 169 deletions(-) -- Tuxbox-GIT: apps
------------------------------------------------------------------------------
_______________________________________________ Tuxbox-cvs-commits mailing list Tuxbox-cvs-commits@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tuxbox-cvs-commits