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