Re: How to customize lcdproc for vdr ?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Am Sonntag, 20. Mai 2007 schrieb kafifi:
> Hello,
>
> I am using vdr-1.4.7, and vdr-lcdproc-0.0.10-jw2, to drive a 16x2
> characters imon VFD module.
>
> The display is really nice, but 16x2 isn't enough to display all datas. I
> would customize lcdproc to
> remove all EPG informations, and display only time, channel number and
> channel name.
>
> Could someone help me to do this customization ?
>
> Thanks a lot.


Hi,

I have a 2x20 LC display and once made this patch. It introduces a new 
option "show time" whice you can disable to have more useful information on 
your display.

S.
diff -ur lcdproc-0.0.10-jw2.org/i18n.c lcdproc-0.0.10-jw2/i18n.c
--- lcdproc-0.0.10-jw2.org/i18n.c	2006-11-12 22:12:11.000000000 +0100
+++ lcdproc-0.0.10-jw2/i18n.c	2007-03-07 13:18:53.000000000 +0100
@@ -368,5 +368,23 @@
     "BackLightWait",
     "BackLightWait",    
   },
+  {
+    "Show time",
+    "Zeit anzeigen",
+    "Show time",
+    "Show time",
+    "Show time",
+    "Show time",
+    "Show time",
+    "Show time",
+    "Show time",
+    "Show time",
+    "Show time",
+    "Show time",
+    "Show time",
+    "Show time",
+    "Show time",
+    "Show time",
+  },  
   { NULL }
   };
diff -ur lcdproc-0.0.10-jw2.org/lcd.c lcdproc-0.0.10-jw2/lcd.c
--- lcdproc-0.0.10-jw2.org/lcd.c	2006-11-12 19:38:44.000000000 +0100
+++ lcdproc-0.0.10-jw2/lcd.c	2007-03-08 13:19:23.000000000 +0100
@@ -646,10 +646,10 @@
   lastPrioN=LcdSetup.ClientPrioN;
       
   syslog(LOG_INFO, "LCD output thread started (pid=%d), display size: %dx%d", getpid(),hgt,wid);
-  cLcd::Write(1," Welcome  to  V D R\0"); 
-  cLcd::Write(2,"--------------------\0"); 
-  cLcd::Write(3,"Video Disk Recorder\0"); 
-  cLcd::Write(4,"Version: "VDRVERSION"\0"); 
+  cLcd::Write(LcdSetup.ShowTime?1:4," Welcome  to  V D R\0"); 
+  cLcd::Write(LcdSetup.ShowTime?2:3,"--------------------\0");
+  cLcd::Write(LcdSetup.ShowTime?3:1,"Video Disk Recorder\0");
+  cLcd::Write(LcdSetup.ShowTime?4:2,"Version: "VDRVERSION"\0");
 
   // Output init
   if (LcdSetup.OutputNumber > 0){
@@ -828,19 +828,22 @@
 	  ScrollState=LCDMENU;   ScrollLine=1;	
 	break;  	
 	case Title:
+	  ScrollState=LCDTITLE;
 	  if (!ToggleMode) {
-	    ScrollState=LCDTITLE;  ScrollLine=2;
+	    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);	    
+	    ScrollLine=1;
+	    if (LcdSetup.ShowTime) {
+	      char tmpbuffer[1024];
+	      strcpy(tmpbuffer,OutStateData.lcdbuffer[LCDTITLE][1]);
+	      strcat(tmpbuffer," * ");
+	      strcat(tmpbuffer, OutStateData.lcdfullbuffer[LCDTITLE]);
+	      strcpy(OutStateData.lcdfullbuffer[LCDTITLE],tmpbuffer);
+            }
+            strncpy(OutStateData.lcdbuffer[LCDTITLE][1],OutStateData.lcdfullbuffer[LCDTITLE],wid);
 	  }
-          if ( strlen(OutStateData.lcdfullbuffer[ScrollState]) != lasttitlelen ) {
-	    lasttitlelen=strlen(OutStateData.lcdfullbuffer[ScrollState]);
+          if ( strlen(OutStateData.lcdfullbuffer[LCDTITLE]) != lasttitlelen ) {
+	    lasttitlelen=strlen(OutStateData.lcdfullbuffer[LCDTITLE]);
             scrollpos=0; scrollwaitcnt=LcdSetup.Scrollwait; ThreadStateData.newscroll=false;	    
           }		  
 	break;  	
@@ -865,7 +868,7 @@
           OutStateData.lcdbuffer[ScrollState][ScrollLine+1][wid]='\0';
           Lcddirty[ScrollState][ScrollLine]=Lcddirty[ScrollState][ScrollLine+1]=true; 
 	}
-      }	    
+      } else if (!LcdSetup.ShowTime) Lcddirty[LCDTITLE][1]=true;
     }
 
     // volume  
@@ -902,12 +905,12 @@
 
       case Title: // Display 'titlescsreen' = 1
         LineMode=0;
