summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoachim Wilke <vdr@joachim-wilke.de>2009-03-07 00:00:00 +0100
committerJoachim Wilke <vdr@joachim-wilke.de>2009-03-07 00:00:00 +0100
commitdd480d3431b3507af78e54a6e12e0421d6ed58f4 (patch)
tree87e0bf88262848d1425531a173c569d7266243a1
parent620a9d6b6edd1e96e76d81088dff03c17393bb52 (diff)
downloadvdr-plugin-lcdproc-release/v0.0.10-jw7.tar.gz
vdr-plugin-lcdproc-release/v0.0.10-jw7.tar.bz2
-rw-r--r--HISTORY11
-rw-r--r--SHF_EPG_3.diff258
-rw-r--r--lcd.c436
-rw-r--r--lcdproc.c91
-rw-r--r--po/de_DE.po56
-rw-r--r--po/it_IT.po57
-rw-r--r--setup.c15
-rw-r--r--setup.h1
8 files changed, 361 insertions, 564 deletions
diff --git a/HISTORY b/HISTORY
index f116c14..fb76d37 100644
--- a/HISTORY
+++ b/HISTORY
@@ -74,4 +74,13 @@ VDR Plugin 'lcdproc' Revision History
(provided by Diego Pierotto <vdr-italian@tiscali.it>)
- fixed missing translation in po/pot files for PrioWait, etc.
(reported by Diego Pierotto <vdr-italian@tiscali.it>)
- \ No newline at end of file
+
+2009-03-07: Version 0.0.10-jw7
+- fixed a segfault when shutting down
+ (patch provided by Hanno <http://www.vdr-portal.de/board/profile.php?userid=10607>)
+- optimized display with 2-line LCDs
+ (patch provided by SHF <http://vdrportal.de/board/profile.php?userid=9031>)
+- added a setup option to decide whether displaying the subtitle
+ (based on a patch provided by SHF <http://vdrportal.de/board/profile.php?userid=9031>)
+- fixed a missing update of lastUserActivity
+ (patch provided by SHF <http://vdrportal.de/board/profile.php?userid=9031>)
diff --git a/SHF_EPG_3.diff b/SHF_EPG_3.diff
deleted file mode 100644
index f13ea23..0000000
--- a/SHF_EPG_3.diff
+++ /dev/null
@@ -1,258 +0,0 @@
-diff -rupbB ./lcdproc.c ../lcdproc-0.0.10.SHF-volume/lcdproc.c
---- ./lcdproc.c 2008-05-27 00:03:09.000000000 +0200
-+++ ../lcdproc-0.0.10.SHF-volume/lcdproc.c 2007-12-13 21:41:06.000000000 +0100
-@@ -61,7 +61,7 @@ protected:
- virtual void OsdCurrentItem(const char *Text);
- virtual void OsdTextItem(const char *Text, bool Scroll);
- virtual void OsdChannel(const char *Text);
-- virtual void OsdProgramme(time_t PresentTime, const char *PresentTitle, const char *PresentSubtitle, time_t FollowingTime, const char *FollowingTitle, const char *FollowingSubtitle);
-+// virtual void OsdProgramme(time_t PresentTime, const char *PresentTitle, const char *PresentSubtitle, time_t FollowingTime, const char *FollowingTitle, const char *FollowingSubtitle);
- };
-
-
-@@ -70,10 +70,8 @@ void cLcdFeed::ChannelSwitch(const cDevi
- //syslog(LOG_INFO, "lcdproc: cLcdFeed::ChannelSwitch %d %d", Device->CardIndex(), ChannelNumber);
- 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;
-+ LCDproc->SetChannelSwitch( (cDevice *) Device, ChannelNumber);
- } else switched = false;
- LCDproc->SetPrimaryDevice( (cDevice *) Device );
- }
-@@ -188,31 +186,31 @@ void cLcdFeed::OsdChannel(const char *Te
- switched=false; menumode=false;
- }
-
--void cLcdFeed::OsdProgramme(time_t PresentTime, const char *PresentTitle, const char *PresentSubtitle, time_t FollowingTime, const char *FollowingTitle, const char *FollowingSubtitle)
--{
-- char buffer[25];
-- struct tm tm_r;
-- //syslog(LOG_INFO, "lcdproc: cLcdFeed::OsdProgramme");
-- strftime(buffer, sizeof(buffer), "%R", localtime_r(&PresentTime, &tm_r));
-- //syslog(LOG_INFO, "%5s %s", buffer, PresentTitle);
-- //syslog(LOG_INFO, "%5s %s", "", PresentSubtitle);
--
--
-- if ( (!isempty(PresentTitle)) && (!isempty(PresentSubtitle)) )
-- LCDproc->SetRunning(false,buffer,PresentTitle,PresentSubtitle);
-- else if (!isempty(PresentTitle)) LCDproc->SetRunning(false,buffer,PresentTitle);
-- else LCDproc->SetRunning(false,tr("No EPG info available."), NULL);
--
--
-- strftime(buffer, sizeof(buffer), "%R", localtime_r(&FollowingTime, &tm_r));
-- //syslog(LOG_INFO, "%5s %s", buffer, FollowingTitle);
-- //syslog(LOG_INFO, "%5s %s", "", FollowingSubtitle);
--
-- if ( (!isempty(FollowingTitle)) && (!isempty(FollowingSubtitle)) )
-- LCDproc->SetRunning(true,buffer,FollowingTitle,FollowingSubtitle);
-- else if (!isempty(FollowingTitle)) LCDproc->SetRunning(true,buffer,FollowingTitle);
-- else LCDproc->SetRunning(true,tr("No EPG info available."), NULL);
--}
-+// void cLcdFeed::OsdProgramme(time_t PresentTime, const char *PresentTitle, const char *PresentSubtitle, time_t FollowingTime, const char *FollowingTitle, const char *FollowingSubtitle)
-+// {
-+// char buffer[25];
-+// struct tm tm_r;
-+// //syslog(LOG_INFO, "lcdproc: cLcdFeed::OsdProgramme");
-+// strftime(buffer, sizeof(buffer), "%R", localtime_r(&PresentTime, &tm_r));
-+// //syslog(LOG_INFO, "%5s %s", buffer, PresentTitle);
-+// //syslog(LOG_INFO, "%5s %s", "", PresentSubtitle);
-+//
-+//
-+// if ( (!isempty(PresentTitle)) && (!isempty(PresentSubtitle)) )
-+// LCDproc->SetRunning(false,buffer,PresentTitle,PresentSubtitle);
-+// else if (!isempty(PresentTitle)) LCDproc->SetRunning(false,buffer,PresentTitle);
-+// else LCDproc->SetRunning(false,tr("No EPG info available."), NULL);
-+//
-+//
-+// strftime(buffer, sizeof(buffer), "%R", localtime_r(&FollowingTime, &tm_r));
-+// //syslog(LOG_INFO, "%5s %s", buffer, FollowingTitle);
-+// //syslog(LOG_INFO, "%5s %s", "", FollowingSubtitle);
-+//
-+// if ( (!isempty(FollowingTitle)) && (!isempty(FollowingSubtitle)) )
-+// LCDproc->SetRunning(true,buffer,FollowingTitle,FollowingSubtitle);
-+// else if (!isempty(FollowingTitle)) LCDproc->SetRunning(true,buffer,FollowingTitle);
-+// else LCDproc->SetRunning(true,tr("No EPG info available."), NULL);
-+// }
-
- // ---
-
-diff -rupbB ./lcd.c ../lcdproc-0.0.10.SHF-volume/lcd.c
---- ./lcd.c 2008-05-27 02:13:45.000000000 +0200
-+++ ../lcdproc-0.0.10.SHF-volume/lcd.c 2008-05-27 02:13:22.000000000 +0200
-@@ -277,6 +277,15 @@ void cLcd::SetWarning( const char *strin
- }
- }
-
-+void cLcd::SetChannelSwitch(const cDevice *Device, int ChannelNumber){
-+ cLcd::SetLine(1,2," ");
-+ cLcd::SetLine(1,3," ");
-+ cLcd::SetRunning(false,tr("Waiting for EPG info."), NULL);
-+ cLcd::SetRunning(true,tr("Waiting for EPG info."), NULL);
-+ epg=false;
-+ epg_retry=MAX_EPG_RETRY;
-+}
-+
- void cLcd::ShowVolume(unsigned int vol, bool muted ) {
- if (!connected) return;
- BeginMutualExclusion();
-@@ -712,9 +721,15 @@ void cLcd::Action(void) { // LCD output
-
- // epg update
-
-+ if ( !epg && epg_retry > 0 ) {
-+ epg_retry-- ;
-+ if ( ( epg_retry % 5 ) == 0 ) nextLcdUpdate=time(NULL)-10;
-+ } else epg = true;
-+
- #ifdef OLDVDR
-
- if ( time(NULL) > nextLcdUpdate ) {
-+ epg=true;
- const cEventInfo *Present = NULL;
- cMutexLock MutexLock;
- const cSchedules *Schedules = cSIProcessor::Schedules(MutexLock);
-@@ -722,54 +737,99 @@ void cLcd::Action(void) { // LCD output
- const cSchedule *Schedule = Schedules->GetSchedule();
- if (Schedule) {
- const char *PresentTitle, *PresentSubtitle;
-+
- PresentTitle = NULL; PresentSubtitle = NULL;
- if ((Present = Schedule->GetPresentEvent()) != NULL) {
-- nextLcdUpdate=Present->GetTime()+Present->GetDuration();
-+// nextLcdUpdate=Present->GetTime()+Present->GetDuration();
- PresentTitle = Present->GetTitle();
- PresentSubtitle = Present->GetSubtitle();
- if ( (!isempty(PresentTitle)) && (!isempty(PresentSubtitle)) )
- SetRunning(false,Present->GetTimeString(),PresentTitle,PresentSubtitle);
- else if (!isempty(PresentTitle)) SetRunning(false,Present->GetTimeString(),PresentTitle);
-+ else {
-+ SetRunning(false,tr("No EPG info available."), NULL);
-+ }
- } else
- SetRunning(false,tr("No EPG info available."), NULL);
-- if ((Present = Schedule->GetFollowingEvent()) != NULL)
-- nextLcdUpdate=(Present->GetTime()<nextLcdUpdate)?Present->GetTime():nextLcdUpdate;
-+
-+ Present = NULL; PresentTitle = NULL; PresentSubtitle = NULL;
-+ if ((Present = Schedule->GetFollowingEvent()) != NULL) {
-+// nextLcdUpdate=Present->StartTime()+Present->Duration();
-+ PresentTitle = Present->Title();
-+ PresentSubtitle = Present->ShortText();
-+ if ( (!isempty(PresentTitle)) && (!isempty(PresentSubtitle)) )
-+ SetRunning(true,Present->GetTimeString(),PresentTitle,PresentSubtitle);
-+ else if (!isempty(PresentTitle)) SetRunning(true,Present->GetTimeString(),PresentTitle);
-+ else {
-+ SetRunning(true,tr("No EPG info available."), NULL);
-+ epg=false;
- }
-+ } else {
-+ SetRunning(true,tr("No EPG info available."), NULL);
-+ epg=false;
- }
-- if ( nextLcdUpdate <= time(NULL) )
-- nextLcdUpdate=(time(NULL)/60)*60+60;
-- else if ( nextLcdUpdate > time(NULL)+60 )
-+
-+// if ((Present = Schedule->GetFollowingEvent()) != NULL)
-+// nextLcdUpdate=(Present->GetTime()<nextLcdUpdate)?Present->GetTime():nextLcdUpdate;
-+ }
-+ }
-+// if ( nextLcdUpdate <= time(NULL) )
-+// nextLcdUpdate=(time(NULL)/60)*60+60;
-+// else if ( nextLcdUpdate > time(NULL)+60 )
- nextLcdUpdate=(time(NULL)/60)*60+60;
- }
-
- #else
-
- if ( time(NULL) > nextLcdUpdate ) {
-+ epg=true;
- cChannel *channel = Channels.GetByNumber(primaryDvbApi->CurrentChannel());
- const cEvent *Present = NULL;
- cSchedulesLock schedulesLock;
- const cSchedules *Schedules = cSchedules::Schedules(schedulesLock);
- if (Schedules) {
- const cSchedule *Schedule = Schedules->GetSchedule(channel->GetChannelID());
-+
- if (Schedule) {
- const char *PresentTitle, *PresentSubtitle;
-+
- PresentTitle = NULL; PresentSubtitle = NULL;
- if ((Present = Schedule->GetPresentEvent()) != NULL) {
-- nextLcdUpdate=Present->StartTime()+Present->Duration();
-+// nextLcdUpdate=Present->StartTime()+Present->Duration();
- PresentTitle = Present->Title();
- PresentSubtitle = Present->ShortText();
- if ( (!isempty(PresentTitle)) && (!isempty(PresentSubtitle)) )
- SetRunning(false,Present->GetTimeString(),PresentTitle,PresentSubtitle);
- else if (!isempty(PresentTitle)) SetRunning(false,Present->GetTimeString(),PresentTitle);
-- } else
-+ else {
- SetRunning(false,tr("No EPG info available."), NULL);
-- if ((Present = Schedule->GetFollowingEvent()) != NULL)
-- nextLcdUpdate=(Present->StartTime()<nextLcdUpdate)?Present->StartTime():nextLcdUpdate;
- }
-+ } else {
-+ SetRunning(false,tr("No EPG info available."), NULL);
- }
-- if ( nextLcdUpdate <= time(NULL) )
-- nextLcdUpdate=(time(NULL)/60)*60+60;
-- else if ( nextLcdUpdate > time(NULL)+60 )
-+
-+ Present = NULL; PresentTitle = NULL; PresentSubtitle = NULL;
-+ if ((Present = Schedule->GetFollowingEvent()) != NULL) {
-+// nextLcdUpdate=Present->StartTime()+Present->Duration();
-+ PresentTitle = Present->Title();
-+ PresentSubtitle = Present->ShortText();
-+ if ( (!isempty(PresentTitle)) && (!isempty(PresentSubtitle)) )
-+ SetRunning(true,Present->GetTimeString(),PresentTitle,PresentSubtitle);
-+ else if (!isempty(PresentTitle)) SetRunning(true,Present->GetTimeString(),PresentTitle);
-+ else {
-+ SetRunning(true,tr("No EPG info available."), NULL);
-+ }
-+ } else {
-+ SetRunning(true,tr("No EPG info available."), NULL);
-+ }
-+
-+// if ((Present = Schedule->GetFollowingEvent()) != NULL)
-+// nextLcdUpdate=(Present->StartTime()<nextLcdUpdate)?Present->StartTime():nextLcdUpdate;
-+ }
-+ }
-+// if ( nextLcdUpdate <= time(NULL) )
-+// nextLcdUpdate=(time(NULL)/60)*60+60;
-+// else if ( nextLcdUpdate > time(NULL)+60 )
- nextLcdUpdate=(time(NULL)/60)*60+60;
- }
-
-diff -rupbB ./lcd.h ../lcdproc-0.0.10.SHF-volume/lcd.h
---- ./lcd.h 2008-05-27 02:11:55.000000000 +0200
-+++ ../lcdproc-0.0.10.SHF-volume/lcd.h 2008-05-27 01:03:23.000000000 +0200
-@@ -14,6 +14,7 @@
- #define LCDMAXWID 40
- #define LCDMAXCARDS 4
- #define LCDMAXFULLSTRING 1024
-+#define MAX_EPG_RETRY 45 // : 8 = sec
- #define MAX_LCDd_dead 12 // : 8 = sec
-
- class cLcd : public cThread {
-@@ -40,6 +41,7 @@ class cLcd : public cThread {
- void SetTitle( const char *string);
- void SetMain( unsigned int n, const char *string);
- void SetHelp( unsigned int n, const char *Red, const char *Green, const char *Yellow, const char *Blue);
-+ void SetChannelSwitch(const cDevice *Device, int ChannelNumber);
- void SetStatus( const char *string);
- void SetWarning( const char *string);
- void ShowVolume(unsigned int vol, bool muted );
-@@ -65,7 +67,9 @@ class cLcd : public cThread {
- char host[100]; // 100 should be sufficient, I think.
- unsigned int port;
- bool connected;
-+ bool epg;
- unsigned int LCDd_dead;
-+ int epg_retry;
- struct StateData ThreadStateData;
- time_t LastProgress;
- cMutex CriticalArea;
diff --git a/lcd.c b/lcd.c
index cd1b3fc..442d63f 100644
--- a/lcd.c
+++ b/lcd.c
@@ -12,14 +12,14 @@
#include "sockets.h"
#include <vdr/plugin.h>
-#ifdef LCD_EXT_KEY_CONF
-#include LCD_EXT_KEY_CONF
-#else
+#ifdef LCD_EXT_KEY_CONF
+#include LCD_EXT_KEY_CONF
+#else
#include "lcdkeyconf.h"
#endif
// character mapping for output, see cLcd::Write
-#include "lcdtranstbl.h"
+#include "lcdtranstbl.h"
#define LCDMENU 0
#define LCDTITLE 1
@@ -31,24 +31,24 @@
cLcd::cLcd() {
int i, j;
- connected = false;
+ connected = false;
suspended = false;
- ThreadStateData.showvolume = false;
- ThreadStateData.newscroll = false;
+ ThreadStateData.showvolume = false;
+ ThreadStateData.newscroll = false;
sock = wid = hgt = cellwid = cellhgt = 0;
closing = false;
- host = NULL;
- replayDvbApi = NULL;
+ host = NULL;
+ replayDvbApi = NULL;
primaryDvbApi = NULL;
-
- for (i=0;i<LCDMAXSTATES;i++) for (j=0;j<4;j++) {
- ThreadStateData.lcdbuffer[i][j][0]=' ';
- ThreadStateData.lcdbuffer[i][j][1]='\0';
- ThreadStateData.lcddirty[i][j]=true;
- }
+
+ for (i=0;i<LCDMAXSTATES;i++) for (j=0;j<4;j++) {
+ ThreadStateData.lcdbuffer[i][j][0]=' ';
+ ThreadStateData.lcdbuffer[i][j][1]='\0';
+ ThreadStateData.lcddirty[i][j]=true;
+ }
ThreadStateData.State=Menu;
for (i=0;i<LCDMAXSTATEBUF;i++) LastState[i]=Title; LastStateP=0;
- ThreadStateData.barx=1, ThreadStateData.bary=1, ThreadStateData.barl=0;
+ ThreadStateData.barx=1, ThreadStateData.bary=1, ThreadStateData.barl=0;
for (i=0;i<LCDMAXCARDS;i++) ThreadStateData.CardStat[i]=0;
channelSwitched = false;
SummaryText = NULL;
@@ -60,7 +60,8 @@ cLcd::cLcd() {
}
cLcd::~cLcd() {
- if (connected) { cLcd::Close(); }
+ cLcd::Cancel(2);
+ if (connected) { cLcd::Close(); }
if (conv) { delete(conv); }
if (host) { free(host); }
}
@@ -85,14 +86,14 @@ bool cLcd::Open() {
}
ToggleMode=false;
- sock_send_string(sock, "hello\n");
- usleep(500000); // wait for a connect message
+ sock_send_string(sock, "hello\n");
+ usleep(500000); // wait for a connect message
memset(istring,0,1024);
sock_recv(sock, istring, 1024);
if ( strncmp("connect LCDproc",istring,15) != 0 ) {
syslog(LOG_INFO, "LCDd at %s:%d does not respond.",host,port);
- cLcd::Close();
+ cLcd::Close();
return connected=false;
}
@@ -101,9 +102,9 @@ bool cLcd::Open() {
if (sscanf(istring+i,"lcd wid %d hgt %d cellwid %d cellhgt %d", &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; } // 2x32-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) {
+ if (!connected) {
syslog(LOG_INFO, "Minimum Display Size is 2x16. Your LCD is to small, sorry.");
cLcd::Close();
return connected;
@@ -117,10 +118,10 @@ bool cLcd::Open() {
sock_send_string(sock,"widget_add VDR line4 string\n"); sock_recv(sock, istring, 1024);
sock_send_string(sock,"widget_add VDR prbar hbar\n"); sock_recv(sock, istring, 1024);
sock_send_string(sock,"widget_set VDR prbar 1 1 0\n"); sock_recv(sock, istring, 1024);
-
+
for (i=0; i<LcdMaxKeys;i++) {
sprintf(istring,"client_add_key %c\n",LcdUsedKeys[i]);
- sock_send_string(sock,istring);
+ sock_send_string(sock,istring);
sock_recv(sock, istring, 1024);
}
syslog(LOG_INFO, "connection to LCDd at %s:%d established.",host,port);
@@ -140,7 +141,7 @@ void cLcd::Close() {
}else{
fprintf(stderr,"Not Connected !!! \n");
}
- connected=false; sock=wid=hgt=cellwid=cellhgt=0;
+ connected=false; sock=wid=hgt=cellwid=cellhgt=0;
}
bool cLcd::Suspend() {
@@ -184,24 +185,24 @@ const char* cLcd::Convert(const char *s) {
void cLcd::Info() { // just for testing ...
if (connected)
printf("sock %d, wid %d, hgt %d, cellwid %d, cellhgt %d\n",sock, wid, hgt, cellwid, cellhgt);
- else
+ else
printf("not connected\n");
}
void cLcd::SetTitle( const char *string) {
if (!connected) return;
-
+
const char* c_string = Convert(string);
-
+
unsigned int i;
char title[wid+1];
-
- // we need to know the length of the translated string "Schedule"
+
+ // we need to know the length of the translated string "Schedule"
const char *trstring=trVDR("Schedule - %s");
int trstringlength=strlen(trstring)-3;
if (strncmp(trstring,c_string,trstringlength)==0) {
- // it is the title of the "Schedule" menu, so we replace "Schedule" with ">"
+ // it is the title of the "Schedule" menu, so we replace "Schedule" with ">"
title[0]='>'; snprintf( title+1, wid,"%s",c_string+trstringlength);
} else if (strlen(c_string) > (wid-1)) {
snprintf( title, wid+1,"%s",c_string);
@@ -215,7 +216,7 @@ void cLcd::SetTitle( const char *string) {
void cLcd::SetMain( unsigned int n, const char *string, bool isConverted) {
const char* c_string;
-
+
if (!connected) return;
if (isConverted)
@@ -227,68 +228,74 @@ void cLcd::SetMain( unsigned int n, const char *string, bool isConverted) {
char line3[wid+1];
if (c_string != NULL) {
+ BeginMutualExclusion();
cLcd::Copy(ThreadStateData.lcdfullbuffer[n],c_string,LCDMAXFULLSTRING-3);
- int i = strlen(ThreadStateData.lcdfullbuffer[n]);
+ unsigned int i = strlen(ThreadStateData.lcdfullbuffer[n]);
+ if (i > (((ToggleMode)?1:2)*wid)) {
ThreadStateData.lcdfullbuffer[n][i++]=' ';
ThreadStateData.lcdfullbuffer[n][i++]='*';
ThreadStateData.lcdfullbuffer[n][i++]=' ';
+ }
ThreadStateData.lcdfullbuffer[n][i]='\0';
ThreadStateData.newscroll=true;
cLcd::Copy(StringBuffer,c_string,2*wid);
cLcd::Split(StringBuffer,line2,line3);
+ EndMutualExclusion();
cLcd::SetBuffer(n,NULL,line2,line3,NULL);
} else {
+ BeginMutualExclusion();
//cLcd::SetBuffer(n,NULL," \0"," \0",NULL);
ThreadStateData.lcdfullbuffer[n][0]='\0';
+ EndMutualExclusion();
}
}
void cLcd::SetHelp( unsigned int n, const char *Red, const char *Green, const char *Yellow, const char *Blue) {
if (!connected) return;
-
+
char help[2*wid], red[wid+1], green[wid+1], yellow[wid+1], blue[wid+1];
unsigned int allchars=0, i,j , empty=0, spacewid=1;
char *longest, *longest1, *longest2;
const char* c_Red = Convert(Red);
- if ( c_Red==NULL || c_Red[0]=='\0' ) {
+ if ( c_Red==NULL || c_Red[0]=='\0' ) {
empty++; red[0]=' '; red[1]='\0';
- } else {
- j=i=0; while ( (i<wid) && (c_Red[i] != '\0') ) {
+ } else {
+ j=i=0; while ( (i<wid) && (c_Red[i] != '\0') ) {
if (c_Red[i] !=' ') {red[j]=c_Red[i]; j++; }
- i++;
+ i++;
} red[j]='\0';
- allchars+=strlen(red);
+ allchars+=strlen(red);
}
const char* c_Green = Convert(Green);
- if ( c_Green==NULL || c_Green[0]=='\0' ) {
+ if ( c_Green==NULL || c_Green[0]=='\0' ) {
empty++; green[0]=' '; green[1]='\0';
- } else {
- j=i=0; while ( (i<wid) && (c_Green[i] != '\0') ) {
+ } else {
+ j=i=0; while ( (i<wid) && (c_Green[i] != '\0') ) {
if (c_Green[i] !=' ') {green[j]=c_Green[i]; j++; }
- i++;
+ i++;
} green[j]='\0';
- allchars+=strlen(green);
+ allchars+=strlen(green);
}
const char* c_Yellow = Convert(Yellow);
- if ( c_Yellow==NULL || c_Yellow[0]=='\0' ) {
+ if ( c_Yellow==NULL || c_Yellow[0]=='\0' ) {
empty++; yellow[0]=' '; yellow[1]='\0';
- } else {
- j=i=0; while ( (i<wid) && (c_Yellow[i] != '\0') ) {
+ } else {
+ j=i=0; while ( (i<wid) && (c_Yellow[i] != '\0') ) {
if (c_Yellow[i] !=' ') {yellow[j]=c_Yellow[i]; j++; }
- i++;
+ i++;
} yellow[j]='\0';
- allchars+=strlen(yellow);
+ allchars+=strlen(yellow);
}
const char* c_Blue = Convert(Blue);
- if ( c_Blue==NULL || c_Blue[0]=='\0' ) {
+ if ( c_Blue==NULL || c_Blue[0]=='\0' ) {
empty++; blue[0]=' '; blue[1]='\0';
- } else {
- j=i=0; while ( (i<wid) && (c_Blue[i] != '\0') ) {
+ } else {
+ j=i=0; while ( (i<wid) && (c_Blue[i] != '\0') ) {
if (c_Blue[i] !=' ') {blue[j]=c_Blue[i]; j++; }
- i++;
+ i++;
} blue[j]='\0';
- allchars+=strlen(blue);
+ allchars+=strlen(blue);
}
while (allchars > (wid-empty-3)) {
@@ -320,9 +327,9 @@ void cLcd::SetHelp( unsigned int n, const char *Red, const char *Green, const ch
void cLcd::SetStatus( const char *string) {
if (!connected) return;
-
+
const char* c_string = Convert(string);
-
+
char statstring[2*wid+1];
if (c_string == NULL) {
@@ -335,7 +342,7 @@ void cLcd::SetStatus( const char *string) {
void cLcd::SetWarning( const char *string) {
if (!connected) return;
-
+
const char* c_string = Convert(string);
char statstring[2*wid+1];
@@ -366,12 +373,12 @@ if (!connected) return;
} else {
if (hgt==2) {
if (ToggleMode) {
- cLcd::SetLine(Vol,0,tr("Volume "));
- cLcd::SetLine(Vol,1," ");
- } else {
- cLcd::SetLine(Vol,0,"|---|---|---|---|---|---|---|---|---|---");
+ cLcd::SetLine(Vol,0,Convert(tr("Volume ")));
+ cLcd::SetLine(Vol,1," ");
+ } else {
+ cLcd::SetLine(Vol,0,Convert(tr("Volume ")));
cLcd::SetLine(Vol,3," ");
- cLcd::SetLine(Vol,1,"|---|---|---|---|---|---|---|---|---|---");
+ cLcd::SetLine(Vol,1," ");
cLcd::SetLine(Vol,2," ");
}
} else {
@@ -379,8 +386,8 @@ if (!connected) return;
cLcd::SetLine(Vol,3,"|---|---|---|---|---|---|---|---|---|---");
cLcd::SetLine(Vol,1,"|---|---|---|---|---|---|---|---|---|---");
cLcd::SetLine(Vol,2," ");
- }
-
+ }
+
}
}
@@ -393,7 +400,7 @@ void cLcd::SetProgress(const char *begin, const char *end, int percent) {
if (begin==NULL) {
BeginMutualExclusion();
ThreadStateData.barx=1; ThreadStateData.bary=1; ThreadStateData.barl=0;
- EndMutualExclusion();
+ EndMutualExclusion();
} else {
time_t t = time(NULL);
if (t != LastProgress) { // output only once a second
@@ -404,18 +411,18 @@ void cLcd::SetProgress(const char *begin, const char *end, int percent) {
sprintf(workstring+wid-endw,"%s", end);
cLcd::SetLine(LCDREPLAY,(ToggleMode)?0:3,workstring);
BeginMutualExclusion();
- ThreadStateData.barx=beginw+1+((hgt==2 && !ToggleMode)?wid:0);
- ThreadStateData.bary=((hgt==2)?1:4);
+ ThreadStateData.barx=beginw+1+((hgt==2 && !ToggleMode)?wid:0);
+ ThreadStateData.bary=((hgt==2)?1:4);
ThreadStateData.barl=(percent*cellwid*(wid-beginw-endw))/100;
EndMutualExclusion();
- LastProgress = t;
+ 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;
@@ -424,9 +431,9 @@ void cLcd::SetLine(unsigned int n, unsigned int l, const char *string) {
void cLcd::SetLineC(unsigned int n, unsigned int l, const char *string) {
if (!connected) return;
-
- const char* c_string = Convert(string);
-
+
+ const char* c_string = Convert(string);
+
BeginMutualExclusion();
if (c_string != NULL) cLcd::Copy(ThreadStateData.lcdbuffer[n][l],c_string,wid);
ThreadStateData.lcddirty[n][l]=true;
@@ -435,65 +442,68 @@ void cLcd::SetLineC(unsigned int n, unsigned int l, const char *string) {
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;
+ 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[1024];
char line1[1024];
static char now1[LCDMAXWID+1];
static char now2[LCDMAXWID+1];
-
+
char *c_string1 = string1 ? strdup(Convert(string1)) : NULL;
char *c_string2 = string2 ? strdup(Convert(string2)) : NULL;
char *c_string3 = string3 ? strdup(Convert(string3)) : NULL;
-
- snprintf(line,1024,"%s %s%s%s",
- (string1==NULL || string1[0]=='\0')?" ":c_string1,
- (string2==NULL || string2[0]=='\0')?" ":c_string2,
+
+ snprintf(line,1024,"%s%s%s%s%s",
+ (string1==NULL || string1[0]=='\0')?"":c_string1,
+ ((!(string1==NULL || string1[0]=='\0')) && (!(string2==NULL || string2[0]=='\0')))?" ":"",
+ (string2==NULL || string2[0]=='\0')?"":c_string2,
(string3==NULL || string3[0]=='\0')?"":"|",
- (string3==NULL || string3[0]=='\0')?" ":c_string3);
+ (string3==NULL || string3[0]=='\0')?"":c_string3);
cLcd::Copy(line1,line,2*wid);
-
+
free(c_string1);
free(c_string2);
free(c_string3);
-
-
+
+
if (nownext) {
- BeginMutualExclusion();
+ BeginMutualExclusion();
cLcd::Split(line1,ThreadStateData.lcdbuffer[LCDMISC][2],ThreadStateData.lcdbuffer[LCDMISC][3]);
ThreadStateData.lcddirty[LCDMISC][2]=true; ThreadStateData.lcddirty[LCDMISC][3]=true;
- EndMutualExclusion();
+ EndMutualExclusion();
cLcd::SetBuffer(LCDMISC,now1,now2,NULL,NULL);
} else {
BeginMutualExclusion();
cLcd::Split(line1,ThreadStateData.lcdbuffer[LCDTITLE][2],ThreadStateData.lcdbuffer[LCDTITLE][3]);
ThreadStateData.lcddirty[LCDTITLE][2]=true; ThreadStateData.lcddirty[LCDTITLE][3]=true;
cLcd::Copy(ThreadStateData.lcdfullbuffer[LCDTITLE],line,LCDMAXFULLSTRING-3);
- int i = strlen(ThreadStateData.lcdfullbuffer[LCDTITLE]);
+ unsigned int i = strlen(ThreadStateData.lcdfullbuffer[LCDTITLE]);
+ if (i>(((ToggleMode)?1:2)*wid)) {
ThreadStateData.lcdfullbuffer[LCDTITLE][i++]=' ';
ThreadStateData.lcdfullbuffer[LCDTITLE][i++]='*';
- ThreadStateData.lcdfullbuffer[LCDTITLE][i++]=' ';
- ThreadStateData.lcdfullbuffer[LCDTITLE][i]='\0';
+ ThreadStateData.lcdfullbuffer[LCDTITLE][i++]=' ';
+ }
+ ThreadStateData.lcdfullbuffer[LCDTITLE][i]='\0';
sprintf(now1,"%s",ThreadStateData.lcdbuffer[LCDTITLE][2]);
sprintf(now2,"%s",ThreadStateData.lcdbuffer[LCDTITLE][3]);
EndMutualExclusion();
-
+
}
}
void cLcd::SummaryInit(const char *string) {
-
+
if (SummaryText)
free(SummaryText);
SummaryText = strdup(Convert(string));
@@ -504,7 +514,7 @@ void cLcd::SummaryInit(const char *string) {
void cLcd::SummaryDown() {
if (!connected) return;
- SummaryCurrent=( (SummaryCurrent+4*wid) < SummaryTextL )?SummaryCurrent+4*wid:SummaryCurrent;
+ SummaryCurrent=( (SummaryCurrent+4*wid) < SummaryTextL )?SummaryCurrent+4*wid:SummaryCurrent;
}
void cLcd::SummaryUp() {
@@ -539,19 +549,19 @@ void cLcd::SetCardStat(unsigned int card, unsigned int stat) {
void cLcd::Clear( unsigned int n) {
if (!connected) return;
- cLcd::SetBuffer(n," "," "," "," ");
+ cLcd::SetBuffer(n," "," "," "," ");
}
void cLcd::SetThreadState( ThreadStates newstate ) {
if (!connected) return;
BeginMutualExclusion();
- if (ThreadStateData.State != newstate) {
+ if (ThreadStateData.State != newstate) {
cLcd::LastState[(++LastStateP)%LCDMAXSTATEBUF]=newstate;
- ThreadStateData.State=newstate;
- ThreadStateData.barx=1, ThreadStateData.bary=1, ThreadStateData.barl=0;
+ ThreadStateData.State=newstate;
+ ThreadStateData.barx=1, ThreadStateData.bary=1, ThreadStateData.barl=0;
}
- EndMutualExclusion();
+ EndMutualExclusion();
}
void cLcd::PopThreadState() {
@@ -564,7 +574,7 @@ void cLcd::PopThreadState() {
void cLcd::SetReplayDevice(cControl *DvbApi) {
replayDvbApi=DvbApi;
-}
+}
void cLcd::SetPrimaryDevice(cDevice *DvbApi) {
primaryDvbApi=DvbApi;
@@ -613,40 +623,40 @@ void cLcd::Split(char *string, char *string1, char *string2) {
&& 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);
+ 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);
+ j=strlen(string);
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 ) {
- string[j+ofs]='\0';
+ string[j+ofs]='\0';
for (k=j+ofs-1;k>i+ofs; k-- ) string[k]=string[k-ofs];
- for (k=0;k<ofs;k++) string[i+k+1]=' ';
+ for (k=0;k<ofs;k++) string[i+k+1]=' ';
}
-
+
}
- 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=j+ofs-1; i>=wid+ofs;i--) string[i]=string[i-ofs];
for (i=wid;i<wid+ofs;i++) string[i]=' ';
}
}
-
+
strncpy(string1,string,wid+1);
if ( strlen(string) >wid ) {
strncpy(string2,string+wid,wid+1);
@@ -660,15 +670,15 @@ void cLcd::Write(int line, const char *string) { // used for any text output to
char workstring[256];
unsigned int i,out;
- if (ToggleMode && (line > 2)) return;
-
+ 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 );
+ sprintf(workstring,"widget_set VDR line%d %d %d \"",line,(line==2||line==4)?wid+1:1,(line<3)?1:2 );
} else {
sprintf(workstring,"widget_set VDR line%d %d %d \"",line,(line==3||line==4)?wid+1:1,(line==1||line==4)?1:2);
- }
+ }
// do lcdtranstbl mapping
out=strlen(workstring);
for (i=0;(i<strlen(string)) && (i<wid);i++)
@@ -684,37 +694,49 @@ void cLcd::GetTimeDateStat( char *string, unsigned int OutStateData[] ) {
const char States[] = ".-*>"; // '.' ... not present, '-' ... present, '*' ... recording, '>' ... replaying
bool ShowStates=false;
unsigned int offset;
-
+
offset=(wid>36)?20:0;
for (i=0; i<LCDMAXCARDS && (!ShowStates) ; i++) ShowStates = ShowStates || (OutStateData[i]>1);
t = time(NULL);
now = localtime(&t);
- if ( offset || !( ShowStates && ((t%LcdSetup.FullCycle) >= LcdSetup.TimeCycle) )) {
- if (wid > 19)
+ if ( offset || !( ShowStates && ((t%LcdSetup.FullCycle) >= LcdSetup.TimeCycle) )) {
+ if (ToggleMode) {
+ strcat(string," ");
+ snprintf(string+wid-6,8," %02d%s%02d", now->tm_hour, (now->tm_sec%2)?" ":":", now->tm_min);
+ }
+ else {
+ if (wid > 19)
snprintf(string,wid+1,"<%s %02d.%02d %02d:%02d:%02d>",
Convert(*WeekDayName(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%LcdSetup.FullCycle) >= LcdSetup.TimeCycle) )) {
if (LcdSetup.RecordingStatus == 0) {
for (i=0; i<LCDMAXCARDS; i++) {
snprintf(string+offset,5," %d:%c", i,States[ OutStateData[i] ] );
- offset+=4;
+ offset+=4;
}
}
else {
+ if (ToggleMode || wid < 19) {
+ snprintf(string,wid+1," ");
+ snprintf(string+wid-16,wid+1,"%s %02d%s%02d", Convert(tr("RECORDING")), now->tm_hour, (now->tm_sec%2)?" ":":", now->tm_min);
+ }
+ else {
snprintf(string,wid+1,"<%s %02d:%02d:%02d>", Convert(tr("RECORDING")), now->tm_hour, now->tm_min,now->tm_sec);
+ }
}
}
}
-#define WakeUpCycle 125000 // us
+#define WakeUpCycle 125000 // us
#define WorkString_Length 1024
void cLcd::Action(void) { // LCD output thread
@@ -722,7 +744,8 @@ void cLcd::Action(void) { // LCD output thread
int Current, Total, scrollpos, scrollcnt, scrollwaitcnt, lastAltShift, lastBackLight,lastPrio, keycnt;
struct timeval now, voltime;
char workstring[WorkString_Length];
- char lastkeypressed='\0';
+ char workstring2[101];
+ char lastkeypressed='\0';
cLcd::ThreadStates PrevState = Menu;
struct cLcd::StateData OutStateData;
bool Lcddirty[LCDMAXSTATES][4];
@@ -730,13 +753,13 @@ void cLcd::Action(void) { // LCD output thread
char priostring[35];
// RT
static int rtcycle;
-
+
// LCR
static int lcrCycle;
-
+
time_t nextLcdUpdate, lastUserActivity;
- while (true) { // outer (reconnect) loop
+ while (true) { // outer (reconnect) loop
barx=1; bary=1; barl=0; ScrollState=0; ScrollLine=1; lasttitlelen=0;
Current=0, Total=1, scrollpos=0, scrollcnt=0, scrollwaitcnt=10, lastAltShift=0, lastBackLight=0 ,lastPrio=0, keycnt=0;
lastkeypressed='\0';
@@ -750,7 +773,7 @@ void cLcd::Action(void) { // LCD output thread
Open();
}
- // backlight init
+ // backlight init
if ((lastBackLight=LcdSetup.BackLight))
sock_send_string(sock,"backlight on\n");
else
@@ -767,11 +790,11 @@ void cLcd::Action(void) { // LCD output thread
}
sock_send_string(sock,priostring);
- }
+ }
lastUserActivity=time(NULL);
syslog(LOG_INFO, "LCD output thread started (pid=%d), display size: %dx%d", getpid(),hgt,wid);
- cLcd::Write(LcdSetup.ShowTime?1:4," Welcome to V D R\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");
@@ -800,39 +823,40 @@ void cLcd::Action(void) { // LCD output thread
sleep(3); bool volume=false; OutStateData.showvolume=false; ThreadStateData.showvolume=false;
- if (primaryDvbApi) for (int k=0; k<primaryDvbApi->NumDevices() ; k++) SetCardStat(k,1);
+ if (primaryDvbApi) for (int k=0; k<primaryDvbApi->NumDevices() ; k++) SetCardStat(k,1);
voltime.tv_sec=0;
for (i=0;i<LCDMAXSTATES;i++) for (j=0;j<4;j++) Lcddirty[i][j]=true;
nextLcdUpdate = 0; // trigger first update immediately
- while (true) { // main loop, wakes up every WakeUpCycle, any output to LCDd is done here
+ while (true) { // main loop, wakes up every WakeUpCycle, any output to LCDd is done here
gettimeofday(&now,NULL);
// epg update
if (channelSwitched) {
channelSwitched = false;
+ lastUserActivity=time(NULL);
nextLcdUpdate = 0; //trigger next epg update
}
- if ( time(NULL) > nextLcdUpdate ) {
+ if ( time(NULL) > nextLcdUpdate ) {
cChannel *channel = Channels.GetByNumber(primaryDvbApi->CurrentChannel());
const cEvent *Present = NULL;
cSchedulesLock schedulesLock;
- const cSchedules *Schedules = cSchedules::Schedules(schedulesLock);
+ const cSchedules *Schedules = cSchedules::Schedules(schedulesLock);
if (Schedules) {
- const cSchedule *Schedule = Schedules->GetSchedule(channel->GetChannelID());
- if (Schedule) {
+ const cSchedule *Schedule = Schedules->GetSchedule(channel->GetChannelID());
+ if (Schedule) {
const char *PresentTitle, *PresentSubtitle;
PresentTitle = NULL; PresentSubtitle = NULL;
if ((Present = Schedule->GetPresentEvent()) != NULL) {
nextLcdUpdate=Present->StartTime()+Present->Duration();
PresentTitle = Present->Title();
PresentSubtitle = Present->ShortText();
- if ( (!isempty(PresentTitle)) && (!isempty(PresentSubtitle)) )
+ if ( (LcdSetup.ShowSubtitle) && (!isempty(PresentTitle)) && (!isempty(PresentSubtitle)) )
SetRunning(false,Present->GetTimeString(),PresentTitle,PresentSubtitle);
- else if (!isempty(PresentTitle)) SetRunning(false,Present->GetTimeString(),PresentTitle);
- } else
- SetRunning(false,tr("No EPG info available."), NULL);
+ else if ( (LcdSetup.ShowSubtitle) && !isempty(PresentTitle)) SetRunning(false,Present->GetTimeString(),PresentTitle);
+ } else
+ SetRunning(false,tr("No EPG info available."), NULL);
if ((Present = Schedule->GetFollowingEvent()) != NULL)
nextLcdUpdate=(Present->StartTime()<nextLcdUpdate)?Present->StartTime():nextLcdUpdate;
rtcycle = 10; // RT
@@ -841,7 +865,7 @@ void cLcd::Action(void) { // LCD output thread
}
if ( nextLcdUpdate <= time(NULL) )
nextLcdUpdate=(time(NULL)/60)*60+60;
- }
+ }
// get&display Radiotext
if (++rtcycle > 10) { // every 10 times
@@ -890,20 +914,20 @@ void cLcd::Action(void) { // LCD output thread
replayDvbApi->GetIndex(Current, Total, false); Total=(Total==0)?1:Total;
sprintf(tempbuffer,IndexToHMSF(Total));
SetProgress(IndexToHMSF(Current),tempbuffer, (100 * Current) / Total);
- }
+ }
- // copy
+ // copy
- BeginMutualExclusion(); // all data needed for output are copied here
+ BeginMutualExclusion(); // all data needed for output are copied here
memcpy(&OutStateData,&ThreadStateData, sizeof (cLcd::StateData));
ThreadStateData.showvolume=false;
- if (ThreadStateData.newscroll) { scrollpos=0; scrollwaitcnt=LcdSetup.Scrollwait; ThreadStateData.newscroll=false; }
- for (i=0;i<LCDMAXSTATES;i++) for (j=0;j<4;j++) {
+ if (ThreadStateData.newscroll) { scrollpos=0; scrollwaitcnt=LcdSetup.Scrollwait; ThreadStateData.newscroll=false; }
+ for (i=0;i<LCDMAXSTATES;i++) for (j=0;j<4;j++) {
ThreadStateData.lcddirty[i][j]=false;
- Lcddirty[i][j]= Lcddirty[i][j] || OutStateData.lcddirty[i][j];
- }
+ Lcddirty[i][j]= Lcddirty[i][j] || OutStateData.lcddirty[i][j];
+ }
EndMutualExclusion();
// scroller
@@ -911,56 +935,57 @@ void cLcd::Action(void) { // LCD output thread
if ( (OutStateData.State==PrevState) && ( OutStateData.State == Replay || OutStateData.State == Menu || OutStateData.State == Title ) ) {
switch (OutStateData.State) {
case Replay:
- ScrollState=LCDREPLAY; ScrollLine=1;
- break;
+ ScrollState=LCDREPLAY; ScrollLine=1;
+ break;
case Menu:
- ScrollState=LCDMENU; ScrollLine=1;
- break;
+ ScrollState=LCDMENU; ScrollLine=1;
+ break;
case Title:
ScrollState=LCDTITLE;
if (!ToggleMode) {
ScrollLine=2;
} else {
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(workstring2,OutStateData.lcdbuffer[LCDTITLE][1],wid);
+ // 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[LCDTITLE]) != lasttitlelen ) {
lasttitlelen=strlen(OutStateData.lcdfullbuffer[LCDTITLE]);
- scrollpos=0; scrollwaitcnt=LcdSetup.Scrollwait; ThreadStateData.newscroll=false;
- }
- break;
- default:
- break;
+ scrollpos=0; scrollwaitcnt=LcdSetup.Scrollwait; ThreadStateData.newscroll=false;
+ }
+ break;
+ default:
+ break;
}
- if ( ( strlen(OutStateData.lcdfullbuffer[ScrollState]) > (((ToggleMode)?1: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) ) {
+ if ( !(scrollcnt=(scrollcnt+1)%LcdSetup.Scrollspeed) ) {
scrollpos=(scrollpos+1)%strlen(OutStateData.lcdfullbuffer[ScrollState]);
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])];
- }
+ OutStateData.lcdfullbuffer[ScrollState][(scrollpos+i)%strlen(OutStateData.lcdfullbuffer[ScrollState])];
+ }
OutStateData.lcdbuffer[ScrollState][ScrollLine][wid]='\0';
for (i=0; i<wid; i++) {
OutStateData.lcdbuffer[ScrollState][ScrollLine+1][i]=
- OutStateData.lcdfullbuffer[ScrollState][(scrollpos+wid+i)%strlen(OutStateData.lcdfullbuffer[ScrollState])];
- }
+ OutStateData.lcdfullbuffer[ScrollState][(scrollpos+wid+i)%strlen(OutStateData.lcdfullbuffer[ScrollState])];
+ }
OutStateData.lcdbuffer[ScrollState][ScrollLine+1][wid]='\0';
- Lcddirty[ScrollState][ScrollLine]=Lcddirty[ScrollState][ScrollLine+1]=true;
+ Lcddirty[ScrollState][ScrollLine]=Lcddirty[ScrollState][ScrollLine+1]=true;
}
- } else if (!LcdSetup.ShowTime) Lcddirty[LCDTITLE][1]=true;
+ } else if ( (!LcdSetup.ShowTime) || (ToggleMode) ) Lcddirty[LCDTITLE][1]=true;
}
- // volume
+ // volume
if (OutStateData.showvolume) gettimeofday(&voltime,NULL);
if ( voltime.tv_sec != 0) { // volume
@@ -968,12 +993,12 @@ void cLcd::Action(void) { // LCD output thread
voltime.tv_sec=0;
OutStateData.barx=1; OutStateData.bary=1; OutStateData.barl=0; volume=false;
} else {
- volume=true;
+ volume=true;
OutStateData.barx=1; OutStateData.bary=((hgt==2)?2:3);
// shortening volume bar in togglemode (lcd with 2x20)
OutStateData.barl=(cellwid*((hgt==2 && !ToggleMode)?2:1)*wid*OutStateData.volume)/255;
- }
- }
+ }
+ }
if (volume) OutStateData.State = Vol;
// modes
@@ -987,34 +1012,34 @@ void cLcd::Action(void) { // LCD output thread
for (i=0;i<4;i++) if (Lcddirty[LCDMENU][i]) {
cLcd::Write(i+1,OutStateData.lcdbuffer[LCDMENU][i]);
Lcddirty[LCDMENU][i]=false;
- }
- PrevState=Menu;
+ }
+ PrevState=Menu;
break;
case Title: // Display 'titlescsreen' = 1
LineMode=0;
- if ( (LcdSetup.ShowTime) && ( (now.tv_usec < WakeUpCycle) || (PrevState != Title) ) ) {
- cLcd::GetTimeDateStat(workstring,OutStateData.CardStat);
- cLcd::Write(1,workstring);
+ if ( (LcdSetup.ShowTime) && ( (now.tv_usec < WakeUpCycle) || (PrevState != Title) || ( (ToggleMode) && (Lcddirty[LCDTITLE][1]) ) ) ) {
+ cLcd::GetTimeDateStat(workstring2,OutStateData.CardStat);
+ cLcd::Write(1,workstring2);
}
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;
+ 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;
}
PrevState = Title;
break;
case Replay: // Display date/time during replaying = 2
LineMode=1;
- if ( !ToggleMode && ((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=(ToggleMode)?0:1;i<4;i++) if (Lcddirty[LCDREPLAY][i]) {
- cLcd::Write(i+1,OutStateData.lcdbuffer[LCDREPLAY][i]);
- Lcddirty[LCDREPLAY][i]=false;
+ for (i=(ToggleMode)?0:1;i<4;i++) if (Lcddirty[LCDREPLAY][i]) {
+ cLcd::Write(i+1,OutStateData.lcdbuffer[LCDREPLAY][i]);
+ Lcddirty[LCDREPLAY][i]=false;
}
PrevState = Replay;
break;
@@ -1041,7 +1066,7 @@ void cLcd::Action(void) { // LCD output thread
PrevState = Vol;
break;
- default: // quite impossible :)
+ default: // quite impossible :)
break;
}
@@ -1049,7 +1074,7 @@ void cLcd::Action(void) { // LCD output thread
if ( (OutStateData.barx != barx) || (OutStateData.bary != bary) || (OutStateData.barl != barl) ) {
sprintf(workstring,"widget_set VDR prbar %d %d %d\n",OutStateData.barx,OutStateData.bary,OutStateData.barl);
sock_send_string(sock,workstring);
- barx=OutStateData.barx; bary=OutStateData.bary; barl=OutStateData.barl;
+ barx=OutStateData.barx; bary=OutStateData.bary; barl=OutStateData.barl;
}
// prio
@@ -1096,7 +1121,7 @@ void cLcd::Action(void) { // LCD output thread
sock_send_string(sock,"backlight on\n");
else
sock_send_string(sock,"backlight off\n");
- }
+ }
// keys
@@ -1106,7 +1131,7 @@ void cLcd::Action(void) { // LCD output thread
sock_send_string(sock,"screen_set VDR -heartbeat slash\n");
else
sock_send_string(sock,"screen_set VDR -heartbeat heart\n");
- }
+ }
if ( !(keycnt=(keycnt+1)%4) ) lastkeypressed='\0';
@@ -1139,16 +1164,16 @@ void cLcd::Action(void) { // LCD output thread
}
LCDd_dead++;
} else LCDd_dead=0;
- }
+ }
// keys (again)
if ( LcdMaxKeys && ( strlen(workstring) > 4 ) ) {
- for (i=0; i < (strlen(workstring)-4); i++ ) {
- if (workstring[i]=='k' && workstring[i+1]=='e' && workstring[i+2]=='y'
+ for (i=0; i < (strlen(workstring)-4); i++ ) {
+ if (workstring[i]=='k' && workstring[i+1]=='e' && workstring[i+2]=='y'
&& workstring[i+3]==' ' && workstring[i+4]!=lastkeypressed ) {
- lastkeypressed=workstring[i+4];
+ lastkeypressed=workstring[i+4];
for (j=0; j<LcdMaxKeys && workstring[i+4]!=LcdUsedKeys[j]; j++ ) {}
if (workstring[i+4] == LcdShiftKey) {
LcdShiftkeyPressed = ! LcdShiftkeyPressed;
@@ -1156,9 +1181,9 @@ void cLcd::Action(void) { // LCD output thread
sock_send_string(sock,"screen_set VDR -heartbeat on\n");
else
sock_send_string(sock,"screen_set VDR -heartbeat off\n");
- }
+ }
if ( (workstring[i+4] != LcdShiftKey) ) {
- if (LcdShiftkeyPressed) {
+ if (LcdShiftkeyPressed) {
//syslog(LOG_INFO, "shiftkey pressed: %c %d", workstring[i+4],j);
cRemote::Put(LcdShiftMap[j]);
LcdShiftkeyPressed=false;
@@ -1166,9 +1191,9 @@ void cLcd::Action(void) { // LCD output thread
} else {
//syslog(LOG_INFO, "normalkey pressed: %c %d", workstring[i+4],j);
cRemote::Put(LcdNormalMap[j]);
- }
- }
- }
+ }
+ }
+ }
}
}
@@ -1213,11 +1238,11 @@ void cLcd::Action(void) { // LCD output thread
break;
case 9: // MP3
if ( (OutStateData.State == Replay) && OutStateData.lcdfullbuffer[LCDREPLAY][0]=='[' &&
- OutStateData.lcdfullbuffer[LCDREPLAY][3]==']' &&
+ 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;
+ 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
@@ -1238,7 +1263,8 @@ void cLcd::Action(void) { // LCD output thread
sock_send_string(sock,lcdCommand);
}
}
- usleep(WakeUpCycle-(now.tv_usec%WakeUpCycle)); // sync to systemtime for nicer time output
+ usleep(WakeUpCycle-(now.tv_usec%WakeUpCycle)); // sync to systemtime for nicer time output
+ if (!Running()) return;
}
}
}
diff --git a/lcdproc.c b/lcdproc.c
index aad9238..89b9e38 100644
--- a/lcdproc.c
+++ b/lcdproc.c
@@ -15,11 +15,11 @@
#include "lcd.h"
#include "lcdtranstbl.h"
-static const char *VERSION = "0.0.10-jw6";
+static const char *VERSION = "0.0.10-jw7";
static const char *MAINMENUENTRY = NULL;
static const char *DESCRIPTION = trNOOP("LCDproc output");
-cLcd *LCDproc = new cLcd;
+cLcd *LCDproc;
bool replaymode=false;
bool menumode=false;
bool switched=false;
@@ -65,12 +65,12 @@ void cLcdFeed::ChannelSwitch(const cDevice *Device, int ChannelNumber)
{
//syslog(LOG_INFO, "lcdproc: cLcdFeed::ChannelSwitch %d %d", Device->CardIndex(), ChannelNumber);
if ( Device && Device->IsPrimaryDevice() ) {
- if (ChannelNumber) {
- LCDproc->SetLine(1,2," ");
+ if (ChannelNumber) {
+ LCDproc->SetLine(1,2," ");
LCDproc->SetLine(1,3," ");
- LCDproc->SetRunning(false,tr("Waiting for EPG info."), NULL);
+ LCDproc->SetRunning(false,tr("Waiting for EPG info."), NULL);
LCDproc->ChannelSwitched();
- switched = true;
+ switched = true;
} else switched = false;
LCDproc->SetPrimaryDevice( (cDevice *) Device );
}
@@ -82,7 +82,7 @@ void cLcdFeed::Recording(const cDevice *Device, const char *Name, const char *Fi
if (On)
LCDproc->SetCardStat(Device->CardIndex(),2);
else
- LCDproc->SetCardStat(Device->CardIndex(),1);
+ LCDproc->SetCardStat(Device->CardIndex(),1);
}
void cLcdFeed::Replaying(const cControl *DvbPlayerControl, const char *Name, const char *FileName, bool On)
@@ -94,12 +94,12 @@ void cLcdFeed::Replaying(const cControl *DvbPlayerControl, const char *Name, con
LCDproc->SetMain(2, Name);
LCDproc->SetThreadState( (cLcd::ThreadStates) 2); // Replaying
} else {
- LCDproc->SetReplayDevice(NULL);
+ LCDproc->SetReplayDevice(NULL);
LCDproc->SetProgress(NULL);
- LCDproc->SetLineC(1,LcdSetup.ShowTime?1:0,tempstringbuffer);
+ LCDproc->SetLineC(1,LcdSetup.ShowTime?1:0,tempstringbuffer);
LCDproc->SetThreadState( (cLcd::ThreadStates) 1); // Title
}
- menumode=false;
+ menumode=false;
}
void cLcdFeed::SetVolume(int Volume, bool Absolute)
@@ -111,13 +111,13 @@ void cLcdFeed::SetVolume(int Volume, bool Absolute)
void cLcdFeed::OsdClear(void)
{
//syslog(LOG_INFO, "lcdproc: cLcdFeed::OsdClear");
-
+
if (replaymode)
LCDproc->SetThreadState( (cLcd::ThreadStates) 2); // Replaying
- else
+ else
LCDproc->SetThreadState( (cLcd::ThreadStates) 1); // Title
menumode=false;
- if (group) {LCDproc->SetLineC(1,LcdSetup.ShowTime?1:0,tempstringbuffer); group=false; }
+ if (group) {LCDproc->SetLineC(1,LcdSetup.ShowTime?1:0,tempstringbuffer); group=false; }
}
void cLcdFeed::OsdTitle(const char *Title)
@@ -135,9 +135,9 @@ void cLcdFeed::OsdStatusMessage(const char *Message)
{
//syslog(LOG_INFO, "lcdproc: cLcdFeed::OsdStatusMessage '%s'", Message);
if ( Message ) {
- if ( menumode )
+ if ( menumode )
LCDproc->SetStatus(Message);
- else
+ else
LCDproc->SetWarning(Message);
}
else {
@@ -160,13 +160,13 @@ void cLcdFeed::OsdCurrentItem(const char *Text)
void cLcdFeed::OsdTextItem(const char *Text, bool Scroll)
{
//syslog(LOG_INFO, "lcdproc: cLcdFeed::OsdTextItem %s %d", Text, Scroll);
- if (Text)
+ if (Text)
LCDproc->SummaryInit( (char *) Text);
- else if (Scroll)
+ else if (Scroll)
LCDproc->SummaryUp();
else
LCDproc->SummaryDown();
- LCDproc->SetThreadState( (cLcd::ThreadStates) 3); // MISC
+ LCDproc->SetThreadState( (cLcd::ThreadStates) 3); // MISC
LCDproc->SummaryDisplay();
}
@@ -176,17 +176,17 @@ void cLcdFeed::OsdChannel(const char *Text)
LCDproc->SetLineC(1,LcdSetup.ShowTime?1:0,Text);
bool switching = group = !isdigit(Text[0]);
- if (!group) strcpy(tempstringbuffer,Text);
+ if (!group) strcpy(tempstringbuffer,Text);
for (unsigned int i=0; ( i<strlen(Text)-1 ) && !switching ; i++) {
- switching= isdigit(Text[i]) && Text[i+1]=='-' ;
+ switching= isdigit(Text[i]) && Text[i+1]=='-' ;
}
-
- if (switched || switching)
+
+ if (switched || switching)
LCDproc->SetThreadState( (cLcd::ThreadStates) 1); // TITLE
- else
+ else
LCDproc->SetThreadState( (cLcd::ThreadStates) 3); // MISC
-
- switched=false; menumode=false;
+
+ switched=false; menumode=false;
}
void cLcdFeed::OsdProgramme(time_t PresentTime, const char *PresentTitle, const char *PresentSubtitle, time_t FollowingTime, const char *FollowingTitle, const char *FollowingSubtitle)
@@ -197,22 +197,22 @@ void cLcdFeed::OsdProgramme(time_t PresentTime, const char *PresentTitle, const
strftime(buffer, sizeof(buffer), "%R", localtime_r(&PresentTime, &tm_r));
//syslog(LOG_INFO, "%5s %s", buffer, PresentTitle);
//syslog(LOG_INFO, "%5s %s", "", PresentSubtitle);
-
- if ( (!isempty(PresentTitle)) && (!isempty(PresentSubtitle)) )
+
+ if ( (LcdSetup.ShowSubtitle) && (!isempty(PresentTitle)) && (!isempty(PresentSubtitle)) )
LCDproc->SetRunning(false,buffer,PresentTitle,PresentSubtitle);
else if (!isempty(PresentTitle)) LCDproc->SetRunning(false,buffer,PresentTitle);
- else LCDproc->SetRunning(false,tr("No EPG info available."), NULL);
+ else LCDproc->SetRunning(false,tr("No EPG info available."), NULL);
strftime(buffer, sizeof(buffer), "%R", localtime_r(&FollowingTime, &tm_r));
//syslog(LOG_INFO, "%5s %s", buffer, FollowingTitle);
//syslog(LOG_INFO, "%5s %s", "", FollowingSubtitle);
-
- if ( (!isempty(FollowingTitle)) && (!isempty(FollowingSubtitle)) )
+
+ if ( (LcdSetup.ShowSubtitle) && (!isempty(FollowingTitle)) && (!isempty(FollowingSubtitle)) )
LCDproc->SetRunning(true,buffer,FollowingTitle,FollowingSubtitle);
else if (!isempty(FollowingTitle)) LCDproc->SetRunning(true,buffer,FollowingTitle);
- else LCDproc->SetRunning(true,tr("No EPG info available."), NULL);
+ else LCDproc->SetRunning(true,tr("No EPG info available."), NULL);
}
// ---
@@ -229,6 +229,7 @@ public:
virtual const char *CommandLineHelp(void);
virtual bool ProcessArgs(int argc, char *argv[]);
virtual bool Start(void);
+ virtual void Stop(void);
virtual void Housekeeping(void);
virtual const char *MainMenuEntry(void) { return MAINMENUENTRY; }
virtual cOsdMenu *MainMenuAction(void);
@@ -244,14 +245,13 @@ cPluginLcd::cPluginLcd(void)
// DON'T DO ANYTHING ELSE THAT MAY HAVE SIDE EFFECTS, REQUIRE GLOBAL
// VDR OBJECTS TO EXIST OR PRODUCE ANY OUTPUT!
lcdFeed = NULL;
-
+ LCDproc = NULL;
}
cPluginLcd::~cPluginLcd()
{
// Clean up after yourself!
delete lcdFeed;
- delete LCDproc;
}
const char *cPluginLcd::CommandLineHelp(void)
@@ -288,12 +288,18 @@ bool cPluginLcd::Start(void)
{
// Start any background activities the plugin shall perform.
lcdFeed = new cLcdFeed;
+ LCDproc = new cLcd;
if ( LCDproc->Connect(LCDprocHOST,LCDprocPORT) ) {
syslog(LOG_INFO, "LCDproc-Plugin started at %s:%d.",LCDprocHOST,LCDprocPORT);
return true;
}
syslog(LOG_INFO, "connection to LCDd at %s:%d failed.",LCDprocHOST,LCDprocPORT);
- return false;
+ return false;
+}
+
+void cPluginLcd::Stop(void)
+{
+ delete LCDproc;
}
void cPluginLcd::Housekeeping(void)
@@ -334,7 +340,7 @@ void cMenuEditStraTrItem::Set(void)
class cMenuSetupLcd : public cMenuSetupPage {
private:
- cLcdSetup newLcdSetup;
+ cLcdSetup newLcdSetup;
const char * RecordingStatusText[2];
const char * PrioBackFunctionText[3];
protected:
@@ -351,7 +357,7 @@ cMenuSetupLcd::cMenuSetupLcd(void)
RecordingStatusText[0] = tr("detailed");
RecordingStatusText[1] = tr("simple");
char str2[30];
- newLcdSetup=LcdSetup;
+ newLcdSetup=LcdSetup;
Add(new cMenuEditIntItem( tr("FullCycle"), &newLcdSetup.FullCycle,1,999));
Add(new cMenuEditIntItem( tr("TimeDateCycle"), &newLcdSetup.TimeCycle,0,LcdSetup.FullCycle));
Add(new cMenuEditIntItem( tr("VolumeKeep"), &newLcdSetup.VolumeKeep,0,999));
@@ -372,6 +378,7 @@ cMenuSetupLcd::cMenuSetupLcd(void)
}
Add(new cMenuEditStraItem( tr("Recording status"), &newLcdSetup.RecordingStatus, 2, RecordingStatusText));
Add(new cMenuEditBoolItem( tr("Show time"), &newLcdSetup.ShowTime));
+ Add(new cMenuEditBoolItem( tr("Show subtitle"), &newLcdSetup.ShowSubtitle));
}
void cMenuSetupLcd::Store(void)
@@ -395,8 +402,9 @@ void cMenuSetupLcd::Store(void)
sprintf(str2,"OutputNumber %d",i);
SetupStore(str2, LcdSetup.OutputFunction[i] = newLcdSetup.OutputFunction[i]);
}
- SetupStore("RecordingStatus", LcdSetup.RecordingStatus = newLcdSetup.RecordingStatus);
- SetupStore("ShowTime", LcdSetup.ShowTime = newLcdSetup.ShowTime);
+ SetupStore("RecordingStatus", LcdSetup.RecordingStatus = newLcdSetup.RecordingStatus);
+ SetupStore("ShowTime", LcdSetup.ShowTime = newLcdSetup.ShowTime);
+ SetupStore("ShowSubtitle", LcdSetup.ShowSubtitle = newLcdSetup.ShowSubtitle);
}
@@ -422,7 +430,7 @@ bool cPluginLcd::SetupParse(const char *Name, const char *Value)
else if (!strcasecmp(Name, "ClientPrioH")) LcdSetup.ClientPrioH = atoi(Value);
else if (!strcasecmp(Name, "BackLightWait")) LcdSetup.BackLightWait = atoi(Value);
else if (!strcasecmp(Name, "PrioWait")) LcdSetup.PrioWait = atoi(Value);
- else if (!strcasecmp(Name, "OutputNumber")) LcdSetup.OutputNumber= 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);
@@ -433,8 +441,9 @@ bool cPluginLcd::SetupParse(const char *Name, const char *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 if (!strcasecmp(Name, "RecordingStatus")) LcdSetup.RecordingStatus = atoi(Value);
- else if (!strcasecmp(Name, "ShowTime")) LcdSetup.ShowTime = atoi(Value);
+ else if (!strcasecmp(Name, "RecordingStatus")) LcdSetup.RecordingStatus = atoi(Value);
+ else if (!strcasecmp(Name, "ShowTime")) LcdSetup.ShowTime = atoi(Value);
+ else if (!strcasecmp(Name, "ShowSubtitle")) LcdSetup.ShowSubtitle = atoi(Value);
else
return false;
return true;
diff --git a/po/de_DE.po b/po/de_DE.po
index cec31cc..ec98a00 100644
--- a/po/de_DE.po
+++ b/po/de_DE.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: VDR 1.5.7\n"
"Report-Msgid-Bugs-To: <vdr@joachim-wilke.de>\n"
-"POT-Creation-Date: 2008-11-16 19:24+0100\n"
+"POT-Creation-Date: 2009-03-07 20:04+0100\n"
"PO-Revision-Date: 2007-08-12 20:41+0200\n"
"Last-Translator: Klaus Schmidinger <kls@cadsoft.de>\n"
"Language-Team: <vdr@linuxtv.org>\n"
@@ -15,19 +15,19 @@ msgstr ""
"Content-Type: text/plain; charset=ISO-8859-15\n"
"Content-Transfer-Encoding: 8bit\n"
-#: lcd.c:363
+#: lcd.c:370
msgid "Mute"
msgstr "Stumm"
-#: lcd.c:369 lcd.c:378
+#: lcd.c:376 lcd.c:379 lcd.c:385
msgid "Volume "
msgstr "Lautstärke "
-#: lcd.c:711
+#: lcd.c:729 lcd.c:732
msgid "RECORDING"
msgstr "AUFNAHME "
-#: lcd.c:835 lcdproc.c:205 lcdproc.c:215
+#: lcd.c:859 lcdproc.c:205 lcdproc.c:215
msgid "No EPG info available."
msgstr "Keine EPG Information verfügbar."
@@ -39,86 +39,90 @@ msgstr "LCDproc Ausgabe"
msgid "Waiting for EPG info."
msgstr "Suche nach EPG Information."
-#: lcdproc.c:348
+#: lcdproc.c:354
msgid "off"
msgstr "aus"
-#: lcdproc.c:349
+#: lcdproc.c:355
msgid "on"
msgstr "an"
-#: lcdproc.c:350
+#: lcdproc.c:356
msgid "auto"
msgstr "auto"
-#: lcdproc.c:351
+#: lcdproc.c:357
msgid "detailed"
msgstr "detailiert"
-#: lcdproc.c:352
+#: lcdproc.c:358
msgid "simple"
msgstr "einfach"
-#: lcdproc.c:355
+#: lcdproc.c:361
msgid "FullCycle"
msgstr "Zyklusdauer Statuszeile"
-#: lcdproc.c:356
+#: lcdproc.c:362
msgid "TimeDateCycle"
msgstr "davon Dauer Zeitanzeige"
-#: lcdproc.c:357
+#: lcdproc.c:363
msgid "VolumeKeep"
msgstr "Anzeigedauer Lautstärke"
-#: lcdproc.c:358
+#: lcdproc.c:364
msgid "Scrollwait"
msgstr "Zeit bis Text rollen"
-#: lcdproc.c:359
+#: lcdproc.c:365
msgid "Scrollspeed"
msgstr "Rollgeschwindigkeit"
-#: lcdproc.c:360
+#: lcdproc.c:366
msgid "Charmap"
msgstr "Zeichenkodierung"
-#: lcdproc.c:361
+#: lcdproc.c:367
msgid "AltShift"
msgstr "Alternative \"Heartbeat\"-Signalisierung"
-#: lcdproc.c:362
+#: lcdproc.c:368
msgid "BackLight"
msgstr "Hintergrundbeleuchtung"
-#: lcdproc.c:363
+#: lcdproc.c:369
msgid "SetClientPriority"
msgstr ""
-#: lcdproc.c:364
+#: lcdproc.c:370
msgid "NormalClientPriority"
msgstr ""
-#: lcdproc.c:365
+#: lcdproc.c:371
msgid "HighClientPriority"
msgstr ""
-#: lcdproc.c:366
+#: lcdproc.c:372
msgid "BackLightWait"
msgstr ""
-#: lcdproc.c:367
+#: lcdproc.c:373
msgid "PrioWait"
msgstr ""
-#: lcdproc.c:368 lcdproc.c:370
+#: lcdproc.c:374 lcdproc.c:376
msgid "OutputNumber"
msgstr "Zahl der Ausgänge am LCD"
-#: lcdproc.c:373
+#: lcdproc.c:379
msgid "Recording status"
msgstr "Aufnahemstatus"
-#: lcdproc.c:374
+#: lcdproc.c:380
msgid "Show time"
msgstr "Zeit anzeigen"
+
+#: lcdproc.c:381
+msgid "Show subtitle"
+msgstr "Untertitel anzeigen"
diff --git a/po/it_IT.po b/po/it_IT.po
index 96d88f3..acb5666 100644
--- a/po/it_IT.po
+++ b/po/it_IT.po
@@ -9,7 +9,7 @@ msgid ""
msgstr ""
"Project-Id-Version: VDR 1.5.7\n"
"Report-Msgid-Bugs-To: <vdr@joachim-wilke.de>\n"
-"POT-Creation-Date: 2008-11-16 19:24+0100\n"
+"POT-Creation-Date: 2009-03-07 20:30+0100\n"
"PO-Revision-Date: 2008-08-21 03:47+0100\n"
"Last-Translator: Diego Pierotto <vdr-italian@tiscali.it>\n"
"Language-Team: <vdr@linuxtv.org>\n"
@@ -17,19 +17,19 @@ msgstr ""
"Content-Type: text/plain; charset=ISO-8859-15\n"
"Content-Transfer-Encoding: 8bit\n"
-#: lcd.c:363
+#: lcd.c:370
msgid "Mute"
msgstr "Muto"
-#: lcd.c:369 lcd.c:378
+#: lcd.c:376 lcd.c:379 lcd.c:385
msgid "Volume "
msgstr "Volume"
-#: lcd.c:711
+#: lcd.c:729 lcd.c:732
msgid "RECORDING"
msgstr "REGISTRAZIONE"
-#: lcd.c:835 lcdproc.c:205 lcdproc.c:215
+#: lcd.c:859 lcdproc.c:205 lcdproc.c:215
msgid "No EPG info available."
msgstr "Nessun info EPG disponibile"
@@ -41,89 +41,94 @@ msgstr "Uscita LCDproc"
msgid "Waiting for EPG info."
msgstr "Attesa info EPG"
-#: lcdproc.c:348
+#: lcdproc.c:354
msgid "off"
msgstr "disattivo"
-#: lcdproc.c:349
+#: lcdproc.c:355
msgid "on"
msgstr "attivo"
-#: lcdproc.c:350
+#: lcdproc.c:356
msgid "auto"
msgstr "auto"
-#: lcdproc.c:351
+#: lcdproc.c:357
msgid "detailed"
msgstr "dettagliato"
-#: lcdproc.c:352
+#: lcdproc.c:358
msgid "simple"
msgstr "semplice"
-#: lcdproc.c:355
+#: lcdproc.c:361
msgid "FullCycle"
msgstr "Ciclo completo"
-#: lcdproc.c:356
+#: lcdproc.c:362
msgid "TimeDateCycle"
msgstr "Ciclo Data/Ora"
-#: lcdproc.c:357
+#: lcdproc.c:363
msgid "VolumeKeep"
msgstr "Mantieni volume"
-#: lcdproc.c:358
+#: lcdproc.c:364
msgid "Scrollwait"
msgstr "Attesa scorrimento"
-#: lcdproc.c:359
+#: lcdproc.c:365
msgid "Scrollspeed"
msgstr "Velocità scorrimento"
-#: lcdproc.c:360
+#: lcdproc.c:366
msgid "Charmap"
msgstr "Mappa caratteri"
-#: lcdproc.c:361
+#: lcdproc.c:367
msgid "AltShift"
msgstr "Alt Shift"
-#: lcdproc.c:362
+#: lcdproc.c:368
msgid "BackLight"
msgstr "Luminosità sfondo"
-#: lcdproc.c:363
+#: lcdproc.c:369
msgid "SetClientPriority"
msgstr "Imposta priorità client"
-#: lcdproc.c:364
+#: lcdproc.c:370
msgid "NormalClientPriority"
msgstr "Priorità normale client"
-#: lcdproc.c:365
+#: lcdproc.c:371
msgid "HighClientPriority"
msgstr "Priorità alta client"
-#: lcdproc.c:366
+#: lcdproc.c:372
msgid "BackLightWait"
msgstr "Attesa luminosità sfondo"
-#: lcdproc.c:367
+#: lcdproc.c:373
msgid "PrioWait"
msgstr ""
-#: lcdproc.c:368 lcdproc.c:370
+#: lcdproc.c:374 lcdproc.c:376
msgid "OutputNumber"
msgstr "Numero uscita"
-#: lcdproc.c:373
+#: lcdproc.c:379
msgid "Recording status"
msgstr "Stato registrazione"
-#: lcdproc.c:374
+#: lcdproc.c:380
msgid "Show time"
msgstr "Mostra ora"
+#: lcdproc.c:381
+#, fuzzy
+msgid "Show subtitle"
+msgstr "Mostra ora"
+
#~ msgid "Schedule - %s"
#~ msgstr "Programmi - %s"
diff --git a/setup.c b/setup.c
index 923a395..218f88d 100644
--- a/setup.c
+++ b/setup.c
@@ -10,17 +10,18 @@ cLcdSetup::cLcdSetup(void)
Scrollwait = 10;
Scrollspeed = 3;
Charmap = 0;
- AltShift = 0;
- BackLight = 2;
- ClientPrioN = 100;
- ClientPrioH = 255;
- SetPrio = 2;
- BackLightWait = 20;
- PrioWait = 60;
+ AltShift = 0;
+ BackLight = 2;
+ ClientPrioN = 100;
+ ClientPrioH = 255;
+ SetPrio = 2;
+ BackLightWait = 20;
+ PrioWait = 60;
OutputNumber = 0;
for (int i = 0; i < LCDMAXOUTPUTS; i++)
OutputFunction[i] = 0;
RecordingStatus = 0;
ShowTime = 1;
+ ShowSubtitle = 1;
}
diff --git a/setup.h b/setup.h
index 1539b6f..dbfe2d6 100644
--- a/setup.h
+++ b/setup.h
@@ -23,6 +23,7 @@ public:
int OutputFunction[LCDMAXOUTPUTS];
int RecordingStatus;
int ShowTime;
+ int ShowSubtitle;
public:
cLcdSetup(void);
};