Advanced Settings Panel
[pierogi] / keysets / denon.cpp
1 #include "denon.h"
2 #include "protocols/sharpprotocol.h"
3 #include "protocols/lircprotocol.h"
4 #include "protocols/necprotocol.h"
5
6 // This whole set of Denon keysets is a mess.  Need to clean it up!!!
7
8 DenonDVD1::DenonDVD1(
9   unsigned int index)
10   : PIRKeysetMetaData(
11       "DVD Keyset 1",
12       Denon_Make,
13       index)
14 {
15   addControlledDevice(Denon_Make, "DVD-1930", DVD_Device);
16 }
17
18
19 void DenonDVD1::populateProtocol(
20   QObject *guiObject)
21 {
22   if (threadableProtocol)
23   {
24     // If the pointer is not null, the keyset must already be populated.
25     return;
26   }
27
28   threadableProtocol = new SharpProtocol(guiObject, index, false);
29
30   addSharpKey("SEARCH_MODE", Unmapped_Key, 0x04, 0x9E);
31   addSharpKey("ZOOM", Zoom_Key, 0x04, 0x9F);
32
33   addSharpKey("POWER_OFF", PowerOff_Key, 0x06, 0xC0);
34   addSharpKey("PAGE-", PageDown_Key, 0x06, 0xFD);
35   addSharpKey("PAGE+", PageUp_Key, 0x06, 0xFE);
36   addSharpKey("GROUP", Unmapped_Key, 0x06, 0xFF);
37
38   addSharpKey("SACD_SETUP", Unmapped_Key, 0x08, 0x7E);
39   addSharpKey("0", Zero_Key, 0x08, 0x81);
40   addSharpKey("1", One_Key, 0x08, 0x82);
41   addSharpKey("2", Two_Key, 0x08, 0x83);
42   addSharpKey("3", Three_Key, 0x08, 0x84);
43   addSharpKey("4", Four_Key, 0x08, 0x85);
44   addSharpKey("5", Five_Key, 0x08, 0x86);
45   addSharpKey("6", Six_Key, 0x08, 0x87);
46   addSharpKey("7", Seven_Key, 0x08, 0x88);
47   addSharpKey("8", Eight_Key, 0x08, 0x89);
48   addSharpKey("9", Nine_Key, 0x08, 0x8A);
49   addSharpKey("10+", DoubleDigit_Key, 0x08, 0x8C);
50   addSharpKey("SUBTITLE", Captions_Key, 0x08, 0x8D);
51   addSharpKey("AUDIO", Audio_Key, 0x08, 0x8E);
52   addSharpKey("ANGLE", Angle_Key, 0x08, 0x8F);
53   addSharpKey("OPEN_CLOSE", Eject_Key, 0x08, 0x90);
54   addSharpKey("MENU", DiscMenu_Key, 0x08, 0x91);
55   addSharpKey("RETURN", Exit_Key, 0x08, 0x92);
56   addSharpKey("REPEAT", Repeat_Key, 0x08, 0x94);
57   addSharpKey("SKIP_UP", Previous_Key, 0x08, 0x98);
58   addSharpKey("SKIP_DOWN", Next_Key, 0x08, 0x99);
59   addSharpKey("FAST_FORWARD", FastForward_Key, 0x08, 0x9A);
60   addSharpKey("FAST_REVERSE", Rewind_Key, 0x08, 0x9B);
61   addSharpKey("MODE", Mode_Key, 0x08, 0x9C);
62   addSharpKey("PAUSE", Pause_Key, 0x08, 0x9D);
63   addSharpKey("PLAY", Play_Key, 0x08, 0xA0);
64   addSharpKey("STOP", Stop_Key, 0x08, 0xA1);
65   addSharpKey("CLEAR", Clear_Key, 0x08, 0xA3);
66   addSharpKey("DISPLAY", Info_Key, 0x08, 0xA7);
67   addSharpKey("RANDOM", Random_Key, 0x08, 0xAA);
68   addSharpKey("UP", Up_Key, 0x08, 0xAC);
69   addSharpKey("DOWN", Down_Key, 0x08, 0xAD);
70   addSharpKey("RIGHT", Right_Key, 0x08, 0xAE);
71   addSharpKey("LEFT", Left_Key, 0x08, 0xAF);
72   addSharpKey("POWER_ON", PowerOn_Key, 0x08, 0xB2);
73   addSharpKey("A_B_REPEAT", RepeatAB_Key, 0x08, 0xBA);
74   addSharpKey("ENTER", Select_Key, 0x08, 0xBB);
75   addSharpKey("SETUP", Menu_Key, 0x08, 0xBC);
76   addSharpKey("TOP_MENU", DiscTitle_Key, 0x08, 0xBD);
77 }
78
79
80 DenonDVD2::DenonDVD2(
81   unsigned int index)
82   : PIRKeysetMetaData(
83       "DVD Keyset 2",
84       Denon_Make,
85       index)
86 {
87   addControlledDevice(Denon_Make, "DVD-2500", DVD_Device);
88 }
89
90
91 void DenonDVD2::populateProtocol(
92   QObject *guiObject)
93 {
94   if (threadableProtocol)
95   {
96     // If the pointer is not null, the keyset must already be populated.
97     return;
98   }
99
100   LIRCProtocol *lp = new LIRCProtocol(
101     guiObject,
102     index,
103     400, 500,
104     400, 1400,
105     43000, false);
106
107   threadableProtocol = lp;
108
109   lp->setHeaderPair(3500, 1800);
110   lp->setTrailerPulse(400);
111
112   setPreData(0x40040D00, 32);
113
114   addKey("Power", Power_Key, 0xBCB1, 16);
115   addKey("Open/Close", Eject_Key, 0x808D, 16);
116   addKey("Stop", Stop_Key, 0x000D, 16);
117   addKey("Pause", Pause_Key, 0x606D, 16);
118   addKey("Play", Play_Key, 0x505D, 16);
119   addKey("SkipBack", Previous_Key, 0x929F, 16);
120   addKey("SkipFwd", Next_Key, 0x525F, 16);
121   addKey("Rev", Rewind_Key, 0x202D, 16);
122   addKey("Fwd", FastForward_Key, 0xA0AD, 16);
123   addKey("Title", DiscTitle_Key, 0xD9D4, 16);
124   addKey("Menu", DiscMenu_Key, 0x010C, 16);
125   addKey("Display", Info_Key, 0x4944, 16);
126   addKey("Return", Exit_Key, 0x818C, 16);
127   addKey("Up", Up_Key, 0xA1AC, 16);
128   addKey("Down", Down_Key, 0x616C, 16);
129   addKey("Right", Right_Key, 0x111C, 16);
130   addKey("Left", Left_Key, 0xE1EC, 16);
131   addKey("Select", Select_Key, 0x414C, 16);
132   addKey("Subtitle", Captions_Key, 0x8984, 16);
133   addKey("Audio", Audio_Key, 0xCCC1, 16);
134   addKey("Angle", Angle_Key, 0x0904, 16);
135   addKey("Marker", Unmapped_Key, 0x717C, 16);
136   addKey("PlayMode", Unmapped_Key, 0xB1BC, 16);
137   addKey("RepeatMode", Repeat_Key, 0x313C, 16);
138   addKey("A-B_Repeat", RepeatAB_Key, 0x121F, 16);
139   addKey("Setup", Menu_Key, 0x2924, 16);
140   addKey("Clear", Clear_Key, 0xC1CC, 16);
141   addKey("VSS", Unmapped_Key, 0x7974, 16);
142   addKey("1", One_Key, 0x0805, 16);
143   addKey("2", Two_Key, 0x8885, 16);
144   addKey("3", Three_Key, 0x4845, 16);
145   addKey("4", Four_Key, 0xC8C5, 16);
146   addKey("5", Five_Key, 0x2825, 16);
147   addKey("6", Six_Key, 0xA8A5, 16);
148   addKey("7", Seven_Key, 0x6865, 16);
149   addKey("8", Eight_Key, 0xE8E5, 16);
150   addKey("9", Nine_Key, 0x1815, 16);
151   addKey("0", Zero_Key, 0x9895, 16);
152   addKey(">=10", DoubleDigit_Key, 0x919C, 16);
153 }
154
155
156 DenonDVD3::DenonDVD3(
157   unsigned int index)
158   : PIRKeysetMetaData(
159       "DVD Keyset 3",
160       Denon_Make,
161       index)
162 {
163   addControlledDevice(Denon_Make, "DVD-1000", DVD_Device);
164 }
165
166
167 void DenonDVD3::populateProtocol(
168   QObject *guiObject)
169 {
170   if (threadableProtocol)
171   {
172     // If the pointer is not null, the keyset must already be populated.
173     return;
174   }
175
176   threadableProtocol = new SharpProtocol(guiObject, index, false);
177
178   addSharpKey("0", Zero_Key, 0x01, 0x81);
179   addSharpKey("1", One_Key, 0x01, 0x82);
180   addSharpKey("2", Two_Key, 0x01, 0x83);
181   addSharpKey("3", Three_Key, 0x01, 0x84);
182   addSharpKey("4", Four_Key, 0x01, 0x85);
183   addSharpKey("5", Five_Key, 0x01, 0x86);
184   addSharpKey("6", Six_Key, 0x01, 0x87);
185   addSharpKey("7", Seven_Key, 0x01, 0x88);
186   addSharpKey("8", Eight_Key, 0x01, 0x89);
187   addSharpKey("9", Nine_Key, 0x01, 0x8A);
188   addSharpKey("10", Unmapped_Key, 0x01, 0x8C);
189   addSharpKey("subtitle", Captions_Key, 0x01, 0x8D);
190   addSharpKey("audio", Audio_Key, 0x01, 0x8E);
191   addSharpKey("angle", Angle_Key, 0x01, 0x8F);
192   addSharpKey("open-close", Eject_Key, 0x01, 0x90);
193   addSharpKey("menu", DiscMenu_Key, 0x01, 0x91);
194   addSharpKey("return", Exit_Key, 0x01, 0x92);
195   addSharpKey("repeat", Repeat_Key, 0x01, 0x97);
196   addSharpKey("skip+", Next_Key, 0x01, 0x98);
197   addSharpKey("skip-", Previous_Key, 0x01, 0x99);
198   addSharpKey("slow+", SlowPlus_Key, 0x01, 0x9A);
199   addSharpKey("slow-", SlowMinus_Key, 0x01, 0x9B);
200   addSharpKey("pause", Pause_Key, 0x01, 0x9D);
201   addSharpKey("play", Play_Key, 0x01, 0xA0);
202   addSharpKey("stop", Stop_Key, 0x01, 0xA1);
203   addSharpKey("program", Program_Key, 0x01, 0xA2);
204   addSharpKey("clear", Clear_Key, 0x01, 0xA3);
205   addSharpKey("display", Info_Key, 0x01, 0xA4);
206   addSharpKey("random", Random_Key, 0x01, 0xAA);
207   addSharpKey("arrow-up", Up_Key, 0x01, 0xAC);
208   addSharpKey("arrow-down", Down_Key, 0x01, 0xAD);
209   addSharpKey("arrow-right", Right_Key, 0x01, 0xAE);
210   addSharpKey("arrow-left", Left_Key, 0x01, 0xAF);
211   addSharpKey("ntsc-pal", Unmapped_Key, 0x01, 0xB7);
212   addSharpKey("power", Power_Key, 0x01, 0xB1);
213   addSharpKey("repeat-ab", RepeatAB_Key, 0x01, 0xBA);
214   addSharpKey("select", Select_Key, 0x01, 0xBB);
215   addSharpKey("setup", Menu_Key, 0x01, 0xBC);
216   addSharpKey("title", DiscTitle_Key, 0x01, 0xBD);
217   addSharpKey("call", Call_Key, 0x01, 0xBE);
218 }
219
220
221 DenonReceiver1::DenonReceiver1(
222   unsigned int index)
223   : PIRKeysetMetaData(
224       "Receiver Keyset 1",
225       Denon_Make,
226       index)
227 {
228   addControlledDevice(Denon_Make, "AVR-1708", Audio_Device);
229 }
230
231
232 void DenonReceiver1::populateProtocol(
233   QObject *guiObject)
234 {
235   if (threadableProtocol)
236   {
237     // If the pointer is not null, the keyset must already be populated.
238     return;
239   }
240
241   threadableProtocol = new SharpProtocol(guiObject, index, false);
242
243   addSharpKey("Phono", PhonoInput_Key, 0x02, 0xC3);
244   addSharpKey("CD", CDInput_Key, 0x02, 0xC4);
245   addSharpKey("Tuner", TunerInput_Key, 0x02, 0xC5); // "SRC_TUNNER"
246   addSharpKey("SRC_SATCBL", SatInput_Key, 0x02, 0xC8);
247   addSharpKey("TV_CBL", CableInput_Key, 0x02, 0xC9);
248   addSharpKey("SRC_HDP", DVDInput_Key, 0x02, 0xCA); // "DVD_TV"
249   addSharpKey("SRC_VAUX", AuxInput_Key, 0x02, 0xCC);
250   addSharpKey("VCR", VCRInput_Key, 0x02, 0xCD);
251   addSharpKey("SRC_DVR", DVRInput_Key, 0x02, 0xCE);
252   addSharpKey("DAT_Tape", TapeInput_Key, 0x02, 0xD2);
253   addSharpKey("Setup", Menu_Key, 0x02, 0xD8); // "VIDEO_SELECT"
254   addSharpKey("multi", Unmapped_Key, 0x02, 0xDB);
255   addSharpKey("analog", Unmapped_Key, 0x02, 0xDC);
256   addSharpKey("Right", Right_Key, 0x02, 0xDD);
257   addSharpKey("Return", Exit_Key, 0x02, 0xDE);
258   addSharpKey("Display", Info_Key, 0x02, 0xDF); // "onscreen"
259   addSharpKey("Enter", Select_Key, 0x02, 0xE0);
260   addSharpKey("On", PowerOn_Key, 0x02, 0xE1);
261   addSharpKey("Off", PowerOff_Key, 0x02, 0xE2);
262   addSharpKey("DVD_HDP", Unmapped_Key, 0x02, 0xE3); // "SRC_DVD"
263   addSharpKey("BTN_STD", Unmapped_Key, 0x02, 0xE4);
264   addSharpKey("Mode", Mode_Key, 0x02, 0xE6); // "BTN_SIMU"
265   addSharpKey("Stereo", Audio_Key, 0x02, 0xE7);
266   addSharpKey("Delay", Unmapped_Key, 0x02, 0xE9);
267   addSharpKey("Test_Tone", Unmapped_Key, 0x02, 0xEA);
268   addSharpKey("Mute", Mute_Key, 0x02, 0xF0);
269   addSharpKey("Volume_up", VolumeUp_Key, 0x02, 0xF1);
270   addSharpKey("Volume_down", VolumeDown_Key, 0x02, 0xF2);
271   addSharpKey("RearVolumeUp", RearVolumeUp_Key, 0x02, 0xF3);
272   addSharpKey("RearVolumeDown", RearVolumeDown_Key, 0x02, 0xF4);
273   addSharpKey("CenterVolumeUp", CenterVolumeUp_Key, 0x02, 0xF5);
274   addSharpKey("CenterVolumeDown", CenterVolumeDown_Key, 0x02, 0xF6);
275
276   addSharpKey("Pause", Pause_Key, 0x04, 0x53);
277   addSharpKey("Skip_Favorite", Favorites_Key, 0x04, 0x57);
278   addSharpKey("Forward", FastForward_Key, 0x04, 0x5A);
279   addSharpKey("Rewind", Rewind_Key, 0x04, 0x5B);
280   addSharpKey("Play", Play_Key, 0x04, 0x5C);
281   addSharpKey("Stop", Stop_Key, 0x04, 0x5E);
282   addSharpKey("TAPE_REC", Unmapped_Key, 0x04, 0x5F);
283   addSharpKey("BTN_STD_CINEMA", Unmapped_Key, 0x04, 0x95);
284   addSharpKey("BTN_STD_MUSIC", Unmapped_Key, 0x04, 0x96);
285   addSharpKey("Night_Audio", Unmapped_Key, 0x04, 0x98);
286   addSharpKey("BTN_MULTEQ", Unmapped_Key, 0x04, 0x9D);
287
288   addSharpKey("Left", Left_Key, 0x0C, 0x7F); // This looks wrong
289   addSharpKey("RCVR_SURROUND", Surround_Key, 0x0C, 0xA1);
290   addSharpKey("Up", Up_Key, 0x0C, 0xA3);
291   addSharpKey("Down", Down_Key, 0x0C, 0xA4);
292   addSharpKey("output", Unmapped_Key, 0x0C, 0xA5);
293   addSharpKey("BTN_HDMI_CONTROL", Unmapped_Key, 0x0C, 0xAF);
294   addSharpKey("ext.in", Unmapped_Key, 0x0C, 0xB5);
295   addSharpKey("input-mode", Unmapped_Key, 0x0C, 0xB6);
296   addSharpKey("Shift", Unmapped_Key, 0x0C, 0xCD);
297   addSharpKey("channel-", ChannelDown_Key, 0x0C, 0xD5);
298   addSharpKey("channel+", ChannelUp_Key, 0x0C, 0xD6);
299   addSharpKey("Dimmer", Unmapped_Key, 0x0C, 0xDF);
300 }
301
302
303 DenonReceiver1a::DenonReceiver1a(
304   unsigned int index)
305   : DenonReceiver1(index)
306 {
307   setKeysetName("Receiver Keyset 1a");
308
309   addControlledDevice(Denon_Make, "AVR-1610", Audio_Device);
310 }
311
312
313 void DenonReceiver1a::populateProtocol(
314   QObject *guiObject)
315 {
316   if (threadableProtocol)
317   {
318     // If the pointer is not null, the keyset must already be populated.
319     return;
320   }
321
322   DenonReceiver1::populateProtocol(guiObject);
323
324   addSharpKey("BTN_SKIP", Unmapped_Key, 0x0C, 0xCC);
325   addSharpKey("BTN_PAUSE", Pause_Key, 0x0C, 0xCD);
326   addSharpKey("BTN_STOP", Stop_Key, 0x0C, 0xD7);
327   addSharpKey("BTN_PLAY", Play_Key, 0x0C, 0xD8);
328   addSharpKey("FAST_FORWARD", FastForward_Key, 0x0C, 0xD9);
329   addSharpKey("FAST_REVERSE", Rewind_Key, 0x0C, 0xDA);
330   addSharpKey("BTN_PREV", Previous_Key, 0x0C, 0xD5);
331   addSharpKey("BTN_NEXT", Next_Key, 0x0C, 0xD6);
332   addSharpKey("PAGE_UP", PageUp_Key, 0x0C, 0xDE);
333   addSharpKey("PAGE_DN", PageDown_Key, 0x0C, 0xDF);
334 }
335
336
337 DenonReceiver1b::DenonReceiver1b(
338   unsigned int index)
339   : DenonReceiver1(index)
340 {
341   setKeysetName("Receiver Keyset 1b");
342
343   addControlledDevice(Denon_Make, "AVR-3300", Audio_Device);
344 }
345
346
347 void DenonReceiver1b::populateProtocol(
348   QObject *guiObject)
349 {
350   if (threadableProtocol)
351   {
352     // If the pointer is not null, the keyset must already be populated.
353     return;
354   }
355
356   DenonReceiver1::populateProtocol(guiObject);
357
358   addSharpKey("setup", Menu_Key, 0x0C, 0x50);
359   addSharpKey("params", Unmapped_Key, 0x0C, 0x51);
360 }
361
362
363 DenonReceiver1c::DenonReceiver1c(
364   unsigned int index)
365   : DenonReceiver1(index)
366 {
367   setKeysetName("Receiver Keyset 1c");
368
369   addControlledDevice(Denon_Make, "AVR-1602", Audio_Device);
370   addControlledDevice(Denon_Make, "AVR-1802", Audio_Device);
371   addControlledDevice(Denon_Make, "AVR-1803", Audio_Device);
372 }
373
374
375 void DenonReceiver1c::populateProtocol(
376   QObject *guiObject)
377 {
378   if (threadableProtocol)
379   {
380     // If the pointer is not null, the keyset must already be populated.
381     return;
382   }
383
384   DenonReceiver1::populateProtocol(guiObject);
385
386   addSharpKey("ONE", One_Key, 0x02, 0xC3);
387   addSharpKey("TWO", Two_Key, 0x02, 0xC4);
388   addSharpKey("THREE", Three_Key, 0x02, 0xE3);
389   addSharpKey("FOUR", Four_Key, 0x02, 0xCC);
390   addSharpKey("FIVE", Five_Key, 0x02, 0xCD);
391   addSharpKey("SIX", Six_Key, 0x02, 0xCE);
392   addSharpKey("SEVEN", Seven_Key, 0x02, 0xC9);
393   addSharpKey("EIGHT", Eight_Key, 0x0C, 0xB6); // must be wrong
394   addSharpKey("NINE", Nine_Key, 0x02, 0xD2);
395   addSharpKey("ZERO", Zero_Key, 0x02, 0xCA);
396   addSharpKey("RCVR_SURROUND_MODE", Surround_Key, 0x02, 0xE6);
397   addSharpKey("RCVR_STATUS", Info_Key, 0x02, 0xDE); // "Panel"
398   addSharpKey("RCVR_T_TONE", Unmapped_Key, 0x02, 0xEA);
399
400   addSharpKey("REPEAT", Repeat_Key, 0x08, 0x54);
401   addSharpKey("CD_NEXT", Next_Key, 0x08, 0x58);
402   addSharpKey("CD_PREV", Previous_Key, 0x08, 0x59);
403   addSharpKey("CD_FFW", FastForward_Key, 0x08, 0x5A);
404   addSharpKey("CD_REW", Rewind_Key, 0x08, 0x5B);
405   addSharpKey("CD_PLAY", Play_Key, 0x08, 0x5C);
406   addSharpKey("CD_PAUSE", Pause_Key, 0x08, 0x5D);
407   addSharpKey("CD_STOP", Stop_Key, 0x08, 0x5E);
408   addSharpKey("DISC1", Unmapped_Key, 0x08, 0x64);
409   addSharpKey("DISC2", Unmapped_Key, 0x08, 0x65);
410   addSharpKey("DISC3", Unmapped_Key, 0x08, 0x66);
411   addSharpKey("DISC4", Unmapped_Key, 0x08, 0x67);
412   addSharpKey("DISC5", Unmapped_Key, 0x08, 0x68);
413   addSharpKey("DISC6", Unmapped_Key, 0x08, 0x69);
414   addSharpKey("random", Random_Key, 0x08, 0x6A);
415   addSharpKey("CD_DISC_SKIP", NextDisc_Key, 0x08, 0x6B);
416   addSharpKey("CD", CDInput_Key, 0x08, 0x73);
417
418   addSharpKey("SYSTEM", Menu_Key, 0x0C, 0xA0);
419 }
420
421
422 DenonReceiver1d::DenonReceiver1d(
423   unsigned int index)
424   : DenonReceiver1c(index)
425 {
426   setKeysetName("Receiver Keyset 1d");
427
428   addControlledDevice(Denon_Make, "PMA-480R", Audio_Device);
429 }
430
431
432 void DenonReceiver1d::populateProtocol(
433   QObject *guiObject)
434 {
435   if (threadableProtocol)
436   {
437     // If the pointer is not null, the keyset must already be populated.
438     return;
439   }
440
441   DenonReceiver1c::populateProtocol(guiObject);
442
443   addSharpKey("AMP_PHONO", PhonoInput_Key, 0x02, 0x81);
444   addSharpKey("AMP_TUNER", TunerInput_Key, 0x02, 0x83);
445   addSharpKey("AMP_AUX", AuxInput_Key, 0x02, 0x84);
446   addSharpKey("AMP_MUTING", Mute_Key, 0x02, 0x8B);
447   addSharpKey("AMP_VOL_DOWN", VolumeDown_Key, 0x02, 0x8C);
448   addSharpKey("AMP_VOL_UP", VolumeUp_Key, 0x02, 0x8D);
449   addSharpKey("AMP_POWER", Power_Key, 0x02, 0x90);
450   addSharpKey("AMP_CD", CDInput_Key, 0x02, 0x92);
451   addSharpKey("AMP_TAPE-1", TapeInput_Key, 0x02, 0x99);
452   addSharpKey("AMP_TAPE-2", Unmapped_Key, 0x02, 0x9A);
453
454   addSharpKey("TAPE_A/B", Unmapped_Key, 0x04, 0x53);
455   addSharpKey("TAPE_PLAY_REV", Unmapped_Key, 0x04, 0x57);
456   addSharpKey("TAPE_PAUSE", Unmapped_Key, 0x04, 0x5D);
457   addSharpKey("DECK", Unmapped_Key, 0x04, 0x75);
458
459   addSharpKey("panel", Info_Key, 0x0C, 0x7E);
460   addSharpKey("TUNER", Unmapped_Key, 0x0C, 0xDD);
461 }
462
463
464 DenonReceiver1e::DenonReceiver1e(
465   unsigned int index)
466   : DenonReceiver1d(index)
467 {
468   setKeysetName("Receiver Keyset 1e");
469
470   addControlledDevice(Denon_Make, "DRA-385RD", Audio_Device);
471 }
472
473
474 void DenonReceiver1e::populateProtocol(
475   QObject *guiObject)
476 {
477   if (threadableProtocol)
478   {
479     // If the pointer is not null, the keyset must already be populated.
480     return;
481   }
482
483   DenonReceiver1d::populateProtocol(guiObject);
484
485   addSharpKey("voldwn", VolumeDown_Key, 0x0C, 0x4C);
486   addSharpKey("volup", VolumeUp_Key, 0x0C, 0x4D);
487   addSharpKey("preset+", NextPreset_Key, 0x0C, 0x4E);
488   addSharpKey("preset-", PrevPreset_Key, 0x0C, 0x4F);
489   addSharpKey("video", CableInput_Key, 0x0C, 0x53);
490   addSharpKey("phono", PhonoInput_Key, 0x0C, 0x58);
491   addSharpKey("tuner", TunerInput_Key, 0x0C, 0x59);
492   addSharpKey("cd", CDInput_Key, 0x0C, 0x5A);
493   addSharpKey("tape_mon", Unmapped_Key, 0x0C, 0x5C);
494   addSharpKey("tape1", Unmapped_Key, 0x0C, 0x5D);
495   addSharpKey("tape2", Unmapped_Key, 0x0C, 0x5E);
496 }
497
498
499 DenonReceiver1f::DenonReceiver1f(
500   unsigned int index)
501   : DenonReceiver1c(index)
502 {
503   setKeysetName("Receiver Keyset 1f");
504
505   addControlledDevice(Denon_Make, "AVR-700RD", Audio_Device);
506   addControlledDevice(Denon_Make, "RC-841", Audio_Device);
507 }
508
509
510 void DenonReceiver1f::populateProtocol(
511   QObject *guiObject)
512 {
513   if (threadableProtocol)
514   {
515     // If the pointer is not null, the keyset must already be populated.
516     return;
517   }
518
519   DenonReceiver1c::populateProtocol(guiObject);
520
521   addSharpKey("Power", Power_Key, 0x02, 0xC1);
522
523   addSharpKey("Deck_A_B", Unmapped_Key, 0x04, 0x53);
524   addSharpKey("Deck_PlayLeft", Unmapped_Key, 0x04, 0x57);
525
526   addSharpKey("Preset_Down", NextPreset_Key, 0x0C, 0xB5);
527   addSharpKey("Preset_Up", PrevPreset_Key, 0x0C, 0xB6);
528 }
529
530
531 DenonReceiver2::DenonReceiver2(
532   unsigned int index)
533   : PIRKeysetMetaData(
534       "Receiver Keyset 2",
535       Denon_Make,
536       index)
537 {
538 }
539
540
541 void DenonReceiver2::populateProtocol(
542   QObject *guiObject)
543 {
544   if (threadableProtocol)
545   {
546     // If the pointer is not null, the keyset must already be populated.
547     return;
548   }
549
550   threadableProtocol = new SharpProtocol(guiObject, index, false);
551
552   addSharpKey("tun_1", One_Key, 0x13, 0x42);
553   addSharpKey("tun_2", Two_Key, 0x13, 0x43);
554   addSharpKey("tun_3", Three_Key, 0x13, 0x44);
555   addSharpKey("tun_4", Four_Key, 0x13, 0x45);
556   addSharpKey("tun_5", Five_Key, 0x13, 0x46);
557   addSharpKey("tun_6", Six_Key, 0x13, 0x47);
558   addSharpKey("tun_7", Seven_Key, 0x13, 0x48);
559   addSharpKey("tun_8", Eight_Key, 0x13, 0x49);
560   addSharpKey("tun_shift", Unmapped_Key, 0x13, 0x4A);
561   addSharpKey("amp_vol-down", VolumeDown_Key, 0x13, 0x4C);
562   addSharpKey("amp_vol-up", VolumeUp_Key, 0x13, 0x4D);
563   addSharpKey("amp_power", Power_Key, 0x13, 0x50);
564   addSharpKey("amp_phono", PhonoInput_Key, 0x13, 0x58);
565   addSharpKey("amp_tuner", TunerInput_Key, 0x13, 0x59);
566   addSharpKey("amp_aux/video", AuxInput_Key, 0x13, 0x5B);
567   addSharpKey("amp_cd", CDInput_Key, 0x13, 0x5A);
568   addSharpKey("amp_tape", TapeInput_Key, 0x13, 0x5D);
569   addSharpKey("TUN_CH_DOWN", ChannelDown_Key, 0x13, 0xD5);
570   addSharpKey("TUN_CH_UP", ChannelUp_Key, 0x13, 0xD6);
571
572   addSharpKey("CD_REPEAT", Repeat_Key, 0x17, 0x54);
573   addSharpKey("cd_next", Next_Key, 0x17, 0x58);
574   addSharpKey("cd_prev", Previous_Key, 0x17, 0x59);
575   addSharpKey("cd_ff", FastForward_Key, 0x17, 0x5A);
576   addSharpKey("cd_rew", Rewind_Key, 0x17, 0x5B);
577   addSharpKey("cd_play", Play_Key, 0x17, 0x5C);
578   addSharpKey("cd_pause", Pause_Key, 0x17, 0x5D);
579   addSharpKey("cd_stop", Stop_Key, 0x17, 0x5E);
580   addSharpKey("CD_RANDOM", Random_Key, 0x17, 0x6A);
581   addSharpKey("CD_SKIP", NextDisc_Key, 0x17, 0x6B);
582
583   addSharpKey("tape_a/b", Unmapped_Key, 0x1B, 0x53);
584   addSharpKey("tape_playrev", Unmapped_Key, 0x1B, 0x57);
585   addSharpKey("tape_ff", Unmapped_Key, 0x1B, 0x5A);
586   addSharpKey("tape_rew", Unmapped_Key, 0x1B, 0x5B);
587   addSharpKey("tape_play", Unmapped_Key, 0x1B, 0x5C);
588   addSharpKey("tape_pause", Unmapped_Key, 0x1B, 0x5D);
589   addSharpKey("tape_stop", Unmapped_Key, 0x1B, 0x5E);
590   addSharpKey("tape_rec", Unmapped_Key, 0x1B, 0x5F);
591 }
592
593
594 DenonReceiver2a::DenonReceiver2a(
595   unsigned int index)
596   : DenonReceiver2(index)
597 {
598   setKeysetName("Receiver Keyset 2a");
599
600   addControlledDevice(Denon_Make, "PMA-425R", Audio_Device);
601 }
602
603
604 void DenonReceiver2a::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   DenonReceiver2::populateProtocol(guiObject);
614
615   addSharpKey("AMP_TAPE2", Unmapped_Key, 0x1D, 0x9A);
616   addSharpKey("AMP_TAPE1", TapeInput_Key, 0x1D, 0x99);
617   addSharpKey("AMP_AUX", AuxInput_Key, 0x1D, 0x84);
618   addSharpKey("AMP_TUNER", TunerInput_Key, 0x1D, 0x73);
619   addSharpKey("AMP_CD", CDInput_Key, 0x1D, 0x82);
620   addSharpKey("AMP_PHONO", PhonoInput_Key, 0x1D, 0x81);
621   addSharpKey("AMP_VOL_UP", VolumeUp_Key, 0x1D, 0x8D);
622   addSharpKey("AMP_VOL_DOWN", VolumeDown_Key, 0x1D, 0x8C);
623   addSharpKey("AMP_POWER", Power_Key, 0x1D, 0x90);
624   addSharpKey("AMP_MUTE", Mute_Key, 0x1D, 0x8B);
625 }
626
627
628 DenonReceiver3::DenonReceiver3(
629   unsigned int index)
630   : PIRKeysetMetaData(
631       "Receiver Keyset 3",
632       Denon_Make,
633       index)
634 {
635   addControlledDevice(Denon_Make, "AVR-600 RD", Audio_Device);
636 }
637
638
639 void DenonReceiver3::populateProtocol(
640   QObject *guiObject)
641 {
642   if (threadableProtocol)
643   {
644     // If the pointer is not null, the keyset must already be populated.
645     return;
646   }
647
648   LIRCProtocol *lp = new LIRCProtocol(
649     guiObject,
650     index,
651     561, 489,
652     561, 1543,
653     67329, true);
654
655   threadableProtocol = lp;
656
657   lp->setTrailerPulse(561);
658
659   addKey("POWER", Power_Key, 0xA20C, 16);
660   addKey("UP", Up_Key, 0x99AC, 16);
661   addKey("DOWN", Down_Key, 0x9AAC, 16);
662   addKey("TUNER", TunerInput_Key, 0xA28C, 16);
663   addKey("CD", CDInput_Key, 0xA08C, 16);
664   addKey("PHONO", PhonoInput_Key, 0xA30C, 16);
665   addKey("VCR", VCRInput_Key, 0xA2CC, 16);
666   addKey("TV", CableInput_Key, 0xA14C, 16);
667   addKey("TAPE", TapeInput_Key, 0xA12C, 16);
668   addKey("STEREO", Unmapped_Key, 0xA39C, 16);
669   addKey("MODE", Mode_Key, 0xA19C, 16);
670   addKey("TESTTONE", Unmapped_Key, 0xA15C, 16);
671   addKey("DELAY", Unmapped_Key, 0xA25C, 16);
672   addKey("MUTE", Mute_Key, 0xA03C, 16);
673   addKey("PANEL", Info_Key, 0xA1EC, 16);
674   addKey("CENTER_UP", CenterVolumeUp_Key, 0xA2BC, 16);
675   addKey("CENTER_DOWN", CenterVolumeDown_Key, 0xA1BC, 16);
676   addKey("REAR_UP", RearVolumeUp_Key, 0xA33C, 16);
677   addKey("REAR_DOWN", RearVolumeDown_Key, 0xA0BC, 16);
678   addKey("VOL_UP", VolumeUp_Key, 0xA23C, 16);
679   addKey("VOL_DOWN", VolumeDown_Key, 0xA13C, 16);
680 }
681
682
683 DenonAudio1::DenonAudio1(
684   unsigned int index)
685   : PIRKeysetMetaData(
686       "Audio Keyset 1",
687       Denon_Make,
688       index)
689 {
690   addControlledDevice(Denon_Make, "HiFi 110", Audio_Device);
691   addControlledDevice(Denon_Make, "DRM-550", Audio_Device);
692   addControlledDevice(Denon_Make, "DCD-335", Audio_Device);
693   addControlledDevice(Denon_Make, "DRA-275RD", Audio_Device);
694   addControlledDevice(Denon_Make, "UD-M30", Audio_Device);
695 }
696
697
698 void DenonAudio1::populateProtocol(
699   QObject *guiObject)
700 {
701   if (threadableProtocol)
702   {
703     // If the pointer is not null, the keyset must already be populated.
704     return;
705   }
706
707   threadableProtocol = new SharpProtocol(guiObject, index, false);
708
709   addSharpKey("reset", Reset_Key, 0x04, 0x54);
710   addSharpKey("TAPE REW", Unmapped_Key, 0x04, 0x57); // "TAPE_PLAY_REV"
711   addSharpKey("TAPE FAST FWD", Unmapped_Key, 0x04, 0x5A); // "TAPE_FORW"
712   addSharpKey("TAPE FAST REW", Unmapped_Key, 0x04, 0x5B); // "TAPE_REW"
713   addSharpKey("TAPE FWD", Unmapped_Key, 0x04, 0x5C); // "TAPE_PLAY_FORW"
714   addSharpKey("TAPE STOP", Unmapped_Key, 0x04, 0x5E);
715   addSharpKey("tapesize", Unmapped_Key, 0x04, 0x60);
716   addSharpKey("revmode", Unmapped_Key, 0x04, 0x62);
717   addSharpKey("TAPE_AB", Unmapped_Key, 0x04, 0x63);
718   addSharpKey("TAPE 2 REW", Unmapped_Key, 0x04, 0x67);
719   addSharpKey("TAPE 2 FAST FWD", Unmapped_Key, 0x04, 0x6A);
720   addSharpKey("TAPE 2 FAST REW", Unmapped_Key, 0x04, 0x6B);
721   addSharpKey("TAPE 2 FWD", Unmapped_Key, 0x04, 0x6C);
722   addSharpKey("TAPE_PAUSE", Unmapped_Key, 0x04, 0x6D);
723   addSharpKey("TAPE 2 STOP", Unmapped_Key, 0x04, 0x6E);
724   addSharpKey("KEY_RECORD", Record_Key, 0x04, 0x6F);
725   addSharpKey("remain", Unmapped_Key, 0x04, 0x74);
726
727   addSharpKey("KEY_1", One_Key, 0x08, 0x42);
728   addSharpKey("KEY_2", Two_Key, 0x08, 0x43);
729   addSharpKey("KEY_3", Three_Key, 0x08, 0x44);
730   addSharpKey("KEY_4", Four_Key, 0x08, 0x45);
731   addSharpKey("KEY_5", Five_Key, 0x08, 0x46);
732   addSharpKey("KEY_6", Six_Key, 0x08, 0x47);
733   addSharpKey("KEY_7", Seven_Key, 0x08, 0x48);
734   addSharpKey("KEY_8", Eight_Key, 0x08, 0x49);
735   addSharpKey("KEY_9", Nine_Key, 0x08, 0x4A);
736   addSharpKey("10", Zero_Key, 0x08, 0x4B);
737   addSharpKey("+10", DoubleDigit_Key, 0x08, 0x4C);
738   addSharpKey("KEY_PROGRAM", Program_Key, 0x08, 0x4D);
739   addSharpKey("open_close", Eject_Key, 0x08, 0x50);
740   addSharpKey("KEY_CANCEL", Clear_Key, 0x08, 0x51); // "cancel", "CD_CANCEL"
741   addSharpKey("call", Call_Key, 0x08, 0x52);
742   addSharpKey("time", Unmapped_Key, 0x08, 0x53); // "CD_TIME"
743   addSharpKey("repeat", Repeat_Key, 0x08, 0x54); // "CD_REPEAT"
744   addSharpKey("a-b", RepeatAB_Key, 0x08, 0x55);
745   addSharpKey("DIRECT", Unmapped_Key, 0x08, 0x57); // "direct"
746   addSharpKey("KEY_NEXT", Next_Key, 0x08, 0x58); // "cdnexttrack"
747   addSharpKey("KEY_PREVIOUS", Previous_Key, 0x08, 0x59); // "cdprevtrack"
748   addSharpKey("KEY_FORWARD", FastForward_Key, 0x08, 0x5A); // "cdffwd"
749   addSharpKey("KEY_REWIND", Rewind_Key, 0x08, 0x5B); // "cdfrew"
750   addSharpKey("KEY_PLAY", Play_Key, 0x08, 0x5C); // "cdplay"
751   addSharpKey("KEY_PAUSE", Pause_Key, 0x08, 0x5D); // "cdpause"
752   addSharpKey("KEY_STOP", Stop_Key, 0x08, 0x5E); // "CD_STOP"
753   addSharpKey("auto_space", Unmapped_Key, 0x08, 0x61);
754   addSharpKey("auto_edit", Unmapped_Key, 0x08, 0x63);
755   addSharpKey("random", Random_Key, 0x08, 0x6A); // "CD_RANDOM"
756   addSharpKey("DISC_SKIP+", NextDisc_Key, 0x08, 0x6B); // "cdskip"
757   addSharpKey("DISC_SKIP-", PrevDisc_Key, 0x08, 0x6E);
758   addSharpKey("peak", Unmapped_Key, 0x08, 0x6F);
759   addSharpKey("edit", Unmapped_Key, 0x08, 0x70); // "CD_EDIT"
760   addSharpKey("fader", Unmapped_Key, 0x08, 0x76);
761   addSharpKey("pitch+", Unmapped_Key, 0x08, 0x77);
762   addSharpKey("pitch-", Unmapped_Key, 0x08, 0x78);
763   addSharpKey("SDB", Unmapped_Key, 0x08, 0xEA);
764
765   addSharpKey("KEY_VOLUMEDOWN", VolumeDown_Key, 0x0C, 0x4C);
766   addSharpKey("KEY_VOLUMEUP", VolumeUp_Key, 0x0C, 0x4D);
767   addSharpKey("PRESET UP", Up_Key, 0x0C, 0x4E); // "up"
768   addSharpKey("PRESET DOWN", Down_Key, 0x0C, 0x4F); // "dwn"
769   addSharpKey("KEY_POWER", Power_Key, 0x0C, 0x50); // "aus"
770   addSharpKey("RCVR_VIDEO", CableInput_Key, 0x0C, 0x53);
771   addSharpKey("RCVR_PHONO", PhonoInput_Key, 0x0C, 0x58);
772   addSharpKey("tuner", TunerInput_Key, 0x0C, 0x59); // "RCVR_TUNER"
773   addSharpKey("RCVR_TAPE_MON", Unmapped_Key, 0x0C, 0x5C);
774   addSharpKey("RCVR_TAPE1", Unmapped_Key, 0x0C, 0x5D);
775   addSharpKey("RCVR_TAPE2", Unmapped_Key, 0x0C, 0x5E);
776   addSharpKey("KEY_FN", Unmapped_Key, 0x0C, 0x5F); // "func"
777   addSharpKey("RCVR_CD", CDInput_Key, 0x0C, 0x6A);
778   addSharpKey("KEY_SLEEP", Sleep_Key, 0x0C, 0x72);
779 //  addSharpKey("RCVR_PANEL", Info_Key, 0x0C, 0x7E);  // Either 0x7E or 0xDE here
780   addSharpKey("memo", Unmapped_Key, 0x0C, 0xD1);
781   addSharpKey("RDS", Unmapped_Key, 0x0C, 0xD2); // "TUNER_RDS"
782   addSharpKey("CT", Unmapped_Key, 0x0C, 0xD3); // "TUNER_CT"
783   addSharpKey("pty", Unmapped_Key, 0x0C, 0xD4); // "TUNER_PTY"
784   addSharpKey("TUNER BAND", FM_Key, 0x0C, 0xD7); // this is a hack
785   addSharpKey("TUNER BAND", AM_Key, 0x0C, 0xD7); // this too
786   addSharpKey("TUNER KEY_UP", ChannelUp_Key, 0x0C, 0xD9);
787   addSharpKey("TUNER KEY_DOWN", ChannelDown_Key, 0x0C, 0xDA);
788   addSharpKey("panel", Info_Key, 0x0C, 0xDE);
789   addSharpKey("eon", Unmapped_Key, 0x0C, 0xFE);
790 }
791
792
793 DenonAudio1a::DenonAudio1a(
794   unsigned int index)
795   : DenonAudio1(index)
796 {
797   setKeysetName("Audio Keyset 1a");
798
799   addControlledDevice(Denon_Make, "UCD-F07", Audio_Device);
800   addControlledDevice(Denon_Make, "UDR-F07", Audio_Device);
801   addControlledDevice(Denon_Make, "UDRA-F07", Audio_Device);
802 }
803
804
805 void DenonAudio1a::populateProtocol(
806   QObject *guiObject)
807 {
808   if (threadableProtocol)
809   {
810     // If the pointer is not null, the keyset must already be populated.
811     return;
812   }
813
814   DenonAudio1::populateProtocol(guiObject);
815
816   addSharpKey("rec", Record_Key, 0x04, 0x5F);
817   addSharpKey("side_a/b", Unmapped_Key, 0x08, 0x53);
818 }
819
820
821 DenonAudio1b::DenonAudio1b(
822   unsigned int index)
823   : DenonAudio1(index)
824 {
825   setKeysetName("Audio Keyset 1b");
826
827   addControlledDevice(Denon_Make, "DCD-1015", Audio_Device);
828   addControlledDevice(Denon_Make, "DCD-655", Audio_Device);
829 }
830
831
832 void DenonAudio1b::populateProtocol(
833   QObject *guiObject)
834 {
835   if (threadableProtocol)
836   {
837     // If the pointer is not null, the keyset must already be populated.
838     return;
839   }
840
841   DenonAudio1::populateProtocol(guiObject);
842
843   addSharpKey("vol_up", VolumeUp_Key, 0x08, 0x4E);
844   addSharpKey("vol_down", VolumeDown_Key, 0x08, 0x4F);
845   addSharpKey("display", Info_Key, 0x08, 0x75);
846 }
847
848
849 DenonAudio1c::DenonAudio1c(
850   unsigned int index)
851   : DenonAudio1b(index)
852 {
853   setKeysetName("Audio Keyset 1c");
854
855   addControlledDevice(Denon_Make, "DCM-260", Audio_Device);
856 }
857
858
859 void DenonAudio1c::populateProtocol(
860   QObject *guiObject)
861 {
862   if (threadableProtocol)
863   {
864     // If the pointer is not null, the keyset must already be populated.
865     return;
866   }
867
868   DenonAudio1b::populateProtocol(guiObject);
869
870   addSharpKey("DISC_SELECT", NextDisc_Key, 0x08, 0x62);
871 }
872
873
874 DenonAudio1d::DenonAudio1d(
875   unsigned int index)
876   : DenonAudio1(index)
877 {
878   setKeysetName("Audio Keyset 1d");
879
880   addControlledDevice(Denon_Make, "UDRA-M7", Audio_Device);
881   addControlledDevice(Denon_Make, "UPA-F88", Audio_Device);
882   addControlledDevice(Denon_Make, "UCD-F88", Audio_Device);
883   addControlledDevice(Denon_Make, "UDR-F88", Audio_Device);
884   addControlledDevice(Denon_Make, "UTU-F88", Audio_Device);
885   addControlledDevice(Denon_Make, "RC-846", Audio_Device);
886 }
887
888
889 void DenonAudio1d::populateProtocol(
890   QObject *guiObject)
891 {
892   if (threadableProtocol)
893   {
894     // If the pointer is not null, the keyset must already be populated.
895     return;
896   }
897
898   DenonAudio1::populateProtocol(guiObject);
899
900   addSharpKey("TAPE_REC", Record_Key, 0x04, 0x5F);
901
902   addSharpKey("MD_STOP", Unmapped_Key, 0x06, 0xE1);
903   addSharpKey("MD_PLAY", Unmapped_Key, 0x06, 0xE2);
904   addSharpKey("MD_REC", Unmapped_Key, 0x06, 0xE5);
905   addSharpKey("MD_SEARCH_NEXT", Unmapped_Key, 0x06, 0xE9);
906   addSharpKey("MD_SEARCH_PREVIOUS", Unmapped_Key, 0x06, 0xEA);
907 }
908
909
910 DenonAudio2::DenonAudio2(
911   unsigned int index)
912   : PIRKeysetMetaData(
913       "Audio Keyset 2",
914       Denon_Make,
915       index)
916 {
917   addControlledDevice(Denon_Make, "D-C30", Audio_Device);
918 }
919
920
921 void DenonAudio2::populateProtocol(
922   QObject *guiObject)
923 {
924   if (threadableProtocol)
925   {
926     // If the pointer is not null, the keyset must already be populated.
927     return;
928   }
929
930   threadableProtocol = new NECProtocol(guiObject, index, false, true);
931
932 //  setPreData(0xDA25, 16);
933   setPreData(0x5B, 8);
934
935   addKey("Power", Power_Key, 0x00, 8);
936   addKey("Volume_Up", VolumeUp_Key, 0x01, 8);
937   addKey("Volume_Down", VolumeDown_Key, 0x02, 8);
938   addKey("Remain", Unmapped_Key, 0x03, 8);
939   addKey("A.Edit", Unmapped_Key, 0x04, 8);
940   addKey("Tuner_Band", TunerInput_Key, 0x07, 8);
941   addKey("Tape_1/2", Unmapped_Key, 0x09, 8);
942   addKey("P.Mode", Unmapped_Key, 0x0B, 8);
943   addKey("EQ_Pattern", Unmapped_Key, 0x11, 8);
944   addKey("CD_Play", Play_Key, 0x12, 8);
945   addKey("CD_Stop", Stop_Key, 0x13, 8);
946   addKey("Skip_Forward", Next_Key, 0x14, 8);
947   addKey("Skip_Backward", Previous_Key, 0x15, 8);
948   addKey("Prog", Program_Key, 0x16, 8);
949   addKey("Repeat", Repeat_Key, 0x17, 8);
950   addKey("Open/Close", Eject_Key, 0x18, 8);
951   addKey("Fast_Forward", FastForward_Key, 0x1B, 8);
952   addKey("Fast_Rewind", Rewind_Key, 0x1C, 8);
953   addKey("Stop", Unmapped_Key, 0x1D, 8);
954   addKey("Play_Forward", Unmapped_Key, 0x19, 8);
955   addKey("Record_Pause", Unmapped_Key, 0x1F, 8);
956   addKey("1", One_Key, 0x4D, 8);
957   addKey("2", Two_Key, 0x4E, 8);
958   addKey("3", Three_Key, 0x4F, 8);
959   addKey("4", Four_Key, 0x50, 8);
960   addKey("5", Five_Key, 0x51, 8);
961   addKey("6", Six_Key, 0x52, 8);
962   addKey("7", Seven_Key, 0x53, 8);
963   addKey("8", Eight_Key, 0x54, 8);
964   addKey("9", Nine_Key, 0x55, 8);
965   addKey("10", Unmapped_Key, 0x56, 8);
966   addKey("10+/12", DoubleDigit_Key, 0x57, 8);
967   addKey("Random", Random_Key, 0x5A, 8);
968   addKey("0/11", Zero_Key, 0x5B, 8);
969   addKey("Disc", Unmapped_Key, 0x5E, 8);
970   addKey("Play_Backward", Unmapped_Key, 0xD2, 8);
971 }
972
973
974 DenonAudio3::DenonAudio3(
975   unsigned int index)
976   : PIRKeysetMetaData(
977       "Audio Keyset 3",
978       Denon_Make,
979       index)
980 {
981   addControlledDevice(Denon_Make, "DMD-800", Audio_Device);
982 }
983
984
985 void DenonAudio3::populateProtocol(
986   QObject *guiObject)
987 {
988   if (threadableProtocol)
989   {
990     // If the pointer is not null, the keyset must already be populated.
991     return;
992   }
993
994   threadableProtocol = new SharpProtocol(guiObject, index, false);
995
996   addKey("1", One_Key, 0x06, 0xC1);
997   addKey("2", Two_Key, 0x06, 0xC2);
998   addKey("3", Three_Key, 0x06, 0xC3);
999   addKey("4", Four_Key, 0x06, 0xC4);
1000   addKey("5", Five_Key, 0x06, 0xC5);
1001   addKey("6", Six_Key, 0x06, 0xC6);
1002   addKey("7", Seven_Key, 0x06, 0xC7);
1003   addKey("8", Eight_Key, 0x06, 0xC8);
1004   addKey("9", Nine_Key, 0x06, 0xC9);
1005   addKey("10", Zero_Key, 0x06, 0xCA);
1006   addKey("CHAR", Unmapped_Key, 0x06, 0xDD);
1007   addKey("ENTER", Select_Key, 0x06, 0xDE);
1008   addKey("CLEAR", Clear_Key, 0x06, 0xDF);
1009   addKey("POWER", Power_Key, 0x06, 0xE0);
1010   addKey("STOP", Stop_Key, 0x06, 0xE1);
1011   addKey("PLAY", Play_Key, 0x06, 0xE2);
1012   addKey("PAUSE", Pause_Key, 0x06, 0xE3);
1013   addKey("REC", Record_Key, 0x06, 0xE5);
1014   addKey("EJECT", Eject_Key, 0x06, 0xE6);
1015   addKey("+10", DoubleDigit_Key, 0x06, 0xE8);
1016   addKey("NEXT_TRACK", Next_Key, 0x06, 0xE9);
1017   addKey("PREV_TRACK", Previous_Key, 0x06, 0xEA);
1018   addKey("FORWARD", Advance_Key, 0x06, 0xEB);
1019   addKey("BACK", Replay_Key, 0x06, 0xEC);
1020   addKey("EDIT", Unmapped_Key, 0x06, 0xEF);
1021   addKey("PROG", Program_Key, 0x06, 0xF0);
1022   addKey("REPEAT", Repeat_Key, 0x06, 0xF1);
1023   addKey("RANDOM", Random_Key, 0x06, 0xF3);
1024   addKey("TIME", Unmapped_Key, 0x06, 0xF4);
1025   addKey("TITLE", Unmapped_Key, 0x06, 0xF5);
1026   addKey("CALL", Call_Key, 0x06, 0xF6);
1027 }
1028
1029
1030 DenonAudio4::DenonAudio4(
1031   unsigned int index)
1032   : PIRKeysetMetaData(
1033       "Audio Keyset 4",
1034       Denon_Make,
1035       index)
1036 {
1037   addControlledDevice(Denon_Make, "D-G1MD", Audio_Device);
1038 }
1039
1040
1041 void DenonAudio4::populateProtocol(
1042   QObject *guiObject)
1043 {
1044   if (threadableProtocol)
1045   {
1046     // If the pointer is not null, the keyset must already be populated.
1047     return;
1048   }
1049
1050   threadableProtocol = new NECProtocol(guiObject, index, true, true);
1051
1052 //  setPreData(0x4040, 16);
1053   setPreData(0x0202, 16);
1054
1055   addKey("fm/am", TunerInput_Key, 0x00, 8);
1056   addKey("rds", Unmapped_Key, 0x01, 8);
1057   addKey("1", One_Key, 0x02, 8);
1058   addKey("6", Six_Key, 0x03, 8);
1059   addKey("+10", DoubleDigit_Key, 0x04, 8);
1060   addKey("mdrec", Record_Key, 0x05, 8);
1061   addKey("recmute", RecordMute_Key, 0x06, 8);
1062   addKey("edit", Unmapped_Key, 0x07, 8);
1063   addKey("tape", Unmapped_Key, 0x08, 8);
1064   addKey("pty", Unmapped_Key, 0x09, 8);
1065   addKey("2", Two_Key, 0x0A, 8);
1066   addKey("7", Seven_Key, 0x0B, 8);
1067   addKey("+100", PlusOneHundred_Key, 0x0C, 8);
1068   addKey("pickrec", Unmapped_Key, 0x0D, 8);
1069   addKey("revmode", Unmapped_Key, 0x0E, 8);
1070   addKey("editcancel", Unmapped_Key, 0x0F, 8);
1071   addKey("cd", CDInput_Key, 0x10, 8);
1072   addKey("ct", Unmapped_Key, 0x11, 8);
1073   addKey("3", Three_Key, 0x12, 8);
1074   addKey("8", Eight_Key, 0x13, 8);
1075   addKey("clock", Unmapped_Key, 0x14, 8);
1076   addKey("checkspace", Unmapped_Key, 0x15, 8);
1077   addKey("dolby", NoiseReduction_Key, 0x16, 8);
1078   addKey("prog", Program_Key, 0x17, 8);
1079   addKey("aux", AuxInput_Key, 0x18, 8);
1080   addKey("rt", Unmapped_Key, 0x19, 8);
1081   addKey("4", Four_Key, 0x1A, 8);
1082   addKey("9", Nine_Key, 0x1B, 8);
1083   addKey("timer", Timer_Key, 0x1C, 8);
1084   addKey("clear", Clear_Key, 0x1D, 8);
1085   addKey("titleinput", Unmapped_Key, 0x1E, 8);
1086   addKey("vol-", VolumeDown_Key, 0x1F, 8);
1087   addKey("md", MDInput_Key, 0x40, 8);
1088   addKey("fmmode", Unmapped_Key, 0x41, 8);
1089   addKey("5", Five_Key, 0x42, 8);
1090   addKey("0", Zero_Key, 0x43, 8);
1091   addKey("sleep", Sleep_Key, 0x44, 8);
1092   addKey("set", Unmapped_Key, 0x45, 8);
1093   addKey("enter", Enter_Key, 0x46, 8);
1094   addKey("5modesrs", Surround_Key, 0x47, 8);
1095   addKey("titlesearch", Unmapped_Key, 0x48, 8);
1096   addKey("vol+", VolumeUp_Key, 0x49, 8);
1097   addKey("repeat", Repeat_Key, 0x4A, 8);
1098   addKey("random", Random_Key, 0x4B, 8);
1099   addKey("power", Power_Key, 0x4C, 8);
1100   addKey("timedisp", Info_Key, 0x4D, 8);
1101   addKey("eqmode", Unmapped_Key, 0x4E, 8);
1102   addKey("mute", Mute_Key, 0x4F, 8);
1103   addKey("bass", EnhancedBass_Key, 0x50, 8);
1104   addKey("forward", FastForward_Key, 0x51, 8);
1105   addKey("prev", Previous_Key, 0x52, 8);
1106   addKey("next", Next_Key, 0x53, 8);
1107   addKey("backward", Rewind_Key, 0x56, 8);
1108   addKey("stop", Stop_Key, 0x57, 8);
1109 }