Memory Management Improved
[pierogi] / keysets / dish.cpp
1 #include "dish.h"
2 #include "protocols/dishprotocol.h"
3
4 DishReceiver1::DishReceiver1(
5   unsigned int index)
6   : PIRKeysetMetaData(
7       "Sat Keyset 1",
8       Dish_Make,
9       index)
10 {
11 }
12
13
14 void DishReceiver1::populateProtocol(
15   QObject *guiObject)
16 {
17   if (threadableProtocol)
18   {
19     // If the pointer is not null, the keyset must already be populated.
20     return;
21   }
22
23   threadableProtocol = new DishProtocol(guiObject, index);
24
25   setPreData(0x00, 5);
26
27   addDishKey("info", Info_Key, 0x00, 0x00);
28   addDishKey("power_on", PowerOn_Key, 0x01, 0x00);
29   addDishKey("power", Power_Key, 0x02, 0x00);
30   addDishKey("1", One_Key, 0x04, 0x00);
31   addDishKey("2", Two_Key, 0x05, 0x00);
32   addDishKey("3", Three_Key, 0x06, 0x00);
33   addDishKey("4", Four_Key, 0x08, 0x00);
34   addDishKey("5", Five_Key, 0x09, 0x00);
35   addDishKey("6", Six_Key, 0x0A, 0x00);
36   addDishKey("menu", Menu_Key, 0x0B, 0x00);
37   addDishKey("7", Seven_Key, 0x0C, 0x00);
38   addDishKey("8", Eight_Key, 0x0D, 0x00);
39   addDishKey("9", Nine_Key, 0x0E, 0x00);
40
41   addDishKey("select", Select_Key, 0x10, 0x00); // "OK", "ENTER"
42   addDishKey("select", Enter_Key, 0x10, 0x00); // "OK", "ENTER"
43   addDishKey("0", Zero_Key, 0x11, 0x00);
44   addDishKey("cancel", Exit_Key, 0x12, 0x00);  // "Exit"
45   addDishKey("guide", Guide_Key, 0x14, 0x00);
46 //  addDishKey("mute", Mute_Key, 0x15, 0x00);
47   addDishKey("livetv", LiveTV_Key, 0x16, 0x00); // "view"
48   addDishKey("tv_vcr", Input_Key, 0x17, 0x00); // "TV/VIDEO", "input"
49   addDishKey("right", Right_Key, 0x18, 0x00); // "VolUp"
50 //  addDishKey("right", VolumeUp_Key, 0x18, 0x00); // "VolUp"
51   addDishKey("up", Up_Key, 0x1A, 0x00); // "ChanUp"
52   addDishKey("up", ChannelUp_Key, 0x1A, 0x00); // "ChanUp"
53   addDishKey("recall", PrevChannel_Key, 0x1B, 0x00); // "prev"
54   addDishKey("left", Left_Key, 0x1C, 0x00); // "VolDown"
55 //  addDishKey("left", VolumeDown_Key, 0x1C, 0x00); // "VolDown"
56   addDishKey("down", Down_Key, 0x1E, 0x00); // "ChanDown"
57   addDishKey("down", ChannelDown_Key, 0x1E, 0x00); // "ChanDown"
58   addDishKey("record", Record_Key, 0x1F, 0x00);
59
60   addDishKey("pause", Pause_Key, 0x20, 0x00);
61   addDishKey("stop", Stop_Key, 0x21, 0x00);
62   addDishKey("sys_info", Unmapped_Key, 0x24, 0x00);
63   addDishKey("asterisk", Unmapped_Key, 0x25, 0x00); // "*/ptv_list"
64   addDishKey("pound", Unmapped_Key, 0x26, 0x00); // "#/search"
65   addDishKey("power_off", PowerOff_Key, 0x27, 0x00);
66   addDishKey("sat", Unmapped_Key, 0x29, 0x00);
67   addDishKey("red", Red_Key, 0x2E, 0x00);
68   addDishKey("greenR", Unmapped_Key, 0x2F, 0x00);
69
70   addDishKey("green", Green_Key, 0x30, 0x00);
71   addDishKey("yellow", Yellow_Key, 0x31, 0x00);
72   addDishKey("blue", Blue_Key, 0x32, 0x00);
73   addDishKey("dish_home", Unmapped_Key, 0x34, 0x00);
74   addDishKey("sys_info2", Unmapped_Key, 0x36, 0x00);
75   addDishKey("dish_home2", Unmapped_Key, 0x38, 0x00);
76
77   addDishKey("mute", Mute_Key, 0x15, 0x01);
78   addDishKey("vol+", VolumeUp_Key, 0x19, 0x01);
79   addDishKey("vol-", VolumeDown_Key, 0x1D, 0x01);
80   addDishKey("tv", Unmapped_Key, 0x2A, 0x01);
81
82   addDishKey("play", Play_Key, 0x03, 0x10);
83   addDishKey("PAGEDN", PageDown_Key, 0x07, 0x10);
84   addDishKey("PAGEUP", PageUp_Key, 0x0F, 0x10);
85
86   addDishKey("rew", Rewind_Key, 0x31, 0x10);
87   addDishKey("fwd", Unmapped_Key, 0x32, 0x10);
88   addDishKey("dish", Unmapped_Key, 0x34, 0x10);
89   addDishKey("skip_back", Replay_Key, 0x36, 0x10);
90   addDishKey("skip_fwd", Advance_Key, 0x37, 0x10);
91   addDishKey("dvr", HDDInput_Key, 0x39, 0x10);
92   addDishKey("pip", PIP_Key, 0x3A, 0x10);
93   addDishKey("position", PIPMove_Key, 0x3B, 0x10);
94   addDishKey("swap", PIPSwap_Key, 0x3D, 0x10);
95 }
96
97
98 DishReceiver1a::DishReceiver1a(
99   unsigned int index)
100   : DishReceiver1(index)
101 {
102   setKeysetName("Sat Keyset 1 mode 2");
103 }
104
105
106 void DishReceiver1a::populateProtocol(
107   QObject *guiObject)
108 {
109   if (threadableProtocol)
110   {
111     // If the pointer is not null, the keyset must already be populated.
112     return;
113   }
114
115   DishReceiver1::populateProtocol(guiObject);
116
117   setPreData(0x01, 5);
118 }
119
120
121 DishReceiver1b::DishReceiver1b(
122   unsigned int index)
123   : DishReceiver1(index)
124 {
125   setKeysetName("Sat Keyset 1 mode 3");
126 }
127
128
129 void DishReceiver1b::populateProtocol(
130   QObject *guiObject)
131 {
132   if (threadableProtocol)
133   {
134     // If the pointer is not null, the keyset must already be populated.
135     return;
136   }
137
138   DishReceiver1::populateProtocol(guiObject);
139
140   setPreData(0x02, 5);
141 }
142
143
144 DishReceiver1c::DishReceiver1c(
145   unsigned int index)
146   : DishReceiver1(index)
147 {
148   setKeysetName("Sat Keyset 1 mode 4");
149 }
150
151
152 void DishReceiver1c::populateProtocol(
153   QObject *guiObject)
154 {
155   if (threadableProtocol)
156   {
157     // If the pointer is not null, the keyset must already be populated.
158     return;
159   }
160
161   DishReceiver1::populateProtocol(guiObject);
162
163   setPreData(0x03, 5);
164 }
165
166
167 DishReceiver1d::DishReceiver1d(
168   unsigned int index)
169   : DishReceiver1(index)
170 {
171   setKeysetName("Sat Keyset 1 mode 5");
172 }
173
174
175 void DishReceiver1d::populateProtocol(
176   QObject *guiObject)
177 {
178   if (threadableProtocol)
179   {
180     // If the pointer is not null, the keyset must already be populated.
181     return;
182   }
183
184   DishReceiver1::populateProtocol(guiObject);
185
186   setPreData(0x04, 5);
187 }
188
189
190 DishReceiver1e::DishReceiver1e(
191   unsigned int index)
192   : DishReceiver1(index)
193 {
194   setKeysetName("Sat Keyset 1 mode 6");
195 }
196
197
198 void DishReceiver1e::populateProtocol(
199   QObject *guiObject)
200 {
201   if (threadableProtocol)
202   {
203     // If the pointer is not null, the keyset must already be populated.
204     return;
205   }
206
207   DishReceiver1::populateProtocol(guiObject);
208
209   setPreData(0x05, 5);
210 }
211
212
213 DishReceiver1f::DishReceiver1f(
214   unsigned int index)
215   : DishReceiver1(index)
216 {
217   setKeysetName("Sat Keyset 1 mode 7");
218 }
219
220
221 void DishReceiver1f::populateProtocol(
222   QObject *guiObject)
223 {
224   if (threadableProtocol)
225   {
226     // If the pointer is not null, the keyset must already be populated.
227     return;
228   }
229
230   DishReceiver1::populateProtocol(guiObject);
231
232   setPreData(0x06, 5);
233 }
234
235
236 DishReceiver1g::DishReceiver1g(
237   unsigned int index)
238   : DishReceiver1(index)
239 {
240   setKeysetName("Sat Keyset 1 mode 8");
241 }
242
243
244 void DishReceiver1g::populateProtocol(
245   QObject *guiObject)
246 {
247   if (threadableProtocol)
248   {
249     // If the pointer is not null, the keyset must already be populated.
250     return;
251   }
252
253   DishReceiver1::populateProtocol(guiObject);
254
255   setPreData(0x07, 5);
256 }
257
258
259 DishReceiver1h::DishReceiver1h(
260   unsigned int index)
261   : DishReceiver1(index)
262 {
263   setKeysetName("Sat Keyset 1 mode 9");
264 }
265
266
267 void DishReceiver1h::populateProtocol(
268   QObject *guiObject)
269 {
270   if (threadableProtocol)
271   {
272     // If the pointer is not null, the keyset must already be populated.
273     return;
274   }
275
276   DishReceiver1::populateProtocol(guiObject);
277
278   setPreData(0x08, 5);
279 }
280
281
282 DishReceiver1i::DishReceiver1i(
283   unsigned int index)
284   : DishReceiver1(index)
285 {
286   setKeysetName("Sat Keyset 1 mode 10");
287 }
288
289
290 void DishReceiver1i::populateProtocol(
291   QObject *guiObject)
292 {
293   if (threadableProtocol)
294   {
295     // If the pointer is not null, the keyset must already be populated.
296     return;
297   }
298
299   DishReceiver1::populateProtocol(guiObject);
300
301   setPreData(0x09, 5);
302 }
303
304
305 DishReceiver1j::DishReceiver1j(
306   unsigned int index)
307   : DishReceiver1(index)
308 {
309   setKeysetName("Sat Keyset 1 mode 11");
310 }
311
312
313 void DishReceiver1j::populateProtocol(
314   QObject *guiObject)
315 {
316   if (threadableProtocol)
317   {
318     // If the pointer is not null, the keyset must already be populated.
319     return;
320   }
321
322   DishReceiver1::populateProtocol(guiObject);
323
324   setPreData(0x0A, 5);
325 }
326
327
328 DishReceiver1k::DishReceiver1k(
329   unsigned int index)
330   : DishReceiver1(index)
331 {
332   setKeysetName("Sat Keyset 1 mode 12");
333 }
334
335
336 void DishReceiver1k::populateProtocol(
337   QObject *guiObject)
338 {
339   if (threadableProtocol)
340   {
341     // If the pointer is not null, the keyset must already be populated.
342     return;
343   }
344
345   DishReceiver1::populateProtocol(guiObject);
346
347   setPreData(0x0B, 5);
348 }
349
350
351 DishReceiver1l::DishReceiver1l(
352   unsigned int index)
353   : DishReceiver1(index)
354 {
355   setKeysetName("Sat Keyset 1 mode 13");
356 }
357
358
359 void DishReceiver1l::populateProtocol(
360   QObject *guiObject)
361 {
362   if (threadableProtocol)
363   {
364     // If the pointer is not null, the keyset must already be populated.
365     return;
366   }
367
368   DishReceiver1::populateProtocol(guiObject);
369
370   setPreData(0x0C, 5);
371 }
372
373
374 DishReceiver1m::DishReceiver1m(
375   unsigned int index)
376   : DishReceiver1(index)
377 {
378   setKeysetName("Sat Keyset 1 mode 14");
379 }
380
381
382 void DishReceiver1m::populateProtocol(
383   QObject *guiObject)
384 {
385   if (threadableProtocol)
386   {
387     // If the pointer is not null, the keyset must already be populated.
388     return;
389   }
390
391   DishReceiver1::populateProtocol(guiObject);
392
393   setPreData(0x0D, 5);
394 }
395
396
397 DishReceiver1n::DishReceiver1n(
398   unsigned int index)
399   : DishReceiver1(index)
400 {
401   setKeysetName("Sat Keyset 1 mode 15");
402 }
403
404
405 void DishReceiver1n::populateProtocol(
406   QObject *guiObject)
407 {
408   if (threadableProtocol)
409   {
410     // If the pointer is not null, the keyset must already be populated.
411     return;
412   }
413
414   DishReceiver1::populateProtocol(guiObject);
415
416   setPreData(0x0E, 5);
417 }
418
419
420 DishReceiver1o::DishReceiver1o(
421   unsigned int index)
422   : DishReceiver1(index)
423 {
424   setKeysetName("Sat Keyset 1 mode 16");
425 }
426
427
428 void DishReceiver1o::populateProtocol(
429   QObject *guiObject)
430 {
431   if (threadableProtocol)
432   {
433     // If the pointer is not null, the keyset must already be populated.
434     return;
435   }
436
437   DishReceiver1::populateProtocol(guiObject);
438
439   setPreData(0x0F, 5);
440 }