Thread: [Commits] : Tuxbox-GIT: apps branch master updated. CVS-Final-376-g7c16926
Tuxbox Sources
Brought to you by:
dbt1
|
From: Thilo G. <tux...@ne...> - 2014-04-06 16:38:32
|
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 <Gau...@ho...>
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 <Gau...@ho...>
Signed-off-by: Thilo Graf <db...@no...>
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...@t-...>
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 <db...@no...>
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 <Gau...@ho...>
Date: Sun Mar 30 21:12:31 2014 +0200
Neutrino EPG viewer: use enums for the different EPG items
Signed-off-by: Christian Schuett <Gau...@ho...>
Signed-off-by: Thilo Graf <db...@no...>
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 <Gau...@ho...>
Date: Sun Mar 30 19:28:44 2014 +0200
Neutrino: rename an enum to clarify its purpose
Signed-off-by: Christian Schuett <Gau...@ho...>
Signed-off-by: Thilo Graf <db...@no...>
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...@t-...>
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 <db...@no...>
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 ...
[truncated message content] |