diff -Naur graphlcd-0.1.4.orig/state.c graphlcd-0.1.4/state.c --- graphlcd-0.1.4.orig/state.c 2007-02-04 23:35:16.317687570 +0100 +++ graphlcd-0.1.4/state.c 2007-02-04 23:42:12.065780817 +0100 @@ -16,6 +16,7 @@ #include #include +#include #include "compat.h" @@ -654,6 +655,8 @@ void cGraphLCDState::GetProgramme() { + bool ptitle = false; + mutex.Lock(); #if VDRVERSNUM < 10300 const cEventInfo * present = NULL, * following = NULL; @@ -670,9 +673,11 @@ { event.presentTime = present->GetTime(); event.presentTitle = ""; - if (!isempty(present->GetTitle())) + if (!isempty(present->GetTitle())) { event.presentTitle = present->GetTitle(); event.presentSubtitle = ""; + ptitle = true; + } if (!isempty(present->GetSubtitle())) event.presentSubtitle = present->GetSubtitle(); } @@ -704,9 +709,11 @@ { event.presentTime = present->StartTime(); event.presentTitle = ""; - if (!isempty(present->Title())) + if (!isempty(present->Title())) { event.presentTitle = present->Title(); event.presentSubtitle = ""; + ptitle = true; + } if (!isempty(present->ShortText())) event.presentSubtitle = present->ShortText(); } @@ -724,6 +731,54 @@ } } #endif + +#if VDRVERSNUM >= 10330 + { // get&display Radiotext + 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 rtpinfo[2][65], rtstr[140]; + strcpy(rtpinfo[0], rtext.rds_title); + strcpy(rtpinfo[1], rtext.rds_artist); + sprintf(rtstr, "%02d:%02d %s | %s", rtext.title_start->tm_hour, rtext.title_start->tm_min, trim(((std::string)(rtpinfo[0]))).c_str(), trim(((std::string)(rtpinfo[1]))).c_str()); + ptitle ? event.presentSubtitle = rtstr : event.presentTitle = rtstr; + } + else if (rtext.rds_info > 0) { + char rtstr[65]; + strcpy(rtstr, rtext.rds_text); + ptitle ? event.presentSubtitle = trim(rtstr) : event.presentTitle = trim(rtstr); + } + } + } + } +#endif + +#if VDRVERSNUM >= 10330 + { // get&display LcrData + 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 ) + { + char lcrStringParts[3][25], lcrString[100]; + strcpy( lcrStringParts[0], (const char *)lcrData.destination ); + strcpy( lcrStringParts[1], (const char *)lcrData.price ); + strcpy( lcrStringParts[2], (const char *)lcrData.pulse ); + sprintf(lcrString, "%s | %s", trim((std::string)(lcrStringParts[1])).c_str(), trim((std::string)(lcrStringParts[2])).c_str()); + event.presentTitle = trim(lcrStringParts[0]); + event.presentSubtitle = trim(lcrString); + } + } + } + } +#endif mutex.Unlock(); } diff -Naur graphlcd-0.1.4.orig/state.h graphlcd-0.1.4/state.h --- graphlcd-0.1.4.orig/state.h 2007-02-04 23:35:16.317687570 +0100 +++ graphlcd-0.1.4/state.h 2007-02-04 23:43:05.728759351 +0100 @@ -130,4 +130,21 @@ tVolumeState GetVolumeState(); }; +// Radiotext +struct RadioTextService_v1_0 { + int rds_info; + int rds_pty; + char *rds_text; + char *rds_title; + char *rds_artist; + struct tm *title_start; +}; + +// LcrData +struct LcrService_v1_0 { + cString destination; + cString price; + cString pulse; +}; + #endif