From d40a2445b68a7153515e1905704f9c401ddb82f4 Mon Sep 17 00:00:00 2001 From: Joachim Wilke Date: Sun, 24 Sep 2006 00:00:00 +0200 Subject: Version 0.0.10-jw1 --- lcd.c | 79 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 69 insertions(+), 10 deletions(-) (limited to 'lcd.c') diff --git a/lcd.c b/lcd.c index d8cb8e7..abd95dd 100644 --- a/lcd.c +++ b/lcd.c @@ -11,6 +11,7 @@ #include "lcd.h" #include "sockets.h" #include "i18n.h" +#include #ifdef LCD_EXT_KEY_CONF #include LCD_EXT_KEY_CONF @@ -43,6 +44,7 @@ cLcd::cLcd() { for (i=0;i= LcdSetup.TimeCycle) )) { if (wid > 19) snprintf(string,wid+1,"<%s %02d.%02d %02d:%02d:%02d>", - WeekDayName(now->tm_wday), now->tm_mday, now->tm_mon+1, now->tm_hour, now->tm_min,now->tm_sec); + *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); @@ -613,6 +618,11 @@ void cLcd::Action(void) { // LCD output thread bool Lcddirty[LCDMAXSTATES][4]; bool LcdShiftkeyPressed=false; char priostring[35]; + // RT + static int rtcycle; + + // LCR + static int lcrCycle; // backlight init if ((lastBackLight=LcdSetup.BackLight)) @@ -664,12 +674,15 @@ void cLcd::Action(void) { // LCD output thread voltime.tv_sec=0; for (i=0;iGetFollowingEvent()) != NULL) nextLcdUpdate=(Present->GetTime()GetTime():nextLcdUpdate; + rtcycle = 10; // RT + lcrCycle = 10; // LCR } } if ( nextLcdUpdate <= time(NULL) ) nextLcdUpdate=(time(NULL)/60)*60+60; - else if ( nextLcdUpdate > time(NULL)+60 ) - nextLcdUpdate=(time(NULL)/60)*60+60; } #else @@ -724,16 +737,58 @@ void cLcd::Action(void) { // LCD output thread SetRunning(false,tr("No EPG info available."), NULL); if ((Present = Schedule->GetFollowingEvent()) != NULL) nextLcdUpdate=(Present->StartTime()StartTime():nextLcdUpdate; + rtcycle = 10; // RT + lcrCycle = 10; // LCR } } if ( nextLcdUpdate <= time(NULL) ) nextLcdUpdate=(time(NULL)/60)*60+60; - else if ( nextLcdUpdate > time(NULL)+60 ) - nextLcdUpdate=(time(NULL)/60)*60+60; } #endif +#if VDRVERSNUM >= 10330 + // get&display Radiotext + if (++rtcycle > 10) { // every 10 times + cPlugin *p; + p = cPluginManager::CallFirstService("RadioTextService-v1.0", NULL); + if (p) { + RadioTextService_v1_0 rtext; + if (cPluginManager::CallFirstService("RadioTextService-v1.0", &rtext)) { + if (rtext.rds_info == 2 && strstr(rtext.rds_title, "---") == NULL) { + char timestr[20]; + sprintf(timestr, "%02d:%02d", rtext.title_start->tm_hour, rtext.title_start->tm_min); + SetRunning(false, timestr, rtext.rds_title, rtext.rds_artist); + } + else if (rtext.rds_info > 0) { + SetRunning(false, NULL, rtext.rds_text); + } + } + } + rtcycle = 0; + //printf("lcdproc - get Radiotext ...\n"); + } + // get&display LcrData + if (lcrCycle++ == 10) // every 10 times + { + lcrCycle = 0; + cPlugin *p; + p = cPluginManager::CallFirstService("LcrService-v1.0", NULL); + if (p) + { + LcrService_v1_0 lcrData; + if (cPluginManager::CallFirstService("LcrService-v1.0", &lcrData)) + { + if ( strstr( lcrData.destination, "---" ) == NULL ) + { + SetRunning(false, (const char *)lcrData.destination, (const char *)lcrData.price, (const char *)lcrData.pulse); + nextLcdUpdate = 0; //trigger next epg update + } + } + } + } +#endif + // replaying if ( (now.tv_usec < WakeUpCycle) && (replayDvbApi) ) { @@ -1021,3 +1076,7 @@ void cLcd::Action(void) { // LCD output thread usleep(WakeUpCycle-(now.tv_usec%WakeUpCycle)); // sync to systemtime for nicer time output } } + +void cLcd::ChannelSwitched() { + channelSwitched = true; +} -- cgit v1.2.3