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