Log In
New Account
  
Home My Page Project Cloud Code Snippets Project Openings Pierogi
Summary Forums Tracker Lists Tasks Docs News SCM Files
1 #include "pirkeysetmanager.h"
3 #include "pirkeysetmetadata.h"
4 #include "pirselectkeysetform.h"
5 #include "pirkeysetwidgetitem.h"
7 #include "keysets/acer.h"
8 #include "keysets/admiral.h"
9 #include "keysets/aiwa.h"
10 #include "keysets/apple.h"
11 #include "keysets/beko.h"
12 #include "keysets/bose.h"
13 #include "keysets/cambridge.h"
14 #include "keysets/daewoo.h"
15 #include "keysets/denon.h"
16 #include "keysets/digitalstream.h"
17 #include "keysets/dish.h"
18 #include "keysets/ei.h"
19 #include "keysets/elgato.h"
20 #include "keysets/emerson.h"
21 #include "keysets/fortec.h"
22 #include "keysets/goldstar.h"
23 #include "keysets/grundig.h"
24 #include "keysets/haier.h"
25 #include "keysets/hauppauge.h"
26 #include "keysets/hitachi.h"
27 #include "keysets/homecast.h"
28 #include "keysets/jvc.h"
29 #include "keysets/kenwood.h"
30 #include "keysets/lg.h"
31 #include "keysets/logitech.h"
32 #include "keysets/magnavox.h"
33 #include "keysets/mce.h"
34 #include "keysets/mitsubishi.h"
35 #include "keysets/nokia.h"
36 #include "keysets/panasonic.h"
37 #include "keysets/philco.h"
38 #include "keysets/philips.h"
39 #include "keysets/pinnacle.h"
40 #include "keysets/pioneer.h"
41 #include "keysets/raite.h"
42 #include "keysets/rca.h"
43 #include "keysets/roku.h"
44 #include "keysets/saba.h"
45 #include "keysets/sagem.h"
46 #include "keysets/samsung.h"
47 #include "keysets/sanyo.h"
48 #include "keysets/sharp.h"
49 #include "keysets/sky.h"
50 #include "keysets/sony.h"
51 #include "keysets/tivo.h"
52 #include "keysets/topfield.h"
53 #include "keysets/toshiba.h"
54 #include "keysets/wd.h"
55 #include "keysets/westinghouse.h"
56 #include "keysets/yamaha.h"
57 #include "keysets/zenith.h"
59 #include "pirexception.h"
61 // I'll be handling the threading of the keyset commands in this object:
62 #include <QMutex>
64 // Global communications mechanism:
65 extern bool stopRepeatingFlag;
66 extern QMutex stopRepeatingMutex;
68 // Global helper objects:
69 PIRMakeMgr makeManager;
70 PIRDeviceTypeMgr deviceManager;
72 // Now, on to the actual method definitions:
74 PIRKeysetManager::PIRKeysetManager(
75   QObject *guiObject)
76   : counter(0)
77 {
78   // Create the keysets.  Ugly!  This needs to be worked on!
79   populateKeyset(new AcerTV1(guiObject, counter++));
80   populateKeyset(new AcerPC1(guiObject, counter++));
82   populateKeyset(new AdmiralTV1(guiObject, counter++));
83   populateKeyset(new AdmiralTV2(guiObject, counter++));
84   populateKeyset(new AdmiralVCR1(guiObject, counter++));
86   populateKeyset(new AiwaVCR1(guiObject, counter++));
87   populateKeyset(new AiwaVCR2(guiObject, counter++));
88   populateKeyset(new AiwaVCR3(guiObject, counter++));
89   populateKeyset(new AiwaAudio1(guiObject, counter++));
90   populateKeyset(new AiwaAudio1a(guiObject, counter++));
91   populateKeyset(new AiwaAudio2(guiObject, counter++));
92   populateKeyset(new AiwaAudio2a(guiObject, counter++));
93   populateKeyset(new AiwaAudio2b(guiObject, counter++));
94   populateKeyset(new AiwaAudio2c(guiObject, counter++));
95   populateKeyset(new AiwaAudio3(guiObject, counter++));
96   populateKeyset(new AiwaAudio4(guiObject, counter++));
97   populateKeyset(new AiwaAudio5(guiObject, counter++));
98   populateKeyset(new AiwaAudio6(guiObject, counter++));
99   populateKeyset(new AiwaCarStereo1(guiObject, counter++));
100   populateKeyset(new AiwaDVD1(guiObject, counter++));
102   populateKeyset(new AppleWhiteRemote(guiObject, counter++));
104   populateKeyset(new BekoTV1(guiObject, counter++));
106   populateKeyset(new BoseRadio1(guiObject, counter++));
107   populateKeyset(new BoseRadio2(guiObject, counter++));
108   populateKeyset(new BoseRadio3(guiObject, counter++));
110   populateKeyset(new CambridgeCD1(guiObject, counter++));
111   populateKeyset(new CambridgeAudio1(guiObject, counter++));
112   populateKeyset(new CambridgeAudio2(guiObject, counter++));
113   populateKeyset(new CambridgeAudio3(guiObject, counter++));
114   populateKeyset(new CambridgeDVD1(guiObject, counter++));
116   populateKeyset(new DaewooTV1(guiObject, counter++));
117   populateKeyset(new DaewooTV2(guiObject, counter++));
118   populateKeyset(new DaewooTV3(guiObject, counter++));
119   populateKeyset(new DaewooTV4(guiObject, counter++));
120   populateKeyset(new DaewooDVD1(guiObject, counter++));
121   populateKeyset(new DaewooVCR1(guiObject, counter++));
122   populateKeyset(new DaewooVCR2(guiObject, counter++));
124   populateKeyset(new DenonDVD1(guiObject, counter++));
125   populateKeyset(new DenonDVD2(guiObject, counter++));
126   populateKeyset(new DenonDVD3(guiObject, counter++));
127   populateKeyset(new DenonReceiver1(guiObject, counter++));
128   populateKeyset(new DenonReceiver1a(guiObject, counter++));
129   populateKeyset(new DenonReceiver1b(guiObject, counter++));
130   populateKeyset(new DenonReceiver1c(guiObject, counter++));
131   populateKeyset(new DenonReceiver1d(guiObject, counter++));
132   populateKeyset(new DenonReceiver1e(guiObject, counter++));
133   populateKeyset(new DenonReceiver1f(guiObject, counter++));
134   populateKeyset(new DenonReceiver2(guiObject, counter++));
135   populateKeyset(new DenonReceiver2a(guiObject, counter++));
136   populateKeyset(new DenonReceiver3(guiObject, counter++));
137   populateKeyset(new DenonAudio1(guiObject, counter++));
138   populateKeyset(new DenonAudio1a(guiObject, counter++));
139   populateKeyset(new DenonAudio1b(guiObject, counter++));
140   populateKeyset(new DenonAudio1c(guiObject, counter++));
141   populateKeyset(new DenonAudio1d(guiObject, counter++));
142   populateKeyset(new DenonAudio2(guiObject, counter++));
143   populateKeyset(new DenonAudio3(guiObject, counter++));
144   populateKeyset(new DenonAudio4(guiObject, counter++));
146   populateKeyset(new DigitalStreamReceiver(guiObject, counter++));
148   populateKeyset(new DishReceiver1(guiObject, counter++));
149   populateKeyset(new DishReceiver1a(guiObject, counter++));
150   populateKeyset(new DishReceiver1b(guiObject, counter++));
151   populateKeyset(new DishReceiver1c(guiObject, counter++));
152   populateKeyset(new DishReceiver1d(guiObject, counter++));
153   populateKeyset(new DishReceiver1e(guiObject, counter++));
154   populateKeyset(new DishReceiver1f(guiObject, counter++));
155   populateKeyset(new DishReceiver1g(guiObject, counter++));
156   populateKeyset(new DishReceiver1h(guiObject, counter++));
157   populateKeyset(new DishReceiver1i(guiObject, counter++));
158   populateKeyset(new DishReceiver1j(guiObject, counter++));
159   populateKeyset(new DishReceiver1k(guiObject, counter++));
160   populateKeyset(new DishReceiver1l(guiObject, counter++));
161   populateKeyset(new DishReceiver1m(guiObject, counter++));
162   populateKeyset(new DishReceiver1n(guiObject, counter++));
163   populateKeyset(new DishReceiver1o(guiObject, counter++));
165   populateKeyset(new EiTV1(guiObject, counter++));
167   populateKeyset(new ElgatoEyeTV1(guiObject, counter++));
169   populateKeyset(new EmersonTV1(guiObject, counter++));
170   populateKeyset(new EmersonDVD1(guiObject, counter++));
172   populateKeyset(new FortecReceiver1(guiObject, counter++));
173   populateKeyset(new FortecReceiver2(guiObject, counter++));
175   populateKeyset(new GoldStarTV1(guiObject, counter++));
176   populateKeyset(new GoldStarTV2(guiObject, counter++));
177   populateKeyset(new GoldStarVCR1(guiObject, counter++));
178   populateKeyset(new GoldStarVCR1a(guiObject, counter++));
179   populateKeyset(new GoldStarVCR1b(guiObject, counter++));
180   populateKeyset(new GoldStarVCR1c(guiObject, counter++));
181   populateKeyset(new GoldStarCD1(guiObject, counter++));
183   populateKeyset(new GrundigSat1(guiObject, counter++));
184   populateKeyset(new GrundigSat2(guiObject, counter++));
185   populateKeyset(new GrundigAmp1(guiObject, counter++));
186   populateKeyset(new GrundigAudio1(guiObject, counter++));
187   populateKeyset(new GrundigAudio2(guiObject, counter++));
188   populateKeyset(new GrundigVCR1(guiObject, counter++));
189   populateKeyset(new GrundigVCR1a(guiObject, counter++));
190   populateKeyset(new GrundigTV1(guiObject, counter++));
191   populateKeyset(new GrundigTV2(guiObject, counter++));
192   populateKeyset(new GrundigTV3(guiObject, counter++));
193   populateKeyset(new GrundigDVD1(guiObject, counter++));
195   populateKeyset(new HaierTV1(guiObject, counter++));
197   populateKeyset(new HauppaugePCTV1(guiObject, counter++));
198   populateKeyset(new HauppaugePCTV1a(guiObject, counter++));
199   populateKeyset(new HauppaugePCTV1b(guiObject, counter++));
200   populateKeyset(new HauppaugePCTV1c(guiObject, counter++));
201   populateKeyset(new HauppaugePCTV2(guiObject, counter++));
203   populateKeyset(new HitachiTV1(guiObject, counter++));
204   populateKeyset(new HitachiTV1a(guiObject, counter++));
205   populateKeyset(new HitachiTV1b(guiObject, counter++));
206   populateKeyset(new HitachiTV1c(guiObject, counter++));
207   populateKeyset(new HitachiTV2(guiObject, counter++));
208   populateKeyset(new HitachiTV3(guiObject, counter++));
209   populateKeyset(new HitachiProjector(guiObject, counter++));
210   populateKeyset(new HitachiDVD1(guiObject, counter++));
211   populateKeyset(new HitachiAudio1(guiObject, counter++));
212   populateKeyset(new HitachiVCR1(guiObject, counter++));
214   populateKeyset(new HomecastReceiver1(guiObject, counter++));
215   populateKeyset(new HomecastReceiver2(guiObject, counter++));
217   populateKeyset(new JVCSat1(guiObject, counter++));
218   populateKeyset(new JVCSat2(guiObject, counter++));
219   populateKeyset(new JVCVCR1(guiObject, counter++));
220   populateKeyset(new JVCVCR1a(guiObject, counter++));
221   populateKeyset(new JVCVCRBmode1(guiObject, counter++));
222   populateKeyset(new JVCVCRBmode1a(guiObject, counter++));
223   populateKeyset(new JVCTV1(guiObject, counter++));
224   populateKeyset(new JVCTV1a(guiObject, counter++));
225   populateKeyset(new JVCTV1b(guiObject, counter++));
226   populateKeyset(new JVCTV1c(guiObject, counter++));
227   populateKeyset(new JVCTV1d(guiObject, counter++));
228   populateKeyset(new JVCDAT1(guiObject, counter++));
229   populateKeyset(new JVCCarDeck1(guiObject, counter++));
230   populateKeyset(new JVCAudio1(guiObject, counter++));
231   populateKeyset(new JVCAudio1a(guiObject, counter++));
232   populateKeyset(new JVCAudio1b(guiObject, counter++));
233   populateKeyset(new JVCAudio2(guiObject, counter++));
234   populateKeyset(new JVCDVD1(guiObject, counter++));
236   populateKeyset(new KenwoodAudio1(guiObject, counter++));
237   populateKeyset(new KenwoodComponent1(guiObject, counter++));
238   populateKeyset(new KenwoodComponent2(guiObject, counter++));
239   populateKeyset(new KenwoodComponent3(guiObject, counter++));
240   populateKeyset(new KenwoodCD1(guiObject, counter++));
241   populateKeyset(new KenwoodDVD1(guiObject, counter++));
242   populateKeyset(new KenwoodTV1(guiObject, counter++));
244   populateKeyset(new LGTV1(guiObject, counter++));
245   populateKeyset(new LGTV1a(guiObject, counter++));
246   populateKeyset(new LGTV1b(guiObject, counter++));
247   populateKeyset(new LGTV1c(guiObject, counter++));
248   populateKeyset(new LGTV2(guiObject, counter++));
249   populateKeyset(new LGTV2a(guiObject, counter++));
250   populateKeyset(new LGTV2b(guiObject, counter++));
251   populateKeyset(new LGDisc1(guiObject, counter++));
252   populateKeyset(new LGDisc2(guiObject, counter++));
253   populateKeyset(new LGDisc2a(guiObject, counter++));
254   populateKeyset(new LGVCR1(guiObject, counter++));
255   populateKeyset(new LGVCR1a(guiObject, counter++));
256   populateKeyset(new LGVCR1b(guiObject, counter++));
257   populateKeyset(new LGAC1(guiObject, counter++));
259   populateKeyset(new LogitechSpeakers(guiObject, counter++));
261   populateKeyset(new MagnavoxDVD1(guiObject, counter++));
262   populateKeyset(new MagnavoxVCR1(guiObject, counter++));
263   populateKeyset(new MagnavoxConverterBox1(guiObject, counter++));
264   populateKeyset(new MagnavoxTV1(guiObject, counter++));
266   populateKeyset(new MCERemote1(guiObject, counter++));
267   populateKeyset(new MCERemote1a(guiObject, counter++));
268   populateKeyset(new MCERemote1b(guiObject, counter++));
269   populateKeyset(new MCERemote1c(guiObject, counter++));
270   populateKeyset(new MCERemote1d(guiObject, counter++));
271   populateKeyset(new MCERemote1e(guiObject, counter++));
272   populateKeyset(new MCERemote1f(guiObject, counter++));
273   populateKeyset(new MCERemote1g(guiObject, counter++));
275   populateKeyset(new MitsubishiTV1(guiObject, counter++));
276   populateKeyset(new MitsubishiTV1a(guiObject, counter++));
277   populateKeyset(new MitsubishiVCR1(guiObject, counter++));
278   populateKeyset(new MitsubishiVCR1a(guiObject, counter++));
280   populateKeyset(new NokiaGenericVCR(guiObject, counter++));
282   populateKeyset(new PanasonicCarAudio(guiObject, counter++));
283   populateKeyset(new PanasonicSat1(guiObject, counter++));
284   populateKeyset(new PanasonicSat1a(guiObject, counter++));
285   populateKeyset(new PanasonicTV1(guiObject, counter++));
286   populateKeyset(new PanasonicTV1a(guiObject, counter++));
287   populateKeyset(new PanasonicTV1b(guiObject, counter++));
288   populateKeyset(new PanasonicVCR1(guiObject, counter++));
289   populateKeyset(new PanasonicVCR1a(guiObject, counter++));
290   populateKeyset(new PanasonicVCR1b(guiObject, counter++));
291   populateKeyset(new PanasonicVCR1c(guiObject, counter++));
292   populateKeyset(new PanasonicDVD1(guiObject, counter++));
293   populateKeyset(new PanasonicDVD1a(guiObject, counter++));
294   populateKeyset(new PanasonicAudio1(guiObject, counter++));
295   populateKeyset(new PanasonicAC1(guiObject, counter++));
297   populateKeyset(new PhilcoTV(guiObject, counter++));
299   populateKeyset(new PhilipsTV1(guiObject, counter++));
300   populateKeyset(new PhilipsTV1a(guiObject, counter++));
301   populateKeyset(new PhilipsTV1b(guiObject, counter++));
302   populateKeyset(new PhilipsTV1c(guiObject, counter++));
303   populateKeyset(new PhilipsTV1d(guiObject, counter++));
304   populateKeyset(new PhilipsTV1e(guiObject, counter++));
305   populateKeyset(new PhilipsTV1f(guiObject, counter++));
306   populateKeyset(new PhilipsTV2(guiObject, counter++));
307   populateKeyset(new PhilipsTV2a(guiObject, counter++));
308   populateKeyset(new PhilipsTV2b(guiObject, counter++));
309   populateKeyset(new PhilipsTV3(guiObject, counter++));
310   populateKeyset(new PhilipsDVD1(guiObject, counter++));
311   populateKeyset(new PhilipsDVD1a(guiObject, counter++));
312   populateKeyset(new PhilipsDVD1b(guiObject, counter++));
313   populateKeyset(new PhilipsDVD1c(guiObject, counter++));
314   populateKeyset(new PhilipsDVD1d(guiObject, counter++));
315   populateKeyset(new PhilipsDVD2(guiObject, counter++));
316   populateKeyset(new PhilipsDVD3(guiObject, counter++));
317   populateKeyset(new PhilipsDVD3a(guiObject, counter++));
318   populateKeyset(new PhilipsDVD4(guiObject, counter++));
319   populateKeyset(new PhilipsVCR1(guiObject, counter++));
320   populateKeyset(new PhilipsVCR1a(guiObject, counter++));
321   populateKeyset(new PhilipsVCR1b(guiObject, counter++));
322   populateKeyset(new PhilipsVCR1c(guiObject, counter++));
323   populateKeyset(new PhilipsSat1(guiObject, counter++));
324   populateKeyset(new PhilipsSat2(guiObject, counter++));
325   populateKeyset(new PhilipsSat2a(guiObject, counter++));
326   populateKeyset(new PhilipsSat3(guiObject, counter++));
327   populateKeyset(new PhilipsAudio1(guiObject, counter++));
328   populateKeyset(new PhilipsAudio1a(guiObject, counter++));
329   populateKeyset(new PhilipsAudio1b(guiObject, counter++));
330   populateKeyset(new PhilipsAudio2(guiObject, counter++));
331   populateKeyset(new PhilipsAudio3(guiObject, counter++));
332   populateKeyset(new PhilipsAudio4(guiObject, counter++));
334   populateKeyset(new PinnaclePCTV1(guiObject, counter++));
335   populateKeyset(new PinnaclePCTV2(guiObject, counter++));
336   populateKeyset(new PinnaclePCTV3(guiObject, counter++));
338   populateKeyset(new PioneerTV1(guiObject, counter++));
339   populateKeyset(new PioneerTV2(guiObject, counter++));
340   populateKeyset(new PioneerTV3(guiObject, counter++));
341   populateKeyset(new PioneerAudio1(guiObject, counter++));
342   populateKeyset(new PioneerAudio1a(guiObject, counter++));
343   populateKeyset(new PioneerAudio2(guiObject, counter++));
344   populateKeyset(new PioneerAudio3(guiObject, counter++));
345   populateKeyset(new PioneerAudio4(guiObject, counter++));
346   populateKeyset(new PioneerAudio5(guiObject, counter++));
347   populateKeyset(new PioneerCD1(guiObject, counter++));
348   populateKeyset(new PioneerLaserDisc1(guiObject, counter++));
349   populateKeyset(new PioneerDVD1(guiObject, counter++));
351   populateKeyset(new RaiteDVD1(guiObject, counter++));
353   populateKeyset(new RCATV1(guiObject, counter++));
354   populateKeyset(new RCATV1a(guiObject, counter++));
355   populateKeyset(new RCATV1b(guiObject, counter++));
356 /*
357   populateKeyset(new RCAAux1(guiObject, counter++));
358   populateKeyset(new RCAAux2(guiObject, counter++));
359   populateKeyset(new RCAAux2a(guiObject, counter++));
360 */
361   populateKeyset(new RCAVCR1(guiObject, counter++));
362   populateKeyset(new RCAVCR1a(guiObject, counter++));
363   populateKeyset(new RCADVD1(guiObject, counter++));
364   populateKeyset(new RCADVD1a(guiObject, counter++));
365   populateKeyset(new RCASat1(guiObject, counter++));
366   populateKeyset(new RCASat2(guiObject, counter++));
368   populateKeyset(new RokuBox1(guiObject, counter++));
369   populateKeyset(new RokuBox2(guiObject, counter++));
371   populateKeyset(new SabaTV1(guiObject, counter++));
372   populateKeyset(new SabaTV2(guiObject, counter++));
374   populateKeyset(new SagemTVBox1(guiObject, counter++));
375   populateKeyset(new SagemTVBox1a(guiObject, counter++));
377   populateKeyset(new SamsungTV1(guiObject, counter++));
378   populateKeyset(new SamsungTV1a(guiObject, counter++));
379   populateKeyset(new SamsungTV1b(guiObject, counter++));
380   populateKeyset(new SamsungTV1c(guiObject, counter++));
381   populateKeyset(new SamsungTV1d(guiObject, counter++));
382   populateKeyset(new SamsungTV1e(guiObject, counter++));
383   populateKeyset(new SamsungTV1f(guiObject, counter++));
384   populateKeyset(new SamsungTV2(guiObject, counter++));
385   populateKeyset(new SamsungTV2a(guiObject, counter++));
386   populateKeyset(new SamsungVCR1(guiObject, counter++));
387   populateKeyset(new SamsungVCR1a(guiObject, counter++));
388   populateKeyset(new SamsungVCR1b(guiObject, counter++));
389   populateKeyset(new SamsungVCR1c(guiObject, counter++));
390   populateKeyset(new SamsungVCR1d(guiObject, counter++));
391   populateKeyset(new SamsungVCR1e(guiObject, counter++));
392   populateKeyset(new SamsungDVD1(guiObject, counter++));
393   populateKeyset(new SamsungDVD1a(guiObject, counter++));
394   populateKeyset(new SamsungDVD1b(guiObject, counter++));
395   populateKeyset(new SamsungDVD2(guiObject, counter++));
396   populateKeyset(new SamsungAC1(guiObject, counter++));
398   populateKeyset(new SanyoVCR1(guiObject, counter++));
399   populateKeyset(new SanyoDVD1(guiObject, counter++));
400   populateKeyset(new SanyoTV1(guiObject, counter++));
401   populateKeyset(new SanyoTV1a(guiObject, counter++));
402   populateKeyset(new SanyoTV1b(guiObject, counter++));
403   populateKeyset(new SanyoTV1c(guiObject, counter++));
404   populateKeyset(new SanyoTV1d(guiObject, counter++));
405   populateKeyset(new SanyoProjector(guiObject, counter++));
407   populateKeyset(new SharpTV1(guiObject, counter++));
408   populateKeyset(new SharpTV1a(guiObject, counter++));
409   populateKeyset(new SharpTV1b(guiObject, counter++));
410   populateKeyset(new SharpTV1c(guiObject, counter++));
411   populateKeyset(new SharpTV1d(guiObject, counter++));
412   populateKeyset(new SharpTV1e(guiObject, counter++));
413   populateKeyset(new SharpVCR1(guiObject, counter++));
414   populateKeyset(new SharpReceiver1(guiObject, counter++));
416   populateKeyset(new SkyReceiver1(guiObject, counter++));
417   populateKeyset(new SkyReceiver1a(guiObject, counter++));
419   populateKeyset(new SonyTV1(guiObject, counter++));
420   populateKeyset(new SonyTV1a(guiObject, counter++));
421   populateKeyset(new SonyTV1b(guiObject, counter++));
422   populateKeyset(new SonyTV1c(guiObject, counter++));
423   populateKeyset(new SonyAmp1(guiObject, counter++));
424   populateKeyset(new SonyAmp2(guiObject, counter++));
425   populateKeyset(new SonyAudio1(guiObject, counter++));
426   populateKeyset(new SonyAudio1a(guiObject, counter++));
427   populateKeyset(new SonyDAT1(guiObject, counter++));
428   populateKeyset(new SonyDVD1(guiObject, counter++));
429   populateKeyset(new SonyDVD1a(guiObject, counter++));
430   populateKeyset(new SonyDVD1b(guiObject, counter++));
431   populateKeyset(new SonyDVD1c(guiObject, counter++));
432   populateKeyset(new SonyVCR1(guiObject, counter++));
433   populateKeyset(new SonyVCR1a(guiObject, counter++));
434   populateKeyset(new SonyVCR1b(guiObject, counter++));
435   populateKeyset(new SonyReceiver1(guiObject, counter++));
437   populateKeyset(new Tivo1(guiObject, counter++));
438   populateKeyset(new Tivo1a(guiObject, counter++));
439   populateKeyset(new Tivo1b(guiObject, counter++));
440   populateKeyset(new Tivo1c(guiObject, counter++));
441   populateKeyset(new Tivo1d(guiObject, counter++));
443   populateKeyset(new TopfieldPVR1(guiObject, counter++));
444   populateKeyset(new TopfieldSat1(guiObject, counter++));
446   populateKeyset(new ToshibaTV1(guiObject, counter++));
447   populateKeyset(new ToshibaTV1a(guiObject, counter++));
448   populateKeyset(new ToshibaTV1b(guiObject, counter++));
449   populateKeyset(new ToshibaTV1c(guiObject, counter++));
450   populateKeyset(new ToshibaTV1d(guiObject, counter++));
451   populateKeyset(new ToshibaTV1e(guiObject, counter++));
452   populateKeyset(new ToshibaTV1f(guiObject, counter++));
453   populateKeyset(new ToshibaTV1g(guiObject, counter++));
454   populateKeyset(new ToshibaTV1h(guiObject, counter++));
455   populateKeyset(new ToshibaVCR1(guiObject, counter++));
456   populateKeyset(new ToshibaVCR1a(guiObject, counter++));
457   populateKeyset(new ToshibaDisc1(guiObject, counter++));
458   populateKeyset(new ToshibaDisc1a(guiObject, counter++));
459   populateKeyset(new ToshibaDisc1b(guiObject, counter++));
460   populateKeyset(new ToshibaDisc1c(guiObject, counter++));
461   populateKeyset(new ToshibaDisc1d(guiObject, counter++));
463   populateKeyset(new WDMediaPlayer1(guiObject, counter++));
464   populateKeyset(new WDMediaPlayer1a(guiObject, counter++));
466   populateKeyset(new WestinghouseTV1(guiObject, counter++));
467   populateKeyset(new WestinghouseTV2(guiObject, counter++));
469   populateKeyset(new YamahaDVD1(guiObject, counter++));
470   populateKeyset(new YamahaDVD1a(guiObject, counter++));
471   populateKeyset(new YamahaAudio1(guiObject, counter++));
472   populateKeyset(new YamahaAudio1a(guiObject, counter++));
473   populateKeyset(new YamahaAudio2(guiObject, counter++));
474   populateKeyset(new YamahaAudio2a(guiObject, counter++));
475   populateKeyset(new YamahaAudio2b(guiObject, counter++));
476   populateKeyset(new YamahaAudio2c(guiObject, counter++));
477   populateKeyset(new YamahaAudio2d(guiObject, counter++));
478   populateKeyset(new YamahaAudio3(guiObject, counter++));
479   populateKeyset(new YamahaAudio4(guiObject, counter++));
480   populateKeyset(new YamahaTV1(guiObject, counter++));
481   populateKeyset(new YamahaKaraoke1(guiObject, counter++));
483   populateKeyset(new ZenithC32V37(guiObject, counter++));
485   // Start the thread running:
486   commandThread.start();
490 PIRKeysetManager::~PIRKeysetManager()
492   // Tell the keysets to stop doing any work:
493   {
494     QMutexLocker locker(&stopRepeatingMutex);
495     stopRepeatingFlag = true;
496   }
498   // Tell the thread that we want it to stop:
499   commandThread.exit();
501   // Wait for the thread to stop:
502   commandThread.wait();
504   // Delete all the keysets:
505   PIRKeysetCollection::iterator i = keysetsInfo.begin();
506   while (i != keysetsInfo.end())
507   {
508     if ((*i).second) delete (*i).second;
509     ++i;
510   }
514 bool PIRKeysetManager::keysetExists(
515   unsigned int keysetID) const
517   PIRKeysetCollection::const_iterator i = keysetsInfo.find(keysetID);
519   return (i != keysetsInfo.end());
523 bool PIRKeysetManager::findKeysetID(
524   QString make,
525   QString name,
526   unsigned int &id) const
528   // Only modify the id if we actually find a match!
530   PIRKeysetMakeIndex::const_iterator i = makeIndex.find(make);
531   if (i == makeIndex.end())
532   {
533     return false;
534   }
536   PIRKeysetNameIndex::const_iterator ii = (*i).second.find(name);
537   if (ii == (*i).second.end())
538   {
539     return false;
540   }
542   //  Ok, we've found it, pull out the id:
543   id = (*ii).second;
544   return true;
548 PIRKeysetWidgetItem *PIRKeysetManager::makeKeysetItem(
549   QString make,
550   QString name) const
552   unsigned int id;
554   if (!findKeysetID(make, name, id))
555   {
556     return NULL;
557   }
559   QString fullname = make;
560   fullname.append(" ");
561   fullname.append(name);
563   return new PIRKeysetWidgetItem(fullname, id, getMake(id));
567 bool PIRKeysetManager::hasKey(
568   unsigned int keysetID,
569   PIRKeyName name) const
571   PIRKeysetCollection::const_iterator i = keysetsInfo.find(keysetID);
573   if ((i == keysetsInfo.end()) || !i->second) return false;
575   return i->second->hasKey(name);
579 PIRMakeName PIRKeysetManager::getMake(
580   unsigned int keysetID) const
582   PIRKeysetCollection::const_iterator i = keysetsInfo.find(keysetID);
584   if ((i == keysetsInfo.end()) || !i->second) return Any_Make;
586   return i->second->getMake();
590 QString PIRKeysetManager::getDisplayName(
591   unsigned int keysetID) const
593   PIRKeysetCollection::const_iterator i = keysetsInfo.find(keysetID);
595   if ((i == keysetsInfo.end()) || !i->second)
596     return QString("Database Error");
598   return QString(i->second->getKeysetName());
602 void PIRKeysetManager::populateKeyset(
603   PIRKeysetMetaData *keyset)
605   // Set up the keyset collection:
606   keysetsInfo[keyset->getID()] = keyset;
608   keyset->moveProtocolToThread(&commandThread);
610   // Also, set up a name-based index into the collection:
611   makeIndex
612     [QString(makeManager.getMakeString(keyset->getMake()))]
613     [QString(keyset->getKeysetName())]
614     = keyset->getID();
618 void PIRKeysetManager::populateGuiWidget(
619   PIRSelectKeysetForm *skf) const
621   PIRMakeName make;
622   PIRKeysetWidgetItem *kwi;
624   PIRKeysetCollection::const_iterator i = keysetsInfo.begin();
626   while (i != keysetsInfo.end())
627   {
628     make = i->second->getMake();
629     QString tempString = makeManager.getMakeString(make);
630     tempString.append(" ");
631     tempString.append(i->second->getKeysetName());
632     kwi = new PIRKeysetWidgetItem(tempString, i->first, make);
633     i->second->populateDeviceTypes(kwi);
634     skf->addWidgetItem(kwi);
635     ++i;
636   }
640 void PIRKeysetManager::populateDeviceTypes(
641   PIRKeysetWidgetItem *kwi,
642   unsigned int keysetID) const
644   PIRKeysetCollection::const_iterator i = keysetsInfo.find(keysetID);
645   if ((i != keysetsInfo.end()) && i->second)
646   {
647     i->second->populateDeviceTypes(kwi);
648   }

Terms of Use    Privacy Policy    Contribution Guidelines    Feedback

Powered By GForge Collaborative Development Environment