diff -up autopatch/lcd.c ./lcd.c --- autopatch/lcd.c Sun Mar 5 19:25:08 2006 +++ ./lcd.c Tue Mar 7 20:51:22 2006 @@ -622,6 +622,9 @@ void cLcd::Action(void) { // LCD output // RT static int rtcycle; + // LCR + static int lcrCycle; + // backlight init if ((lastBackLight=LcdSetup.BackLight)) sock_send_string(sock,"backlight on\n"); @@ -705,6 +708,7 @@ void cLcd::Action(void) { // LCD output if ((Present = Schedule->GetFollowingEvent()) != NULL) nextLcdUpdate=(Present->GetTime()GetTime():nextLcdUpdate; rtcycle = 10; // RT + lcrCycle = 10; // LCR } } if ( nextLcdUpdate <= time(NULL) ) @@ -735,6 +739,7 @@ void cLcd::Action(void) { // LCD output if ((Present = Schedule->GetFollowingEvent()) != NULL) nextLcdUpdate=(Present->StartTime()StartTime():nextLcdUpdate; rtcycle = 10; // RT + lcrCycle = 10; // LCR } } if ( nextLcdUpdate <= time(NULL) ) @@ -763,7 +768,26 @@ void cLcd::Action(void) { // LCD output } 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 diff -up autopatch/lcd.c.orig ./lcd.c.orig --- autopatch/lcd.c.orig Sun Feb 26 20:11:02 2006 +++ ./lcd.c.orig Sun Mar 5 19:25:08 2006 @@ -11,6 +11,7 @@ #include "lcd.h" #include "sockets.h" #include "i18n.h" +#include #ifdef LCD_EXT_KEY_CONF #include LCD_EXT_KEY_CONF @@ -390,6 +391,7 @@ void cLcd::SetRunning( bool nownext, con void cLcd::SummaryInit(char *string) { SummaryText = string; SummaryTextL = strlen(string); + dsyslog("> %i", SummaryTextL); SummaryCurrent=0; } @@ -406,7 +408,7 @@ void cLcd::SummaryUp() { } void cLcd::SummaryDisplay() { - if ( (!connected) || (SummaryTextL < 1) ) return; + if ( (!connected) || (SummaryTextL < 1) || !SummaryText ) return; char workstring[256]; unsigned int i, offset=0; @@ -617,6 +619,8 @@ void cLcd::Action(void) { // LCD output bool Lcddirty[LCDMAXSTATES][4]; bool LcdShiftkeyPressed=false; char priostring[35]; + // RT + static int rtcycle; // backlight init if ((lastBackLight=LcdSetup.BackLight)) @@ -700,6 +704,7 @@ void cLcd::Action(void) { // LCD output SetRunning(false,tr("No EPG info available."), NULL); if ((Present = Schedule->GetFollowingEvent()) != NULL) nextLcdUpdate=(Present->GetTime()GetTime():nextLcdUpdate; + rtcycle = 10; // RT } } if ( nextLcdUpdate <= time(NULL) ) @@ -729,12 +734,36 @@ void cLcd::Action(void) { // LCD output SetRunning(false,tr("No EPG info available."), NULL); if ((Present = Schedule->GetFollowingEvent()) != NULL) nextLcdUpdate=(Present->StartTime()StartTime():nextLcdUpdate; + rtcycle = 10; // RT } } if ( nextLcdUpdate <= time(NULL) ) 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"); + } #endif // replaying diff -up autopatch/lcd.h ./lcd.h --- autopatch/lcd.h Sun Feb 26 20:11:01 2006 +++ ./lcd.h Tue Mar 7 20:46:30 2006 @@ -89,4 +89,11 @@ struct RadioTextService_v1_0 { struct tm *title_start; }; +// LcrData +struct LcrService_v1_0 { + cString destination; + cString price; + cString pulse; +}; + #endif //__LCD_H diff -up autopatch/lcd.h.orig ./lcd.h.orig --- autopatch/lcd.h.orig Sun Feb 26 20:11:02 2006 +++ ./lcd.h.orig Sun Feb 26 20:11:01 2006 @@ -79,4 +79,14 @@ class cLcd : public cThread { bool channelSwitched; }; +// Radiotext +struct RadioTextService_v1_0 { + int rds_info; + int rds_pty; + char *rds_text; + char *rds_title; + char *rds_artist; + struct tm *title_start; +}; + #endif //__LCD_H