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