Binary files VDR/.nfs018ad96d00000002 and VDR-LCD/.nfs018ad96d00000002 differ diff -ruN VDR/Makefile VDR-LCD/Makefile --- VDR/Makefile Wed Aug 15 15:56:11 2001 +++ VDR-LCD/Makefile Mon Aug 27 12:50:50 2001 @@ -28,7 +28,7 @@ OBJS = config.o dvbapi.o dvbosd.o dvd.o eit.o font.o i18n.o interface.o menu.o osd.o\ recording.o remote.o remux.o ringbuffer.o svdrp.o thread.o tools.o vdr.o\ - videodir.o + videodir.o sockets.o lcd.o OSDFONT = -adobe-helvetica-medium-r-normal--23-*-100-100-p-*-iso8859-1 FIXFONT = -adobe-courier-bold-r-normal--25-*-100-100-m-*-iso8859-1 @@ -48,6 +48,10 @@ DEFINES += -DVFAT endif +ifdef LCD +DEFINES += -DLCD +endif + all: vdr font: genfontfile fontfix.c fontosd.c @echo "font files created." @@ -66,8 +70,8 @@ eit.o : eit.c config.h dvbapi.h dvbosd.h dvd.h eit.h font.h $(DTVDIR)/libdtv.h thread.h tools.h videodir.h font.o : font.c font.h fontfix.c fontosd.c tools.h i18n.o : i18n.c config.h dvbapi.h dvbosd.h dvd.h eit.h font.h i18n.h thread.h tools.h -interface.o : interface.c config.h dvbapi.h dvbosd.h dvd.h eit.h font.h i18n.h interface.h remote.h svdrp.h thread.h tools.h -menu.o : menu.c config.h dvbapi.h dvbosd.h dvd.h eit.h font.h i18n.h interface.h menu.h osd.h recording.h remote.h svdrp.h thread.h tools.h +interface.o : interface.c config.h dvbapi.h dvbosd.h dvd.h eit.h font.h i18n.h interface.h remote.h svdrp.h thread.h tools.h lcd.h +menu.o : menu.c config.h dvbapi.h dvbosd.h dvd.h eit.h font.h i18n.h interface.h menu.h osd.h recording.h remote.h svdrp.h thread.h tools.h lcd.h osd.o : osd.c config.h dvbapi.h dvbosd.h dvd.h eit.h font.h i18n.h interface.h osd.h remote.h svdrp.h thread.h tools.h recording.o : recording.c config.h dvbapi.h dvbosd.h dvd.h eit.h font.h interface.h recording.h remote.h svdrp.h thread.h tools.h videodir.h remote.o : remote.c config.h dvbapi.h dvbosd.h dvd.h eit.h font.h remote.h thread.h tools.h @@ -76,7 +80,7 @@ svdrp.o : svdrp.c config.h dvbapi.h dvbosd.h dvd.h eit.h font.h interface.h remote.h svdrp.h thread.h tools.h thread.o : thread.c thread.h tools.h tools.o : tools.c tools.h -vdr.o : vdr.c config.h dvbapi.h dvbosd.h dvd.h eit.h font.h i18n.h interface.h menu.h osd.h recording.h remote.h svdrp.h thread.h tools.h videodir.h +vdr.o : vdr.c config.h dvbapi.h dvbosd.h dvd.h eit.h font.h i18n.h interface.h menu.h osd.h recording.h remote.h svdrp.h thread.h tools.h videodir.h lcd.h sockets.h videodir.o : videodir.c tools.h videodir.h # The main program: diff -ruN VDR/README.LCDproc VDR-LCD/README.LCDproc --- VDR/README.LCDproc Thu Jan 1 01:00:00 1970 +++ VDR-LCD/README.LCDproc Mon Aug 27 12:50:50 2001 @@ -0,0 +1,65 @@ +!!! To enalble LCD support use 'LCD=1 ... make' !!! + +Output to LCD modules that are supported by LCDproc: + +vdr -L HOST [-P PORT] ... makes vdr connect to a LCDd. + +Current channel info and menus are then +displayed on the LCD too. + +I had a 4x20 character display in mind but it may +work with 4x16 or above too. + +LCDd can be used in an xterm or console too, so it +might be useful even without having the hardware. +( ./LCDd -d curses ) + +lcdtranstbl.h is used to map characters for output to LCDd. +Depending on the LCD hardware some characters may not displayed +correctly, you can fix that by altering this table ... +use lcdtranstbl-nomap.h if you don't want anything mapped. + +LCDproc is available at http://lcdproc.omnipotent.net/ +or here http://sourceforge.net/projects/lcdproc/ + + What's needed to run a LCD? + + Hardware: + + I used a single 4x20 LCD that works with the hd44780 8-bit driver on + the printer port. + ( availible at http://www.conrad.com/ product ID: 187275 + or see http://www.lcd-module.de/eng/doma/standard.htm ) + + printer port LCD + ---------------------------------------------------------------------- + GND (1) (used the PC's power suppy (black cable)) + +5V (2) (used the PC's power suppy (red cable)) + Vadj (3) (contrast, conneced to GND works fine for me) + + D0 (2) D0 (7) + D1 (3) D1 (8) + D2 (4) D2 (9) + D3 (5) D3 (10) + D4 (6) D4 (11) + D5 (7) D5 (12) + D6 (8) D6 (13) + D7 (9) D7 (14) + nSTRB (1) EN (6) + INIT (16) RS (4) + RW (5) (connected to GND (1) of the LCD) + GND (18-25) + --- optional for LCDs with background illumination --- + + LED+ (15) (connected to +5V over a 100Ohm resisitor + to make it not too bright) + LED- (16) (connected to GND) + + Software: + + Last tested with lcdproc-0.4.1 ( http://prdownloads.sourceforge.net/lcdproc/lcdproc-0.4.1.tar.gz ) + LCDd -d HD44780 "-p 0x3bc -c winamp" + should run LCDd for the hardware described above conneceted to the + printer port (in my case the port's base address is 0x3bc). + +Martin diff -ruN VDR/dvbapi.c VDR-LCD/dvbapi.c --- VDR/dvbapi.c Sat Aug 25 15:52:38 2001 +++ VDR-LCD/dvbapi.c Mon Aug 27 12:50:50 2001 @@ -39,6 +39,9 @@ #include "ringbuffer.h" #include "tools.h" #include "videodir.h" +#ifdef LCD // LCDproc +#include "lcd.h" +#endif // LCD #define DEV_VIDEO "/dev/video" #define DEV_OST_OSD "/dev/ost/osd" @@ -80,6 +83,10 @@ #define FATALERRNO (errno != EAGAIN && errno != EINTR) +#ifdef LCD // LCDproc +extern cLcd *LCDproc; +#endif // LCD + typedef unsigned char uchar; const char *IndexToHMSF(int Index, bool WithFrame) @@ -524,7 +531,9 @@ void cRecordBuffer::Input(void) { dsyslog(LOG_INFO, "input thread started (pid=%d)", getpid()); - +#ifdef LCD // LCDproc + LCDproc->SetCardStat(dvbApi->CardIndex(),2); +#endif // LCD uchar b[MINVIDEODATA]; time_t t = time(NULL); recording = true; @@ -561,6 +570,9 @@ } dsyslog(LOG_INFO, "input thread ended (pid=%d)", getpid()); +#ifdef LCD // LCDproc + LCDproc->SetCardStat(dvbApi->CardIndex(),1); +#endif // LCD } void cRecordBuffer::Output(void) @@ -2473,9 +2485,12 @@ NumDvbApis = 0; for (int i = 0; i < MAXDVBAPI; i++) { if (useDvbApi == 0 || (useDvbApi & (1 << i)) != 0) { - if (Probe(OstName(DEV_OST_QPSKFE, i)) || Probe(OstName(DEV_OST_QAMFE, i))) - dvbApi[NumDvbApis++] = new cDvbApi(i); - else + if (Probe(OstName(DEV_OST_QPSKFE, i)) || Probe(OstName(DEV_OST_QAMFE, i))) { + dvbApi[NumDvbApis] = new cDvbApi(i); +#ifdef LCD // LCDproc + LCDproc->SetCardStat(NumDvbApis++,1); +#endif // LCD + } else break; } } diff -ruN VDR/i18n.c VDR-LCD/i18n.c --- VDR/i18n.c Sun Aug 26 15:45:10 2001 +++ VDR-LCD/i18n.c Mon Aug 27 12:50:50 2001 @@ -1211,6 +1211,78 @@ "Opération de montage lancée", "Redigeringsprosess startet", }, + { "Sun", + "Son", + "Ned", + "Dom", + "Zon", + "???", + "???", + "???", + }, + { "Mon", + "Mon", + "Pon", + "Lun", + "Maa", + "???", + "???", + "???", + }, + { "Tue", + "Die", + "Tor", + "Mar", + "Din", + "???", + "???", + "???", + }, + { "Wed", + "Mit", + "Sre", + "Mer", + "Woe", + "???", + "???", + "???", + }, + { "Thu", + "Don", + "Cet", + "Gio", + "Don", + "???", + "???", + "???", + }, + { "Fri", + "Fre", + "Pet", + "Ven", + "Vri", + "???", + "???", + "???", + }, + { "Sat", + "Sam", + "Sob", + "Sab", + "Zat", + "???", + "???", + "???", + }, + { "Up/Dn - OK to move", + "Auf/Ab - OK für Pos.", + "Gor/Dol - OK premik", + "???", + "???", + "???", + "???", + "???", + }, { NULL } }; diff -ruN VDR/interface.c VDR-LCD/interface.c --- VDR/interface.c Sat Aug 25 15:15:00 2001 +++ VDR-LCD/interface.c Mon Aug 27 12:50:50 2001 @@ -12,6 +12,11 @@ #include #include "i18n.h" +#ifdef LCD // LCDproc +#include "lcd.h" +extern cLcd *LCDproc; +#endif // LCD + cInterface *Interface = NULL; cInterface::cInterface(int SVDRPport) @@ -297,8 +302,14 @@ Open(Setup.OSDwidth, -1); isyslog(LOG_INFO, "info: %s", s); Status(s, clrBlack, clrGreen); +#ifdef LCD // LCDproc + LCDproc->SetWarning(s); +#endif // LCD Wait(); Status(NULL); +#ifdef LCD // LCDproc + LCDproc->SetWarning(NULL); +#endif // LCD Close(); } @@ -307,8 +318,14 @@ Open(Setup.OSDwidth, -1); esyslog(LOG_ERR, "ERROR: %s", s); Status(s, clrWhite, clrRed); +#ifdef LCD // LCDproc + LCDproc->SetStatus(s); +#endif // LCD Wait(); Status(NULL); +#ifdef LCD // LCDproc + LCDproc->SetStatus(NULL); +#endif // LCD Close(); } @@ -317,8 +334,14 @@ Open(); isyslog(LOG_INFO, "confirm: %s", s); Status(s, clrBlack, clrYellow); +#ifdef LCD // LCDproc + LCDproc->SetStatus(s); +#endif // LCD bool result = Wait(10) == kOk; Status(NULL); +#ifdef LCD // LCDproc + LCDproc->SetStatus(NULL); +#endif // LCD Close(); isyslog(LOG_INFO, "%sconfirmed", result ? "" : "not "); return result; diff -ruN VDR/lcd.c VDR-LCD/lcd.c --- VDR/lcd.c Thu Jan 1 01:00:00 1970 +++ VDR-LCD/lcd.c Mon Aug 27 13:00:02 2001 @@ -0,0 +1,522 @@ +#ifdef LCD // LCDproc +#include +#include +#include +#include +#include +#include "config.h" +#include "i18n.h" +#include "lcd.h" +#include "sockets.h" +#include "lcdtranstbl.h" // character mapping for output, see cLcd::Write + +#define LCDMENU 0 +#define LCDTITLE 1 +#define LCDREPLAY 2 +#define LCDMISC 3 + +// public: + +cLcd::cLcd() { + int i,j; + connected=false; sock=wid=hgt=cellwid=cellhgt=0; + + for (i=0;i (wid-1)) { + snprintf( title, wid+1,"%s",string); + } else { + memset(title,' ',wid/2+1); + snprintf(title + ( (wid-strlen(string))/2 ),wid-( (wid-strlen(string))/2 ),"%s",string); // center title + for (i=0;i (wid-empty-3)) { + longest1=( strlen(red) > strlen(green) ) ? red : green; + longest2=( strlen(yellow) > strlen(blue) ) ? yellow : blue; + longest =( strlen(longest1) > strlen(longest2) ) ? longest1: longest2; + longest[strlen(longest)-1]='\0'; allchars--; + } + + if (empty>0) { + spacewid=(wid-allchars-3)/empty; + if (spacewid<1) spacewid=1; + char spacer[spacewid+1]; memset(spacer,'-',spacewid); spacer[spacewid]='\0'; + if ( Red==NULL || Red[0]=='\0' ) strncpy(red,spacer,spacewid+1); + if ( Green==NULL || Green[0]=='\0' ) strncpy(green,spacer,spacewid+1); + if ( Yellow==NULL || Yellow[0]=='\0' ) strncpy(yellow,spacer,spacewid+1); + if ( Blue==NULL || Blue[0]=='\0' ) strncpy(blue,spacer,spacewid+1); + } + + #define MANYBLANKS "%s " + + snprintf(help,wid,MANYBLANKS,red); + snprintf(help+strlen(red)+1,wid,MANYBLANKS,green); + snprintf(help+wid-strlen(blue)-strlen(yellow)-1,wid,MANYBLANKS,yellow); + snprintf(help+wid-strlen(blue),strlen(blue)+1,"%s",blue); + for (i=0;i100) percent=100; if (percent<0) percent=0; + if (begin==NULL) { + BeginMutualExclusion(); + ThreadStateData.barx=1; ThreadStateData.bary=1; ThreadStateData.barl=0; + EndMutualExclusion(); + } else { + time_t t = time(NULL); + if (t != LastProgress) { // output only once a second + int beginw=strlen(begin); + int endw=strlen(end); + sprintf(workstring,"%s", begin); + memset(workstring+beginw,' ',wid-beginw-endw); + sprintf(workstring+wid-endw,"%s", end); + cLcd::SetLine(LCDREPLAY,3,workstring); + BeginMutualExclusion(); + ThreadStateData.barx=beginw+1; + ThreadStateData.bary=4; + ThreadStateData.barl=(percent*cellwid*(wid-beginw-endw))/100; + EndMutualExclusion(); + LastProgress = t; + } + } +} + +void cLcd::SetLine(unsigned int n, unsigned int l, const char *string) { + if (!connected) return; + + BeginMutualExclusion(); + if (string != NULL) strncpy(ThreadStateData.lcdbuffer[n][l],string,wid+1); + ThreadStateData.lcddirty[n][l]=true; + EndMutualExclusion(); +} + +void cLcd::SetLineC(unsigned int n, unsigned int l, const char *string) { + if (!connected) return; + + BeginMutualExclusion(); + if (string != NULL) cLcd::Copy(ThreadStateData.lcdbuffer[n][l],string,wid); + ThreadStateData.lcddirty[n][l]=true; + EndMutualExclusion(); +} + +void cLcd::SetBuffer(unsigned int n, const char *l1,const char *l2,const char *l3,const char *l4) { + if (!connected) return; + + BeginMutualExclusion(); + if (l1 != NULL) strncpy(ThreadStateData.lcdbuffer[n][0],l1,wid+1); ThreadStateData.lcddirty[n][0]=true; + if (l2 != NULL) strncpy(ThreadStateData.lcdbuffer[n][1],l2,wid+1); ThreadStateData.lcddirty[n][1]=true; + if (l3 != NULL) strncpy(ThreadStateData.lcdbuffer[n][2],l3,wid+1); ThreadStateData.lcddirty[n][2]=true; + if (l4 != NULL) strncpy(ThreadStateData.lcdbuffer[n][3],l4,wid+1); ThreadStateData.lcddirty[n][3]=true; + EndMutualExclusion(); +} + +void cLcd::SetRunning( bool nownext, const char *string1, const char *string2, const char *string3) { + if (!connected) return; + + char line[256]; + char line1[256]; + + snprintf(line,256,"%s %s%s%s", + (string1==NULL || string1[0]=='\0')?" ":string1, + (string2==NULL || string2[0]=='\0')?" ":string2, + (string3==NULL || string3[0]=='\0')?"":"|", + (string3==NULL || string3[0]=='\0')?" ":string3); + cLcd::Copy(line1,line,2*wid); + if (nownext) { + cLcd::Split(line1,ThreadStateData.lcdbuffer[LCDMISC][2],ThreadStateData.lcdbuffer[LCDMISC][3]); + ThreadStateData.lcddirty[LCDMISC][2]=true; ThreadStateData.lcddirty[LCDMISC][3]=true; + } else { + BeginMutualExclusion(); + cLcd::Split(line1,ThreadStateData.lcdbuffer[LCDTITLE][2],ThreadStateData.lcdbuffer[LCDTITLE][3]); + ThreadStateData.lcddirty[LCDTITLE][2]=true; ThreadStateData.lcddirty[LCDTITLE][3]=true; + EndMutualExclusion(); + cLcd::SetBuffer(LCDMISC,ThreadStateData.lcdbuffer[LCDTITLE][2],ThreadStateData.lcdbuffer[LCDTITLE][3],NULL,NULL); + } +} + +void cLcd::SummaryInit(char *string) { + SummaryText = string; + SummaryTextL = strlen(string); + SummaryCurrent=0; +} + +void cLcd::SummaryDown() { + if (!connected) return; + + SummaryCurrent=( (SummaryCurrent+4*wid) < SummaryTextL )?SummaryCurrent+4*wid:SummaryCurrent; +} + +void cLcd::SummaryUp() { + if (!connected) return; + + SummaryCurrent=( SummaryCurrent > 4*wid )?SummaryCurrent-4*wid:0; +} + +void cLcd::SummaryDisplay() { + if ( (!connected) || (SummaryTextL < 1) ) return; + + char workstring[256]; + unsigned int i, offset=0; + + for (i=0;i<4;i++) { + if (SummaryCurrent+offset < SummaryTextL) { + strncpy(workstring,SummaryText+SummaryCurrent+offset,wid+1); + workstring[wid]='\0'; + cLcd::SetLine(LCDMENU,i,workstring); + offset+=wid; + } else cLcd::SetLine(LCDMENU,i," "); + } +} + +void cLcd::SetCardStat(unsigned int card, unsigned int stat) { + if (!connected) return; + BeginMutualExclusion(); + ThreadStateData.CardStat[card]=stat; + EndMutualExclusion(); +} + +void cLcd::Clear( unsigned int n) { + if (!connected) return; + + cLcd::SetBuffer(n," "," "," "," "); +} + +void cLcd::SetThreadState( ThreadStates newstate ) { + if (!connected) return; + + BeginMutualExclusion(); + if (ThreadStateData.State != newstate) { + cLcd::LastState=ThreadStateData.State; + ThreadStateData.State=newstate; + ThreadStateData.barx=1, ThreadStateData.bary=1, ThreadStateData.barl=0; + } + EndMutualExclusion(); +} + +// private: + +// everything between BeginMutualExclusion(); and EndMutualExclusion(); +// should have exclusive access to ThreadStateData + +void cLcd::BeginMutualExclusion() { + pthread_mutex_lock(&CriticalArea); +} + +void cLcd::EndMutualExclusion() { + pthread_mutex_unlock(&CriticalArea); +} + +void cLcd::Copy(char *to, const char *from, unsigned int max) { // eliminates tabs, double blanks ... + + unsigned int i=0 , out=0; + + if (from != NULL) { + while ((out < max) && (from[i] != '\0') ) { + to[out]=(isspace(from[i]))?' ':from[i]; + if ( (out>0) && (to[out-1]==' ') && ispunct(to[out]) ) {to[out-1]=to[out]; to[out]=' '; } + if (!(( (out==0) && (to[out]==' ') ) || + ( (out>0) && (to[out-1]==' ') && (to[out]==' ') ) || + ( (out>0) && ispunct(to[out-1]) && (to[out]==' ') ) + )) out++; + i++; + } + if (out==0) to[out++]=' '; + to[out]='\0'; + } else { + to[0]=' '; to[1]='\0'; + } +} + +void cLcd::Split(const char *string, char *string1, char *string2) { + + strncpy(string1,string,wid+1); + if ( strlen(string) >wid ) { + strncpy(string2,string+wid,wid+1); + } else { + string2[0]=' '; string2[1]='\0'; + } +} + +void cLcd::Write(int line, const char *string) { // used for any text output to LCDd + + char workstring[256]; + unsigned int i,out; + + sprintf(workstring,"widget_set VDR line%d 1 %d \"",line,line); + out=strlen(workstring); + for (i=0;(i' ... replaying + bool ShowStates=false; + unsigned int offset; + + offset=(wid>36)?20:0; + for (i=0; i1); + + t = time(NULL); + now = localtime(&t); + + if ( offset || !( ShowStates && ((t%FullCycle) >= TimeCycle) )) { + if (wid > 19) + snprintf(string,wid+1,"<%s %02d.%02d %02d:%02d:%02d>", + tr(Days[now->tm_wday]), now->tm_mday, now->tm_mon+1, now->tm_hour, now->tm_min,now->tm_sec); + else + snprintf(string,wid+1,"<%02d.%02d %02d:%02d:%02d>", + now->tm_mday, now->tm_mon+1, now->tm_hour, now->tm_min,now->tm_sec); + } + + if ( offset || ( ShowStates && ((t%FullCycle) >= TimeCycle) )) { + for (i=0; i' ) */ (unsigned char) 62, +/* 63 ( '?' ) */ (unsigned char) 63, +/* 64 ( '@' ) */ (unsigned char) 64, +/* 65 ( 'A' ) */ (unsigned char) 65, +/* 66 ( 'B' ) */ (unsigned char) 66, +/* 67 ( 'C' ) */ (unsigned char) 67, +/* 68 ( 'D' ) */ (unsigned char) 68, +/* 69 ( 'E' ) */ (unsigned char) 69, +/* 70 ( 'F' ) */ (unsigned char) 70, +/* 71 ( 'G' ) */ (unsigned char) 71, +/* 72 ( 'H' ) */ (unsigned char) 72, +/* 73 ( 'I' ) */ (unsigned char) 73, +/* 74 ( 'J' ) */ (unsigned char) 74, +/* 75 ( 'K' ) */ (unsigned char) 75, +/* 76 ( 'L' ) */ (unsigned char) 76, +/* 77 ( 'M' ) */ (unsigned char) 77, +/* 78 ( 'N' ) */ (unsigned char) 78, +/* 79 ( 'O' ) */ (unsigned char) 79, +/* 80 ( 'P' ) */ (unsigned char) 80, +/* 81 ( 'Q' ) */ (unsigned char) 81, +/* 82 ( 'R' ) */ (unsigned char) 82, +/* 83 ( 'S' ) */ (unsigned char) 83, +/* 84 ( 'T' ) */ (unsigned char) 84, +/* 85 ( 'U' ) */ (unsigned char) 85, +/* 86 ( 'V' ) */ (unsigned char) 86, +/* 87 ( 'W' ) */ (unsigned char) 87, +/* 88 ( 'X' ) */ (unsigned char) 88, +/* 89 ( 'Y' ) */ (unsigned char) 89, +/* 90 ( 'Z' ) */ (unsigned char) 90, +/* 91 ( '[' ) */ (unsigned char) 91, +/* 92 ( '\' ) */ (unsigned char) 92, +/* 93 ( ']' ) */ (unsigned char) 93, +/* 94 ( '^' ) */ (unsigned char) 94, +/* 95 ( '_' ) */ (unsigned char) 95, +/* 96 ( '`' ) */ (unsigned char) 96, +/* 97 ( 'a' ) */ (unsigned char) 97, +/* 98 ( 'b' ) */ (unsigned char) 98, +/* 99 ( 'c' ) */ (unsigned char) 99, +/* 100 ( 'd' ) */ (unsigned char) 100, +/* 101 ( 'e' ) */ (unsigned char) 101, +/* 102 ( 'f' ) */ (unsigned char) 102, +/* 103 ( 'g' ) */ (unsigned char) 103, +/* 104 ( 'h' ) */ (unsigned char) 104, +/* 105 ( 'i' ) */ (unsigned char) 105, +/* 106 ( 'j' ) */ (unsigned char) 106, +/* 107 ( 'k' ) */ (unsigned char) 107, +/* 108 ( 'l' ) */ (unsigned char) 108, +/* 109 ( 'm' ) */ (unsigned char) 109, +/* 110 ( 'n' ) */ (unsigned char) 110, +/* 111 ( 'o' ) */ (unsigned char) 111, +/* 112 ( 'p' ) */ (unsigned char) 112, +/* 113 ( 'q' ) */ (unsigned char) 113, +/* 114 ( 'r' ) */ (unsigned char) 114, +/* 115 ( 's' ) */ (unsigned char) 115, +/* 116 ( 't' ) */ (unsigned char) 116, +/* 117 ( 'u' ) */ (unsigned char) 117, +/* 118 ( 'v' ) */ (unsigned char) 118, +/* 119 ( 'w' ) */ (unsigned char) 119, +/* 120 ( 'x' ) */ (unsigned char) 120, +/* 121 ( 'y' ) */ (unsigned char) 121, +/* 122 ( 'z' ) */ (unsigned char) 122, +/* 123 ( '{' ) */ (unsigned char) 123, +/* 124 ( '|' ) */ (unsigned char) 124, +/* 125 ( '}' ) */ (unsigned char) 125, +/* 126 ( '~' ) */ (unsigned char) 126, +/* 127 ( '^?') */ (unsigned char) 127, +/* 128 ( '~@') */ (unsigned char) 128, +/* 129 ( '~A') */ (unsigned char) 129, +/* 130 ( '~B') */ (unsigned char) 130, +/* 131 ( '~C') */ (unsigned char) 131, +/* 132 ( '~D') */ (unsigned char) 132, +/* 133 ( '~E') */ (unsigned char) 133, +/* 134 ( '~F') */ (unsigned char) 134, +/* 135 ( '~G') */ (unsigned char) 135, +/* 136 ( '~H') */ (unsigned char) 136, +/* 137 ( '~I') */ (unsigned char) 137, +/* 138 ( '~J') */ (unsigned char) 138, +/* 139 ( '~K') */ (unsigned char) 139, +/* 140 ( '~L') */ (unsigned char) 140, +/* 141 ( '~M') */ (unsigned char) 141, +/* 142 ( '~N') */ (unsigned char) 142, +/* 143 ( '~O') */ (unsigned char) 143, +/* 144 ( '~P') */ (unsigned char) 144, +/* 145 ( '~Q') */ (unsigned char) 145, +/* 146 ( '~R') */ (unsigned char) 146, +/* 147 ( '~S') */ (unsigned char) 147, +/* 148 ( '~T') */ (unsigned char) 148, +/* 149 ( '~U') */ (unsigned char) 149, +/* 150 ( '~V') */ (unsigned char) 150, +/* 151 ( '~W') */ (unsigned char) 151, +/* 152 ( '~X') */ (unsigned char) 152, +/* 153 ( '~Y') */ (unsigned char) 153, +/* 154 ( '~Z') */ (unsigned char) 154, +/* 155 ( '~[') */ (unsigned char) 155, +/* 156 ( '~\') */ (unsigned char) 156, +/* 157 ( '~]') */ (unsigned char) 157, +/* 158 ( '~^') */ (unsigned char) 158, +/* 159 ( '~_') */ (unsigned char) 159, +/* 160 ( '| ') */ (unsigned char) 160, +/* 161 ( '¡' ) */ (unsigned char) 161, +/* 162 ( '¢' ) */ (unsigned char) 162, +/* 163 ( '£' ) */ (unsigned char) 163, +/* 164 ( '¤' ) */ (unsigned char) 164, +/* 165 ( '¥' ) */ (unsigned char) 92, +/* 166 ( '¦' ) */ (unsigned char) 166, +/* 167 ( '§' ) */ (unsigned char) 167, +/* 168 ( '¨' ) */ (unsigned char) 168, +/* 169 ( '©' ) */ (unsigned char) 67, +/* 170 ( 'ª' ) */ (unsigned char) 170, +/* 171 ( '«' ) */ (unsigned char) 171, +/* 172 ( '¬' ) */ (unsigned char) 172, +/* 173 ( '­' ) */ (unsigned char) 173, +/* 174 ( '®' ) */ (unsigned char) 174, +/* 175 ( '¯' ) */ (unsigned char) 175, +/* 176 ( '°' ) */ (unsigned char) 223, +/* 177 ( '±' ) */ (unsigned char) 177, +/* 178 ( '²' ) */ (unsigned char) 50, +/* 179 ( '³' ) */ (unsigned char) 51, +/* 180 ( '´' ) */ (unsigned char) 180, +/* 181 ( 'µ' ) */ (unsigned char) 228, +/* 182 ( '¶' ) */ (unsigned char) 182, +/* 183 ( '·' ) */ (unsigned char) 183, +/* 184 ( '¸' ) */ (unsigned char) 184, +/* 185 ( '¹' ) */ (unsigned char) 185, +/* 186 ( 'º' ) */ (unsigned char) 223, +/* 187 ( '»' ) */ (unsigned char) 187, +/* 188 ( '¼' ) */ (unsigned char) 188, +/* 189 ( '½' ) */ (unsigned char) 189, +/* 190 ( '¾' ) */ (unsigned char) 190, +/* 191 ( '¿' ) */ (unsigned char) 191, +/* 192 ( 'À' ) */ (unsigned char) 65, +/* 193 ( 'Á' ) */ (unsigned char) 65, +/* 194 ( 'Â' ) */ (unsigned char) 65, +/* 195 ( 'Ã' ) */ (unsigned char) 65, +/* 196 ( 'Ä' ) */ (unsigned char) 225, +/* 197 ( 'Å' ) */ (unsigned char) 65, +/* 198 ( 'Æ' ) */ (unsigned char) 225, +/* 199 ( 'Ç' ) */ (unsigned char) 67, +/* 200 ( 'È' ) */ (unsigned char) 69, +/* 201 ( 'É' ) */ (unsigned char) 69, +/* 202 ( 'Ê' ) */ (unsigned char) 69, +/* 203 ( 'Ë' ) */ (unsigned char) 69, +/* 204 ( 'Ì' ) */ (unsigned char) 73, +/* 205 ( 'Í' ) */ (unsigned char) 73, +/* 206 ( 'Î' ) */ (unsigned char) 73, +/* 207 ( 'Ï' ) */ (unsigned char) 73, +/* 208 ( 'Ð' ) */ (unsigned char) 68, +/* 209 ( 'Ñ' ) */ (unsigned char) 78, +/* 210 ( 'Ò' ) */ (unsigned char) 79, +/* 211 ( 'Ó' ) */ (unsigned char) 79, +/* 212 ( 'Ô' ) */ (unsigned char) 79, +/* 213 ( 'Õ' ) */ (unsigned char) 79, +/* 214 ( 'Ö' ) */ (unsigned char) 239, +/* 215 ( '×' ) */ (unsigned char) 88, +/* 216 ( 'Ø' ) */ (unsigned char) 48, +/* 217 ( 'Ù' ) */ (unsigned char) 85, +/* 218 ( 'Ú' ) */ (unsigned char) 85, +/* 219 ( 'Û' ) */ (unsigned char) 85, +/* 220 ( 'Ü' ) */ (unsigned char) 245, +/* 221 ( 'Ý' ) */ (unsigned char) 89, +/* 222 ( 'Þ' ) */ (unsigned char) 222, +/* 223 ( 'ß' ) */ (unsigned char) 226, +/* 224 ( 'à' ) */ (unsigned char) 97, +/* 225 ( 'á' ) */ (unsigned char) 97, +/* 226 ( 'â' ) */ (unsigned char) 97, +/* 227 ( 'ã' ) */ (unsigned char) 97, +/* 228 ( 'ä' ) */ (unsigned char) 225, +/* 229 ( 'å' ) */ (unsigned char) 97, +/* 230 ( 'æ' ) */ (unsigned char) 230, +/* 231 ( 'ç' ) */ (unsigned char) 99, +/* 232 ( 'è' ) */ (unsigned char) 101, +/* 233 ( 'é' ) */ (unsigned char) 101, +/* 234 ( 'ê' ) */ (unsigned char) 101, +/* 235 ( 'ë' ) */ (unsigned char) 101, +/* 236 ( 'ì' ) */ (unsigned char) 105, +/* 237 ( 'í' ) */ (unsigned char) 105, +/* 238 ( 'î' ) */ (unsigned char) 105, +/* 239 ( 'ï' ) */ (unsigned char) 105, +/* 240 ( 'ð' ) */ (unsigned char) 100, +/* 241 ( 'ñ' ) */ (unsigned char) 110, +/* 242 ( 'ò' ) */ (unsigned char) 111, +/* 243 ( 'ó' ) */ (unsigned char) 111, +/* 244 ( 'ô' ) */ (unsigned char) 111, +/* 245 ( 'õ' ) */ (unsigned char) 111, +/* 246 ( 'ö' ) */ (unsigned char) 239, +/* 247 ( '÷' ) */ (unsigned char) 253, +/* 248 ( 'ø' ) */ (unsigned char) 248, +/* 249 ( 'ù' ) */ (unsigned char) 117, +/* 250 ( 'ú' ) */ (unsigned char) 117, +/* 251 ( 'û' ) */ (unsigned char) 117, +/* 252 ( 'ü' ) */ (unsigned char) 245, +/* 253 ( 'ý' ) */ (unsigned char) 121, +/* 254 ( 'þ' ) */ (unsigned char) 254, +/* 255 ( 'ÿ' ) */ (unsigned char) 121}; + diff -ruN VDR/lcdtranstbl-nomap.h VDR-LCD/lcdtranstbl-nomap.h --- VDR/lcdtranstbl-nomap.h Thu Jan 1 01:00:00 1970 +++ VDR-LCD/lcdtranstbl-nomap.h Mon Aug 27 12:50:50 2001 @@ -0,0 +1,264 @@ +/* +lcdtranstbl-nomap.h +nothing except '"' is mapped here, seems that somone does not understand '\"' ... +newline,tab and friends are mapped to ' ' +*/ + +const unsigned char LcdTransTbl[256]={ +/* 0 ( '^@') */ (unsigned char) 0, +/* 1 ( '^A') */ (unsigned char) 1, +/* 2 ( '^B') */ (unsigned char) 2, +/* 3 ( '^C') */ (unsigned char) 3, +/* 4 ( '^D') */ (unsigned char) 4, +/* 5 ( '^E') */ (unsigned char) 5, +/* 6 ( '^F') */ (unsigned char) 6, +/* 7 ( '^G') */ (unsigned char) 7, +/* 8 ( '^H') */ (unsigned char) 8, +/* 9 ( '' ) */ (unsigned char) 32, +/* 10 ( '' ) */ (unsigned char) 32, +/* 11 ( '^K') */ (unsigned char) 32, +/* 12 ( '^L') */ (unsigned char) 32, +/* 13 ( '^M') */ (unsigned char) 32, +/* 14 ( '^N') */ (unsigned char) 14, +/* 15 ( '^O') */ (unsigned char) 15, +/* 16 ( '^P') */ (unsigned char) 16, +/* 17 ( '^Q') */ (unsigned char) 17, +/* 18 ( '^R') */ (unsigned char) 18, +/* 19 ( '^S') */ (unsigned char) 19, +/* 20 ( '^T') */ (unsigned char) 20, +/* 21 ( '^U') */ (unsigned char) 21, +/* 22 ( '^V') */ (unsigned char) 22, +/* 23 ( '^W') */ (unsigned char) 23, +/* 24 ( '^X') */ (unsigned char) 24, +/* 25 ( '^Y') */ (unsigned char) 25, +/* 26 ( '^Z') */ (unsigned char) 26, +/* 27 ( '^[') */ (unsigned char) 27, +/* 28 ( '^\') */ (unsigned char) 28, +/* 29 ( '^]') */ (unsigned char) 29, +/* 30 ( '^^') */ (unsigned char) 30, +/* 31 ( '^_') */ (unsigned char) 31, +/* 32 ( ' ' ) */ (unsigned char) 32, +/* 33 ( '!' ) */ (unsigned char) 33, +/* 34 ( '"' ) */ (unsigned char) 39, +/* 35 ( '#' ) */ (unsigned char) 35, +/* 36 ( '$' ) */ (unsigned char) 36, +/* 37 ( '%' ) */ (unsigned char) 37, +/* 38 ( '&' ) */ (unsigned char) 38, +/* 39 ( ''' ) */ (unsigned char) 39, +/* 40 ( '(' ) */ (unsigned char) 40, +/* 41 ( ')' ) */ (unsigned char) 41, +/* 42 ( '*' ) */ (unsigned char) 42, +/* 43 ( '+' ) */ (unsigned char) 43, +/* 44 ( ',' ) */ (unsigned char) 44, +/* 45 ( '-' ) */ (unsigned char) 45, +/* 46 ( '.' ) */ (unsigned char) 46, +/* 47 ( '/' ) */ (unsigned char) 47, +/* 48 ( '0' ) */ (unsigned char) 48, +/* 49 ( '1' ) */ (unsigned char) 49, +/* 50 ( '2' ) */ (unsigned char) 50, +/* 51 ( '3' ) */ (unsigned char) 51, +/* 52 ( '4' ) */ (unsigned char) 52, +/* 53 ( '5' ) */ (unsigned char) 53, +/* 54 ( '6' ) */ (unsigned char) 54, +/* 55 ( '7' ) */ (unsigned char) 55, +/* 56 ( '8' ) */ (unsigned char) 56, +/* 57 ( '9' ) */ (unsigned char) 57, +/* 58 ( ':' ) */ (unsigned char) 58, +/* 59 ( ';' ) */ (unsigned char) 59, +/* 60 ( '<' ) */ (unsigned char) 60, +/* 61 ( '=' ) */ (unsigned char) 61, +/* 62 ( '>' ) */ (unsigned char) 62, +/* 63 ( '?' ) */ (unsigned char) 63, +/* 64 ( '@' ) */ (unsigned char) 64, +/* 65 ( 'A' ) */ (unsigned char) 65, +/* 66 ( 'B' ) */ (unsigned char) 66, +/* 67 ( 'C' ) */ (unsigned char) 67, +/* 68 ( 'D' ) */ (unsigned char) 68, +/* 69 ( 'E' ) */ (unsigned char) 69, +/* 70 ( 'F' ) */ (unsigned char) 70, +/* 71 ( 'G' ) */ (unsigned char) 71, +/* 72 ( 'H' ) */ (unsigned char) 72, +/* 73 ( 'I' ) */ (unsigned char) 73, +/* 74 ( 'J' ) */ (unsigned char) 74, +/* 75 ( 'K' ) */ (unsigned char) 75, +/* 76 ( 'L' ) */ (unsigned char) 76, +/* 77 ( 'M' ) */ (unsigned char) 77, +/* 78 ( 'N' ) */ (unsigned char) 78, +/* 79 ( 'O' ) */ (unsigned char) 79, +/* 80 ( 'P' ) */ (unsigned char) 80, +/* 81 ( 'Q' ) */ (unsigned char) 81, +/* 82 ( 'R' ) */ (unsigned char) 82, +/* 83 ( 'S' ) */ (unsigned char) 83, +/* 84 ( 'T' ) */ (unsigned char) 84, +/* 85 ( 'U' ) */ (unsigned char) 85, +/* 86 ( 'V' ) */ (unsigned char) 86, +/* 87 ( 'W' ) */ (unsigned char) 87, +/* 88 ( 'X' ) */ (unsigned char) 88, +/* 89 ( 'Y' ) */ (unsigned char) 89, +/* 90 ( 'Z' ) */ (unsigned char) 90, +/* 91 ( '[' ) */ (unsigned char) 91, +/* 92 ( '\' ) */ (unsigned char) 92, +/* 93 ( ']' ) */ (unsigned char) 93, +/* 94 ( '^' ) */ (unsigned char) 94, +/* 95 ( '_' ) */ (unsigned char) 95, +/* 96 ( '`' ) */ (unsigned char) 96, +/* 97 ( 'a' ) */ (unsigned char) 97, +/* 98 ( 'b' ) */ (unsigned char) 98, +/* 99 ( 'c' ) */ (unsigned char) 99, +/* 100 ( 'd' ) */ (unsigned char) 100, +/* 101 ( 'e' ) */ (unsigned char) 101, +/* 102 ( 'f' ) */ (unsigned char) 102, +/* 103 ( 'g' ) */ (unsigned char) 103, +/* 104 ( 'h' ) */ (unsigned char) 104, +/* 105 ( 'i' ) */ (unsigned char) 105, +/* 106 ( 'j' ) */ (unsigned char) 106, +/* 107 ( 'k' ) */ (unsigned char) 107, +/* 108 ( 'l' ) */ (unsigned char) 108, +/* 109 ( 'm' ) */ (unsigned char) 109, +/* 110 ( 'n' ) */ (unsigned char) 110, +/* 111 ( 'o' ) */ (unsigned char) 111, +/* 112 ( 'p' ) */ (unsigned char) 112, +/* 113 ( 'q' ) */ (unsigned char) 113, +/* 114 ( 'r' ) */ (unsigned char) 114, +/* 115 ( 's' ) */ (unsigned char) 115, +/* 116 ( 't' ) */ (unsigned char) 116, +/* 117 ( 'u' ) */ (unsigned char) 117, +/* 118 ( 'v' ) */ (unsigned char) 118, +/* 119 ( 'w' ) */ (unsigned char) 119, +/* 120 ( 'x' ) */ (unsigned char) 120, +/* 121 ( 'y' ) */ (unsigned char) 121, +/* 122 ( 'z' ) */ (unsigned char) 122, +/* 123 ( '{' ) */ (unsigned char) 123, +/* 124 ( '|' ) */ (unsigned char) 124, +/* 125 ( '}' ) */ (unsigned char) 125, +/* 126 ( '~' ) */ (unsigned char) 126, +/* 127 ( '^?') */ (unsigned char) 127, +/* 128 ( '~@') */ (unsigned char) 128, +/* 129 ( '~A') */ (unsigned char) 129, +/* 130 ( '~B') */ (unsigned char) 130, +/* 131 ( '~C') */ (unsigned char) 131, +/* 132 ( '~D') */ (unsigned char) 132, +/* 133 ( '~E') */ (unsigned char) 133, +/* 134 ( '~F') */ (unsigned char) 134, +/* 135 ( '~G') */ (unsigned char) 135, +/* 136 ( '~H') */ (unsigned char) 136, +/* 137 ( '~I') */ (unsigned char) 137, +/* 138 ( '~J') */ (unsigned char) 138, +/* 139 ( '~K') */ (unsigned char) 139, +/* 140 ( '~L') */ (unsigned char) 140, +/* 141 ( '~M') */ (unsigned char) 141, +/* 142 ( '~N') */ (unsigned char) 142, +/* 143 ( '~O') */ (unsigned char) 143, +/* 144 ( '~P') */ (unsigned char) 144, +/* 145 ( '~Q') */ (unsigned char) 145, +/* 146 ( '~R') */ (unsigned char) 146, +/* 147 ( '~S') */ (unsigned char) 147, +/* 148 ( '~T') */ (unsigned char) 148, +/* 149 ( '~U') */ (unsigned char) 149, +/* 150 ( '~V') */ (unsigned char) 150, +/* 151 ( '~W') */ (unsigned char) 151, +/* 152 ( '~X') */ (unsigned char) 152, +/* 153 ( '~Y') */ (unsigned char) 153, +/* 154 ( '~Z') */ (unsigned char) 154, +/* 155 ( '~[') */ (unsigned char) 155, +/* 156 ( '~\') */ (unsigned char) 156, +/* 157 ( '~]') */ (unsigned char) 157, +/* 158 ( '~^') */ (unsigned char) 158, +/* 159 ( '~_') */ (unsigned char) 159, +/* 160 ( '| ') */ (unsigned char) 160, +/* 161 ( '¡' ) */ (unsigned char) 161, +/* 162 ( '¢' ) */ (unsigned char) 162, +/* 163 ( '£' ) */ (unsigned char) 163, +/* 164 ( '¤' ) */ (unsigned char) 164, +/* 165 ( '¥' ) */ (unsigned char) 165, +/* 166 ( '¦' ) */ (unsigned char) 166, +/* 167 ( '§' ) */ (unsigned char) 167, +/* 168 ( '¨' ) */ (unsigned char) 168, +/* 169 ( '©' ) */ (unsigned char) 169, +/* 170 ( 'ª' ) */ (unsigned char) 170, +/* 171 ( '«' ) */ (unsigned char) 171, +/* 172 ( '¬' ) */ (unsigned char) 172, +/* 173 ( '­' ) */ (unsigned char) 173, +/* 174 ( '®' ) */ (unsigned char) 174, +/* 175 ( '¯' ) */ (unsigned char) 175, +/* 176 ( '°' ) */ (unsigned char) 176, +/* 177 ( '±' ) */ (unsigned char) 177, +/* 178 ( '²' ) */ (unsigned char) 178, +/* 179 ( '³' ) */ (unsigned char) 179, +/* 180 ( '´' ) */ (unsigned char) 180, +/* 181 ( 'µ' ) */ (unsigned char) 181, +/* 182 ( '¶' ) */ (unsigned char) 182, +/* 183 ( '·' ) */ (unsigned char) 183, +/* 184 ( '¸' ) */ (unsigned char) 184, +/* 185 ( '¹' ) */ (unsigned char) 185, +/* 186 ( 'º' ) */ (unsigned char) 186, +/* 187 ( '»' ) */ (unsigned char) 187, +/* 188 ( '¼' ) */ (unsigned char) 188, +/* 189 ( '½' ) */ (unsigned char) 189, +/* 190 ( '¾' ) */ (unsigned char) 190, +/* 191 ( '¿' ) */ (unsigned char) 191, +/* 192 ( 'À' ) */ (unsigned char) 192, +/* 193 ( 'Á' ) */ (unsigned char) 193, +/* 194 ( 'Â' ) */ (unsigned char) 194, +/* 195 ( 'Ã' ) */ (unsigned char) 195, +/* 196 ( 'Ä' ) */ (unsigned char) 196, +/* 197 ( 'Å' ) */ (unsigned char) 197, +/* 198 ( 'Æ' ) */ (unsigned char) 198, +/* 199 ( 'Ç' ) */ (unsigned char) 199, +/* 200 ( 'È' ) */ (unsigned char) 200, +/* 201 ( 'É' ) */ (unsigned char) 201, +/* 202 ( 'Ê' ) */ (unsigned char) 202, +/* 203 ( 'Ë' ) */ (unsigned char) 203, +/* 204 ( 'Ì' ) */ (unsigned char) 204, +/* 205 ( 'Í' ) */ (unsigned char) 205, +/* 206 ( 'Î' ) */ (unsigned char) 206, +/* 207 ( 'Ï' ) */ (unsigned char) 207, +/* 208 ( 'Ð' ) */ (unsigned char) 208, +/* 209 ( 'Ñ' ) */ (unsigned char) 209, +/* 210 ( 'Ò' ) */ (unsigned char) 210, +/* 211 ( 'Ó' ) */ (unsigned char) 211, +/* 212 ( 'Ô' ) */ (unsigned char) 212, +/* 213 ( 'Õ' ) */ (unsigned char) 213, +/* 214 ( 'Ö' ) */ (unsigned char) 214, +/* 215 ( '×' ) */ (unsigned char) 215, +/* 216 ( 'Ø' ) */ (unsigned char) 216, +/* 217 ( 'Ù' ) */ (unsigned char) 217, +/* 218 ( 'Ú' ) */ (unsigned char) 218, +/* 219 ( 'Û' ) */ (unsigned char) 219, +/* 220 ( 'Ü' ) */ (unsigned char) 220, +/* 221 ( 'Ý' ) */ (unsigned char) 221, +/* 222 ( 'Þ' ) */ (unsigned char) 222, +/* 223 ( 'ß' ) */ (unsigned char) 223, +/* 224 ( 'à' ) */ (unsigned char) 224, +/* 225 ( 'á' ) */ (unsigned char) 225, +/* 226 ( 'â' ) */ (unsigned char) 226, +/* 227 ( 'ã' ) */ (unsigned char) 227, +/* 228 ( 'ä' ) */ (unsigned char) 228, +/* 229 ( 'å' ) */ (unsigned char) 229, +/* 230 ( 'æ' ) */ (unsigned char) 230, +/* 231 ( 'ç' ) */ (unsigned char) 231, +/* 232 ( 'è' ) */ (unsigned char) 232, +/* 233 ( 'é' ) */ (unsigned char) 233, +/* 234 ( 'ê' ) */ (unsigned char) 234, +/* 235 ( 'ë' ) */ (unsigned char) 235, +/* 236 ( 'ì' ) */ (unsigned char) 236, +/* 237 ( 'í' ) */ (unsigned char) 237, +/* 238 ( 'î' ) */ (unsigned char) 238, +/* 239 ( 'ï' ) */ (unsigned char) 239, +/* 240 ( 'ð' ) */ (unsigned char) 240, +/* 241 ( 'ñ' ) */ (unsigned char) 241, +/* 242 ( 'ò' ) */ (unsigned char) 242, +/* 243 ( 'ó' ) */ (unsigned char) 243, +/* 244 ( 'ô' ) */ (unsigned char) 244, +/* 245 ( 'õ' ) */ (unsigned char) 245, +/* 246 ( 'ö' ) */ (unsigned char) 246, +/* 247 ( '÷' ) */ (unsigned char) 247, +/* 248 ( 'ø' ) */ (unsigned char) 248, +/* 249 ( 'ù' ) */ (unsigned char) 249, +/* 250 ( 'ú' ) */ (unsigned char) 250, +/* 251 ( 'û' ) */ (unsigned char) 251, +/* 252 ( 'ü' ) */ (unsigned char) 252, +/* 253 ( 'ý' ) */ (unsigned char) 253, +/* 254 ( 'þ' ) */ (unsigned char) 254, +/* 255 ( 'ÿ' ) */ (unsigned char) 255}; + diff -ruN VDR/lcdtranstbl.h VDR-LCD/lcdtranstbl.h --- VDR/lcdtranstbl.h Thu Jan 1 01:00:00 1970 +++ VDR-LCD/lcdtranstbl.h Mon Aug 27 12:50:50 2001 @@ -0,0 +1,265 @@ +/* +lcdtranstbl-hd44780.h +this table is used to map characters for output to +a hd44780 LCD to display some special characters correctly. +newline,tab and friends are mapped to ' ' +*/ + +const unsigned char LcdTransTbl[256]={ +/* 0 ( '^@') */ (unsigned char) 0, +/* 1 ( '^A') */ (unsigned char) 1, +/* 2 ( '^B') */ (unsigned char) 2, +/* 3 ( '^C') */ (unsigned char) 3, +/* 4 ( '^D') */ (unsigned char) 4, +/* 5 ( '^E') */ (unsigned char) 5, +/* 6 ( '^F') */ (unsigned char) 6, +/* 7 ( '^G') */ (unsigned char) 7, +/* 8 ( '^H') */ (unsigned char) 8, +/* 9 ( '' ) */ (unsigned char) 32, +/* 10 ( '' ) */ (unsigned char) 32, +/* 11 ( '^K') */ (unsigned char) 32, +/* 12 ( '^L') */ (unsigned char) 32, +/* 13 ( '^M') */ (unsigned char) 32, +/* 14 ( '^N') */ (unsigned char) 14, +/* 15 ( '^O') */ (unsigned char) 15, +/* 16 ( '^P') */ (unsigned char) 16, +/* 17 ( '^Q') */ (unsigned char) 17, +/* 18 ( '^R') */ (unsigned char) 18, +/* 19 ( '^S') */ (unsigned char) 19, +/* 20 ( '^T') */ (unsigned char) 20, +/* 21 ( '^U') */ (unsigned char) 21, +/* 22 ( '^V') */ (unsigned char) 22, +/* 23 ( '^W') */ (unsigned char) 23, +/* 24 ( '^X') */ (unsigned char) 24, +/* 25 ( '^Y') */ (unsigned char) 25, +/* 26 ( '^Z') */ (unsigned char) 26, +/* 27 ( '^[') */ (unsigned char) 27, +/* 28 ( '^\') */ (unsigned char) 28, +/* 29 ( '^]') */ (unsigned char) 29, +/* 30 ( '^^') */ (unsigned char) 30, +/* 31 ( '^_') */ (unsigned char) 31, +/* 32 ( ' ' ) */ (unsigned char) 32, +/* 33 ( '!' ) */ (unsigned char) 33, +/* 34 ( '"' ) */ (unsigned char) 39, +/* 35 ( '#' ) */ (unsigned char) 35, +/* 36 ( '$' ) */ (unsigned char) 36, +/* 37 ( '%' ) */ (unsigned char) 37, +/* 38 ( '&' ) */ (unsigned char) 38, +/* 39 ( ''' ) */ (unsigned char) 39, +/* 40 ( '(' ) */ (unsigned char) 40, +/* 41 ( ')' ) */ (unsigned char) 41, +/* 42 ( '*' ) */ (unsigned char) 42, +/* 43 ( '+' ) */ (unsigned char) 43, +/* 44 ( ',' ) */ (unsigned char) 44, +/* 45 ( '-' ) */ (unsigned char) 45, +/* 46 ( '.' ) */ (unsigned char) 46, +/* 47 ( '/' ) */ (unsigned char) 47, +/* 48 ( '0' ) */ (unsigned char) 48, +/* 49 ( '1' ) */ (unsigned char) 49, +/* 50 ( '2' ) */ (unsigned char) 50, +/* 51 ( '3' ) */ (unsigned char) 51, +/* 52 ( '4' ) */ (unsigned char) 52, +/* 53 ( '5' ) */ (unsigned char) 53, +/* 54 ( '6' ) */ (unsigned char) 54, +/* 55 ( '7' ) */ (unsigned char) 55, +/* 56 ( '8' ) */ (unsigned char) 56, +/* 57 ( '9' ) */ (unsigned char) 57, +/* 58 ( ':' ) */ (unsigned char) 58, +/* 59 ( ';' ) */ (unsigned char) 59, +/* 60 ( '<' ) */ (unsigned char) 60, +/* 61 ( '=' ) */ (unsigned char) 61, +/* 62 ( '>' ) */ (unsigned char) 62, +/* 63 ( '?' ) */ (unsigned char) 63, +/* 64 ( '@' ) */ (unsigned char) 64, +/* 65 ( 'A' ) */ (unsigned char) 65, +/* 66 ( 'B' ) */ (unsigned char) 66, +/* 67 ( 'C' ) */ (unsigned char) 67, +/* 68 ( 'D' ) */ (unsigned char) 68, +/* 69 ( 'E' ) */ (unsigned char) 69, +/* 70 ( 'F' ) */ (unsigned char) 70, +/* 71 ( 'G' ) */ (unsigned char) 71, +/* 72 ( 'H' ) */ (unsigned char) 72, +/* 73 ( 'I' ) */ (unsigned char) 73, +/* 74 ( 'J' ) */ (unsigned char) 74, +/* 75 ( 'K' ) */ (unsigned char) 75, +/* 76 ( 'L' ) */ (unsigned char) 76, +/* 77 ( 'M' ) */ (unsigned char) 77, +/* 78 ( 'N' ) */ (unsigned char) 78, +/* 79 ( 'O' ) */ (unsigned char) 79, +/* 80 ( 'P' ) */ (unsigned char) 80, +/* 81 ( 'Q' ) */ (unsigned char) 81, +/* 82 ( 'R' ) */ (unsigned char) 82, +/* 83 ( 'S' ) */ (unsigned char) 83, +/* 84 ( 'T' ) */ (unsigned char) 84, +/* 85 ( 'U' ) */ (unsigned char) 85, +/* 86 ( 'V' ) */ (unsigned char) 86, +/* 87 ( 'W' ) */ (unsigned char) 87, +/* 88 ( 'X' ) */ (unsigned char) 88, +/* 89 ( 'Y' ) */ (unsigned char) 89, +/* 90 ( 'Z' ) */ (unsigned char) 90, +/* 91 ( '[' ) */ (unsigned char) 91, +/* 92 ( '\' ) */ (unsigned char) 92, +/* 93 ( ']' ) */ (unsigned char) 93, +/* 94 ( '^' ) */ (unsigned char) 94, +/* 95 ( '_' ) */ (unsigned char) 95, +/* 96 ( '`' ) */ (unsigned char) 96, +/* 97 ( 'a' ) */ (unsigned char) 97, +/* 98 ( 'b' ) */ (unsigned char) 98, +/* 99 ( 'c' ) */ (unsigned char) 99, +/* 100 ( 'd' ) */ (unsigned char) 100, +/* 101 ( 'e' ) */ (unsigned char) 101, +/* 102 ( 'f' ) */ (unsigned char) 102, +/* 103 ( 'g' ) */ (unsigned char) 103, +/* 104 ( 'h' ) */ (unsigned char) 104, +/* 105 ( 'i' ) */ (unsigned char) 105, +/* 106 ( 'j' ) */ (unsigned char) 106, +/* 107 ( 'k' ) */ (unsigned char) 107, +/* 108 ( 'l' ) */ (unsigned char) 108, +/* 109 ( 'm' ) */ (unsigned char) 109, +/* 110 ( 'n' ) */ (unsigned char) 110, +/* 111 ( 'o' ) */ (unsigned char) 111, +/* 112 ( 'p' ) */ (unsigned char) 112, +/* 113 ( 'q' ) */ (unsigned char) 113, +/* 114 ( 'r' ) */ (unsigned char) 114, +/* 115 ( 's' ) */ (unsigned char) 115, +/* 116 ( 't' ) */ (unsigned char) 116, +/* 117 ( 'u' ) */ (unsigned char) 117, +/* 118 ( 'v' ) */ (unsigned char) 118, +/* 119 ( 'w' ) */ (unsigned char) 119, +/* 120 ( 'x' ) */ (unsigned char) 120, +/* 121 ( 'y' ) */ (unsigned char) 121, +/* 122 ( 'z' ) */ (unsigned char) 122, +/* 123 ( '{' ) */ (unsigned char) 123, +/* 124 ( '|' ) */ (unsigned char) 124, +/* 125 ( '}' ) */ (unsigned char) 125, +/* 126 ( '~' ) */ (unsigned char) 126, +/* 127 ( '^?') */ (unsigned char) 127, +/* 128 ( '~@') */ (unsigned char) 128, +/* 129 ( '~A') */ (unsigned char) 129, +/* 130 ( '~B') */ (unsigned char) 130, +/* 131 ( '~C') */ (unsigned char) 131, +/* 132 ( '~D') */ (unsigned char) 132, +/* 133 ( '~E') */ (unsigned char) 133, +/* 134 ( '~F') */ (unsigned char) 134, +/* 135 ( '~G') */ (unsigned char) 135, +/* 136 ( '~H') */ (unsigned char) 136, +/* 137 ( '~I') */ (unsigned char) 137, +/* 138 ( '~J') */ (unsigned char) 138, +/* 139 ( '~K') */ (unsigned char) 139, +/* 140 ( '~L') */ (unsigned char) 140, +/* 141 ( '~M') */ (unsigned char) 141, +/* 142 ( '~N') */ (unsigned char) 142, +/* 143 ( '~O') */ (unsigned char) 143, +/* 144 ( '~P') */ (unsigned char) 144, +/* 145 ( '~Q') */ (unsigned char) 145, +/* 146 ( '~R') */ (unsigned char) 146, +/* 147 ( '~S') */ (unsigned char) 147, +/* 148 ( '~T') */ (unsigned char) 148, +/* 149 ( '~U') */ (unsigned char) 149, +/* 150 ( '~V') */ (unsigned char) 150, +/* 151 ( '~W') */ (unsigned char) 151, +/* 152 ( '~X') */ (unsigned char) 152, +/* 153 ( '~Y') */ (unsigned char) 153, +/* 154 ( '~Z') */ (unsigned char) 154, +/* 155 ( '~[') */ (unsigned char) 155, +/* 156 ( '~\') */ (unsigned char) 156, +/* 157 ( '~]') */ (unsigned char) 157, +/* 158 ( '~^') */ (unsigned char) 158, +/* 159 ( '~_') */ (unsigned char) 159, +/* 160 ( '| ') */ (unsigned char) 160, +/* 161 ( '¡' ) */ (unsigned char) 161, +/* 162 ( '¢' ) */ (unsigned char) 162, +/* 163 ( '£' ) */ (unsigned char) 163, +/* 164 ( '¤' ) */ (unsigned char) 164, +/* 165 ( '¥' ) */ (unsigned char) 92, +/* 166 ( '¦' ) */ (unsigned char) 166, +/* 167 ( '§' ) */ (unsigned char) 167, +/* 168 ( '¨' ) */ (unsigned char) 168, +/* 169 ( '©' ) */ (unsigned char) 67, +/* 170 ( 'ª' ) */ (unsigned char) 170, +/* 171 ( '«' ) */ (unsigned char) 171, +/* 172 ( '¬' ) */ (unsigned char) 172, +/* 173 ( '­' ) */ (unsigned char) 173, +/* 174 ( '®' ) */ (unsigned char) 174, +/* 175 ( '¯' ) */ (unsigned char) 175, +/* 176 ( '°' ) */ (unsigned char) 223, +/* 177 ( '±' ) */ (unsigned char) 177, +/* 178 ( '²' ) */ (unsigned char) 50, +/* 179 ( '³' ) */ (unsigned char) 51, +/* 180 ( '´' ) */ (unsigned char) 180, +/* 181 ( 'µ' ) */ (unsigned char) 228, +/* 182 ( '¶' ) */ (unsigned char) 182, +/* 183 ( '·' ) */ (unsigned char) 183, +/* 184 ( '¸' ) */ (unsigned char) 184, +/* 185 ( '¹' ) */ (unsigned char) 185, +/* 186 ( 'º' ) */ (unsigned char) 223, +/* 187 ( '»' ) */ (unsigned char) 187, +/* 188 ( '¼' ) */ (unsigned char) 188, +/* 189 ( '½' ) */ (unsigned char) 189, +/* 190 ( '¾' ) */ (unsigned char) 190, +/* 191 ( '¿' ) */ (unsigned char) 191, +/* 192 ( 'À' ) */ (unsigned char) 65, +/* 193 ( 'Á' ) */ (unsigned char) 65, +/* 194 ( 'Â' ) */ (unsigned char) 65, +/* 195 ( 'Ã' ) */ (unsigned char) 65, +/* 196 ( 'Ä' ) */ (unsigned char) 225, +/* 197 ( 'Å' ) */ (unsigned char) 65, +/* 198 ( 'Æ' ) */ (unsigned char) 225, +/* 199 ( 'Ç' ) */ (unsigned char) 67, +/* 200 ( 'È' ) */ (unsigned char) 69, +/* 201 ( 'É' ) */ (unsigned char) 69, +/* 202 ( 'Ê' ) */ (unsigned char) 69, +/* 203 ( 'Ë' ) */ (unsigned char) 69, +/* 204 ( 'Ì' ) */ (unsigned char) 73, +/* 205 ( 'Í' ) */ (unsigned char) 73, +/* 206 ( 'Î' ) */ (unsigned char) 73, +/* 207 ( 'Ï' ) */ (unsigned char) 73, +/* 208 ( 'Ð' ) */ (unsigned char) 68, +/* 209 ( 'Ñ' ) */ (unsigned char) 78, +/* 210 ( 'Ò' ) */ (unsigned char) 79, +/* 211 ( 'Ó' ) */ (unsigned char) 79, +/* 212 ( 'Ô' ) */ (unsigned char) 79, +/* 213 ( 'Õ' ) */ (unsigned char) 79, +/* 214 ( 'Ö' ) */ (unsigned char) 239, +/* 215 ( '×' ) */ (unsigned char) 88, +/* 216 ( 'Ø' ) */ (unsigned char) 48, +/* 217 ( 'Ù' ) */ (unsigned char) 85, +/* 218 ( 'Ú' ) */ (unsigned char) 85, +/* 219 ( 'Û' ) */ (unsigned char) 85, +/* 220 ( 'Ü' ) */ (unsigned char) 245, +/* 221 ( 'Ý' ) */ (unsigned char) 89, +/* 222 ( 'Þ' ) */ (unsigned char) 222, +/* 223 ( 'ß' ) */ (unsigned char) 226, +/* 224 ( 'à' ) */ (unsigned char) 97, +/* 225 ( 'á' ) */ (unsigned char) 97, +/* 226 ( 'â' ) */ (unsigned char) 97, +/* 227 ( 'ã' ) */ (unsigned char) 97, +/* 228 ( 'ä' ) */ (unsigned char) 225, +/* 229 ( 'å' ) */ (unsigned char) 97, +/* 230 ( 'æ' ) */ (unsigned char) 230, +/* 231 ( 'ç' ) */ (unsigned char) 99, +/* 232 ( 'è' ) */ (unsigned char) 101, +/* 233 ( 'é' ) */ (unsigned char) 101, +/* 234 ( 'ê' ) */ (unsigned char) 101, +/* 235 ( 'ë' ) */ (unsigned char) 101, +/* 236 ( 'ì' ) */ (unsigned char) 105, +/* 237 ( 'í' ) */ (unsigned char) 105, +/* 238 ( 'î' ) */ (unsigned char) 105, +/* 239 ( 'ï' ) */ (unsigned char) 105, +/* 240 ( 'ð' ) */ (unsigned char) 100, +/* 241 ( 'ñ' ) */ (unsigned char) 110, +/* 242 ( 'ò' ) */ (unsigned char) 111, +/* 243 ( 'ó' ) */ (unsigned char) 111, +/* 244 ( 'ô' ) */ (unsigned char) 111, +/* 245 ( 'õ' ) */ (unsigned char) 111, +/* 246 ( 'ö' ) */ (unsigned char) 239, +/* 247 ( '÷' ) */ (unsigned char) 253, +/* 248 ( 'ø' ) */ (unsigned char) 248, +/* 249 ( 'ù' ) */ (unsigned char) 117, +/* 250 ( 'ú' ) */ (unsigned char) 117, +/* 251 ( 'û' ) */ (unsigned char) 117, +/* 252 ( 'ü' ) */ (unsigned char) 245, +/* 253 ( 'ý' ) */ (unsigned char) 121, +/* 254 ( 'þ' ) */ (unsigned char) 254, +/* 255 ( 'ÿ' ) */ (unsigned char) 121}; + diff -ruN VDR/menu.c VDR-LCD/menu.c --- VDR/menu.c Sun Aug 26 16:03:27 2001 +++ VDR-LCD/menu.c Mon Aug 27 13:15:09 2001 @@ -16,6 +16,11 @@ #include "eit.h" #include "i18n.h" +#ifdef LCD // LCDproc +#include "lcd.h" +extern cLcd *LCDproc; +#endif // LCD + #define MENUTIMEOUT 120 // seconds #define MAXWAIT4EPGINFO 10 // seconds @@ -796,6 +801,9 @@ offset = 0; eDvbFont oldFont = Interface->SetFont(font); text = Interface->WrapText(Text, w - 1, &lines); +#ifdef LCD // LCDproc + LCDproc->SummaryInit(text); +#endif // LCD Interface->SetFont(oldFont); if (h < 0) h = lines; @@ -837,24 +845,39 @@ // scroll indicators use inverted color scheme! if (CanScrollUp()) Interface->Write(x + w - 1, y, "^", bgColor, fgColor); if (CanScrollDown()) Interface->Write(x + w - 1, y + h - 1, "v", bgColor, fgColor); +#ifdef LCD // LCDproc + LCDproc->SummaryDisplay(); +#endif // LCD } void cMenuTextItem::ScrollUp(void) { +#ifdef LCD // LCDproc + LCDproc->SummaryUp(); +#endif // LCD if (CanScrollUp()) { Clear(); offset--; Display(); } +#ifdef LCD // LCDproc + else LCDproc->SummaryDisplay(); +#endif // LCD } void cMenuTextItem::ScrollDown(void) { +#ifdef LCD // LCDproc + LCDproc->SummaryDown(); +#endif // LCD if (CanScrollDown()) { Clear(); offset++; Display(); } +#ifdef LCD // LCDproc + else LCDproc->SummaryDisplay(); +#endif // LCD } eOSState cMenuTextItem::ProcessKey(eKeys Key) @@ -1887,7 +1910,8 @@ } break; default: switch (Key) { - case kMenu: state = osEnd; break; + case kMenu: state = osEnd; + break; case kRed: if (!HasSubMenu()) state = osRecord; break; @@ -1957,6 +1981,9 @@ if (number < 0) Interface->DisplayChannelNumber(oldNumber); Interface->Close(); +#ifdef LCD // LCDproc + LCDproc->SetThreadState( (cLcd::ThreadStates) 1); +#endif // LCD } void cDisplayChannel::DisplayChannel(const cChannel *Channel) @@ -1971,6 +1998,10 @@ snprintf(buffer, BufSize, "%s", Channel ? Channel->name : tr("*** Invalid Channel ***")); Interface->Fill(0, 0, Setup.OSDwidth, 1, clrBackground); Interface->Write(0, 0, buffer); +#ifdef LCD // LCDproc + LCDproc->Clear(1); + LCDproc->SetLineC(1,1,buffer); +#endif // LCD const char *date = DayDateTime(); Interface->Write(-strlen(date), 0, date); } @@ -2023,6 +2054,15 @@ if (!isempty(FollowingSubtitle)) { Interface->Write(t, l, FollowingSubtitle, clrCyan, clrBackground); } +#ifdef LCD // LCDproc + if ( (!isempty(PresentTitle)) && (!isempty(PresentSubtitle)) ) + LCDproc->SetRunning(false,Present->GetTimeString(),PresentTitle,PresentSubtitle); + else if (!isempty(PresentTitle)) LCDproc->SetRunning(false,Present->GetTimeString(),PresentTitle); + + if ( (!isempty(FollowingTitle)) && (!isempty(FollowingSubtitle)) ) + LCDproc->SetRunning(true,Following->GetTimeString(),FollowingTitle,FollowingSubtitle); + else if (!isempty(FollowingTitle)) LCDproc->SetRunning(true,Following->GetTimeString(),FollowingTitle); +#endif // LCD Interface->Flush(); lines = Lines; lastTime = time_ms(); @@ -2313,18 +2353,31 @@ timeoutShow = 0; timeSearchActive = false; if (fileName) { +#ifdef LCD // LCDproc + LCDproc->SetMain(2,title); + LCDproc->SetThreadState( (cLcd::ThreadStates) 2); // Replaying +#endif // LCD marks.Load(fileName); dvbApi->StartReplay(fileName); } #ifdef DVDSUPPORT - else if (dvd) + else if (dvd) { +#ifdef LCD // LCDproc + LCDproc->SetMain(2, "Replaying DVD"); + LCDproc->SetThreadState( (cLcd::ThreadStates) 2); // Replaying +#endif // LCD dvbApi->StartDVDplay(dvd, titleid);//XXX + } #endif //DVDSUPPORT } cReplayControl::~cReplayControl() { Hide(); +#ifdef LCD // LCDproc + LCDproc->SetProgress(NULL); + LCDproc->SetThreadState( (cLcd::ThreadStates) 1); // Title +#endif // LCD dvbApi->StopReplay(); } @@ -2593,6 +2646,9 @@ eOSState cReplayControl::ProcessKey(eKeys Key) { + int Current, Total; + char tempbuffer[16]; + if (!dvbApi->Replaying()) return osEnd; if (visible) { @@ -2603,6 +2659,13 @@ else shown = ShowProgress(!shown) || shown; } + + // Display progress on the LCD + dvbApi->GetIndex(Current, Total); + sprintf(tempbuffer,IndexToHMSF(Total)); +#ifdef LCD // LCDproc + LCDproc->SetProgress(IndexToHMSF(Current),tempbuffer, (100 * Current) / Total); +#endif // LCD bool DisplayedFrames = displayFrames; displayFrames = false; if (timeSearchActive && Key != kNone) { diff -ruN VDR/osd.c VDR-LCD/osd.c --- VDR/osd.c Sat Aug 25 15:15:16 2001 +++ VDR-LCD/osd.c Mon Aug 27 13:06:59 2001 @@ -11,6 +11,11 @@ #include #include "i18n.h" +#ifdef LCD // LCDproc +#include "lcd.h" +extern cLcd *LCDproc; +#endif // LCD + // --- cOsdItem -------------------------------------------------------------- cOsdItem::cOsdItem(eOSState State) @@ -65,6 +70,9 @@ offset = Offset; if (offset >= 0) Interface->WriteText(0, offset + 2, text, userColor ? fgColor : FgColor, userColor ? bgColor : BgColor); +#ifdef LCD // LCDproc + if (FgColor == clrBlack) LCDproc->SetMain(0,text); +#endif // LCD } eOSState cOsdItem::ProcessKey(eKeys Key) @@ -95,6 +103,9 @@ cOsdMenu::~cOsdMenu() { +#ifdef LCD // LCDproc + if (strncmp(title,tr("Main"),strlen(tr("Main")) )==0) LCDproc->SetThreadState(LCDproc->cLcd::LastState); else LCDproc->Clear(0); //a bit gross ... +#endif // LCD delete title; delete subMenu; delete status; @@ -151,10 +162,19 @@ void cOsdMenu::Display(void) { visible = true; + Interface->Clear(); Interface->SetCols(cols); Interface->Title(title); Interface->Help(helpRed, helpGreen, helpYellow, helpBlue); + +#ifdef LCD // LCDproc + LCDproc->Clear(0); + LCDproc->SetTitle(title); + LCDproc->SetHelp(0,helpRed, helpGreen, helpYellow, helpBlue); + LCDproc->SetThreadState( (cLcd::ThreadStates) 0); // Menu +#endif // LCD + int count = Count(); if (count > 0) { if (current < 0) @@ -287,6 +307,9 @@ if (Count() && marked < 0) { marked = current; SetStatus(tr("Up/Dn for new location - OK to move")); +#ifdef LCD // LCDproc + LCDproc->SetStatus( tr("Up/Dn - OK to move") ); +#endif // LCD } } diff -ruN VDR/sockets.c VDR-LCD/sockets.c --- VDR/sockets.c Thu Jan 1 01:00:00 1970 +++ VDR-LCD/sockets.c Mon Aug 27 12:50:50 2001 @@ -0,0 +1,232 @@ +#ifdef LCD // LCDproc +/******************************** +this file was taken from the +LCDproc source see +http://lcdproc.omnipotent.net/ +for more info. +*********************************/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "sockets.h" + +/************************************************** + LCDproc client sockets code... + + Feel free to use this in your own clients... :) +**************************************************/ + +// Length of longest transmission allowed at once... +#define MAXMSG 8192 + +typedef struct sockaddr_in sockaddr_in; + +static int +sock_init_sockaddr (sockaddr_in * name, const char *hostname, unsigned short int port) +{ + struct hostent *hostinfo; + + name->sin_family = AF_INET; + name->sin_port = htons (port); + hostinfo = gethostbyname (hostname); + if (hostinfo == NULL) { + fprintf (stderr, "sock_init_sockaddr: Unknown host %s.\n", hostname); + return -1; + } + name->sin_addr = *(struct in_addr *) hostinfo->h_addr; + + return 0; + +} + + // Client functions... +int +sock_connect (char *host, unsigned short int port) +{ + struct sockaddr_in servername; + int sock; + int err = 0; + + //debug ("sock_connect: Creating socket\n"); + sock = socket (PF_INET, SOCK_STREAM, 0); + if (sock < 0) { + perror ("sock_connect: Error creating socket"); + return sock; + } + //debug ("sock_connect: Created socket (%i)\n", sock); + + sock_init_sockaddr (&servername, host, port); + + err = connect (sock, (struct sockaddr *) &servername, sizeof (servername)); + if (err < 0) { + perror ("sock_connect: connect failed"); + shutdown (sock, 2); + return 0; // Normal exit if server doesn't exist... + } + + fcntl (sock, F_SETFL, O_NONBLOCK); + + return sock; +} + +int +sock_close (int fd) +{ + int err; + + err = shutdown (fd, 2); + if (!err) + close (fd); + + return err; +} + +// Send/receive lines of text +int +sock_send_string (int fd, char *string) +{ + int len; + int offset = 0; + + if (!string) + return -1; + + len = strlen (string) ; + while (offset != len) { + // write isn't guaranteed to send the entire string at once, + // so we have to sent it in a loop like this + int sent = write (fd, string + offset, len - offset); + if (sent == -1) { + if (errno != EAGAIN) { + perror ("sock_send_string: socket write error"); + printf ("Message was: %s\n", string); + //shutdown(fd, 2); + return sent; + } + continue; + } else if (sent == 0) { + // when this returns zero, it generally means + // we got disconnected + return sent + offset; + } + + offset += sent; + } + + return offset; +} + +// Recv gives only one line per call... +int +sock_recv_string (int fd, char *dest, size_t maxlen) +{ + char *ptr = dest; + unsigned int recv = 0; + + if (!dest) + return -1; + if (maxlen <= 0) + return 0; + + while (1) { + int err = read (fd, ptr, 1); + if (err == -1) { + if (errno == EAGAIN) { + if (recv) { + // We've begun to read a string, but no bytes are + // available. Loop. + continue; + } + return 0; + } else { + perror ("sock_recv_string: socket read error"); + return err; + } + } else if (err == 0) { + return recv; + } + + recv++; + + if (recv == maxlen || *ptr == 0 || *ptr == 10) { + *ptr = 0; + break; + } + ptr++; + } + + if (recv == 1 && dest[0] == 0) { + // Don't return a null string + return 0; + } + + if (recv < maxlen - 1) { + dest[recv] = 0; + } + + return recv; +} + +// Send/receive raw data +int +sock_send (int fd, void *src, size_t size) +{ + unsigned int offset = 0; + + if (!src) + return -1; + + while (offset != size) { + // write isn't guaranteed to send the entire string at once, + // so we have to sent it in a loop like this + int sent = write (fd, ((char *) src) + offset, size - offset); + if (sent == -1) { + if (errno != EAGAIN) { + perror ("sock_send: socket write error"); + //shutdown(fd, 2); + return sent; + } + continue; + } else if (sent == 0) { + // when this returns zero, it generally means + // we got disconnected + return sent + offset; + } + + offset += sent; + } + + return offset; +} + +int +sock_recv (int fd, void *dest, size_t maxlen) +{ + int err; + + if (!dest) + return -1; + if (maxlen <= 0) + return 0; + + err = read (fd, dest, maxlen); + if (err < 0) { + //fprintf (stderr,"sock_recv: socket read error\n"); + //shutdown(fd, 2); + return err; + } + //debug("sock_recv: Got message \"%s\"\n", (char *)dest); + + return err; +} +#endif // LCD diff -ruN VDR/sockets.h VDR-LCD/sockets.h --- VDR/sockets.h Thu Jan 1 01:00:00 1970 +++ VDR-LCD/sockets.h Mon Aug 27 12:50:50 2001 @@ -0,0 +1,94 @@ +#ifdef LCD // LCDproc +/******************************** +this file was taken from the +LCDproc source see +http://lcdproc.omnipotent.net/ +for more info. +*********************************/ + +#ifndef SOCKETS_H +#define SOCKETS_H + +#include + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#ifndef LCDPORT +#define LCDPORT 13666 +#endif + +/* + Socket functions available to server and clients... + (ignore the rest of the comments... I was babbling out random ideas) + + This should have stuff to read/write sockets, open/close them, etc... + */ + +// Client functions... +int sock_connect (char *host, unsigned short int port); +int sock_close (int fd); +// Send/receive lines of text +int sock_send_string (int fd, char *string); +// Recv gives only one line per call... +int sock_recv_string (int fd, char *dest, size_t maxlen); +// Send/receive raw data +int sock_send (int fd, void *src, size_t size); +int sock_recv (int fd, void *dest, size_t maxlen); + +// Er, ignore the rest of this file. I'll clean it up sometime... + +/***************************************************************** + LCDproc command line interface?: (while running) + + -command + Tells LCDproc to interpret stdin as raw commands to send through + the socket. Input must be formatted as above, in socket interface. + -function f + Runs LCDproc external function f, where f is one of the predefined + functions which can be assigned to keypad keys. (like NEXTMODE, etc) + -key x + Simulates keypad press of key 'x', where 'x' is (A-Z). + -print [time] + Prints stdin on LCD one line at a time, with no line-wrapping (raw), + with [time] frames between updates (lines). + -wrap [time] + Prints stdin as with "-print", but with line wrapping when possible. + -contrast xxx + Sets contrast to xxx (decimal) + -backlight [on/off] + Turns backlight [on/off/auto], or toggles it. + If [off], stays off. + If [on], stays on. + If [auto], LCDproc controls backlight based on load, etc... + -exit + -quit + Duh... :) + +******************************************************************/ + +/***************************************************************** + LCDproc stuff supported in config file (loose approximation): + + Grammar is tcl-style. I.e., "command arg1 arg2 ...". + Spaces are used as argument separators, *until* it thinks it has the final + argument. So, "function thing shell myprogram arg1 arg2 arg3" would be + split into "function", "thing", "shell", and "myprogram arg1 arg2 arg3". + + User-definable functions (use built-in's to create new ones?): + Function mp3NextSong Shell /usr/local/bin/mp3player -next + Function MySequence Sequence cpu mem xload + Function OtherSequence Sequence time cd xload + + Keypad keys can be bound to any _function_: + Key A mp3NextSong + Key B HaltSystem + Key C Menu + Key D Next/+ + Key E OtherSequence + +******************************************************************/ + +#endif +#endif // LCD diff -ruN VDR/vdr.c VDR-LCD/vdr.c --- VDR/vdr.c Sun Aug 26 17:02:00 2001 +++ VDR-LCD/vdr.c Mon Aug 27 13:19:03 2001 @@ -40,7 +40,9 @@ #include "recording.h" #include "tools.h" #include "videodir.h" - +#ifdef LCD // LCDproc +#include "lcd.h" +#endif // LCD #ifdef REMOTE_KBD #define KEYS_CONF "keys-pc.conf" #else @@ -51,6 +53,10 @@ static int Interrupted = 0; +#ifdef LCD // LCDproc +cLcd *LCDproc = new cLcd; +#endif // LCD + static void SignalHandler(int signum) { if (signum != SIGPIPE) @@ -70,6 +76,12 @@ { // Command line options: +#ifdef LCD // LCDproc; + unsigned int LCDprocPORT=LCDPORT; + bool LCDprocConnect=false; + char *LCDprocHOST=LCDHOST; +#endif // LCD + #define DEFAULTSVDRPPORT 2001 #define DEFAULTWATCHDOG 0 // seconds @@ -92,12 +104,14 @@ { "dvd", required_argument, NULL, 'V' }, { "watchdog", required_argument, NULL, 'w' }, { "terminal", required_argument, NULL, 't' }, + { "lcdh", required_argument, NULL, 'L' }, + { "lcdp", required_argument, NULL, 'P' }, { NULL } }; int c; int option_index = 0; - while ((c = getopt_long(argc, argv, "a:c:dD:E:hl:p:t:v:V:w:", long_options, &option_index)) != -1) { + while ((c = getopt_long(argc, argv, "a:c:dD:E:hl:p:t:v:V:w:L:P:", long_options, &option_index)) != -1) { switch (c) { case 'a': cDvbApi::SetAudioCommand(optarg); break; @@ -139,6 +153,10 @@ " -V DEV, --dvd=DEV use DEV as the DVD device (default: %s)\n" " -w SEC, --watchdog=SEC activate the watchdog timer with a timeout of SEC\n" " seconds (default: %d); '0' disables the watchdog\n" +#ifdef LCD // LCDproc + " -L HOST, --lcdh=HOST connect to a LCDd at HOST\n" + " -P PORT, --lcdp=PORT use PORT for LCDd (default: %d)\n" +#endif // LCD "\n" "Report bugs to \n", cSIProcessor::GetEpgDataFileName() ? cSIProcessor::GetEpgDataFileName() : "'-'", @@ -150,6 +168,9 @@ "no DVD support", #endif //DVDSUPPORT DEFAULTWATCHDOG +#ifdef LCD // LCDproc + ,LCDprocPORT +#endif // LCD ); return 0; break; @@ -198,6 +219,19 @@ fprintf(stderr, "vdr: invalid watchdog timeout: %s\n", optarg); return 2; break; +#ifdef LCD // LCDproc + case 'L': if (optarg && *optarg) { + LCDprocHOST=optarg; LCDprocConnect=true; + } else abort(); + break; + case 'P': if (isnumber(optarg)) + LCDprocPORT = atoi(optarg); + else { + fprintf(stderr, "vdr: invalid LCDport number: %s\n", optarg); + abort(); + } + break; +#endif // LCD default: return 2; } } @@ -252,6 +286,12 @@ Channels.Load(AddDirectory(ConfigDirectory, "channels.conf")); Timers.Load(AddDirectory(ConfigDirectory, "timers.conf")); Commands.Load(AddDirectory(ConfigDirectory, "commands.conf")); + +#ifdef LCD // LCDproc + if (LCDprocConnect && LCDproc->Connect(LCDprocHOST,LCDprocPORT) ) + isyslog(LOG_INFO, "connection to LCDd at %s:%d established.",LCDprocHOST,LCDprocPORT); +#endif // LCD + #if defined(REMOTE_LIRC) Keys.SetDummyValues(); #elif !defined(REMOTE_NONE) @@ -413,9 +453,21 @@ } break; // Menu Control: - case kMenu: Menu = new cMenuMain(ReplayControl); break; + case kMenu: Menu = new cMenuMain(ReplayControl); +#ifdef LCD // LCDproc + LCDproc->SetThreadState( (cLcd::ThreadStates) 0); +#endif // LCD + break; // Viewing Control: - case kOk: LastChannel = -1; break; // forces channel display + case kOk: +#ifdef LCD // LCDproc + LCDproc->Clear(3); +#endif // LCD + LastChannel = -1; // forces channel display +#ifdef LCD // LCDproc + LCDproc->SetThreadState( (cLcd::ThreadStates) 3); +#endif // LCD + break; default: break; } } @@ -438,6 +490,9 @@ Setup.Save(); cVideoCutter::Stop(); delete Menu; +#ifdef LCD // LCDproc + delete LCDproc; +#endif // LCD delete ReplayControl; delete Interface; cDvbApi::Cleanup();