summaryrefslogtreecommitdiff
blob: bd2b66c5bdd0e1d859562cfc148406f4b35601ea (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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
diff -Naur radioinfo-0.0.3.orig/HISTORY radioinfo-0.0.3/HISTORY
--- radioinfo-0.0.3.orig/HISTORY	2006-06-29 15:08:07.000000000 -0400
+++ radioinfo-0.0.3/HISTORY	2007-01-15 08:55:20.000000000 -0500
@@ -25,3 +25,10 @@
   than direct user input
 - Fixed some problems that occur when debug messages are turned off
 - Changed default OSD update time to 2 seconds
+ 
+ 
+2007-01-15: Version 0.0.4 
+ 
+- Cleaned up device handling 
+- Now works with VDR 1.5.0 
+
diff -Naur radioinfo-0.0.3.orig/radioinfo.c radioinfo-0.0.3/radioinfo.c
--- radioinfo-0.0.3.orig/radioinfo.c	2006-06-29 14:56:03.000000000 -0400
+++ radioinfo-0.0.3/radioinfo.c	2007-01-15 09:26:19.000000000 -0500
@@ -21,7 +21,7 @@
 #include "radioInfoSetupMenu.h"
 
 
-static const char *VERSION        = "0.0.3";
+static const char *VERSION        = "0.0.4";
 static const char *DESCRIPTION    = "Provides extra information for radio channels";
 static const char *MAINMENUENTRY  = NULL;
 
@@ -32,10 +32,12 @@
   // DON'T DO ANYTHING ELSE THAT MAY HAVE SIDE EFFECTS, REQUIRE GLOBAL
   // VDR OBJECTS TO EXIST OR PRODUCE ANY OUTPUT!
   //radioInfoMonitor = NULL;
-  radioInfoOsd = NULL;
+  radioInfoOsd      = NULL;
   radioInfoReceiver = NULL;
-  radioInfoFilter = NULL;
+  radioInfoFilter   = NULL; 
   
+  currentChannel = NULL; 
+  currentDevice  = NULL;   
   radioInfo = new sRadioInfo;
   radioInfo->updating = true;
   
@@ -173,10 +175,14 @@
 		// Is it a radio channel?
 		if (chan && chan->Vpid() == 0 && chan->Apid(0) != 0) 
 		{
+        currentChannel = (cChannel*) chan; 
+      currentDevice  = (cDevice*)  Device; 
+  
+
 		  resetInfo();
 		   
 		  // Find Info PID
-      radioInfoFilter->Attach();
+      radioInfoFilter->Attach(currentDevice); 
       
       // Ready for OSD
 		  wantsOsd = true;
@@ -196,6 +202,9 @@
     if (radioInfoReceiver) {
       radioInfoReceiver->Detach();    
     }
+    
+    currentChannel = NULL; 
+    currentDevice  = NULL;
   }
 
 }
@@ -238,19 +247,11 @@
   if (Pid != -1)
   {
     // Start receiving data from info PID
-    cChannel* c = Channels.GetByNumber(cDevice::CurrentChannel());
-    if (c) 
-    {  
-      if (radioInfoReceiver) { DEBUG_MSG("Receiver already exits; this shoudn't happen!"); }
-        
-      radioInfoReceiver = new cRadioInfoReceiver(Pid, c->Ca(), radioInfo);
-
-      radioInfoReceiver->Attach();
-    }
-    else {
-      DEBUG_MSG("ERROR Got NULL Channel!");
-    }
-  }
+  
+    if (radioInfoReceiver) { DEBUG_MSG("Receiver already exits; this shoudn't happen!"); }
+    radioInfoReceiver = new cRadioInfoReceiver(Pid, currentChannel->GetChannelID(), radioInfo); 
+    radioInfoReceiver->Attach(currentDevice); 
+   } 
   
   else // No PID found
   {
@@ -276,21 +277,6 @@
 }
 
 
-cDevice* cPluginRadioinfo::getDevice(void)
-{
-  cChannel* c = Channels.GetByNumber(cDevice::CurrentChannel());
-  if (c) {
-    return cDevice::GetDevice(c, 0);
-  }
-  else
-  {
-    //TODO: Can we do something better here?
-    return cDevice::ActualDevice();
-  }
-}
-
-
-
 sRadioInfoConfig config;
 
 
