From 2a3f6ddb352317d0f23624ca24fb8240d1cb5026 Mon Sep 17 00:00:00 2001 From: Martin Hammerschmid Date: Wed, 21 Aug 2002 12:38:54 +0200 Subject: Version 0.0.2 --- lcd.c | 33 +++++++++++++++++++++++++-------- 1 file changed, 25 insertions(+), 8 deletions(-) (limited to 'lcd.c') diff --git a/lcd.c b/lcd.c index abd3e74..950f484 100644 --- a/lcd.c +++ b/lcd.c @@ -1,4 +1,5 @@ #include +#include #include #include #include @@ -70,6 +71,7 @@ bool cLcd::Connect( char *host, unsigned int port ) { , &wid, &hgt, &cellwid, &cellhgt) ) connected=true; if ((hgt < 4 ) || (wid < 16)) connected = false; // 4 lines are needed, may work with more than 4 though + if ( (hgt==2) && (wid>31) ) { connected = true; wid=wid/2; LineMode=0; } // 2x40 if (!connected) { cLcd::Close(); return connected; } sock_send_string(sock,"screen_add VDR\n"); sock_recv(sock, istring, 1024); @@ -230,10 +232,15 @@ if (!connected) return; cLcd::SetLine(Vol,2," "); cLcd::SetLine(Vol,3," "); } else { - cLcd::SetLine(Vol,0,tr("Volume ")); + if (hgt==2) { + cLcd::SetLine(Vol,0,"|---|---|---|---|---|---|---|---|---|---"); + cLcd::SetLine(Vol,3," "); + } else { + cLcd::SetLine(Vol,0,tr("Volume ")); + cLcd::SetLine(Vol,3,"|---|---|---|---|---|---|---|---|---|---"); + } cLcd::SetLine(Vol,1,"|---|---|---|---|---|---|---|---|---|---"); cLcd::SetLine(Vol,2," "); - cLcd::SetLine(Vol,3,"|---|---|---|---|---|---|---|---|---|---"); } } @@ -257,8 +264,8 @@ void cLcd::SetProgress(const char *begin, const char *end, int percent) { sprintf(workstring+wid-endw,"%s", end); cLcd::SetLine(LCDREPLAY,3,workstring); BeginMutualExclusion(); - ThreadStateData.barx=beginw+1; - ThreadStateData.bary=4; + ThreadStateData.barx=beginw+1+((hgt==2)?wid:0); + ThreadStateData.bary=((hgt==2)?1:4); ThreadStateData.barl=(percent*cellwid*(wid-beginw-endw))/100; EndMutualExclusion(); LastProgress = t; @@ -443,8 +450,13 @@ void cLcd::Write(int line, const char *string) { // used for any text output to char workstring[256]; unsigned int i,out; - - sprintf(workstring,"widget_set VDR line%d 1 %d \"",line,line); + if (hgt > 2) { + sprintf(workstring,"widget_set VDR line%d 1 %d \"",line,line); + } else if (LineMode==0) { + sprintf(workstring,"widget_set VDR line%d %d %d \"",line,(line==2||line==4)?wid+1:1,(line<3)?1:2 ); + } else { + sprintf(workstring,"widget_set VDR line%d %d %d \"",line,(line==3||line==4)?wid+1:1,(line==1||line==4)?1:2); + } out=strlen(workstring); for (i=0;(i