First attempt to implement RC6 Protocol
[pierogi] / keysets / hauppauge.cpp
1 #include "hauppauge.h"
2 #include "rc5protocol.h"
3
4 HauppaugePCTV1::HauppaugePCTV1(
5   QObject *guiObject,
6   unsigned int index)
7   : PIRKeysetMetaData(
8       "PCTV Keyset 1",
9       Hauppauge_Make,
10       index)
11 {
12   addControlledDevice(Hauppauge_Make, "PVR 350", Computer_Device);
13
14   threadableProtocol = new RC5Protocol(guiObject, index, 0x5E);
15
16   addKey("Power", Power_Key, 0x3D, 6);
17   addKey("Go", Unmapped_Key, 0x3B, 6);
18   addKey("TV", Unmapped_Key, 0x1C, 6);
19   addKey("Videos", Unmapped_Key, 0x18, 6);
20   addKey("Music", Unmapped_Key, 0x19, 6);
21   addKey("Pictures", Unmapped_Key, 0x1A, 6);
22   addKey("Guide", Unmapped_Key, 0x1B, 6);
23   addKey("Radio", Unmapped_Key, 0x0C, 6);
24   addKey("Up", Up_Key, 0x14, 6);
25   addKey("Down", Down_Key, 0x15, 6);
26   addKey("Left", Left_Key, 0x16, 6);
27   addKey("Right", Right_Key, 0x17, 6);
28   addKey("Ok", Select_Key, 0x25, 6);
29   addKey("Back/Exit", Exit_Key, 0x1F, 6);
30   addKey("Menu/i", Menu_Key, 0x0D, 6);
31   addKey("Vol+", VolumeUp_Key, 0x10, 6);
32   addKey("Vol-", VolumeDown_Key, 0x11, 6);
33   addKey("Prev.Ch", PrevChannel_Key, 0x12, 6);
34   addKey("Mute", Mute_Key, 0x0F, 6);
35   addKey("Ch+", ChannelUp_Key, 0x20, 6);
36   addKey("Ch-", ChannelDown_Key, 0x21, 6);
37   addKey("Record", Record_Key, 0x37, 6);
38   addKey("Stop", Stop_Key, 0x36, 6);
39   addKey("Rewind", Rewind_Key, 0x32, 6);
40   addKey("Play", Play_Key, 0x35, 6);
41   addKey("Forward", FastForward_Key, 0x34, 6);
42   addKey("Replay/SkipBackward", Replay_Key, 0x24, 6);
43   addKey("Pause", Pause_Key, 0x30, 6);
44   addKey("SkipForward", Advance_Key, 0x1E, 6);
45   addKey("0", Zero_Key, 0x00, 6);
46   addKey("1", One_Key, 0x01, 6);
47   addKey("2", Two_Key, 0x02, 6);
48   addKey("3", Three_Key, 0x03, 6);
49   addKey("4", Four_Key, 0x04, 6);
50   addKey("5", Five_Key, 0x05, 6);
51   addKey("6", Six_Key, 0x06, 6);
52   addKey("7", Seven_Key, 0x07, 6);
53   addKey("8", Eight_Key, 0x08, 6);
54   addKey("9", Nine_Key, 0x09, 6);
55   addKey("Asterix", Unmapped_Key, 0x0A, 6);
56   addKey("sub/cc", Captions_Key, 0x0E, 6); // "Recordings"
57   addKey("Red", Red_Key, 0x0B, 6);
58   addKey("Green", Green_Key, 0x2E, 6);
59   addKey("Yellow", Yellow_Key, 0x38, 6);
60   addKey("Blue", Blue_Key, 0x29, 6);
61 }
62
63
64 HauppaugePCTV1a::HauppaugePCTV1a(
65   QObject *guiObject,
66   unsigned int index)
67   : HauppaugePCTV1(guiObject, index)
68 {
69   setKeysetName("PCTV Keyset 1a");
70
71   addControlledDevice(Hauppauge_Make, "WinTV-HVR-950Q", Computer_Device);
72
73   setPreData(0x5D, 7);
74 }
75
76
77 HauppaugePCTV1b::HauppaugePCTV1b(
78   QObject *guiObject,
79   unsigned int index)
80   : HauppaugePCTV1(guiObject, index)
81 {
82   setKeysetName("PCTV Keyset 1b");
83
84   addControlledDevice(Hauppauge_Make, "MVP", Computer_Device);
85
86   setPreData(0x43, 7);
87
88   addKey("KEY_FN_1", Unmapped_Key, 0x0C, 6);
89   addKey("KEY_FN_2", Unmapped_Key, 0x3C, 6);
90 }
91
92
93 HauppaugePCTV1c::HauppaugePCTV1c(
94   QObject *guiObject,
95   unsigned int index)
96   : HauppaugePCTV1(guiObject, index)
97 {
98   setKeysetName("PCTV Keyset 1c");
99
100   addControlledDevice(Hauppauge_Make, "PVR 250", Computer_Device);
101 //  addControlledDevice(Hauppauge_Make, "PVR 350", Computer_Device);
102
103   setPreData(0x5F, 7);
104
105   addKey("blank", Unmapped_Key, 0x0C, 6);
106   addKey("full", Unmapped_Key, 0x3C, 6);
107 }
108
109
110 // Based on LIRC Sony_RM-V302-DVD010 config file
111 HauppaugePCTV2::HauppaugePCTV2(
112   QObject *guiObject,
113   unsigned int index)
114   : PIRKeysetMetaData(
115       "PCTV Keyset 2",
116       Hauppauge_Make,
117       index)
118 {
119   addControlledDevice(Hauppauge_Make, "PVR-250", Computer_Device);
120
121   threadableProtocol = new RC5Protocol(guiObject, index, 0x54);
122
123   addKey("POWER", Power_Key, 0x150C, 13);
124   addKey("1", One_Key, 0x1525, 13);
125   addKey("2", Two_Key, 0x1526, 13);
126   addKey("3", Three_Key, 0x1527, 13);
127   addKey("4", Four_Key, 0x1519, 13);
128   addKey("5", Five_Key, 0x153D, 13);
129   addKey("6", Six_Key, 0x1516, 13);
130   addKey("7", Seven_Key, 0x1517, 13);
131   addKey("8", Eight_Key, 0x1518, 13);
132   addKey("9", Nine_Key, 0x152B, 13);
133   addKey("0", Zero_Key, 0x151D, 13);
134   addKey("VOL+", VolumeUp_Key, 0x1810, 13);
135   addKey("VOL-", VolumeDown_Key, 0x1811, 13);
136   addKey("CH+", ChannelUp_Key, 0x1534, 13);
137   addKey("CH-", ChannelDown_Key, 0x1533, 13);
138   addKey("TV/VIDEO", Input_Key, 0x1500, 13);
139   addKey("DISPLAY", Info_Key, 0x1532, 13);
140   addKey("SLEEP", Sleep_Key, 0x1510, 13);
141   addKey("MUTE", Mute_Key, 0x180D, 13);
142   addKey("RECALL", PrevChannel_Key, 0x1501, 13);
143   addKey("UP", Up_Key, 0x1502, 13);
144   addKey("DOWN", Down_Key, 0x1508, 13);
145   addKey("LEFT", Left_Key, 0x1504, 13);
146   addKey("RIGHT", Right_Key, 0x1506, 13);
147   addKey("MENU", Menu_Key, 0x1503, 13);
148   addKey("OK", Enter_Key, 0x1505, 13);
149   addKey("OK", Select_Key, 0x1505, 13);
150   addKey("SEEK-", Rewind_Key, 0x1535, 13);
151   addKey("PLAY", Play_Key, 0x1530, 13);
152   addKey("SEEK+", FastForward_Key, 0x1536, 13);
153   addKey("PAUSE", Pause_Key, 0x153C, 13);
154   addKey("STOP", Stop_Key, 0x1520, 13);
155 }
156
157
158 /*
159 // Translation of DSR-0095 config file
160 HauppaugePCTV3::HauppaugePCTV3(
161   QObject *guiObject,
162   unsigned int index)
163   : PIRKeysetMetaData(
164       "PCTV Keyset 3",
165       Hauppauge_Make,
166       index)
167 {
168   RC5Protocol *rp = new RC5Protocol(
169     guiObject,
170     index,
171     900, 900,
172     900,
173     114000, true);
174
175   threadableProtocol = rp;
176
177   rp->setToggleBit(2);
178
179   rp->setPreData(0x17, 5);
180
181   addKey("home", Unmapped_Key, 0x7B, 8);
182   addKey("choice", Unmapped_Key, 0x5B, 8);
183   addKey("stop", Stop_Key, 0x77, 8);
184 }
185 */