-        if ( (now.tv_usec < WakeUpCycle) || (PrevState != Title) ) { 
+	if ( (LcdSetup.ShowTime) && ( (now.tv_usec < WakeUpCycle) || (PrevState != Title) ) ) { 
           cLcd::GetTimeDateStat(workstring,OutStateData.CardStat);
           cLcd::Write(1,workstring);
-        } 
-        if (PrevState != Title) for (i=1;i<4;i++) Lcddirty[LCDTITLE][i]=true;
-        for (i=1;i<4;i++) if (Lcddirty[LCDTITLE][i]) { 
+        }
+        if (PrevState != Title) for (i=LcdSetup.ShowTime?1:0;i<4;i++) Lcddirty[LCDTITLE][i]=true;
+        for (i=LcdSetup.ShowTime?1:0;i<4;i++) if (Lcddirty[LCDTITLE][i]) { 
           cLcd::Write(i+1,OutStateData.lcdbuffer[LCDTITLE][i]); 
           Lcddirty[LCDTITLE][i]=false; 
         }
diff -ur lcdproc-0.0.10-jw2.org/lcdproc.c lcdproc-0.0.10-jw2/lcdproc.c
--- lcdproc-0.0.10-jw2.org/lcdproc.c	2006-11-15 14:39:28.000000000 +0100
+++ lcdproc-0.0.10-jw2/lcdproc.c	2007-03-07 13:33:03.000000000 +0100
@@ -97,7 +97,7 @@
   } else {
     LCDproc->SetReplayDevice(NULL); 
     LCDproc->SetProgress(NULL);
-    LCDproc->SetLineC(1,1,tempstringbuffer); 
+    LCDproc->SetLineC(1,LcdSetup.ShowTime?1:0,tempstringbuffer); 
     LCDproc->SetThreadState( (cLcd::ThreadStates) 1); // Title
   }
   menumode=false; 
@@ -118,7 +118,7 @@
   else 
     LCDproc->SetThreadState( (cLcd::ThreadStates) 1); // Title
   menumode=false;
-  if (group) {LCDproc->SetLineC(1,1,tempstringbuffer); group=false; } 
+  if (group) {LCDproc->SetLineC(1,LcdSetup.ShowTime?1:0,tempstringbuffer); group=false; } 
 }
 
 void cLcdFeed::OsdTitle(const char *Title)
@@ -170,7 +170,7 @@
 void cLcdFeed::OsdChannel(const char *Text)
 {
   //syslog(LOG_INFO, "lcdproc: cLcdFeed::OsdChannel %s", Text);
-  LCDproc->SetLineC(1,1,Text);
+  LCDproc->SetLineC(1,LcdSetup.ShowTime?1:0,Text);
 
   bool switching = group = !isdigit(Text[0]);
   if (!group) strcpy(tempstringbuffer,Text); 
@@ -365,6 +365,7 @@
     Add(new cMenuEditStraTrItem( str2, &newLcdSetup.OutputFunction[i],14, OutputFunctionText));
   }
   Add(new cMenuEditStraItem( tr("Recording status"),   &newLcdSetup.RecordingStatus, 2, RecordingStatusText));
+  Add(new cMenuEditBoolItem( tr("Show time"),          &newLcdSetup.ShowTime));
 }
 
 void cMenuSetupLcd::Store(void)
@@ -388,6 +389,7 @@
     SetupStore(str2,   LcdSetup.OutputFunction[i]   = newLcdSetup.OutputFunction[i]);
   }
   SetupStore("RecordingStatus", LcdSetup.RecordingStatus = newLcdSetup.RecordingStatus);  
+  SetupStore("ShowTime", LcdSetup.ShowTime = newLcdSetup.ShowTime);
 }
 
 
@@ -424,6 +426,7 @@
   else if (!strcasecmp(Name, "OutputNumber 8")) LcdSetup.OutputFunction[8]   = atoi(Value);
   else if (!strcasecmp(Name, "OutputNumber 9")) LcdSetup.OutputFunction[9]   = atoi(Value);
   else if (!strcasecmp(Name, "RecordingStatus")) LcdSetup.RecordingStatus   = atoi(Value);
+  else if (!strcasecmp(Name, "ShowTime")) LcdSetup.ShowTime = atoi(Value);
   else
   return false;
   return true;
diff -ur lcdproc-0.0.10-jw2.org/README lcdproc-0.0.10-jw2/README
--- lcdproc-0.0.10-jw2.org/README	2006-11-12 19:59:31.000000000 +0100
+++ lcdproc-0.0.10-jw2/README	2007-03-08 13:15:54.000000000 +0100
@@ -78,6 +78,10 @@
   configures whether the recording status is displayed "detailed" 
   (for every dvb card) or only "simple".
 
+ShowTime
+  implemented by Sebastian Frei <sebastian@xxxxxxxxxxxxxxxxx>
+  disable this if you have a small display and don't want to have
+  the time displayed in the top line
 
 LCDproc is available at http://lcdproc.omnipotent.net/
 or here http://sourceforge.net/projects/lcdproc/
diff -ur lcdproc-0.0.10-jw2.org/setup.c lcdproc-0.0.10-jw2/setup.c
--- lcdproc-0.0.10-jw2.org/setup.c	2006-11-12 20:25:11.000000000 +0100
+++ lcdproc-0.0.10-jw2/setup.c	2007-03-07 13:13:45.000000000 +0100
@@ -20,5 +20,6 @@
   for (int i = 0; i < LCDMAXOUTPUTS; i++)
     OutputFunction[i] = 0;
   RecordingStatus = 0;
+  ShowTime = 1;
 }
 
diff -ur lcdproc-0.0.10-jw2.org/setup.h lcdproc-0.0.10-jw2/setup.h
--- lcdproc-0.0.10-jw2.org/setup.h	2006-11-12 20:26:25.000000000 +0100
+++ lcdproc-0.0.10-jw2/setup.h	2007-03-07 13:34:52.000000000 +0100
@@ -20,6 +20,7 @@
   int OutputNumber;
   int OutputFunction[LCDMAXOUTPUTS];
   int RecordingStatus;
+  int ShowTime;
 public:
   cLcdSetup(void);
   };
_______________________________________________
vdr mailing list
vdr@xxxxxxxxxxx
http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr

[Index of Archives]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Util Linux NG]     [Xfree86]     [Big List of Linux Books]     [Fedora Users]     [Fedora Women]     [ALSA Devel]     [Linux USB]

  Powered by Linux