#include "pirkeysetmanager.h"
+
#include "pirkeysetmetadata.h"
+#include "pirselectkeysetform.h"
+#include "pirkeysetwidgetitem.h"
+
+#include "keysets/acer.h"
+#include "keysets/admiral.h"
+#include "keysets/aiwa.h"
#include "keysets/apple.h"
+#include "keysets/beko.h"
+#include "keysets/bose.h"
+#include "keysets/cambridge.h"
+#include "keysets/daewoo.h"
#include "keysets/denon.h"
+#include "keysets/digitalstream.h"
+#include "keysets/dish.h"
#include "keysets/ei.h"
#include "keysets/elgato.h"
+#include "keysets/emerson.h"
+#include "keysets/fortec.h"
#include "keysets/goldstar.h"
+#include "keysets/grundig.h"
+#include "keysets/haier.h"
#include "keysets/hauppauge.h"
#include "keysets/hitachi.h"
+#include "keysets/homecast.h"
#include "keysets/jvc.h"
+#include "keysets/kenwood.h"
#include "keysets/lg.h"
+#include "keysets/logitech.h"
#include "keysets/magnavox.h"
+#include "keysets/mce.h"
#include "keysets/mitsubishi.h"
#include "keysets/nokia.h"
#include "keysets/panasonic.h"
+#include "keysets/philco.h"
#include "keysets/philips.h"
#include "keysets/pinnacle.h"
+#include "keysets/pioneer.h"
#include "keysets/raite.h"
#include "keysets/rca.h"
+#include "keysets/roku.h"
+#include "keysets/saba.h"
#include "keysets/sagem.h"
#include "keysets/samsung.h"
#include "keysets/sanyo.h"
#include "keysets/sharp.h"
+#include "keysets/sky.h"
#include "keysets/sony.h"
#include "keysets/tivo.h"
+#include "keysets/topfield.h"
#include "keysets/toshiba.h"
+#include "keysets/wd.h"
#include "keysets/westinghouse.h"
#include "keysets/yamaha.h"
#include "keysets/zenith.h"
-#include "pirmakenames.h"
#include "pirexception.h"
-#include <QObject>
-
// I'll be handling the threading of the keyset commands in this object:
#include <QMutex>
: counter(0)
{
// Create the keysets. Ugly! This needs to be worked on!
+ populateKeyset(new AcerTV1(guiObject, counter++));
+ populateKeyset(new AcerPC1(guiObject, counter++));
+
+ populateKeyset(new AdmiralTV1(guiObject, counter++));
+ populateKeyset(new AdmiralTV2(guiObject, counter++));
+ populateKeyset(new AdmiralVCR1(guiObject, counter++));
+
+ populateKeyset(new AiwaVCR1(guiObject, counter++));
+ populateKeyset(new AiwaVCR2(guiObject, counter++));
+ populateKeyset(new AiwaVCR3(guiObject, counter++));
+ populateKeyset(new AiwaAudio1(guiObject, counter++));
+ populateKeyset(new AiwaAudio1a(guiObject, counter++));
+ populateKeyset(new AiwaAudio2(guiObject, counter++));
+ populateKeyset(new AiwaAudio2a(guiObject, counter++));
+ populateKeyset(new AiwaAudio2b(guiObject, counter++));
+ populateKeyset(new AiwaAudio2c(guiObject, counter++));
+ populateKeyset(new AiwaAudio3(guiObject, counter++));
+ populateKeyset(new AiwaAudio4(guiObject, counter++));
+ populateKeyset(new AiwaAudio5(guiObject, counter++));
+ populateKeyset(new AiwaAudio6(guiObject, counter++));
+ populateKeyset(new AiwaCarStereo1(guiObject, counter++));
+ populateKeyset(new AiwaDVD1(guiObject, counter++));
+
populateKeyset(new AppleWhiteRemote(guiObject, counter++));
+ populateKeyset(new BekoTV1(guiObject, counter++));
+
+ populateKeyset(new BoseRadio1(guiObject, counter++));
+ populateKeyset(new BoseRadio2(guiObject, counter++));
+ populateKeyset(new BoseRadio3(guiObject, counter++));
+
+ populateKeyset(new CambridgeCD1(guiObject, counter++));
+ populateKeyset(new CambridgeAudio1(guiObject, counter++));
+ populateKeyset(new CambridgeAudio2(guiObject, counter++));
+ populateKeyset(new CambridgeAudio3(guiObject, counter++));
+ populateKeyset(new CambridgeDVD1(guiObject, counter++));
+
+ populateKeyset(new DaewooTV1(guiObject, counter++));
+ populateKeyset(new DaewooTV2(guiObject, counter++));
+ populateKeyset(new DaewooTV3(guiObject, counter++));
+ populateKeyset(new DaewooTV4(guiObject, counter++));
+ populateKeyset(new DaewooDVD1(guiObject, counter++));
+ populateKeyset(new DaewooVCR1(guiObject, counter++));
+ populateKeyset(new DaewooVCR2(guiObject, counter++));
+
populateKeyset(new DenonDVD1(guiObject, counter++));
populateKeyset(new DenonDVD2(guiObject, counter++));
populateKeyset(new DenonDVD3(guiObject, counter++));
populateKeyset(new DenonReceiver1a(guiObject, counter++));
populateKeyset(new DenonReceiver1b(guiObject, counter++));
populateKeyset(new DenonReceiver1c(guiObject, counter++));
+ populateKeyset(new DenonReceiver1d(guiObject, counter++));
+ populateKeyset(new DenonReceiver1e(guiObject, counter++));
+ populateKeyset(new DenonReceiver1f(guiObject, counter++));
populateKeyset(new DenonReceiver2(guiObject, counter++));
populateKeyset(new DenonReceiver2a(guiObject, counter++));
populateKeyset(new DenonReceiver3(guiObject, counter++));
- populateKeyset(new DenonReceiver3a(guiObject, counter++));
- populateKeyset(new DenonReceiver4(guiObject, counter++));
- populateKeyset(new DenonReceiver5(guiObject, counter++));
populateKeyset(new DenonAudio1(guiObject, counter++));
populateKeyset(new DenonAudio1a(guiObject, counter++));
populateKeyset(new DenonAudio1b(guiObject, counter++));
populateKeyset(new DenonAudio2(guiObject, counter++));
populateKeyset(new DenonAudio3(guiObject, counter++));
populateKeyset(new DenonAudio4(guiObject, counter++));
- populateKeyset(new DenonAudio5(guiObject, counter++));
+
+ populateKeyset(new DigitalStreamReceiver(guiObject, counter++));
+
+ populateKeyset(new DishReceiver1(guiObject, counter++));
+ populateKeyset(new DishReceiver1a(guiObject, counter++));
+ populateKeyset(new DishReceiver1b(guiObject, counter++));
+ populateKeyset(new DishReceiver1c(guiObject, counter++));
+ populateKeyset(new DishReceiver1d(guiObject, counter++));
+ populateKeyset(new DishReceiver1e(guiObject, counter++));
+ populateKeyset(new DishReceiver1f(guiObject, counter++));
+ populateKeyset(new DishReceiver1g(guiObject, counter++));
+ populateKeyset(new DishReceiver1h(guiObject, counter++));
+ populateKeyset(new DishReceiver1i(guiObject, counter++));
+ populateKeyset(new DishReceiver1j(guiObject, counter++));
+ populateKeyset(new DishReceiver1k(guiObject, counter++));
+ populateKeyset(new DishReceiver1l(guiObject, counter++));
+ populateKeyset(new DishReceiver1m(guiObject, counter++));
+ populateKeyset(new DishReceiver1n(guiObject, counter++));
+ populateKeyset(new DishReceiver1o(guiObject, counter++));
populateKeyset(new EiTV1(guiObject, counter++));
populateKeyset(new ElgatoEyeTV1(guiObject, counter++));
+ populateKeyset(new EmersonTV1(guiObject, counter++));
+ populateKeyset(new EmersonDVD1(guiObject, counter++));
+
+ populateKeyset(new FortecReceiver1(guiObject, counter++));
+ populateKeyset(new FortecReceiver2(guiObject, counter++));
+
populateKeyset(new GoldStarTV1(guiObject, counter++));
populateKeyset(new GoldStarTV2(guiObject, counter++));
populateKeyset(new GoldStarVCR1(guiObject, counter++));
populateKeyset(new GoldStarVCR1c(guiObject, counter++));
populateKeyset(new GoldStarCD1(guiObject, counter++));
+ populateKeyset(new GrundigSat1(guiObject, counter++));
+ populateKeyset(new GrundigSat2(guiObject, counter++));
+ populateKeyset(new GrundigAmp1(guiObject, counter++));
+ populateKeyset(new GrundigAudio1(guiObject, counter++));
+ populateKeyset(new GrundigAudio2(guiObject, counter++));
+ populateKeyset(new GrundigVCR1(guiObject, counter++));
+ populateKeyset(new GrundigVCR1a(guiObject, counter++));
+ populateKeyset(new GrundigTV1(guiObject, counter++));
+ populateKeyset(new GrundigTV2(guiObject, counter++));
+ populateKeyset(new GrundigTV3(guiObject, counter++));
+ populateKeyset(new GrundigDVD1(guiObject, counter++));
+
+ populateKeyset(new HaierTV1(guiObject, counter++));
+
populateKeyset(new HauppaugePCTV1(guiObject, counter++));
populateKeyset(new HauppaugePCTV1a(guiObject, counter++));
populateKeyset(new HauppaugePCTV1b(guiObject, counter++));
populateKeyset(new HauppaugePCTV1c(guiObject, counter++));
populateKeyset(new HauppaugePCTV2(guiObject, counter++));
+ populateKeyset(new HitachiTV1(guiObject, counter++));
+ populateKeyset(new HitachiTV1a(guiObject, counter++));
+ populateKeyset(new HitachiTV1b(guiObject, counter++));
+ populateKeyset(new HitachiTV1c(guiObject, counter++));
+ populateKeyset(new HitachiTV2(guiObject, counter++));
+ populateKeyset(new HitachiTV3(guiObject, counter++));
+ populateKeyset(new HitachiProjector(guiObject, counter++));
+ populateKeyset(new HitachiDVD1(guiObject, counter++));
+ populateKeyset(new HitachiAudio1(guiObject, counter++));
+ populateKeyset(new HitachiVCR1(guiObject, counter++));
+
+ populateKeyset(new HomecastReceiver1(guiObject, counter++));
+ populateKeyset(new HomecastReceiver2(guiObject, counter++));
+
populateKeyset(new JVCSat1(guiObject, counter++));
populateKeyset(new JVCSat2(guiObject, counter++));
populateKeyset(new JVCVCR1(guiObject, counter++));
populateKeyset(new JVCAudio2(guiObject, counter++));
populateKeyset(new JVCDVD1(guiObject, counter++));
+ populateKeyset(new KenwoodAudio1(guiObject, counter++));
+ populateKeyset(new KenwoodComponent1(guiObject, counter++));
+ populateKeyset(new KenwoodComponent2(guiObject, counter++));
+ populateKeyset(new KenwoodComponent3(guiObject, counter++));
+ populateKeyset(new KenwoodCD1(guiObject, counter++));
+ populateKeyset(new KenwoodDVD1(guiObject, counter++));
+ populateKeyset(new KenwoodTV1(guiObject, counter++));
+
populateKeyset(new LGTV1(guiObject, counter++));
populateKeyset(new LGTV1a(guiObject, counter++));
populateKeyset(new LGTV1b(guiObject, counter++));
populateKeyset(new LGVCR1(guiObject, counter++));
populateKeyset(new LGVCR1a(guiObject, counter++));
populateKeyset(new LGVCR1b(guiObject, counter++));
+ populateKeyset(new LGAC1(guiObject, counter++));
+
+ populateKeyset(new LogitechSpeakers(guiObject, counter++));
populateKeyset(new MagnavoxDVD1(guiObject, counter++));
populateKeyset(new MagnavoxVCR1(guiObject, counter++));
populateKeyset(new MagnavoxConverterBox1(guiObject, counter++));
populateKeyset(new MagnavoxTV1(guiObject, counter++));
+ populateKeyset(new MCERemote1(guiObject, counter++));
+ populateKeyset(new MCERemote1a(guiObject, counter++));
+ populateKeyset(new MCERemote1b(guiObject, counter++));
+ populateKeyset(new MCERemote1c(guiObject, counter++));
+ populateKeyset(new MCERemote1d(guiObject, counter++));
+ populateKeyset(new MCERemote1e(guiObject, counter++));
+ populateKeyset(new MCERemote1f(guiObject, counter++));
+ populateKeyset(new MCERemote1g(guiObject, counter++));
+
populateKeyset(new MitsubishiTV1(guiObject, counter++));
populateKeyset(new MitsubishiTV1a(guiObject, counter++));
populateKeyset(new MitsubishiVCR1(guiObject, counter++));
populateKeyset(new NokiaGenericVCR(guiObject, counter++));
- populateKeyset(new PanasonicAmp(guiObject, counter++));
populateKeyset(new PanasonicCarAudio(guiObject, counter++));
populateKeyset(new PanasonicSat1(guiObject, counter++));
populateKeyset(new PanasonicSat1a(guiObject, counter++));
populateKeyset(new PanasonicDVD1(guiObject, counter++));
populateKeyset(new PanasonicDVD1a(guiObject, counter++));
populateKeyset(new PanasonicAudio1(guiObject, counter++));
- populateKeyset(new PanasonicAudio1a(guiObject, counter++));
+ populateKeyset(new PanasonicAC1(guiObject, counter++));
+
+ populateKeyset(new PhilcoTV(guiObject, counter++));
populateKeyset(new PhilipsTV1(guiObject, counter++));
populateKeyset(new PhilipsTV1a(guiObject, counter++));
populateKeyset(new PhilipsDVD1d(guiObject, counter++));
populateKeyset(new PhilipsDVD2(guiObject, counter++));
populateKeyset(new PhilipsDVD3(guiObject, counter++));
+ populateKeyset(new PhilipsDVD3a(guiObject, counter++));
populateKeyset(new PhilipsDVD4(guiObject, counter++));
populateKeyset(new PhilipsVCR1(guiObject, counter++));
populateKeyset(new PhilipsVCR1a(guiObject, counter++));
populateKeyset(new PinnaclePCTV2(guiObject, counter++));
populateKeyset(new PinnaclePCTV3(guiObject, counter++));
+ populateKeyset(new PioneerTV1(guiObject, counter++));
+ populateKeyset(new PioneerTV2(guiObject, counter++));
+ populateKeyset(new PioneerTV3(guiObject, counter++));
+ populateKeyset(new PioneerAudio1(guiObject, counter++));
+ populateKeyset(new PioneerAudio1a(guiObject, counter++));
+ populateKeyset(new PioneerAudio2(guiObject, counter++));
+ populateKeyset(new PioneerAudio3(guiObject, counter++));
+ populateKeyset(new PioneerAudio4(guiObject, counter++));
+ populateKeyset(new PioneerAudio5(guiObject, counter++));
+ populateKeyset(new PioneerCD1(guiObject, counter++));
+ populateKeyset(new PioneerLaserDisc1(guiObject, counter++));
+ populateKeyset(new PioneerDVD1(guiObject, counter++));
+
populateKeyset(new RaiteDVD1(guiObject, counter++));
populateKeyset(new RCATV1(guiObject, counter++));
populateKeyset(new RCATV1a(guiObject, counter++));
- populateKeyset(new RCATV2(guiObject, counter++));
+ populateKeyset(new RCATV1b(guiObject, counter++));
+/*
populateKeyset(new RCAAux1(guiObject, counter++));
populateKeyset(new RCAAux2(guiObject, counter++));
populateKeyset(new RCAAux2a(guiObject, counter++));
+*/
populateKeyset(new RCAVCR1(guiObject, counter++));
- populateKeyset(new RCAVCR2(guiObject, counter++));
+ populateKeyset(new RCAVCR1a(guiObject, counter++));
populateKeyset(new RCADVD1(guiObject, counter++));
populateKeyset(new RCADVD1a(guiObject, counter++));
populateKeyset(new RCASat1(guiObject, counter++));
populateKeyset(new RCASat2(guiObject, counter++));
+ populateKeyset(new RokuBox1(guiObject, counter++));
+ populateKeyset(new RokuBox2(guiObject, counter++));
+
+ populateKeyset(new SabaTV1(guiObject, counter++));
+ populateKeyset(new SabaTV2(guiObject, counter++));
+
populateKeyset(new SagemTVBox1(guiObject, counter++));
populateKeyset(new SagemTVBox1a(guiObject, counter++));
populateKeyset(new SanyoTV1b(guiObject, counter++));
populateKeyset(new SanyoTV1c(guiObject, counter++));
populateKeyset(new SanyoTV1d(guiObject, counter++));
- populateKeyset(new SanyoTV1e(guiObject, counter++));
populateKeyset(new SanyoProjector(guiObject, counter++));
populateKeyset(new SharpTV1(guiObject, counter++));
populateKeyset(new SharpVCR1(guiObject, counter++));
populateKeyset(new SharpReceiver1(guiObject, counter++));
+ populateKeyset(new SkyReceiver1(guiObject, counter++));
+ populateKeyset(new SkyReceiver1a(guiObject, counter++));
+
populateKeyset(new SonyTV1(guiObject, counter++));
populateKeyset(new SonyTV1a(guiObject, counter++));
populateKeyset(new SonyTV1b(guiObject, counter++));
populateKeyset(new Tivo1c(guiObject, counter++));
populateKeyset(new Tivo1d(guiObject, counter++));
+ populateKeyset(new TopfieldPVR1(guiObject, counter++));
+ populateKeyset(new TopfieldSat1(guiObject, counter++));
+
populateKeyset(new ToshibaTV1(guiObject, counter++));
populateKeyset(new ToshibaTV1a(guiObject, counter++));
populateKeyset(new ToshibaTV1b(guiObject, counter++));
populateKeyset(new ToshibaTV1e(guiObject, counter++));
populateKeyset(new ToshibaTV1f(guiObject, counter++));
populateKeyset(new ToshibaTV1g(guiObject, counter++));
+ populateKeyset(new ToshibaTV1h(guiObject, counter++));
populateKeyset(new ToshibaVCR1(guiObject, counter++));
populateKeyset(new ToshibaVCR1a(guiObject, counter++));
populateKeyset(new ToshibaDisc1(guiObject, counter++));
populateKeyset(new ToshibaDisc1c(guiObject, counter++));
populateKeyset(new ToshibaDisc1d(guiObject, counter++));
+ populateKeyset(new WDMediaPlayer1(guiObject, counter++));
+ populateKeyset(new WDMediaPlayer1a(guiObject, counter++));
+
populateKeyset(new WestinghouseTV1(guiObject, counter++));
populateKeyset(new WestinghouseTV2(guiObject, counter++));
populateKeyset(new YamahaAudio2d(guiObject, counter++));
populateKeyset(new YamahaAudio3(guiObject, counter++));
populateKeyset(new YamahaAudio4(guiObject, counter++));
- populateKeyset(new YamahaAudio5(guiObject, counter++));
- populateKeyset(new YamahaAudio6(guiObject, counter++));
- populateKeyset(new YamahaAudio7(guiObject, counter++));
populateKeyset(new YamahaTV1(guiObject, counter++));
populateKeyset(new YamahaKaraoke1(guiObject, counter++));
bool PIRKeysetManager::keysetExists(
- unsigned int keysetID)
+ unsigned int keysetID) const
{
PIRKeysetCollection::const_iterator i = keysetsInfo.find(keysetID);
bool PIRKeysetManager::findKeysetID(
QString make,
QString name,
- unsigned int &id)
+ unsigned int &id) const
{
// Only modify the id if we actually find a match!
PIRKeysetWidgetItem *PIRKeysetManager::makeKeysetItem(
QString make,
- QString name)
+ QString name) const
{
unsigned int id;
bool PIRKeysetManager::hasKey(
unsigned int keysetID,
- PIRKeyName name)
+ PIRKeyName name) const
{
- PIRKeysetMetaData *meta = keysetsInfo[keysetID];
+ PIRKeysetCollection::const_iterator i = keysetsInfo.find(keysetID);
- if (!meta) return false;
+ if ((i == keysetsInfo.end()) || !i->second) return false;
- return meta->hasKey(name);
+ return i->second->hasKey(name);
}
PIRMakeName PIRKeysetManager::getMake(
- unsigned int keysetID)
+ unsigned int keysetID) const
{
- PIRKeysetMetaData *meta = keysetsInfo[keysetID];
+ PIRKeysetCollection::const_iterator i = keysetsInfo.find(keysetID);
- if (!meta) return Any_Make; // Work on this!
+ if ((i == keysetsInfo.end()) || !i->second) return Any_Make;
- return meta->getMake();
+ return i->second->getMake();
}
QString PIRKeysetManager::getDisplayName(
- unsigned int keysetID)
+ unsigned int keysetID) const
{
- PIRKeysetMetaData *meta = keysetsInfo[keysetID];
+ PIRKeysetCollection::const_iterator i = keysetsInfo.find(keysetID);
- if (!meta) return QString("Database Error");
+ if ((i == keysetsInfo.end()) || !i->second)
+ return QString("Database Error");
- return QString(meta->getKeysetName());
+ return QString(i->second->getKeysetName());
}
// Set up the keyset collection:
keysetsInfo[keyset->getID()] = keyset;
- keyset->moveProtocolToThread(commandThread);
+ keyset->moveProtocolToThread(&commandThread);
// Also, set up a name-based index into the collection:
makeIndex
void PIRKeysetManager::populateGuiWidget(
- PIRSelectKeysetForm *skf)
+ PIRSelectKeysetForm *skf) const
{
PIRMakeName make;
PIRKeysetWidgetItem *kwi;
void PIRKeysetManager::populateDeviceTypes(
PIRKeysetWidgetItem *kwi,
- unsigned int keysetID)
+ unsigned int keysetID) const
{
- // Pass the buck: (Need to check for bad keysetID here?)
- keysetsInfo[keysetID]->populateDeviceTypes(kwi);
+ PIRKeysetCollection::const_iterator i = keysetsInfo.find(keysetID);
+ if ((i != keysetsInfo.end()) && i->second)
+ {
+ i->second->populateDeviceTypes(kwi);
+ }
}