summaryrefslogtreecommitdiff
path: root/patches/lcdproc-0.0.10-rtservice.diff
blob: f256ca231d77f08f716d19a46a0a2b70d9deb9b4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
diff -Nru lcdproc-0.0.10.org/lcd.c lcdproc-0.0.10.diff/lcd.c
--- lcdproc-0.0.10.org/lcd.c	2004-01-17 17:40:28.000000000 +0100
+++ lcdproc-0.0.10.diff/lcd.c	2006-01-07 11:48:29.000000000 +0100
@@ -11,6 +11,7 @@
 #include "lcd.h"
 #include "sockets.h"
 #include "i18n.h"
+#include <vdr/plugin.h>
 
 #ifdef LCD_EXT_KEY_CONF 
 #include LCD_EXT_KEY_CONF 
@@ -613,6 +614,8 @@
   bool Lcddirty[LCDMAXSTATES][4];
   bool LcdShiftkeyPressed=false;
   char priostring[35];
+  // RT
+  static int rtcycle;
   
   // backlight init 
   if ((lastBackLight=LcdSetup.BackLight))
@@ -693,6 +696,7 @@
                SetRunning(false,tr("No EPG info available."), NULL);
             if ((Present = Schedule->GetFollowingEvent()) != NULL)
               nextLcdUpdate=(Present->GetTime()<nextLcdUpdate)?Present->GetTime():nextLcdUpdate;
+            rtcycle = 10; // RT
          }
       }
      if ( nextLcdUpdate <= time(NULL) )
@@ -724,6 +728,7 @@
                SetRunning(false,tr("No EPG info available."), NULL); 
             if ((Present = Schedule->GetFollowingEvent()) != NULL)
               nextLcdUpdate=(Present->StartTime()<nextLcdUpdate)?Present->StartTime():nextLcdUpdate;
+            rtcycle = 10; // RT
          }
       }
      if ( nextLcdUpdate <= time(NULL) )
@@ -734,6 +739,29 @@
 
 #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
     
     if ( (now.tv_usec < WakeUpCycle) && (replayDvbApi) ) {
diff -Nru lcdproc-0.0.10.org/lcd.h lcdproc-0.0.10.diff/lcd.h
--- lcdproc-0.0.10.org/lcd.h	2002-11-16 10:17:42.000000000 +0100
+++ lcdproc-0.0.10.diff/lcd.h	2006-01-07 11:44:30.000000000 +0100
@@ -77,4 +77,14 @@
     int closing ;
 };
 
+// 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