Memory Management Improved
[pierogi] / keysets / mce.cpp
1 #include "mce.h"
2 #include "protocols/mceprotocol.h"
3
4 MCERemote1::MCERemote1(
5   unsigned int index)
6   : PIRKeysetMetaData(
7       "Remote mode 1",
8       Microsoft_Make,
9       index)
10 {
11   addControlledDevice(Any_Make, "ASRock HT330", Computer_Device);
12 }
13
14
15 void MCERemote1::populateProtocol(
16   QObject *guiObject)
17 {
18   if (threadableProtocol)
19   {
20     // If the pointer is not null, the keyset must already be populated.
21     return;
22   }
23
24   threadableProtocol = new MCEProtocol(guiObject, index, 0x800F);
25
26   setPreData(0x04, 7);
27
28   addKey("Zero", Zero_Key, 0x00, 8);
29   addKey("One", One_Key, 0x01, 8);
30   addKey("Two", Two_Key, 0x02, 8);
31   addKey("Three", Three_Key, 0x03, 8);
32   addKey("Four", Four_Key, 0x04, 8);
33   addKey("Five", Five_Key, 0x05, 8);
34   addKey("Six", Six_Key, 0x06, 8);
35   addKey("Seven", Seven_Key, 0x07, 8);
36   addKey("Eight", Eight_Key, 0x08, 8);
37   addKey("Nine", Nine_Key, 0x09, 8);
38   addKey("Clear", Clear_Key, 0x0A, 8);
39   addKey("Enter", Enter_Key, 0x0B, 8);
40
41   addKey("Power", Power_Key, 0x0C, 8);
42   addKey("Home", Menu_Key, 0x0D, 8);
43   addKey("Mute", Mute_Key, 0x0E, 8);
44   addKey("MoreInfo", Info_Key, 0x0F, 8);
45   addKey("VolUp", VolumeUp_Key, 0x10, 8);
46   addKey("VolDown", VolumeDown_Key, 0x11, 8);
47   addKey("ChanUp", ChannelUp_Key, 0x12, 8);
48   addKey("ChanDown", ChannelDown_Key, 0x13, 8);
49
50   addKey("Forward", FastForward_Key, 0x14, 8);
51   addKey("Rewind", Rewind_Key, 0x15, 8);
52   addKey("Play", Play_Key, 0x16, 8);
53   addKey("Record", Record_Key, 0x17, 8);
54   addKey("Pause", Pause_Key, 0x18, 8);
55   addKey("Stop", Stop_Key, 0x19, 8);
56   addKey("Skip", Advance_Key, 0x1A, 8);
57   addKey("Replay", Replay_Key, 0x1B, 8);
58
59   addKey("Hash", Unmapped_Key, 0x1C, 8); // "Caps Lock"
60   addKey("Star", Unmapped_Key, 0x1D, 8); // "Mouse"
61
62   addKey("Up", Up_Key, 0x1E, 8);
63   addKey("Down", Down_Key, 0x1F, 8);
64   addKey("Left", Left_Key, 0x20, 8);
65   addKey("Right", Right_Key, 0x21, 8);
66   addKey("OK", Select_Key, 0x22, 8);
67   addKey("Back", Exit_Key, 0x23, 8);
68   addKey("DVD", DiscMenu_Key, 0x24, 8);
69   addKey("LiveTV", LiveTV_Key, 0x25, 8);
70   addKey("Guide", Guide_Key, 0x26, 8);
71
72   addKey("Aspect", AspectRatio_Key, 0x27, 8);
73
74   addKey("Visualization", Unmapped_Key, 0x32, 8);
75   addKey("SlideShow", Unmapped_Key, 0x33, 8);
76   addKey("Eject", Eject_Key, 0x34, 8);
77
78   addKey("TV", Unmapped_Key, 0x46, 8); // "My TV"
79   addKey("Music", Unmapped_Key, 0x47, 8); // "My Music"
80   addKey("RecTV", Unmapped_Key, 0x48, 8); // "Recorded TV"
81   addKey("Pictures", Unmapped_Key, 0x49, 8); // "My Pictures"
82   addKey("Videos", Unmapped_Key, 0x4A, 8); // "My Videos"
83   addKey("DVD angle", Angle_Key, 0x4B, 8);
84   addKey("DVD audio", Audio_Key, 0x4C, 8);
85   addKey("DVD subtitle", Captions_Key, 0x4D, 8);
86
87   addKey("Print", Unmapped_Key, 0x4E, 8);
88   addKey("Radio", TunerInput_Key, 0x50, 8);
89
90   addKey("Teletext", Teletext_Key, 0x5A, 8);
91   addKey("Red", Red_Key, 0x5B, 8);
92   addKey("Green", Green_Key, 0x5C, 8);
93   addKey("Yellow", Yellow_Key, 0x5D, 8);
94   addKey("Blue", Blue_Key, 0x5E, 8);
95
96 //  addKey("PlayPause", Play_Key, 0x6E, 8);
97 //  addKey("PlayPause", Pause_Key, 0x6E, 8);
98
99   addKey("Media", Unmapped_Key, 0x80, 8); // "Write"
100 }
101
102
103 MCERemote1a::MCERemote1a(
104   unsigned int index)
105   : MCERemote1(index)
106 {
107   setKeysetName("Remote mode 2");
108 }
109
110
111 void MCERemote1a::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   MCERemote1::populateProtocol(guiObject);
121
122   setPreData(0x14, 7);
123 }
124
125
126 MCERemote1b::MCERemote1b(
127   unsigned int index)
128   : MCERemote1(index)
129 {
130   setKeysetName("Remote mode 3");
131 }
132
133
134 void MCERemote1b::populateProtocol(
135   QObject *guiObject)
136 {
137   if (threadableProtocol)
138   {
139     // If the pointer is not null, the keyset must already be populated.
140     return;
141   }
142
143   MCERemote1::populateProtocol(guiObject);
144
145   setPreData(0x24, 7);
146 }
147
148
149 MCERemote1c::MCERemote1c(
150   unsigned int index)
151   : MCERemote1(index)
152 {
153   setKeysetName("Remote mode 4");
154 }
155
156
157 void MCERemote1c::populateProtocol(
158   QObject *guiObject)
159 {
160   if (threadableProtocol)
161   {
162     // If the pointer is not null, the keyset must already be populated.
163     return;
164   }
165
166   MCERemote1::populateProtocol(guiObject);
167
168   setPreData(0x34, 7);
169 }
170
171
172 MCERemote1d::MCERemote1d(
173   unsigned int index)
174   : MCERemote1(index)
175 {
176   setKeysetName("Remote mode 5");
177 }
178
179
180 void MCERemote1d::populateProtocol(
181   QObject *guiObject)
182 {
183   if (threadableProtocol)
184   {
185     // If the pointer is not null, the keyset must already be populated.
186     return;
187   }
188
189   MCERemote1::populateProtocol(guiObject);
190
191   setPreData(0x44, 7);
192 }
193
194
195 MCERemote1e::MCERemote1e(
196   unsigned int index)
197   : MCERemote1(index)
198 {
199   setKeysetName("Remote mode 6");
200 }
201
202
203 void MCERemote1e::populateProtocol(
204   QObject *guiObject)
205 {
206   if (threadableProtocol)
207   {
208     // If the pointer is not null, the keyset must already be populated.
209     return;
210   }
211
212   MCERemote1::populateProtocol(guiObject);
213
214   setPreData(0x54, 7);
215 }
216
217
218 MCERemote1f::MCERemote1f(
219   unsigned int index)
220   : MCERemote1(index)
221 {
222   setKeysetName("Remote mode 7");
223 }
224
225
226 void MCERemote1f::populateProtocol(
227   QObject *guiObject)
228 {
229   if (threadableProtocol)
230   {
231     // If the pointer is not null, the keyset must already be populated.
232     return;
233   }
234
235   MCERemote1::populateProtocol(guiObject);
236
237   setPreData(0x64, 7);
238 }
239
240
241 MCERemote1g::MCERemote1g(
242   unsigned int index)
243   : MCERemote1(index)
244 {
245   setKeysetName("Remote mode 8");
246 }
247
248
249 void MCERemote1g::populateProtocol(
250   QObject *guiObject)
251 {
252   if (threadableProtocol)
253   {
254     // If the pointer is not null, the keyset must already be populated.
255     return;
256   }
257
258   MCERemote1::populateProtocol(guiObject);
259
260   setPreData(0x74, 7);
261 }