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