summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Hammerschmid <linux@home.pages.at>2002-11-23 11:25:54 +0100
committerMartin Hammerschmid <linux@home.pages.at>2002-11-23 11:25:54 +0100
commitd4acf91a5ebc13da557af6a5388b9502df86148b (patch)
tree463a81d4c8b8ff0525bf7850e960d6f4d4d2c1e1
parent575800cfff3962e6beb609052668586a1a8e0b75 (diff)
downloadvdr-plugin-lcdproc-d4acf91a5ebc13da557af6a5388b9502df86148b.tar.gz
vdr-plugin-lcdproc-d4acf91a5ebc13da557af6a5388b9502df86148b.tar.bz2
-rw-r--r--Makefile2
-rw-r--r--README37
-rw-r--r--i18n.c18
-rw-r--r--lcd.c192
-rw-r--r--lcd.h2
-rw-r--r--lcdproc.c79
-rw-r--r--setup.c4
-rw-r--r--setup.h5
8 files changed, 307 insertions, 32 deletions
diff --git a/Makefile b/Makefile
index bc10e92..80ad3e9 100644
--- a/Makefile
+++ b/Makefile
@@ -43,7 +43,7 @@ OBJS = $(PLUGIN).o lcd.o sockets.o i18n.o setup.o
### The C++ compiler and options:
CXX = g++
-CXXFLAGS = -g -O2 -Wall -Woverloaded-virtual -m486
+CXXFLAGS = -g -O2 -Wall -Woverloaded-virtual
### Implicit rules:
diff --git a/README b/README
index 9f99182..1f7cb7a 100644
--- a/README
+++ b/README
@@ -18,6 +18,7 @@ Current channel info and menus are then displayed on the LCD too.
I had a 4x20 character display in mind but it should
work with 4x16 up to 4x40 and 2x40.
+2x16+ displays should work too but are NOT fully supported.
LCDd can be used in an xterm or console too, so it
might be useful even without having the hardware.
@@ -33,6 +34,42 @@ correctly, you can fix that by selecting a in the setup menu: (Charmap)
lcdkeyconf.h is used to configure the plugin for a keypad.
+Mattia Rossi <mattia@technologist.com> added support for the output pins
+that some Matrix Orbital displays have (lcdm001 and glk driver).
+So the card status among other things can be indecated by led.
+
+
+Brief description of the setup menue:
+
+FullCycle / TimeDateCycle
+ during recording the some displays toggle between time/date and card status
+ FullCycle (seconds) is the time for a complete cycle while
+ TimeDateCycle (seconds) is the duration where time/date is shown.
+
+VolumeKeep
+ ( 1/10 seconds ) how long the volume is shown on the display
+
+Scrollwait
+ ( 1/8 seconds ) duration before scrolling is started
+
+Scrollspeed
+ ( 1/8 seconds ) higher value means slower scrolling
+
+Charmap
+ see above.
+
+AltShift
+ when a keypad is used and a shiftkey is defined the type of shiftkey
+ indication ( done by LCDproc's 'heartbeat' ) can be changed.
+
+BackLight
+ backlight on/off
+
+OutputNumber
+ implemented by Mattia Rossi <mattia@technologist.com>
+ sets how many output pins should be used to indicate
+ states like on/off, card status, ...
+
LCDproc is available at http://lcdproc.omnipotent.net/
or here http://sourceforge.net/projects/lcdproc/
diff --git a/i18n.c b/i18n.c
index 3f06536..f9de73a 100644
--- a/i18n.c
+++ b/i18n.c
@@ -17,7 +17,7 @@ const tI18nPhrase Phrases[] = {
"No EPG info available.",// TODO
"No EPG info available.",// TODO
},
- { "Scanning for EPG info.",
+ { "Waiting for EPG info.",
"Suche nach EPG Information.",
"Scanning for EPG info.",// TODO
"Scanning for EPG info.",// TODO
@@ -161,5 +161,21 @@ const tI18nPhrase Phrases[] = {
"BackLight",// TODO
"BackLight",// TODO
},
+{ "Output Number",
+ "Output Number",// TODO
+ "Output Number",// TODO
+ "Output Number",// TODO
+ "Output Number",// TODO
+ "Output Number",// TODO
+ "Output Number",// TODO
+ "Output Number",// TODO
+ "Output Number",// TODO
+ "Output Number",// TODO
+ "Output Number",// TODO
+ "Output Number",// TODO
+ "Output Number",// TODO
+ "Output Number",// TODO
+ "Output Number",// TODO
+ },
{ NULL }
};
diff --git a/lcd.c b/lcd.c
index 0f7b623..7ce9b39 100644
--- a/lcd.c
+++ b/lcd.c
@@ -26,7 +26,7 @@
cLcd::cLcd() {
int i,j;
- connected=false; ThreadStateData.showvolume=false; ThreadStateData.newscroll=false; sock=wid=hgt=cellwid=cellhgt=0;
+ connected=false; ThreadStateData.showvolume=false; ThreadStateData.newscroll=false; sock=wid=hgt=cellwid=cellhgt=0;closing = false;
replayDvbApi=NULL; primaryDvbApi=NULL;
for (i=0;i<LCDMAXSTATES;i++) for (j=0;j<4;j++) {
@@ -53,6 +53,7 @@ bool cLcd::Connect( char *host, unsigned int port ) {
return connected=false;
}
+ ToggleMode=false;
sock_send_string(sock, "hello\n");
usleep(500000); // wait for a connect message
sock_recv(sock, istring, 1024);
@@ -65,7 +66,8 @@ 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 ( (hgt==2) && (wid>31) ) { connected = true; wid=wid/2; LineMode=0; } // 2x32-2x40
+ else if ( (hgt==2) && (wid>15) && (wid<32) ) { connected = true; ToggleMode=true; } // 2x16-2x31
if (!connected) { cLcd::Close(); return connected; }
sock_send_string(sock,"screen_add VDR\n"); sock_recv(sock, istring, 1024);
@@ -88,7 +90,17 @@ bool cLcd::Connect( char *host, unsigned int port ) {
}
void cLcd::Close() {
+ char istring[1024];
+ fprintf(stderr,"Close Called \n");
+ if (connected) {
+ closing = true;
+ sock_send_string(sock,"output off\n");
+ sock_recv(sock, istring, 1024);
+ sleep(1);
sock_close(sock);
+ }else{
+ fprintf(stderr,"Not Connected !!! \n");
+ }
connected=false; sock=wid=hgt=cellwid=cellhgt=0;
}
@@ -236,15 +248,23 @@ if (!connected) return;
cLcd::SetLine(Vol,2," ");
cLcd::SetLine(Vol,3," ");
} else {
- if (hgt==2) {
- cLcd::SetLine(Vol,0,"|---|---|---|---|---|---|---|---|---|---");
- cLcd::SetLine(Vol,3," ");
+ if (hgt==2) {
+ if (ToggleMode) {
+ cLcd::SetLine(Vol,0,"|---|---|---|---|---|---|---|---|---|---");
+ cLcd::SetLine(Vol,1," ");
+ } else {
+ cLcd::SetLine(Vol,0,"|---|---|---|---|---|---|---|---|---|---");
+ cLcd::SetLine(Vol,3," ");
+ cLcd::SetLine(Vol,1,"|---|---|---|---|---|---|---|---|---|---");
+ cLcd::SetLine(Vol,2," ");
+ }
} else {
cLcd::SetLine(Vol,0,tr("Volume "));
cLcd::SetLine(Vol,3,"|---|---|---|---|---|---|---|---|---|---");
+ cLcd::SetLine(Vol,1,"|---|---|---|---|---|---|---|---|---|---");
+ cLcd::SetLine(Vol,2," ");
}
- cLcd::SetLine(Vol,1,"|---|---|---|---|---|---|---|---|---|---");
- cLcd::SetLine(Vol,2," ");
+
}
}
@@ -266,9 +286,9 @@ void cLcd::SetProgress(const char *begin, const char *end, int percent) {
sprintf(workstring,"%s", begin);
memset(workstring+beginw,' ',wid-beginw-endw);
sprintf(workstring+wid-endw,"%s", end);
- cLcd::SetLine(LCDREPLAY,3,workstring);
+ cLcd::SetLine(LCDREPLAY,(ToggleMode)?0:3,workstring);
BeginMutualExclusion();
- ThreadStateData.barx=beginw+1+((hgt==2)?wid:0);
+ ThreadStateData.barx=beginw+1+((hgt==2 && !ToggleMode)?wid:0);
ThreadStateData.bary=((hgt==2)?1:4);
ThreadStateData.barl=(percent*cellwid*(wid-beginw-endw))/100;
EndMutualExclusion();
@@ -336,7 +356,6 @@ void cLcd::SetRunning( bool nownext, const char *string1, const char *string2, c
ThreadStateData.lcdfullbuffer[LCDTITLE][i++]='*';
ThreadStateData.lcdfullbuffer[LCDTITLE][i++]=' ';
ThreadStateData.lcdfullbuffer[LCDTITLE][i]='\0';
- ThreadStateData.newscroll=true;
EndMutualExclusion();
cLcd::SetBuffer(LCDMISC,ThreadStateData.lcdbuffer[LCDTITLE][2],ThreadStateData.lcdbuffer[LCDTITLE][3],NULL,NULL);
}
@@ -456,11 +475,22 @@ void cLcd::Split(char *string, char *string1, char *string2) {
unsigned int i,j,k,ofs;
- if ( (hgt>2 && strlen(string) < 2*wid) && strlen(string) > wid ) { // beautification ..
+ if ( hgt>2 && ( strlen(string) < 2*wid) && isdigit(string[0]) && isdigit(string[1]) // beautification ..
+ && string[2]==':' && isdigit(string[3]) && isdigit(string[4]) ) {
+ char *tmpptr=strpbrk(string,"|");
+ if ( ( tmpptr != NULL ) && (ofs=tmpptr-string)<wid && wid-(ofs+1)<2*wid-(j=strlen(string)) ) {
+ ofs=wid-(ofs+1);
+ string[j+ofs]='\0';
+ for (i=j+ofs-1; i>=wid-ofs;i--) string[i]=string[i-ofs];
+ for (i=wid-ofs-1;i<wid;i++) string[i]=' ';
+ }
+ }
+
+ if ( hgt>2 && ( strlen(string) < 2*wid) && ( strlen(string) >= wid ) ) { // beautification ..
if (isalpha(string[wid-1]) && isalpha(string[wid]) ) {
j=strlen(string);
- for (i=wid-1; (i>0) && (string[i]!=' ') && (string[i]!='|') && (string[i]!=',')
+ for (i=wid-1; (i>0) && (string[i]!=' ') && (string[i]!='|') && (string[i]!=',') && (string[i]!=')')
&& (string[i]!='-') && (string[i]!='.') && (string[i]!=':') ; i-- ) {}
if ( ( (2*wid-j) >= (ofs=wid-(i+1)) ) && ofs+j <= 2*wid ) {
@@ -471,12 +501,14 @@ void cLcd::Split(char *string, char *string1, char *string2) {
}
- if ( (j=strlen(string)) < 2*wid && isdigit(string[0]) && isdigit(string[1]) &&
+ if ( (j=strlen(string)) < 2*wid && isdigit(string[0]) && isdigit(string[1]) &&
string[2]==':' && isdigit(string[3]) && isdigit(string[4]) ) {
ofs=2*wid-strlen(string); ofs=(ofs>6)?6:ofs;
+ if (string[wid]=='|') string[wid]=' ';
+ if (ofs==6 && string[wid]==' ') ofs--;
string[j+ofs]='\0';
for (i=j+ofs-1; i>=wid+ofs;i--) string[i]=string[i-ofs];
- for (i=wid;i<wid+ofs;i++) string[i]=' ';
+ for (i=wid;i<wid+ofs;i++) string[i]=' ';
}
}
@@ -493,7 +525,10 @@ void cLcd::Write(int line, const char *string) { // used for any text output to
char workstring[256];
unsigned int i,out;
- if (hgt > 2) {
+
+ if (ToggleMode && (line > 2)) return;
+
+ if (ToggleMode || 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 );
@@ -542,7 +577,7 @@ void cLcd::GetTimeDateStat( char *string, unsigned int OutStateData[] ) {
#define WakeUpCycle 125000 // us
void cLcd::Action(void) { // LCD output thread
- unsigned int i,j, barx=1, bary=1, barl=0, ScrollState=0, ScrollLine=1;
+ unsigned int i,j, barx=1, bary=1, barl=0, ScrollState=0, ScrollLine=1, lasttitlelen=0;
int Current=0, Total=1, scrollpos=0, scrollcnt=0, scrollwaitcnt=10, lastAltShift=0, lastBackLight;
struct timeval now, voltime;
char workstring[256];
@@ -562,7 +597,30 @@ void cLcd::Action(void) { // LCD output thread
cLcd::Write(2,"--------------------\0");
cLcd::Write(3,"Video Disk Recorder\0");
cLcd::Write(4,"Version: "VDRVERSION"\0");
- sleep(5); bool volume=false; OutStateData.showvolume=false; ThreadStateData.showvolume=false;
+
+ // Output init
+ if (LcdSetup.OutputNumber > 0){
+ char lcdCommand[100];
+
+ for (int o=0; o < LcdSetup.OutputNumber; o++){
+ sprintf(lcdCommand,"output %d\n",1 << o);
+ sock_send_string(sock,lcdCommand);
+ usleep(150000);
+ }
+ for (int o= LcdSetup.OutputNumber-1; o >= 0; o--){
+ sprintf(lcdCommand,"output %d\n",1 << o);
+ sock_send_string(sock,lcdCommand);
+ usleep(150000);
+ }
+ sprintf(lcdCommand,"output on\n");
+ sock_send_string(sock,lcdCommand);
+ usleep(500000);
+ sprintf(lcdCommand,"output off\n");
+ sock_send_string(sock,lcdCommand);
+ }
+
+
+ sleep(3); bool volume=false; OutStateData.showvolume=false; ThreadStateData.showvolume=false;
if (primaryDvbApi) for (int k=0; k<primaryDvbApi->NumDevices() ; k++) SetCardStat(k,1);
@@ -637,17 +695,31 @@ void cLcd::Action(void) { // LCD output thread
ScrollState=LCDMENU; ScrollLine=1;
break;
case Title:
- ScrollState=LCDTITLE; ScrollLine=2;
+ if (!ToggleMode) {
+ ScrollState=LCDTITLE; ScrollLine=2;
+ } else {
+ ScrollState=LCDTITLE; ScrollLine=1;
+ char tmpbuffer[1024];
+ strcpy(tmpbuffer,OutStateData.lcdbuffer[LCDTITLE][1]);
+ strcat(tmpbuffer," * ");
+ strcat(tmpbuffer, OutStateData.lcdfullbuffer[ScrollState]);
+ strcpy(OutStateData.lcdfullbuffer[ScrollState],tmpbuffer);
+ strncpy(OutStateData.lcdbuffer[LCDTITLE][1],OutStateData.lcdfullbuffer[ScrollState],wid);
+ }
+ if ( strlen(OutStateData.lcdfullbuffer[ScrollState]) != lasttitlelen ) {
+ lasttitlelen=strlen(OutStateData.lcdfullbuffer[ScrollState]);
+ scrollpos=0; scrollwaitcnt=LcdSetup.Scrollwait; ThreadStateData.newscroll=false;
+ }
break;
default:
break;
}
- if ( ( strlen(OutStateData.lcdfullbuffer[ScrollState]) > (2*wid+3) )
+ if ( ( strlen(OutStateData.lcdfullbuffer[ScrollState]) > (((ToggleMode)?1:2)*wid+3) )
&& ( (scrollpos) || !(scrollwaitcnt=(scrollwaitcnt+1)%LcdSetup.Scrollwait) ) ) {
if ( !(scrollcnt=(scrollcnt+1)%LcdSetup.Scrollspeed) ) {
scrollpos=(scrollpos+1)%strlen(OutStateData.lcdfullbuffer[ScrollState]);
- if ( scrollpos==1 ) scrollwaitcnt=1;
+ if ( scrollpos==1 ) scrollwaitcnt=0;
for (i=0; i<wid; i++) {
OutStateData.lcdbuffer[ScrollState][ScrollLine][i]=
OutStateData.lcdfullbuffer[ScrollState][(scrollpos+i)%strlen(OutStateData.lcdfullbuffer[ScrollState])];
@@ -707,12 +779,12 @@ void cLcd::Action(void) { // LCD output thread
case Replay: // Display date/time during replaying = 2
LineMode=1;
- if ( (now.tv_usec < WakeUpCycle) || (PrevState != Replay) ) {
+ if ( !ToggleMode && ((now.tv_usec < WakeUpCycle) || (PrevState != Replay)) ) {
cLcd::GetTimeDateStat(workstring,OutStateData.CardStat);
cLcd::Write(1,workstring);
}
if (PrevState != Replay) { scrollpos=0; for (i=1;i<4;i++) Lcddirty[LCDREPLAY][i]=true; }
- for (i=1;i<4;i++) if (Lcddirty[LCDREPLAY][i]) {
+ for (i=(ToggleMode)?0:1;i<4;i++) if (Lcddirty[LCDREPLAY][i]) {
cLcd::Write(i+1,OutStateData.lcdbuffer[LCDREPLAY][i]);
Lcddirty[LCDREPLAY][i]=false;
}
@@ -770,6 +842,16 @@ void cLcd::Action(void) { // LCD output thread
sock_send_string(sock,"screen_set VDR -heartbeat heart\n");
}
+
+
+ if ( LcdMaxKeys && (lastAltShift != LcdSetup.AltShift) ) {
+ lastAltShift=LcdSetup.AltShift;
+ if (lastAltShift)
+ sock_send_string(sock,"screen_set VDR -heartbeat slash\n");
+ else
+ sock_send_string(sock,"screen_set VDR -heartbeat heart\n");
+ }
+
workstring[0]='\0'; sock_recv(sock, workstring, 256);
if ( LcdMaxKeys && ( strlen(workstring) > 4 ) ) {
for (i=0; i < (strlen(workstring)-4); i++ ) {
@@ -797,6 +879,72 @@ void cLcd::Action(void) { // LCD output thread
}
}
+ // Output
+
+ int OutValue = 0;
+ char lcdCommand[100];
+ if (!closing){
+ if (LcdSetup.OutputNumber > 0){
+ for (int o=0; o < LcdSetup.OutputNumber; o++){
+ switch(LcdSetup.OutputFunction[o]){
+ case 0: // Off
+ break;
+ case 1: // On
+ OutValue += 1 << o;
+ break;
+ case 2: // Recording DVB 1
+ if (OutStateData.CardStat[0] == 2)
+ OutValue += 1 << o;
+ break;
+ case 3: // Recording DVB 2
+ if (OutStateData.CardStat[1] == 2)
+ OutValue += 1 << o;
+ break;
+ case 4: // Recording DVB 3
+ if (OutStateData.CardStat[2] == 2)
+ OutValue += 1 << o;
+ break;
+ case 5: // Recording DVB 4
+ if (OutStateData.CardStat[3] == 2)
+ OutValue += 1 << o;
+ break;
+ case 6: // Replay
+ if (OutStateData.State == Replay)
+ OutValue += 1 << o;
+ break;
+ case 7: // DVD
+ if ( (OutStateData.State == Replay) && (!strncmp(OutStateData.lcdfullbuffer[LCDREPLAY],"DVD", 3)))
+ OutValue += 1 << o;
+ break;
+ case 8: // Mplayer
+ break;
+ case 9: // MP3
+ if ( (OutStateData.State == Replay) && OutStateData.lcdfullbuffer[LCDREPLAY][0]=='[' &&
+ OutStateData.lcdfullbuffer[LCDREPLAY][3]==']' &&
+ (OutStateData.lcdfullbuffer[LCDREPLAY][1]=='.' || OutStateData.lcdfullbuffer[LCDREPLAY][1]=='L' ) &&
+ (OutStateData.lcdfullbuffer[LCDREPLAY][2]=='.' || OutStateData.lcdfullbuffer[LCDREPLAY][2]=='S' )
+ )
+ OutValue += 1 << o;
+ break;
+ case 10: // Mplayer + MP3
+ // Until I find a better solution any replay that is not a DVD is flagged as Mplayer-Mp3
+ if ( (OutStateData.State == Replay) && (strncmp(OutStateData.lcdfullbuffer[LCDREPLAY],"DVD",3))!= 0)
+ OutValue += 1 << o;
+ break;
+ case 11: // User1
+ break;
+ case 12: // User2
+ break;
+ case 13: // User3
+ break;
+ default:
+ ;
+ }
+ }
+ sprintf(lcdCommand,"output %d\n",OutValue);
+ sock_send_string(sock,lcdCommand);
+ }
+ }
usleep(WakeUpCycle-(now.tv_usec%WakeUpCycle)); // sync to systemtime for nicer time output
}
}
diff --git a/lcd.h b/lcd.h
index fe7aa07..947c64c 100644
--- a/lcd.h
+++ b/lcd.h
@@ -22,6 +22,7 @@ class cLcd : public cThread {
enum ThreadStates {Menu=0, Title=1, Replay=2, Misc=3, Vol=4};
ThreadStates LastState[LCDMAXSTATEBUF];
int LastStateP,LineMode;
+ bool ToggleMode;
struct StateData {
char lcdbuffer[LCDMAXSTATES][4][LCDMAXWID+1];
char lcdfullbuffer[LCDMAXSTATES][LCDMAXFULLSTRING];
@@ -73,6 +74,7 @@ class cLcd : public cThread {
void Write(int line, const char *string);
void GetTimeDateStat( char *string, unsigned int OutStateData[] );
void Action(void);
+ int closing ;
};
#endif //__LCD_H
diff --git a/lcdproc.c b/lcdproc.c
index 4fbcbef..574169c 100644
--- a/lcdproc.c
+++ b/lcdproc.c
@@ -16,7 +16,7 @@
#include "lcd.h"
#include "lcdtranstbl.h"
-static const char *VERSION = "0.0.6";
+static const char *VERSION = "0.0.7";
static const char *MAINMENUENTRY = NULL;
static const char *DESCRIPTION = "LCDproc output";
@@ -30,6 +30,21 @@ char tempstringbuffer[80];
char *LCDprocHOST=LCDHOST;
unsigned int LCDprocPORT=LCDPORT;
+static const char * OutputFunctionText[]= {"Off",
+ "On",
+ "Recording DVB1",
+ "Recording DVB2",
+ "Recording DVB3",
+ "Recording DVB4",
+ "Replay",
+ "DVD",
+ "MPlayer",
+ "MP3",
+ "MPlayer + MP3",
+ "User1",
+ "User2",
+ "User3"};
+
// ---
class cLcdFeed : public cStatus {
@@ -52,13 +67,15 @@ protected:
void cLcdFeed::ChannelSwitch(const cDevice *Device, int ChannelNumber)
{
//syslog(LOG_INFO, "lcdproc: cLcdFeed::ChannelSwitch %d %d", Device->CardIndex(), ChannelNumber);
- if (ChannelNumber) {
- LCDproc->SetLine(1,2," ");
- LCDproc->SetLine(1,3," ");
- LCDproc->SetRunning(false,tr("Scanning for EPG info."), NULL);
- switched = true;
- } else switched = false;
- if (Device) LCDproc->SetPrimaryDevice( (cDevice *) Device );
+ if ( Device && Device->IsPrimaryDevice() ) {
+ if (ChannelNumber) {
+ LCDproc->SetLine(1,2," ");
+ LCDproc->SetLine(1,3," ");
+ LCDproc->SetRunning(false,tr("Waiting for EPG info."), NULL);
+ switched = true;
+ } else switched = false;
+ LCDproc->SetPrimaryDevice( (cDevice *) Device );
+ }
}
void cLcdFeed::Recording(const cDevice *Device, const char *Name)
@@ -294,8 +311,32 @@ class cMenuSetupLcd : public cMenuSetupPage {
cMenuSetupLcd(void);
};
+// --- cMenuEditStraTrItem -----------------------------------------------------
+
+class cMenuEditStraTrItem : public cMenuEditIntItem {
+private:
+ const char * const *strings;
+protected:
+ virtual void Set(void);
+public:
+ cMenuEditStraTrItem(const char *Name, int *Value, int NumStrings, const char * const *Strings);
+ };
+
+cMenuEditStraTrItem::cMenuEditStraTrItem(const char *Name, int *Value, int NumStrings, const char * const *Strings)
+:cMenuEditIntItem(Name, Value, 0, NumStrings - 1)
+{
+ strings = Strings;
+ Set();
+}
+
+void cMenuEditStraTrItem::Set(void)
+{
+ SetValue(strings[*value]);
+}
+
cMenuSetupLcd::cMenuSetupLcd(void)
{
+ char str2[30];
newLcdSetup=LcdSetup;
Add(new cMenuEditIntItem( tr("FullCycle"), &newLcdSetup.FullCycle,LcdSetup.TimeCycle,999));
Add(new cMenuEditIntItem( tr("TimeDateCycle"), &newLcdSetup.TimeCycle,0,LcdSetup.FullCycle));
@@ -305,10 +346,16 @@ cMenuSetupLcd::cMenuSetupLcd(void)
Add(new cMenuEditIntItem( tr("Charmap"), &newLcdSetup.Charmap,0,LCDMAXTRANSTBL-1 ));
Add(new cMenuEditBoolItem( tr("AltShift"), &newLcdSetup.AltShift));
Add(new cMenuEditBoolItem( tr("BackLight"), &newLcdSetup.BackLight));
+ Add(new cMenuEditIntItem( tr("OutputNumber"), &newLcdSetup.OutputNumber));
+ for (int i =0 ; i < newLcdSetup.OutputNumber; i++){
+ sprintf(str2,"OutputNumber %d",i);
+ Add(new cMenuEditStraTrItem( tr(str2), &newLcdSetup.OutputFunction[i],14, OutputFunctionText));
+ }
}
void cMenuSetupLcd::Store(void)
{
+ char str2[30];
SetupStore("FullCycle", LcdSetup.FullCycle = newLcdSetup.FullCycle);
SetupStore("TimeCycle", LcdSetup.TimeCycle = newLcdSetup.TimeCycle);
SetupStore("VolumeKeep", LcdSetup.VolumeKeep = newLcdSetup.VolumeKeep);
@@ -317,6 +364,11 @@ void cMenuSetupLcd::Store(void)
SetupStore("Charmap", LcdSetup.Charmap = newLcdSetup.Charmap);
SetupStore("AltShift", LcdSetup.AltShift = newLcdSetup.AltShift);
SetupStore("BackLight", LcdSetup.BackLight = newLcdSetup.BackLight);
+ SetupStore("OutputNumber", LcdSetup.OutputNumber = newLcdSetup.OutputNumber);
+ for (int i =0 ; i < newLcdSetup.OutputNumber; i++){
+ sprintf(str2,"OutputNumber %d",i);
+ SetupStore(str2, LcdSetup.OutputFunction[i] = newLcdSetup.OutputFunction[i]);
+ }
}
@@ -337,6 +389,17 @@ bool cPluginLcd::SetupParse(const char *Name, const char *Value)
else if (!strcasecmp(Name, "Charmap")) LcdSetup.Charmap = atoi(Value);
else if (!strcasecmp(Name, "AltShift")) LcdSetup.AltShift = atoi(Value);
else if (!strcasecmp(Name, "BackLight")) LcdSetup.BackLight = atoi(Value);
+ else if (!strcasecmp(Name, "OutputNumber")) LcdSetup.OutputNumber = atoi(Value);
+ else if (!strcasecmp(Name, "OutputNumber 0")) LcdSetup.OutputFunction[0] = atoi(Value);
+ else if (!strcasecmp(Name, "OutputNumber 1")) LcdSetup.OutputFunction[1] = atoi(Value);
+ else if (!strcasecmp(Name, "OutputNumber 2")) LcdSetup.OutputFunction[2] = atoi(Value);
+ else if (!strcasecmp(Name, "OutputNumber 3")) LcdSetup.OutputFunction[3] = atoi(Value);
+ else if (!strcasecmp(Name, "OutputNumber 4")) LcdSetup.OutputFunction[4] = atoi(Value);
+ else if (!strcasecmp(Name, "OutputNumber 5")) LcdSetup.OutputFunction[5] = atoi(Value);
+ else if (!strcasecmp(Name, "OutputNumber 6")) LcdSetup.OutputFunction[6] = atoi(Value);
+ else if (!strcasecmp(Name, "OutputNumber 7")) LcdSetup.OutputFunction[7] = atoi(Value);
+ else if (!strcasecmp(Name, "OutputNumber 8")) LcdSetup.OutputFunction[8] = atoi(Value);
+ else if (!strcasecmp(Name, "OutputNumber 9")) LcdSetup.OutputFunction[9] = atoi(Value);
else
return false;
return true;
diff --git a/setup.c b/setup.c
index 51df783..6877dbd 100644
--- a/setup.c
+++ b/setup.c
@@ -12,4 +12,8 @@ cLcdSetup::cLcdSetup(void)
Charmap = 0;
AltShift = 0;
BackLight = 1;
+ OutputNumber = 0;
+ for (int i = 0; i < LCDMAXOUTPUTS; i++)
+ OutputFunction[i] = 0;
}
+
diff --git a/setup.h b/setup.h
index 1fbe9d6..5fec4c1 100644
--- a/setup.h
+++ b/setup.h
@@ -1,6 +1,8 @@
#ifndef LCD_SETUP_H
#define LCD_SETUP_H
+#define LCDMAXOUTPUTS 10
+
class cLcdSetup {
public:
int FullCycle;
@@ -11,10 +13,13 @@ public:
int Charmap;
int AltShift;
int BackLight;
+ int OutputNumber;
+ int OutputFunction[LCDMAXOUTPUTS];
public:
cLcdSetup(void);
};
+
extern cLcdSetup LcdSetup;
#endif