Memory Management Improved
[pierogi] / keysets / jvc.cpp
1 #include "jvc.h"
2 #include "protocols/jvcprotocol.h"
3 #include "protocols/lircprotocol.h"
4
5 JVCSat1::JVCSat1(
6   unsigned int index)
7   : PIRKeysetMetaData(
8       "Sat (Dish) Keyset 1",
9       JVC_Make,
10       index)
11 {
12 }
13
14
15 void JVCSat1::populateProtocol(
16   QObject *guiObject)
17 {
18   if (threadableProtocol)
19   {
20     // If the pointer is not null, the keyset must already be populated.
21     return;
22   }
23
24   LIRCProtocol *lp = new LIRCProtocol(
25    guiObject,
26    index,
27    624, 1500,
28    624, 2600,
29    6000, false);
30
31   threadableProtocol = lp;
32
33   lp->setHeaderPair(750, 6000);
34   lp->setTrailerPulse(624);
35
36   lp->setFullHeadlessRepeat(true);
37
38 //  np->setCarrierFrequency(56000);
39 //  np->setDutyCycle(32);
40
41   addKey("power", Power_Key, 0x1EFC, 13);
42   addKey("recent", Unmapped_Key, 0x16FC, 13);
43   addKey("tvWeb", Unmapped_Key, 0x1A7C, 13);
44   addKey("scrollUp", PageUp_Key, 0x137C, 13);
45   addKey("scrollDown", PageDown_Key, 0x117C, 13);
46   addKey("home", Unmapped_Key, 0x15FC, 13);
47   addKey("back", Exit_Key, 0x1FFC, 13);
48   addKey("up", Up_Key, 0x12FC, 13);
49   addKey("left", Left_Key, 0x11FC, 13);
50   addKey("go", Enter_Key, 0x17FC, 13);
51   addKey("right", Right_Key, 0x13FC, 13);
52   addKey("down", Down_Key, 0x10FC, 13);
53   addKey("options", Unmapped_Key, 0x14FC, 13);
54   addKey("chDown", ChannelDown_Key, 0x187C, 13);
55   addKey("record", Record_Key, 0x107C, 13);
56   addKey("rewind", Rewind_Key, 0x1C7C, 13);
57   addKey("play", Play_Key, 0x1E7C, 13);
58   addKey("1", One_Key, 0x1DFC, 13);
59   addKey("2", Two_Key, 0x1D7C, 13);
60   addKey("3", Three_Key, 0x1CFC, 13);
61   addKey("4", Four_Key, 0x1BFC, 13);
62   addKey("5", Five_Key, 0x1B7C, 13);
63   addKey("6", Six_Key, 0x1AFC, 13);
64   addKey("7", Seven_Key, 0x19FC, 13);
65   addKey("8", Eight_Key, 0x197C, 13);
66   addKey("9", Nine_Key, 0x18FC, 13);
67   addKey("0", Zero_Key, 0x177C, 13);
68   addKey("enter", Enter_Key, 0x127C, 13);
69   addKey("pip", PIP_Key, 0x077C, 13);
70   addKey("info", Info_Key, 0x06FC, 13);
71   addKey("listings", Guide_Key, 0x07FC, 13);
72   addKey("personalTv", Unmapped_Key, 0x0CFC, 13);
73   addKey("replay", Replay_Key, 0x0EFC, 13);
74   addKey("skip", Advance_Key, 0x0E7C, 13);
75   addKey("pause", Pause_Key, 0x0DFC, 13);
76   addKey("fastForward", FastForward_Key, 0x0D7C, 13);
77   addKey("stop", Stop_Key, 0x0F7C, 13);
78   addKey("chUp", ChannelUp_Key, 0x0FFC, 13);
79   addKey("recall", PrevChannel_Key, 0x057C, 13);
80 }
81
82
83 JVCSat2::JVCSat2(
84   unsigned int index)
85   : PIRKeysetMetaData(
86       "Sat (Dish) Keyset 2",
87       JVC_Make,
88       index)
89 {
90 }
91
92
93 void JVCSat2::populateProtocol(
94   QObject *guiObject)
95 {
96   if (threadableProtocol)
97   {
98     // If the pointer is not null, the keyset must already be populated.
99     return;
100   }
101
102   LIRCProtocol *lp = new LIRCProtocol(
103     guiObject,
104     index,
105     440, 2780,
106     440, 1645,
107     6115, false);
108
109   threadableProtocol = lp;
110
111   lp->setHeaderPair(525, 6045);
112   lp->setTrailerPulse(450);
113
114 //  lp->setMinimumRepetitions(6);
115   lp->setFullHeadlessRepeat(true);
116
117   lp->setCarrierFrequency(56000);
118   lp->setDutyCycle(32);
119
120   setPostData(0x000, 10);
121
122   addKey("info", Info_Key, 0x0, 6);
123   addKey("power_on", PowerOn_Key, 0x1, 6);
124   addKey("power", Power_Key, 0x2, 6);
125   addKey("1", One_Key, 0x4, 6);
126   addKey("2", Two_Key, 0x5, 6);
127   addKey("3", Three_Key, 0x6, 6);
128   addKey("4", Four_Key, 0x8, 6);
129   addKey("5", Five_Key, 0x9, 6);
130   addKey("6", Six_Key, 0x10, 6);
131   addKey("7", Seven_Key, 0x12, 6);
132   addKey("8", Eight_Key, 0x13, 6);
133   addKey("9", Nine_Key, 0x14, 6);
134   addKey("0", Zero_Key, 0x17, 6);
135   addKey("menu", Menu_Key, 0x11, 6);
136   addKey("select", Select_Key, 0x16, 6);
137   addKey("cancel", Exit_Key, 0x18, 6);
138   addKey("guide", Guide_Key, 0x20, 6);
139   addKey("view", Unmapped_Key, 0x22, 6);
140   addKey("tv_vcr", Input_Key, 0x23, 6);
141   addKey("right", Right_Key, 0x24, 6);
142   addKey("up", Up_Key, 0x26, 6);
143   addKey("recall", PrevChannel_Key, 0x27, 6);
144   addKey("left", Left_Key, 0x28, 6);
145   addKey("down", Down_Key, 0x30, 6);
146   addKey("record", Record_Key, 0x31, 6);
147   addKey("pause", Pause_Key, 0x32, 6);
148   addKey("stop", Stop_Key, 0x33, 6);
149   addKey("sys_info", Info_Key, 0x36, 6);
150   addKey("asterisk", Unmapped_Key, 0x37, 6);
151   addKey("pound", Unmapped_Key, 0x38, 6);
152   addKey("power_off", PowerOff_Key, 0x39, 6);
153   addKey("sat", Unmapped_Key, 0x41, 6);
154   addKey("dish_home", Unmapped_Key, 0x52, 6);
155   addKey("sys_info2", Unmapped_Key, 0x54, 6);
156   addKey("dish_home2", Unmapped_Key, 0x56, 6);
157 }
158
159
160 JVCVCR1::JVCVCR1(
161   unsigned int index)
162   : PIRKeysetMetaData(
163       "VCR Keyset 1",
164       JVC_Make,
165       index)
166 {
167 }
168
169
170 void JVCVCR1::populateProtocol(
171   QObject *guiObject)
172 {
173   if (threadableProtocol)
174   {
175     // If the pointer is not null, the keyset must already be populated.
176     return;
177   }
178
179   threadableProtocol = new JVCProtocol(guiObject, index);
180
181 //  setPreData(0xC2, 8);
182   setPreData(0x43, 8);
183
184   addKey("av", Unmapped_Key, 0x01, 8);
185   addKey("stop", Stop_Key, 0x03, 8);
186   addKey("eject", Eject_Key, 0x04, 8);
187   addKey("forward", FastForward_Key, 0x06, 8);
188   addKey("backward", Rewind_Key, 0x07, 8);
189   addKey("power", Power_Key, 0x0B, 8);
190   addKey("pause", Pause_Key, 0x0D, 8);
191   addKey("play", Play_Key, 0x0E, 8);
192
193   addKey("input_1", Unmapped_Key, 0x11, 8);
194   addKey("tv_vcr", Input_Key, 0x13, 8); // "monitor"
195   addKey("right", Next_Key, 0x14, 8); // "JOG+"
196   addKey("left", Previous_Key, 0x15, 8); // "JOG-"
197   addKey("MUTE", Mute_Key, 0x17, 8);
198   addKey("pr_dn", ChannelDown_Key, 0x18, 8);
199   addKey("pr_up", ChannelUp_Key, 0x19, 8);
200
201   addKey("no_1", One_Key, 0x21, 8);
202   addKey("no_2", Two_Key, 0x22, 8);
203   addKey("no_3", Three_Key, 0x23, 8);
204   addKey("no_4", Four_Key, 0x24, 8);
205   addKey("no_5", Five_Key, 0x25, 8);
206   addKey("no_6", Six_Key, 0x26, 8);
207   addKey("no_7", Seven_Key, 0x27, 8);
208   addKey("no_8", Eight_Key, 0x28, 8);
209   addKey("no_9", Nine_Key, 0x29, 8);
210   addKey("SPEED", VHSSpeed_Key, 0x31, 8); // "I/II"
211   addKey("Blue", Blue_Key, 0x31, 8); // odd
212   addKey("no_0", Zero_Key, 0x33, 8);
213
214   addKey("TIMER", Timer_Key, 0x35, 8);
215   addKey("CANCEL", Exit_Key, 0x36, 8); // "zero4x", "reset"
216   addKey("CANCEL", Clear_Key, 0x36, 8); // "zero4x", "reset"
217   addKey("menu", Menu_Key, 0x37, 8); // "PROG"
218   addKey("DISPLAY", Info_Key, 0x38, 8);
219   addKey("clock", Clock_Key, 0x3A, 8);
220   addKey("Green", Green_Key, 0x3B, 8);
221   addKey("ok", Select_Key, 0x3C, 8);
222   addKey("check", Unmapped_Key, 0x3D, 8); // "prog_check"
223   addKey("enter", Enter_Key, 0x3E, 8); // "store"
224
225   addKey("ch_set", Unmapped_Key, 0x66, 8);
226   addKey("line", Unmapped_Key, 0x6E, 8);
227   addKey("mode", Mode_Key, 0x81, 8);
228   addKey("Red", Red_Key, 0x91, 8);
229   addKey("INDEX1", Unmapped_Key, 0x93, 8);
230   addKey("INDEX2", Unmapped_Key, 0x94, 8);
231   addKey("3dphonic", Unmapped_Key, 0x95, 8);
232   addKey("ff_30sec", Advance_Key, 0x96, 8); // "skip"
233   addKey("scene-finder", Unmapped_Key, 0x97, 8);
234   addKey("Yellow", Yellow_Key, 0x97, 8);
235   addKey("start", Unmapped_Key, 0x98, 8);
236   addKey("showview", Program_Key, 0xC1, 8); // program
237   addKey("review", Replay_Key, 0xC3, 8);
238   addKey("SOUND2", Unmapped_Key, 0xC4, 8);
239   addKey("date+", Unmapped_Key, 0xC6, 8);
240   addKey("date-", Unmapped_Key, 0xC7, 8);
241   addKey("start+", Unmapped_Key, 0xC8, 8);
242   addKey("start-", Unmapped_Key, 0xC9, 8);
243   addKey("stop+", Unmapped_Key, 0xCA, 8);
244   addKey("stop-", Unmapped_Key, 0xCB, 8);
245   addKey("RECORD", Record_Key, 0xCC, 8); // "1tr"
246
247   addKey("MIC+", Unmapped_Key, 0xD1, 8);
248   addKey("MIC-", Unmapped_Key, 0xD2, 8);
249   addKey("SOUND1", Unmapped_Key, 0xD7, 8);
250   addKey("SOUND3", Unmapped_Key, 0xDC, 8);
251   addKey("IN/OUT", Unmapped_Key, 0xDE, 8);
252   addKey("lock", Unmapped_Key, 0xF0, 8);
253   addKey("die", Unmapped_Key, 0xFA, 8);
254
255   // Cursor keys duplicate some other keys:
256   addKey("right", Right_Key, 0x14, 8); // "JOG+"
257   addKey("left", Left_Key, 0x15, 8); // "JOG-"
258   addKey("pr_dn", Down_Key, 0x18, 8);
259   addKey("pr_up", Up_Key, 0x19, 8);
260 }
261
262
263 JVCVCR1a::JVCVCR1a(
264   unsigned int index)
265   : JVCVCR1(index)
266 {
267   setKeysetName("VCR Keyset 1a");
268 }
269
270
271 void JVCVCR1a::populateProtocol(
272   QObject *guiObject)
273 {
274   if (threadableProtocol)
275   {
276     // If the pointer is not null, the keyset must already be populated.
277     return;
278   }
279
280   JVCVCR1::populateProtocol(guiObject);
281
282   addKey("red", Red_Key, 0x07, 8);
283   addKey("green", Green_Key, 0x51, 8);
284   addKey("yellow", Yellow_Key, 0x14, 8);
285   addKey("blue", Blue_Key, 0x06, 8);
286   addKey("menu", Menu_Key, 0x13, 8);
287   addKey("last", Unmapped_Key, 0x15, 8); // what is this?
288   addKey("suchl", Unmapped_Key, 0x96, 8); // ditto
289 }
290
291
292 // Setup keysets for use in B-mode:
293 JVCVCRBmode1::JVCVCRBmode1(
294   unsigned int index)
295   : JVCVCR1(index)
296 {
297   setKeysetName("VCR (B Mode) keyset 1");
298 }
299
300
301 void JVCVCRBmode1::populateProtocol(
302   QObject *guiObject)
303 {
304   if (threadableProtocol)
305   {
306     // If the pointer is not null, the keyset must already be populated.
307     return;
308   }
309
310   JVCVCR1::populateProtocol(guiObject);
311
312   setPreData(0x53, 8);
313 }
314
315
316 JVCVCRBmode1a::JVCVCRBmode1a(
317   unsigned int index)
318   : JVCVCR1a(index)
319 {
320   setKeysetName("VCR (B Mode) keyset 1a");
321 }
322
323
324 void JVCVCRBmode1a::populateProtocol(
325   QObject *guiObject)
326 {
327   if (threadableProtocol)
328   {
329     // If the pointer is not null, the keyset must already be populated.
330     return;
331   }
332
333   JVCVCR1a::populateProtocol(guiObject);
334
335   setPreData(0x53, 8);
336 }
337
338
339 JVCTV1::JVCTV1(
340   unsigned int index)
341   : PIRKeysetMetaData(
342       "TV Keyset 1",
343       JVC_Make,
344       index)
345 {
346 }
347
348
349 void JVCTV1::populateProtocol(
350   QObject *guiObject)
351 {
352   if (threadableProtocol)
353   {
354     // If the pointer is not null, the keyset must already be populated.
355     return;
356   }
357
358   threadableProtocol = new JVCProtocol(guiObject, index);
359
360   setPreData(0x03, 8);
361
362   addKey("main/sap", Audio_Key, 0x00, 8); // "I/II", "Stereo/SAP/Mono"
363   addKey("info", Info_Key, 0x04, 8); // "display", "OSD"
364   addKey("last", PrevChannel_Key, 0x05, 8); // "return"
365   addKey("RESET", Reset_Key, 0x06, 8);
366   addKey("antenna/cable", Unmapped_Key, 0x0A, 8);
367   addKey("BROADCAST", Unmapped_Key, 0x0B, 8); // "ant/cable"
368   addKey("video_status", Unmapped_Key, 0x0D, 8); // "AV Status/Reset"
369   addKey("cc", Captions_Key, 0x0E, 8);
370   addKey("input_s", Unmapped_Key, 0x0F, 8);
371
372   addKey("tuner discrete", AntennaInput_Key, 0x10, 8);
373   addKey("Video in discrete", CompositeInput_Key, 0x11, 8);
374   addKey("input_2", Unmapped_Key, 0x12, 8);
375   addKey("TV/VCR", Input_Key, 0x13, 8); // "input"
376   addKey("input_3", Unmapped_Key, 0x14, 8);
377   addKey("Power", Power_Key, 0x17, 8);
378   addKey("Prog-", ChannelDown_Key, 0x18, 8);
379   addKey("Prog+", ChannelUp_Key, 0x19, 8);
380   addKey("Power Off", PowerOff_Key, 0x1A, 8); // "LEVELUP"
381 //  addKey("LEVELDOWN", Unmapped_Key, 0x1B, 8);
382   addKey("AUDIO", Mute_Key, 0x1C, 8); // "mute"
383   addKey("Power On", PowerOn_Key, 0x1D, 8);
384   addKey("Vol+", VolumeUp_Key, 0x1E, 8);
385   addKey("Vol-", VolumeDown_Key, 0x1F, 8);
386
387   addKey("0", Zero_Key, 0x20, 8);
388   addKey("1", One_Key, 0x21, 8);
389   addKey("2", Two_Key, 0x22, 8);
390   addKey("3", Three_Key, 0x23, 8);
391   addKey("4", Four_Key, 0x24, 8);
392   addKey("5", Five_Key, 0x25, 8);
393   addKey("6", Six_Key, 0x26, 8);
394   addKey("7", Seven_Key, 0x27, 8);
395   addKey("8", Eight_Key, 0x28, 8);
396   addKey("9", Nine_Key, 0x29, 8);
397
398   addKey("br_up", BrightnessUp_Key, 0x30, 8);
399   addKey("br_down", BrightnessDown_Key, 0x31, 8);
400   addKey("col_up", ColorUp_Key, 0x32, 8);
401   addKey("col_down", ColorDown_Key, 0x33, 8);
402   addKey("con_up", ContrastUp_Key, 0x36, 8);
403   addKey("con_down", ContrastDown_Key, 0x37, 8);
404   addKey("FUNCTION", Unmapped_Key, 0x3B, 8);
405   addKey("RECALL", Unmapped_Key, 0x3C, 8); // "recall choice"
406   addKey("sound", Unmapped_Key, 0x42, 8); // "<>"
407   addKey("VNR", NoiseReduction_Key, 0x45, 8);
408   addKey("right", Right_Key, 0x5A, 8);
409   addKey("left", Left_Key, 0x5B, 8);
410   addKey("X", Clear_Key, 0x70, 8);
411   addKey("Timer", Sleep_Key, 0x71, 8);
412   addKey("100+", PlusOneHundred_Key, 0x77, 8);
413   addKey("standard", PictureMode_Key, 0x79, 8); // "picture_mode"
414   addKey("menu", Menu_Key, 0x7A, 8);
415   addKey("down", Down_Key, 0x7B, 8);
416   addKey("up", Up_Key, 0x7C, 8);
417
418   addKey("tone", Unmapped_Key, 0x90, 8);
419   addKey("colour", Unmapped_Key, 0x92, 8); // "P/S"
420   addKey("aspect", AspectRatio_Key, 0x93, 8);
421   addKey("CH_PRESET", Unmapped_Key, 0x99, 8);
422   addKey("MAX_CH", Unmapped_Key, 0x9D, 8);
423 //  addKey("SP/LP", VHSSpeed_Key, 0x9D, 8); // "/_//"
424   addKey("-/--", DoubleDigit_Key, 0x9D, 8);
425   addKey("sound", SoundMode_Key, 0xB4, 8);
426   addKey("theater_pro", Unmapped_Key, 0xD5, 8);
427   addKey("C1/C2", Unmapped_Key, 0xDA, 8);
428   addKey("exit", Exit_Key, 0xE6, 8);
429
430 //  addKey("Red", Red_Key, 0x91, 8);
431 //  addKey("Green", Green_Key, 0x3B, 8);
432 //  addKey("Yellow", Yellow_Key, 0x97, 8);
433 //  addKey("Blue", Blue_Key, 0x31, 8);
434 }
435
436
437 JVCTV1a::JVCTV1a(
438   unsigned int index)
439   : JVCTV1(index)
440 {
441   setKeysetName("TV Keyset 1a");
442 }
443
444
445 void JVCTV1a::populateProtocol(
446   QObject *guiObject)
447 {
448   if (threadableProtocol)
449   {
450     // If the pointer is not null, the keyset must already be populated.
451     return;
452   }
453
454   JVCTV1::populateProtocol(guiObject);
455
456   addKey("+10", DoubleDigit_Key, 0x71, 8);
457 }
458
459
460 JVCTV1b::JVCTV1b(
461   unsigned int index)
462   : JVCTV1(index)
463 {
464   setKeysetName("TV Keyset 1b");
465 }
466
467
468 void JVCTV1b::populateProtocol(
469   QObject *guiObject)
470 {
471   if (threadableProtocol)
472   {
473     // If the pointer is not null, the keyset must already be populated.
474     return;
475   }
476
477   JVCTV1::populateProtocol(guiObject);
478
479   addKey("sleep_timer", Sleep_Key, 0x03, 8);
480 }
481
482
483 JVCTV1c::JVCTV1c(
484   unsigned int index)
485   : JVCTV1(index)
486 {
487   setKeysetName("TV Keyset 1c");
488 }
489
490
491 void JVCTV1c::populateProtocol(
492   QObject *guiObject)
493 {
494   if (threadableProtocol)
495   {
496     // If the pointer is not null, the keyset must already be populated.
497     return;
498   }
499
500   JVCTV1::populateProtocol(guiObject);
501
502   addKey("STOP", Stop_Key, 0x00, 8);
503   addKey("REC", Record_Key, 0x04, 8);
504   addKey("PAUSE", Pause_Key, 0x0B, 8);
505   addKey("PLAY", Play_Key, 0x89, 8);
506   addKey("REW", Rewind_Key, 0xB2, 8);
507   addKey("FF", FastForward_Key, 0xD6, 8);
508 }
509
510
511 // TVs where "volume" and "channel" keys are used to navigate menus:
512 JVCTV1d::JVCTV1d(
513   unsigned int index)
514   : JVCTV1(index)
515 {
516   setKeysetName("TV Keyset 1d");
517 }
518
519
520 void JVCTV1d::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   JVCTV1::populateProtocol(guiObject);
530
531   addKey("down", Down_Key, 0x18, 8);
532   addKey("up", Up_Key, 0x19, 8);
533   addKey("right", Right_Key, 0x1E, 8);
534   addKey("left", Left_Key, 0x1F, 8);
535 }
536
537
538 JVCDAT1::JVCDAT1(
539   unsigned int index)
540   : PIRKeysetMetaData(
541       "DAT Keyset 1",
542       JVC_Make,
543       index)
544 {
545 }
546
547
548 void JVCDAT1::populateProtocol(
549   QObject *guiObject)
550 {
551   if (threadableProtocol)
552   {
553     // If the pointer is not null, the keyset must already be populated.
554     return;
555   }
556
557   threadableProtocol = new JVCProtocol(guiObject, index);
558
559 //  setPreData(0xC9, 8);
560   setPreData(0x93, 8);
561
562   addKey("REC", Record_Key, 0x02, 8);
563   addKey("STOP", Stop_Key, 0x03, 8);
564   addKey("FF", FastForward_Key, 0x06, 8);
565   addKey("REW", Rewind_Key, 0x07, 8);
566   addKey("PLAY", Play_Key, 0x0C, 8);
567   addKey("PAUSE", Pause_Key, 0x0D, 8);
568
569   addKey("INTRO", Unmapped_Key, 0x11, 8);
570   addKey("MEMORY", Program_Key, 0x12, 8);
571   addKey("DISPLAY", Info_Key, 0x14, 8);
572   addKey("CALL", Call_Key, 0x15, 8);
573   addKey("SEARCH->>", Unmapped_Key, 0x16, 8);
574   addKey("<<-SEARCH", Unmapped_Key, 0x17, 8);
575   addKey("|<-SKIP", Previous_Key, 0x18, 8);
576   addKey("SKIP->|", Next_Key, 0x19, 8);
577   addKey("REPEAT", Repeat_Key, 0x1B, 8);
578   addKey("REC_MUTE", RecordMute_Key, 0x1C, 8);
579
580   addKey("0", Zero_Key, 0x20, 8);
581   addKey("1", One_Key, 0x21, 8);
582   addKey("2", Two_Key, 0x22, 8);
583   addKey("3", Three_Key, 0x23, 8);
584   addKey("4", Four_Key, 0x24, 8);
585   addKey("5", Five_Key, 0x25, 8);
586   addKey("6", Six_Key, 0x26, 8);
587   addKey("7", Seven_Key, 0x27, 8);
588   addKey("8", Eight_Key, 0x28, 8);
589   addKey("9", Nine_Key, 0x29, 8);
590
591   addKey("RESERVE", Unmapped_Key, 0x2A, 8);
592   addKey("CANCEL/RESET", Reset_Key, 0x2D, 8);
593 }
594
595
596 JVCCarDeck1::JVCCarDeck1(
597   unsigned int index)
598   : PIRKeysetMetaData(
599       "Car Deck Keyset 1",
600       JVC_Make,
601       index)
602 {
603 }
604
605
606 void JVCCarDeck1::populateProtocol(
607   QObject *guiObject)
608 {
609   if (threadableProtocol)
610   {
611     // If the pointer is not null, the keyset must already be populated.
612     return;
613   }
614
615   threadableProtocol = new JVCProtocol(guiObject, index);
616
617 //  setPreData(0xF1, 8);
618   setPreData(0x8F, 8);
619
620   addKey("Vol+", VolumeUp_Key, 0x84, 8);
621   addKey("Vol-", VolumeDown_Key, 0x85, 8);
622   addKey("Source", Input_Key, 0x88, 8);  // "FUNC", "SRC"
623   addKey("Sound", Mute_Key, 0x8D, 8); // "SCM"
624   addKey("Power", Power_Key, 0x8E, 8); // "Att"
625   addKey("DISC+", ChannelUp_Key, 0x94, 8);
626   addKey("DISC-", ChannelDown_Key, 0x95, 8);
627
628   // Can't be sure if either or both of these are true:
629   addKey("Track+", Next_Key, 0x92, 8);
630   addKey("Track-", Previous_Key, 0x93, 8);
631   addKey("FF", FastForward_Key, 0x92, 8);
632   addKey("Rew", Rewind_Key, 0x93, 8);
633 }
634
635
636 // Modern JVC audio devices are using a wide array of addresses, so I'm
637 // smushing the address and command together.  Once you start mixing adresses
638 // together, they might as well all be a single command anyway...
639
640 JVCAudio1::JVCAudio1(
641   unsigned int index)
642   : PIRKeysetMetaData(
643       "Audio Keyset 1",
644       JVC_Make,
645       index)
646 {
647 }
648
649
650 void JVCAudio1::populateProtocol(
651   QObject *guiObject)
652 {
653   if (threadableProtocol)
654   {
655     // If the pointer is not null, the keyset must already be populated.
656     return;
657   }
658
659   threadableProtocol = new JVCProtocol(guiObject, index);
660
661   addKey("SLEEP", Sleep_Key, 0x03A3, 16);
662   addKey("POWER", Power_Key, 0x17A3, 16);
663   addKey("VOL+", VolumeUp_Key, 0x1EA3, 16);
664   addKey("VOL-", VolumeDown_Key, 0x1FA3, 16);
665   addKey("MD-AUX", AuxInput_Key, 0x3EA3, 16); // "TAPE-AUX"
666   addKey("TAPE", TapeInput_Key, 0x3FA3, 16);
667   addKey("FM-MODE", FMMode_Key, 0x5AA3, 16);
668   addKey("TUNER-BAND", TunerBand_Key, 0x5BA3, 16);
669   addKey("AHB-PRO", Unmapped_Key, 0x75A3, 16);
670   addKey("AUTO-PRESET", Unmapped_Key, 0x77A3, 16);
671
672   addKey("STOP", Stop_Key, 0x43B3, 16); // "CD.Stop"
673   addKey("CD-EJECT", Eject_Key, 0x44B3, 16);
674   addKey("INTRO", Unmapped_Key, 0x48B3, 16);
675   addKey("PLAY", Play_Key, 0x4CB3, 16); // "CD.Play"
676   addKey("DIMMER", Unmapped_Key, 0x52B3, 16);
677   addKey("REW", Rewind_Key, 0x58B3, 16);
678   addKey("FF", FastForward_Key, 0x59B3, 16); // "CD.Next"
679   addKey("REPEAT", Repeat_Key, 0x5BB3, 16);
680   addKey("1", One_Key, 0x61B3, 16);
681   addKey("2", Two_Key, 0x62B3, 16);
682   addKey("3", Three_Key, 0x63B3, 16);
683   addKey("4", Four_Key, 0x64B3, 16);
684   addKey("5", Five_Key, 0x65B3, 16);
685   addKey("6", Six_Key, 0x66B3, 16);
686   addKey("7", Seven_Key, 0x67B3, 16);
687   addKey("8", Eight_Key, 0x68B3, 16);
688   addKey("9", Nine_Key, 0x69B3, 16);
689   addKey("MEMORY/CALL", Program_Key, 0x6AB3, 16); // "PROGRAM"
690   addKey("CANCEL", Clear_Key, 0x6DB3, 16);
691   addKey("10", Zero_Key, 0x6EB3, 16); // Treating "10" as "0" here
692   addKey("+10", DoubleDigit_Key, 0x6FB3, 16);
693   addKey("RANDOM", Random_Key, 0x72B3, 16);
694
695   addKey("UP", Up_Key, 0x00AF, 16);
696   addKey("DOWN", Down_Key, 0x01AF, 16);
697   addKey("RIGHT", Right_Key, 0x02AF, 16);
698   addKey("LEFT", Left_Key, 0x03AF, 16);
699   addKey("NEXT", Next_Key, 0x05AF, 16);
700   addKey("PREV", Previous_Key, 0x06AF, 16);
701   addKey("BASS", Unmapped_Key, 0x1EAF, 16);
702   addKey("TREBLE", Unmapped_Key, 0x2EAF, 16);
703   addKey("DISPLAY-MODE", Info_Key, 0x83AF, 16);
704   addKey("PTY-EON", Unmapped_Key, 0x85AF, 16);
705   addKey("SET", Select_Key, 0x91AF, 16);
706
707   addKey("EDIT-TITLE", Unmapped_Key, 0x89BF, 16);
708   addKey("CHARA", Unmapped_Key, 0xB8BF, 16);
709 }
710
711
712 JVCAudio1a::JVCAudio1a(
713   unsigned int index)
714   : JVCAudio1(index)
715 {
716   setKeysetName("Audio Keyset 1a");
717 }
718
719
720 void JVCAudio1a::populateProtocol(
721   QObject *guiObject)
722 {
723   if (threadableProtocol)
724   {
725     // If the pointer is not null, the keyset must already be populated.
726     return;
727   }
728
729   JVCAudio1::populateProtocol(guiObject);
730
731   addKey("CD-PLAY-PAUSE", Play_Key, 0x3DA3, 16);
732   addKey("MD-PLAY-PAUSE", Unmapped_Key, 0x30AF, 16);
733 }
734
735
736 JVCAudio1b::JVCAudio1b(
737   unsigned int index)
738   : JVCAudio1(index)
739 {
740   setKeysetName("Audio Keyset 1b");
741 }
742
743
744 void JVCAudio1b::populateProtocol(
745   QObject *guiObject)
746 {
747   if (threadableProtocol)
748   {
749     // If the pointer is not null, the keyset must already be populated.
750     return;
751   }
752
753   JVCAudio1::populateProtocol(guiObject);
754
755   addKey("VCR", VCRInput_Key, 0x2443, 16);
756
757   addKey("tape-stop", Unmapped_Key, 0x0383, 16); // "Deck.Stop"
758   addKey("FORWARDS", Unmapped_Key, 0x0683, 16); // "Deck.Right"
759   addKey("BACKWARDS", Unmapped_Key, 0x0783, 16); // "Deck.Left"
760   addKey("PLAY", Unmapped_Key, 0x0C83, 16); // "tape-play"
761   addKey("STILL/PAUSE", Unmapped_Key, 0x0D83, 16);
762   addKey("STOP", Unmapped_Key, 0x0D83, 16);
763   addKey("Deck.PlayLeft", Unmapped_Key, 0x0E83, 16);
764   addKey("Deck.PlayRight", Unmapped_Key, 0x0F83, 16);
765   addKey("STOP2", Unmapped_Key, 0x4383, 16);
766   addKey("REC+PLAY", Record_Key, 0xCC83, 16);
767   addKey("Deck.A", Unmapped_Key, 0xD083, 16);
768   addKey("Deck.B", Unmapped_Key, 0xD183, 16);
769   addKey("RecPause", RecordPause_Key, 0xED83, 16);
770
771   addKey("MONITOR/TAPE2", Unmapped_Key, 0x07A3, 16);
772   addKey("TUNER", TunerInput_Key, 0x0BA3, 16);
773   addKey("tuner-", ChannelDown_Key, 0x18A3, 16);
774   addKey("tuner+", ChannelUp_Key, 0x19A3, 16);
775   addKey("FADE_MUTING", Unmapped_Key, 0x1CA3, 16);
776   addKey("Tuner 0", Unmapped_Key, 0x20A3, 16);
777   addKey("Tuner 1", Unmapped_Key, 0x21A3, 16);
778   addKey("Tuner 2", Unmapped_Key, 0x22A3, 16);
779   addKey("Tuner 3", Unmapped_Key, 0x23A3, 16);
780   addKey("Tuner 4", Unmapped_Key, 0x24A3, 16);
781   addKey("Tuner 5", Unmapped_Key, 0x25A3, 16);
782   addKey("Tuner 6", Unmapped_Key, 0x26A3, 16);
783   addKey("Tuner 7", Unmapped_Key, 0x27A3, 16);
784   addKey("Tuner 8", Unmapped_Key, 0x28A3, 16);
785   addKey("Tuner 9", Unmapped_Key, 0x29A3, 16);
786   addKey("Tuner 10", Unmapped_Key, 0x2AA3, 16);
787   addKey("Tuner +10", Unmapped_Key, 0x2FA3, 16);
788   addKey("SoundMode", SoundMode_Key, 0x38A3, 16);
789   addKey("PHONO", PhonoInput_Key, 0x3CA3, 16);
790   addKey("cd-play", Play_Key, 0x3DA3, 16); // "CD"
791
792   addKey("cd-stop", Stop_Key, 0x43B3, 16);
793   addKey("cd-pause", Pause_Key, 0x4DB3, 16);
794   addKey("cd-prev", Previous_Key, 0x58B3, 16);
795   addKey("cd-next", Next_Key, 0x59B3, 16);
796   addKey("0", Zero_Key, 0x60B3, 16);
797   addKey("cd-back", Rewind_Key, 0x70B3, 16);
798   addKey("Disc program", Unmapped_Key, 0x71B3, 16);
799   addKey("cd-forw", FastForward_Key, 0x76B3, 16);
800   addKey("Disc continue", Unmapped_Key, 0x77B3, 16);
801   addKey("Disc 1", Unmapped_Key, 0x79B3, 16);
802   addKey("Disc 2", Unmapped_Key, 0x7AB3, 16);
803   addKey("Disc 3", Unmapped_Key, 0x7BB3, 16);
804   addKey("Disc 4", Unmapped_Key, 0x7CB3, 16);
805   addKey("Disc 5", Unmapped_Key, 0x7DB3, 16);
806   addKey("Disc 6", Unmapped_Key, 0x7EB3, 16);
807 }
808
809
810 JVCAudio2::JVCAudio2(
811   unsigned int index)
812   : PIRKeysetMetaData(
813       "Audio Keyset 2",
814       JVC_Make,
815       index)
816 {
817 }
818
819
820 void JVCAudio2::populateProtocol(
821   QObject *guiObject)
822 {
823   if (threadableProtocol)
824   {
825     // If the pointer is not null, the keyset must already be populated.
826     return;
827   }
828
829   threadableProtocol = new JVCProtocol(guiObject, index);
830
831 //  setPreData(0xF9, 8);
832   setPreData(0x9F, 8);
833
834   addKey("power", Power_Key, 0x00, 8);
835   addKey("vol+", VolumeUp_Key, 0x01, 8);
836   addKey("vol-", VolumeDown_Key, 0x02, 8);
837   addKey("ACTIVE_HYPER_BASS", EnhancedBass_Key, 0x04, 8); // "bass"
838   addKey("band", TunerBand_Key, 0x0B, 8);  // "TUNER_BAND"
839   addKey("aux", AuxInput_Key, 0x0D, 8);
840
841   addKey("enter", Enter_Key, 0x11, 8);
842   addKey("PRESET_SCAN", Scan_Key, 0x12, 8);
843   addKey("auto_preset", Unmapped_Key, 0x13, 8);
844   addKey("presettuning", Unmapped_Key, 0x15, 8);
845   addKey("display-mode", Unmapped_Key, 0x16, 8);
846   addKey("pty-eon", Unmapped_Key, 0x17, 8);
847   addKey("right-select", Unmapped_Key, 0x18, 8);
848   addKey("left-select", Unmapped_Key, 0x19, 8);
849   addKey("display", Info_Key, 0x1C, 8); // "CLOCK"
850   addKey("auto_mono", FMMode_Key, 0x1F, 8);  // "fmstereo", "mode"
851
852   addKey("1", One_Key, 0x21, 8);
853   addKey("2", Two_Key, 0x22, 8);
854   addKey("3", Three_Key, 0x23, 8);
855   addKey("4", Four_Key, 0x24, 8);
856   addKey("5", Five_Key, 0x25, 8);
857   addKey("6", Six_Key, 0x26, 8);
858   addKey("7", Seven_Key, 0x27, 8);
859   addKey("8", Eight_Key, 0x28, 8);
860   addKey("9", Nine_Key, 0x29, 8);
861   addKey("10", Zero_Key, 0x2A, 8); // treating "10" as "0" here
862   addKey("10+", DoubleDigit_Key, 0x2E, 8);
863
864   addKey("TIMER_SET", Timer_Key, 0x30, 8);
865   addKey("sleep", Sleep_Key, 0x32, 8);
866   addKey("SET", Select_Key, 0x33, 8); // "clock"
867   addKey("TIMER_ON_OFF", Unmapped_Key, 0x36, 8); // "onoff"
868   addKey("ff", FastForward_Key, 0x3D, 8); // "SEARCH_UP" "search_forward"
869   addKey("rew", Rewind_Key, 0x3E, 8);  // "SEARCH_DOWN" "search_back"
870   addKey("stop", Unmapped_Key, 0x41, 8); // "TAPESTOP"
871   addKey("tape", Unmapped_Key, 0x42, 8);
872   addKey("ff", Unmapped_Key, 0x44, 8); // "TAPENEXT"
873   addKey("rewind", Unmapped_Key, 0x45, 8); // "TAPEPREV"
874   addKey("record", Record_Key, 0x4B, 8); // "TAPEREC"
875   addKey("play", Unmapped_Key, 0x4C, 8); // "TAPERIGHT"
876   addKey("reverseplay", Unmapped_Key, 0x4D, 8); // "TAPELEFT"
877   addKey("synchrorec", Unmapped_Key, 0x56, 8);
878   addKey("deckab", Unmapped_Key, 0x58, 8);
879   addKey("revmode", Unmapped_Key, 0x5F, 8);
880
881   addKey("play", Play_Key, 0x70, 8); // "CD_PLAY_PAUSE"
882   addKey("play", Pause_Key, 0x70, 8); // "CD_PLAY_PAUSE"
883   addKey("stop", Stop_Key, 0x71, 8); // "CD_STOP" "stop_clear"
884   addKey("stop", Clear_Key, 0x71, 8); // "CD_STOP" "stop_clear"
885   addKey("NEXT_TRACK", Next_Key, 0x72, 8);
886   addKey("PREV_TRACK", Previous_Key, 0x73, 8);
887   addKey("memory", Program_Key, 0x74, 8); // "MEMORY_CALL", "program"
888   addKey("edit", Unmapped_Key, 0x75, 8);
889   addKey("intro", Unmapped_Key, 0x76, 8);
890   addKey("random", Random_Key, 0x77, 8);
891   addKey("repeat", Repeat_Key, 0x78, 8);
892   addKey("open_close", Eject_Key, 0x7B, 8); // "allcdeject"
893   addKey("continue", Unmapped_Key, 0x7D, 8);
894   addKey("call", Call_Key, 0x7F, 8);
895   addKey("FREQUENCY", Unmapped_Key, 0x80, 8);
896   addKey("tone", Unmapped_Key, 0x86, 8);
897   addKey("bass+", BassUp_Key, 0x87, 8);
898   addKey("bass-", BassDown_Key, 0x88, 8);
899   addKey("treble+", TrebleUp_Key, 0x89, 8);
900   addKey("treble-", TrebleDown_Key, 0x8A, 8);
901   addKey("sound", Unmapped_Key, 0x8F, 8);
902   addKey("beat-cut", Unmapped_Key, 0xEE, 8);
903   addKey("playcd1", Unmapped_Key, 0xF1, 8);
904   addKey("playcd2", Unmapped_Key, 0xF2, 8);
905   addKey("playcd3", Unmapped_Key, 0xF3, 8);
906   addKey("ejectcd1", Unmapped_Key, 0xF4, 8);
907   addKey("ejectcd2", Unmapped_Key, 0xF5, 8);
908   addKey("ejectcd2", Unmapped_Key, 0xF6, 8);
909 }
910
911
912 JVCDVD1::JVCDVD1(
913   unsigned int index)
914   : PIRKeysetMetaData(
915       "DVD Keyset 1",
916       JVC_Make,
917       index)
918 {
919 }
920
921
922 void JVCDVD1::populateProtocol(
923   QObject *guiObject)
924 {
925   if (threadableProtocol)
926   {
927     // If the pointer is not null, the keyset must already be populated.
928     return;
929   }
930
931   threadableProtocol = new JVCProtocol(guiObject, index);
932
933 //  setPreData(0xF7, 8);
934   setPreData(0xEF, 8);
935
936   addKey("power", Power_Key, 0x40, 8);
937   addKey("stop", Stop_Key, 0x43, 8);
938   addKey("openclose", Eject_Key, 0x44, 8);
939   addKey("SWOOP", Unmapped_Key, 0x49, 8);
940   addKey("play", Play_Key, 0x4C, 8);
941   addKey("pause", Pause_Key, 0x4D, 8);
942   addKey("DIMMER", Unmapped_Key, 0x51, 8);
943   addKey("repeat", Repeat_Key, 0x5B, 8);
944
945   addKey("0", Zero_Key, 0x60, 8);
946   addKey("1", One_Key, 0x61, 8);
947   addKey("2", Two_Key, 0x62, 8);
948   addKey("3", Three_Key, 0x63, 8);
949   addKey("4", Four_Key, 0x64, 8);
950   addKey("5", Five_Key, 0x65, 8);
951   addKey("6", Six_Key, 0x66, 8);
952   addKey("7", Seven_Key, 0x67, 8);
953   addKey("8", Eight_Key, 0x68, 8);
954   addKey("9", Nine_Key, 0x69, 8);
955   addKey("cancel", Clear_Key, 0x6D, 8);
956   addKey("10", Unmapped_Key, 0x6E, 8);
957   addKey("+10", DoubleDigit_Key, 0x6F, 8);
958
959   addKey("back", Rewind_Key, 0x70, 8); // "SLOW_MINUS"
960   addKey("forw", FastForward_Key, 0x76, 8); // "SLOW_PLUS"
961   addKey("choice", Unmapped_Key, 0x7F, 8);
962   addKey("playmode", Unmapped_Key, 0x83, 8);
963
964   addKey("zoom+", Unmapped_Key, 0xAE, 8);
965   addKey("zoom-", Unmapped_Key, 0xAF, 8);
966   addKey("skip_forw", Next_Key, 0xB0, 8); // "next"
967   addKey("skip_back", Previous_Key, 0xB1, 8); // "previous"
968   addKey("display", Info_Key, 0xB5, 8);
969   addKey("digest", Unmapped_Key, 0xB9, 8);
970   addKey("zoom", Zoom_Key, 0xBC, 8);
971   addKey("3dphonix", Unmapped_Key, 0xBD, 8);
972   addKey("vfp", Unmapped_Key, 0xBE, 8); // "theaterposition"
973
974   addKey("onscreen", Unmapped_Key, 0xC0, 8);
975   addKey("menu", Menu_Key, 0xC1, 8);
976   addKey("topmenu", DiscTitle_Key, 0xC2, 8);
977   addKey("audio", Audio_Key, 0xC8, 8);
978   addKey("angle", Angle_Key, 0xCB, 8);
979   addKey("subtitle", Captions_Key, 0xCD, 8);
980
981   addKey("up", Up_Key, 0xD0, 8);
982   addKey("down", Down_Key, 0xD1, 8);
983   addKey("left", Left_Key, 0xD2, 8);
984   addKey("right", Right_Key, 0xD3, 8);
985   addKey("enter", Select_Key, 0xD4, 8);
986   addKey("return", Exit_Key, 0xD5, 8);
987   addKey("title/group", Unmapped_Key, 0xEE, 8);
988
989 //  addKey("voldown", VolumeDown_Key, 0xC5F8, 16);
990 //  addKey("volup", VolumeUp_Key, 0xC578, 16);
991 }