First attempt to implement RC6 Protocol
[pierogi] / keysets / sharp.cpp
1 #include "sharp.h"
2 #include "necprotocol.h"
3 //#include "pirmakenames.h"
4
5 SharpTV1::SharpTV1(
6   QObject *guiObject,
7   unsigned int index)
8   : PIRKeysetMetaData(
9       "TV Keyset 1",
10       Sharp_Make,
11       index)
12 {
13   NECProtocol *np = new NECProtocol(
14     guiObject,
15     index,
16     350, 650,
17     350, 1650,
18     64000, true);
19
20   threadableProtocol = np;
21
22   np->setElevenBitToggle(true);
23
24   np->setTrailerPulse(350);
25
26 //  np->setMinimumRepetitions(1);
27
28 //  np->setToggleMask(0x3FF);
29
30   addKey("POWER", Power_Key, 0x41A2, 15);
31   addKey("TV/VIDEO", Input_Key, 0x4322, 15);
32   addKey("10+", Unmapped_Key, 0x43D2, 15);
33   addKey("20+", Unmapped_Key, 0x4032, 15);
34   addKey("30+", Unmapped_Key, 0x4232, 15);
35   addKey("40+", Unmapped_Key, 0x43C2, 15);
36   addKey("1", One_Key, 0x4202, 15);
37   addKey("2", Two_Key, 0x4102, 15);
38   addKey("3", Three_Key, 0x4302, 15);
39   addKey("4", Four_Key, 0x4082, 15);
40   addKey("5", Five_Key, 0x4282, 15);
41   addKey("6", Six_Key, 0x4242, 15);
42   addKey("7", Seven_Key, 0x4382, 15);
43   addKey("8", Eight_Key, 0x4042, 15);
44   addKey("9", Nine_Key, 0x4242, 15);
45   addKey("0", Zero_Key, 0x4142, 15);
46   addKey("CH_DOWN", ChannelDown_Key, 0x4122, 15);
47   addKey("CH_UP", ChannelUp_Key, 0x4222, 15);
48   addKey("TIMER", Sleep_Key, 0x4162, 15);
49   addKey("INFO", Info_Key, 0x4362, 15); // "disp_del" "TEXT"
50   addKey("CH_SWAP", PrevChannel_Key, 0x4392, 15); // "FLASHBACK", "ret"
51   addKey("MUTE", Mute_Key, 0x43A2, 15);  // "VOLUME_KILL"
52   addKey("VOL_DOWN", VolumeDown_Key, 0x42A2, 15);
53   addKey("VOL_UP", VolumeUp_Key, 0x40A2, 15);
54   addKey("stereo", Unmapped_Key, 0x40C2, 15); // "VpsPds"
55   addKey("AmPm", Unmapped_Key, 0x40BD, 15);
56   addKey("PROG", Program_Key, 0x42E2, 15);
57   addKey("MONO", Unmapped_Key, 0x40D2, 15);
58   addKey("SOUND_MODE", Unmapped_Key, 0x4062, 15); // I/II/I+II
59 //  addKey("SINGLE_DOUBLE", DoubleDigit_Key, 0x42B2, 15);
60   addKey("TELETEXT", Unmapped_Key, 0x40B2, 15);
61   addKey("PICTURE", Unmapped_Key, 0x4132, 15);
62   addKey("REVEAL", Unmapped_Key, 0x4072, 15);
63   addKey("TOP_BOTTOM_FULL", Unmapped_Key, 0x43B2, 15);
64   addKey("HOLD", Unmapped_Key, 0x4332, 15);
65   addKey("TIME", Unmapped_Key, 0x40E2, 15);
66   addKey("RESET", Unmapped_Key, 0x412A, 15);
67   addKey("INDEX", Unmapped_Key, 0x40CA, 15);
68   addKey("COLOR_RED", Red_Key, 0x404A, 15);
69   addKey("COLOR_GREEN", Green_Key, 0x424A, 15);
70   addKey("COLOR_YELLOW", Yellow_Key, 0x414A, 15);
71   addKey("COLOR_BLUE", Blue_Key, 0x434A, 15);
72   addKey("BROWSE", Unmapped_Key, 0x43D2, 15);
73   addKey("BALANCE_LEFT", Unmapped_Key, 0x435A, 15);
74   addKey("BALANCE_RIGHT", Unmapped_Key, 0x40DA, 15);
75   addKey("TREBLE_DOWN", Unmapped_Key, 0x431A, 15);
76   addKey("TREBLE_UP", Unmapped_Key, 0x411A, 15);
77   addKey("BASS_DOWN", Unmapped_Key, 0x429A, 15);
78   addKey("BASS_UP", Unmapped_Key, 0x409A, 15);
79   addKey("WOOFER_DOWN", Unmapped_Key, 0x439A, 15);
80   addKey("WOOFER_UP", Unmapped_Key, 0x419A, 15);
81   addKey("PICTURE_NORMALIZE", Unmapped_Key, 0x4212, 15);
82   addKey("SOUND_NORMALIZE", Unmapped_Key, 0x4192, 15);
83   addKey("COLOR_DOWN", Unmapped_Key, 0x4292, 15);
84   addKey("COLOR_UP", Unmapped_Key, 0x4092, 15);
85   addKey("CONTRAST_DOWN", Unmapped_Key, 0x4312, 15);
86   addKey("CONTRAST_UP", Unmapped_Key, 0x4112, 15);
87   addKey("BRIGHTNESS_DOWN", Unmapped_Key, 0x4152, 15);
88   addKey("BRIGHTNESS_UP", Unmapped_Key, 0x4252, 15);
89   addKey("PROGRAM", Program_Key, 0x41B2, 15);
90   addKey("calendar", Unmapped_Key, 0x41BA, 15);
91   addKey("program_timer", Unmapped_Key, 0x4262, 15); // "on_timer"
92   addKey("message", Unmapped_Key, 0x4372, 15);
93   addKey("language", Language_Key, 0x407A, 15);
94   addKey("100", PlusOneHundred_Key, 0x4342, 15);
95   addKey("p/c", Unmapped_Key, 0x42F2, 15);
96   addKey("pr", Unmapped_Key, 0x420A, 15);
97   addKey("PICTURE", PictureMode_Key, 0x401A, 15);
98   addKey("SOUND", SoundMode_Key, 0x421A, 15);
99   addKey("FUNCTIONS", Unmapped_Key, 0x43EA, 15);
100   addKey("MENU", Menu_Key, 0x42CA, 15);
101   addKey("LOCK", Unmapped_Key, 0x422A, 15);
102   addKey("./..", DoubleDigit_Key, 0x40F2, 15); // "dual"
103   addKey("NR", Unmapped_Key, 0x4022, 15);
104   addKey("BACKLIGHT", Unmapped_Key, 0x3F46, 15); // "OPC"
105   addKey("ROTATE", Unmapped_Key, 0x3CC6, 15);
106   addKey("AV-", Unmapped_Key, 0x473A, 15); // reverse-direction input 
107   addKey("BT_END", Unmapped_Key, 0x42BE, 15);
108   addKey("SUBTITLE", Captions_Key, 0x3FE6, 15);
109   addKey("SUBPAGE", Unmapped_Key, 0x3ECE, 15);
110   addKey("DTV", Unmapped_Key, 0x4416, 15);
111   addKey("EPG", Guide_Key, 0x44E9, 15);
112   addKey("ESG", Unmapped_Key, 0x4796, 15);
113   addKey("RADIO", Unmapped_Key, 0x4496, 15);
114   addKey("AV_MODE", Unmapped_Key, 0x407E, 15);
115   addKey("SURROUND", Surround_Key, 0x41DA, 15);
116   addKey("DTV_MENU", Unmapped_Key, 0x4616, 15);
117   addKey("LIST", Unmapped_Key, 0x4516, 15);
118   addKey("TRUD", Unmapped_Key, 0x46EE, 15);
119   addKey("WIDE_MODES", AspectRatio_Key, 0x444E, 15);
120   addKey("ACTION", Unmapped_Key, 0x467E, 15);
121 }
122
123
124 SharpTV1a::SharpTV1a(
125   QObject *guiObject,
126   unsigned int index)
127   : SharpTV1(guiObject, index)
128 {
129   setKeysetName("TV Keyset 1a");
130
131   addKey("Input", Input_Key, 0x40B2, 15);
132   addKey("Time", Sleep_Key, 0x41C2, 15);
133   addKey("Stop", Stop_Key, 0x4392, 15);
134   addKey("REC", Record_Key, 0x4052, 15);
135   addKey("Pause", Pause_Key, 0x4292, 15);
136   addKey("Play", Play_Key, 0x4112, 15);
137   addKey("REW", Rewind_Key, 0x4312, 15);
138   addKey("FF", FastForward_Key, 0x4212, 15);
139   addKey("TapeSpeed", VHSSpeed_Key, 0x43E2, 15);
140   addKey("ZeroBack", Unmapped_Key, 0x4306, 15);
141   addKey("Replay", Replay_Key, 0x43DD, 15);
142   addKey("SkipSearch", Advance_Key, 0x4026, 15);
143   addKey("Slow", Unmapped_Key, 0x4252, 15);
144   addKey("DPSS-", Unmapped_Key, 0x4032, 15);
145   addKey("DPSS+", Unmapped_Key, 0x43D2, 15);
146   addKey("Key", Unmapped_Key, 0x42C2, 15);
147 }
148
149
150 SharpTV1b::SharpTV1b(
151   QObject *guiObject,
152   unsigned int index)
153   : SharpTV1(guiObject, index)
154 {
155   setKeysetName("TV Keyset 1b");
156
157   addKey("chScan", Scan_Key, 0x40E2, 15);
158   addKey("video", Input_Key, 0x424A, 15);
159   addKey("minus", Down_Key, 0x402A, 15); // "DOWN"
160   addKey("plus", Up_Key, 0x43CA, 15); // "UP"
161   addKey("setup", Menu_Key, 0x4012, 15);
162   addKey("fback_clr", Unmapped_Key, 0x43D2, 15);
163   addKey("FINE_TUNING", Unmapped_Key, 0x41C2, 15);
164   addKey("TIMER", Unmapped_Key, 0x432A, 15);
165   addKey("BLUE_BACK", Unmapped_Key, 0x4372, 15);
166   addKey("SKIP", Unmapped_Key, 0x438A, 15);
167   addKey("SYSTEM_SOUND", Unmapped_Key, 0x43DA, 15);
168   addKey("SYSTEM_COLOUR", Unmapped_Key, 0x423A, 15);
169 }
170
171
172 SharpTV1c::SharpTV1c(
173   QObject *guiObject,
174   unsigned int index)
175   : SharpTV1(guiObject, index)
176 {
177   setKeysetName("TV Keyset 1c");
178
179   addKey("save_ch", Unmapped_Key, 0x420A, 15);
180   addKey("del_ch", Unmapped_Key, 0x42F2, 15);
181 }
182
183
184 SharpTV1d::SharpTV1d(
185   QObject *guiObject,
186   unsigned int index)
187   : SharpTV1(guiObject, index)
188 {
189   setKeysetName("TV Keyset 1d");
190
191   addKey("P-MODE", PictureMode_Key, 0x42CA, 15);
192   addKey("S-MODE", SoundMode_Key, 0x4192, 15);
193 }
194
195
196 SharpTV1e::SharpTV1e(
197   QObject *guiObject,
198   unsigned int index)
199   : SharpTV1(guiObject, index)
200 {
201   setKeysetName("TV Keyset 1e");
202
203   addKey("UP", Up_Key, 0x43AA, 15);
204   addKey("LEFT", Left_Key, 0x43AE, 15);
205   addKey("OK", Select_Key, 0x412A, 15);
206   addKey("RIGHT", Right_Key, 0x406E, 15);
207   addKey("DOWN", Down_Key, 0x4012, 15);
208   addKey("MENU", Menu_Key, 0x458E, 15);
209   addKey("RETURN", Exit_Key, 0x409E, 15);
210 }
211
212
213 SharpVCR1::SharpVCR1(
214   QObject *guiObject,
215   unsigned int index)
216   : PIRKeysetMetaData(
217       "VCR Keyset 1",
218       Sharp_Make,
219       index)
220 {
221   NECProtocol *np = new NECProtocol(
222     guiObject,
223     index,
224     400, 600,
225     400, 1700,
226     64000, true);
227
228   threadableProtocol = np;
229
230   np->setElevenBitToggle(true);
231
232   np->setTrailerPulse(400);
233
234 //  np->setMinimumRepetitions(1);
235
236 //  np->setToggleMask(0x3FF);
237
238   addKey("Power", Power_Key, 0x61A2, 15);
239   addKey("1", One_Key, 0x6202, 15);
240   addKey("2", Two_Key, 0x6102, 15);
241   addKey("3", Three_Key, 0x6302, 15);
242   addKey("4", Four_Key, 0x6082, 15);
243   addKey("5", Five_Key, 0x6282, 15);
244   addKey("6", Six_Key, 0x6182, 15);
245   addKey("7", Seven_Key, 0x6382, 15);
246   addKey("8", Eight_Key, 0x6042, 15);
247   addKey("9", Nine_Key, 0x6242, 15);
248   addKey("0", Zero_Key, 0x6142, 15);
249   addKey("Play", Play_Key, 0x6112, 15);
250   addKey("Stop", Stop_Key, 0x6392, 15);
251   addKey("Rec", Record_Key, 0x6052, 15);
252   addKey("Pause", Pause_Key, 0x6292, 15);
253   addKey("FF", FastForward_Key, 0x6212, 15);
254   addKey("Rew", Rewind_Key, 0x6312, 15);
255   addKey("./..", DoubleDigit_Key, 0x6342, 15);
256   addKey("InputSelect", Input_Key, 0x60B2, 15); // "simul"
257   addKey("ChnUp", ChannelUp_Key, 0x6222, 15);
258   addKey("ChnDn", ChannelDown_Key, 0x6122, 15);
259   addKey("Display", Info_Key, 0x60C6, 15);
260   addKey("ModeOsd", Unmapped_Key, 0x62C6, 15);
261   addKey("TV/VCR", Unmapped_Key, 0x6322, 15);
262   addKey("Menu", Menu_Key, 0x6066, 15);
263   addKey("Set", Select_Key, 0x6166, 15);
264   addKey("SV/V+/Timer", Unmapped_Key, 0x600E, 15);
265   addKey("Clear", Clear_Key, 0x6012, 15);
266   addKey("TimerOn/Off", Unmapped_Key, 0x6262, 15);
267   addKey("AudioOut", Surround_Key, 0x6062, 15);
268   addKey("SkipSearch", Unmapped_Key, 0x6026, 15);
269   addKey("ZeroBack", Unmapped_Key, 0x6306, 15);  // "MEMORY"
270   addKey("TapeSpeed", VHSSpeed_Key, 0x63E2, 15);
271   addKey("Slow", Unmapped_Key, 0x6252, 15);
272   addKey("DPSS-", Unmapped_Key, 0x6032, 15); // "slow-"
273   addKey("DPSS+", Unmapped_Key, 0x63D2, 15); // "slow+"
274   addKey("Key", Unmapped_Key, 0x62C2, 15);  // "C-LOCK", "tamper_proof"
275   addKey("Left", Left_Key, 0x62E6, 15);
276   addKey("Right", Right_Key, 0x6366, 15);
277   addKey("Up", Up_Key, 0x6266, 15);
278   addKey("Dn", Down_Key, 0x60E6, 15);
279   addKey("EJECT", Eject_Key, 0x6332, 15);
280   addKey("MUTE", Mute_Key, 0x63A2, 15);
281   addKey("PROG", Program_Key, 0x62E2, 15);
282   addKey("TRACKING_DOWN", TrackingMinus_Key, 0x6186, 15);
283   addKey("TRACKING_UP", TrackingPlus_Key, 0x6286, 15);
284   addKey("CLOCK", Unmapped_Key, 0x60D2, 15);
285   addKey("SEARCH", Unmapped_Key, 0x63B2, 15);
286   addKey("TIME", Unmapped_Key, 0x61C2, 15);
287   addKey("REC_TIME", Unmapped_Key, 0x63C2, 15); // "TIME-0"
288   addKey("F.ADV", Unmapped_Key, 0x6092, 15);
289   addKey("SHUTTLE0", Unmapped_Key, 0x61D6, 15);
290   addKey("SHUTTLE-1", Unmapped_Key, 0x6256, 15);
291   addKey("SHUTTLE-2", Unmapped_Key, 0x6356, 15);
292   addKey("SHUTTLE+1", Unmapped_Key, 0x6016, 15);
293   addKey("SHUTTLE+2", Unmapped_Key, 0x6116, 15);
294   addKey("SHUTTLE+3", Unmapped_Key, 0x6096, 15);
295   addKey("SHUTTLE+4", Unmapped_Key, 0x6196, 15);
296   addKey("SHUTTLE+5", Unmapped_Key, 0x6056, 15);
297   addKey("SHUTTLE+6", Unmapped_Key, 0x6156, 15);
298   addKey("repeat", Unmapped_Key, 0x6022, 15);
299   addKey("osp", Unmapped_Key, 0x60E2, 15);
300   addKey("vps", Unmapped_Key, 0x60C2, 15);
301   addKey("x2", Unmapped_Key, 0x6232, 15);
302   addKey("100", PlusOneHundred_Key, 0x6046, 15);
303   addKey("cancel", Unmapped_Key, 0x6086, 15);  // could be exit key
304 }
305
306
307 SharpReceiver1::SharpReceiver1(
308   QObject *guiObject,
309   unsigned int index)
310   : PIRKeysetMetaData(
311       "Receiver Keyset 1",
312       Sharp_Make,
313       index)
314 {
315   NECProtocol *np = new NECProtocol(
316     guiObject,
317     index,
318     350, 650,
319     350, 1650,
320     67000, true);
321
322   threadableProtocol = np;
323
324   np->setElevenBitToggle(true);
325
326   np->setTrailerPulse(350);
327
328 //  np->setMinimumRepetitions(9);
329
330   addKey("POWER", Power_Key, 0x25A2, 15);
331   addKey("X-BASS", Unmapped_Key, 0x25D2, 15);
332   addKey("VOL-", VolumeDown_Key, 0x26A2, 15);
333   addKey("VOL+", VolumeUp_Key, 0x24A2, 15);
334   addKey("CD", Unmapped_Key, 0x2762, 15);
335   addKey("TUNER", Unmapped_Key, 0x2662, 15);
336   addKey("TAPE", Unmapped_Key, 0x2562, 15);
337   addKey("PHONO", Unmapped_Key, 0x26E2, 15);
338   addKey("FM", Unmapped_Key, 0x2532, 15);
339   addKey("MW", Unmapped_Key, 0x24B2, 15);
340   addKey("SW", Unmapped_Key, 0x254E, 15);
341   addKey("LW", Unmapped_Key, 0x2732, 15);
342   addKey("PRESET-", Unmapped_Key, 0x2522, 15);
343   addKey("PRESET+", Unmapped_Key, 0x2622, 15);
344   addKey("1", One_Key, 0x1602, 15);
345   addKey("2", Two_Key, 0x1502, 15);
346   addKey("3", Three_Key, 0x1702, 15);
347   addKey("4", Four_Key, 0x1482, 15);
348   addKey("5", Five_Key, 0x1682, 15);
349   addKey("6", Six_Key, 0x1582, 15);
350   addKey("7", Seven_Key, 0x1782, 15);
351   addKey("8", Eight_Key, 0x1442, 15);
352   addKey("9", Nine_Key, 0x1642, 15);
353   addKey("0", Zero_Key, 0x1542, 15);
354   addKey("+10", DoubleDigit_Key, 0x1472, 15);
355   addKey("MEMORY", Unmapped_Key, 0x1722, 15);
356   addKey("REPEAT", Unmapped_Key, 0x15B2, 15);
357   addKey("STOP", Stop_Key, 0x146D, 15);
358   addKey("PAUSE", Pause_Key, 0x1692, 15);
359   addKey("PLAY", Play_Key, 0x1512, 15);
360   addKey("REVIEW", Rewind_Key, 0x1562, 15);
361   addKey("CUE", FastForward_Key, 0x1662, 15);
362   addKey("APSS-", Unmapped_Key, 0x1712, 15);
363   addKey("APSS+", Unmapped_Key, 0x1612, 15);
364   addKey("CLEAR", Clear_Key, 0x1522, 15);
365   addKey("CALL", Unmapped_Key, 0x1622, 15);
366   addKey("TIME_DISPLAY", Unmapped_Key, 0x1762, 15);
367   addKey("RANDOM", Unmapped_Key, 0x15E2, 15);
368 }