diff -Naur radioinfo-0.0.3.orig/radioInfoFilter.c radioinfo-0.0.3/radioInfoFilter.c
--- radioinfo-0.0.3.orig/radioInfoFilter.c	2006-05-21 00:26:26.000000000 -0400
+++ radioinfo-0.0.3/radioInfoFilter.c	2007-01-15 09:05:42.000000000 -0500
@@ -34,11 +34,11 @@
 }
 
 
-void cRadioInfoFilter::Attach(void)
+void cRadioInfoFilter::Attach(cDevice* device) 
 {
   if (!attachedDevice) 
   {
-    attachedDevice = cPluginRadioinfo::getDevice();
+attachedDevice = device; 
     if (attachedDevice) 
     {
       attachedDevice->AttachFilter(this);
diff -Naur radioinfo-0.0.3.orig/radioInfoFilter.h radioinfo-0.0.3/radioInfoFilter.h
--- radioinfo-0.0.3.orig/radioInfoFilter.h	2006-05-20 13:58:11.000000000 -0400
+++ radioinfo-0.0.3/radioInfoFilter.h	2007-01-15 09:07:13.000000000 -0500
@@ -17,7 +17,7 @@
 public:
   cRadioInfoFilter();
   
-  void Attach(void);
+  void Attach(cDevice* device); 
   void Detach(void);
   
 protected:
diff -Naur radioinfo-0.0.3.orig/radioinfo.h radioinfo-0.0.3/radioinfo.h
--- radioinfo-0.0.3.orig/radioinfo.h	2006-05-21 14:27:18.000000000 -0400
+++ radioinfo-0.0.3/radioinfo.h	2007-01-15 09:08:43.000000000 -0500
@@ -30,8 +30,8 @@
   
   
   bool wantsOsd;
-  
-  
+  cChannel* currentChannel; 
+  cDevice*  currentDevice;    
   
 public:
   cPluginRadioinfo(void);
@@ -53,7 +53,6 @@
   virtual cString SVDRPCommand(const char *Command, const char *Option, int &ReplyCode);
   
   void foundInfoPid(int Pid);
-  static cDevice* getDevice(void);
   
 protected:
   virtual void ChannelSwitch(const cDevice* Device, int ChannelNumber);
diff -Naur radioinfo-0.0.3.orig/radioInfoReceiver.c radioinfo-0.0.3/radioInfoReceiver.c
--- radioinfo-0.0.3.orig/radioInfoReceiver.c	2006-05-23 19:38:08.000000000 -0400
+++ radioinfo-0.0.3/radioInfoReceiver.c	2007-01-15 09:12:00.000000000 -0500
@@ -8,7 +8,7 @@
 
 
 
-cRadioInfoReceiver::cRadioInfoReceiver(int Pid, int Ca, sRadioInfo* Ri) : cReceiver(Ca, -1, Pid)
+cRadioInfoReceiver::cRadioInfoReceiver(int Pid, tChannelID ChannelID, sRadioInfo* Ri) : cReceiver(ChannelID, -1, Pid) 
 {
   DEBUG_MSG("RadioInfoReceiver Created.");
   radioInfo = Ri;
@@ -18,11 +18,11 @@
 }
 
 
-void cRadioInfoReceiver::Attach(void)
+void cRadioInfoReceiver::Attach(cDevice* device)
 {
 if (!attachedDevice) 
   {
-    attachedDevice = cPluginRadioinfo::getDevice();
+    attachedDevice = device;
     if (attachedDevice) 
     {
       attachedDevice->AttachReceiver(this);
diff -Naur radioinfo-0.0.3.orig/radioInfoReceiver.h radioinfo-0.0.3/radioInfoReceiver.h
--- radioinfo-0.0.3.orig/radioInfoReceiver.h	2006-05-20 13:58:07.000000000 -0400
+++ radioinfo-0.0.3/radioInfoReceiver.h	2007-01-15 09:13:31.000000000 -0500
@@ -15,9 +15,8 @@
   cDevice* attachedDevice;
    
 public:
-  cRadioInfoReceiver(int Pid, int Ca, sRadioInfo* Ri);
-  
-  void Attach(void);
+  cRadioInfoReceiver(int Pid, tChannelID ChannelID, sRadioInfo* Ri);   
+  void Attach(cDevice* device); 
   void Detach(void);
   
 protected: