Memory Management Improved
[pierogi] / keysets / samsung.cpp
1 #include "samsung.h"
2 #include "protocols/samsungprotocol.h"
3 #include "protocols/lircprotocol.h"
4 #include "protocols/rc5protocol.h"
5
6 SamsungTV1::SamsungTV1(
7   unsigned int index)
8   : PIRKeysetMetaData(
9       "TV Keyset 1",
10       Samsung_Make,
11       index)
12 {
13   addControlledDevice(Samsung_Make, "SyncMaster 192MP", TV_Device);
14   addControlledDevice(Samsung_Make, "SyncMaster 225MW", TV_Device);
15   addControlledDevice(Samsung_Make, "LN32C530F1FXZA", TV_Device);
16   addControlledDevice(Samsung_Make, "UE46B6000VPXZG", TV_Device); // ?
17 }
18
19
20 void SamsungTV1::populateProtocol(
21   QObject *guiObject)
22 {
23   if (threadableProtocol)
24   {
25     // If the pointer is not null, the keyset must already be populated.
26     return;
27   }
28
29   threadableProtocol = new SamsungProtocol(guiObject, index);
30
31 //  setPreData(0xE0E0, 16);
32   setPreData(0x0707, 16);
33
34   addKey("mts", Audio_Key, 0x00, 8); // "dual"
35   addKey("TV/Video", Input_Key, 0x01, 8);
36   addKey("Power", Power_Key, 0x02, 8);
37   addKey("Sleep", Sleep_Key, 0x03, 8);
38   addKey("1", One_Key, 0x04, 8);
39   addKey("2", Two_Key, 0x05, 8);
40   addKey("3", Three_Key, 0x06, 8);
41   addKey("Volume Up", VolumeUp_Key, 0x07, 8);
42   addKey("4", Four_Key, 0x08, 8);
43   addKey("5", Five_Key, 0x09, 8);
44   addKey("6", Six_Key, 0x0A, 8);
45   addKey("Volume Down", VolumeDown_Key, 0x0B, 8);
46   addKey("7", Seven_Key, 0x0C, 8);
47   addKey("8", Eight_Key, 0x0D, 8);
48   addKey("9", Nine_Key, 0x0E, 8);
49   addKey("Mute", Mute_Key, 0x0F, 8);
50   addKey("Channel Down", ChannelDown_Key, 0x10, 8);
51   addKey("0", Zero_Key, 0x11, 8);
52   addKey("Channel Up", ChannelUp_Key, 0x12, 8);
53   addKey("PrevCh", PrevChannel_Key, 0x13, 8);
54   addKey("Green", Green_Key, 0x14, 8);
55   addKey("Yellow", Yellow_Key, 0x15, 8);
56   addKey("Blue", Blue_Key, 0x16, 8);
57   addKey("Menu", Menu_Key, 0x1A, 8);
58   addKey("tv", Unmapped_Key, 0x1B, 8);
59   addKey("Display", Info_Key, 0x1F, 8);
60   addKey("PIP", PIP_Key, 0x20, 8);
61   addKey("Swap", PIPSwap_Key, 0x21, 8);
62   addKey("position", PIPMove_Key, 0x22, 8);
63   addKey("-/--", DoubleDigit_Key, 0x23, 8);
64   addKey("+100", PlusOneHundred_Key, 0x23, 8);
65   addKey("DASH", Dash_Key, 0x23, 8);
66   addKey("PIP.SOURCE", PIPSource_Key, 0x24, 8);
67   addKey("Closed Captions", Captions_Key, 0x25, 8); // "SUBTITLE"
68   addKey("AD", Unmapped_Key, 0x27, 8);
69   addKey("PMode", PictureMode_Key, 0x28, 8); // "p.std"
70   addKey("SMode", SoundMode_Key, 0x2B, 8);
71   addKey("ttx/mix", Teletext_Key, 0x2C, 8); // "teletext"
72   addKey("Exit", Exit_Key, 0x2D, 8);
73   addKey("size", AspectRatio_Key, 0x2F, 8);
74   addKey("ch.scan", PIPScan_Key, 0x31, 8);  // "h.scan"
75   addKey("PIP.chan+", PIPChannelUp_Key, 0x32, 8); // "AUDCH_UP"
76   addKey("PIP.chan-", PIPChannelDown_Key, 0x33, 8); // "AUDCH_DOWN"
77   addKey("ANTENNA", AntennaInput_Key, 0x36, 8);
78   addKey("surf", Unmapped_Key, 0x3D, 8); // "r.surf"
79   addKey("PSize", PIPSize_Key, 0x3E, 8);
80   addKey("STILL", PIPPause_Key, 0x42, 8);
81   addKey("TV-DTV", Unmapped_Key, 0x43, 8);
82   addKey("FAV-CH", Favorites_Key, 0x44, 8);
83   addKey("Rewind", Rewind_Key, 0x45, 8);
84   addKey("Stop", Stop_Key, 0x46, 8);
85   addKey("Play/Pause", Play_Key, 0x47, 8);
86   addKey("Play/Pause", Pause_Key, 0x47, 8);
87   addKey("Fast Forward", FastForward_Key, 0x48, 8);
88   addKey("Record", Record_Key, 0x49, 8);
89   addKey("Tools", Unmapped_Key, 0x4B, 8);
90   addKey("Guide", Guide_Key, 0x4F, 8);
91   addKey("RETURN", Unmapped_Key, 0x58, 8);
92   addKey("Up", Up_Key, 0x60, 8);
93   addKey("Down", Down_Key, 0x61, 8);
94   addKey("Right", Right_Key, 0x62, 8);
95   addKey("Left", Left_Key, 0x65, 8);
96   addKey("Enter", Select_Key, 0x68, 8);
97   addKey("pc", PCInput_Key, 0x69, 8);
98   addKey("ch-mgr", Unmapped_Key, 0x6B, 8); // "CH_LIST"
99   addKey("Red", Red_Key, 0x6C, 8);
100   addKey("srs", Surround_Key, 0x6E, 8);
101   addKey("E.SAVING", Unmapped_Key, 0x77, 8);
102   addKey("Content", Unmapped_Key, 0x79, 8);
103   addKey("HDMI", HDMIInput_Key, 0x8B, 8);
104   addKey("WISELINK", Unmapped_Key, 0x8C, 8); // "W.Link", "Media.P"
105   addKey("D.MENU", DiscMenu_Key, 0x8E, 8);
106   addKey("Internet", Unmapped_Key, 0x93, 8);
107   addKey("E.Mode", Unmapped_Key, 0x94, 8);
108   addKey("ANYNET", Unmapped_Key, 0x97, 8);
109
110 //  addKey("turbo", Unmapped_Key, 0xA659, 16);
111 }
112
113
114 SamsungTV1a::SamsungTV1a(
115   unsigned int index)
116   : SamsungTV1(index)
117 {
118   setKeysetName("TV Keyset 1a");
119 }
120
121
122 void SamsungTV1a::populateProtocol(
123   QObject *guiObject)
124 {
125   if (threadableProtocol)
126   {
127     // If the pointer is not null, the keyset must already be populated.
128     return;
129   }
130
131   SamsungTV1::populateProtocol(guiObject);
132
133   addKey("turbo", Unmapped_Key, 0x13, 8);
134   addKey("s.menu", SoundMode_Key, 0x14, 8);
135   addKey("s.std", Unmapped_Key, 0x15, 8);
136   addKey("p.std", Unmapped_Key, 0x16, 8);
137 }
138
139
140 SamsungTV1b::SamsungTV1b(
141   unsigned int index)
142   : SamsungTV1(index)
143 {
144   setKeysetName("TV Keyset 1b");
145
146   addControlledDevice(Samsung_Make, "LE46M51B (R)", TV_Device); // ?
147 }
148
149
150 void SamsungTV1b::populateProtocol(
151   QObject *guiObject)
152 {
153   if (threadableProtocol)
154   {
155     // If the pointer is not null, the keyset must already be populated.
156     return;
157   }
158
159   SamsungTV1::populateProtocol(guiObject);
160
161   addKey("Red", Red_Key, 0x21, 8);
162   addKey("Exit", Exit_Key, 0x2C, 8);
163 }
164
165
166 SamsungTV1c::SamsungTV1c(
167   unsigned int index)
168   : SamsungTV1(index)
169 {
170   setKeysetName("TV Keyset 1c");
171 }
172
173
174 void SamsungTV1c::populateProtocol(
175   QObject *guiObject)
176 {
177   if (threadableProtocol)
178   {
179     // If the pointer is not null, the keyset must already be populated.
180     return;
181   }
182
183   SamsungTV1::populateProtocol(guiObject);
184
185   // Some remotes apparently use channel and volume keys for navigation:
186   addKey("right", Right_Key, 0x07, 8);
187   addKey("left", Left_Key, 0x0B, 8);
188   addKey("down", Down_Key, 0x10, 8);
189   addKey("up", Up_Key, 0x12, 8);
190   addKey("center", Unmapped_Key, 0x1A, 8);
191 }
192
193
194 SamsungTV1d::SamsungTV1d(
195   unsigned int index)
196   : SamsungTV1(index)
197 {
198   setKeysetName("TV Keyset 1d");
199 }
200
201
202 void SamsungTV1d::populateProtocol(
203   QObject *guiObject)
204 {
205   if (threadableProtocol)
206   {
207     // If the pointer is not null, the keyset must already be populated.
208     return;
209   }
210
211   SamsungTV1::populateProtocol(guiObject);
212
213   addKey("turbo", Unmapped_Key, 0x64, 8);
214 }
215
216
217 SamsungTV1e::SamsungTV1e(
218   unsigned int index)
219   : SamsungTV1(index)
220 {
221   setKeysetName("TV Keyset 1e");
222 }
223
224
225 void SamsungTV1e::populateProtocol(
226   QObject *guiObject)
227 {
228   if (threadableProtocol)
229   {
230     // If the pointer is not null, the keyset must already be populated.
231     return;
232   }
233
234   SamsungTV1::populateProtocol(guiObject);
235
236   addKey("p.mode", PictureMode_Key, 0x16, 8);
237 }
238
239
240 // This one overrides the color keys:
241 SamsungTV1f::SamsungTV1f(
242   unsigned int index)
243   : SamsungTV1(index)
244 {
245   setKeysetName("TV Keyset 1f");
246 }
247
248
249 void SamsungTV1f::populateProtocol(
250   QObject *guiObject)
251 {
252   if (threadableProtocol)
253   {
254     // If the pointer is not null, the keyset must already be populated.
255     return;
256   }
257
258   SamsungTV1::populateProtocol(guiObject);
259
260   addKey("p-mode", PictureMode_Key, 0x6C, 8);
261   addKey("s-mode", SoundMode_Key, 0x14, 8);
262   addKey("still", PIPPause_Key, 0x15, 8);
263   addKey("p-size", PIPSize_Key, 0x16, 8);
264 }
265
266
267 // Not sure that this even is a Samsung TV...
268 SamsungTV2::SamsungTV2(
269   unsigned int index)
270   : PIRKeysetMetaData(
271       "TV Keyset 2",
272       Samsung_Make,
273       index)
274 {
275 }
276
277
278 void SamsungTV2::populateProtocol(
279   QObject *guiObject)
280 {
281   if (threadableProtocol)
282   {
283     // If the pointer is not null, the keyset must already be populated.
284     return;
285   }
286
287   threadableProtocol = new RC5Protocol(guiObject, index);
288
289   addKey("1", One_Key, 0x1001, 13);
290   addKey("2", Two_Key, 0x1002, 13);
291   addKey("3", Three_Key, 0x1003, 13);
292   addKey("4", Four_Key, 0x1004, 13);
293   addKey("5", Five_Key, 0x1005, 13);
294   addKey("6", Six_Key, 0x1006, 13);
295   addKey("7", Seven_Key, 0x1007, 13);
296   addKey("8", Eight_Key, 0x1008, 13);
297   addKey("9", Nine_Key, 0x1009, 13);
298   addKey("0", Zero_Key, 0x1000, 13);
299   addKey("TV", Unmapped_Key, 0x103F, 13);
300   addKey("Power", Power_Key, 0x100C, 13);
301   addKey("Video", Unmapped_Key, 0x1038, 13);
302   addKey("Display", Info_Key, 0x100F, 13); // [+]
303   addKey("Sleep", Sleep_Key, 0x1026, 13);
304   addKey("-/--", DoubleDigit_Key, 0x100A, 13);
305   addKey("P.STD", PictureMode_Key, 0x100E, 13); // "Colour"
306   addKey("Mute", Mute_Key, 0x100D, 13);
307   addKey("P.Size", AspectRatio_Key, 0x1016, 13);
308   addKey("Vol-", VolumeDown_Key, 0x0015, 13);
309   addKey("Vol+", VolumeUp_Key, 0x0016, 13);
310   addKey("CH/P_UP", ChannelUp_Key, 0x0010, 13);
311   addKey("CH/P_DOWN", ChannelDown_Key, 0x0011, 13);
312   addKey("Menu", Menu_Key, 0x0012, 13);
313   addKey("TTX/MIX", Teletext_Key, 0x103C, 13);
314   addKey("Red", Red_Key, 0x002B, 13);
315   addKey("Green", Green_Key, 0x002C, 13);
316   addKey("Yellow", Yellow_Key, 0x002D, 13);
317   addKey("Blue", Blue_Key, 0x002E, 13);
318   addKey(">>", FastForward_Key, 0x101E, 13);
319   addKey("colour+", ColorUp_Key, 0x1014, 13);
320   addKey("colour-", ColorDown_Key, 0x1015, 13);
321   addKey("brightness+", BrightnessUp_Key, 0x1012, 13);
322   addKey("brightness-", BrightnessDown_Key, 0x1013, 13);
323   addKey("contrast+", ContrastUp_Key, 0x101C, 13);
324   addKey("contrast-", ContrastDown_Key, 0x101D, 13);
325 }
326
327
328 SamsungTV2a::SamsungTV2a(
329   unsigned int index)
330   : SamsungTV2(index)
331 {
332   setKeysetName("TV Keyset 2a");
333 }
334
335
336 void SamsungTV2a::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   SamsungTV2::populateProtocol(guiObject);
346
347   addKey("volume+", VolumeUp_Key, 0x1010, 13);
348   addKey("volume-", VolumeDown_Key, 0x1011, 13);
349   addKey("prog+", ChannelUp_Key, 0x1020, 13);
350   addKey("prog-", ChannelDown_Key, 0x1021, 13);
351 }
352
353
354 SamsungVCR1::SamsungVCR1(
355   unsigned int index)
356   : PIRKeysetMetaData(
357       "VCR(DVD) Keyset 1",
358       Samsung_Make,
359       index)
360 {
361 }
362
363
364 void SamsungVCR1::populateProtocol(
365   QObject *guiObject)
366 {
367   if (threadableProtocol)
368   {
369     // If the pointer is not null, the keyset must already be populated.
370     return;
371   }
372
373   threadableProtocol = new SamsungProtocol(guiObject, index);
374
375 //  setPreData(0xA0A0, 16);
376   setPreData(0x0505, 16);
377
378   addKey("TV/Video", Input_Key, 0x01, 8);
379   addKey("Power", Power_Key, 0x02, 8);
380   addKey("A.REP", Unmapped_Key, 0x03, 8);
381   addKey("One", One_Key, 0x04, 8);
382   addKey("Two", Two_Key, 0x05, 8);
383   addKey("Three", Three_Key, 0x06, 8);
384   addKey("Four", Four_Key, 0x08, 8);
385   addKey("Five", Five_Key, 0x09, 8);
386   addKey("Six", Six_Key, 0x0A, 8);
387   addKey("Seven", Seven_Key, 0x0C, 8);
388   addKey("Eight", Eight_Key, 0x0D, 8);
389   addKey("Nine", Nine_Key, 0x0E, 8);
390
391   addKey("ChannelDown", ChannelDown_Key, 0x10, 8);
392   addKey("Zero", Zero_Key, 0x11, 8);
393   addKey("ChannelUp", ChannelUp_Key, 0x12, 8);
394   addKey("SLOW_UP", SlowPlus_Key, 0x13, 8);
395   addKey("Record", Record_Key, 0x14, 8);
396   addKey("Stop", Stop_Key, 0x15, 8);
397   addKey("Rewind", Rewind_Key, 0x18, 8);
398   addKey("SLOW_DOWN", SlowMinus_Key, 0x17, 8);
399   addKey("Play/Pause", Play_Key, 0x19, 8);
400   addKey("Play/Pause", Pause_Key, 0x19, 8);
401   addKey("FastForward", FastForward_Key, 0x1A, 8);
402   addKey("Memory", Memory_Key, 0x1C, 8);
403   addKey("Clear", Reset_Key, 0x1D, 8); // "CNT.RESET", "CLR_RST", "reset"
404 //  addKey("Exit", Exit_Key, 0x1D, 8);
405   addKey("Info", Info_Key, 0x1E, 8); // "display"
406   addKey("Menu", Menu_Key, 0x1F, 8);
407
408   addKey("Eject", Eject_Key, 0x20, 8);
409   addKey("auto_track", AutoTracking_Key, 0x21, 8); // "A.TRK"
410   addKey("Captions", Captions_Key, 0x22, 8);
411   addKey("BAND", TunerBand_Key, 0x23, 8);
412   addKey("input", Unmapped_Key, 0x24, 8);
413   addKey("shift", Unmapped_Key, 0x25, 8);
414   addKey("100+", PlusOneHundred_Key, 0x26, 8);
415   addKey("Down", Down_Key, 0x29, 8); // "erase"
416   addKey("mark/search", Unmapped_Key, 0x2B, 8); // "index"
417   addKey("trk_up", TrackingPlus_Key, 0x2C, 8); // "FINE_UP"
418   addKey("trk_down", TrackingMinus_Key, 0x2D, 8); // "FINE_DOWN"
419   addKey("dub", Unmapped_Key, 0x2E, 8);
420   addKey("Up", Up_Key, 0x2F, 8); // "mark"
421
422   addKey("timer", Unmapped_Key, 0x30, 8); // "MONITOR", "showview", "SHOWVIEW"
423   addKey("SEARCH", Unmapped_Key, 0x31, 8);
424   addKey("SYSTEM", Unmapped_Key, 0x32, 8);
425   addKey("CLK_COUNT", Unmapped_Key, 0x33, 8); // "clk/cnt"
426   addKey("PRESET", Unmapped_Key, 0x35, 8);
427   addKey("VPS", Unmapped_Key, 0x38, 8);
428   addKey("progressive/speed", VHSSpeed_Key, 0x3A, 8); // "SP-LP"
429   addKey("Q_PRO", Unmapped_Key, 0x3D, 8);
430
431   addKey("Enter", Select_Key, 0x5C, 8); // "ok"
432   addKey("Dma", Unmapped_Key, 0x63, 8);
433
434   addKey("ipc", PictureMode_Key, 0x75, 8); // "PICTURE"
435   addKey("Left", Left_Key, 0x7D, 8); // "shuttle<"
436   addKey("Right", Right_Key, 0x7E, 8); // "shuttle>"
437 }
438
439
440 SamsungVCR1a::SamsungVCR1a(
441   unsigned int index)
442   : SamsungVCR1(index)
443 {
444   setKeysetName("VCR(DVD) Keyset 1a");
445 }
446
447
448 void SamsungVCR1a::populateProtocol(
449   QObject *guiObject)
450 {
451   if (threadableProtocol)
452   {
453     // If the pointer is not null, the keyset must already be populated.
454     return;
455   }
456
457   SamsungVCR1::populateProtocol(guiObject);
458
459   addKey("right", Right_Key, 0x13, 8);
460   addKey("left", Left_Key, 0x17, 8);
461   addKey("vcr", Unmapped_Key, 0x28, 8);
462   addKey("up", Up_Key, 0x2C, 8);
463   addKey("down", Down_Key, 0x2D, 8);
464   addKey("clear", Clear_Key, 0x31, 8);
465   addKey("audio", Audio_Key, 0x3D, 8);
466   addKey("enter", Select_Key, 0x43, 8); // "ok"
467   addKey("angle/timer", Unmapped_Key, 0x45, 8);
468   addKey("power", Power_Key, 0x48, 8);
469   addKey("dvd", Unmapped_Key, 0x55, 8);
470   addKey("input_sel", Input_Key, 0x59, 8);
471   addKey("disc_menu", DiscMenu_Key, 0x60, 8);
472   addKey("mode/repeat", Unmapped_Key, 0x66, 8);
473   addKey("menu", Menu_Key, 0x68, 8);
474 }
475
476
477 SamsungVCR1b::SamsungVCR1b(
478   unsigned int index)
479   : SamsungVCR1(index)
480 {
481   setKeysetName("VCR(DVD) Keyset 1b");
482 }
483
484
485 void SamsungVCR1b::populateProtocol(
486   QObject *guiObject)
487 {
488   if (threadableProtocol)
489   {
490     // If the pointer is not null, the keyset must already be populated.
491     return;
492   }
493
494   SamsungVCR1::populateProtocol(guiObject);
495
496   addKey("audio", Audio_Key, 0x22, 8); // "output"
497   addKey("+", Unmapped_Key, 0x26, 8);
498   addKey("-", Unmapped_Key, 0x28, 8);
499   addKey("pause", Pause_Key, 0x16, 8); // "P/S"
500   addKey("prog", Program_Key, 0x1F, 8);
501   addKey("aft", Unmapped_Key, 0x74, 8);
502   addKey("SYSTEM", Menu_Key, 0x69, 8);
503   addKey("OK_UP", Up_Key, 0x52, 8);
504   addKey("OK_DOWN", Down_Key, 0x50, 8);
505   addKey("OK_LEFT", Left_Key, 0x73, 8);
506   addKey("OK_RIGHT", Right_Key, 0x77, 8);
507 }
508
509
510 SamsungVCR1c::SamsungVCR1c(
511   unsigned int index)
512   : SamsungVCR1a(index)
513 {
514   setKeysetName("VCR(DVD) Keyset 1c");
515
516   addControlledDevice(Samsung_Make, "DVD-V1000", DVD_Device);
517 }
518
519
520 void SamsungVCR1c::populateProtocol(
521   QObject *guiObject)
522 {
523   if (threadableProtocol)
524   {
525     // If the pointer is not null, the keyset must already be populated.
526     return;
527   }
528
529   SamsungVCR1a::populateProtocol(guiObject);
530
531   addKey("right", Right_Key, 0x00, 8);
532   addKey("up", Up_Key, 0x1E, 8);
533   addKey("timer", Sleep_Key, 0x22, 8);
534   addKey("speed", VHSSpeed_Key, 0x30, 8);
535   addKey("down", Down_Key, 0x31, 8);
536   addKey("eject", Eject_Key, 0x32, 8);
537   addKey("return", Exit_Key, 0x3D, 8);
538   addKey("vol_down", VolumeDown_Key, 0x40, 8);
539   addKey("prev_ch", PrevChannel_Key, 0x54, 8);
540   addKey("vol_up", VolumeUp_Key, 0x63, 8);
541   addKey("left", Left_Key, 0x66, 8);
542 }
543
544
545 SamsungVCR1d::SamsungVCR1d(
546   unsigned int index)
547   : SamsungVCR1(index)
548 {
549   // Combo VCR/TV:
550   addControlledDevice(Samsung_Make, "CXD1342", TV_Device);
551   addControlledDevice(Samsung_Make, "CXD1342", VCR_Device);
552
553   setKeysetName("VCR/TV Combo Keyset 1d");
554 }
555
556
557 void SamsungVCR1d::populateProtocol(
558   QObject *guiObject)
559 {
560   if (threadableProtocol)
561   {
562     // If the pointer is not null, the keyset must already be populated.
563     return;
564   }
565
566   SamsungVCR1::populateProtocol(guiObject);
567
568   addKey("VOL+", VolumeUp_Key, 0x07, 8);
569   addKey("VOL-", VolumeDown_Key, 0x0B, 8);
570   addKey("MUTE", Mute_Key, 0x0F, 8);
571   addKey("P./STILL", Pause_Key, 0x16, 8);
572   addKey("PRE-CH", PrevChannel_Key, 0x2A, 8);
573   addKey("eject", Eject_Key, 0x32, 8);
574   addKey("REPEAT", Repeat_Key, 0x37, 8);
575   addKey("P-STD", Unmapped_Key, 0x6F, 8); // Picture mode?
576 }
577
578
579 SamsungVCR1e::SamsungVCR1e(
580   unsigned int index)
581   : SamsungVCR1(index)
582 {
583   setKeysetName("VCR(DVD) Keyset 1e");
584 }
585
586
587 void SamsungVCR1e::populateProtocol(
588   QObject *guiObject)
589 {
590   if (threadableProtocol)
591   {
592     // If the pointer is not null, the keyset must already be populated.
593     return;
594   }
595
596   SamsungVCR1::populateProtocol(guiObject);
597
598   addKey("DIGEST", Unmapped_Key, 0x00, 8);
599   addKey("RIGHT", Right_Key, 0x13, 8);
600   addKey("LEFT", Left_Key, 0x17, 8);
601   addKey("DISC_MENU", DiscMenu_Key, 0x1F, 8);
602   addKey("3D_SOUND", Surround_Key, 0x26, 8);
603   addKey("VCR", Unmapped_Key, 0x28, 8);
604   addKey("UP", Up_Key, 0x2C, 8);
605   addKey("DOWN", Down_Key, 0x2D, 8);
606   addKey("CLOCK/COUNTER", Clock_Key, 0x31, 8);
607   addKey("OPEN/CLOSE", Eject_Key, 0x32, 8);
608   addKey("ZOOM", Zoom_Key, 0x3A, 8);
609   addKey("RETURN", Exit_Key, 0x3D, 8);
610   addKey("TRK_DOWN", TrackingMinus_Key, 0x40, 8);
611   addKey("SETUP/ENTER", Menu_Key, 0x43, 8);
612   addKey("SETUP/ENTER", Select_Key, 0x43, 8);
613   addKey("ANGLE", Angle_Key, 0x54, 8);
614   addKey("DVD", Unmapped_Key, 0x55, 8);
615   addKey("INPUT_SEL", Input_Key, 0x59, 8);
616   addKey("TITLE", DiscTitle_Key, 0x60, 8);
617   addKey("TRK_UP", TrackingPlus_Key, 0x63, 8);
618   addKey("MODE/REPEAT", Repeat_Key, 0x66, 8);
619   addKey("AUDIO", Audio_Key, 0x68, 8);
620 }
621
622
623 SamsungDVD1::SamsungDVD1(
624   unsigned int index)
625   : PIRKeysetMetaData(
626       "DVD Keyset 1",
627       Samsung_Make,
628       index)
629 {
630 }
631
632
633 void SamsungDVD1::populateProtocol(
634   QObject *guiObject)
635 {
636   if (threadableProtocol)
637   {
638     // If the pointer is not null, the keyset must already be populated.
639     return;
640   }
641
642   LIRCProtocol *lp = new LIRCProtocol(
643     guiObject,
644     index,
645     600, 500,
646     600, 1600,
647     108000, true);
648
649   threadableProtocol = lp;
650
651   lp->setHeaderPair(9000, 4500);
652   lp->setTrailerPulse(600);
653   lp->setRepeatPair(9000, 4500);
654
655   setPreData(0x198133F, 26);
656
657   addKey("power", Power_Key, 0x8976, 16);
658   addKey("open_close", Eject_Key, 0x31CE, 16);
659   addKey("1", One_Key, 0x817E, 16);
660   addKey("2", Two_Key, 0x41BE, 16);
661   addKey("3", Three_Key, 0xC13E, 16);
662   addKey("4", Four_Key, 0x21DE, 16);
663   addKey("5", Five_Key, 0xA15E, 16);
664   addKey("6", Six_Key, 0x619E, 16);
665   addKey("7", Seven_Key, 0xE11E, 16);
666   addKey("8", Eight_Key, 0x11EE, 16);
667   addKey("9", Nine_Key, 0x916E, 16);
668   addKey("0", Zero_Key, 0x01FE, 16);
669   addKey("prog", Program_Key, 0xE51A, 16); // "Mode"
670   addKey("clear", Clear_Key, 0x25DA, 16); // "cancel"
671   addKey("step", StepForward_Key, 0x659A, 16);
672   addKey("replay", Replay_Key, 0x55AA, 16);
673   addKey("skip", Advance_Key, 0x758A, 16); // "digest"
674   addKey("|<<", Previous_Key, 0xF906, 16); // "skip-"
675   addKey(">>|", Next_Key, 0x857A, 16);
676   addKey("<<", Rewind_Key, 0x39C6, 16);
677   addKey(">>", FastForward_Key, 0x7986, 16);
678   addKey("stop", Stop_Key, 0x45BA, 16);
679   addKey("play", Play_Key, 0x05FA, 16);
680   addKey("play/pause", Pause_Key, 0x05FA, 16);
681   addKey("return", Exit_Key, 0xA956, 16);
682   addKey("menu", Menu_Key, 0xD12E, 16); // "setup"
683   addKey("info", Info_Key, 0xF10E, 16); // "display"
684   addKey("disc_menu", DiscMenu_Key, 0x29D6, 16);
685   addKey("left", Left_Key, 0x59A6, 16);
686   addKey("up", Up_Key, 0xE916, 16);
687   addKey("down", Down_Key, 0x19E6, 16);
688   addKey("right", Right_Key, 0x9966, 16);
689   addKey("enter", Select_Key, 0xD926, 16);
690   addKey("ez_view", Unmapped_Key, 0xF50A, 16); // s.fit
691   addKey("subtitle", Captions_Key, 0x09F6, 16);
692   addKey("audio", Audio_Key, 0x718E, 16);
693   addKey("angle", Angle_Key, 0x49B6, 16);
694   addKey("repeat", Repeat_Key, 0xB946, 16);
695   addKey("repeat_A-B", RepeatAB_Key, 0x15EA, 16);
696   addKey("step_r", StepForward_Key, 0xEB14, 16);
697   addKey("step_l", StepBack_Key, 0x1BE4, 16);
698   addKey("jog_r", Unmapped_Key, 0x936C, 16);
699   addKey("jog_l", Unmapped_Key, 0x53AC, 16);
700   addKey("sacd/cd", Unmapped_Key, 0x6E91, 16);
701   addKey("bookmark", Unmapped_Key, 0x956A, 16);
702   addKey("index_pre", Unmapped_Key, 0x837C, 16);
703   addKey("index_next", Unmapped_Key, 0x639C, 16);
704   addKey("page_pre", PageUp_Key, 0x23DC, 16);
705   addKey("page_next", PageDown_Key, 0x639C, 16);
706   addKey("zoom", Zoom_Key, 0x35CA, 16);
707   addKey("hdmi_sel", Unmapped_Key, 0xE41B, 16);
708   addKey("video_sel", Unmapped_Key, 0x44BB, 16);
709   addKey("3D_Sound", Surround_Key, 0xD52A, 16);
710   addKey("TopMenu", DiscTitle_Key, 0xC936, 16);
711 }
712
713
714 SamsungDVD1a::SamsungDVD1a(
715   unsigned int index)
716   : SamsungDVD1(index)
717 {
718   setKeysetName("DVD Keyset 1a");
719 }
720
721
722 void SamsungDVD1a::populateProtocol(
723   QObject *guiObject)
724 {
725   if (threadableProtocol)
726   {
727     // If the pointer is not null, the keyset must already be populated.
728     return;
729   }
730
731   SamsungDVD1::populateProtocol(guiObject);
732
733   addKey("hdmi_sel", Unmapped_Key, 0x15EA, 16);
734 }
735
736
737 SamsungDVD1b::SamsungDVD1b(
738   unsigned int index)
739   : SamsungDVD1(index)
740 {
741   setKeysetName("DVD Keyset 1b");
742 }
743
744
745 void SamsungDVD1b::populateProtocol(
746   QObject *guiObject)
747 {
748   if (threadableProtocol)
749   {
750     // If the pointer is not null, the keyset must already be populated.
751     return;
752   }
753
754   SamsungDVD1::populateProtocol(guiObject);
755
756   addKey("Zoom", Zoom_Key, 0x55AA, 16);
757   addKey("i.replay", Replay_Key, 0xB54A, 16);
758   addKey("Volume_Con", Unmapped_Key, 0x35CA, 16);
759 }
760
761
762 SamsungDVD2::SamsungDVD2(
763   unsigned int index)
764   : PIRKeysetMetaData(
765       "DVD Keyset 2",
766       Samsung_Make,
767       index)
768 {
769   addControlledDevice(Samsung_Make, "HT-P1200", DVD_Device);
770 }
771
772
773 void SamsungDVD2::populateProtocol(
774   QObject *guiObject)
775 {
776   if (threadableProtocol)
777   {
778     // If the pointer is not null, the keyset must already be populated.
779     return;
780   }
781
782   threadableProtocol= new SamsungProtocol(guiObject, index);
783
784 //  setPreData(0xC2CA, 16);
785   setPreData(0x5343, 16);
786
787   addKey("remain", Unmapped_Key, 0x00, 8);
788   addKey("play", Play_Key, 0x03, 8);
789   addKey("PLII-MODE", Unmapped_Key, 0x04, 8);
790   addKey("ENTER", Select_Key, 0x05, 8);
791   addKey("AUDIO", Audio_Key, 0x06, 8);
792   addKey("EZ-VIEW", Unmapped_Key, 0x07, 8);
793   addKey("TUNER", TunerInput_Key, 0x09, 8);
794   addKey("stop", Stop_Key, 0x0B, 8);
795   addKey("PLII-EFFECT", Unmapped_Key, 0x0C, 8);
796   addKey("UP", Up_Key, 0x0D, 8);
797   addKey("SUBTITLE", Captions_Key, 0x0E, 8);
798   addKey("ZOOM", Zoom_Key, 0x0F, 8);
799   addKey("AUX", AuxInput_Key, 0x11, 8);
800   addKey("next", Next_Key, 0x13, 8);
801   addKey("SOUND-EDIT", SoundMode_Key, 0x14, 8);
802   addKey("DOWN", Down_Key, 0x15, 8);
803   addKey("cancel", Unmapped_Key, 0x17, 8);
804 //  addKey("MODE", Program_Key, 0x18, 8); // Might be wrong
805   addKey("TV-VIDEO", Input_Key, 0x18, 8);
806   addKey("DVD", DVDInput_Key, 0x19, 8);
807   addKey("prev", Previous_Key, 0x1B, 8);
808   addKey("RETURN", Exit_Key, 0x1C, 8);
809   addKey("RIGHT", Right_Key, 0x1D, 8);
810   addKey("SLEEP", Sleep_Key, 0x21, 8);
811   addKey("ch+", ChannelUp_Key, 0x23, 8);
812   addKey("MUSIC", Unmapped_Key, 0x24, 8);
813   addKey("LEFT", Left_Key, 0x25, 8);
814   addKey("INFO", Info_Key, 0x26, 8);
815   addKey("ch-", ChannelDown_Key, 0x2B, 8);
816   addKey("TUNER-MEMORY", Memory_Key, 0x2D, 8);
817   addKey("0", Zero_Key, 0x2F, 8);
818   addKey("VOL+", VolumeUp_Key, 0x33, 8);
819   addKey("TEST-TONE", Unmapped_Key, 0x34, 8);
820   addKey("SLOW", Slow_Key, 0x35, 8);
821   addKey("MENU", Menu_Key, 0x36, 8);
822   addKey("9", Nine_Key, 0x37, 8);
823   addKey("LOGO", Unmapped_Key, 0x38, 8);
824   addKey("MUTE", Mute_Key, 0x39, 8);
825   addKey("VOL-", VolumeDown_Key, 0x3B, 8);
826   addKey("STEP", StepForward_Key, 0x3D, 8);
827   addKey("8", Eight_Key, 0x3F, 8);
828   addKey("1", One_Key, 0x41, 8);
829   addKey("2", Two_Key, 0x42, 8);
830   addKey("3", Three_Key, 0x43, 8);
831   addKey("4", Four_Key, 0x44, 8);
832   addKey("5", Five_Key, 0x45, 8);
833   addKey("6", Six_Key, 0x46, 8);
834   addKey("7", Seven_Key, 0x47, 8);
835   addKey("SD-HD", AspectRatio_Key, 0x59, 8);
836   addKey("REPEAT", Repeat_Key, 0x66, 8);
837   addKey("super5.1", Surround_Key, 0x67, 8);
838   addKey("MOVIE", Unmapped_Key, 0x68, 8);
839   addKey("ASC", Unmapped_Key, 0x69, 8);
840   addKey("HDMI-AUDIO", Unmapped_Key, 0x70, 8);
841 }
842
843
844 SamsungAC1::SamsungAC1(
845   unsigned int index)
846   : PIRKeysetMetaData(
847       "Air Conditioner Keyset 1",
848       Samsung_Make,
849       index)
850 {
851 }
852
853
854 void SamsungAC1::populateProtocol(
855   QObject *guiObject)
856 {
857   if (threadableProtocol)
858   {
859     // If the pointer is not null, the keyset must already be populated.
860     return;
861   }
862
863   LIRCProtocol *lp = new LIRCProtocol(
864     guiObject,
865     index,
866     600, 500,
867     600, 1600,
868     60000, true);
869
870   threadableProtocol = lp;
871
872   lp->setHeaderPair(4500, 4500);
873   lp->setTrailerPulse(600);
874
875   setPreData(0x804, 12);
876
877 //  np->setMinimumRepetitions(1);
878
879   addKey("TIMER", Timer_Key, 0xA4, 8);
880   addKey("SLEEP", Sleep_Key, 0xE4, 8);
881   addKey("TEMP+", VolumeUp_Key, 0x4C, 8);
882   addKey("TEMP-", VolumeDown_Key, 0x8C, 8);
883   addKey("FAN", One_Key, 0x9C, 8);
884   addKey("COOL", Two_Key, 0x3C, 8);
885   addKey("HEAT", Three_Key, 0x5C, 8);
886   addKey("FAN_HIGH", Four_Key, 0xEC, 8);
887   addKey("FAN_MED", Five_Key, 0x6C, 8);
888   addKey("FAN_LOW", Six_Key, 0xAC, 8);
889   addKey("SWING", Seven_Key, 0x94, 8);
890   addKey("POWER", Power_Key, 0xFC, 8);
891 }
892
893
894 SamsungDVBT1::SamsungDVBT1(
895   unsigned int index)
896   : PIRKeysetMetaData(
897       "DVB-T Receiver Keyset 1",
898       Samsung_Make,
899       index)
900 {
901   addControlledDevice(Samsung_Make, "SMT-1000T", TV_Device);
902   addControlledDevice(Samsung_Make, "SMT-1100T", TV_Device);
903 }
904
905
906 void SamsungDVBT1::populateProtocol(
907   QObject *guiObject)
908 {
909   if (threadableProtocol)
910   {
911     // If the pointer is not null, the keyset must already be populated.
912     return;
913   }
914
915   threadableProtocol = new NECProtocol(guiObject, index, true, true);
916
917   setPreData(0x4040, 16);
918
919   addKey("0", Zero_Key, 0x00, 8);
920   addKey("1", One_Key, 0x01, 8);
921   addKey("2", Two_Key, 0x02, 8);
922   addKey("3", Three_Key, 0x03, 8);
923   addKey("4", Four_Key, 0x04, 8);
924   addKey("5", Five_Key, 0x05, 8);
925   addKey("6", Six_Key, 0x06, 8);
926   addKey("7", Seven_Key, 0x07, 8);
927   addKey("8", Eight_Key, 0x08, 8);
928   addKey("9", Nine_Key, 0x09, 8);
929   addKey("power", Power_Key, 0x0A, 8);
930   addKey("up", Up_Key, 0x0B, 8);
931   addKey("mute", Mute_Key, 0x0C, 8);
932   addKey("ok", Select_Key, 0x0D, 8);
933   addKey("down", Down_Key, 0x0E, 8);
934   addKey("tv/stb", Input_Key, 0x0F, 8);
935
936   addKey("left", Left_Key, 0x10, 8);
937   addKey("right", Right_Key, 0x11, 8);
938   addKey("clock", Unmapped_Key, 0x12, 8);
939   addKey("vol+", VolumeUp_Key, 0x15, 8);
940   addKey("red", Red_Key, 0x16, 8);
941   addKey("green", Green_Key, 0x17, 8);
942   addKey("yellow", Yellow_Key, 0x18, 8);
943   addKey("blue", Blue_Key, 0x19, 8);
944   addKey("epg", Guide_Key, 0x1A, 8);
945   addKey("vol-", VolumeDown_Key, 0x1C, 8);
946   addKey("radio", TunerInput_Key, 0x1D, 8);
947   addKey("chan-", ChannelDown_Key, 0x1E, 8);
948   addKey("chan+", ChannelUp_Key, 0x1F, 8);
949
950   addKey("fav", Favorites_Key, 0x27, 8);
951
952   addKey("menu", Menu_Key, 0x40, 8);
953   addKey("exit", Exit_Key, 0x41, 8);
954   addKey("i", Info_Key, 0x42, 8);
955   addKey("rcl", PrevChannel_Key, 0x43, 8);
956   addKey("txt", Teletext_Key, 0x45, 8); // might be wrong
957   addKey("a-z", Unmapped_Key, 0x46, 8);
958 }