Advanced Settings Panel
[pierogi] / keysets / aiwa.cpp
1 #include "aiwa.h"
2 #include "protocols/aiwaprotocol.h"
3 #include "protocols/lircprotocol.h"
4 #include "protocols/necprotocol.h"
5
6 AiwaVCR1::AiwaVCR1(
7   unsigned int index)
8   : PIRKeysetMetaData(
9       "VCR Keyset 1",
10       Aiwa_Make,
11       index)
12 {
13   addControlledDevice(Aiwa_Make, "HV-CX100KER", VCR_Device);
14 }
15
16
17 void AiwaVCR1::populateProtocol(
18   QObject *guiObject)
19 {
20   if (threadableProtocol)
21   {
22     // If the pointer is not null, the keyset must already be populated.
23     return;
24   }
25
26   threadableProtocol = new AiwaProtocol(guiObject, index);
27
28   setPreData(0x007F, 13);
29
30   addKey("POWER", Power_Key, 0x00, 8);
31   addKey("1", One_Key, 0x01, 8);
32   addKey("2", Two_Key, 0x02, 8);
33   addKey("3", Three_Key, 0x03, 8);
34   addKey("4", Four_Key, 0x04, 8);
35   addKey("5", Five_Key, 0x05, 8);
36   addKey("6", Six_Key, 0x06, 8);
37   addKey("7", Seven_Key, 0x07, 8);
38   addKey("8", Eight_Key, 0x08, 8);
39   addKey("9", Nine_Key, 0x09, 8);
40   addKey("0", Zero_Key, 0x0A, 8);
41   addKey("CH", Unmapped_Key, 0x0C, 8);
42   addKey("TV/VCR", Unmapped_Key, 0x0D, 8);
43   addKey("INPUT", Input_Key, 0x0E, 8);
44   addKey("SLOW", Slow_Key, 0x0F, 8);
45
46   addKey("COUNTDISPLAY", Info_Key, 0x10, 8);
47   addKey("FORWARD", FastForward_Key, 0x11, 8);
48   addKey("REWIND", Rewind_Key, 0x12, 8);
49   addKey("Audio_MONI", Unmapped_Key, 0x13, 8);
50   addKey("REC", Record_Key, 0x14, 8);
51   addKey("PLAY", Play_Key, 0x15, 8);
52   addKey("PAUSE", Pause_Key, 0x17, 8);
53   addKey("Index_SkipForward", Next_Key, 0x18, 8);
54   addKey("Index_SkipBack", Previous_Key, 0x19, 8);
55 //  addKey("ONETOUCH", Unmapped_Key, 0x19, 8); // need sub-keyset for this
56   addKey("STOP", Stop_Key, 0x1A, 8);
57   addKey("TIMER/PRG", Timer_Key, 0x1C, 8);
58   addKey("T-REC", RecordTimed_Key, 0x1E, 8);
59   addKey("CLEAR", Clear_Key, 0x1F, 8); // "CANCEL"
60
61   addKey("CHAN_UP", ChannelUp_Key, 0x40, 8);
62   addKey("CHAN_DOWN", ChannelDown_Key, 0x41, 8);
63   addKey("Audio_DUB", Unmapped_Key, 0x42, 8);
64   addKey("SAT", Unmapped_Key, 0x44, 8);
65   addKey("Zero_Return", Unmapped_Key, 0x45, 8);
66   addKey("TRACK+", TrackingPlus_Key, 0x46, 8);
67   addKey("TRACK-", TrackingMinus_Key, 0x47, 8);
68   addKey("EJECT", Eject_Key, 0x48, 8);
69   addKey("AD-Skip", Advance_Key, 0x49, 8);
70   addKey("SUPER_CLEAR", Unmapped_Key, 0x4B, 8);
71   addKey("RESET", Reset_Key, 0x4C, 8); // "Counter_Reset"
72   addKey("INDEXSRCH", IndexSearch_Key, 0x4D, 8);
73   addKey("SP/LP", VHSSpeed_Key, 0x50, 8);
74   addKey("MEMORY", Memory_Key, 0x51, 8);
75   addKey("AUTO", Unmapped_Key, 0x53, 8);
76   addKey("CLOCK", Clock_Key, 0x56, 8);
77   addKey("A-TR", AutoTracking_Key, 0x5C, 8);
78   addKey("Tape_Remain", Unmapped_Key, 0x5E, 8);
79   addKey("REPEAT", Repeat_Key, 0x5F, 8);
80
81   addKey("Fwd(Jog)", StepForward_Key, 0x65, 8);
82   addKey("Rev(Jog)", StepBack_Key, 0x74, 8);
83
84   addKey("MENU", Menu_Key, 0x81, 8);
85   addKey("VPS/PDC", RecordPDC_Key, 0x82, 8);
86 //  addKey("NEXT", Next_Key, 0x83, 8);
87   addKey("MENURIGHT", Right_Key, 0x83, 8);
88   addKey("MENULEFT", Left_Key, 0x84, 8);
89   addKey("OTPB", OneTouchPlayBack_Key, 0x89, 8);
90   addKey("MENUUP", Up_Key, 0x8D, 8);
91   addKey("MENUDOWN", Down_Key, 0x8E, 8);
92
93   addKey("Showview_DeLuxe", Unmapped_Key, 0x98, 8);
94   addKey("Add_T", Unmapped_Key, 0x99, 8);
95   addKey("D/WLY", Unmapped_Key, 0x9A, 8);
96   addKey("Set_Ch.No", Unmapped_Key, 0x9D, 8);
97   addKey("Set_Auto", Unmapped_Key, 0x9E, 8);
98   addKey("OK", Select_Key, 0x9F, 8);
99
100   addKey("GUIDE", Guide_Key, 0xB0, 8);
101   addKey("Audio_MIX", Unmapped_Key, 0xB5, 8);
102   addKey("TheatreMode_BBE", Unmapped_Key, 0xB9, 8);
103   addKey("TheatreMode_Q.Surround", Unmapped_Key, 0xBA,8);
104   addKey("TheatreMode_Midnight", Unmapped_Key, 0xBB, 8);
105 }
106
107
108 AiwaVCR2::AiwaVCR2(
109   unsigned int index)
110   : PIRKeysetMetaData(
111       "VCR Keyset 2",
112       Aiwa_Make,
113       index)
114 {
115 }
116
117
118 void AiwaVCR2::populateProtocol(
119   QObject *guiObject)
120 {
121   if (threadableProtocol)
122   {
123     // If the pointer is not null, the keyset must already be populated.
124     return;
125   }
126
127   threadableProtocol = new NECProtocol(guiObject, index, false, true);
128
129   setPreData(0x6E, 8);
130
131   addKey("eject", Eject_Key, 0x00, 8);
132   addKey("stop", Stop_Key, 0x01, 8);
133   addKey("rew", Rewind_Key, 0x02, 8);
134   addKey("ff", FastForward_Key, 0x03, 8);
135   addKey("0", Zero_Key, 0x04, 8);
136   addKey("1", One_Key, 0x05, 8);
137   addKey("2", Two_Key, 0x06, 8);
138   addKey("3", Three_Key, 0x07, 8);
139   addKey("play", Play_Key, 0x08, 8);
140   addKey("rec/otr", Record_Key, 0x09, 8);
141   addKey("pause", Pause_Key, 0x0B, 8);
142   addKey("4", Four_Key, 0x0C, 8);
143   addKey("5", Five_Key, 0x0D, 8);
144   addKey("6", Six_Key, 0x0E, 8);
145   addKey("7", Seven_Key, 0x0F, 8);
146
147   addKey("power", Power_Key, 0x14, 8);
148   addKey("tv/vcr", Input_Key, 0x15, 8);
149   addKey("menu/i", Menu_Key, 0x16, 8);
150   addKey("8", Eight_Key, 0x1C, 8);
151   addKey("9", Nine_Key, 0x1D, 8);
152   addKey("clear", Clear_Key, 0x1F, 8);
153
154   addKey("child-lock", Unmapped_Key, 0x3F, 8);
155   addKey("viss", IndexSearch_Key, 0x41, 8);
156   addKey("showview", Unmapped_Key, 0x47, 8);
157   addKey("speed", VHSSpeed_Key, 0x48, 8);
158   addKey("av", Unmapped_Key, 0x56, 8);
159   addKey("a-tr", AutoTracking_Key, 0x5F, 8);
160
161   addKey("up", Up_Key, 0x82, 8);
162   addKey("left", Left_Key, 0x83, 8);
163   addKey("down", Down_Key, 0x89, 8);
164   addKey("ok/clk/cnt", Select_Key, 0x8E, 8);
165   addKey("right", Right_Key, 0x90, 8);
166
167   addKey("fav.program", Unmapped_Key, 0xB3, 8);
168   addKey("rec-end-search", Next_Key, 0xB5, 8); // might be wrong
169   addKey("otpb", OneTouchPlayBack_Key, 0xBF, 8);
170   addKey("ad-skip", Advance_Key, 0xDD, 8);
171 }
172
173
174 AiwaVCR3::AiwaVCR3(
175   unsigned int index)
176   : PIRKeysetMetaData(
177       "VCR Keyset 3",
178       Aiwa_Make,
179       index)
180 {
181 }
182
183
184 void AiwaVCR3::populateProtocol(
185   QObject *guiObject)
186 {
187   if (threadableProtocol)
188   {
189     // If the pointer is not null, the keyset must already be populated.
190     return;
191   }
192
193   threadableProtocol = new NECProtocol(guiObject, index, true, false);
194
195   setPreData(0x7B80, 16);
196
197   addKey("0", Zero_Key, 0x00, 8);
198   addKey("1", One_Key, 0x01, 8);
199   addKey("2", Two_Key, 0x02, 8);
200   addKey("3", Three_Key, 0x03, 8);
201   addKey("4", Four_Key, 0x04, 8);
202   addKey("5", Five_Key, 0x05, 8);
203   addKey("6", Six_Key, 0x06, 8);
204   addKey("7", Seven_Key, 0x07, 8);
205   addKey("8", Eight_Key, 0x08, 8);
206   addKey("9", Nine_Key, 0x09, 8);
207   addKey("ch+", ChannelUp_Key, 0x0A, 8);
208   addKey("ch-", ChannelDown_Key, 0x0B, 8);
209   addKey("t-rec", RecordTimed_Key, 0x0D, 8);
210   addKey("audio", Audio_Key, 0x0E, 8);
211   addKey("-/--", DoubleDigit_Key, 0x0F, 8);
212   addKey("tv/vcr", Input_Key, 0x12, 8);
213   addKey("power", Power_Key, 0x13, 8);
214   addKey("index", Unmapped_Key, 0x14, 8);
215   addKey("rec", Record_Key, 0x15, 8);
216   addKey("play", Play_Key, 0x16, 8);
217   addKey("stop", Stop_Key, 0x17, 8);
218   addKey("ff", FastForward_Key, 0x18, 8);
219   addKey("rew", Rewind_Key, 0x19, 8);
220   addKey("pause", Pause_Key, 0x1A, 8);
221   addKey("otpb", OneTouchPlayBack_Key, 0x1B, 8);
222   addKey("vidplus", Unmapped_Key, 0x1D, 8);
223   addKey("speed", VHSSpeed_Key, 0x1E, 8);
224   addKey("slow", Slow_Key, 0x1F, 8);
225   addKey("up", Up_Key, 0x41, 8);
226   addKey("down", Down_Key, 0x42, 8);
227   addKey("select", Select_Key, 0x45, 8);
228   addKey("left", Left_Key, 0x49, 8);
229   addKey("cancel", Clear_Key, 0x4A, 8);
230   addKey("zero", Unmapped_Key, 0x4B, 8);
231   addKey("reset", Reset_Key, 0x4C, 8);
232   addKey("right", Right_Key, 0x4D, 8);
233   addKey("eject", Eject_Key, 0x4E, 8);
234   addKey("menu", Menu_Key, 0x50, 8);
235   addKey("counter", Unmapped_Key, 0x51, 8);
236   addKey("tracking", AutoTracking_Key, 0x52, 8);
237   addKey("ad-skip", Advance_Key, 0x5C, 8);
238   addKey("call", Call_Key, 0x5F, 8);
239 }
240
241
242 AiwaAudio1::AiwaAudio1(
243   unsigned int index)
244   : PIRKeysetMetaData(
245       "Audio Keyset 1",
246       Aiwa_Make,
247       index)
248 {
249   addControlledDevice(Aiwa_Make, "LCX-100", Audio_Device);
250   addControlledDevice(Aiwa_Make, "RC-TD3", Audio_Device);
251 }
252
253
254 void AiwaAudio1::populateProtocol(
255   QObject *guiObject)
256 {
257   if (threadableProtocol)
258   {
259     // If the pointer is not null, the keyset must already be populated.
260     return;
261   }
262
263   threadableProtocol = new AiwaProtocol(guiObject, index);
264
265   setPreData(0x0070, 13);
266
267   addKey("power", Power_Key, 0x00, 8);
268   addKey("tape", TapeInput_Key, 0x0C, 8);
269   addKey("tuner", TunerInput_Key, 0x0D, 8);
270   addKey("cd", CDInput_Key, 0x0E, 8);
271
272   addKey("volume_up", VolumeUp_Key, 0x11, 8);
273   addKey("volume_down", VolumeDown_Key, 0x12, 8);
274   addKey("tuner_band", AM_Key, 0x13, 8);  // This is a hack
275   addKey("tuner_band", FM_Key, 0x13, 8);  // This too
276   addKey("tape_play", Unmapped_Key, 0x14, 8);
277   addKey("tape_stop", Unmapped_Key, 0x15, 8);
278   addKey("tape_next", Unmapped_Key, 0x16, 8);
279   addKey("tape_prev", Unmapped_Key, 0x17, 8);
280   addKey("tape_rec", Unmapped_Key, 0x18, 8);
281   addKey("tape_pause", Unmapped_Key, 0x19, 8);
282   addKey("geq", Unmapped_Key, 0x1F, 8); // "mode", "CD_MODE"
283
284   addKey("sleep", Sleep_Key, 0x40, 8);
285   addKey("tuner_mode", FMMode_Key, 0x4E, 8); // "FM_MODE"
286   addKey("REPEAT", Repeat_Key, 0x51, 8);
287   addKey("set", Memory_Key, 0x52, 8); // "MEMORY"
288   addKey("CANCEL", Clear_Key, 0x53, 8);
289   addKey("timer", Timer_Key, 0x5A, 8);
290   addKey("aux", AuxInput_Key, 0x5D, 8); // "DAT_AUX"
291
292   addKey("DISPLAY", Info_Key, 0x80, 8);
293   addKey("random", Random_Key, 0x8F, 8);
294   addKey("1", One_Key, 0x91, 8);
295   addKey("2", Two_Key, 0x92, 8);
296   addKey("3", Three_Key, 0x93, 8);
297   addKey("4", Four_Key, 0x94, 8);
298   addKey("5", Five_Key, 0x95, 8);
299   addKey("6", Six_Key, 0x96, 8);
300   addKey("7", Seven_Key, 0x97, 8);
301   addKey("8", Eight_Key, 0x98, 8);
302   addKey("9", Nine_Key, 0x99, 8);
303   addKey("0", Zero_Key, 0x9A, 8);
304   addKey("+10", DoubleDigit_Key, 0x9B, 8);
305
306   addKey("play", Play_Key, 0xC4, 8); // "ENTER", "UP"
307   addKey("play", Up_Key, 0xC4, 8); // "ENTER", "UP"
308   addKey("stop", Stop_Key, 0xC5, 8); // "DOWN"
309   addKey("stop", Down_Key, 0xC5, 8); // "DOWN"
310   addKey("forward", FastForward_Key, 0xC6, 8); // "RIGHT", "next"
311   addKey("forward", Right_Key, 0xC6, 8); // "RIGHT", "next"
312   addKey("SKIP-SEARCH-TUNING-RIGHT", ChannelUp_Key, 0xC6, 8);
313   addKey("back", Rewind_Key, 0xC7, 8); // "LEFT", "prev"
314   addKey("back", Left_Key, 0xC7, 8); // "LEFT", "prev"
315   addKey("SKIP-SEARCH-TUNING-LEFT", ChannelDown_Key, 0xC7, 8);
316   addKey("PAUSE", Pause_Key, 0xC9, 8);
317   addKey("dimmer", Unmapped_Key, 0xCD, 8);
318   addKey("tray", Eject_Key, 0xCF, 8);
319 }
320
321
322 AiwaAudio1a::AiwaAudio1a(
323   unsigned int index)
324   : AiwaAudio1(index)
325 {
326   setKeysetName("Audio Keyset 1a");
327
328   addControlledDevice(Aiwa_Make, "XR-M201", Audio_Device);
329   addControlledDevice(Aiwa_Make, "CA-DW635", Audio_Device);
330 }
331
332
333 // Don't know why only the numbers are different for this one:
334 void AiwaAudio1a::populateProtocol(
335   QObject *guiObject)
336 {
337   if (threadableProtocol)
338   {
339     // If the pointer is not null, the keyset must already be populated.
340     return;
341   }
342
343   AiwaAudio1::populateProtocol(guiObject);
344
345   addKey("1", One_Key, 0x01, 8);
346   addKey("2", Two_Key, 0x02, 8);
347   addKey("3", Three_Key, 0x03, 8);
348   addKey("4", Four_Key, 0x04, 8);
349   addKey("5", Five_Key, 0x05, 8);
350   addKey("6", Six_Key, 0x06, 8);
351   addKey("7", Seven_Key, 0x07, 8);
352   addKey("8", Eight_Key, 0x08, 8);
353   addKey("9", Nine_Key, 0x09, 8);
354   addKey("0", Zero_Key, 0x0A, 8);
355   addKey("+10", DoubleDigit_Key, 0x0B, 8);
356
357   addKey("EQ", Unmapped_Key, 0xCA, 8);
358 }
359
360
361 AiwaAudio2::AiwaAudio2(
362   unsigned int index)
363   : PIRKeysetMetaData(
364       "Audio Keyset 2",
365       Aiwa_Make,
366       index)
367 {
368   addControlledDevice(Aiwa_Make, "NSX-S22", Audio_Device);
369   addControlledDevice(Aiwa_Make, "NSX-532", Audio_Device);
370   addControlledDevice(Aiwa_Make, "NSX-AV320", Audio_Device);
371   addControlledDevice(Aiwa_Make, "XR-M35", Audio_Device);
372   addControlledDevice(Aiwa_Make, "LCX50", Audio_Device);
373   addControlledDevice(Aiwa_Make, "NSX-V929", Audio_Device);
374   addControlledDevice(Aiwa_Make, "NSX-V30", Audio_Device);
375   addControlledDevice(Aiwa_Make, "NSX-V25", Audio_Device);
376   addControlledDevice(Aiwa_Make, "NSX-320", Audio_Device);
377   addControlledDevice(Aiwa_Make, "NSX-330", Audio_Device);
378   addControlledDevice(Aiwa_Make, "NSX-500", Audio_Device);
379   addControlledDevice(Aiwa_Make, "NSX-540", Audio_Device);
380   addControlledDevice(Aiwa_Make, "NSX-DR5", Audio_Device);
381 }
382
383
384 void AiwaAudio2::populateProtocol(
385   QObject *guiObject)
386 {
387   if (threadableProtocol)
388   {
389     // If the pointer is not null, the keyset must already be populated.
390     return;
391   }
392
393   threadableProtocol = new AiwaProtocol(guiObject, index);
394
395   setPreData(0x006E, 13);
396
397   addKey("power", Power_Key, 0x00, 8);
398   addKey("1", One_Key, 0x01, 8);
399   addKey("2", Two_Key, 0x02, 8);
400   addKey("3", Three_Key, 0x03, 8);
401   addKey("4", Four_Key, 0x04, 8);
402   addKey("5", Five_Key, 0x05, 8);
403   addKey("6", Six_Key, 0x06, 8);
404   addKey("7", Seven_Key, 0x07, 8);
405   addKey("8", Eight_Key, 0x08, 8);
406   addKey("9", Nine_Key, 0x09, 8);
407   addKey("0", Zero_Key, 0x0A, 8);
408   addKey("plus10", DoubleDigit_Key, 0x0B, 8);
409   addKey("shift7", Timer_Key, 0x0C, 8); // "timer"
410   addKey("shift8", Sleep_Key, 0x0E, 8); // "sleep"
411
412   addKey("shift9", Unmapped_Key, 0x11, 8); // "clock"
413   addKey("shift0", FMMode_Key, 0x12, 8); // "mono tuner"
414   addKey("EJECT", Eject_Key, 0x13, 8); // "OPEN"
415   addKey("KARAOKE_ENTER", Unmapped_Key, 0x14, 8);
416   addKey("shift3", Random_Key, 0x15, 8); // "random/repeat"
417   addKey("REPEAT", Repeat_Key, 0x16, 8);
418   addKey("shift1", Unmapped_Key, 0x17, 8); // "edit/check"
419   addKey("shift2", Program_Key, 0x19, 8); // "prgm"
420   addKey("TAPE", TapeInput_Key, 0x1B, 8); // "Deck"
421   addKey("shiftplus10", Unmapped_Key, 0x1C, 8); // "band"
422   addKey("VIDEO", AuxInput_Key, 0x1D, 8); // "aux"
423   addKey("function", Unmapped_Key, 0x1E, 8);
424   addKey("CD", CDInput_Key, 0x1F, 8);
425
426   addKey("play", Play_Key, 0x40, 8); // "direction"
427   addKey("stop", Stop_Key, 0x41, 8); // "clear"
428   addKey("stop", Clear_Key, 0x41, 8); // "clear"
429   addKey("next", FastForward_Key, 0x42, 8); // "FF", "up"
430   addKey("next", Up_Key, 0x42, 8); // "FF", "up"
431   addKey("prev", Rewind_Key, 0x43, 8); // "REW", "down"
432   addKey("prev", Down_Key, 0x43, 8); // "REW", "down"
433   addKey("pause", Pause_Key, 0x44, 8); // "SET"
434   addKey("record", Record_Key, 0x45, 8);
435   addKey("Rec_Mute", RecordMute_Key, 0x46, 8);
436   addKey("shift6", EnhancedBass_Key, 0x47, 8); // "t-bass"
437   addKey("bbe", Unmapped_Key, 0x48, 8);
438   addKey("shift4", Unmapped_Key, 0x49, 8); // "geq" "eq" equalizer?
439   addKey("DSP", Surround_Key, 0x4A, 8); // "qsurround"
440   addKey("Mute", Mute_Key, 0x4C, 8);
441   addKey("volup", VolumeUp_Key, 0x4D, 8);
442   addKey("voldown", VolumeDown_Key, 0x4E, 8);
443
444   addKey("vocal_fader", Unmapped_Key, 0x50, 8); // "KARAOKE"
445   addKey("cd1", DiscOne_Key, 0x51, 8); // "DDP_1"
446   addKey("cd2", DiscTwo_Key, 0x52, 8); // "DDP_2"
447   addKey("cd3", DiscThree_Key, 0x53, 8); // "DDP_3"
448   addKey("DISCSKIP", NextDisc_Key, 0x56, 8);
449   addKey("Treble", Unmapped_Key, 0x57, 8);
450   addKey("MANUAL", Unmapped_Key, 0x58, 8);
451   addKey("phrase_repeat", RepeatAB_Key, 0x5A, 8);
452   addKey("DOLBY", NoiseReduction_Key, 0x6A, 8);
453   addKey("md", MDInput_Key, 0x70, 8);
454   addKey("Enter", Enter_Key, 0x73, 8);
455 }
456
457
458 AiwaAudio2a::AiwaAudio2a(
459   unsigned int index)
460   : AiwaAudio2(index)
461 {
462   setKeysetName("Audio Keyset 2a");
463 }
464
465
466 void AiwaAudio2a::populateProtocol(
467   QObject *guiObject)
468 {
469   if (threadableProtocol)
470   {
471     // If the pointer is not null, the keyset must already be populated.
472     return;
473   }
474
475   AiwaAudio2::populateProtocol(guiObject);
476
477   addKey("Rec", Record_Key, 0x5F, 8);
478   addKey("ChUp", ChannelUp_Key, 0x86, 8);
479   addKey("ChDown", ChannelDown_Key, 0x85, 8);
480 }
481
482
483 AiwaAudio2b::AiwaAudio2b(
484   unsigned int index)
485   : AiwaAudio2(index)
486 {
487   setKeysetName("Audio Keyset 2b");
488 }
489
490
491 void AiwaAudio2b::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   AiwaAudio2::populateProtocol(guiObject);
501
502   addKey("UP", Up_Key, 0x40, 8);
503   addKey("DOWN", Down_Key, 0x41, 8);
504   addKey("RIGHT", Right_Key, 0x42, 8);
505   addKey("LEFT", Left_Key, 0x43, 8);
506 }
507
508
509 AiwaAudio2c::AiwaAudio2c(
510   unsigned int index)
511   : AiwaAudio2(index)
512 {
513   setKeysetName("Audio Keyset 2c");
514
515   addControlledDevice(Aiwa_Make, "XR-MD201", Audio_Device);
516 }
517
518
519 void AiwaAudio2c::populateProtocol(
520   QObject *guiObject)
521 {
522   if (threadableProtocol)
523   {
524     // If the pointer is not null, the keyset must already be populated.
525     return;
526   }
527
528   AiwaAudio2::populateProtocol(guiObject);
529
530   addKey("display", Info_Key, 0x14, 8);
531   addKey("rec", Record_Key, 0x71, 8);
532   addKey("drec", Unmapped_Key, 0x72, 8);
533   addKey("md_mark", Unmapped_Key, 0x73, 8);
534   addKey("mode", Mode_Key, 0x76, 8);
535   addKey("tit_inp", Unmapped_Key, 0x77, 8);
536 }
537
538
539 // Might not be audio here:
540 AiwaAudio3::AiwaAudio3(
541   unsigned int index)
542   : PIRKeysetMetaData(
543       "Audio Keyset 3",
544       Aiwa_Make,
545       index)
546 {
547 }
548
549
550 void AiwaAudio3::populateProtocol(
551   QObject *guiObject)
552 {
553   if (threadableProtocol)
554   {
555     // If the pointer is not null, the keyset must already be populated.
556     return;
557   }
558
559   threadableProtocol = new AiwaProtocol(guiObject, index);
560
561   setPreData(0x007B, 13);
562
563   addKey("Power", Power_Key, 0x00, 8);
564   addKey("1", One_Key, 0x01, 8);
565   addKey("2", Two_Key, 0x02, 8);
566   addKey("3", Three_Key, 0x03, 8);
567   addKey("4", Four_Key, 0x04, 8);
568   addKey("5", Five_Key, 0x05, 8);
569   addKey("6", Six_Key, 0x06, 8);
570   addKey("7", Seven_Key, 0x07, 8);
571   addKey("8", Eight_Key, 0x08, 8);
572   addKey("9", Nine_Key, 0x09, 8);
573   addKey("0", Zero_Key, 0x0A, 8);
574
575   addKey("Yellow", Yellow_Key, 0x13, 8);
576   addKey("Right", Right_Key, 0x18, 8);
577   addKey("Left", Left_Key, 0x19, 8);
578   addKey("Ok", Select_Key, 0x1B, 8);
579
580   addKey("Up", Up_Key, 0x40, 8);
581   addKey("Down", Down_Key, 0x41, 8);
582   addKey("Volume-", VolumeDown_Key, 0x43, 8);
583   addKey("Mute", Mute_Key, 0x4A, 8);
584   addKey("Blue", Blue_Key, 0x4B, 8);
585   addKey("RED", Red_Key, 0x4E, 8);
586   addKey("Volume+", VolumeUp_Key, 0x4F, 8);
587
588   addKey("Back", Exit_Key, 0x90, 8);
589   addKey("Menu", Menu_Key, 0xC4, 8);
590   addKey("Green", Green_Key, 0xDC, 8);
591 }
592
593
594 AiwaAudio4::AiwaAudio4(
595   unsigned int index)
596   : PIRKeysetMetaData(
597       "Audio Keyset 4",
598       Aiwa_Make,
599       index)
600 {
601 }
602
603
604 void AiwaAudio4::populateProtocol(
605   QObject *guiObject)
606 {
607   if (threadableProtocol)
608   {
609     // If the pointer is not null, the keyset must already be populated.
610     return;
611   }
612
613   threadableProtocol = new AiwaProtocol(guiObject, index);
614
615   setPreData(0x00F6, 13);
616
617   addKey("1", One_Key, 0x01, 8);
618   addKey("2", Two_Key, 0x02, 8);
619   addKey("3", Three_Key, 0x03, 8);
620   addKey("4", Four_Key, 0x04, 8);
621   addKey("5", Five_Key, 0x05, 8);
622   addKey("6", Six_Key, 0x06, 8);
623   addKey("7", Seven_Key, 0x07, 8);
624   addKey("8", Eight_Key, 0x08, 8);
625   addKey("9", Nine_Key, 0x09, 8);
626   addKey("10", Zero_Key, 0x0A, 8); // best I can do for now
627   addKey("greater_20", DoubleDigit_Key, 0x0B, 8);
628   addKey("open_close", Eject_Key, 0x0C, 8);
629   addKey("program", Program_Key, 0x0D, 8);
630   addKey("delete", Unmapped_Key, 0x0E, 8);
631   addKey("check", Unmapped_Key, 0x0F, 8);
632
633   addKey("search_forw", FastForward_Key, 0x11, 8);
634   addKey("search_back", Rewind_Key, 0x12, 8);
635   addKey("random", Random_Key, 0x13, 8);
636   addKey("play", Play_Key, 0x15, 8);
637   addKey("pause", Pause_Key, 0x17, 8);
638   addKey("skip_forw", Advance_Key, 0x18, 8);
639   addKey("skip_back", Replay_Key, 0x19, 8);
640   addKey("stop", Stop_Key, 0x1A, 8);
641   addKey("repeat_1_all", Repeat_Key, 0x1B, 8);
642   addKey("repeat_a_b", RepeatAB_Key, 0x1C, 8);
643   addKey("index_forw", Next_Key, 0x1D, 8);
644   addKey("index_back", Previous_Key, 0x1E, 8);
645   addKey("time", Unmapped_Key, 0x1F, 8);
646
647   addKey("ac", Unmapped_Key, 0x2E, 8);
648
649   addKey("blank", Unmapped_Key, 0x40, 8);
650   addKey("11", Unmapped_Key, 0x41, 8);
651   addKey("12", Unmapped_Key, 0x42, 8);
652   addKey("13", Unmapped_Key, 0x43, 8);
653   addKey("14", Unmapped_Key, 0x44, 8);
654   addKey("15", Unmapped_Key, 0x45, 8);
655   addKey("16", Unmapped_Key, 0x46, 8);
656   addKey("17", Unmapped_Key, 0x47, 8);
657   addKey("18", Unmapped_Key, 0x48, 8);
658   addKey("19", Unmapped_Key, 0x49, 8);
659   addKey("20", Unmapped_Key, 0x4A, 8);
660 }
661
662
663 AiwaAudio5::AiwaAudio5(
664   unsigned int index)
665   : PIRKeysetMetaData(
666       "Audio Keyset 5",
667       Aiwa_Make,
668       index)
669 {
670 }
671
672
673 void AiwaAudio5::populateProtocol(
674   QObject *guiObject)
675 {
676   if (threadableProtocol)
677   {
678     // If the pointer is not null, the keyset must already be populated.
679     return;
680   }
681
682   threadableProtocol = new AiwaProtocol(guiObject, index);
683
684   setPreData(0x0076, 13);
685
686   addKey("1", One_Key, 0x01, 8);
687   addKey("2", Two_Key, 0x02, 8);
688   addKey("3", Three_Key, 0x03, 8);
689   addKey("4", Four_Key, 0x04, 8);
690   addKey("5", Five_Key, 0x05, 8);
691   addKey("6", Six_Key, 0x06, 8);
692   addKey("7", Seven_Key, 0x07, 8);
693   addKey("8", Eight_Key, 0x08, 8);
694   addKey("9", Nine_Key, 0x09, 8);
695   addKey("0", Zero_Key, 0x0A, 8);
696   addKey("+10", DoubleDigit_Key, 0x0B, 8);
697   addKey("open", Eject_Key, 0x0C, 8);
698   addKey("Prog", Program_Key, 0x0D, 8); // "on"
699   addKey("cont", Unmapped_Key, 0x0F, 8);
700   addKey("random", Random_Key, 0x13, 8);
701   addKey("Play", Play_Key, 0x15, 8);
702   addKey("Forward", FastForward_Key, 0x18, 8);
703   addKey("Rewind", Rewind_Key, 0x19, 8);
704   addKey("Stop", Stop_Key, 0x1A, 8);
705   addKey("Rep/Rand", Repeat_Key, 0x1B, 8);
706   addKey("display", Info_Key, 0x1F, 8);
707 }
708
709
710 AiwaAudio6::AiwaAudio6(
711   unsigned int index)
712   : PIRKeysetMetaData(
713       "Audio Keyset 6",
714       Aiwa_Make,
715       index)
716 {
717   addControlledDevice(Aiwa_Make, "CX-770", Audio_Device);
718   addControlledDevice(Aiwa_Make, "Series 70", Audio_Device);
719 }
720
721
722 void AiwaAudio6::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   threadableProtocol = new AiwaProtocol(guiObject, index);
732
733   setPreData(0x0048, 13);
734
735   addKey("fm", FM_Key, 0x00, 8);
736   addKey("am", AM_Key, 0x01, 8); // "MW"
737   addKey("LW", LW_Key, 0x02, 8);
738   addKey("t_up", ChannelUp_Key, 0x03, 8);
739   addKey("power", Power_Key, 0x04, 8);
740   addKey("t_down", ChannelDown_Key, 0x05, 8);
741   addKey("v_up", VolumeUp_Key, 0x07, 8);
742   addKey("v_down", VolumeDown_Key, 0x08, 8);
743   addKey("muting", Mute_Key, 0x09, 8);
744   addKey("cdp_program", Program_Key, 0x0A, 8);
745   addKey("cdp_play", Play_Key, 0x0B, 8);
746   addKey("cdp_memory", Memory_Key, 0x0C, 8);
747   addKey("cdp_stop", Stop_Key, 0x0D, 8);
748   addKey("cdp_fskip", FastForward_Key, 0x0E, 8);
749   addKey("cdp_bskip", Rewind_Key, 0x0F, 8);
750   addKey("VcrAux", AuxInput_Key, 0x10, 8);
751   addKey("phono", PhonoInput_Key, 0x11, 8);
752   addKey("tape", TapeInput_Key, 0x12, 8);
753 }
754
755
756 AiwaCarStereo1::AiwaCarStereo1(
757   unsigned int index)
758   : PIRKeysetMetaData(
759       "Car Stereo Keyset 1",
760       Aiwa_Make,
761       index)
762 {
763 }
764
765
766 void AiwaCarStereo1::populateProtocol(
767   QObject *guiObject)
768 {
769   if (threadableProtocol)
770   {
771     // If the pointer is not null, the keyset must already be populated.
772     return;
773   }
774
775   threadableProtocol = new NECProtocol(guiObject, index, true, true);
776
777   setPreData(0x1386, 16);
778
779   addKey("off", Power_Key, 0x00, 8);
780   addKey("vol+", VolumeUp_Key, 0x0F, 8);
781   addKey("vol-", VolumeDown_Key, 0x10, 8);
782   addKey("disc_tune+", ChannelUp_Key, 0x11, 8);
783   addKey("disc_tune-", ChannelDown_Key, 0x12, 8);
784   addKey("radio_band", TunerInput_Key, 0x13, 8);
785   addKey("tape", TapeInput_Key, 0x14, 8);
786   addKey("ff_next", FastForward_Key, 0x16, 8);
787   addKey("rew_prev", Rewind_Key, 0x17, 8);
788   addKey("playpause", Play_Key, 0x1B, 8);
789   addKey("playpause", Pause_Key, 0x1B, 8);
790   addKey("preset_scan", Scan_Key, 0x1F, 8);
791 }
792
793
794 AiwaDVD1::AiwaDVD1(
795   unsigned int index)
796   : PIRKeysetMetaData(
797       "DVD Keyset 1",
798       Aiwa_Make,
799       index)
800 {
801 }
802
803
804 void AiwaDVD1::populateProtocol(
805   QObject *guiObject)
806 {
807   if (threadableProtocol)
808   {
809     // If the pointer is not null, the keyset must already be populated.
810     return;
811   }
812
813   LIRCProtocol *lp = new LIRCProtocol(
814     guiObject,
815     index,
816     500, 622,
817     1629, 622,
818     99349, false);
819
820   threadableProtocol = lp;
821
822   lp->setHeaderPair(1623, 615);
823   lp->setRepeatPair(8967, 4467);
824
825   addKey("KEY_POWER", Power_Key, 0x201, 10);
826   addKey("KEY_SUBTITLE", Captions_Key, 0x32C, 10);
827   addKey("KEY_RED", Red_Key, 0x2F1, 10);
828   addKey("KEY_GREEN", Green_Key, 0x390, 10);
829   addKey("KEY_YELLOW", Yellow_Key, 0x370, 10);
830   addKey("KEY_BLUE", Blue_Key, 0x3AC, 10);
831   addKey("KEY_EPG", Guide_Key, 0x360, 10);
832   addKey("KEY_INFO", Info_Key, 0x211, 10);
833   addKey("KEY_OK", Select_Key, 0x28D, 10);
834   addKey("KEY_BACK", Exit_Key, 0x348, 10);
835   addKey("KEY_MENU", Menu_Key, 0x30C, 10);
836   addKey("KEY_UP", Up_Key, 0x24D, 10);
837   addKey("KEY_DOWN", Down_Key, 0x34C, 10);
838   addKey("KEY_LEFT", Left_Key, 0x3CC, 10);
839   addKey("KEY_RIGHT", Right_Key, 0x2CD, 10);
840   addKey("KEY_REWIND", Rewind_Key, 0x2D9, 10);
841   addKey("KEY_PLAYPAUSE", Play_Key, 0x350, 10);
842   addKey("KEY_PLAYPAUSE", Pause_Key, 0x350, 10);
843   addKey("KEY_FORWARD", FastForward_Key, 0x358, 10);
844   addKey("KEY_STOP", Stop_Key, 0x2B1, 10);
845   addKey("KEY_RECORD", Record_Key, 0x3EC, 10);
846   addKey("KEY_CHANNELUP", ChannelUp_Key, 0x231, 10);
847   addKey("KEY_CHANNELDOWN", ChannelDown_Key, 0x330, 10);
848   addKey("KEY_1", One_Key, 0x300, 10);
849   addKey("KEY_2", Two_Key, 0x281, 10);
850   addKey("KEY_3", Three_Key, 0x380, 10);
851   addKey("KEY_4", Four_Key, 0x241, 10);
852   addKey("KEY_5", Five_Key, 0x340, 10);
853   addKey("KEY_6", Six_Key, 0x2C1, 10);
854   addKey("KEY_7", Seven_Key, 0x3C0, 10);
855   addKey("KEY_8", Eight_Key, 0x221, 10);
856   addKey("KEY_9", Nine_Key, 0x320, 10);
857   addKey("KEY_0", Zero_Key, 0x2A1, 10);
858   addKey("KEY_MEDIA", Unmapped_Key, 0x348, 10);
859 }