From d4996260671e35f52fddccd2c11ad55d3c6a2995 Mon Sep 17 00:00:00 2001 From: John Pietrzak Date: Sun, 19 Feb 2012 19:26:18 -0500 Subject: [PATCH] Memory Management Improved A huge improvement in memory usage, through the simple expedient of avoiding keyset initialization until absolutely necessary. Still a lot more work to do on this front, but its a start. Also, a fix for the Sky/Sky+ protocol, and first pass at keysets for HP and Motorola. --- keysets/acer.cpp | 24 +- keysets/acer.h | 8 +- keysets/admiral.cpp | 42 +- keysets/admiral.h | 12 +- keysets/aiwa.cpp | 205 ++++++- keysets/aiwa.h | 60 +- keysets/apple.cpp | 12 +- keysets/apple.h | 4 +- keysets/beko.cpp | 13 +- keysets/beko.h | 4 +- keysets/bose.cpp | 52 +- keysets/bose.h | 16 +- keysets/cambridge.cpp | 64 ++- keysets/cambridge.h | 20 +- keysets/daewoo.cpp | 87 ++- keysets/daewoo.h | 28 +- keysets/denon.cpp | 298 ++++++++-- keysets/denon.h | 84 ++- keysets/digitalstream.cpp | 13 +- keysets/digitalstream.h | 4 +- keysets/directv.cpp | 13 +- keysets/directv.h | 4 +- keysets/dish.cpp | 268 +++++++-- keysets/dish.h | 64 ++- keysets/ei.cpp | 12 +- keysets/ei.h | 4 +- keysets/elgato.cpp | 13 +- keysets/elgato.h | 4 +- keysets/emerson.cpp | 26 +- keysets/emerson.h | 8 +- keysets/fortec.cpp | 26 +- keysets/fortec.h | 8 +- keysets/goldstar.cpp | 100 +++- keysets/goldstar.h | 28 +- keysets/grundig.cpp | 139 ++++- keysets/grundig.h | 44 +- keysets/haier.cpp | 12 +- keysets/haier.h | 4 +- keysets/hauppauge.cpp | 75 ++- keysets/hauppauge.h | 20 +- keysets/hitachi.cpp | 132 ++++- keysets/hitachi.h | 40 +- keysets/homecast.cpp | 26 +- keysets/homecast.h | 8 +- keysets/hp.cpp | 55 ++ keysets/hp.h | 18 + keysets/huawei.cpp | 24 +- keysets/huawei.h | 8 +- keysets/jvc.cpp | 261 ++++++++- keysets/jvc.h | 72 ++- keysets/kenwood.cpp | 90 ++- keysets/kenwood.h | 28 +- keysets/lg.cpp | 205 ++++++- keysets/lg.h | 56 +- keysets/logitech.cpp | 13 +- keysets/logitech.h | 4 +- keysets/magnavox.cpp | 50 +- keysets/magnavox.h | 16 +- keysets/mce.cpp | 124 ++++- keysets/mce.h | 32 +- keysets/mitsubishi.cpp | 59 +- keysets/mitsubishi.h | 16 +- keysets/motorola.cpp | 282 ++++++++++ keysets/motorola.h | 58 ++ keysets/nokia.cpp | 13 +- keysets/nokia.h | 4 +- keysets/onida.cpp | 26 +- keysets/onida.h | 8 +- keysets/panasonic.cpp | 203 ++++++- keysets/panasonic.h | 60 +- keysets/philco.cpp | 13 +- keysets/philco.h | 4 +- keysets/philips.cpp | 488 +++++++++++++++-- keysets/philips.h | 136 +++-- keysets/pinnacle.cpp | 36 +- keysets/pinnacle.h | 12 +- keysets/pioneer.cpp | 153 +++++- keysets/pioneer.h | 48 +- keysets/raite.cpp | 12 +- keysets/raite.h | 4 +- keysets/rca.cpp | 129 ++++- keysets/rca.h | 36 +- keysets/roku.cpp | 26 +- keysets/roku.h | 8 +- keysets/saba.cpp | 26 +- keysets/saba.h | 8 +- keysets/sagem.cpp | 29 +- keysets/sagem.h | 8 +- keysets/samsung.cpp | 314 +++++++++-- keysets/samsung.h | 84 ++- keysets/sanyo.cpp | 113 +++- keysets/sanyo.h | 32 +- keysets/sharp.cpp | 132 ++++- keysets/sharp.h | 36 +- keysets/sky.cpp | 31 +- keysets/sky.h | 8 +- keysets/sony.cpp | 267 +++++++-- keysets/sony.h | 68 ++- keysets/tivo.cpp | 77 ++- keysets/tivo.h | 20 +- keysets/topfield.cpp | 24 +- keysets/topfield.h | 8 +- keysets/toshiba.cpp | 246 ++++++++- keysets/toshiba.h | 64 ++- keysets/vestel.cpp | 26 +- keysets/vestel.h | 8 +- keysets/virgin.cpp | 13 +- keysets/virgin.h | 4 +- keysets/vizio.cpp | 13 +- keysets/vizio.h | 4 +- keysets/wd.cpp | 29 +- keysets/wd.h | 8 +- keysets/westinghouse.cpp | 25 +- keysets/westinghouse.h | 8 +- keysets/yamaha.cpp | 185 ++++++- keysets/yamaha.h | 52 +- keysets/zenith.cpp | 12 +- keysets/zenith.h | 4 +- mainwindow.cpp | 12 +- pierogi.pro | 10 +- pierogi.pro.user | 10 +- pirkeysetmanager.cpp | 878 +++++++++++++++--------------- pirkeysetmanager.h | 10 +- pirkeysetmetadata.cpp | 18 +- pirkeysetmetadata.h | 15 +- pirmakenames.cpp | 2 + pirmakenames.h | 2 + pirrx51hardware.cpp | 17 +- protocols/giprotocol.cpp | 149 +++++ protocols/giprotocol.h | 34 ++ protocols/rc6skyprotocol.cpp | 26 +- qtc_packaging/debian_fremantle/changelog | 7 + qtc_packaging/debian_fremantle/control | 4 +- 133 files changed, 6816 insertions(+), 1382 deletions(-) create mode 100644 keysets/hp.cpp create mode 100644 keysets/hp.h create mode 100644 keysets/motorola.cpp create mode 100644 keysets/motorola.h create mode 100644 protocols/giprotocol.cpp create mode 100644 protocols/giprotocol.h diff --git a/keysets/acer.cpp b/keysets/acer.cpp index b471cd7..778bb61 100644 --- a/keysets/acer.cpp +++ b/keysets/acer.cpp @@ -2,13 +2,23 @@ #include "protocols/necprotocol.h" AcerTV1::AcerTV1( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "TV Keyset 1", Acer_Make, index) { +} + +void AcerTV1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + threadableProtocol = new NECProtocol(guiObject, index, true, true); setPreData(0x6361, 16); @@ -74,7 +84,6 @@ AcerTV1::AcerTV1( AcerPC1::AcerPC1( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "PC Keyset 1", @@ -83,6 +92,17 @@ AcerPC1::AcerPC1( { addControlledDevice(Acer_Make, "Aspire 9500", Computer_Device); addControlledDevice(Acer_Make, "Aspire 9800", Computer_Device); +} + + +void AcerPC1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } threadableProtocol = new NECProtocol(guiObject, index, true, true); diff --git a/keysets/acer.h b/keysets/acer.h index a2eb94e..3ea5691 100644 --- a/keysets/acer.h +++ b/keysets/acer.h @@ -9,16 +9,20 @@ class AcerTV1: public PIRKeysetMetaData { public: AcerTV1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class AcerPC1: public PIRKeysetMetaData { public: AcerPC1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; #endif // ACER_H diff --git a/keysets/admiral.cpp b/keysets/admiral.cpp index 676b988..58c8d2c 100644 --- a/keysets/admiral.cpp +++ b/keysets/admiral.cpp @@ -3,13 +3,24 @@ #include "protocols/rc5protocol.h" AdmiralTV1::AdmiralTV1( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "TV Keyset 1", Admiral_Make, index) { +} + + +void AdmiralTV1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + threadableProtocol = new SharpProtocol(guiObject, index, true); addSharpKey("tv-1", One_Key, 0x01, 0x01); @@ -37,15 +48,27 @@ AdmiralTV1::AdmiralTV1( } -// The following is just a guess: AdmiralTV2::AdmiralTV2( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "TV Keyset 2", Admiral_Make, index) { +} + + + +// The following is just a guess: +void AdmiralTV2::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + threadableProtocol = new RC5Protocol(guiObject, index); addKey("0", Zero_Key, 0x1000, 13); @@ -97,13 +120,24 @@ AdmiralTV2::AdmiralTV2( AdmiralVCR1::AdmiralVCR1( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "VCR Keyset 1", Admiral_Make, index) { +} + + +void AdmiralVCR1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + threadableProtocol = new SharpProtocol(guiObject, index, true); addSharpKey("vcr-1", One_Key, 0x03, 0x01); diff --git a/keysets/admiral.h b/keysets/admiral.h index f5721e0..8f28151 100644 --- a/keysets/admiral.h +++ b/keysets/admiral.h @@ -9,24 +9,30 @@ class AdmiralTV1: public PIRKeysetMetaData { public: AdmiralTV1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class AdmiralTV2: public PIRKeysetMetaData { public: AdmiralTV2( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class AdmiralVCR1: public PIRKeysetMetaData { public: AdmiralVCR1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; #endif // ADMIRAL_H diff --git a/keysets/aiwa.cpp b/keysets/aiwa.cpp index d6ca886..2d58566 100644 --- a/keysets/aiwa.cpp +++ b/keysets/aiwa.cpp @@ -4,7 +4,6 @@ #include "protocols/necprotocol.h" AiwaVCR1::AiwaVCR1( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "VCR Keyset 1", @@ -12,6 +11,17 @@ AiwaVCR1::AiwaVCR1( index) { addControlledDevice(Aiwa_Make, "HV-CX100KER", VCR_Device); +} + + +void AiwaVCR1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } threadableProtocol = new AiwaProtocol(guiObject, index); @@ -96,13 +106,24 @@ AiwaVCR1::AiwaVCR1( AiwaVCR2::AiwaVCR2( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "VCR Keyset 2", Aiwa_Make, index) { +} + + +void AiwaVCR2::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + threadableProtocol = new NECProtocol(guiObject, index, false, true); setPreData(0x6E, 8); @@ -151,13 +172,24 @@ AiwaVCR2::AiwaVCR2( AiwaVCR3::AiwaVCR3( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "VCR Keyset 3", Aiwa_Make, index) { +} + + +void AiwaVCR3::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + threadableProtocol = new NECProtocol(guiObject, index, true, false); setPreData(0x7B80, 16); @@ -208,7 +240,6 @@ AiwaVCR3::AiwaVCR3( AiwaAudio1::AiwaAudio1( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "Audio Keyset 1", @@ -217,6 +248,17 @@ AiwaAudio1::AiwaAudio1( { addControlledDevice(Aiwa_Make, "LCX-100", Audio_Device); addControlledDevice(Aiwa_Make, "RC-TD3", Audio_Device); +} + + +void AiwaAudio1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } threadableProtocol = new AiwaProtocol(guiObject, index); @@ -276,16 +318,28 @@ AiwaAudio1::AiwaAudio1( } -// Don't know why only the numbers are different for this one: AiwaAudio1a::AiwaAudio1a( - QObject *guiObject, unsigned int index) - : AiwaAudio1(guiObject, index) + : AiwaAudio1(index) { setKeysetName("Audio Keyset 1a"); addControlledDevice(Aiwa_Make, "XR-M201", Audio_Device); addControlledDevice(Aiwa_Make, "CA-DW635", Audio_Device); +} + + +// Don't know why only the numbers are different for this one: +void AiwaAudio1a::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + AiwaAudio1::populateProtocol(guiObject); addKey("1", One_Key, 0x01, 8); addKey("2", Two_Key, 0x02, 8); @@ -304,7 +358,6 @@ AiwaAudio1a::AiwaAudio1a( AiwaAudio2::AiwaAudio2( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "Audio Keyset 2", @@ -324,6 +377,17 @@ AiwaAudio2::AiwaAudio2( addControlledDevice(Aiwa_Make, "NSX-500", Audio_Device); addControlledDevice(Aiwa_Make, "NSX-540", Audio_Device); addControlledDevice(Aiwa_Make, "NSX-DR5", Audio_Device); +} + + +void AiwaAudio2::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } threadableProtocol = new AiwaProtocol(guiObject, index); @@ -391,11 +455,23 @@ AiwaAudio2::AiwaAudio2( AiwaAudio2a::AiwaAudio2a( - QObject *guiObject, unsigned int index) - : AiwaAudio2(guiObject, index) + : AiwaAudio2(index) { setKeysetName("Audio Keyset 2a"); +} + + +void AiwaAudio2a::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + AiwaAudio2::populateProtocol(guiObject); addKey("Rec", Record_Key, 0x5F, 8); addKey("ChUp", ChannelUp_Key, 0x86, 8); @@ -404,11 +480,23 @@ AiwaAudio2a::AiwaAudio2a( AiwaAudio2b::AiwaAudio2b( - QObject *guiObject, unsigned int index) - : AiwaAudio2(guiObject, index) + : AiwaAudio2(index) { setKeysetName("Audio Keyset 2b"); +} + + +void AiwaAudio2b::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + AiwaAudio2::populateProtocol(guiObject); addKey("UP", Up_Key, 0x40, 8); addKey("DOWN", Down_Key, 0x41, 8); @@ -418,13 +506,25 @@ AiwaAudio2b::AiwaAudio2b( AiwaAudio2c::AiwaAudio2c( - QObject *guiObject, unsigned int index) - : AiwaAudio2(guiObject, index) + : AiwaAudio2(index) { setKeysetName("Audio Keyset 2c"); addControlledDevice(Aiwa_Make, "XR-MD201", Audio_Device); +} + + +void AiwaAudio2c::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + AiwaAudio2::populateProtocol(guiObject); addKey("display", Info_Key, 0x14, 8); addKey("rec", Record_Key, 0x71, 8); @@ -437,13 +537,24 @@ AiwaAudio2c::AiwaAudio2c( // Might not be audio here: AiwaAudio3::AiwaAudio3( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "Audio Keyset 3", Aiwa_Make, index) { +} + + +void AiwaAudio3::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + threadableProtocol = new AiwaProtocol(guiObject, index); setPreData(0x007B, 13); @@ -480,13 +591,24 @@ AiwaAudio3::AiwaAudio3( AiwaAudio4::AiwaAudio4( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "Audio Keyset 4", Aiwa_Make, index) { +} + + +void AiwaAudio4::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + threadableProtocol = new AiwaProtocol(guiObject, index); setPreData(0x00F6, 13); @@ -538,13 +660,24 @@ AiwaAudio4::AiwaAudio4( AiwaAudio5::AiwaAudio5( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "Audio Keyset 5", Aiwa_Make, index) { +} + + +void AiwaAudio5::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + threadableProtocol = new AiwaProtocol(guiObject, index); setPreData(0x0076, 13); @@ -574,7 +707,6 @@ AiwaAudio5::AiwaAudio5( AiwaAudio6::AiwaAudio6( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "Audio Keyset 6", @@ -583,6 +715,17 @@ AiwaAudio6::AiwaAudio6( { addControlledDevice(Aiwa_Make, "CX-770", Audio_Device); addControlledDevice(Aiwa_Make, "Series 70", Audio_Device); +} + + +void AiwaAudio6::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } threadableProtocol = new AiwaProtocol(guiObject, index); @@ -610,13 +753,24 @@ AiwaAudio6::AiwaAudio6( AiwaCarStereo1::AiwaCarStereo1( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "Car Stereo Keyset 1", Aiwa_Make, index) { +} + + +void AiwaCarStereo1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + threadableProtocol = new NECProtocol(guiObject, index, true, true); setPreData(0x1386, 16); @@ -637,13 +791,24 @@ AiwaCarStereo1::AiwaCarStereo1( AiwaDVD1::AiwaDVD1( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "DVD Keyset 1", Aiwa_Make, index) { +} + + +void AiwaDVD1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + LIRCProtocol *lp = new LIRCProtocol( guiObject, index, diff --git a/keysets/aiwa.h b/keysets/aiwa.h index 0e6562a..fc6f38e 100644 --- a/keysets/aiwa.h +++ b/keysets/aiwa.h @@ -9,120 +9,150 @@ class AiwaVCR1: public PIRKeysetMetaData { public: AiwaVCR1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class AiwaVCR2: public PIRKeysetMetaData { public: AiwaVCR2( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class AiwaVCR3: public PIRKeysetMetaData { public: AiwaVCR3( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class AiwaAudio1: public PIRKeysetMetaData { public: AiwaAudio1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class AiwaAudio1a: public AiwaAudio1 { public: AiwaAudio1a( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class AiwaAudio2: public PIRKeysetMetaData { public: AiwaAudio2( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class AiwaAudio2a: public AiwaAudio2 { public: AiwaAudio2a( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class AiwaAudio2b: public AiwaAudio2 { public: AiwaAudio2b( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class AiwaAudio2c: public AiwaAudio2 { public: AiwaAudio2c( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class AiwaAudio3: public PIRKeysetMetaData { public: AiwaAudio3( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class AiwaAudio4: public PIRKeysetMetaData { public: AiwaAudio4( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class AiwaAudio5: public PIRKeysetMetaData { public: AiwaAudio5( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class AiwaAudio6: public PIRKeysetMetaData { public: AiwaAudio6( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class AiwaCarStereo1: public PIRKeysetMetaData { public: AiwaCarStereo1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class AiwaDVD1: public PIRKeysetMetaData { public: AiwaDVD1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; #endif // AIWA_H diff --git a/keysets/apple.cpp b/keysets/apple.cpp index e68c59c..1d3be72 100644 --- a/keysets/apple.cpp +++ b/keysets/apple.cpp @@ -3,7 +3,6 @@ // Based on LIRC Apple_A1156 config file AppleWhiteRemote::AppleWhiteRemote( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "White Remote", @@ -11,6 +10,17 @@ AppleWhiteRemote::AppleWhiteRemote( index) { addControlledDevice(Apple_Make, "Mac Mini", Computer_Device); +} + + +void AppleWhiteRemote::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } // Set up the threadable object: LIRCProtocol *lp = new LIRCProtocol( diff --git a/keysets/apple.h b/keysets/apple.h index 2d5cd93..3157220 100644 --- a/keysets/apple.h +++ b/keysets/apple.h @@ -9,8 +9,10 @@ class AppleWhiteRemote: public PIRKeysetMetaData { public: AppleWhiteRemote( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; #endif // APPLE_H diff --git a/keysets/beko.cpp b/keysets/beko.cpp index f70fc32..b415af4 100644 --- a/keysets/beko.cpp +++ b/keysets/beko.cpp @@ -3,13 +3,24 @@ BekoTV1::BekoTV1( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "TV Keyset 1", Beko_Make, index) { +} + + +void BekoTV1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + threadableProtocol = new RC5Protocol(guiObject, index); addKey("MIX", TeletextAndTV_Key, 0x1004, 13); diff --git a/keysets/beko.h b/keysets/beko.h index 839e30b..25c8e1e 100644 --- a/keysets/beko.h +++ b/keysets/beko.h @@ -9,8 +9,10 @@ class BekoTV1: public PIRKeysetMetaData { public: BekoTV1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; #endif // BEKO_H diff --git a/keysets/bose.cpp b/keysets/bose.cpp index f5db3cc..897ea73 100644 --- a/keysets/bose.cpp +++ b/keysets/bose.cpp @@ -3,13 +3,24 @@ #include "protocols/necprotocol.h" BoseRadio1::BoseRadio1( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "Wave Radio Keyset 1", Bose_Make, index) { +} + + +void BoseRadio1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + threadableProtocol = new BoseProtocol(guiObject, index); addKey("Mute", Mute_Key, 0x01, 8); @@ -47,13 +58,24 @@ BoseRadio1::BoseRadio1( BoseRadio2::BoseRadio2( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "Wave Radio Keyset 2", Bose_Make, index) { +} + + +void BoseRadio2::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + threadableProtocol = new BoseProtocol(guiObject, index); addKey("on/off", Power_Key, 0x00, 8); @@ -81,13 +103,24 @@ BoseRadio2::BoseRadio2( BoseRadio3::BoseRadio3( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "Wave Radio Keyset 3", Bose_Make, index) { +} + + +void BoseRadio3::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + threadableProtocol = new NECProtocol(guiObject, index, false, false); setPreData(0xBA, 8); @@ -117,13 +150,24 @@ BoseRadio3::BoseRadio3( BoseHomeTheater1::BoseHomeTheater1( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "Home Theater 1", Bose_Make, index) { +} + + +void BoseHomeTheater1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + threadableProtocol = new NECProtocol(guiObject, index, true, false); setPreData(0x4BBA, 16); diff --git a/keysets/bose.h b/keysets/bose.h index 345a523..ae3057f 100644 --- a/keysets/bose.h +++ b/keysets/bose.h @@ -9,32 +9,40 @@ class BoseRadio1: public PIRKeysetMetaData { public: BoseRadio1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class BoseRadio2: public PIRKeysetMetaData { public: BoseRadio2( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class BoseRadio3: public PIRKeysetMetaData { public: BoseRadio3( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class BoseHomeTheater1: public PIRKeysetMetaData { public: BoseHomeTheater1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; #endif // BOSE_H diff --git a/keysets/cambridge.cpp b/keysets/cambridge.cpp index 6bc9ea6..0462dd0 100644 --- a/keysets/cambridge.cpp +++ b/keysets/cambridge.cpp @@ -5,13 +5,24 @@ CambridgeCD1::CambridgeCD1( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "CD Keyset 1", Cambridge_Make, index) { +} + + +void CambridgeCD1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + threadableProtocol = new NECProtocol(guiObject, index, true, true); setPreData(0x4D84, 16); @@ -47,13 +58,24 @@ CambridgeCD1::CambridgeCD1( CambridgeAudio1::CambridgeAudio1( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "Audio Keyset 1", Cambridge_Make, index) { +} + + +void CambridgeAudio1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + threadableProtocol = new NECXProtocol(guiObject, index, true); setPreData(0xA0A0, 16); @@ -91,13 +113,24 @@ CambridgeAudio1::CambridgeAudio1( CambridgeAudio2::CambridgeAudio2( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "Audio Keyset 2", Cambridge_Make, index) { +} + + +void CambridgeAudio2::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + threadableProtocol = new NECXProtocol(guiObject, index, true); setPreData(0xC0C0, 16); @@ -146,13 +179,24 @@ CambridgeAudio2::CambridgeAudio2( CambridgeAudio3::CambridgeAudio3( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "Audio Keyset 3", Cambridge_Make, index) { +} + + +void CambridgeAudio3::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + threadableProtocol = new RC5Protocol(guiObject, index); addKey("Tape_Mon", TapeInput_Key, 0x1400, 13); @@ -178,7 +222,6 @@ CambridgeAudio3::CambridgeAudio3( CambridgeDVD1::CambridgeDVD1( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "DVD Keyset 1", @@ -189,6 +232,17 @@ CambridgeDVD1::CambridgeDVD1( addControlledDevice(Cambridge_Make, "DVD55", DVD_Device); addControlledDevice(Cambridge_Make, "DVD57", DVD_Device); addControlledDevice(Cambridge_Make, "DVD59B", DVD_Device); +} + + +void CambridgeDVD1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } threadableProtocol = new NECProtocol(guiObject, index, false, true); diff --git a/keysets/cambridge.h b/keysets/cambridge.h index 9e7c800..e948520 100644 --- a/keysets/cambridge.h +++ b/keysets/cambridge.h @@ -9,40 +9,50 @@ class CambridgeCD1: public PIRKeysetMetaData { public: CambridgeCD1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class CambridgeAudio1: public PIRKeysetMetaData { public: CambridgeAudio1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class CambridgeAudio2: public PIRKeysetMetaData { public: CambridgeAudio2( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class CambridgeAudio3: public PIRKeysetMetaData { public: CambridgeAudio3( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class CambridgeDVD1: public PIRKeysetMetaData { public: CambridgeDVD1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; #endif // CAMBRIDGE_H diff --git a/keysets/daewoo.cpp b/keysets/daewoo.cpp index 3d8e955..ea3dbf4 100644 --- a/keysets/daewoo.cpp +++ b/keysets/daewoo.cpp @@ -4,7 +4,6 @@ #include "protocols/necprotocol.h" DaewooTV1::DaewooTV1( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "TV Keyset 1", @@ -12,6 +11,17 @@ DaewooTV1::DaewooTV1( index) { addControlledDevice(Daewoo_Make, "21T5T", TV_Device); +} + + +void DaewooTV1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } threadableProtocol = new RC5Protocol(guiObject, index); @@ -61,7 +71,6 @@ DaewooTV1::DaewooTV1( DaewooTV2::DaewooTV2( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "TV Keyset 1", @@ -69,6 +78,17 @@ DaewooTV2::DaewooTV2( index) { addControlledDevice(Daewoo_Make, "DMQ-2141", TV_Device); +} + + +void DaewooTV2::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } threadableProtocol = new DaewooProtocol(guiObject, index); @@ -117,13 +137,24 @@ DaewooTV2::DaewooTV2( DaewooTV3::DaewooTV3( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "TV Keyset 3", Daewoo_Make, index) { +} + + +void DaewooTV3::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + threadableProtocol = new NECProtocol(guiObject, index, false, true); setPreData(0x14, 8); @@ -193,13 +224,24 @@ DaewooTV3::DaewooTV3( DaewooTV4::DaewooTV4( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "TV Keyset 4", Daewoo_Make, index) { +} + + +void DaewooTV4::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + threadableProtocol = new NECProtocol(guiObject, index, true, true); setPreData(0x1004, 16); @@ -245,13 +287,24 @@ DaewooTV4::DaewooTV4( DaewooDVD1::DaewooDVD1( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "DVD Keyset 1", Daewoo_Make, index) { +} + + +void DaewooDVD1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + threadableProtocol = new DaewooProtocol(guiObject, index); setPreData(0x15, 8); @@ -305,7 +358,6 @@ DaewooDVD1::DaewooDVD1( DaewooVCR1::DaewooVCR1( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "VCR Keyset 1", @@ -313,6 +365,17 @@ DaewooVCR1::DaewooVCR1( index) { addControlledDevice(Daewoo_Make, "PV-200", VCR_Device); +} + + +void DaewooVCR1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } threadableProtocol = new NECProtocol(guiObject, index, false, true); @@ -358,7 +421,6 @@ DaewooVCR1::DaewooVCR1( DaewooVCR2::DaewooVCR2( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "VCR Keyset 2", @@ -366,6 +428,17 @@ DaewooVCR2::DaewooVCR2( index) { addControlledDevice(Daewoo_Make, "VQ857S", VCR_Device); +} + + +void DaewooVCR2::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } threadableProtocol = new DaewooProtocol(guiObject, index); diff --git a/keysets/daewoo.h b/keysets/daewoo.h index a13adb1..7571663 100644 --- a/keysets/daewoo.h +++ b/keysets/daewoo.h @@ -9,56 +9,70 @@ class DaewooTV1: public PIRKeysetMetaData { public: DaewooTV1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class DaewooTV2: public PIRKeysetMetaData { public: DaewooTV2( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class DaewooTV3: public PIRKeysetMetaData { public: DaewooTV3( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class DaewooTV4: public PIRKeysetMetaData { public: DaewooTV4( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class DaewooDVD1: public PIRKeysetMetaData { public: DaewooDVD1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class DaewooVCR1: public PIRKeysetMetaData { public: DaewooVCR1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class DaewooVCR2: public PIRKeysetMetaData { public: DaewooVCR2( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; #endif // DAEWOO_H diff --git a/keysets/denon.cpp b/keysets/denon.cpp index 4aaa0b5..006ee96 100644 --- a/keysets/denon.cpp +++ b/keysets/denon.cpp @@ -6,7 +6,6 @@ // This whole set of Denon keysets is a mess. Need to clean it up!!! DenonDVD1::DenonDVD1( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "DVD Keyset 1", @@ -14,6 +13,17 @@ DenonDVD1::DenonDVD1( index) { addControlledDevice(Denon_Make, "DVD-1930", DVD_Device); +} + + +void DenonDVD1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } threadableProtocol = new SharpProtocol(guiObject, index, false); @@ -68,7 +78,6 @@ DenonDVD1::DenonDVD1( DenonDVD2::DenonDVD2( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "DVD Keyset 2", @@ -76,6 +85,17 @@ DenonDVD2::DenonDVD2( index) { addControlledDevice(Denon_Make, "DVD-2500", DVD_Device); +} + + +void DenonDVD2::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } LIRCProtocol *lp = new LIRCProtocol( guiObject, @@ -134,7 +154,6 @@ DenonDVD2::DenonDVD2( DenonDVD3::DenonDVD3( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "DVD Keyset 3", @@ -142,6 +161,17 @@ DenonDVD3::DenonDVD3( index) { addControlledDevice(Denon_Make, "dvd-1000", DVD_Device); +} + + +void DenonDVD3::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } threadableProtocol = new SharpProtocol(guiObject, index, false); @@ -189,7 +219,6 @@ DenonDVD3::DenonDVD3( DenonReceiver1::DenonReceiver1( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "Receiver Keyset 1", @@ -197,6 +226,17 @@ DenonReceiver1::DenonReceiver1( index) { addControlledDevice(Denon_Make, "avr-1708", Audio_Device); +} + + +void DenonReceiver1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } threadableProtocol = new SharpProtocol(guiObject, index, false); @@ -261,13 +301,25 @@ DenonReceiver1::DenonReceiver1( DenonReceiver1a::DenonReceiver1a( - QObject *guiObject, unsigned int index) - : DenonReceiver1(guiObject, index) + : DenonReceiver1(index) { setKeysetName("Receiver Keyset 1a"); addControlledDevice(Denon_Make, "AVR-1610", Audio_Device); +} + + +void DenonReceiver1a::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + DenonReceiver1::populateProtocol(guiObject); addSharpKey("BTN_SKIP", Unmapped_Key, 0x0C, 0xCC); addSharpKey("BTN_PAUSE", Pause_Key, 0x0C, 0xCD); @@ -283,13 +335,25 @@ DenonReceiver1a::DenonReceiver1a( DenonReceiver1b::DenonReceiver1b( - QObject *guiObject, unsigned int index) - : DenonReceiver1(guiObject, index) + : DenonReceiver1(index) { setKeysetName("Receiver Keyset 1b"); addControlledDevice(Denon_Make, "avr-3300", Audio_Device); +} + + +void DenonReceiver1b::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + DenonReceiver1::populateProtocol(guiObject); addSharpKey("setup", Menu_Key, 0x0C, 0x50); addSharpKey("params", Unmapped_Key, 0x0C, 0x51); @@ -297,15 +361,27 @@ DenonReceiver1b::DenonReceiver1b( DenonReceiver1c::DenonReceiver1c( - QObject *guiObject, unsigned int index) - : DenonReceiver1(guiObject, index) + : DenonReceiver1(index) { setKeysetName("Receiver Keyset 1c"); addControlledDevice(Denon_Make, "AVR-1602", Audio_Device); addControlledDevice(Denon_Make, "AVR-1802", Audio_Device); addControlledDevice(Denon_Make, "AVR-1803", Audio_Device); +} + + +void DenonReceiver1c::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + DenonReceiver1::populateProtocol(guiObject); addSharpKey("ONE", One_Key, 0x02, 0xC3); addSharpKey("TWO", Two_Key, 0x02, 0xC4); @@ -344,13 +420,25 @@ DenonReceiver1c::DenonReceiver1c( DenonReceiver1d::DenonReceiver1d( - QObject *guiObject, unsigned int index) - : DenonReceiver1c(guiObject, index) + : DenonReceiver1c(index) { setKeysetName("Receiver Keyset 1d"); addControlledDevice(Denon_Make, "PMA-480R", Audio_Device); +} + + +void DenonReceiver1d::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + DenonReceiver1c::populateProtocol(guiObject); addSharpKey("AMP_PHONO", PhonoInput_Key, 0x02, 0x81); addSharpKey("AMP_TUNER", TunerInput_Key, 0x02, 0x83); @@ -374,13 +462,25 @@ DenonReceiver1d::DenonReceiver1d( DenonReceiver1e::DenonReceiver1e( - QObject *guiObject, unsigned int index) - : DenonReceiver1d(guiObject, index) + : DenonReceiver1d(index) { setKeysetName("Receiver Keyset 1e"); addControlledDevice(Denon_Make, "DRA-385RD", Audio_Device); +} + + +void DenonReceiver1e::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + DenonReceiver1d::populateProtocol(guiObject); addSharpKey("voldwn", VolumeDown_Key, 0x0C, 0x4C); addSharpKey("volup", VolumeUp_Key, 0x0C, 0x4D); @@ -395,15 +495,28 @@ DenonReceiver1e::DenonReceiver1e( addSharpKey("tape2", Unmapped_Key, 0x0C, 0x5E); } + DenonReceiver1f::DenonReceiver1f( - QObject *guiObject, unsigned int index) - : DenonReceiver1c(guiObject, index) + : DenonReceiver1c(index) { setKeysetName("Receiver Keyset 1f"); addControlledDevice(Denon_Make, "AVR-700RD", Audio_Device); addControlledDevice(Denon_Make, "RC-841", Audio_Device); +} + + +void DenonReceiver1f::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + DenonReceiver1c::populateProtocol(guiObject); addSharpKey("Power", Power_Key, 0x02, 0xC1); @@ -416,13 +529,24 @@ DenonReceiver1f::DenonReceiver1f( DenonReceiver2::DenonReceiver2( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "Receiver Keyset 2", Denon_Make, index) { +} + + +void DenonReceiver2::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + threadableProtocol = new SharpProtocol(guiObject, index, false); addSharpKey("tun_1", One_Key, 0x13, 0x42); @@ -468,13 +592,25 @@ DenonReceiver2::DenonReceiver2( DenonReceiver2a::DenonReceiver2a( - QObject *guiObject, unsigned int index) - : DenonReceiver2(guiObject, index) + : DenonReceiver2(index) { setKeysetName("Receiver Keyset 2a"); addControlledDevice(Denon_Make, "PMA-425R", Audio_Device); +} + + +void DenonReceiver2a::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + DenonReceiver2::populateProtocol(guiObject); addSharpKey("AMP_TAPE2", Unmapped_Key, 0x1D, 0x9A); addSharpKey("AMP_TAPE1", TapeInput_Key, 0x1D, 0x99); @@ -490,7 +626,6 @@ DenonReceiver2a::DenonReceiver2a( DenonReceiver3::DenonReceiver3( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "Receiver Keyset 3", @@ -498,6 +633,17 @@ DenonReceiver3::DenonReceiver3( index) { addControlledDevice(Denon_Make, "AVR-600 RD", Audio_Device); +} + + +void DenonReceiver3::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } LIRCProtocol *lp = new LIRCProtocol( guiObject, @@ -535,7 +681,6 @@ DenonReceiver3::DenonReceiver3( DenonAudio1::DenonAudio1( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "Audio Keyset 1", @@ -547,6 +692,17 @@ DenonAudio1::DenonAudio1( addControlledDevice(Denon_Make, "DCD-335", Audio_Device); addControlledDevice(Denon_Make, "DRA-275RD", Audio_Device); addControlledDevice(Denon_Make, "UD-M30", Audio_Device); +} + + +void DenonAudio1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } threadableProtocol = new SharpProtocol(guiObject, index, false); @@ -634,15 +790,27 @@ DenonAudio1::DenonAudio1( DenonAudio1a::DenonAudio1a( - QObject *guiObject, unsigned int index) - : DenonAudio1(guiObject, index) + : DenonAudio1(index) { setKeysetName("Audio Keyset 1a"); addControlledDevice(Denon_Make, "UCD-F07", Audio_Device); addControlledDevice(Denon_Make, "UDR-F07", Audio_Device); addControlledDevice(Denon_Make, "UDRA-F07", Audio_Device); +} + + +void DenonAudio1a::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + DenonAudio1::populateProtocol(guiObject); addSharpKey("rec", Record_Key, 0x04, 0x5F); addSharpKey("side_a/b", Unmapped_Key, 0x08, 0x53); @@ -650,14 +818,26 @@ DenonAudio1a::DenonAudio1a( DenonAudio1b::DenonAudio1b( - QObject *guiObject, unsigned int index) - : DenonAudio1(guiObject, index) + : DenonAudio1(index) { setKeysetName("Audio Keyset 1b"); addControlledDevice(Denon_Make, "DCD-1015", Audio_Device); addControlledDevice(Denon_Make, "DCD-655", Audio_Device); +} + + +void DenonAudio1b::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + DenonAudio1::populateProtocol(guiObject); addSharpKey("vol_up", VolumeUp_Key, 0x08, 0x4E); addSharpKey("vol_down", VolumeDown_Key, 0x08, 0x4F); @@ -666,22 +846,33 @@ DenonAudio1b::DenonAudio1b( DenonAudio1c::DenonAudio1c( - QObject *guiObject, unsigned int index) - : DenonAudio1b(guiObject, index) + : DenonAudio1b(index) { setKeysetName("Audio Keyset 1c"); addControlledDevice(Denon_Make, "DCM-260", Audio_Device); +} + + +void DenonAudio1c::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + DenonAudio1b::populateProtocol(guiObject); addSharpKey("DISC_SELECT", NextDisc_Key, 0x08, 0x62); } DenonAudio1d::DenonAudio1d( - QObject *guiObject, unsigned int index) - : DenonAudio1(guiObject, index) + : DenonAudio1(index) { setKeysetName("Audio Keyset 1d"); @@ -691,6 +882,19 @@ DenonAudio1d::DenonAudio1d( addControlledDevice(Denon_Make, "UDR-F88", Audio_Device); addControlledDevice(Denon_Make, "UTU-F88", Audio_Device); addControlledDevice(Denon_Make, "RC-846", Audio_Device); +} + + +void DenonAudio1d::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + DenonAudio1::populateProtocol(guiObject); addSharpKey("TAPE_REC", Record_Key, 0x04, 0x5F); @@ -703,7 +907,6 @@ DenonAudio1d::DenonAudio1d( DenonAudio2::DenonAudio2( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "Audio Keyset 2", @@ -711,6 +914,17 @@ DenonAudio2::DenonAudio2( index) { addControlledDevice(Denon_Make, "D-C30", Audio_Device); +} + + +void DenonAudio2::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } threadableProtocol = new NECProtocol(guiObject, index, false, true); @@ -757,7 +971,6 @@ DenonAudio2::DenonAudio2( DenonAudio3::DenonAudio3( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "Audio Keyset 3", @@ -765,6 +978,17 @@ DenonAudio3::DenonAudio3( index) { addControlledDevice(Denon_Make, "DMD-800", Audio_Device); +} + + +void DenonAudio3::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } threadableProtocol = new SharpProtocol(guiObject, index, false); @@ -803,7 +1027,6 @@ DenonAudio3::DenonAudio3( DenonAudio4::DenonAudio4( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "Audio Keyset 4", @@ -811,6 +1034,17 @@ DenonAudio4::DenonAudio4( index) { addControlledDevice(Denon_Make, "D-G1MD", Audio_Device); +} + + +void DenonAudio4::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } threadableProtocol = new NECProtocol(guiObject, index, true, true); diff --git a/keysets/denon.h b/keysets/denon.h index ea7ea18..adac371 100644 --- a/keysets/denon.h +++ b/keysets/denon.h @@ -9,168 +9,210 @@ class DenonDVD1: public PIRKeysetMetaData { public: DenonDVD1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class DenonDVD2: public PIRKeysetMetaData { public: DenonDVD2( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class DenonDVD3: public PIRKeysetMetaData { public: DenonDVD3( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class DenonReceiver1: public PIRKeysetMetaData { public: DenonReceiver1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class DenonReceiver1a: public DenonReceiver1 { public: DenonReceiver1a( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class DenonReceiver1b: public DenonReceiver1 { public: DenonReceiver1b( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class DenonReceiver1c: public DenonReceiver1 { public: DenonReceiver1c( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class DenonReceiver1d: public DenonReceiver1c { public: DenonReceiver1d( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class DenonReceiver1e: public DenonReceiver1d { public: DenonReceiver1e( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class DenonReceiver1f: public DenonReceiver1c { public: DenonReceiver1f( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class DenonReceiver2: public PIRKeysetMetaData { public: DenonReceiver2( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class DenonReceiver2a: public DenonReceiver2 { public: DenonReceiver2a( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class DenonReceiver3: public PIRKeysetMetaData { public: DenonReceiver3( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class DenonAudio1: public PIRKeysetMetaData { public: DenonAudio1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class DenonAudio1a: public DenonAudio1 { public: DenonAudio1a( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class DenonAudio1b: public DenonAudio1 { public: DenonAudio1b( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class DenonAudio1c: public DenonAudio1b { public: DenonAudio1c( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class DenonAudio1d: public DenonAudio1 { public: DenonAudio1d( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class DenonAudio2: public PIRKeysetMetaData { public: DenonAudio2( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class DenonAudio3: public PIRKeysetMetaData { public: DenonAudio3( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class DenonAudio4: public PIRKeysetMetaData { public: DenonAudio4( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; #endif // DENON_H diff --git a/keysets/digitalstream.cpp b/keysets/digitalstream.cpp index a873770..9769bc2 100644 --- a/keysets/digitalstream.cpp +++ b/keysets/digitalstream.cpp @@ -3,13 +3,24 @@ DigitalStreamReceiver::DigitalStreamReceiver( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "Receiver Keyset 1", DigitalStream_Make, index) { +} + + +void DigitalStreamReceiver::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + threadableProtocol = new NECProtocol(guiObject, index, true, true); setPreData(0x482C, 16); diff --git a/keysets/digitalstream.h b/keysets/digitalstream.h index d836c7b..2de6487 100644 --- a/keysets/digitalstream.h +++ b/keysets/digitalstream.h @@ -9,8 +9,10 @@ class DigitalStreamReceiver: public PIRKeysetMetaData { public: DigitalStreamReceiver( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; #endif // DIGITALSTREAM_H diff --git a/keysets/directv.cpp b/keysets/directv.cpp index 355dc52..5cf0a92 100644 --- a/keysets/directv.cpp +++ b/keysets/directv.cpp @@ -4,13 +4,24 @@ // Note: volume keys are tricky! DirectvReceiver1::DirectvReceiver1( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "Sat Keyset 1", Directv_Make, index) { +} + + +void DirectvReceiver1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + threadableProtocol = new DirectvProtocol(guiObject, index, LowFreq, true); setPreData(0xC, 4); diff --git a/keysets/directv.h b/keysets/directv.h index 8e2a20d..e06c92c 100644 --- a/keysets/directv.h +++ b/keysets/directv.h @@ -9,8 +9,10 @@ class DirectvReceiver1: public PIRKeysetMetaData { public: DirectvReceiver1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; #endif // DIRECTV_H diff --git a/keysets/dish.cpp b/keysets/dish.cpp index 690ee12..223b611 100644 --- a/keysets/dish.cpp +++ b/keysets/dish.cpp @@ -2,13 +2,24 @@ #include "protocols/dishprotocol.h" DishReceiver1::DishReceiver1( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "Sat Keyset 1", Dish_Make, index) { +} + + +void DishReceiver1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + threadableProtocol = new DishProtocol(guiObject, index); setPreData(0x00, 5); @@ -85,150 +96,345 @@ DishReceiver1::DishReceiver1( DishReceiver1a::DishReceiver1a( - QObject *guiObject, unsigned int index) - : DishReceiver1(guiObject, index) + : DishReceiver1(index) { setKeysetName("Sat Keyset 1 mode 2"); +} + + +void DishReceiver1a::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + DishReceiver1::populateProtocol(guiObject); + setPreData(0x01, 5); } DishReceiver1b::DishReceiver1b( - QObject *guiObject, unsigned int index) - : DishReceiver1(guiObject, index) + : DishReceiver1(index) { setKeysetName("Sat Keyset 1 mode 3"); +} + + +void DishReceiver1b::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + DishReceiver1::populateProtocol(guiObject); + setPreData(0x02, 5); } DishReceiver1c::DishReceiver1c( - QObject *guiObject, unsigned int index) - : DishReceiver1(guiObject, index) + : DishReceiver1(index) { setKeysetName("Sat Keyset 1 mode 4"); +} + + +void DishReceiver1c::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + DishReceiver1::populateProtocol(guiObject); + setPreData(0x03, 5); } DishReceiver1d::DishReceiver1d( - QObject *guiObject, unsigned int index) - : DishReceiver1(guiObject, index) + : DishReceiver1(index) { setKeysetName("Sat Keyset 1 mode 5"); +} + + +void DishReceiver1d::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + DishReceiver1::populateProtocol(guiObject); + setPreData(0x04, 5); } DishReceiver1e::DishReceiver1e( - QObject *guiObject, unsigned int index) - : DishReceiver1(guiObject, index) + : DishReceiver1(index) { setKeysetName("Sat Keyset 1 mode 6"); +} + + +void DishReceiver1e::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + DishReceiver1::populateProtocol(guiObject); + setPreData(0x05, 5); } DishReceiver1f::DishReceiver1f( - QObject *guiObject, unsigned int index) - : DishReceiver1(guiObject, index) + : DishReceiver1(index) { setKeysetName("Sat Keyset 1 mode 7"); +} + + +void DishReceiver1f::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + DishReceiver1::populateProtocol(guiObject); + setPreData(0x06, 5); } DishReceiver1g::DishReceiver1g( - QObject *guiObject, unsigned int index) - : DishReceiver1(guiObject, index) + : DishReceiver1(index) { setKeysetName("Sat Keyset 1 mode 8"); +} + + +void DishReceiver1g::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + DishReceiver1::populateProtocol(guiObject); + setPreData(0x07, 5); } DishReceiver1h::DishReceiver1h( - QObject *guiObject, unsigned int index) - : DishReceiver1(guiObject, index) + : DishReceiver1(index) { setKeysetName("Sat Keyset 1 mode 9"); +} + + +void DishReceiver1h::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + DishReceiver1::populateProtocol(guiObject); + setPreData(0x08, 5); } DishReceiver1i::DishReceiver1i( - QObject *guiObject, unsigned int index) - : DishReceiver1(guiObject, index) + : DishReceiver1(index) { setKeysetName("Sat Keyset 1 mode 10"); +} + + +void DishReceiver1i::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + DishReceiver1::populateProtocol(guiObject); + setPreData(0x09, 5); } DishReceiver1j::DishReceiver1j( - QObject *guiObject, unsigned int index) - : DishReceiver1(guiObject, index) + : DishReceiver1(index) { setKeysetName("Sat Keyset 1 mode 11"); +} + + +void DishReceiver1j::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + DishReceiver1::populateProtocol(guiObject); + setPreData(0x0A, 5); } DishReceiver1k::DishReceiver1k( - QObject *guiObject, unsigned int index) - : DishReceiver1(guiObject, index) + : DishReceiver1(index) { setKeysetName("Sat Keyset 1 mode 12"); +} + + +void DishReceiver1k::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + DishReceiver1::populateProtocol(guiObject); + setPreData(0x0B, 5); } DishReceiver1l::DishReceiver1l( - QObject *guiObject, unsigned int index) - : DishReceiver1(guiObject, index) + : DishReceiver1(index) { setKeysetName("Sat Keyset 1 mode 13"); +} + + +void DishReceiver1l::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + DishReceiver1::populateProtocol(guiObject); + setPreData(0x0C, 5); } DishReceiver1m::DishReceiver1m( - QObject *guiObject, unsigned int index) - : DishReceiver1(guiObject, index) + : DishReceiver1(index) { setKeysetName("Sat Keyset 1 mode 14"); +} + + +void DishReceiver1m::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + DishReceiver1::populateProtocol(guiObject); + setPreData(0x0D, 5); } DishReceiver1n::DishReceiver1n( - QObject *guiObject, unsigned int index) - : DishReceiver1(guiObject, index) + : DishReceiver1(index) { setKeysetName("Sat Keyset 1 mode 15"); +} + + +void DishReceiver1n::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + DishReceiver1::populateProtocol(guiObject); + setPreData(0x0E, 5); } DishReceiver1o::DishReceiver1o( - QObject *guiObject, unsigned int index) - : DishReceiver1(guiObject, index) + : DishReceiver1(index) { setKeysetName("Sat Keyset 1 mode 16"); +} + + +void DishReceiver1o::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + DishReceiver1::populateProtocol(guiObject); + setPreData(0x0F, 5); } diff --git a/keysets/dish.h b/keysets/dish.h index a78f569..e0c9949 100644 --- a/keysets/dish.h +++ b/keysets/dish.h @@ -9,128 +9,160 @@ class DishReceiver1: public PIRKeysetMetaData { public: DishReceiver1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class DishReceiver1a: public DishReceiver1 { public: DishReceiver1a( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class DishReceiver1b: public DishReceiver1 { public: DishReceiver1b( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class DishReceiver1c: public DishReceiver1 { public: DishReceiver1c( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class DishReceiver1d: public DishReceiver1 { public: DishReceiver1d( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class DishReceiver1e: public DishReceiver1 { public: DishReceiver1e( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class DishReceiver1f: public DishReceiver1 { public: DishReceiver1f( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class DishReceiver1g: public DishReceiver1 { public: DishReceiver1g( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class DishReceiver1h: public DishReceiver1 { public: DishReceiver1h( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class DishReceiver1i: public DishReceiver1 { public: DishReceiver1i( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class DishReceiver1j: public DishReceiver1 { public: DishReceiver1j( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class DishReceiver1k: public DishReceiver1 { public: DishReceiver1k( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class DishReceiver1l: public DishReceiver1 { public: DishReceiver1l( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class DishReceiver1m: public DishReceiver1 { public: DishReceiver1m( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class DishReceiver1n: public DishReceiver1 { public: DishReceiver1n( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class DishReceiver1o: public DishReceiver1 { public: DishReceiver1o( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; #endif // DISH_H diff --git a/keysets/ei.cpp b/keysets/ei.cpp index 1fe7955..35e12d9 100644 --- a/keysets/ei.cpp +++ b/keysets/ei.cpp @@ -3,7 +3,6 @@ // Based on LIRC Ei-TV90 config file EiTV1::EiTV1( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "TV Keyset 1", @@ -15,6 +14,17 @@ EiTV1::EiTV1( addControlledDevice(Ei_Make, "COLOR 63105", TV_Device); addControlledDevice(Ei_Make, "COLOR 56105", TV_Device); addControlledDevice(Ei_Make, "COLOR 72105", TV_Device); +} + + +void EiTV1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } threadableProtocol = new RC5Protocol(guiObject, index, 0x40); diff --git a/keysets/ei.h b/keysets/ei.h index 55703ed..d407f81 100644 --- a/keysets/ei.h +++ b/keysets/ei.h @@ -9,8 +9,10 @@ class EiTV1: public PIRKeysetMetaData { public: EiTV1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; #endif // EI_H diff --git a/keysets/elgato.cpp b/keysets/elgato.cpp index 484cb58..b482415 100644 --- a/keysets/elgato.cpp +++ b/keysets/elgato.cpp @@ -2,13 +2,24 @@ #include "protocols/necprotocol.h" ElgatoEyeTV1::ElgatoEyeTV1( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "EyeTV Keyset 1", Elgato_Make, index) { +} + + +void ElgatoEyeTV1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + threadableProtocol = new NECProtocol(guiObject, index, false, true); setPreData(0x45, 8); diff --git a/keysets/elgato.h b/keysets/elgato.h index 5a48fbd..5d2c064 100644 --- a/keysets/elgato.h +++ b/keysets/elgato.h @@ -9,8 +9,10 @@ class ElgatoEyeTV1: public PIRKeysetMetaData { public: ElgatoEyeTV1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; #endif // ELGATO_H diff --git a/keysets/emerson.cpp b/keysets/emerson.cpp index 010a616..7bc4268 100644 --- a/keysets/emerson.cpp +++ b/keysets/emerson.cpp @@ -2,13 +2,24 @@ #include "protocols/necprotocol.h" EmersonTV1::EmersonTV1( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "TV Keyset 1", Emerson_Make, index) { +} + + +void EmersonTV1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + threadableProtocol = new NECProtocol(guiObject, index, true, false); setPreData(0x0586, 16); @@ -44,13 +55,24 @@ EmersonTV1::EmersonTV1( EmersonDVD1::EmersonDVD1( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "DVD Keyset 1", Emerson_Make, index) { +} + + +void EmersonDVD1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + threadableProtocol = new NECProtocol(guiObject, index, true, true); setPreData(0x2287, 16); diff --git a/keysets/emerson.h b/keysets/emerson.h index 179032b..c0be67f 100644 --- a/keysets/emerson.h +++ b/keysets/emerson.h @@ -9,16 +9,20 @@ class EmersonTV1: public PIRKeysetMetaData { public: EmersonTV1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class EmersonDVD1: public PIRKeysetMetaData { public: EmersonDVD1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; #endif // EMERSON_H diff --git a/keysets/fortec.cpp b/keysets/fortec.cpp index eb10324..f082cfe 100644 --- a/keysets/fortec.cpp +++ b/keysets/fortec.cpp @@ -3,13 +3,24 @@ FortecReceiver1::FortecReceiver1( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "Sat Keyset 1", Fortec_Make, index) { +} + + +void FortecReceiver1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + threadableProtocol = new NECProtocol(guiObject, index, false, true); setPreData(0x20, 8); @@ -51,13 +62,24 @@ FortecReceiver1::FortecReceiver1( FortecReceiver2::FortecReceiver2( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "Sat Keyset 2", Fortec_Make, index) { +} + + +void FortecReceiver2::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + threadableProtocol = new NECProtocol(guiObject, index, true, true); setPreData(0xFD01, 8); diff --git a/keysets/fortec.h b/keysets/fortec.h index f316922..3040637 100644 --- a/keysets/fortec.h +++ b/keysets/fortec.h @@ -9,16 +9,20 @@ class FortecReceiver1: public PIRKeysetMetaData { public: FortecReceiver1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class FortecReceiver2: public PIRKeysetMetaData { public: FortecReceiver2( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; #endif // FORTEC_H diff --git a/keysets/goldstar.cpp b/keysets/goldstar.cpp index b09cc71..e9fbbf0 100644 --- a/keysets/goldstar.cpp +++ b/keysets/goldstar.cpp @@ -4,7 +4,6 @@ #include "protocols/lircprotocol.h" GoldStarTV1::GoldStarTV1( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "105-210A TV", @@ -12,6 +11,17 @@ GoldStarTV1::GoldStarTV1( index) { addControlledDevice(GoldStar_Make, "105-210A", TV_Device); +} + + +void GoldStarTV1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } threadableProtocol = new NECProtocol(guiObject, index, false, true); @@ -51,13 +61,24 @@ GoldStarTV1::GoldStarTV1( GoldStarTV2::GoldStarTV2( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "TV Keyset 2", GoldStar_Make, index) { +} + + +void GoldStarTV2::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + threadableProtocol = new RC5Protocol(guiObject, index, 0x40); addKey("0", Zero_Key, 0x00, 6); @@ -101,7 +122,6 @@ GoldStarTV2::GoldStarTV2( GoldStarVCR1::GoldStarVCR1( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "VCR Keyset 1", @@ -110,6 +130,17 @@ GoldStarVCR1::GoldStarVCR1( { addControlledDevice(GoldStar_Make, "GSE-Q204P", VCR_Device); addControlledDevice(GoldStar_Make, "QUISY 500", VCR_Device); +} + + +void GoldStarVCR1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } threadableProtocol = new NECProtocol(guiObject, index, false, true); @@ -166,33 +197,69 @@ GoldStarVCR1::GoldStarVCR1( GoldStarVCR1a::GoldStarVCR1a( - QObject *guiObject, unsigned int index) - : GoldStarVCR1(guiObject, index) + : GoldStarVCR1(index) { setKeysetName("VCR Keyset 1a"); +} + + +void GoldStarVCR1a::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + GoldStarVCR1::populateProtocol(guiObject); addKey("TU_AV", Input_Key, 0x56, 16); } GoldStarVCR1b::GoldStarVCR1b( - QObject *guiObject, unsigned int index) - : GoldStarVCR1(guiObject, index) + : GoldStarVCR1(index) { setKeysetName("VCR Keyset 1b"); +} + + +void GoldStarVCR1b::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + GoldStarVCR1::populateProtocol(guiObject); addKey("BACK", Exit_Key, 0x4C, 8); } GoldStarVCR1c::GoldStarVCR1c( - QObject *guiObject, unsigned int index) - : GoldStarVCR1(guiObject, index) + : GoldStarVCR1(index) { setKeysetName("VCR Keyset 1c"); +} + + +void GoldStarVCR1c::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + GoldStarVCR1::populateProtocol(guiObject); addKey("trk-", TrackingMinus_Key, 0xED, 8); addKey("trk+", TrackingPlus_Key, 0xEE, 8); @@ -201,9 +268,7 @@ GoldStarVCR1c::GoldStarVCR1c( } -// Based on LIRC 6710S-6000A config file GoldStarCD1::GoldStarCD1( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "Audio Keyset 1", @@ -211,6 +276,19 @@ GoldStarCD1::GoldStarCD1( index) { addControlledDevice(GoldStar_Make, "FFH-272A/L", Audio_Device); +} + + + +// Based on LIRC 6710S-6000A config file +void GoldStarCD1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } LIRCProtocol *lp = new LIRCProtocol( guiObject, diff --git a/keysets/goldstar.h b/keysets/goldstar.h index e694f28..6809724 100644 --- a/keysets/goldstar.h +++ b/keysets/goldstar.h @@ -9,8 +9,10 @@ class GoldStarTV1: public PIRKeysetMetaData { public: GoldStarTV1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; @@ -18,8 +20,10 @@ class GoldStarTV2: public PIRKeysetMetaData { public: GoldStarTV2( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; @@ -27,8 +31,10 @@ class GoldStarVCR1: public PIRKeysetMetaData { public: GoldStarVCR1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; @@ -36,8 +42,10 @@ class GoldStarVCR1a: public GoldStarVCR1 { public: GoldStarVCR1a( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; @@ -45,8 +53,10 @@ class GoldStarVCR1b: public GoldStarVCR1 { public: GoldStarVCR1b( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; @@ -54,8 +64,10 @@ class GoldStarVCR1c: public GoldStarVCR1 { public: GoldStarVCR1c( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; @@ -63,8 +75,10 @@ class GoldStarCD1: public PIRKeysetMetaData { public: GoldStarCD1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; #endif // GOLDSTAR_H diff --git a/keysets/grundig.cpp b/keysets/grundig.cpp index d883272..13352ea 100644 --- a/keysets/grundig.cpp +++ b/keysets/grundig.cpp @@ -5,13 +5,24 @@ // This one is iffy, might be another brand: GrundigSat1::GrundigSat1( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "Satellite Keyset 1", Grundig_Make, index) { +} + + +void GrundigSat1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + threadableProtocol = new RC5Protocol(guiObject, index); addKey("Mute", Mute_Key, 0x0286, 13); @@ -49,7 +60,6 @@ GrundigSat1::GrundigSat1( GrundigSat2::GrundigSat2( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "Satellite Keyset 2", @@ -57,6 +67,17 @@ GrundigSat2::GrundigSat2( index) { addControlledDevice(Grundig_Make, "STR 7100", Sat_Device); +} + + +void GrundigSat2::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } threadableProtocol = new RC5Protocol(guiObject, index); @@ -96,7 +117,6 @@ GrundigSat2::GrundigSat2( GrundigAmp1::GrundigAmp1( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "Amp Keyset 1", @@ -104,6 +124,17 @@ GrundigAmp1::GrundigAmp1( index) { addControlledDevice(Grundig_Make, "FineArts Amplifier V1", Audio_Device); +} + + +void GrundigAmp1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } threadableProtocol = new RC5Protocol(guiObject, index); @@ -159,7 +190,6 @@ GrundigAmp1::GrundigAmp1( GrundigAudio1::GrundigAudio1( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "Audio(CD) Keyset 1", @@ -167,6 +197,17 @@ GrundigAudio1::GrundigAudio1( index) { addControlledDevice(Grundig_Make, "CD 8400", Audio_Device); +} + + +void GrundigAudio1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } threadableProtocol = new RC5Protocol(guiObject, index); @@ -201,7 +242,6 @@ GrundigAudio1::GrundigAudio1( GrundigAudio2::GrundigAudio2( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "Audio Keyset 2", @@ -210,6 +250,17 @@ GrundigAudio2::GrundigAudio2( { addControlledDevice(Grundig_Make, "CDM 700", Audio_Device); addControlledDevice(Grundig_Make, "UMS-9V", Audio_Device); +} + + +void GrundigAudio2::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } threadableProtocol = new NECXProtocol(guiObject, index, true); @@ -254,7 +305,6 @@ GrundigAudio2::GrundigAudio2( GrundigVCR1::GrundigVCR1( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "VCR Keyset 1", @@ -262,6 +312,17 @@ GrundigVCR1::GrundigVCR1( index) { addControlledDevice(Grundig_Make, "GV 437", VCR_Device); +} + + +void GrundigVCR1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } threadableProtocol = new RC5Protocol(guiObject, index); @@ -305,11 +366,23 @@ GrundigVCR1::GrundigVCR1( GrundigVCR1a::GrundigVCR1a( - QObject *guiObject, unsigned int index) - : GrundigVCR1(guiObject, index) + : GrundigVCR1(index) { setKeysetName("VCR Keyset 1a"); +} + + +void GrundigVCR1a::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + GrundigVCR1::populateProtocol(guiObject); addKey("INDEX", Unmapped_Key, 0x0170, 13); addKey("PAUSE", Pause_Key, 0x1169, 13); @@ -317,7 +390,6 @@ GrundigVCR1a::GrundigVCR1a( GrundigTV1::GrundigTV1( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "TV Keyset 1", @@ -325,6 +397,17 @@ GrundigTV1::GrundigTV1( index) { addControlledDevice(Grundig_Make, "ST 55-908", TV_Device); +} + + +void GrundigTV1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } threadableProtocol = new RC5Protocol(guiObject, index); @@ -366,13 +449,24 @@ GrundigTV1::GrundigTV1( GrundigTV2::GrundigTV2( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "TV Keyset 2", Grundig_Make, index) { +} + + +void GrundigTV2::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + threadableProtocol = new RC5Protocol(guiObject, index); addKey("P+", ChannelUp_Key, 0x0010, 13); @@ -420,13 +514,24 @@ GrundigTV2::GrundigTV2( GrundigTV3::GrundigTV3( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "TV/VDR Keyset 3", Grundig_Make, index) { +} + + +void GrundigTV3::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + threadableProtocol = new RC5Protocol(guiObject, index); addKey("USR4", Unmapped_Key, 0x0205, 13); @@ -477,7 +582,6 @@ GrundigTV3::GrundigTV3( GrundigDVD1::GrundigDVD1( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "DVD Keyset 1", @@ -485,6 +589,17 @@ GrundigDVD1::GrundigDVD1( index) { addControlledDevice(Grundig_Make, "GDV 130", DVD_Device); +} + + +void GrundigDVD1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } threadableProtocol = new NECProtocol(guiObject, index, false, true); diff --git a/keysets/grundig.h b/keysets/grundig.h index 67e6a74..2b4bb4e 100644 --- a/keysets/grundig.h +++ b/keysets/grundig.h @@ -9,88 +9,110 @@ class GrundigSat1: public PIRKeysetMetaData { public: GrundigSat1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class GrundigSat2: public PIRKeysetMetaData { public: GrundigSat2( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class GrundigAmp1: public PIRKeysetMetaData { public: GrundigAmp1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class GrundigAudio1: public PIRKeysetMetaData { public: GrundigAudio1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class GrundigAudio2: public PIRKeysetMetaData { public: GrundigAudio2( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class GrundigVCR1: public PIRKeysetMetaData { public: GrundigVCR1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class GrundigVCR1a: public GrundigVCR1 { public: GrundigVCR1a( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class GrundigTV1: public PIRKeysetMetaData { public: GrundigTV1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class GrundigTV2: public PIRKeysetMetaData { public: GrundigTV2( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class GrundigTV3: public PIRKeysetMetaData { public: GrundigTV3( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class GrundigDVD1: public PIRKeysetMetaData { public: GrundigDVD1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; #endif // GRUNDIG_H diff --git a/keysets/haier.cpp b/keysets/haier.cpp index df14f06..250342f 100644 --- a/keysets/haier.cpp +++ b/keysets/haier.cpp @@ -2,7 +2,6 @@ #include "protocols/aiwaprotocol.h" HaierTV1::HaierTV1( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "TV Keyset 1", @@ -10,6 +9,17 @@ HaierTV1::HaierTV1( index) { addControlledDevice(Haier_Make, "TN201AUV", TV_Device); +} + + +void HaierTV1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } threadableProtocol = new AiwaProtocol(guiObject, index); diff --git a/keysets/haier.h b/keysets/haier.h index c0ae1ea..ff8ddf9 100644 --- a/keysets/haier.h +++ b/keysets/haier.h @@ -9,8 +9,10 @@ class HaierTV1: public PIRKeysetMetaData { public: HaierTV1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; #endif // HAIER_H diff --git a/keysets/hauppauge.cpp b/keysets/hauppauge.cpp index 25921a4..f98dbe0 100644 --- a/keysets/hauppauge.cpp +++ b/keysets/hauppauge.cpp @@ -2,7 +2,6 @@ #include "protocols/rc5protocol.h" HauppaugePCTV1::HauppaugePCTV1( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "PCTV Keyset 1", @@ -10,6 +9,18 @@ HauppaugePCTV1::HauppaugePCTV1( index) { addControlledDevice(Hauppauge_Make, "PVR 350", Computer_Device); +} + + +void HauppaugePCTV1::populateProtocol( + QObject *guiObject) +{ + + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } threadableProtocol = new RC5Protocol(guiObject, index, 0x5E); @@ -63,26 +74,50 @@ HauppaugePCTV1::HauppaugePCTV1( HauppaugePCTV1a::HauppaugePCTV1a( - QObject *guiObject, unsigned int index) - : HauppaugePCTV1(guiObject, index) + : HauppaugePCTV1(index) { setKeysetName("PCTV Keyset 1a"); addControlledDevice(Hauppauge_Make, "WinTV-HVR-950Q", Computer_Device); +} + + +void HauppaugePCTV1a::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + HauppaugePCTV1::populateProtocol(guiObject); setPreData(0x5D, 7); } HauppaugePCTV1b::HauppaugePCTV1b( - QObject *guiObject, unsigned int index) - : HauppaugePCTV1(guiObject, index) + : HauppaugePCTV1(index) { setKeysetName("PCTV Keyset 1b"); addControlledDevice(Hauppauge_Make, "MVP", Computer_Device); +} + + +void HauppaugePCTV1b::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + HauppaugePCTV1::populateProtocol(guiObject); setPreData(0x43, 7); @@ -92,14 +127,26 @@ HauppaugePCTV1b::HauppaugePCTV1b( HauppaugePCTV1c::HauppaugePCTV1c( - QObject *guiObject, unsigned int index) - : HauppaugePCTV1(guiObject, index) + : HauppaugePCTV1(index) { setKeysetName("PCTV Keyset 1c"); addControlledDevice(Hauppauge_Make, "PVR 250", Computer_Device); // addControlledDevice(Hauppauge_Make, "PVR 350", Computer_Device); +} + + +void HauppaugePCTV1c::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + HauppaugePCTV1::populateProtocol(guiObject); setPreData(0x5F, 7); @@ -108,9 +155,7 @@ HauppaugePCTV1c::HauppaugePCTV1c( } -// Based on LIRC Sony_RM-V302-DVD010 config file HauppaugePCTV2::HauppaugePCTV2( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "PCTV Keyset 2", @@ -118,6 +163,18 @@ HauppaugePCTV2::HauppaugePCTV2( index) { addControlledDevice(Hauppauge_Make, "PVR-250", Computer_Device); +} + + +// Based on LIRC Sony_RM-V302-DVD010 config file +void HauppaugePCTV2::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } threadableProtocol = new RC5Protocol(guiObject, index); diff --git a/keysets/hauppauge.h b/keysets/hauppauge.h index 7b74e28..5229d9f 100644 --- a/keysets/hauppauge.h +++ b/keysets/hauppauge.h @@ -9,40 +9,50 @@ class HauppaugePCTV1: public PIRKeysetMetaData { public: HauppaugePCTV1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class HauppaugePCTV1a: public HauppaugePCTV1 { public: HauppaugePCTV1a( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class HauppaugePCTV1b: public HauppaugePCTV1 { public: HauppaugePCTV1b( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class HauppaugePCTV1c: public HauppaugePCTV1 { public: HauppaugePCTV1c( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class HauppaugePCTV2: public PIRKeysetMetaData { public: HauppaugePCTV2( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; #endif // HAUPPAUGE_H diff --git a/keysets/hitachi.cpp b/keysets/hitachi.cpp index 2330c84..d1321e1 100644 --- a/keysets/hitachi.cpp +++ b/keysets/hitachi.cpp @@ -3,13 +3,24 @@ HitachiTV1::HitachiTV1( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "TV Keyset 1", Hitachi_Make, index) { +} + + +void HitachiTV1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + threadableProtocol = new NECProtocol(guiObject, index, false, true); // setPreData(0x0AF5, 16); @@ -72,21 +83,45 @@ HitachiTV1::HitachiTV1( HitachiTV1a::HitachiTV1a( - QObject *guiObject, unsigned int index) - : HitachiTV1(guiObject, index) + : HitachiTV1(index) { setKeysetName("TV Keyset 1a"); +} + + +void HitachiTV1a::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + HitachiTV1::populateProtocol(guiObject); addKey("menu", Menu_Key, 0x53, 8); } HitachiTV1b::HitachiTV1b( - QObject *guiObject, unsigned int index) - : HitachiTV1a(guiObject, index) + : HitachiTV1a(index) { setKeysetName("TV Keyset 1b"); +} + + +void HitachiTV1b::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + HitachiTV1a::populateProtocol(guiObject); addKey("Sound+", VolumeUp_Key, 0x72, 8); addKey("Sound-", VolumeDown_Key, 0x73, 8); @@ -95,13 +130,25 @@ HitachiTV1b::HitachiTV1b( HitachiTV1c::HitachiTV1c( - QObject *guiObject, unsigned int index) - : HitachiTV1(guiObject, index) + : HitachiTV1(index) { setKeysetName("TV Keyset 1c"); addControlledDevice(Hitachi_Make, "57F510", TV_Device); +} + + +void HitachiTV1c::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + HitachiTV1::populateProtocol(guiObject); addKey("LastChannel", PrevChannel_Key, 0x0A, 8); addKey("Info", Info_Key, 0x10, 8); @@ -150,13 +197,24 @@ HitachiTV1c::HitachiTV1c( // Taken from Hitachi 42HDM12.rmdu, a plasma HDMI monitor without a tuner HitachiTV2::HitachiTV2( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "TV (monitor) Keyset 2", Hitachi_Make, index) { +} + + +void HitachiTV2::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + threadableProtocol = new NECProtocol(guiObject, index, false, true); setPreData(0x50, 8); // This might be wrong... @@ -191,13 +249,18 @@ HitachiTV2::HitachiTV2( // See: http://www.hitachi-america.us/supportingdocs/forhome/ubcg/remote_ir_codes/2009_RC_Layouts_and_IR_Codes_L19_L26.pdf HitachiTV3::HitachiTV3( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "TV Keyset 3", Hitachi_Make, index) { +} + + +void HitachiTV3::populateProtocol( + QObject *guiObject) +{ threadableProtocol = new NECProtocol(guiObject, index, false, true); // setPreData(0x0AF5, 16); @@ -274,13 +337,24 @@ HitachiTV3::HitachiTV3( HitachiProjector::HitachiProjector( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "Projector Keyset", Hitachi_Make, index) { +} + + +void HitachiProjector::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + threadableProtocol = new NECProtocol(guiObject, index, true, true); // setPreData(0xE1A2, 16); @@ -316,13 +390,24 @@ HitachiProjector::HitachiProjector( HitachiDVD1::HitachiDVD1( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "DVD Keyset 1", Hitachi_Make, index) { +} + + +void HitachiDVD1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + threadableProtocol = new NECProtocol(guiObject, index, true, true); // setPreData(0x01C4, 16); @@ -373,7 +458,6 @@ HitachiDVD1::HitachiDVD1( HitachiAudio1::HitachiAudio1( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "Audio Keyset 1", @@ -382,6 +466,17 @@ HitachiAudio1::HitachiAudio1( { addControlledDevice(Hitachi_Make, "FX-7", Audio_Device); addControlledDevice(Hitachi_Make, "FX-77", Audio_Device); +} + + +void HitachiAudio1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } threadableProtocol = new NECProtocol(guiObject, index, false, true); @@ -421,13 +516,24 @@ HitachiAudio1::HitachiAudio1( HitachiVCR1::HitachiVCR1( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "VCR Keyset 1", Hitachi_Make, index) { +} + + +void HitachiVCR1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + threadableProtocol = new NECProtocol(guiObject, index, false, true); // setPreData(0x06F9, 16); diff --git a/keysets/hitachi.h b/keysets/hitachi.h index bbc6e5f..e7831f4 100644 --- a/keysets/hitachi.h +++ b/keysets/hitachi.h @@ -9,80 +9,100 @@ class HitachiTV1: public PIRKeysetMetaData { public: HitachiTV1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class HitachiTV1a: public HitachiTV1 { public: HitachiTV1a( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class HitachiTV1b: public HitachiTV1a { public: HitachiTV1b( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class HitachiTV1c: public HitachiTV1 { public: HitachiTV1c( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class HitachiTV2: public PIRKeysetMetaData { public: HitachiTV2( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class HitachiTV3: public PIRKeysetMetaData { public: HitachiTV3( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class HitachiProjector: public PIRKeysetMetaData { public: HitachiProjector( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class HitachiDVD1: public PIRKeysetMetaData { public: HitachiDVD1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class HitachiAudio1: public PIRKeysetMetaData { public: HitachiAudio1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class HitachiVCR1: public PIRKeysetMetaData { public: HitachiVCR1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; #endif // HITACHI_H diff --git a/keysets/homecast.cpp b/keysets/homecast.cpp index 423e7c4..e6be8bb 100644 --- a/keysets/homecast.cpp +++ b/keysets/homecast.cpp @@ -3,13 +3,24 @@ HomecastReceiver1::HomecastReceiver1( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "Sat Keyset 1", Homecast_Make, index) { +} + + +void HomecastReceiver1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + threadableProtocol = new NECProtocol(guiObject, index, true, true); setPreData(0x2020, 16); @@ -52,13 +63,24 @@ HomecastReceiver1::HomecastReceiver1( HomecastReceiver2::HomecastReceiver2( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "DVB-T Keyset 1", Homecast_Make, index) { +} + + +void HomecastReceiver2::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + threadableProtocol = new NECProtocol(guiObject, index, true, true); setPreData(0x4040, 16); diff --git a/keysets/homecast.h b/keysets/homecast.h index a8e36f7..90f88ee 100644 --- a/keysets/homecast.h +++ b/keysets/homecast.h @@ -9,16 +9,20 @@ class HomecastReceiver1: public PIRKeysetMetaData { public: HomecastReceiver1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class HomecastReceiver2: public PIRKeysetMetaData { public: HomecastReceiver2( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; #endif // HOMECAST_H diff --git a/keysets/hp.cpp b/keysets/hp.cpp new file mode 100644 index 0000000..cfa598f --- /dev/null +++ b/keysets/hp.cpp @@ -0,0 +1,55 @@ +#include "hp.h" +#include "protocols/mceprotocol.h" + + +HPRemote1::HPRemote1( + unsigned int index) + : PIRKeysetMetaData( + "Remote Keyset 1", + HP_Make, + index) +{ +} + + +void HPRemote1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // Keyset already populated. + return; + } + + threadableProtocol = new MCEProtocol(guiObject, index, 0x8011); + + setPreData(0x04, 7); + + addKey("KEY_POWER", Power_Key, 0x0C, 8); + addKey("KEY_MEDIA", Unmapped_Key, 0x0D, 8); + addKey("KEY_MUTE", Mute_Key, 0x0E, 8); + addKey("KEY_INFO", Info_Key, 0x0F, 8); + + addKey("KEY_VOLUMEUP", VolumeUp_Key, 0x10, 8); + addKey("KEY_VOLUMEDOWN", VolumeDown_Key, 0x11, 8); + addKey("KEY_PAGEUP", PageUp_Key, 0x12, 8); + addKey("KEY_PAGEDOWN", PageDown_Key, 0x13, 8); + addKey("KEY_FASTFORWARD", FastForward_Key, 0x14, 8); + addKey("KEY_REWIND", Rewind_Key, 0x15, 8); + addKey("KEY_PLAYPAUSE", Play_Key, 0x16, 8); + addKey("KEY_PLAYPAUSE", Pause_Key, 0x16, 8); + addKey("KEY_STOP", Stop_Key, 0x19, 8); + addKey("KEY_NEXTSONG", Next_Key, 0x1A, 8); + addKey("KEY_PREVIOUSSONG", Previous_Key, 0x1B, 8); + addKey("KEY_UP", Up_Key, 0x1E, 8); + addKey("KEY_DOWN", Down_Key, 0x1F, 8); + + addKey("KEY_LEFT", Left_Key, 0x20, 8); + addKey("KEY_RIGHT", Right_Key, 0x21, 8); + addKey("KEY_OK", Select_Key, 0x22, 8); + addKey("KEY_ENTER", Enter_Key, 0x23, 8); + addKey("KEY_DVD", DiscMenu_Key, 0x24, 8); + + addKey("KEY_REPEAT", Repeat_Key, 0x4A, 8); + addKey("KEY_SWITCHVIDEOMODE", Input_Key, 0x4F, 8); +} diff --git a/keysets/hp.h b/keysets/hp.h new file mode 100644 index 0000000..94ed006 --- /dev/null +++ b/keysets/hp.h @@ -0,0 +1,18 @@ +#ifndef HP_H +#define HP_H + +#include "pirkeysetmetadata.h" + +class QObject; + +class HPRemote1: public PIRKeysetMetaData +{ +public: + HPRemote1( + unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); +}; + +#endif // HP_H diff --git a/keysets/huawei.cpp b/keysets/huawei.cpp index ad433ac..d5dabef 100644 --- a/keysets/huawei.cpp +++ b/keysets/huawei.cpp @@ -4,7 +4,6 @@ HuaweiSTB1::HuaweiSTB1( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "STB Keyset 1", @@ -12,6 +11,17 @@ HuaweiSTB1::HuaweiSTB1( index) { addControlledDevice(Huawei_Make, "EX2108", Other_Device); +} + + +void HuaweiSTB1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } threadableProtocol = new NECXProtocol(guiObject, index, false); @@ -56,7 +66,6 @@ HuaweiSTB1::HuaweiSTB1( HuaweiSTB2::HuaweiSTB2( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "STB Keyset 2", @@ -64,6 +73,17 @@ HuaweiSTB2::HuaweiSTB2( index) { addControlledDevice(Huawei_Make, "EC2108", Other_Device); +} + + +void HuaweiSTB2::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } threadableProtocol = new NECProtocol(guiObject, index, false, true); diff --git a/keysets/huawei.h b/keysets/huawei.h index 8c67c6c..fd3605a 100644 --- a/keysets/huawei.h +++ b/keysets/huawei.h @@ -9,16 +9,20 @@ class HuaweiSTB1: public PIRKeysetMetaData { public: HuaweiSTB1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class HuaweiSTB2: public PIRKeysetMetaData { public: HuaweiSTB2( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; #endif // HUAWEI_H diff --git a/keysets/jvc.cpp b/keysets/jvc.cpp index f34ed93..47c047e 100644 --- a/keysets/jvc.cpp +++ b/keysets/jvc.cpp @@ -3,13 +3,24 @@ #include "protocols/lircprotocol.h" JVCSat1::JVCSat1( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "Sat (Dish) Keyset 1", JVC_Make, index) { +} + + +void JVCSat1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + LIRCProtocol *lp = new LIRCProtocol( guiObject, index, @@ -70,13 +81,24 @@ JVCSat1::JVCSat1( JVCSat2::JVCSat2( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "Sat (Dish) Keyset 2", JVC_Make, index) { +} + + +void JVCSat2::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + LIRCProtocol *lp = new LIRCProtocol( guiObject, index, @@ -136,13 +158,24 @@ JVCSat2::JVCSat2( JVCVCR1::JVCVCR1( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "VCR Keyset 1", JVC_Make, index) { +} + + +void JVCVCR1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + threadableProtocol = new JVCProtocol(guiObject, index); // setPreData(0xC2, 8); @@ -228,11 +261,23 @@ JVCVCR1::JVCVCR1( JVCVCR1a::JVCVCR1a( - QObject *guiObject, unsigned int index) - : JVCVCR1(guiObject, index) + : JVCVCR1(index) { setKeysetName("VCR Keyset 1a"); +} + + +void JVCVCR1a::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + JVCVCR1::populateProtocol(guiObject); addKey("red", Red_Key, 0x07, 8); addKey("green", Green_Key, 0x51, 8); @@ -246,35 +291,70 @@ JVCVCR1a::JVCVCR1a( // Setup keysets for use in B-mode: JVCVCRBmode1::JVCVCRBmode1( - QObject *guiObject, unsigned int index) - : JVCVCR1(guiObject, index) + : JVCVCR1(index) { setKeysetName("VCR (B Mode) keyset 1"); +} + + +void JVCVCRBmode1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + JVCVCR1::populateProtocol(guiObject); setPreData(0x53, 8); } JVCVCRBmode1a::JVCVCRBmode1a( - QObject *guiObject, unsigned int index) - : JVCVCR1a(guiObject, index) + : JVCVCR1a(index) { setKeysetName("VCR (B Mode) keyset 1a"); +} + + +void JVCVCRBmode1a::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + JVCVCR1a::populateProtocol(guiObject); setPreData(0x53, 8); } JVCTV1::JVCTV1( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "TV Keyset 1", JVC_Make, index) { +} + + +void JVCTV1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + threadableProtocol = new JVCProtocol(guiObject, index); setPreData(0x03, 8); @@ -355,33 +435,69 @@ JVCTV1::JVCTV1( JVCTV1a::JVCTV1a( - QObject *guiObject, unsigned int index) - : JVCTV1(guiObject, index) + : JVCTV1(index) { setKeysetName("TV Keyset 1a"); +} + + +void JVCTV1a::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + JVCTV1::populateProtocol(guiObject); addKey("+10", DoubleDigit_Key, 0x71, 8); } JVCTV1b::JVCTV1b( - QObject *guiObject, unsigned int index) - : JVCTV1(guiObject, index) + : JVCTV1(index) { setKeysetName("TV Keyset 1b"); +} + + +void JVCTV1b::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + JVCTV1::populateProtocol(guiObject); addKey("sleep_timer", Sleep_Key, 0x03, 8); } JVCTV1c::JVCTV1c( - QObject *guiObject, unsigned int index) - : JVCTV1(guiObject, index) + : JVCTV1(index) { setKeysetName("TV Keyset 1c"); +} + + +void JVCTV1c::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + JVCTV1::populateProtocol(guiObject); addKey("STOP", Stop_Key, 0x00, 8); addKey("REC", Record_Key, 0x04, 8); @@ -394,11 +510,23 @@ JVCTV1c::JVCTV1c( // TVs where "volume" and "channel" keys are used to navigate menus: JVCTV1d::JVCTV1d( - QObject *guiObject, unsigned int index) - : JVCTV1(guiObject, index) + : JVCTV1(index) { setKeysetName("TV Keyset 1d"); +} + + +void JVCTV1d::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + JVCTV1::populateProtocol(guiObject); addKey("down", Down_Key, 0x18, 8); addKey("up", Up_Key, 0x19, 8); @@ -408,13 +536,24 @@ JVCTV1d::JVCTV1d( JVCDAT1::JVCDAT1( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "DAT Keyset 1", JVC_Make, index) { +} + + +void JVCDAT1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + threadableProtocol = new JVCProtocol(guiObject, index); // setPreData(0xC9, 8); @@ -455,13 +594,24 @@ JVCDAT1::JVCDAT1( JVCCarDeck1::JVCCarDeck1( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "Car Deck Keyset 1", JVC_Make, index) { +} + + +void JVCCarDeck1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + threadableProtocol = new JVCProtocol(guiObject, index); // setPreData(0xF1, 8); @@ -488,13 +638,24 @@ JVCCarDeck1::JVCCarDeck1( // together, they might as well all be a single command anyway... JVCAudio1::JVCAudio1( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "Audio Keyset 1", JVC_Make, index) { +} + + +void JVCAudio1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + threadableProtocol = new JVCProtocol(guiObject, index); addKey("SLEEP", Sleep_Key, 0x03A3, 16); @@ -549,11 +710,23 @@ JVCAudio1::JVCAudio1( JVCAudio1a::JVCAudio1a( - QObject *guiObject, unsigned int index) - : JVCAudio1(guiObject, index) + : JVCAudio1(index) { setKeysetName("Audio Keyset 1a"); +} + + +void JVCAudio1a::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + JVCAudio1::populateProtocol(guiObject); addKey("CD-PLAY-PAUSE", Play_Key, 0x3DA3, 16); addKey("MD-PLAY-PAUSE", Unmapped_Key, 0x30AF, 16); @@ -561,11 +734,23 @@ JVCAudio1a::JVCAudio1a( JVCAudio1b::JVCAudio1b( - QObject *guiObject, unsigned int index) - : JVCAudio1(guiObject, index) + : JVCAudio1(index) { setKeysetName("Audio Keyset 1b"); +} + + +void JVCAudio1b::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + JVCAudio1::populateProtocol(guiObject); addKey("VCR", VCRInput_Key, 0x2443, 16); @@ -623,13 +808,24 @@ JVCAudio1b::JVCAudio1b( JVCAudio2::JVCAudio2( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "Audio Keyset 2", JVC_Make, index) { +} + + +void JVCAudio2::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + threadableProtocol = new JVCProtocol(guiObject, index); // setPreData(0xF9, 8); @@ -714,13 +910,24 @@ JVCAudio2::JVCAudio2( JVCDVD1::JVCDVD1( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "DVD Keyset 1", JVC_Make, index) { +} + + +void JVCDVD1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + threadableProtocol = new JVCProtocol(guiObject, index); // setPreData(0xF7, 8); diff --git a/keysets/jvc.h b/keysets/jvc.h index df08fe9..92553a4 100644 --- a/keysets/jvc.h +++ b/keysets/jvc.h @@ -9,144 +9,180 @@ class JVCSat1: public PIRKeysetMetaData { public: JVCSat1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class JVCSat2: public PIRKeysetMetaData { public: JVCSat2( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class JVCVCR1: public PIRKeysetMetaData { public: JVCVCR1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class JVCVCR1a: public JVCVCR1 { public: JVCVCR1a( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class JVCVCRBmode1: public JVCVCR1 { public: JVCVCRBmode1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class JVCVCRBmode1a: public JVCVCR1a { public: JVCVCRBmode1a( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class JVCTV1: public PIRKeysetMetaData { public: JVCTV1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class JVCTV1a: public JVCTV1 { public: JVCTV1a( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class JVCTV1b: public JVCTV1 { public: JVCTV1b( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class JVCTV1c: public JVCTV1 { public: JVCTV1c( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class JVCTV1d: public JVCTV1 { public: JVCTV1d( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class JVCDAT1: public PIRKeysetMetaData { public: JVCDAT1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class JVCCarDeck1: public PIRKeysetMetaData { public: JVCCarDeck1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class JVCAudio1: public PIRKeysetMetaData { public: JVCAudio1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class JVCAudio1a: public JVCAudio1 { public: JVCAudio1a( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class JVCAudio1b: public JVCAudio1 { public: JVCAudio1b( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class JVCAudio2: public PIRKeysetMetaData { public: JVCAudio2( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class JVCDVD1: public PIRKeysetMetaData { public: JVCDVD1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; #endif // JVC_H diff --git a/keysets/kenwood.cpp b/keysets/kenwood.cpp index 96653b0..0756fba 100644 --- a/keysets/kenwood.cpp +++ b/keysets/kenwood.cpp @@ -3,13 +3,24 @@ KenwoodAudio1::KenwoodAudio1( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "Audio Keyset 1", Kenwood_Make, index) { +} + + +void KenwoodAudio1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + threadableProtocol = new NECProtocol(guiObject, index, false, true); setPreData(0xB8, 8); @@ -108,13 +119,24 @@ KenwoodAudio2::KenwoodAudio2( KenwoodComponent1::KenwoodComponent1( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "Component Keyset 1", Kenwood_Make, index) { +} + + +void KenwoodComponent1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + threadableProtocol = new NECProtocol(guiObject, index, true, true); setPreData(0x00B8, 16); @@ -196,13 +218,24 @@ KenwoodComponent1::KenwoodComponent1( KenwoodComponent2::KenwoodComponent2( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "Component Keyset 2", Kenwood_Make, index) { +} + + +void KenwoodComponent2::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + threadableProtocol = new NECProtocol(guiObject, index, true, true); setPreData(0x01B8, 16); @@ -245,13 +278,24 @@ KenwoodComponent2::KenwoodComponent2( KenwoodComponent3::KenwoodComponent3( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "Component Keyset 3", Kenwood_Make, index) { +} + + +void KenwoodComponent3::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + threadableProtocol = new NECProtocol(guiObject, index, true, true); setPreData(0x02B8, 16); @@ -322,13 +366,24 @@ KenwoodAudio5::KenwoodAudio5( KenwoodCD1::KenwoodCD1( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "CD Keyset 1", Kenwood_Make, index) { +} + + +void KenwoodCD1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + threadableProtocol = new NECProtocol(guiObject, index, false, true); setPreData(0xB6, 8); @@ -405,7 +460,6 @@ KenwoodCD1::KenwoodCD1( KenwoodDVD1::KenwoodDVD1( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "DVD Keyset 1", @@ -413,6 +467,17 @@ KenwoodDVD1::KenwoodDVD1( index) { addControlledDevice(Kenwood_Make, "DVF-9010", Audio_Device); +} + + +void KenwoodDVD1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } threadableProtocol = new NECProtocol(guiObject, index, true, true); @@ -472,13 +537,24 @@ KenwoodDVD1::KenwoodDVD1( KenwoodTV1::KenwoodTV1( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "TV Keyset 1", Kenwood_Make, index) { +} + + +void KenwoodTV1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + threadableProtocol = new NECProtocol(guiObject, index, false, true); setPreData(0x04, 8); diff --git a/keysets/kenwood.h b/keysets/kenwood.h index 32a5907..21c5f95 100644 --- a/keysets/kenwood.h +++ b/keysets/kenwood.h @@ -9,56 +9,70 @@ class KenwoodAudio1: public PIRKeysetMetaData { public: KenwoodAudio1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class KenwoodComponent1: public PIRKeysetMetaData { public: KenwoodComponent1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class KenwoodComponent2: public PIRKeysetMetaData { public: KenwoodComponent2( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class KenwoodComponent3: public PIRKeysetMetaData { public: KenwoodComponent3( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class KenwoodCD1: public PIRKeysetMetaData { public: KenwoodCD1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class KenwoodDVD1: public PIRKeysetMetaData { public: KenwoodDVD1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class KenwoodTV1: public PIRKeysetMetaData { public: KenwoodTV1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; #endif // KENWOOD_H diff --git a/keysets/lg.cpp b/keysets/lg.cpp index 8133e06..e8aaa42 100644 --- a/keysets/lg.cpp +++ b/keysets/lg.cpp @@ -4,7 +4,6 @@ #include "protocols/rc5protocol.h" LGTV1::LGTV1( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "TV Keyset 1", @@ -12,6 +11,17 @@ LGTV1::LGTV1( index) { addControlledDevice(LG_Make, "32LH301C", TV_Device); +} + + +void LGTV1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } threadableProtocol = new NECProtocol(guiObject, index, false, true); @@ -117,11 +127,23 @@ LGTV1::LGTV1( LGTV1a::LGTV1a( - QObject *guiObject, unsigned int index) - : LGTV1(guiObject, index) + : LGTV1(index) { setKeysetName("TV Keyset 1a"); +} + + +void LGTV1a::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + LGTV1::populateProtocol(guiObject); addKey("*", Unmapped_Key, 0x39, 8); addKey("exit", Exit_Key, 0x5B, 8); @@ -138,11 +160,23 @@ LGTV1a::LGTV1a( LGTV1b::LGTV1b( - QObject *guiObject, unsigned int index) - : LGTV1(guiObject, index) + : LGTV1(index) { setKeysetName("TV Keyset 1b"); +} + + +void LGTV1b::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + LGTV1::populateProtocol(guiObject); addKey("PR+/Up_Arrow", Up_Key, 0x00, 8); addKey("PR-/Down_Arrow", Down_Key, 0x01, 8); @@ -156,15 +190,27 @@ LGTV1b::LGTV1b( LGTV1c::LGTV1c( - QObject *guiObject, unsigned int index) - : LGTV1(guiObject, index) + : LGTV1(index) { setKeysetName("TV Keyset 1c"); addControlledDevice(LG_Make, "60px950", TV_Device); addControlledDevice(LG_Make, "60pg60", TV_Device); addControlledDevice(LG_Make, "55lw9500", TV_Device); +} + + +void LGTV1c::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + LGTV1::populateProtocol(guiObject); // addKey("Mark", Unmapped_Key, 0x1E, 8); // This is probably an error // addKey("3DOption", Unmapped_Key, 0x45, 8); // also probably error @@ -185,13 +231,24 @@ LGTV1c::LGTV1c( LGTV2::LGTV2( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "TV Keyset 2", LG_Make, index) { +} + + +void LGTV2::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + threadableProtocol = new RC5Protocol(guiObject, index, 0x40); addKey("0", Zero_Key, 0x00, 6); @@ -241,11 +298,23 @@ LGTV2::LGTV2( LGTV2a::LGTV2a( - QObject *guiObject, unsigned int index) - : LGTV2(guiObject, index) + : LGTV2(index) { setKeysetName("TV Keyset 2a"); +} + + +void LGTV2a::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + LGTV2::populateProtocol(guiObject); addKey("KEY_YELLOW", Yellow_Key, 0x32, 6); addKey("KEY_BLUE", Blue_Key, 0x34, 6); @@ -255,11 +324,23 @@ LGTV2a::LGTV2a( LGTV2b::LGTV2b( - QObject *guiObject, unsigned int index) - : LGTV2(guiObject, index) + : LGTV2(index) { setKeysetName("TV Keyset 2b"); +} + + +void LGTV2b::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + LGTV2::populateProtocol(guiObject); addKey("sleep", Sleep_Key, 0x26, 6); // might need separate class addKey("Q.VIEW", Unmapped_Key, 0x32, 6); @@ -270,13 +351,24 @@ LGTV2b::LGTV2b( LGDisc1::LGDisc1( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "DVD/BD Keyset 1", LG_Make, index) { +} + + +void LGDisc1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + threadableProtocol = new NECXProtocol(guiObject, index, true); // setPreData(0x3434, 16); @@ -346,13 +438,24 @@ LGDisc1::LGDisc1( LGDisc2::LGDisc2( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "DVD/BD Keyset 2", LG_Make, index) { +} + + +void LGDisc2::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + threadableProtocol = new NECXProtocol(guiObject, index, true); // setPreData(0xB4B4, 16); @@ -408,11 +511,23 @@ LGDisc2::LGDisc2( LGDisc2a::LGDisc2a( - QObject *guiObject, unsigned int index) - : LGDisc2(guiObject, index) + : LGDisc2(index) { setKeysetName("DVD/BD Keyset 2a"); +} + + +void LGDisc2a::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + LGDisc2::populateProtocol(guiObject); addKey("KEY_HOME", Menu_Key, 0x67, 8); addKey("KEY_CLEAR", Clear_Key, 0x7C, 8); @@ -424,13 +539,24 @@ LGDisc2a::LGDisc2a( LGVCR1::LGVCR1( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "VCR Keyset 1", LG_Make, index) { +} + + +void LGVCR1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + threadableProtocol = new NECProtocol(guiObject, index, false, true); // setPreData(0x7689, 16); @@ -489,22 +615,46 @@ LGVCR1::LGVCR1( LGVCR1a::LGVCR1a( - QObject *guiObject, unsigned int index) - : LGVCR1(guiObject, index) + : LGVCR1(index) { setKeysetName("VCR Keyset 1a"); +} + + +void LGVCR1a::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + LGVCR1::populateProtocol(guiObject); addKey("power", Power_Key, 0x7D, 8); } LGVCR1b::LGVCR1b( - QObject *guiObject, unsigned int index) - : LGVCR1(guiObject, index) + : LGVCR1(index) { setKeysetName("VCR Keyset 1b"); +} + + +void LGVCR1b::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + LGVCR1::populateProtocol(guiObject); addKey("menu-up", Up_Key, 0x82, 8); addKey("menu-left", Left_Key, 0x83, 8); @@ -515,13 +665,24 @@ LGVCR1b::LGVCR1b( LGAC1::LGAC1( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "Air Conditioner 1", LG_Make, index) { +} + + +void LGAC1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + threadableProtocol = new NECProtocol(guiObject, index, true, true); setPreData(0x6681, 16); diff --git a/keysets/lg.h b/keysets/lg.h index c35ba87..5fd1096 100644 --- a/keysets/lg.h +++ b/keysets/lg.h @@ -9,112 +9,140 @@ class LGTV1: public PIRKeysetMetaData { public: LGTV1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class LGTV1a: public LGTV1 { public: LGTV1a( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class LGTV1b: public LGTV1 { public: LGTV1b( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class LGTV1c: public LGTV1 { public: LGTV1c( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class LGTV2: public PIRKeysetMetaData { public: LGTV2( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class LGTV2a: public LGTV2 { public: LGTV2a( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class LGTV2b: public LGTV2 { public: LGTV2b( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class LGDisc1: public PIRKeysetMetaData { public: LGDisc1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class LGDisc2: public PIRKeysetMetaData { public: LGDisc2( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class LGDisc2a: public LGDisc2 { public: LGDisc2a( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class LGVCR1: public PIRKeysetMetaData { public: LGVCR1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class LGVCR1a: public LGVCR1 { public: LGVCR1a( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class LGVCR1b: public LGVCR1 { public: LGVCR1b( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class LGAC1: public PIRKeysetMetaData { public: LGAC1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; #endif // LG_H diff --git a/keysets/logitech.cpp b/keysets/logitech.cpp index 0ac7f37..6f20278 100644 --- a/keysets/logitech.cpp +++ b/keysets/logitech.cpp @@ -2,13 +2,24 @@ #include "protocols/necprotocol.h" LogitechSpeakers::LogitechSpeakers( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "Digital Speakers Keyset", Logitech_Make, index) { +} + + +void LogitechSpeakers::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + threadableProtocol = new NECProtocol(guiObject, index, false, true); setPreData(0x08, 8); diff --git a/keysets/logitech.h b/keysets/logitech.h index 58edd00..f5e010f 100644 --- a/keysets/logitech.h +++ b/keysets/logitech.h @@ -9,8 +9,10 @@ class LogitechSpeakers: public PIRKeysetMetaData { public: LogitechSpeakers( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; #endif // LOGITECH_H diff --git a/keysets/magnavox.cpp b/keysets/magnavox.cpp index 444419d..ce4e36a 100644 --- a/keysets/magnavox.cpp +++ b/keysets/magnavox.cpp @@ -4,7 +4,6 @@ #include "protocols/lircprotocol.h" MagnavoxDVD1::MagnavoxDVD1( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "DVD Keyset 1", @@ -12,6 +11,17 @@ MagnavoxDVD1::MagnavoxDVD1( index) { addControlledDevice(Magnavox_Make, "MDV450", DVD_Device); +} + + +void MagnavoxDVD1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } threadableProtocol = new RC6Protocol(guiObject, index, 0x04); @@ -52,13 +62,24 @@ MagnavoxDVD1::MagnavoxDVD1( MagnavoxVCR1::MagnavoxVCR1( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "VCR Keyset 1", Magnavox_Make, index) { +} + + +void MagnavoxVCR1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + threadableProtocol = new RC5Protocol(guiObject, index); addKey("Power", Power_Key, 0x114C, 13); @@ -121,7 +142,6 @@ MagnavoxVCR1::MagnavoxVCR1( MagnavoxConverterBox1::MagnavoxConverterBox1( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "Settop Box Keyset 1", @@ -129,6 +149,17 @@ MagnavoxConverterBox1::MagnavoxConverterBox1( index) { addControlledDevice(Magnavox_Make, "TB100MG9", Other_Device); +} + + +void MagnavoxConverterBox1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } LIRCProtocol *lp = new LIRCProtocol( guiObject, @@ -172,13 +203,24 @@ MagnavoxConverterBox1::MagnavoxConverterBox1( MagnavoxTV1::MagnavoxTV1( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "TV(?) Keyset 1", Magnavox_Make, index) { +} + + +void MagnavoxTV1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + threadableProtocol = new RC5Protocol(guiObject, index, 0x40); addKey("Zero", Zero_Key, 0x00, 6); diff --git a/keysets/magnavox.h b/keysets/magnavox.h index b2f8ba9..b46024c 100644 --- a/keysets/magnavox.h +++ b/keysets/magnavox.h @@ -9,32 +9,40 @@ class MagnavoxDVD1: public PIRKeysetMetaData { public: MagnavoxDVD1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class MagnavoxVCR1: public PIRKeysetMetaData { public: MagnavoxVCR1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class MagnavoxConverterBox1: public PIRKeysetMetaData { public: MagnavoxConverterBox1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class MagnavoxTV1: public PIRKeysetMetaData { public: MagnavoxTV1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; #endif // MAGNAVOX_H diff --git a/keysets/mce.cpp b/keysets/mce.cpp index 68ea81a..460d650 100644 --- a/keysets/mce.cpp +++ b/keysets/mce.cpp @@ -2,7 +2,6 @@ #include "protocols/mceprotocol.h" MCERemote1::MCERemote1( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "Remote mode 1", @@ -10,6 +9,17 @@ MCERemote1::MCERemote1( index) { addControlledDevice(Any_Make, "ASRock HT330", Computer_Device); +} + + +void MCERemote1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } threadableProtocol = new MCEProtocol(guiObject, index, 0x800F); @@ -91,77 +101,161 @@ MCERemote1::MCERemote1( MCERemote1a::MCERemote1a( - QObject *guiObject, unsigned int index) - : MCERemote1(guiObject, index) + : MCERemote1(index) { setKeysetName("Remote mode 2"); +} + + +void MCERemote1a::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + MCERemote1::populateProtocol(guiObject); setPreData(0x14, 7); } MCERemote1b::MCERemote1b( - QObject *guiObject, unsigned int index) - : MCERemote1(guiObject, index) + : MCERemote1(index) { setKeysetName("Remote mode 3"); +} + + +void MCERemote1b::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + MCERemote1::populateProtocol(guiObject); setPreData(0x24, 7); } MCERemote1c::MCERemote1c( - QObject *guiObject, unsigned int index) - : MCERemote1(guiObject, index) + : MCERemote1(index) { setKeysetName("Remote mode 4"); +} + + +void MCERemote1c::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + MCERemote1::populateProtocol(guiObject); setPreData(0x34, 7); } MCERemote1d::MCERemote1d( - QObject *guiObject, unsigned int index) - : MCERemote1(guiObject, index) + : MCERemote1(index) { setKeysetName("Remote mode 5"); +} + + +void MCERemote1d::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + MCERemote1::populateProtocol(guiObject); setPreData(0x44, 7); } MCERemote1e::MCERemote1e( - QObject *guiObject, unsigned int index) - : MCERemote1(guiObject, index) + : MCERemote1(index) { setKeysetName("Remote mode 6"); +} + + +void MCERemote1e::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + MCERemote1::populateProtocol(guiObject); setPreData(0x54, 7); } MCERemote1f::MCERemote1f( - QObject *guiObject, unsigned int index) - : MCERemote1(guiObject, index) + : MCERemote1(index) { setKeysetName("Remote mode 7"); +} + + +void MCERemote1f::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + MCERemote1::populateProtocol(guiObject); setPreData(0x64, 7); } MCERemote1g::MCERemote1g( - QObject *guiObject, unsigned int index) - : MCERemote1(guiObject, index) + : MCERemote1(index) { setKeysetName("Remote mode 8"); +} + + +void MCERemote1g::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + MCERemote1::populateProtocol(guiObject); setPreData(0x74, 7); } diff --git a/keysets/mce.h b/keysets/mce.h index 406ecca..e43d7d5 100644 --- a/keysets/mce.h +++ b/keysets/mce.h @@ -9,64 +9,80 @@ class MCERemote1: public PIRKeysetMetaData { public: MCERemote1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class MCERemote1a: public MCERemote1 { public: MCERemote1a( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class MCERemote1b: public MCERemote1 { public: MCERemote1b( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class MCERemote1c: public MCERemote1 { public: MCERemote1c( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class MCERemote1d: public MCERemote1 { public: MCERemote1d( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class MCERemote1e: public MCERemote1 { public: MCERemote1e( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class MCERemote1f: public MCERemote1 { public: MCERemote1f( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class MCERemote1g: public MCERemote1 { public: MCERemote1g( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; #endif // MCE_H diff --git a/keysets/mitsubishi.cpp b/keysets/mitsubishi.cpp index 896d3f6..ef6900c 100644 --- a/keysets/mitsubishi.cpp +++ b/keysets/mitsubishi.cpp @@ -2,13 +2,24 @@ #include "protocols/lircprotocol.h" MitsubishiTV1::MitsubishiTV1( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "TV Keyset 1", Mitsubishi_Make, index) { +} + + +void MitsubishiTV1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + LIRCProtocol *lp = new LIRCProtocol( guiObject, index, @@ -92,11 +103,23 @@ MitsubishiTV1::MitsubishiTV1( MitsubishiTV1a::MitsubishiTV1a( - QObject *guiObject, unsigned int index) - : MitsubishiTV1(guiObject, index) + : MitsubishiTV1(index) { setKeysetName("TV Keyset 1a"); +} + + +void MitsubishiTV1a::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + MitsubishiTV1::populateProtocol(guiObject); addKey("TURNLEFT", Unmapped_Key, 0xAC, 8); addKey("TURNRIGHT", Unmapped_Key, 0xB4, 8); @@ -106,13 +129,25 @@ MitsubishiTV1a::MitsubishiTV1a( MitsubishiVCR1::MitsubishiVCR1( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "VCR Keyset 1", Mitsubishi_Make, index) { +} + + + +void MitsubishiVCR1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + LIRCProtocol *lp = new LIRCProtocol( guiObject, index, @@ -185,11 +220,23 @@ MitsubishiVCR1::MitsubishiVCR1( MitsubishiVCR1a::MitsubishiVCR1a( - QObject *guiObject, unsigned int index) - : MitsubishiVCR1(guiObject, index) + : MitsubishiVCR1(index) { setKeysetName("VCR Keyset 1a"); +} + + +void MitsubishiVCR1a::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + MitsubishiVCR1::populateProtocol(guiObject); addKey("->", Unmapped_Key, 0xAC, 8); // Shuttle right addKey("<-", Unmapped_Key, 0xD0, 8); // Shuttle left diff --git a/keysets/mitsubishi.h b/keysets/mitsubishi.h index 0972174..24a91ee 100644 --- a/keysets/mitsubishi.h +++ b/keysets/mitsubishi.h @@ -9,32 +9,40 @@ class MitsubishiTV1: public PIRKeysetMetaData { public: MitsubishiTV1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class MitsubishiTV1a: public MitsubishiTV1 { public: MitsubishiTV1a( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class MitsubishiVCR1: public PIRKeysetMetaData { public: MitsubishiVCR1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class MitsubishiVCR1a: public MitsubishiVCR1 { public: MitsubishiVCR1a( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; #endif // MITSUBISHI_H diff --git a/keysets/motorola.cpp b/keysets/motorola.cpp new file mode 100644 index 0000000..36582af --- /dev/null +++ b/keysets/motorola.cpp @@ -0,0 +1,282 @@ +#include "motorola.h" +#include "protocols/lircprotocol.h" +#include "protocols/giprotocol.h" +#include "protocols/necprotocol.h" + + +Motorola4DTV::Motorola4DTV( + unsigned int index) + : PIRKeysetMetaData( + "4DTV/StarChoice Keyset", + Motorola_Make, + index) +{ +} + + +void Motorola4DTV::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // Keyset already populated. + return; + } + + LIRCProtocol *lp = new LIRCProtocol( + guiObject, index, + 1000, 1000, + 1000, 3000, + 100000, true); + + threadableProtocol = lp; + + lp->setHeaderPair(5000, 2000); + lp->setTrailerPulse(1000); + + addKey("0", Zero_Key, 0x246, 12); + addKey("1", One_Key, 0xF04, 12); + addKey("2", Two_Key, 0x886, 12); + addKey("3", Three_Key, 0x486, 12); + addKey("4", Four_Key, 0xE83, 12); + addKey("5", Five_Key, 0x98B, 12); + addKey("6", Six_Key, 0xD8D, 12); + addKey("7", Seven_Key, 0x50B, 12); + addKey("8", Eight_Key, 0x901, 12); + addKey("9", Nine_Key, 0x708, 12); + addKey("Power", Power_Key, 0x605, 12); + addKey("Source", Input_Key, 0xA4A, 12); + addKey("Sat", SatInput_Key, 0xA85, 12); + addKey("Up", Up_Key, 0xC4F, 12); + addKey("Down", Down_Key, 0x045, 12); + addKey("Right", Right_Key, 0x80C, 12); + addKey("Left", Left_Key, 0xB88, 12); + addKey("Enter", Enter_Key, 0x384, 12); + addKey("GoBack", Unmapped_Key, 0x68F, 12); + addKey("Exit", Exit_Key, 0xA0F, 12); + addKey("Guide", Guide_Key, 0x782, 12); + addKey("Interests", Unmapped_Key, 0x581, 12); + addKey("Options", Unmapped_Key, 0x289, 12); + addKey("Info", Info_Key, 0xE4C, 12); + addKey("Browse", Unmapped_Key, 0x849, 12); + addKey("Future", Unmapped_Key, 0x443, 12); + addKey("Ch-UP", ChannelUp_Key, 0xD07, 12); + addKey("Ch-DOWN", ChannelDown_Key, 0x08A, 12); + addKey("LastCh", PrevChannel_Key, 0x187, 12); + addKey("Help", Unmapped_Key, 0xF8E, 12); +} + + +MotorolaSTB1::MotorolaSTB1( + unsigned int index) + : PIRKeysetMetaData( + "STB Keyset 1", + Motorola_Make, + index) +{ +} + + +void MotorolaSTB1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // Keyset already populated. + return; + } + + threadableProtocol = new GIProtocol(guiObject, index); + + addKey("0", Zero_Key, 0x0000, 16); + addKey("1", One_Key, 0xF001, 16); + addKey("2", Two_Key, 0xE002, 16); + addKey("3", Three_Key, 0xD003, 16); + addKey("4", Four_Key, 0xC004, 16); + addKey("5", Five_Key, 0xB005, 16); + addKey("6", Six_Key, 0xA006, 16); + addKey("7", Seven_Key, 0x9007, 16); + addKey("8", Eight_Key, 0x8008, 16); + addKey("9", Nine_Key, 0x7009, 16); + addKey("power", Power_Key, 0x600A, 16); + addKey("ch+", ChannelUp_Key, 0x500B, 16); + addKey("ch-", ChannelDown_Key, 0x400C, 16); + addKey("vol+", VolumeUp_Key, 0x300D, 16); + addKey("vol-", VolumeDown_Key, 0x200E, 16); + addKey("mute", Mute_Key, 0x100F, 16); + + addKey("MUSIC", Unmapped_Key, 0xF010, 16); + addKey("select", Select_Key, 0xE011, 16); + addKey("enter", Enter_Key, 0xE011, 16); + addKey("exit", Exit_Key, 0xD012, 16); + addKey("last", PrevChannel_Key, 0xC013, 16); + addKey("input", Input_Key, 0xB014, 16); // "tv/vcr_input" + addKey("fav", Favorites_Key, 0xA015, 16); + addKey("ppv", Unmapped_Key, 0x9016, 16); + addKey("a", Audio_Key, 0x8017, 16); // "lang" + addKey("menu", Menu_Key, 0x6019, 16); + addKey("ffwd", FastForward_Key, 0x201D, 16); + addKey("rew", Rewind_Key, 0x101E, 16); + addKey("pause", Pause_Key, 0x001F, 16); + +// addKey("pnp-swap", PIPSwap_Key, 0xB020, 16); + addKey("pip_onoff", PIP_Key, 0xC022, 16); + addKey("pip_swap", PIPSwap_Key, 0xB023, 16); + addKey("pip_move", PIPMove_Key, 0xA024, 16); + addKey("pip_chan_up", PIPChannelUp_Key, 0x9025, 16); + addKey("pip_chan_down", PIPChannelDown_Key, 0x8026, 16); + addKey("b", Unmapped_Key, 0x7027, 16); + addKey("c", Unmapped_Key, 0x6028, 16); + + addKey("guide", Guide_Key, 0xD030, 16); + addKey("record", Record_Key, 0xC031, 16); + addKey("settings", Unmapped_Key, 0xB032, 16); // "help" + addKey("info", Info_Key, 0xA033, 16); + addKey("up", Up_Key, 0x9034, 16); + addKey("down", Down_Key, 0x8035, 16); + addKey("left", Left_Key, 0x7036, 16); + addKey("right", Right_Key, 0x6037, 16); + addKey("play", Play_Key, 0x5038, 16); + addKey("stop", Stop_Key, 0x4039, 16); + addKey("page+", PageUp_Key, 0x303A, 16); + addKey("page-", PageDown_Key, 0x203B, 16); + addKey("skipback", Replay_Key, 0x103C, 16); + addKey("mydvr", HDDInput_Key, 0x003D, 16); + addKey("live", LiveTV_Key, 0xF03E, 16); + addKey("next", Advance_Key, 0xE03F, 16); + + addKey("hdzoom_enter", AspectRatio_Key, 0xC040, 16); + + addKey("red", Red_Key, 0xC06E, 16); + addKey("green", Green_Key, 0xB06F, 16); + addKey("yelow", Yellow_Key, 0x9070, 16); + addKey("blue", Blue_Key, 0x8071, 16); + addKey("grey", Unmapped_Key, 0x7072, 16); + + addKey("back", Unmapped_Key, 0x649D, 16); + + addKey("exit", Unmapped_Key, 0x60FB, 16); // separate keyset? +} + + +MotorolaSTB1a::MotorolaSTB1a( + unsigned int index) + : MotorolaSTB1(index) +{ + setKeysetName("STB Keyset 1a"); +} + + +void MotorolaSTB1a::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // Already populated. + return; + } + + MotorolaSTB1::populateProtocol(guiObject); + + addKey("a_lock", Unmapped_Key, 0x9016, 16); + addKey("ppv", Unmapped_Key, 0x7018, 16); + addKey("vod", Unmapped_Key, 0x501A, 16); + addKey("play", Play_Key, 0x401B, 16); + addKey("stop", Stop_Key, 0x301C, 16); + + addKey("c_day+", Unmapped_Key, 0x5038, 16); + addKey("b_day-", Unmapped_Key, 0x4039, 16); +} + + +MotorolaSTB1b::MotorolaSTB1b( + unsigned int index) + : MotorolaSTB1(index) +{ + setKeysetName("STB Keyset 1b"); +} + + +void MotorolaSTB1b::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // Already populated. + return; + } + + MotorolaSTB1::populateProtocol(guiObject); + + addKey("yellow", Yellow_Key, 0x8017, 16); + addKey("ondemand", Unmapped_Key, 0x501A, 16); + addKey("stop", Stop_Key, 0x301C, 16); + addKey("play-pause", Play_Key, 0x001F, 16); + addKey("play-pause", Pause_Key, 0x001F, 16); + addKey("blue", Blue_Key, 0x7027, 16); + addKey("red", Red_Key, 0x6028, 16); + addKey("green", Green_Key, 0x5029, 16); + addKey("#", Unmapped_Key, 0xC040, 16); + addKey("widgets", Unmapped_Key, 0x9043, 16); + addKey("*", Unmapped_Key, 0x8044, 16); +} + + +MotorolaSkyDigital::MotorolaSkyDigital( + unsigned int index) + : PIRKeysetMetaData( + "Sky Digital Keyset", + Motorola_Make, + index) +{ +} + + +void MotorolaSkyDigital::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // Keyset already populated. + return; + } + + threadableProtocol = new NECProtocol(guiObject, index, true, true); + + setPreData(0x2F86, 16); + + addKey("chandown", ChannelDown_Key, 0x01, 8); + addKey("1", One_Key, 0x02, 8); + addKey("yellow", Yellow_Key, 0x04, 8); + addKey("chanup", ChannelUp_Key, 0x07, 8); + addKey("blue", Blue_Key, 0x09, 8); + addKey("mute", Mute_Key, 0x0A, 8); + addKey("3", Three_Key, 0x0C, 8); + addKey("8", Eight_Key, 0x0D, 8); + addKey("0", Zero_Key, 0x0E, 8); + + addKey("ok", Select_Key, 0x10, 8); + addKey("volup", VolumeUp_Key, 0x12, 8); + addKey("2", Two_Key, 0x13, 8); + addKey("5", Five_Key, 0x14, 8); + addKey("plus", Unmapped_Key, 0x15, 8); + addKey("4", Four_Key, 0x16, 8); + addKey("6", Six_Key, 0x17, 8); + addKey("7", Seven_Key, 0x18, 8); + addKey("9", Nine_Key, 0x19, 8); + addKey("power", Power_Key, 0x1A, 8); + addKey("voldown", VolumeDown_Key, 0x1B, 8); + addKey("green", Green_Key, 0x1E, 8); + addKey("red", Red_Key, 0x1F, 8); + + addKey("tv", Input_Key, 0x82, 8); + addKey("left", Left_Key, 0x88, 8); + addKey("back", Exit_Key, 0x89, 8); + addKey("up", Up_Key, 0x8B, 8); + addKey("question", Unmapped_Key, 0x8F, 8); + + addKey("down", Down_Key, 0x91, 8); + addKey("interactive", Unmapped_Key, 0x93, 8); + addKey("guide", Guide_Key, 0x9C, 8); + addKey("right", Right_Key, 0x9D, 8); +} diff --git a/keysets/motorola.h b/keysets/motorola.h new file mode 100644 index 0000000..b22c61b --- /dev/null +++ b/keysets/motorola.h @@ -0,0 +1,58 @@ +#ifndef MOTOROLA_H +#define MOTOROLA_H + +#include "pirkeysetmetadata.h" + +class QObject; + +class Motorola4DTV: public PIRKeysetMetaData +{ +public: + Motorola4DTV( + unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); +}; + +class MotorolaSTB1: public PIRKeysetMetaData +{ +public: + MotorolaSTB1( + unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); +}; + +class MotorolaSTB1a: public MotorolaSTB1 +{ +public: + MotorolaSTB1a( + unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); +}; + +class MotorolaSTB1b: public MotorolaSTB1 +{ +public: + MotorolaSTB1b( + unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); +}; + +class MotorolaSkyDigital: public PIRKeysetMetaData +{ +public: + MotorolaSkyDigital( + unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); +}; + +#endif // MOTOROLA_H diff --git a/keysets/nokia.cpp b/keysets/nokia.cpp index 4a3d776..56a0fad 100644 --- a/keysets/nokia.cpp +++ b/keysets/nokia.cpp @@ -2,13 +2,24 @@ #include "protocols/lircprotocol.h" NokiaGenericVCR::NokiaGenericVCR( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "Generic VCR", Nokia_Make, index) { +} + + +void NokiaGenericVCR::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + LIRCProtocol *lp = new LIRCProtocol( guiObject, index, diff --git a/keysets/nokia.h b/keysets/nokia.h index 98d6bcf..a82d31b 100644 --- a/keysets/nokia.h +++ b/keysets/nokia.h @@ -9,8 +9,10 @@ class NokiaGenericVCR: public PIRKeysetMetaData { public: NokiaGenericVCR( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; #endif // NOKIA_H diff --git a/keysets/onida.cpp b/keysets/onida.cpp index 7083342..9e1a145 100644 --- a/keysets/onida.cpp +++ b/keysets/onida.cpp @@ -4,13 +4,24 @@ OnidaTV1::OnidaTV1( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "TV Keyset 1", Onida_Make, index) { +} + + +void OnidaTV1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + threadableProtocol = new JVCProtocol(guiObject, index); setPreData(0x03, 8); @@ -50,13 +61,24 @@ OnidaTV1::OnidaTV1( OnidaDVD1::OnidaDVD1( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "DVD Keyset 1", Onida_Make, index) { +} + + +void OnidaDVD1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + threadableProtocol = new NECProtocol(guiObject, index, false, true); setPreData(0x00, 8); diff --git a/keysets/onida.h b/keysets/onida.h index 3de7ddb..3ab1152 100644 --- a/keysets/onida.h +++ b/keysets/onida.h @@ -9,16 +9,20 @@ class OnidaTV1: public PIRKeysetMetaData { public: OnidaTV1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class OnidaDVD1: public PIRKeysetMetaData { public: OnidaDVD1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; #endif // ONIDA_H diff --git a/keysets/panasonic.cpp b/keysets/panasonic.cpp index 5f7b792..fcf3d29 100644 --- a/keysets/panasonic.cpp +++ b/keysets/panasonic.cpp @@ -4,13 +4,24 @@ PanasonicCarAudio::PanasonicCarAudio( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "Car Audio Keyset", Panasonic_Make, index) { +} + + +void PanasonicCarAudio::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + threadableProtocol = new NECProtocol(guiObject, index, true, false); // setPreData(0x8156, 16); @@ -28,13 +39,24 @@ PanasonicCarAudio::PanasonicCarAudio( PanasonicSat1::PanasonicSat1( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "Satellite Keyset 1", Panasonic_Make, index) { +} + + +void PanasonicSat1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + threadableProtocol = new KaseikyoProtocol(guiObject, index); // setPreData(0x40040140, 32); @@ -81,11 +103,23 @@ PanasonicSat1::PanasonicSat1( PanasonicSat1a::PanasonicSat1a( - QObject *guiObject, unsigned int index) - : PanasonicSat1(guiObject, index) + : PanasonicSat1(index) { setKeysetName("Satellite Keyset 1a"); +} + + +void PanasonicSat1a::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + PanasonicSat1::populateProtocol(guiObject); addKaseikyoKey("EXIT", Exit_Key, 0x028, 0xCF); addKaseikyoKey("CH+", ChannelUp_Key, 0x028, 0xB2); @@ -94,13 +128,24 @@ PanasonicSat1a::PanasonicSat1a( PanasonicTV1::PanasonicTV1( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "TV Keyset 1", Panasonic_Make, index) { +} + + +void PanasonicTV1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + threadableProtocol = new KaseikyoProtocol(guiObject, index); // setPreData(0x400401, 24); @@ -213,11 +258,24 @@ PanasonicTV1::PanasonicTV1( PanasonicTV1a::PanasonicTV1a( - QObject *guiObject, unsigned int index) - : PanasonicTV1(guiObject, index) + : PanasonicTV1(index) { setKeysetName("TV Keyset 1a"); +} + + +void PanasonicTV1a::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + PanasonicTV1::populateProtocol(guiObject); + // Overwrite some of the keys: addKaseikyoKey("OK", Select_Key, 0x008, 0x49); addKaseikyoKey("MENU", Menu_Key, 0x008, 0x06); @@ -225,9 +283,8 @@ PanasonicTV1a::PanasonicTV1a( PanasonicTV1b::PanasonicTV1b( - QObject *guiObject, unsigned int index) - : PanasonicTV1(guiObject, index) + : PanasonicTV1(index) { setKeysetName("TV Keyset 1b"); @@ -235,6 +292,19 @@ PanasonicTV1b::PanasonicTV1b( addControlledDevice(Panasonic_Make, "Viera 42PZ700U", TV_Device); addControlledDevice(Panasonic_Make, "Viera 42PZ8ES", TV_Device); addControlledDevice(Panasonic_Make, "Quintrix TX-25MK1C", TV_Device); +} + + +void PanasonicTV1b::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + PanasonicTV1::populateProtocol(guiObject); addKaseikyoKey("Info", Info_Key, 0x008, 0x39); // "OSD" addKaseikyoKey("OK", Select_Key, 0x008, 0x49); @@ -247,13 +317,24 @@ PanasonicTV1b::PanasonicTV1b( PanasonicVCR1::PanasonicVCR1( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "VCR Keyset 1", Panasonic_Make, index) { +} + + +void PanasonicVCR1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + threadableProtocol = new KaseikyoProtocol(guiObject, index); // setPreData(0x400409, 24); @@ -351,11 +432,23 @@ PanasonicVCR1::PanasonicVCR1( PanasonicVCR1a::PanasonicVCR1a( - QObject *guiObject, unsigned int index) - : PanasonicVCR1(guiObject, index) + : PanasonicVCR1(index) { setKeysetName("VCR Keyset 1a"); +} + + +void PanasonicVCR1a::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + PanasonicVCR1::populateProtocol(guiObject); addKaseikyoKey("OSD", Info_Key, 0x009, 0x57); addKaseikyoKey("AV", Input_Key, 0x009, 0xC0); @@ -364,11 +457,23 @@ PanasonicVCR1a::PanasonicVCR1a( PanasonicVCR1b::PanasonicVCR1b( - QObject *guiObject, unsigned int index) - : PanasonicVCR1(guiObject, index) + : PanasonicVCR1(index) { setKeysetName("VCR Keyset 1b"); +} + + +void PanasonicVCR1b::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + PanasonicVCR1::populateProtocol(guiObject); addKaseikyoKey("repeat", Repeat_Key, 0x009, 0xF9); addKaseikyoKey("prog", Program_Key, 0x009, 0xFF); @@ -377,11 +482,23 @@ PanasonicVCR1b::PanasonicVCR1b( PanasonicVCR1c::PanasonicVCR1c( - QObject *guiObject, unsigned int index) - : PanasonicVCR1(guiObject, index) + : PanasonicVCR1(index) { setKeysetName("VCR Keyset 1c"); +} + + +void PanasonicVCR1c::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + PanasonicVCR1::populateProtocol(guiObject); addKaseikyoKey("rotate", Up_Key, 0x019, 0x02); addKaseikyoKey("rotatedown", Down_Key, 0x019, 0x03); @@ -391,13 +508,24 @@ PanasonicVCR1c::PanasonicVCR1c( PanasonicDVD1::PanasonicDVD1( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "DVD Keyset 1", Panasonic_Make, index) { +} + + +void PanasonicDVD1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + threadableProtocol = new KaseikyoProtocol(guiObject, index); // setPreData(0x40040D00, 32); @@ -480,11 +608,23 @@ PanasonicDVD1::PanasonicDVD1( PanasonicDVD1a::PanasonicDVD1a( - QObject *guiObject, unsigned int index) - : PanasonicDVD1(guiObject, index) + : PanasonicDVD1(index) { setKeysetName("DVD Keyset 1a"); +} + + +void PanasonicDVD1a::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + PanasonicDVD1::populateProtocol(guiObject); addKaseikyoKey("channel2up", ChannelUp_Key, 0x00B, 0x34); addKaseikyoKey("channel2down", ChannelDown_Key, 0x00B, 0x35); @@ -493,7 +633,6 @@ PanasonicDVD1a::PanasonicDVD1a( PanasonicAudio1::PanasonicAudio1( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "Audio Keyset 1", @@ -502,6 +641,17 @@ PanasonicAudio1::PanasonicAudio1( { addControlledDevice(Panasonic_Make, "RX-DS25", Audio_Device); addControlledDevice(Panasonic_Make, "RX-e300", Audio_Device); +} + + +void PanasonicAudio1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } threadableProtocol = new KaseikyoProtocol(guiObject, index); @@ -574,13 +724,24 @@ PanasonicAudio1::PanasonicAudio1( PanasonicAC1::PanasonicAC1( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "Air Conditioner 1", Panasonic_Make, index) { +} + + +void PanasonicAC1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + threadableProtocol = new NECProtocol(guiObject, index, true, true); setPreData(0x6681, 16); diff --git a/keysets/panasonic.h b/keysets/panasonic.h index 5237836..1933a6a 100644 --- a/keysets/panasonic.h +++ b/keysets/panasonic.h @@ -9,120 +9,150 @@ class PanasonicCarAudio: public PIRKeysetMetaData { public: PanasonicCarAudio( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class PanasonicSat1: public PIRKeysetMetaData { public: PanasonicSat1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class PanasonicSat1a: public PanasonicSat1 { public: PanasonicSat1a( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class PanasonicTV1: public PIRKeysetMetaData { public: PanasonicTV1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class PanasonicTV1a: public PanasonicTV1 { public: PanasonicTV1a( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class PanasonicTV1b: public PanasonicTV1 { public: PanasonicTV1b( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class PanasonicVCR1: public PIRKeysetMetaData { public: PanasonicVCR1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class PanasonicVCR1a: public PanasonicVCR1 { public: PanasonicVCR1a( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class PanasonicVCR1b: public PanasonicVCR1 { public: PanasonicVCR1b( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class PanasonicVCR1c: public PanasonicVCR1 { public: PanasonicVCR1c( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class PanasonicDVD1: public PIRKeysetMetaData { public: PanasonicDVD1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class PanasonicDVD1a: public PanasonicDVD1 { public: PanasonicDVD1a( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class PanasonicAudio1: public PIRKeysetMetaData { public: PanasonicAudio1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class PanasonicAudio1a: public PanasonicAudio1 { public: PanasonicAudio1a( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class PanasonicAC1: public PIRKeysetMetaData { public: PanasonicAC1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; #endif // PANASONIC_H diff --git a/keysets/philco.cpp b/keysets/philco.cpp index 7c60b80..6ae8921 100644 --- a/keysets/philco.cpp +++ b/keysets/philco.cpp @@ -2,13 +2,24 @@ #include "protocols/necprotocol.h" PhilcoTV::PhilcoTV( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "TV Keyset 1", Philco_Make, index) { +} + + +void PhilcoTV::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + threadableProtocol = new NECProtocol(guiObject, index, false, true); setPreData(0x50, 8); diff --git a/keysets/philco.h b/keysets/philco.h index 8245ac7..d3f85fb 100644 --- a/keysets/philco.h +++ b/keysets/philco.h @@ -9,8 +9,10 @@ class PhilcoTV: public PIRKeysetMetaData { public: PhilcoTV( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; #endif // PHILCO_H diff --git a/keysets/philips.cpp b/keysets/philips.cpp index b5bd7df..a2713ea 100644 --- a/keysets/philips.cpp +++ b/keysets/philips.cpp @@ -4,7 +4,6 @@ #include "protocols/necprotocol.h" PhilipsTV1::PhilipsTV1( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "TV Keyset 1", @@ -13,6 +12,17 @@ PhilipsTV1::PhilipsTV1( { addControlledDevice(Philips_Make, "HV92", TV_Device); addControlledDevice(Philips_Make, "15PF4121", TV_Device); +} + + +void PhilipsTV1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } threadableProtocol = new RC5Protocol(guiObject, index); @@ -114,26 +124,50 @@ PhilipsTV1::PhilipsTV1( PhilipsTV1a::PhilipsTV1a( - QObject *guiObject, unsigned int index) - : PhilipsTV1(guiObject, index) + : PhilipsTV1(index) { setKeysetName("TV Keyset 1a"); addControlledDevice(Philips_Make, "17PT1563", TV_Device); +} + + +void PhilipsTV1a::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + PhilipsTV1::populateProtocol(guiObject); addKey("TIMER", Sleep_Key, 0x002D, 13); } PhilipsTV1b::PhilipsTV1b( - QObject *guiObject, unsigned int index) - : PhilipsTV1(guiObject, index) + : PhilipsTV1(index) { setKeysetName("TV Keyset 1b"); addControlledDevice(Philips_Make, "29PT5507", TV_Device); +} + + +void PhilipsTV1b::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + PhilipsTV1::populateProtocol(guiObject); addKey("radio", Unmapped_Key, 0x00F1, 13); addKey("sound", Unmapped_Key, 0x1014, 13); @@ -146,11 +180,23 @@ PhilipsTV1b::PhilipsTV1b( PhilipsTV1c::PhilipsTV1c( - QObject *guiObject, unsigned int index) - : PhilipsTV1(guiObject, index) + : PhilipsTV1(index) { setKeysetName("TV Keyset 1c"); +} + + +void PhilipsTV1c::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + PhilipsTV1::populateProtocol(guiObject); addKey("spatial", Surround_Key, 0x1024, 13); addKey("stereo", Audio_Key, 0x1023, 13); @@ -159,15 +205,27 @@ PhilipsTV1c::PhilipsTV1c( PhilipsTV1d::PhilipsTV1d( - QObject *guiObject, unsigned int index) - : PhilipsTV1(guiObject, index) + : PhilipsTV1(index) { setKeysetName("TV Keyset 1d"); addControlledDevice(Philips_Make, "47PFL7603D", TV_Device); addControlledDevice(Philips_Make, "14PT1562/00", TV_Device); addControlledDevice(Philips_Make, "32PW9528/12", TV_Device); +} + + +void PhilipsTV1d::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + PhilipsTV1::populateProtocol(guiObject); addKey("NOTE_BUTTON", Unmapped_Key, 0x1014, 13); // "Tune" addKey("RADIO_BUTTON", Unmapped_Key, 0x00F1, 13); @@ -190,14 +248,26 @@ PhilipsTV1d::PhilipsTV1d( PhilipsTV1e::PhilipsTV1e( - QObject *guiObject, unsigned int index) - : PhilipsTV1(guiObject, index) + : PhilipsTV1(index) { setKeysetName("TV Keyset 1e"); addControlledDevice(Philips_Make, "28PT4455", TV_Device); addControlledDevice(Philips_Make, "21PT2265", TV_Device); +} + + +void PhilipsTV1e::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + PhilipsTV1::populateProtocol(guiObject); addKey("smart_audio", SoundMode_Key, 0x10CB, 13); addKey("smart_video", PictureMode_Key, 0x10CA, 13); @@ -211,13 +281,25 @@ PhilipsTV1e::PhilipsTV1e( PhilipsTV1f::PhilipsTV1f( - QObject *guiObject, unsigned int index) - : PhilipsTV1(guiObject, index) + : PhilipsTV1(index) { setKeysetName("TV Keyset 1f"); addControlledDevice(Philips_Make, "25PT5302", TV_Device); +} + + +void PhilipsTV1f::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + PhilipsTV1::populateProtocol(guiObject); addKey("SETUP", Menu_Key, 0x003A, 13); addKey("VOL-", VolumeDown_Key, 0x0011, 13); @@ -236,7 +318,6 @@ PhilipsTV1f::PhilipsTV1f( PhilipsTV2::PhilipsTV2( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "TV Keyset 2", @@ -246,6 +327,17 @@ PhilipsTV2::PhilipsTV2( addControlledDevice(Philips_Make, "28PW8506/12R", TV_Device); addControlledDevice(Philips_Make, "26PFL5604H", TV_Device); addControlledDevice(Philips_Make, "32PFL5403D", TV_Device); +} + + +void PhilipsTV2::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } threadableProtocol = new RC6Protocol(guiObject, index, 0x00); @@ -312,13 +404,25 @@ PhilipsTV2::PhilipsTV2( PhilipsTV2a::PhilipsTV2a( - QObject *guiObject, unsigned int index) - : PhilipsTV2(guiObject, index) + : PhilipsTV2(index) { setKeysetName("TV Keyset 2a"); addControlledDevice(Philips_Make, "29PT8607/12", TV_Device); +} + + +void PhilipsTV2a::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + PhilipsTV2::populateProtocol(guiObject); addKey("tv-display", Info_Key, 0x3C, 8); addKey("tv-teletext_submode_(J:12)", Unmapped_Key, 0x5D, 8); @@ -332,13 +436,25 @@ PhilipsTV2a::PhilipsTV2a( PhilipsTV2b::PhilipsTV2b( - QObject *guiObject, unsigned int index) - : PhilipsTV2(guiObject, index) + : PhilipsTV2(index) { setKeysetName("TV Keyset 2b"); addControlledDevice(Philips_Make, "32PFL7532D", TV_Device); +} + + +void PhilipsTV2b::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + PhilipsTV2::populateProtocol(guiObject); addKey("KEY_PLAY", Play_Key, 0xC1, 8); addKey("KEY_FAVORITES", Favorites_Key, 0xD2, 8); @@ -346,7 +462,6 @@ PhilipsTV2b::PhilipsTV2b( PhilipsTV3::PhilipsTV3( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "TV (settop-box) keyset 3", @@ -354,6 +469,17 @@ PhilipsTV3::PhilipsTV3( index) { addControlledDevice(Philips_Make, "DTX6372", TV_Device); +} + + +void PhilipsTV3::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } threadableProtocol = new RC6Protocol(guiObject, index, 0x28); @@ -401,7 +527,6 @@ PhilipsTV3::PhilipsTV3( PhilipsDVD1::PhilipsDVD1( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "DVD Keyset 1", @@ -412,6 +537,17 @@ PhilipsDVD1::PhilipsDVD1( addControlledDevice(Philips_Make, "DVD722", DVD_Device); addControlledDevice(Philips_Make, "DVD-724", DVD_Device); addControlledDevice(Philips_Make, "DVP 3005", DVD_Device); +} + + +void PhilipsDVD1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } threadableProtocol = new RC6Protocol(guiObject, index, 0x04); @@ -469,13 +605,25 @@ PhilipsDVD1::PhilipsDVD1( PhilipsDVD1a::PhilipsDVD1a( - QObject *guiObject, unsigned int index) - : PhilipsDVD1(guiObject, index) + : PhilipsDVD1(index) { setKeysetName("DVD Keyset 1a"); addControlledDevice(Philips_Make, "DVP-5982", DVD_Device); +} + + +void PhilipsDVD1a::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + PhilipsDVD1::populateProtocol(guiObject); addKey("Play_Pause", Pause_Key, 0x2C, 8); addKey("USB", Unmapped_Key, 0x7E, 8); @@ -484,13 +632,25 @@ PhilipsDVD1a::PhilipsDVD1a( PhilipsDVD1b::PhilipsDVD1b( - QObject *guiObject, unsigned int index) - : PhilipsDVD1(guiObject, index) + : PhilipsDVD1(index) { setKeysetName("DVD Keyset 1b"); addControlledDevice(Philips_Make, "DVP-642", DVD_Device); +} + + +void PhilipsDVD1b::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + PhilipsDVD1::populateProtocol(guiObject); addKey("Forward", FastForward_Key, 0x20, 8); addKey("Reverse", Rewind_Key, 0x21, 8); @@ -499,15 +659,27 @@ PhilipsDVD1b::PhilipsDVD1b( PhilipsDVD1c::PhilipsDVD1c( - QObject *guiObject, unsigned int index) - : PhilipsDVD1(guiObject, index) + : PhilipsDVD1(index) { setKeysetName("DVD Keyset 1c"); addControlledDevice(Philips_Make, "HTS3544", DVD_Device); addControlledDevice(Philips_Make, "DVP5982", DVD_Device); addControlledDevice(Philips_Make, "DVP5160", DVD_Device); +} + + +void PhilipsDVD1c::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + PhilipsDVD1::populateProtocol(guiObject); addKey("play-pause", Pause_Key, 0x2C, 8); addKey("disc-usb", Unmapped_Key, 0x3F, 8); @@ -520,13 +692,25 @@ PhilipsDVD1c::PhilipsDVD1c( PhilipsDVD1d::PhilipsDVD1d( - QObject *guiObject, unsigned int index) - : PhilipsDVD1(guiObject, index) + : PhilipsDVD1(index) { setKeysetName("DVD Keyset 1d"); addControlledDevice(Philips_Make, "DVD 963sa", DVD_Device); +} + + +void PhilipsDVD1d::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + PhilipsDVD1::populateProtocol(guiObject); addKey("ff-right", FastForward_Key, 0x20, 8); addKey("ff-left", Rewind_Key, 0x21, 8); @@ -535,13 +719,24 @@ PhilipsDVD1d::PhilipsDVD1d( PhilipsDVD2::PhilipsDVD2( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "DVD/BD Keyset 2", Philips_Make, index) { +} + + +void PhilipsDVD2::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + threadableProtocol = new RC6Protocol(guiObject, index, 0x46); addKey("0", Zero_Key, 0x00, 8); @@ -593,7 +788,6 @@ PhilipsDVD2::PhilipsDVD2( PhilipsDVD3::PhilipsDVD3( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "DVD Keyset 3", @@ -601,6 +795,17 @@ PhilipsDVD3::PhilipsDVD3( index) { addControlledDevice(Philips_Make, "DVDR3570H", DVD_Device); +} + + +void PhilipsDVD3::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } threadableProtocol = new RC6Protocol(guiObject, index, 0x32); @@ -671,13 +876,25 @@ PhilipsDVD3::PhilipsDVD3( PhilipsDVD3a::PhilipsDVD3a( - QObject *guiObject, unsigned int index) - : PhilipsDVD3(guiObject, index) + : PhilipsDVD3(index) { setKeysetName("DVD Keyset 3a"); addControlledDevice(Philips_Make, "DVDR-3455H", DVD_Device); +} + + +void PhilipsDVD3a::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + PhilipsDVD3::populateProtocol(guiObject); addKey("CH+", ChannelUp_Key, 0x1E, 8); addKey("CH-", ChannelDown_Key, 0x1F, 8); @@ -691,7 +908,6 @@ PhilipsDVD3a::PhilipsDVD3a( PhilipsDVD4::PhilipsDVD4( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "DVD Keyset 4", @@ -699,6 +915,17 @@ PhilipsDVD4::PhilipsDVD4( index) { addControlledDevice(Philips_Make, "DVDR 1000", DVD_Device); +} + + +void PhilipsDVD4::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } threadableProtocol = new RC6Protocol(guiObject, index, 0x30); @@ -758,13 +985,24 @@ PhilipsDVD4::PhilipsDVD4( PhilipsVCR1::PhilipsVCR1( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "VCR Keyset 1", Philips_Make, index) { +} + + +void PhilipsVCR1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + threadableProtocol = new RC5Protocol(guiObject, index); addKey("Standby", Power_Key, 0x114C, 13); @@ -820,13 +1058,25 @@ PhilipsVCR1::PhilipsVCR1( PhilipsVCR1a::PhilipsVCR1a( - QObject *guiObject, unsigned int index) - : PhilipsVCR1(guiObject, index) + : PhilipsVCR1(index) { setKeysetName("VCR Keyset 1a"); addControlledDevice(Philips_Make, "VP27/55", VCR_Device); +} + + +void PhilipsVCR1a::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + PhilipsVCR1::populateProtocol(guiObject); addKey("menu", Menu_Key, 0x115D, 13); addKey("eject", Eject_Key, 0x116D, 13); @@ -840,11 +1090,23 @@ PhilipsVCR1a::PhilipsVCR1a( PhilipsVCR1b::PhilipsVCR1b( - QObject *guiObject, unsigned int index) - : PhilipsVCR1(guiObject, index) + : PhilipsVCR1(index) { setKeysetName("VCR Keyset 1b"); +} + + +void PhilipsVCR1b::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + PhilipsVCR1::populateProtocol(guiObject); addKey("Cassette_Eject", Eject_Key, 0x017E, 13); addKey("Select", Select_Key, 0x114B, 13); @@ -859,11 +1121,23 @@ PhilipsVCR1b::PhilipsVCR1b( PhilipsVCR1c::PhilipsVCR1c( - QObject *guiObject, unsigned int index) - : PhilipsVCR1(guiObject, index) + : PhilipsVCR1(index) { setKeysetName("VCR Keyset 1c"); +} + + +void PhilipsVCR1c::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + PhilipsVCR1::populateProtocol(guiObject); addKey("TIMER_REVIEW", Unmapped_Key, 0x0168, 13); addKey("DATE_UP", Unmapped_Key, 0x125C, 13); @@ -894,13 +1168,24 @@ PhilipsVCR1c::PhilipsVCR1c( PhilipsSat1::PhilipsSat1( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "Sat Keyset 1", Philips_Make, index) { +} + + +void PhilipsSat1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + threadableProtocol = new RC5Protocol(guiObject, index); addKey("Standby", Power_Key, 0x120C, 13); @@ -950,7 +1235,6 @@ PhilipsSat1::PhilipsSat1( PhilipsSat2::PhilipsSat2( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "Sat Keyset 2", @@ -958,6 +1242,17 @@ PhilipsSat2::PhilipsSat2( index) { addControlledDevice(Philips_Make, "DSX-5500", Sat_Device); +} + + +void PhilipsSat2::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } threadableProtocol = new RC6Protocol(guiObject, index, 0x27); @@ -998,13 +1293,25 @@ PhilipsSat2::PhilipsSat2( PhilipsSat2a::PhilipsSat2a( - QObject *guiObject, unsigned int index) - : PhilipsSat2(guiObject, index) + : PhilipsSat2(index) { setKeysetName("Sat Keyset 2a"); addControlledDevice(Philips_Make, "DSX 6010/62A", Sat_Device); +} + + +void PhilipsSat2a::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + PhilipsSat2::populateProtocol(guiObject); addKey("ch+", ChannelUp_Key, 0x58, 8); addKey("ch-", ChannelDown_Key, 0x59, 8); @@ -1020,7 +1327,6 @@ PhilipsSat2a::PhilipsSat2a( PhilipsSat3::PhilipsSat3( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "Sat Keyset 3", @@ -1028,6 +1334,17 @@ PhilipsSat3::PhilipsSat3( index) { addControlledDevice(Philips_Make, "DST5816/33", Sat_Device); +} + + +void PhilipsSat3::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } threadableProtocol = new RC5Protocol(guiObject, index); @@ -1065,7 +1382,6 @@ PhilipsSat3::PhilipsSat3( PhilipsAudio1::PhilipsAudio1( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "Audio Keyset 1", @@ -1080,6 +1396,17 @@ PhilipsAudio1::PhilipsAudio1( addControlledDevice(Philips_Make, "AZ2407", Audio_Device); addControlledDevice(Philips_Make, "MZ7", Audio_Device); addControlledDevice(Philips_Make, "AS680C", Audio_Device); +} + + +void PhilipsAudio1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } threadableProtocol = new RC5Protocol(guiObject, index); @@ -1162,13 +1489,25 @@ PhilipsAudio1::PhilipsAudio1( PhilipsAudio1a::PhilipsAudio1a( - QObject *guiObject, unsigned int index) - : PhilipsAudio1(guiObject, index) + : PhilipsAudio1(index) { setKeysetName("Audio Keyset 1a"); addControlledDevice(Philips_Make, "C 380", Audio_Device); +} + + +void PhilipsAudio1a::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + PhilipsAudio1::populateProtocol(guiObject); addKey("VOL-", VolumeDown_Key, 0x1511, 13); addKey("VOL+", VolumeUp_Key, 0x1510, 13); @@ -1176,13 +1515,25 @@ PhilipsAudio1a::PhilipsAudio1a( PhilipsAudio1b::PhilipsAudio1b( - QObject *guiObject, unsigned int index) - : PhilipsAudio1(guiObject, index) + : PhilipsAudio1(index) { setKeysetName("Audio Keyset 1b"); addControlledDevice(Philips_Make, "FW 362", Audio_Device); +} + + +void PhilipsAudio1b::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + PhilipsAudio1::populateProtocol(guiObject); addKey("tv_power", Unmapped_Key, 0x100C, 13); addKey("tv_vcr", VCRInput_Key, 0x103F, 13); @@ -1200,7 +1551,6 @@ PhilipsAudio1b::PhilipsAudio1b( PhilipsAudio2::PhilipsAudio2( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "Audio Keyset 2", @@ -1208,6 +1558,17 @@ PhilipsAudio2::PhilipsAudio2( index) { addControlledDevice(Philips_Make, "FW2104", Audio_Device); +} + + +void PhilipsAudio2::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } threadableProtocol = new NECProtocol(guiObject, index, true, false); @@ -1269,7 +1630,6 @@ PhilipsAudio2::PhilipsAudio2( // This CD control is different enough from Audio1 that I figured I should // give it an entirely new keyset: PhilipsAudio3::PhilipsAudio3( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "Audio Keyset 3", @@ -1277,6 +1637,17 @@ PhilipsAudio3::PhilipsAudio3( index) { addControlledDevice(Philips_Make, "CD723", Audio_Device); +} + + +void PhilipsAudio3::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } threadableProtocol = new RC5Protocol(guiObject, index); @@ -1312,13 +1683,24 @@ PhilipsAudio3::PhilipsAudio3( PhilipsAudio4::PhilipsAudio4( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "Audio Keyset 4", Philips_Make, index) { +} + + +void PhilipsAudio4::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + threadableProtocol = new RC5Protocol(guiObject, index); addKey("EJECT", Eject_Key, 0x16AD, 13); diff --git a/keysets/philips.h b/keysets/philips.h index 672ca5e..2a02375 100644 --- a/keysets/philips.h +++ b/keysets/philips.h @@ -9,272 +9,340 @@ class PhilipsTV1: public PIRKeysetMetaData { public: PhilipsTV1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class PhilipsTV1a: public PhilipsTV1 { public: PhilipsTV1a( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class PhilipsTV1b: public PhilipsTV1 { public: PhilipsTV1b( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class PhilipsTV1c: public PhilipsTV1 { public: PhilipsTV1c( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class PhilipsTV1d: public PhilipsTV1 { public: PhilipsTV1d( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class PhilipsTV1e: public PhilipsTV1 { public: PhilipsTV1e( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class PhilipsTV1f: public PhilipsTV1 { public: PhilipsTV1f( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class PhilipsTV2: public PIRKeysetMetaData { public: PhilipsTV2( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class PhilipsTV2a: public PhilipsTV2 { public: PhilipsTV2a( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class PhilipsTV2b: public PhilipsTV2 { public: PhilipsTV2b( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class PhilipsTV3: public PIRKeysetMetaData { public: PhilipsTV3( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class PhilipsDVD1: public PIRKeysetMetaData { public: PhilipsDVD1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class PhilipsDVD1a: public PhilipsDVD1 { public: PhilipsDVD1a( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class PhilipsDVD1b: public PhilipsDVD1 { public: PhilipsDVD1b( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class PhilipsDVD1c: public PhilipsDVD1 { public: PhilipsDVD1c( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class PhilipsDVD1d: public PhilipsDVD1 { public: PhilipsDVD1d( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class PhilipsDVD2: public PIRKeysetMetaData { public: PhilipsDVD2( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class PhilipsDVD3: public PIRKeysetMetaData { public: PhilipsDVD3( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class PhilipsDVD3a: public PhilipsDVD3 { public: PhilipsDVD3a( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class PhilipsDVD4: public PIRKeysetMetaData { public: PhilipsDVD4( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class PhilipsVCR1: public PIRKeysetMetaData { public: PhilipsVCR1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class PhilipsVCR1a: public PhilipsVCR1 { public: PhilipsVCR1a( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class PhilipsVCR1b: public PhilipsVCR1 { public: PhilipsVCR1b( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class PhilipsVCR1c: public PhilipsVCR1 { public: PhilipsVCR1c( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class PhilipsSat1: public PIRKeysetMetaData { public: PhilipsSat1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class PhilipsSat2: public PIRKeysetMetaData { public: PhilipsSat2( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class PhilipsSat2a: public PhilipsSat2 { public: PhilipsSat2a( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class PhilipsSat3: public PIRKeysetMetaData { public: PhilipsSat3( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class PhilipsAudio1: public PIRKeysetMetaData { public: PhilipsAudio1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class PhilipsAudio1a: public PhilipsAudio1 { public: PhilipsAudio1a( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class PhilipsAudio1b: public PhilipsAudio1 { public: PhilipsAudio1b( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class PhilipsAudio2: public PIRKeysetMetaData { public: PhilipsAudio2( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class PhilipsAudio3: public PIRKeysetMetaData { public: PhilipsAudio3( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class PhilipsAudio4: public PIRKeysetMetaData { public: PhilipsAudio4( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; #endif // PHILIPS_H diff --git a/keysets/pinnacle.cpp b/keysets/pinnacle.cpp index caaedea..3bad6b5 100644 --- a/keysets/pinnacle.cpp +++ b/keysets/pinnacle.cpp @@ -2,7 +2,6 @@ #include "protocols/rc5protocol.h" PinnaclePCTV1::PinnaclePCTV1( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "PCTV Keyset 1", @@ -10,6 +9,17 @@ PinnaclePCTV1::PinnaclePCTV1( index) { addControlledDevice(Pinnacle_Make, "800i", Computer_Device); +} + + +void PinnaclePCTV1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } threadableProtocol = new RC5Protocol(guiObject, index, 0x47); @@ -43,7 +53,6 @@ PinnaclePCTV1::PinnaclePCTV1( PinnaclePCTV2::PinnaclePCTV2( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "PCTV Keyset 2", @@ -51,6 +60,17 @@ PinnaclePCTV2::PinnaclePCTV2( index) { addControlledDevice(Pinnacle_Make, "USB Stick", Computer_Device); +} + + +void PinnaclePCTV2::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } threadableProtocol = new RC5Protocol(guiObject, index, 0x47); @@ -83,7 +103,6 @@ PinnaclePCTV2::PinnaclePCTV2( PinnaclePCTV3::PinnaclePCTV3( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "PCTV Keyset 3", @@ -91,6 +110,17 @@ PinnaclePCTV3::PinnaclePCTV3( index) { addControlledDevice(Pinnacle_Make, "110i", Computer_Device); +} + + +void PinnaclePCTV3::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } threadableProtocol = new RC5Protocol(guiObject, index, 0x47); diff --git a/keysets/pinnacle.h b/keysets/pinnacle.h index 267be22..300b259 100644 --- a/keysets/pinnacle.h +++ b/keysets/pinnacle.h @@ -9,24 +9,30 @@ class PinnaclePCTV1: public PIRKeysetMetaData { public: PinnaclePCTV1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class PinnaclePCTV2: public PIRKeysetMetaData { public: PinnaclePCTV2( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class PinnaclePCTV3: public PIRKeysetMetaData { public: PinnaclePCTV3( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; #endif // PINNACLE_H diff --git a/keysets/pioneer.cpp b/keysets/pioneer.cpp index 30adfe1..3ae1695 100644 --- a/keysets/pioneer.cpp +++ b/keysets/pioneer.cpp @@ -3,13 +3,24 @@ #include "protocols/lircprotocol.h" PioneerTV1::PioneerTV1( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "TV Keyset 1", Pioneer_Make, index) { +} + + +void PioneerTV1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + threadableProtocol = new PioneerProtocol(guiObject, index); addNECKey("0", Zero_Key, 0xAA, 0x00); @@ -70,13 +81,24 @@ PioneerTV1::PioneerTV1( PioneerTV2::PioneerTV2( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "TV (STB) Keyset 2", Pioneer_Make, index) { +} + + +void PioneerTV2::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + threadableProtocol = new PioneerProtocol(guiObject, index); // I'm not sure this keyset even needs the "0xAA" keys at all... @@ -130,13 +152,24 @@ PioneerTV2::PioneerTV2( PioneerTV3::PioneerTV3( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "TV (STB) Keyset 3", Pioneer_Make, index) { +} + + +void PioneerTV3::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + threadableProtocol = new PioneerProtocol(guiObject, index); addNECKey("KEY_VOLUMEUP", VolumeUp_Key, 0xAA, 0x0A); @@ -190,7 +223,6 @@ PioneerTV3::PioneerTV3( PioneerAudio1::PioneerAudio1( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "Audio Keyset 1", @@ -201,6 +233,17 @@ PioneerAudio1::PioneerAudio1( addControlledDevice(Pioneer_Make, "Hi-Fi DU-L7", Audio_Device); addControlledDevice(Pioneer_Make, "CU-XR015", Audio_Device); addControlledDevice(Pioneer_Make, "A880", Audio_Device); +} + + +void PioneerAudio1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } threadableProtocol = new PioneerProtocol(guiObject, index); @@ -285,11 +328,23 @@ PioneerAudio1::PioneerAudio1( PioneerAudio1a::PioneerAudio1a( - QObject *guiObject, unsigned int index) - : PioneerAudio1(guiObject, index) + : PioneerAudio1(index) { setKeysetName("Audio Keyset 1a"); +} + + +void PioneerAudio1a::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + PioneerAudio1::populateProtocol(guiObject); addNECKey("cd", CDInput_Key, 0xA6, 0x0E); addNECKey("tape", TapeInput_Key, 0xA6, 0x0F); @@ -297,13 +352,24 @@ PioneerAudio1a::PioneerAudio1a( PioneerAudio2::PioneerAudio2( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "Audio Keyset 2", Pioneer_Make, index) { +} + + +void PioneerAudio2::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + threadableProtocol = new PioneerProtocol(guiObject, index); addNECKey("VOL+", VolumeUp_Key, 0xA5, 0x0A); @@ -354,7 +420,6 @@ PioneerAudio2::PioneerAudio2( PioneerAudio3::PioneerAudio3( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "Audio Keyset 3", @@ -364,6 +429,17 @@ PioneerAudio3::PioneerAudio3( addControlledDevice(Pioneer_Make, "A-207R", Audio_Device); addControlledDevice(Pioneer_Make, "SX-302", Audio_Device); addControlledDevice(Pioneer_Make, "VSX-9300", Audio_Device); +} + + +void PioneerAudio3::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } threadableProtocol = new PioneerProtocol(guiObject, index); @@ -508,13 +584,24 @@ PioneerAudio3::PioneerAudio3( PioneerAudio4::PioneerAudio4( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "Audio Keyset 4", Pioneer_Make, index) { +} + + +void PioneerAudio4::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + threadableProtocol = new PioneerProtocol(guiObject, index); addNECKey("tapesel", Unmapped_Key, 0xA1, 0x4C); @@ -544,7 +631,6 @@ PioneerAudio4::PioneerAudio4( PioneerAudio5::PioneerAudio5( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "Audio Keyset 5", @@ -552,6 +638,17 @@ PioneerAudio5::PioneerAudio5( index) { addControlledDevice(Pioneer_Make, "XR-P240C", Audio_Device); +} + + +void PioneerAudio5::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } LIRCProtocol *lp = new LIRCProtocol( guiObject, @@ -604,7 +701,6 @@ PioneerAudio5::PioneerAudio5( PioneerCD1::PioneerCD1( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "CD Keyset 1", @@ -618,6 +714,17 @@ PioneerCD1::PioneerCD1( addControlledDevice(Pioneer_Make, "PD-M107", Audio_Device); addControlledDevice(Pioneer_Make, "PD-S503", Audio_Device); addControlledDevice(Pioneer_Make, "PD-F1007", Audio_Device); +} + + +void PioneerCD1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } threadableProtocol = new PioneerProtocol(guiObject, index); @@ -697,7 +804,6 @@ PioneerCD1::PioneerCD1( PioneerLaserDisc1::PioneerLaserDisc1( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "LD Keyset 1", @@ -705,6 +811,17 @@ PioneerLaserDisc1::PioneerLaserDisc1( index) { addControlledDevice(Pioneer_Make, "CLD-D925", Other_Device); +} + + +void PioneerLaserDisc1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } threadableProtocol = new PioneerProtocol(guiObject, index); @@ -757,7 +874,6 @@ PioneerLaserDisc1::PioneerLaserDisc1( PioneerDVD1::PioneerDVD1( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "DVD Keyset 1", @@ -766,6 +882,17 @@ PioneerDVD1::PioneerDVD1( { addControlledDevice(Pioneer_Make, "VXX2702", DVD_Device); addControlledDevice(Pioneer_Make, "VXX2801", DVD_Device); +} + + +void PioneerDVD1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } threadableProtocol = new PioneerProtocol(guiObject, index); diff --git a/keysets/pioneer.h b/keysets/pioneer.h index 7dfbaa1..656f112 100644 --- a/keysets/pioneer.h +++ b/keysets/pioneer.h @@ -9,96 +9,120 @@ class PioneerTV1: public PIRKeysetMetaData { public: PioneerTV1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class PioneerTV2: public PIRKeysetMetaData { public: PioneerTV2( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class PioneerTV3: public PIRKeysetMetaData { public: PioneerTV3( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class PioneerAudio1: public PIRKeysetMetaData { public: PioneerAudio1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class PioneerAudio1a: public PioneerAudio1 { public: PioneerAudio1a( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class PioneerAudio2: public PIRKeysetMetaData { public: PioneerAudio2( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class PioneerAudio3: public PIRKeysetMetaData { public: PioneerAudio3( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class PioneerAudio4: public PIRKeysetMetaData { public: PioneerAudio4( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class PioneerAudio5: public PIRKeysetMetaData { public: PioneerAudio5( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class PioneerCD1: public PIRKeysetMetaData { public: PioneerCD1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class PioneerLaserDisc1: public PIRKeysetMetaData { public: PioneerLaserDisc1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class PioneerDVD1: public PIRKeysetMetaData { public: PioneerDVD1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; #endif // PIONEER_H diff --git a/keysets/raite.cpp b/keysets/raite.cpp index 9a882cb..608216c 100644 --- a/keysets/raite.cpp +++ b/keysets/raite.cpp @@ -2,7 +2,6 @@ #include "protocols/necprotocol.h" RaiteDVD1::RaiteDVD1( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "DVD Keyset 1", @@ -10,6 +9,17 @@ RaiteDVD1::RaiteDVD1( index) { addControlledDevice(Raite_Make, "DVD-703", DVD_Device); +} + + +void RaiteDVD1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } threadableProtocol = new NECProtocol(guiObject, index, false, true); diff --git a/keysets/raite.h b/keysets/raite.h index 4651342..ba05989 100644 --- a/keysets/raite.h +++ b/keysets/raite.h @@ -9,8 +9,10 @@ class RaiteDVD1: public PIRKeysetMetaData { public: RaiteDVD1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; #endif // RAITE_H diff --git a/keysets/rca.cpp b/keysets/rca.cpp index e6ed72b..e2e583b 100644 --- a/keysets/rca.cpp +++ b/keysets/rca.cpp @@ -3,13 +3,24 @@ #include "protocols/rcaprotocol.h" RCATV1::RCATV1( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "TV Keyset 1", RCA_Make, index) { +} + + +void RCATV1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + threadableProtocol = new RCAProtocol(guiObject, index); setPreData(0xF, 4); @@ -73,22 +84,46 @@ RCATV1::RCATV1( RCATV1a::RCATV1a( - QObject *guiObject, unsigned int index) - : RCATV1(guiObject, index) + : RCATV1(index) { setKeysetName("TV Keyset 1a"); +} + + +void RCATV1a::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + RCATV1::populateProtocol(guiObject); addKey("repeat", Repeat_Key, 0x05, 8); } RCATV1b::RCATV1b( - QObject *guiObject, unsigned int index) - : RCATV1(guiObject, index) + : RCATV1(index) { setKeysetName("TV Keyset 1b"); +} + + +void RCATV1b::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + RCATV1::populateProtocol(guiObject); addKey("reset", Reset_Key, 0x12, 8); } @@ -237,13 +272,24 @@ RCAAux2a::RCAAux2a( RCAVCR1::RCAVCR1( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "VCR Keyset 1", RCA_Make, index) { +} + + +void RCAVCR1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + threadableProtocol = new RCAProtocol(guiObject, index); setPreData(0xE, 4); @@ -291,24 +337,47 @@ RCAVCR1::RCAVCR1( RCAVCR1a::RCAVCR1a( - QObject *guiObject, unsigned int index) - : RCAVCR1(guiObject, index) + : RCAVCR1(index) { setKeysetName("VCR(alt) Keyset 1a"); +} + + +void RCAVCR1a::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + RCAVCR1::populateProtocol(guiObject); setPreData(0xD, 4); } RCADVD1::RCADVD1( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "DVD Keyset 1", RCA_Make, index) { +} + + +void RCADVD1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + threadableProtocol = new RCAProtocol(guiObject, index); setPreData(0x5, 4); @@ -357,11 +426,23 @@ RCADVD1::RCADVD1( RCADVD1a::RCADVD1a( - QObject *guiObject, unsigned int index) - : RCADVD1(guiObject, index) + : RCADVD1(index) { setKeysetName("DVD Keyset 1a"); +} + + +void RCADVD1a::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + RCADVD1::populateProtocol(guiObject); addKey("dvd_ch+", ChannelUp_Key, 0x20, 8); addKey("dvd_ch-", ChannelDown_Key, 0x22, 8); @@ -369,13 +450,24 @@ RCADVD1a::RCADVD1a( RCASat1::RCASat1( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "Satellite(DirecTV) Keyset 1", RCA_Make, index) { +} + + +void RCASat1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + threadableProtocol = new RCAProtocol(guiObject, index); setPreData(0x7, 4); @@ -424,13 +516,24 @@ RCASat1::RCASat1( RCASat2::RCASat2( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "Satellite (Dish Network) Keyset 2", RCA_Make, index) { +} + + +void RCASat2::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + LIRCProtocol *lp = new LIRCProtocol( guiObject, index, diff --git a/keysets/rca.h b/keysets/rca.h index 68b00c0..9d49cbf 100644 --- a/keysets/rca.h +++ b/keysets/rca.h @@ -9,24 +9,30 @@ class RCATV1: public PIRKeysetMetaData { public: RCATV1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class RCATV1a: public RCATV1 { public: RCATV1a( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class RCATV1b: public RCATV1 { public: RCATV1b( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; /* @@ -59,48 +65,60 @@ class RCAVCR1: public PIRKeysetMetaData { public: RCAVCR1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class RCAVCR1a: public RCAVCR1 { public: RCAVCR1a( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class RCADVD1: public PIRKeysetMetaData { public: RCADVD1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class RCADVD1a: public RCADVD1 { public: RCADVD1a( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class RCASat1: public PIRKeysetMetaData { public: RCASat1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class RCASat2: public PIRKeysetMetaData { public: RCASat2( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; #endif // RCA_H diff --git a/keysets/roku.cpp b/keysets/roku.cpp index 068a92a..445f051 100644 --- a/keysets/roku.cpp +++ b/keysets/roku.cpp @@ -2,13 +2,24 @@ #include "protocols/necprotocol.h" RokuBox1::RokuBox1( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "Settop Box Keyset 1", Roku_Make, index) { +} + + +void RokuBox1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + threadableProtocol = new NECProtocol(guiObject, index, true, false); setPreData(0xEFBE, 16); @@ -27,13 +38,24 @@ RokuBox1::RokuBox1( RokuBox2::RokuBox2( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "Soundbridge Keyset 1", Roku_Make, index) { +} + + +void RokuBox2::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + threadableProtocol = new NECProtocol(guiObject, index, false, true); setPreData(0x6F, 8); diff --git a/keysets/roku.h b/keysets/roku.h index 9e312c9..f1a5b42 100644 --- a/keysets/roku.h +++ b/keysets/roku.h @@ -9,16 +9,20 @@ class RokuBox1: public PIRKeysetMetaData { public: RokuBox1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class RokuBox2: public PIRKeysetMetaData { public: RokuBox2( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; #endif // ROKU_H diff --git a/keysets/saba.cpp b/keysets/saba.cpp index d0be389..c90e6a7 100644 --- a/keysets/saba.cpp +++ b/keysets/saba.cpp @@ -2,13 +2,24 @@ #include "protocols/thomsonprotocol.h" SabaTV1::SabaTV1( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "TV/VCR Keyset 1", Saba_Make, index) { +} + + +void SabaTV1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + threadableProtocol = new ThomsonProtocol(guiObject, index); setPreData(0x0, 4); @@ -54,13 +65,24 @@ SabaTV1::SabaTV1( SabaTV2::SabaTV2( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "TV Keyset 2", Saba_Make, index) { +} + + +void SabaTV2::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + threadableProtocol = new ThomsonProtocol(guiObject, index); setPreData(0x3, 4); diff --git a/keysets/saba.h b/keysets/saba.h index bea56bc..5bc83cc 100644 --- a/keysets/saba.h +++ b/keysets/saba.h @@ -9,16 +9,20 @@ class SabaTV1: public PIRKeysetMetaData { public: SabaTV1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class SabaTV2: public PIRKeysetMetaData { public: SabaTV2( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; #endif // SABA_H diff --git a/keysets/sagem.cpp b/keysets/sagem.cpp index 270b3cc..8f534a8 100644 --- a/keysets/sagem.cpp +++ b/keysets/sagem.cpp @@ -2,13 +2,24 @@ #include "protocols/necprotocol.h" SagemTVBox1::SagemTVBox1( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "DVB-T/Cable Box Keyset 1", Sagem_Make, index) { +} + + +void SagemTVBox1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + threadableProtocol = new NECProtocol(guiObject, index, true, true); // setPreData(0xE17A, 16); @@ -56,11 +67,23 @@ SagemTVBox1::SagemTVBox1( SagemTVBox1a::SagemTVBox1a( - QObject *guiObject, unsigned int index) - : SagemTVBox1(guiObject, index) + : SagemTVBox1(index) { setKeysetName("DVB-T/Cable Box Keyset 1a"); +} + + +void SagemTVBox1a::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + SagemTVBox1::populateProtocol(guiObject); addKey("tria2", Unmapped_Key, 0x0F, 8); addKey("epg", Guide_Key, 0x11, 8); diff --git a/keysets/sagem.h b/keysets/sagem.h index 84142c5..90db9d0 100644 --- a/keysets/sagem.h +++ b/keysets/sagem.h @@ -9,16 +9,20 @@ class SagemTVBox1: public PIRKeysetMetaData { public: SagemTVBox1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class SagemTVBox1a: public SagemTVBox1 { public: SagemTVBox1a( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; #endif // SAGEM_H diff --git a/keysets/samsung.cpp b/keysets/samsung.cpp index 9ae5112..f1ddbb8 100644 --- a/keysets/samsung.cpp +++ b/keysets/samsung.cpp @@ -4,7 +4,6 @@ #include "protocols/rc5protocol.h" SamsungTV1::SamsungTV1( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "TV Keyset 1", @@ -15,6 +14,17 @@ SamsungTV1::SamsungTV1( addControlledDevice(Samsung_Make, "SyncMaster 225MW", TV_Device); addControlledDevice(Samsung_Make, "LN32C530F1FXZA", TV_Device); addControlledDevice(Samsung_Make, "UE46B6000VPXZG", TV_Device); // ? +} + + +void SamsungTV1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } threadableProtocol = new SamsungProtocol(guiObject, index); @@ -102,11 +112,23 @@ SamsungTV1::SamsungTV1( SamsungTV1a::SamsungTV1a( - QObject *guiObject, unsigned int index) - : SamsungTV1(guiObject, index) + : SamsungTV1(index) { setKeysetName("TV Keyset 1a"); +} + + +void SamsungTV1a::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + SamsungTV1::populateProtocol(guiObject); addKey("turbo", Unmapped_Key, 0x13, 8); addKey("s.menu", SoundMode_Key, 0x14, 8); @@ -116,13 +138,25 @@ SamsungTV1a::SamsungTV1a( SamsungTV1b::SamsungTV1b( - QObject *guiObject, unsigned int index) - : SamsungTV1(guiObject, index) + : SamsungTV1(index) { setKeysetName("TV Keyset 1b"); addControlledDevice(Samsung_Make, "LE46M51B (R)", TV_Device); // ? +} + + +void SamsungTV1b::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + SamsungTV1::populateProtocol(guiObject); addKey("Red", Red_Key, 0x21, 8); addKey("Exit", Exit_Key, 0x2C, 8); @@ -130,11 +164,23 @@ SamsungTV1b::SamsungTV1b( SamsungTV1c::SamsungTV1c( - QObject *guiObject, unsigned int index) - : SamsungTV1(guiObject, index) + : SamsungTV1(index) { setKeysetName("TV Keyset 1c"); +} + + +void SamsungTV1c::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + SamsungTV1::populateProtocol(guiObject); // Some remotes apparently use channel and volume keys for navigation: addKey("right", Right_Key, 0x07, 8); @@ -146,22 +192,46 @@ SamsungTV1c::SamsungTV1c( SamsungTV1d::SamsungTV1d( - QObject *guiObject, unsigned int index) - : SamsungTV1(guiObject, index) + : SamsungTV1(index) { setKeysetName("TV Keyset 1d"); +} + + +void SamsungTV1d::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + SamsungTV1::populateProtocol(guiObject); addKey("turbo", Unmapped_Key, 0x64, 8); } SamsungTV1e::SamsungTV1e( - QObject *guiObject, unsigned int index) - : SamsungTV1(guiObject, index) + : SamsungTV1(index) { setKeysetName("TV Keyset 1e"); +} + + +void SamsungTV1e::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + SamsungTV1::populateProtocol(guiObject); addKey("p.mode", PictureMode_Key, 0x16, 8); } @@ -169,11 +239,23 @@ SamsungTV1e::SamsungTV1e( // This one overrides the color keys: SamsungTV1f::SamsungTV1f( - QObject *guiObject, unsigned int index) - : SamsungTV1(guiObject, index) + : SamsungTV1(index) { setKeysetName("TV Keyset 1f"); +} + + +void SamsungTV1f::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + SamsungTV1::populateProtocol(guiObject); addKey("p-mode", PictureMode_Key, 0x6C, 8); addKey("s-mode", SoundMode_Key, 0x14, 8); @@ -184,13 +266,24 @@ SamsungTV1f::SamsungTV1f( // Not sure that this even is a Samsung TV... SamsungTV2::SamsungTV2( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "TV Keyset 2", Samsung_Make, index) { +} + + +void SamsungTV2::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + threadableProtocol = new RC5Protocol(guiObject, index); addKey("1", One_Key, 0x1001, 13); @@ -233,11 +326,23 @@ SamsungTV2::SamsungTV2( SamsungTV2a::SamsungTV2a( - QObject *guiObject, unsigned int index) - : SamsungTV2(guiObject, index) + : SamsungTV2(index) { setKeysetName("TV Keyset 2a"); +} + + +void SamsungTV2a::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + SamsungTV2::populateProtocol(guiObject); addKey("volume+", VolumeUp_Key, 0x1010, 13); addKey("volume-", VolumeDown_Key, 0x1011, 13); @@ -247,13 +352,24 @@ SamsungTV2a::SamsungTV2a( SamsungVCR1::SamsungVCR1( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "VCR(DVD) Keyset 1", Samsung_Make, index) { +} + + +void SamsungVCR1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + threadableProtocol = new SamsungProtocol(guiObject, index); // setPreData(0xA0A0, 16); @@ -322,11 +438,23 @@ SamsungVCR1::SamsungVCR1( SamsungVCR1a::SamsungVCR1a( - QObject *guiObject, unsigned int index) - : SamsungVCR1(guiObject, index) + : SamsungVCR1(index) { setKeysetName("VCR(DVD) Keyset 1a"); +} + + +void SamsungVCR1a::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + SamsungVCR1::populateProtocol(guiObject); addKey("right", Right_Key, 0x13, 8); addKey("left", Left_Key, 0x17, 8); @@ -347,11 +475,23 @@ SamsungVCR1a::SamsungVCR1a( SamsungVCR1b::SamsungVCR1b( - QObject *guiObject, unsigned int index) - : SamsungVCR1(guiObject, index) + : SamsungVCR1(index) { setKeysetName("VCR(DVD) Keyset 1b"); +} + + +void SamsungVCR1b::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + SamsungVCR1::populateProtocol(guiObject); addKey("audio", Audio_Key, 0x22, 8); // "output" addKey("+", Unmapped_Key, 0x26, 8); @@ -368,13 +508,25 @@ SamsungVCR1b::SamsungVCR1b( SamsungVCR1c::SamsungVCR1c( - QObject *guiObject, unsigned int index) - : SamsungVCR1a(guiObject, index) + : SamsungVCR1a(index) { + setKeysetName("VCR(DVD) Keyset 1c"); + addControlledDevice(Samsung_Make, "DVD-V1000", DVD_Device); +} - setKeysetName("VCR(DVD) Keyset 1c"); + +void SamsungVCR1c::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + SamsungVCR1a::populateProtocol(guiObject); addKey("right", Right_Key, 0x00, 8); addKey("up", Up_Key, 0x1E, 8); @@ -391,15 +543,27 @@ SamsungVCR1c::SamsungVCR1c( SamsungVCR1d::SamsungVCR1d( - QObject *guiObject, unsigned int index) - : SamsungVCR1(guiObject, index) + : SamsungVCR1(index) { // Combo VCR/TV: addControlledDevice(Samsung_Make, "CXD1342", TV_Device); addControlledDevice(Samsung_Make, "CXD1342", VCR_Device); setKeysetName("VCR/TV Combo Keyset 1d"); +} + + +void SamsungVCR1d::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + SamsungVCR1::populateProtocol(guiObject); addKey("VOL+", VolumeUp_Key, 0x07, 8); addKey("VOL-", VolumeDown_Key, 0x0B, 8); @@ -413,11 +577,23 @@ SamsungVCR1d::SamsungVCR1d( SamsungVCR1e::SamsungVCR1e( - QObject *guiObject, unsigned int index) - : SamsungVCR1(guiObject, index) + : SamsungVCR1(index) { setKeysetName("VCR(DVD) Keyset 1e"); +} + + +void SamsungVCR1e::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + SamsungVCR1::populateProtocol(guiObject); addKey("DIGEST", Unmapped_Key, 0x00, 8); addKey("RIGHT", Right_Key, 0x13, 8); @@ -445,13 +621,24 @@ SamsungVCR1e::SamsungVCR1e( SamsungDVD1::SamsungDVD1( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "DVD Keyset 1", Samsung_Make, index) { +} + + +void SamsungDVD1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + LIRCProtocol *lp = new LIRCProtocol( guiObject, index, @@ -525,22 +712,46 @@ SamsungDVD1::SamsungDVD1( SamsungDVD1a::SamsungDVD1a( - QObject *guiObject, unsigned int index) - : SamsungDVD1(guiObject, index) + : SamsungDVD1(index) { setKeysetName("DVD Keyset 1a"); +} + + +void SamsungDVD1a::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + SamsungDVD1::populateProtocol(guiObject); addKey("hdmi_sel", Unmapped_Key, 0x15EA, 16); } SamsungDVD1b::SamsungDVD1b( - QObject *guiObject, unsigned int index) - : SamsungDVD1(guiObject, index) + : SamsungDVD1(index) { setKeysetName("DVD Keyset 1b"); +} + + +void SamsungDVD1b::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + SamsungDVD1::populateProtocol(guiObject); addKey("Zoom", Zoom_Key, 0x55AA, 16); addKey("i.replay", Replay_Key, 0xB54A, 16); @@ -549,7 +760,6 @@ SamsungDVD1b::SamsungDVD1b( SamsungDVD2::SamsungDVD2( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "DVD Keyset 2", @@ -557,6 +767,17 @@ SamsungDVD2::SamsungDVD2( index) { addControlledDevice(Samsung_Make, "HT-P1200", DVD_Device); +} + + +void SamsungDVD2::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } threadableProtocol= new SamsungProtocol(guiObject, index); @@ -621,13 +842,24 @@ SamsungDVD2::SamsungDVD2( SamsungAC1::SamsungAC1( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "Air Conditioner Keyset 1", Samsung_Make, index) { +} + + +void SamsungAC1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + LIRCProtocol *lp = new LIRCProtocol( guiObject, index, @@ -660,7 +892,6 @@ SamsungAC1::SamsungAC1( SamsungDVBT1::SamsungDVBT1( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "DVB-T Receiver Keyset 1", @@ -669,6 +900,17 @@ SamsungDVBT1::SamsungDVBT1( { addControlledDevice(Samsung_Make, "SMT-1000T", TV_Device); addControlledDevice(Samsung_Make, "SMT-1100T", TV_Device); +} + + +void SamsungDVBT1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } threadableProtocol = new NECProtocol(guiObject, index, true, true); diff --git a/keysets/samsung.h b/keysets/samsung.h index 27d7014..761be7f 100644 --- a/keysets/samsung.h +++ b/keysets/samsung.h @@ -9,8 +9,10 @@ class SamsungTV1: public PIRKeysetMetaData { public: SamsungTV1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; @@ -18,8 +20,10 @@ class SamsungTV1a: public SamsungTV1 { public: SamsungTV1a( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; @@ -27,8 +31,10 @@ class SamsungTV1b: public SamsungTV1 { public: SamsungTV1b( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; @@ -36,8 +42,10 @@ class SamsungTV1c: public SamsungTV1 { public: SamsungTV1c( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; @@ -45,8 +53,10 @@ class SamsungTV1d: public SamsungTV1 { public: SamsungTV1d( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; @@ -54,8 +64,10 @@ class SamsungTV1e: public SamsungTV1 { public: SamsungTV1e( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; @@ -63,8 +75,10 @@ class SamsungTV1f: public SamsungTV1 { public: SamsungTV1f( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; @@ -72,24 +86,30 @@ class SamsungTV2: public PIRKeysetMetaData { public: SamsungTV2( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class SamsungTV2a: public SamsungTV2 { public: SamsungTV2a( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class SamsungVCR1: public PIRKeysetMetaData { public: SamsungVCR1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; @@ -97,88 +117,110 @@ class SamsungVCR1a: public SamsungVCR1 { public: SamsungVCR1a( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class SamsungVCR1b: public SamsungVCR1 { public: SamsungVCR1b( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class SamsungVCR1c: public SamsungVCR1a { public: SamsungVCR1c( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class SamsungVCR1d: public SamsungVCR1 { public: SamsungVCR1d( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class SamsungVCR1e: public SamsungVCR1 { public: SamsungVCR1e( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class SamsungDVD1: public PIRKeysetMetaData { public: SamsungDVD1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class SamsungDVD1a: public SamsungDVD1 { public: SamsungDVD1a( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class SamsungDVD1b: public SamsungDVD1 { public: SamsungDVD1b( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class SamsungDVD2: public PIRKeysetMetaData { public: SamsungDVD2( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class SamsungAC1: public PIRKeysetMetaData { public: SamsungAC1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class SamsungDVBT1: public PIRKeysetMetaData { public: SamsungDVBT1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; #endif // SAMSUNG_H diff --git a/keysets/sanyo.cpp b/keysets/sanyo.cpp index 48c440e..23a5957 100644 --- a/keysets/sanyo.cpp +++ b/keysets/sanyo.cpp @@ -3,7 +3,6 @@ #include "protocols/necprotocol.h" SanyoVCR1::SanyoVCR1( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "DVD/VCR Keyset 1", @@ -12,6 +11,17 @@ SanyoVCR1::SanyoVCR1( { addControlledDevice(Sanyo_Make, "DVW-5000", VCR_Device); addControlledDevice(Sanyo_Make, "DVW-5000", DVD_Device); +} + + +void SanyoVCR1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } threadableProtocol = new NECProtocol(guiObject, index, false, true); @@ -67,7 +77,6 @@ SanyoVCR1::SanyoVCR1( SanyoDVD1::SanyoDVD1( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "DVD Keyset 1", @@ -75,6 +84,17 @@ SanyoDVD1::SanyoDVD1( index) { addControlledDevice(Sanyo_Make, "DVD-SL25", DVD_Device); +} + + +void SanyoDVD1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } threadableProtocol = new NECProtocol(guiObject, index, true, true); @@ -129,13 +149,24 @@ SanyoDVD1::SanyoDVD1( SanyoTV1::SanyoTV1( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "TV Keyset 1", Sanyo_Make, index) { +} + + +void SanyoTV1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + threadableProtocol = new NECProtocol(guiObject, index, false, true); // setPreData(0x1CE3, 16); @@ -208,9 +239,8 @@ SanyoTV1::SanyoTV1( SanyoTV1a::SanyoTV1a( - QObject *guiObject, unsigned int index) - : SanyoTV1(guiObject, index) + : SanyoTV1(index) { setKeysetName("TV Keyset 1a"); @@ -222,6 +252,19 @@ SanyoTV1a::SanyoTV1a( // addControlledDevice(Sanyo_Make, "CED3011PV", TV_Device); // addControlledDevice(Sanyo_Make, "CEM6011PV", TV_Device); // addControlledDevice(Sanyo_Make, "DP32746", TV_Device); +} + + +void SanyoTV1a::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + SanyoTV1::populateProtocol(guiObject); addKey("-/--", DoubleDigit_Key, 0x0A, 8); addKey("CS", Unmapped_Key, 0x0B, 8); // 2- @@ -255,11 +298,23 @@ SanyoTV1a::SanyoTV1a( SanyoTV1b::SanyoTV1b( - QObject *guiObject, unsigned int index) - : SanyoTV1(guiObject, index) + : SanyoTV1(index) { setKeysetName("TV Keyset 1b"); +} + + +void SanyoTV1b::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + SanyoTV1::populateProtocol(guiObject); addKey("image", PictureMode_Key, 0x11, 8); addKey("TV", Unmapped_Key, 0x14, 8); // "tv/video"? @@ -268,11 +323,23 @@ SanyoTV1b::SanyoTV1b( SanyoTV1c::SanyoTV1c( - QObject *guiObject, unsigned int index) - : SanyoTV1a(guiObject, index) + : SanyoTV1a(index) { setKeysetName("TV Keyset 1c"); +} + + +void SanyoTV1c::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + SanyoTV1a::populateProtocol(guiObject); addKey("contrast_>", ContrastUp_Key, 0x0E, 8); addKey("contrast_<", ContrastDown_Key, 0x0F, 8); @@ -288,13 +355,25 @@ SanyoTV1c::SanyoTV1c( SanyoTV1d::SanyoTV1d( - QObject *guiObject, unsigned int index) - : SanyoTV1(guiObject, index) + : SanyoTV1(index) { setKeysetName("TV Keyset 1d"); addControlledDevice(Sanyo_Make, "CTP-6791P", TV_Device); +} + + +void SanyoTV1d::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + SanyoTV1::populateProtocol(guiObject); addKey("audio_mode", SoundMode_Key, 0x1C, 8); // "auto" addKey("Digicon", PictureMode_Key, 0x1D, 8); @@ -304,7 +383,6 @@ SanyoTV1d::SanyoTV1d( SanyoProjector::SanyoProjector( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "Projector Keyset 1", @@ -312,6 +390,17 @@ SanyoProjector::SanyoProjector( index) { addControlledDevice(Sanyo_Make, "PLV-Z1", Other_Device); +} + + +void SanyoProjector::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } threadableProtocol = new NECProtocol(guiObject, index, false, true); diff --git a/keysets/sanyo.h b/keysets/sanyo.h index d155d1c..a609fc5 100644 --- a/keysets/sanyo.h +++ b/keysets/sanyo.h @@ -9,64 +9,80 @@ class SanyoVCR1: public PIRKeysetMetaData { public: SanyoVCR1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class SanyoDVD1: public PIRKeysetMetaData { public: SanyoDVD1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class SanyoTV1: public PIRKeysetMetaData { public: SanyoTV1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class SanyoTV1a: public SanyoTV1 { public: SanyoTV1a( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class SanyoTV1b: public SanyoTV1 { public: SanyoTV1b( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class SanyoTV1c: public SanyoTV1a { public: SanyoTV1c( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class SanyoTV1d: public SanyoTV1 { public: SanyoTV1d( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class SanyoProjector: public PIRKeysetMetaData { public: SanyoProjector( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; #endif // SANYO_H diff --git a/keysets/sharp.cpp b/keysets/sharp.cpp index 3c75da1..cdcd61b 100644 --- a/keysets/sharp.cpp +++ b/keysets/sharp.cpp @@ -3,13 +3,24 @@ #include "protocols/necprotocol.h" SharpTV1::SharpTV1( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "TV Keyset 1", Sharp_Make, index) { +} + + +void SharpTV1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + threadableProtocol = new SharpProtocol(guiObject, index, true); addSharpKey("1", One_Key, 0x01, 0x01); @@ -113,11 +124,23 @@ SharpTV1::SharpTV1( SharpTV1a::SharpTV1a( - QObject *guiObject, unsigned int index) - : SharpTV1(guiObject, index) + : SharpTV1(index) { setKeysetName("TV Keyset 1a"); +} + + +void SharpTV1a::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + SharpTV1::populateProtocol(guiObject); addSharpKey("Key", Unmapped_Key, 0x01, 0x0D); addSharpKey("Time", Sleep_Key, 0x01, 0x0E); @@ -140,11 +163,23 @@ SharpTV1a::SharpTV1a( SharpTV1b::SharpTV1b( - QObject *guiObject, unsigned int index) - : SharpTV1(guiObject, index) + : SharpTV1(index) { setKeysetName("TV Keyset 1b"); +} + + +void SharpTV1b::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + SharpTV1::populateProtocol(guiObject); addSharpKey("FINE_TUNING", Unmapped_Key, 0x01, 0x0E); addSharpKey("chScan", Scan_Key, 0x01, 0x1C); @@ -162,11 +197,23 @@ SharpTV1b::SharpTV1b( SharpTV1c::SharpTV1c( - QObject *guiObject, unsigned int index) - : SharpTV1(guiObject, index) + : SharpTV1(index) { setKeysetName("TV Keyset 1c"); +} + + +void SharpTV1c::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + SharpTV1::populateProtocol(guiObject); addSharpKey("save_ch", Unmapped_Key, 0x01, 0x41); addSharpKey("del_ch", Unmapped_Key, 0x01, 0x3D); @@ -174,11 +221,23 @@ SharpTV1c::SharpTV1c( SharpTV1d::SharpTV1d( - QObject *guiObject, unsigned int index) - : SharpTV1(guiObject, index) + : SharpTV1(index) { setKeysetName("TV Keyset 1d"); +} + + +void SharpTV1d::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + SharpTV1::populateProtocol(guiObject); addSharpKey("P-MODE", PictureMode_Key, 0x01, 0x4D); addSharpKey("S-MODE", SoundMode_Key, 0x01, 0x26); @@ -186,11 +245,23 @@ SharpTV1d::SharpTV1d( SharpTV1e::SharpTV1e( - QObject *guiObject, unsigned int index) - : SharpTV1(guiObject, index) + : SharpTV1(index) { setKeysetName("TV Keyset 1e"); +} + + +void SharpTV1e::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + SharpTV1::populateProtocol(guiObject); addSharpKey("DOWN", Down_Key, 0x01, 0x20); addSharpKey("OK", Select_Key, 0x01, 0x52); @@ -204,13 +275,24 @@ SharpTV1e::SharpTV1e( SharpVCR1::SharpVCR1( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "VCR Keyset 1", Sharp_Make, index) { +} + + +void SharpVCR1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + threadableProtocol = new SharpProtocol(guiObject, index, true); addSharpKey("1", One_Key, 0x03, 0x01); @@ -282,13 +364,24 @@ SharpVCR1::SharpVCR1( SharpReceiver1::SharpReceiver1( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "Receiver Keyset 1", Sharp_Make, index) { +} + + +void SharpReceiver1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + threadableProtocol = new SharpProtocol(guiObject, index, true); addSharpKey("PRESET+", ChannelUp_Key, 0x12, 0x11); @@ -334,13 +427,24 @@ SharpReceiver1::SharpReceiver1( SharpAC1::SharpAC1( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "Air Conditioner 1", Sharp_Make, index) { +} + + +void SharpAC1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + threadableProtocol = new NECProtocol(guiObject, index, false, true); setPreData(0xF508, 16); diff --git a/keysets/sharp.h b/keysets/sharp.h index ee124b6..e1b3926 100644 --- a/keysets/sharp.h +++ b/keysets/sharp.h @@ -9,56 +9,70 @@ class SharpTV1: public PIRKeysetMetaData { public: SharpTV1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class SharpTV1a: public SharpTV1 { public: SharpTV1a( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class SharpTV1b: public SharpTV1 { public: SharpTV1b( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class SharpTV1c: public SharpTV1 { public: SharpTV1c( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class SharpTV1d: public SharpTV1 { public: SharpTV1d( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class SharpTV1e: public SharpTV1 { public: SharpTV1e( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class SharpVCR1: public PIRKeysetMetaData { public: SharpVCR1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; @@ -66,16 +80,20 @@ class SharpReceiver1: public PIRKeysetMetaData { public: SharpReceiver1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class SharpAC1: public PIRKeysetMetaData { public: SharpAC1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; #endif // SHARP_H diff --git a/keysets/sky.cpp b/keysets/sky.cpp index 440f194..8ac4017 100644 --- a/keysets/sky.cpp +++ b/keysets/sky.cpp @@ -2,13 +2,24 @@ #include "protocols/rc6skyprotocol.h" SkyReceiver1::SkyReceiver1( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "Receiver Keyset 1", Sky_Make, index) { +} + + +void SkyReceiver1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + threadableProtocol = new RC6SkyProtocol(guiObject, index); setPreData(0x000, 12); @@ -53,7 +64,7 @@ SkyReceiver1::SkyReceiver1( addKey("SKY", Unmapped_Key, 0x80, 8); addKey("HELP", Unmapped_Key, 0x81, 8); // menu? addKey("BACK", Exit_Key, 0x83, 8); - addKey("TV", Unmapped_Key, 0x84, 8); + addKey("TV", Input_Key, 0x84, 8); addKey("INFO", Info_Key, 0xCB, 8); addKey("TV_GUIDE", Guide_Key, 0xCC, 8); @@ -63,11 +74,23 @@ SkyReceiver1::SkyReceiver1( SkyReceiver1a::SkyReceiver1a( - QObject *guiObject, unsigned int index) - : SkyReceiver1(guiObject, index) + : SkyReceiver1(index) { setKeysetName("Receiver Keyset 1a"); +} + + +void SkyReceiver1a::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + SkyReceiver1::populateProtocol(guiObject); setPreData(0x00C, 12); } diff --git a/keysets/sky.h b/keysets/sky.h index 46043ee..123363c 100644 --- a/keysets/sky.h +++ b/keysets/sky.h @@ -9,16 +9,20 @@ class SkyReceiver1: public PIRKeysetMetaData { public: SkyReceiver1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class SkyReceiver1a: public SkyReceiver1 { public: SkyReceiver1a( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; #endif // SKY_H diff --git a/keysets/sony.cpp b/keysets/sony.cpp index 4805e53..0e90091 100644 --- a/keysets/sony.cpp +++ b/keysets/sony.cpp @@ -3,7 +3,6 @@ SonyTV1::SonyTV1( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "TV Keyset 1", @@ -22,19 +21,30 @@ SonyTV1::SonyTV1( addControlledDevice(Sony_Make, "KDL-46X2000", TV_Device); addControlledDevice(Sony_Make, "KDL-40X2000", TV_Device); addControlledDevice(Sony_Make, "KP-46WT520", TV_Device); +} + + +void SonyTV1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } threadableProtocol = new SIRCProtocol(guiObject, index); - addSIRC12Key("1", One_Key, 0x01, 0x0); - addSIRC12Key("2", Two_Key, 0x01, 0x1); - addSIRC12Key("3", Three_Key, 0x01, 0x2); - addSIRC12Key("4", Four_Key, 0x01, 0x3); - addSIRC12Key("5", Five_Key, 0x01, 0x4); - addSIRC12Key("6", Six_Key, 0x01, 0x5); - addSIRC12Key("7", Seven_Key, 0x01, 0x6); - addSIRC12Key("8", Eight_Key, 0x01, 0x7); - addSIRC12Key("9", Nine_Key, 0x01, 0x8); - addSIRC12Key("0", Zero_Key, 0x01, 0x9); + addSIRC12Key("1", One_Key, 0x01, 0x00); + addSIRC12Key("2", Two_Key, 0x01, 0x01); + addSIRC12Key("3", Three_Key, 0x01, 0x02); + addSIRC12Key("4", Four_Key, 0x01, 0x03); + addSIRC12Key("5", Five_Key, 0x01, 0x04); + addSIRC12Key("6", Six_Key, 0x01, 0x05); + addSIRC12Key("7", Seven_Key, 0x01, 0x06); + addSIRC12Key("8", Eight_Key, 0x01, 0x07); + addSIRC12Key("9", Nine_Key, 0x01, 0x08); + addSIRC12Key("0", Zero_Key, 0x01, 0x09); addSIRC12Key("enter", Enter_Key, 0x01, 0x0B); addSIRC12Key("1-", Unmapped_Key, 0x01, 0x0C); addSIRC12Key("2-", Unmapped_Key, 0x01, 0x0D); @@ -134,13 +144,25 @@ SonyTV1::SonyTV1( SonyTV1a::SonyTV1a( - QObject *guiObject, unsigned int index) - : SonyTV1(guiObject, index) + : SonyTV1(index) { setKeysetName("TV Keyset 1a"); addControlledDevice(Sony_Make, "KDW-25", TV_Device); +} + + +void SonyTV1a::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + SonyTV1::populateProtocol(guiObject); addSIRC12Key("LEFT/-/RED", Left_Key, 0x03, 0x4C); addSIRC12Key("UP/GREEN", Up_Key, 0x03, 0x4D); @@ -150,11 +172,23 @@ SonyTV1a::SonyTV1a( SonyTV1b::SonyTV1b( - QObject *guiObject, unsigned int index) - : SonyTV1a(guiObject, index) + : SonyTV1a(index) { setKeysetName("TV Keyset 1b"); +} + + +void SonyTV1b::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + SonyTV1a::populateProtocol(guiObject); addSIRC12Key("clear", Unmapped_Key, 0x01, 0x34); // "Clock Clear" addSIRC12Key("level_plus", Unmapped_Key, 0x01, 0x74); @@ -165,11 +199,23 @@ SonyTV1b::SonyTV1b( // Not sure about these codes: SonyTV1c::SonyTV1c( - QObject *guiObject, unsigned int index) - : SonyTV1(guiObject, index) + : SonyTV1(index) { setKeysetName("TV Keyset 1c"); +} + + +void SonyTV1c::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + SonyTV1::populateProtocol(guiObject); addSIRC12Key(">>", FastForward_Key, 0x01, 0x58); addSIRC12Key("<<", Rewind_Key, 0x01, 0x59); @@ -189,13 +235,24 @@ SonyTV1c::SonyTV1c( // These controls don't quite match other SIRC data. (some do, some don't) // This all taken from LIRC "AMPIR" config file. SonyAmp1::SonyAmp1( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "Amp Keyset 1", Sony_Make, index) { +} + + +void SonyAmp1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + threadableProtocol = new SIRCProtocol(guiObject, index); addSIRC12Key("1", One_Key, 0x0C, 0x00); @@ -235,13 +292,24 @@ SonyAmp1::SonyAmp1( // These taken from LIRC config file "RM-AV2100T". SonyAmp2::SonyAmp2( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "Amp Keyset 2", Sony_Make, index) { +} + + +void SonyAmp2::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + threadableProtocol = new SIRCProtocol(guiObject, index); addSIRC12Key("up", Up_Key, 0x0C, 0x78); @@ -285,13 +353,24 @@ SonyAmp2::SonyAmp2( SonyAudio1::SonyAudio1( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "Audio Keyset 1", Sony_Make, index) { +} + + +void SonyAudio1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + threadableProtocol = new SIRCProtocol(guiObject, index); addSIRC12Key("tv_video", Input_Key, 0x01, 0x25); @@ -375,11 +454,23 @@ SonyAudio1::SonyAudio1( SonyAudio1a::SonyAudio1a( - QObject *guiObject, unsigned int index) - : SonyAudio1(guiObject, index) + : SonyAudio1(index) { setKeysetName("Audio Keyset 1a"); +} + + +void SonyAudio1a::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + SonyAudio1::populateProtocol(guiObject); addSIRC12Key("tape", TapeInput_Key, 0x10, 0x23); @@ -391,13 +482,24 @@ SonyAudio1a::SonyAudio1a( SonyDAT1::SonyDAT1( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "DAT Keyset 1", Sony_Make, index) { +} + + +void SonyDAT1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + threadableProtocol = new SIRCProtocol(guiObject, index); setPostData(0x07, 5); @@ -434,13 +536,24 @@ SonyDAT1::SonyDAT1( SonyDVD1::SonyDVD1( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "DVD Keyset 1", Sony_Make, index) { +} + + +void SonyDVD1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + threadableProtocol = new SIRCProtocol(guiObject, index); addSIRC20Key("1", One_Key, 0x49, 0x1A, 0x00); @@ -545,11 +658,23 @@ SonyDVD1::SonyDVD1( SonyDVD1a::SonyDVD1a( - QObject *guiObject, unsigned int index) - : SonyDVD1(guiObject, index) + : SonyDVD1(index) { setKeysetName("DVD Keyset 1a"); +} + + +void SonyDVD1a::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + SonyDVD1::populateProtocol(guiObject); addSIRC20Key("STEP_BACK", StepBack_Key, 0x49, 0x1A, 0x20); addSIRC20Key("STEP_FORWARD", StepForward_Key, 0x49, 0x1A, 0x21); @@ -559,11 +684,23 @@ SonyDVD1a::SonyDVD1a( SonyDVD1b::SonyDVD1b( - QObject *guiObject, unsigned int index) - : SonyDVD1(guiObject, index) + : SonyDVD1(index) { setKeysetName("DVD Keyset 1b"); +} + + +void SonyDVD1b::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + SonyDVD1::populateProtocol(guiObject); addSIRC20Key("SLOW-", SlowMinus_Key, 0x49, 0x1A, 0x72); addSIRC20Key("SLOW+", SlowPlus_Key, 0x49, 0x1A, 0x73); @@ -571,11 +708,23 @@ SonyDVD1b::SonyDVD1b( SonyDVD1c::SonyDVD1c( - QObject *guiObject, unsigned int index) - : SonyDVD1(guiObject, index) + : SonyDVD1(index) { setKeysetName("DVD Keyset 1c"); +} + + +void SonyDVD1c::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + SonyDVD1::populateProtocol(guiObject); addSIRC20Key("up", Up_Key, 0x49, 0x1A, 0x39); addSIRC20Key("down", Down_Key, 0x49, 0x1A, 0x38); @@ -587,13 +736,24 @@ SonyDVD1c::SonyDVD1c( SonyVCR1::SonyVCR1( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "VCR Keyset 1", Sony_Make, index) { +} + + +void SonyVCR1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + threadableProtocol = new SIRCProtocol(guiObject, index); addSIRC12Key("VOL_UP", VolumeUp_Key, 0x01, 0x12); @@ -644,11 +804,23 @@ SonyVCR1::SonyVCR1( SonyVCR1a::SonyVCR1a( - QObject *guiObject, unsigned int index) - : SonyVCR1(guiObject, index) + : SonyVCR1(index) { setKeysetName("VCR Keyset 1a"); +} + + +void SonyVCR1a::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + SonyVCR1::populateProtocol(guiObject); // These are the expected cursor keys: addSIRC12Key("up", Up_Key, 0x0B, 0x42); @@ -663,11 +835,23 @@ SonyVCR1a::SonyVCR1a( // Extra codes off of hifi-remote website: SonyVCR1b::SonyVCR1b( - QObject *guiObject, unsigned int index) - : SonyVCR1a(guiObject, index) + : SonyVCR1a(index) { setKeysetName("VCR Keyset 1b"); +} + + +void SonyVCR1b::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + SonyVCR1a::populateProtocol(guiObject); addSIRC12Key("Volume Up", VolumeUp_Key, 0x0B, 0x12); addSIRC12Key("Volume Down", VolumeDown_Key, 0x0B, 0x13); @@ -688,13 +872,24 @@ SonyVCR1b::SonyVCR1b( SonyReceiver1::SonyReceiver1( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "Receiver Keyset 1", Sony_Make, index) { +} + + +void SonyReceiver1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + threadableProtocol = new SIRCProtocol(guiObject, index); addSIRC15Key("1", One_Key, 0x30, 0x00); diff --git a/keysets/sony.h b/keysets/sony.h index 9ee2ac4..2afd53b 100644 --- a/keysets/sony.h +++ b/keysets/sony.h @@ -9,8 +9,10 @@ class SonyTV1: public PIRKeysetMetaData { public: SonyTV1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; @@ -18,8 +20,10 @@ class SonyTV1a: public SonyTV1 { public: SonyTV1a( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; @@ -27,8 +31,10 @@ class SonyTV1b: public SonyTV1a { public: SonyTV1b( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; @@ -36,8 +42,10 @@ class SonyTV1c: public SonyTV1 { public: SonyTV1c( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; @@ -45,8 +53,10 @@ class SonyAmp1: public PIRKeysetMetaData { public: SonyAmp1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; @@ -54,8 +64,10 @@ class SonyAmp2: public PIRKeysetMetaData { public: SonyAmp2( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; @@ -63,8 +75,10 @@ class SonyAudio1: public PIRKeysetMetaData { public: SonyAudio1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; @@ -72,8 +86,10 @@ class SonyAudio1a: public SonyAudio1 { public: SonyAudio1a( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; @@ -81,8 +97,10 @@ class SonyDAT1: public PIRKeysetMetaData { public: SonyDAT1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; @@ -90,8 +108,10 @@ class SonyDVD1: public PIRKeysetMetaData { public: SonyDVD1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; @@ -99,8 +119,10 @@ class SonyDVD1a: public SonyDVD1 { public: SonyDVD1a( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; @@ -108,8 +130,10 @@ class SonyDVD1b: public SonyDVD1 { public: SonyDVD1b( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; @@ -117,8 +141,10 @@ class SonyDVD1c: public SonyDVD1 { public: SonyDVD1c( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; @@ -126,8 +152,10 @@ class SonyVCR1: public PIRKeysetMetaData { public: SonyVCR1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; @@ -135,8 +163,10 @@ class SonyVCR1a: public SonyVCR1 { public: SonyVCR1a( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; @@ -144,8 +174,10 @@ class SonyVCR1b: public SonyVCR1a { public: SonyVCR1b( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; @@ -153,8 +185,10 @@ class SonyReceiver1: public PIRKeysetMetaData { public: SonyReceiver1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; #endif // SONY_H diff --git a/keysets/tivo.cpp b/keysets/tivo.cpp index c905811..596be26 100644 --- a/keysets/tivo.cpp +++ b/keysets/tivo.cpp @@ -2,13 +2,24 @@ #include "protocols/lircprotocol.h" Tivo1::Tivo1( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "Tivo Keyset 1", Tivo_Make, index) { +} + + +void Tivo1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + LIRCProtocol *lp = new LIRCProtocol( guiObject, index, 560, 560, @@ -65,11 +76,23 @@ Tivo1::Tivo1( Tivo1a::Tivo1a( - QObject *guiObject, unsigned int index) - : Tivo1(guiObject, index) + : Tivo1(index) { setKeysetName("Tivo Keyset 1a"); +} + + +void Tivo1a::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + Tivo1::populateProtocol(guiObject); addKey("TIVO", Power_Key, 0xE00F, 16); addKey("TVPOWER", Unmapped_Key, 0x0807, 16); @@ -80,11 +103,23 @@ Tivo1a::Tivo1a( Tivo1b::Tivo1b( - QObject *guiObject, unsigned int index) - : Tivo1(guiObject, index) + : Tivo1(index) { setKeysetName("Tivo Keyset 1b"); +} + + +void Tivo1b::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + Tivo1::populateProtocol(guiObject); addKey("tivo", Power_Key, 0xF00F, 16); addKey("tvpower", Unmapped_Key, 0x48B7, 16); @@ -97,11 +132,23 @@ Tivo1b::Tivo1b( Tivo1c::Tivo1c( - QObject *guiObject, unsigned int index) - : Tivo1(guiObject, index) + : Tivo1(index) { setKeysetName("Tivo Keyset 1c"); +} + + +void Tivo1c::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + Tivo1::populateProtocol(guiObject); addKey("TIVO", Power_Key, 0x500F, 16); addKey("TV_POWER", Unmapped_Key, 0x0807, 16); @@ -112,11 +159,23 @@ Tivo1c::Tivo1c( Tivo1d::Tivo1d( - QObject *guiObject, unsigned int index) - : Tivo1(guiObject, index) + : Tivo1(index) { setKeysetName("Tivo Keyset 1d"); +} + + +void Tivo1d::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + Tivo1::populateProtocol(guiObject); addKey("TIVO", Power_Key, 0x400F, 16); addKey("TVPWR", Unmapped_Key, 0x0807, 16); diff --git a/keysets/tivo.h b/keysets/tivo.h index 3a601c2..c438ec4 100644 --- a/keysets/tivo.h +++ b/keysets/tivo.h @@ -9,40 +9,50 @@ class Tivo1: public PIRKeysetMetaData { public: Tivo1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class Tivo1a: public Tivo1 { public: Tivo1a( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class Tivo1b: public Tivo1 { public: Tivo1b( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class Tivo1c: public Tivo1 { public: Tivo1c( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class Tivo1d: public Tivo1 { public: Tivo1d( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; #endif // TIVO_H diff --git a/keysets/topfield.cpp b/keysets/topfield.cpp index 5581b1d..256009b 100644 --- a/keysets/topfield.cpp +++ b/keysets/topfield.cpp @@ -2,7 +2,6 @@ #include "protocols/necprotocol.h" TopfieldPVR1::TopfieldPVR1( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "PVR Keyset 1", @@ -11,6 +10,17 @@ TopfieldPVR1::TopfieldPVR1( { addControlledDevice(Topfield_Make, "PVR 4000", Other_Device); addControlledDevice(Topfield_Make, "PVR 5000", Other_Device); +} + + +void TopfieldPVR1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } threadableProtocol = new NECProtocol(guiObject, index, false, true); @@ -73,7 +83,6 @@ TopfieldPVR1::TopfieldPVR1( TopfieldSat1::TopfieldSat1( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "Sat Keyset 1", @@ -81,6 +90,17 @@ TopfieldSat1::TopfieldSat1( index) { addControlledDevice(Topfield_Make, "TF4000Fi", Sat_Device); +} + + +void TopfieldSat1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } threadableProtocol = new NECProtocol(guiObject, index, true, true); diff --git a/keysets/topfield.h b/keysets/topfield.h index ca9e847..b33c057 100644 --- a/keysets/topfield.h +++ b/keysets/topfield.h @@ -9,16 +9,20 @@ class TopfieldPVR1: public PIRKeysetMetaData { public: TopfieldPVR1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class TopfieldSat1: public PIRKeysetMetaData { public: TopfieldSat1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; #endif // TOPFIELD_H diff --git a/keysets/toshiba.cpp b/keysets/toshiba.cpp index 6d194a6..ba2edcb 100644 --- a/keysets/toshiba.cpp +++ b/keysets/toshiba.cpp @@ -2,7 +2,6 @@ #include "protocols/necprotocol.h" ToshibaTV1::ToshibaTV1( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "TV Keyset 1", @@ -10,6 +9,17 @@ ToshibaTV1::ToshibaTV1( index) { addControlledDevice(Toshiba_Make, "21S03D", TV_Device); +} + + +void ToshibaTV1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } threadableProtocol = new NECProtocol(guiObject, index, false, true); @@ -81,13 +91,25 @@ ToshibaTV1::ToshibaTV1( ToshibaTV1a::ToshibaTV1a( - QObject *guiObject, unsigned int index) - : ToshibaTV1(guiObject, index) + : ToshibaTV1(index) { setKeysetName("TV Keyset 1a"); addControlledDevice(Toshiba_Make, "27A51", TV_Device); +} + + +void ToshibaTV1a::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + ToshibaTV1::populateProtocol(guiObject); addKey("menu/enter", Menu_Key, 0x80, 8); addKey("menu/enter", Select_Key, 0x80, 8); @@ -95,11 +117,23 @@ ToshibaTV1a::ToshibaTV1a( ToshibaTV1b::ToshibaTV1b( - QObject *guiObject, unsigned int index) - : ToshibaTV1(guiObject, index) + : ToshibaTV1(index) { setKeysetName("TV Keyset 1b"); +} + + +void ToshibaTV1b::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + ToshibaTV1::populateProtocol(guiObject); addKey("right", Right_Key, 0x19, 8); // "fav+" addKey("left", Left_Key, 0x1D, 8); // "fav-" @@ -111,11 +145,23 @@ ToshibaTV1b::ToshibaTV1b( ToshibaTV1c::ToshibaTV1c( - QObject *guiObject, unsigned int index) - : ToshibaTV1f(guiObject, index) + : ToshibaTV1f(index) { setKeysetName("TV Keyset 1c"); +} + + +void ToshibaTV1c::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + ToshibaTV1f::populateProtocol(guiObject); addKey("textzoom", TeletextSize_Key, 0x0D, 8); // "Enlarge" addKey("texttime", TeletextTime_Key, 0x15, 8); @@ -129,11 +175,23 @@ ToshibaTV1c::ToshibaTV1c( ToshibaTV1d::ToshibaTV1d( - QObject *guiObject, unsigned int index) - : ToshibaTV1f(guiObject, index) + : ToshibaTV1f(index) { setKeysetName("TV Keyset 1d"); +} + + +void ToshibaTV1d::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + ToshibaTV1f::populateProtocol(guiObject); addKey("subtitle", Captions_Key, 0x0C, 8); addKey("page+", PageDown_Key, 0x0D,8); @@ -150,11 +208,23 @@ ToshibaTV1d::ToshibaTV1d( ToshibaTV1e::ToshibaTV1e( - QObject *guiObject, unsigned int index) - : ToshibaTV1(guiObject, index) + : ToshibaTV1(index) { setKeysetName("TV Keyset 1e"); +} + + +void ToshibaTV1e::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + ToshibaTV1::populateProtocol(guiObject); addKey("SKIPPREV", Previous_Key, 0x11, 8); addKey("FFWD", FastForward_Key, 0x2A, 8); @@ -166,13 +236,25 @@ ToshibaTV1e::ToshibaTV1e( ToshibaTV1f::ToshibaTV1f( - QObject *guiObject, unsigned int index) - : ToshibaTV1(guiObject, index) + : ToshibaTV1(index) { setKeysetName("TV Keyset 1f"); addControlledDevice(Toshiba_Make, "Regza AV50*", TV_Device); +} + + +void ToshibaTV1f::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + ToshibaTV1::populateProtocol(guiObject); addKey("info", Info_Key, 0x16, 8); addKey("stillpicture", Pause_Key, 0x22, 8); @@ -182,11 +264,23 @@ ToshibaTV1f::ToshibaTV1f( ToshibaTV1g::ToshibaTV1g( - QObject *guiObject, unsigned int index) - : ToshibaTV1(guiObject, index) + : ToshibaTV1(index) { setKeysetName("TV Keyset 1g"); +} + + +void ToshibaTV1g::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + ToshibaTV1::populateProtocol(guiObject); addKey("menu", Menu_Key, 0x80, 8); addKey("set+", Right_Key, 0x82, 8); @@ -196,11 +290,23 @@ ToshibaTV1g::ToshibaTV1g( ToshibaTV1h::ToshibaTV1h( - QObject *guiObject, unsigned int index) - : ToshibaTV1b(guiObject, index) + : ToshibaTV1b(index) { setKeysetName("TV Keyset 1h"); +} + + +void ToshibaTV1h::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + ToshibaTV1b::populateProtocol(guiObject); addKey("last (prev ch)", PrevChannel_Key, 0x17, 8); addKey("program guide", Guide_Key, 0x1C, 8); @@ -209,13 +315,24 @@ ToshibaTV1h::ToshibaTV1h( ToshibaVCR1::ToshibaVCR1( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "VCR Keyset 1", Toshiba_Make, index) { +} + + +void ToshibaVCR1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + threadableProtocol = new NECProtocol(guiObject, index, false, true); setPreData(0x44, 8); @@ -251,11 +368,23 @@ ToshibaVCR1::ToshibaVCR1( ToshibaVCR1a::ToshibaVCR1a( - QObject *guiObject, unsigned int index) - : ToshibaVCR1(guiObject, index) + : ToshibaVCR1(index) { setKeysetName("VCR Keyset 1a"); +} + + +void ToshibaVCR1a::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + ToshibaVCR1::populateProtocol(guiObject); addKey("ch+", ChannelUp_Key, 0x1E, 8); // addKey("ch-", ChannelDown_Key, 0x1F, 8); // Already in parent @@ -263,13 +392,24 @@ ToshibaVCR1a::ToshibaVCR1a( ToshibaDisc1::ToshibaDisc1( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "Disc Keyset 1", Toshiba_Make, index) { +} + + +void ToshibaDisc1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + threadableProtocol = new NECProtocol(guiObject, index, false, true); // setPreData(0xA25D, 16); @@ -328,11 +468,23 @@ ToshibaDisc1::ToshibaDisc1( ToshibaDisc1a::ToshibaDisc1a( - QObject *guiObject, unsigned int index) - : ToshibaDisc1(guiObject, index) + : ToshibaDisc1(index) { setKeysetName("Disc Keyset 1a"); +} + + +void ToshibaDisc1a::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + ToshibaDisc1::populateProtocol(guiObject); addKey("setup", Menu_Key, 0x20, 8); addKey("audio", Audio_Key, 0x27, 8); @@ -342,11 +494,23 @@ ToshibaDisc1a::ToshibaDisc1a( ToshibaDisc1b::ToshibaDisc1b( - QObject *guiObject, unsigned int index) - : ToshibaDisc1(guiObject, index) + : ToshibaDisc1(index) { setKeysetName("Disc Keyset 1b"); +} + + +void ToshibaDisc1b::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + ToshibaDisc1::populateProtocol(guiObject); addKey("enter", Select_Key, 0x84, 8); addKey("mark", Unmapped_Key, 0x21, 8); @@ -354,11 +518,23 @@ ToshibaDisc1b::ToshibaDisc1b( ToshibaDisc1c::ToshibaDisc1c( - QObject *guiObject, unsigned int index) - : ToshibaDisc1a(guiObject, index) + : ToshibaDisc1a(index) { setKeysetName("Disc Keyset 1c"); +} + + +void ToshibaDisc1c::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + ToshibaDisc1a::populateProtocol(guiObject); addKey("KEY_DVD", Unmapped_Key, 0x22, 8); addKey("KEY_SLOW", Slow_Key, 0x26, 8); @@ -368,11 +544,23 @@ ToshibaDisc1c::ToshibaDisc1c( ToshibaDisc1d::ToshibaDisc1d( - QObject *guiObject, unsigned int index) - : ToshibaDisc1a(guiObject, index) + : ToshibaDisc1a(index) { setKeysetName("Disc Keyset 1d"); +} + + +void ToshibaDisc1d::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + ToshibaDisc1a::populateProtocol(guiObject); addKey("recall", PrevChannel_Key, 0x16, 8); } diff --git a/keysets/toshiba.h b/keysets/toshiba.h index d749f98..1dc7572 100644 --- a/keysets/toshiba.h +++ b/keysets/toshiba.h @@ -9,128 +9,160 @@ class ToshibaTV1: public PIRKeysetMetaData { public: ToshibaTV1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class ToshibaTV1a: public ToshibaTV1 { public: ToshibaTV1a( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class ToshibaTV1b: public ToshibaTV1 { public: ToshibaTV1b( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class ToshibaTV1f: public ToshibaTV1 { public: ToshibaTV1f( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class ToshibaTV1c: public ToshibaTV1f { public: ToshibaTV1c( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class ToshibaTV1d: public ToshibaTV1f { public: ToshibaTV1d( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class ToshibaTV1e: public ToshibaTV1 { public: ToshibaTV1e( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class ToshibaTV1g: public ToshibaTV1 { public: ToshibaTV1g( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class ToshibaTV1h: public ToshibaTV1b { public: ToshibaTV1h( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class ToshibaVCR1: public PIRKeysetMetaData { public: ToshibaVCR1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class ToshibaVCR1a: public ToshibaVCR1 { public: ToshibaVCR1a( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class ToshibaDisc1: public PIRKeysetMetaData { public: ToshibaDisc1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class ToshibaDisc1a: public ToshibaDisc1 { public: ToshibaDisc1a( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class ToshibaDisc1b: public ToshibaDisc1 { public: ToshibaDisc1b( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class ToshibaDisc1c: public ToshibaDisc1a { public: ToshibaDisc1c( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class ToshibaDisc1d: public ToshibaDisc1a { public: ToshibaDisc1d( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; #endif // TOSHIBA_H diff --git a/keysets/vestel.cpp b/keysets/vestel.cpp index f7782f9..7e0b7ef 100644 --- a/keysets/vestel.cpp +++ b/keysets/vestel.cpp @@ -3,13 +3,24 @@ VestelTV1::VestelTV1( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "TV Keyset 1", Vestel_Make, index) { +} + + +void VestelTV1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + threadableProtocol = new RC5Protocol(guiObject, index); addKey("0", Zero_Key, 0x1000, 13); @@ -58,13 +69,24 @@ VestelTV1::VestelTV1( VestelTV2::VestelTV2( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "TV/DVD Keyset 2", Vestel_Make, index) { +} + + +void VestelTV2::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + threadableProtocol = new RC5Protocol(guiObject, index); addKey("on_off", Power_Key, 0x174D, 13); diff --git a/keysets/vestel.h b/keysets/vestel.h index b85c6e6..66896de 100644 --- a/keysets/vestel.h +++ b/keysets/vestel.h @@ -9,16 +9,20 @@ class VestelTV1: public PIRKeysetMetaData { public: VestelTV1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class VestelTV2: public PIRKeysetMetaData { public: VestelTV2( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; #endif // VESTEL_H diff --git a/keysets/virgin.cpp b/keysets/virgin.cpp index 8d5c853..15aa2f5 100644 --- a/keysets/virgin.cpp +++ b/keysets/virgin.cpp @@ -3,13 +3,24 @@ VirginSTB1::VirginSTB1( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "STB Keyset 1", Virgin_Make, index) { +} + + +void VirginSTB1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + threadableProtocol = new RC5Protocol(guiObject, index); addKey("menu", Menu_Key, 0x028F, 13); diff --git a/keysets/virgin.h b/keysets/virgin.h index 1fcb82f..9d0f8d7 100644 --- a/keysets/virgin.h +++ b/keysets/virgin.h @@ -9,8 +9,10 @@ class VirginSTB1: public PIRKeysetMetaData { public: VirginSTB1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; #endif // VIRGIN_H diff --git a/keysets/vizio.cpp b/keysets/vizio.cpp index f219a3b..fa923ac 100644 --- a/keysets/vizio.cpp +++ b/keysets/vizio.cpp @@ -3,13 +3,24 @@ VizioTV1::VizioTV1( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "TV Keyset 1", Vizio_Make, index) { +} + + +void VizioTV1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + threadableProtocol = new NECProtocol(guiObject, index, false, true); setPreData(0x04, 8); diff --git a/keysets/vizio.h b/keysets/vizio.h index 56f6434..a63e27a 100644 --- a/keysets/vizio.h +++ b/keysets/vizio.h @@ -9,8 +9,10 @@ class VizioTV1: public PIRKeysetMetaData { public: VizioTV1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; #endif // VIZIO_H diff --git a/keysets/wd.cpp b/keysets/wd.cpp index 1239d8e..9097b75 100644 --- a/keysets/wd.cpp +++ b/keysets/wd.cpp @@ -2,13 +2,24 @@ #include "protocols/necprotocol.h" WDMediaPlayer1::WDMediaPlayer1( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "Media Player Keyset 1", WD_Make, index) { +} + + +void WDMediaPlayer1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + threadableProtocol = new NECProtocol(guiObject, index, true, true); setPreData(0x7984, 16); @@ -38,11 +49,23 @@ WDMediaPlayer1::WDMediaPlayer1( WDMediaPlayer1a::WDMediaPlayer1a( - QObject *guiObject, unsigned int index) - : WDMediaPlayer1(guiObject, index) + : WDMediaPlayer1(index) { setKeysetName("Media Player Keyset 1a"); +} + + +void WDMediaPlayer1a::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + WDMediaPlayer1::populateProtocol(guiObject); addKey("next page", PageDown_Key, 0x03, 8); addKey("subtitle", Captions_Key, 0x0C, 8); diff --git a/keysets/wd.h b/keysets/wd.h index acd9f96..47c24c2 100644 --- a/keysets/wd.h +++ b/keysets/wd.h @@ -9,16 +9,20 @@ class WDMediaPlayer1: public PIRKeysetMetaData { public: WDMediaPlayer1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class WDMediaPlayer1a: public WDMediaPlayer1 { public: WDMediaPlayer1a( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; #endif // WD_H diff --git a/keysets/westinghouse.cpp b/keysets/westinghouse.cpp index 9a2c02a..d4ac7d6 100644 --- a/keysets/westinghouse.cpp +++ b/keysets/westinghouse.cpp @@ -3,13 +3,24 @@ #include "protocols/sircprotocol.h" WestinghouseTV1::WestinghouseTV1( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "TV Keyset 1", Westinghouse_Make, index) { +} + + +void WestinghouseTV1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + threadableProtocol = new NECProtocol(guiObject, index, false, false); // setPreData(0x807F, 16); @@ -49,7 +60,6 @@ WestinghouseTV1::WestinghouseTV1( WestinghouseTV2::WestinghouseTV2( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "TV Keyset 2", @@ -57,6 +67,17 @@ WestinghouseTV2::WestinghouseTV2( index) { addControlledDevice(Westinghouse_Make, "LVM-42W2", TV_Device); +} + + +void WestinghouseTV2::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } threadableProtocol = new SIRCProtocol(guiObject, index); diff --git a/keysets/westinghouse.h b/keysets/westinghouse.h index e9efa37..7e1b699 100644 --- a/keysets/westinghouse.h +++ b/keysets/westinghouse.h @@ -9,16 +9,20 @@ class WestinghouseTV1: public PIRKeysetMetaData { public: WestinghouseTV1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class WestinghouseTV2: public PIRKeysetMetaData { public: WestinghouseTV2( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; #endif // WESTINGHOUSE_H diff --git a/keysets/yamaha.cpp b/keysets/yamaha.cpp index 8105b67..55e4127 100644 --- a/keysets/yamaha.cpp +++ b/keysets/yamaha.cpp @@ -3,13 +3,24 @@ YamahaDVD1::YamahaDVD1( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "DVD Keyset 1", Yamaha_Make, index) { +} + + +void YamahaDVD1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + threadableProtocol = new NECProtocol(guiObject, index, false, true); // setPreData(0x3EC1, 16); @@ -51,11 +62,23 @@ YamahaDVD1::YamahaDVD1( YamahaDVD1a::YamahaDVD1a( - QObject *guiObject, unsigned int index) - : YamahaDVD1(guiObject, index) + : YamahaDVD1(index) { setKeysetName("DVD/LD Keyset 1a"); +} + + +void YamahaDVD1a::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + YamahaDVD1::populateProtocol(guiObject); addKey("LD_CH_-", ChannelDown_Key, 0x02, 8); addKey("LD_CH_+", ChannelUp_Key, 0x03, 8); @@ -72,13 +95,24 @@ YamahaDVD1a::YamahaDVD1a( YamahaAudio1::YamahaAudio1( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "Audio Device Keyset 1", Yamaha_Make, index) { +} + + +void YamahaAudio1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + threadableProtocol = new NECProtocol(guiObject, index, false, true); // setPreData(0x9E61, 16); @@ -141,11 +175,23 @@ YamahaAudio1::YamahaAudio1( YamahaAudio1a::YamahaAudio1a( - QObject *guiObject, unsigned int index) - : YamahaAudio1(guiObject, index) + : YamahaAudio1(index) { setKeysetName("Audio Keyset 1a"); +} + + +void YamahaAudio1a::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + YamahaAudio1::populateProtocol(guiObject); addKey("PAUSE/STOP", Stop_Key, 0x03, 8); addKey("PAUSE/STOP", Pause_Key, 0x03, 8); @@ -153,7 +199,6 @@ YamahaAudio1a::YamahaAudio1a( YamahaAudio2::YamahaAudio2( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "Audio Keyset 2", @@ -163,6 +208,17 @@ YamahaAudio2::YamahaAudio2( addControlledDevice(Yamaha_Make, "RX-395-RDS", Audio_Device); addControlledDevice(Yamaha_Make, "AX-570", Audio_Device); addControlledDevice(Yamaha_Make, "CDX-570", Audio_Device); +} + + +void YamahaAudio2::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } threadableProtocol = new NECProtocol(guiObject, index, false, true); @@ -246,11 +302,23 @@ YamahaAudio2::YamahaAudio2( YamahaAudio2a::YamahaAudio2a( - QObject *guiObject, unsigned int index) - : YamahaAudio2(guiObject, index) + : YamahaAudio2(index) { setKeysetName("Audio Keyset 2a"); +} + + +void YamahaAudio2a::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + YamahaAudio2::populateProtocol(guiObject); addKey("Dolby/DTS", Unmapped_Key, 0x90, 8); addKey("6.1/5.1", Unmapped_Key, 0x97, 8); @@ -260,22 +328,46 @@ YamahaAudio2a::YamahaAudio2a( YamahaAudio2b::YamahaAudio2b( - QObject *guiObject, unsigned int index) - : YamahaAudio2(guiObject, index) + : YamahaAudio2(index) { setKeysetName("Audio Keyset 2b"); +} + + +void YamahaAudio2b::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + YamahaAudio2::populateProtocol(guiObject); addKey("SOURCE_DIRECT", Unmapped_Key, 0x56, 8); } YamahaAudio2c::YamahaAudio2c( - QObject *guiObject, unsigned int index) - : YamahaAudio2(guiObject, index) + : YamahaAudio2(index) { setKeysetName("Audio Keyset 2c"); +} + + +void YamahaAudio2c::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + YamahaAudio2::populateProtocol(guiObject); addKey("parameterv", Unmapped_Key, 0xC4, 8); addKey("parameter^", Unmapped_Key, 0xC5, 8); @@ -299,11 +391,23 @@ YamahaAudio2c::YamahaAudio2c( YamahaAudio2d::YamahaAudio2d( - QObject *guiObject, unsigned int index) - : YamahaAudio2(guiObject, index) + : YamahaAudio2(index) { setKeysetName("Audio Keyset 2d"); +} + + +void YamahaAudio2d::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + + YamahaAudio2::populateProtocol(guiObject); addKey("LOUDNESS_+", Unmapped_Key, 0x1D, 8); addKey("LOUDNESS_-", Unmapped_Key, 0x1E, 8); @@ -311,13 +415,24 @@ YamahaAudio2d::YamahaAudio2d( YamahaAudio3::YamahaAudio3( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "Audio Keyset 3", Yamaha_Make, index) { +} + + +void YamahaAudio3::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + threadableProtocol = new NECProtocol(guiObject, index, false, true); // setPreData(0xFE01, 16); @@ -359,7 +474,6 @@ YamahaAudio3::YamahaAudio3( YamahaAudio4::YamahaAudio4( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "Audio Keyset 4", @@ -367,6 +481,17 @@ YamahaAudio4::YamahaAudio4( index) { addControlledDevice(Yamaha_Make, "GX-50", Audio_Device); +} + + +void YamahaAudio4::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } threadableProtocol = new NECProtocol(guiObject, index, false, true); @@ -422,13 +547,24 @@ YamahaAudio4::YamahaAudio4( YamahaTV1::YamahaTV1( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "TV Keyset 1", Yamaha_Make, index) { +} + + +void YamahaTV1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + threadableProtocol = new NECProtocol(guiObject, index, false, true); // setPreData(0x20DF, 16); @@ -454,13 +590,24 @@ YamahaTV1::YamahaTV1( YamahaKaraoke1::YamahaKaraoke1( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "Karaoke Keyset 1", Yamaha_Make, index) { +} + + +void YamahaKaraoke1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } + threadableProtocol = new NECProtocol(guiObject, index, false, true); // setPreData(0xDE21, 16); diff --git a/keysets/yamaha.h b/keysets/yamaha.h index 8501bd2..5881259 100644 --- a/keysets/yamaha.h +++ b/keysets/yamaha.h @@ -9,104 +9,130 @@ class YamahaDVD1: public PIRKeysetMetaData { public: YamahaDVD1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class YamahaDVD1a: public YamahaDVD1 { public: YamahaDVD1a( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class YamahaAudio1: public PIRKeysetMetaData { public: YamahaAudio1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class YamahaAudio1a: public YamahaAudio1 { public: YamahaAudio1a( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class YamahaAudio2: public PIRKeysetMetaData { public: YamahaAudio2( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class YamahaAudio2a: public YamahaAudio2 { public: YamahaAudio2a( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class YamahaAudio2b: public YamahaAudio2 { public: YamahaAudio2b( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class YamahaAudio2c: public YamahaAudio2 { public: YamahaAudio2c( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class YamahaAudio2d: public YamahaAudio2 { public: YamahaAudio2d( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class YamahaAudio3: public PIRKeysetMetaData { public: YamahaAudio3( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class YamahaAudio4: public PIRKeysetMetaData { public: YamahaAudio4( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class YamahaTV1: public PIRKeysetMetaData { public: YamahaTV1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; class YamahaKaraoke1: public PIRKeysetMetaData { public: YamahaKaraoke1( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; #endif // YAMAHA_H diff --git a/keysets/zenith.cpp b/keysets/zenith.cpp index 9f744f0..537e9dd 100644 --- a/keysets/zenith.cpp +++ b/keysets/zenith.cpp @@ -3,7 +3,6 @@ // Based solely on LIRC Zenith_C32V37 config file ZenithC32V37::ZenithC32V37( - QObject *guiObject, unsigned int index) : PIRKeysetMetaData( "TV Keyset 1", @@ -11,6 +10,17 @@ ZenithC32V37::ZenithC32V37( index) { addControlledDevice(Zenith_Make, "C32V37", TV_Device); +} + + +void ZenithC32V37::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // If the pointer is not null, the keyset must already be populated. + return; + } threadableProtocol = new NECProtocol(guiObject, index, false, true); diff --git a/keysets/zenith.h b/keysets/zenith.h index e42bf68..491c0e5 100644 --- a/keysets/zenith.h +++ b/keysets/zenith.h @@ -9,8 +9,10 @@ class ZenithC32V37: public PIRKeysetMetaData { public: ZenithC32V37( - QObject *guiObject, unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; #endif // ZENITH_H diff --git a/mainwindow.cpp b/mainwindow.cpp index 27f13d7..fb07829 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -45,7 +45,7 @@ MainWindow::MainWindow(QWidget *parent) setAttribute(Qt::WA_Maemo5StackedWindow); // Collect the keysets: - myKeysets = new PIRKeysetManager(this); + myKeysets = new PIRKeysetManager(); // Set up the keyset selection window: selectKeysetForm = new PIRSelectKeysetForm(this); @@ -69,7 +69,6 @@ MainWindow::MainWindow(QWidget *parent) } enableButtons(); - secondaryForm->enableButtons(myKeysets, currentKeyset); connect( ui->favoriteKeysetsWidget, @@ -179,6 +178,9 @@ void MainWindow::showExpanded() void MainWindow::enableButtons() { + // Just to be sure, check to see if the keyset has been populated: + myKeysets->populateKeyset(this, currentKeyset); + // This is going to be a little painful... // Main keys emit powerEnabled(myKeysets->hasKey(currentKeyset, Power_Key)); @@ -250,6 +252,9 @@ void MainWindow::enableButtons() emit pauseEnabled(myKeysets->hasKey(currentKeyset, Pause_Key)); emit stopEnabled(myKeysets->hasKey(currentKeyset, Stop_Key)); emit ejectEnabled(myKeysets->hasKey(currentKeyset, Eject_Key)); + + // Also enable the buttons on the secondary form: + secondaryForm->enableButtons(myKeysets, currentKeyset); } @@ -883,7 +888,7 @@ void MainWindow::on_actionDocumentation_triggered() void MainWindow::keysetSelectionChanged( QListWidgetItem *item) { - if (!item) return; // Should probably say something here! + if (!item) return; // Should probably display error message here! PIRKeysetWidgetItem *kwi = dynamic_cast(item); @@ -903,7 +908,6 @@ void MainWindow::keysetSelectionChanged( myKeysets->getDisplayName(currentKeyset)); enableButtons(); - secondaryForm->enableButtons(myKeysets, currentKeyset); } diff --git a/pierogi.pro b/pierogi.pro index 0b5d5a8..fc7a7d8 100644 --- a/pierogi.pro +++ b/pierogi.pro @@ -120,7 +120,10 @@ SOURCES += main.cpp mainwindow.cpp \ keysets/onida.cpp \ keysets/vestel.cpp \ keysets/virgin.cpp \ - keysets/vizio.cpp + keysets/vizio.cpp \ + keysets/hp.cpp \ + keysets/motorola.cpp \ + protocols/giprotocol.cpp HEADERS += mainwindow.h \ pirkeynames.h \ pirmakenames.h \ @@ -215,7 +218,10 @@ HEADERS += mainwindow.h \ keysets/onida.h \ keysets/vestel.h \ keysets/virgin.h \ - keysets/vizio.h + keysets/vizio.h \ + keysets/hp.h \ + keysets/motorola.h \ + protocols/giprotocol.h FORMS += mainwindow.ui \ pirdocumentationform.ui \ piraboutform.ui \ diff --git a/pierogi.pro.user b/pierogi.pro.user index 6dfd63d..c3b5939 100644 --- a/pierogi.pro.user +++ b/pierogi.pro.user @@ -1,6 +1,6 @@ - + ProjectExplorer.Project.ActiveTarget @@ -78,8 +78,8 @@ dpkg-buildpackage -sa -S -uc -us /Users/john/QtSDK/Maemo/4.6.2/bin/mad - true - /Users/john/Develop/n900/pierogi-0.6.6 + false + /Users/john/Develop/n900/pierogi-0.6.7 Custom Process Step ProjectExplorer.ProcessStep @@ -186,6 +186,7 @@ /Users/john/Develop/n900/pierogi-build-maemo-Qt_for_Fremantle_PR1_3_Devices__Qt_SDK__Release/pierogi_0_5_1_armel.deb /Users/john/Develop/n900/pierogi-build-maemo-Qt_for_Fremantle_PR1_3_Devices__Qt_SDK__Release/pierogi_0_6_1_armel.deb /Users/john/Develop/n900/pierogi-build-maemo-Qt_for_Fremantle_PR1_3_Devices__Qt_SDK__Release/pierogi_0_5_3_armel.deb + /Users/john/Develop/n900/pierogi-build-maemo-Qt_for_Fremantle_PR1_3_Devices__Qt_SDK__Release/pierogi_0_6_7_armel.deb /Users/john/Develop/n900/pierogi-build-maemo-Qt_for_Fremantle_PR1_3_Devices__Qt_SDK__Release/pierogi_0_6_3_armel.deb /Users/john/Develop/n900/pierogi-build-maemo-Qt_for_Fremantle_PR1_3_Devices__Qt_SDK__Release/pierogi_0_6_5_armel.deb /Users/john/Develop/n900/pierogi-build-maemo-Qt_for_Fremantle_PR1_3_Devices__Qt_SDK__Release/pierogi_0_1_1_armel.deb @@ -216,6 +217,7 @@ 192.168.0.15 192.168.0.15 192.168.0.15 + 192.168.0.15 localhost 192.168.0.15 192.168.0.15 @@ -249,12 +251,14 @@ + 2012-01-19T22:18:07 2012-02-06T17:22:16 2012-02-12T23:10:44 2012-02-09T18:12:21 + 2012-02-19T10:29:22 2012-02-14T21:02:03 2012-02-16T21:50:07 2012-01-17T00:15:23 diff --git a/pirkeysetmanager.cpp b/pirkeysetmanager.cpp index 57b9894..48b0899 100644 --- a/pirkeysetmanager.cpp +++ b/pirkeysetmanager.cpp @@ -26,6 +26,7 @@ #include "keysets/hauppauge.h" #include "keysets/hitachi.h" #include "keysets/homecast.h" +#include "keysets/hp.h" #include "keysets/huawei.h" #include "keysets/jvc.h" #include "keysets/kenwood.h" @@ -34,6 +35,7 @@ #include "keysets/magnavox.h" #include "keysets/mce.h" #include "keysets/mitsubishi.h" +#include "keysets/motorola.h" #include "keysets/nokia.h" #include "keysets/onida.h" #include "keysets/panasonic.h" @@ -77,434 +79,439 @@ PIRDeviceTypeMgr deviceManager; // Now, on to the actual method definitions: -PIRKeysetManager::PIRKeysetManager( - QObject *guiObject) +PIRKeysetManager::PIRKeysetManager() : 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 BoseHomeTheater1(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 DenonReceiver1(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 DenonAudio1(guiObject, counter++)); - populateKeyset(new DenonAudio1a(guiObject, counter++)); - populateKeyset(new DenonAudio1b(guiObject, counter++)); - populateKeyset(new DenonAudio1c(guiObject, counter++)); - populateKeyset(new DenonAudio1d(guiObject, counter++)); - populateKeyset(new DenonAudio2(guiObject, counter++)); - populateKeyset(new DenonAudio3(guiObject, counter++)); - populateKeyset(new DenonAudio4(guiObject, counter++)); - - populateKeyset(new DigitalStreamReceiver(guiObject, counter++)); - - populateKeyset(new DirectvReceiver1(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 GoldStarVCR1a(guiObject, counter++)); - populateKeyset(new GoldStarVCR1b(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 HuaweiSTB1(guiObject, counter++)); - populateKeyset(new HuaweiSTB2(guiObject, counter++)); - - populateKeyset(new JVCSat1(guiObject, counter++)); - populateKeyset(new JVCSat2(guiObject, counter++)); - populateKeyset(new JVCVCR1(guiObject, counter++)); - populateKeyset(new JVCVCR1a(guiObject, counter++)); - populateKeyset(new JVCVCRBmode1(guiObject, counter++)); - populateKeyset(new JVCVCRBmode1a(guiObject, counter++)); - populateKeyset(new JVCTV1(guiObject, counter++)); - populateKeyset(new JVCTV1a(guiObject, counter++)); - populateKeyset(new JVCTV1b(guiObject, counter++)); - populateKeyset(new JVCTV1c(guiObject, counter++)); - populateKeyset(new JVCTV1d(guiObject, counter++)); - populateKeyset(new JVCDAT1(guiObject, counter++)); - populateKeyset(new JVCCarDeck1(guiObject, counter++)); - populateKeyset(new JVCAudio1(guiObject, counter++)); - populateKeyset(new JVCAudio1a(guiObject, counter++)); - populateKeyset(new JVCAudio1b(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 LGTV1c(guiObject, counter++)); - populateKeyset(new LGTV2(guiObject, counter++)); - populateKeyset(new LGTV2a(guiObject, counter++)); - populateKeyset(new LGTV2b(guiObject, counter++)); - populateKeyset(new LGDisc1(guiObject, counter++)); - populateKeyset(new LGDisc2(guiObject, counter++)); - populateKeyset(new LGDisc2a(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 MitsubishiVCR1a(guiObject, counter++)); - - populateKeyset(new NokiaGenericVCR(guiObject, counter++)); - - populateKeyset(new OnidaTV1(guiObject, counter++)); - populateKeyset(new OnidaDVD1(guiObject, counter++)); - - populateKeyset(new PanasonicCarAudio(guiObject, counter++)); - populateKeyset(new PanasonicSat1(guiObject, counter++)); - populateKeyset(new PanasonicSat1a(guiObject, counter++)); - populateKeyset(new PanasonicTV1(guiObject, counter++)); - populateKeyset(new PanasonicTV1a(guiObject, counter++)); - populateKeyset(new PanasonicTV1b(guiObject, counter++)); - populateKeyset(new PanasonicVCR1(guiObject, counter++)); - populateKeyset(new PanasonicVCR1a(guiObject, counter++)); - populateKeyset(new PanasonicVCR1b(guiObject, counter++)); - populateKeyset(new PanasonicVCR1c(guiObject, counter++)); - populateKeyset(new PanasonicDVD1(guiObject, counter++)); - populateKeyset(new PanasonicDVD1a(guiObject, counter++)); - populateKeyset(new PanasonicAudio1(guiObject, counter++)); - populateKeyset(new PanasonicAC1(guiObject, counter++)); - - populateKeyset(new PhilcoTV(guiObject, counter++)); - - populateKeyset(new PhilipsTV1(guiObject, counter++)); - populateKeyset(new PhilipsTV1a(guiObject, counter++)); - populateKeyset(new PhilipsTV1b(guiObject, counter++)); - populateKeyset(new PhilipsTV1c(guiObject, counter++)); - populateKeyset(new PhilipsTV1d(guiObject, counter++)); - populateKeyset(new PhilipsTV1e(guiObject, counter++)); - populateKeyset(new PhilipsTV1f(guiObject, counter++)); - populateKeyset(new PhilipsTV2(guiObject, counter++)); - populateKeyset(new PhilipsTV2a(guiObject, counter++)); - populateKeyset(new PhilipsTV2b(guiObject, counter++)); - populateKeyset(new PhilipsTV3(guiObject, counter++)); - populateKeyset(new PhilipsDVD1(guiObject, counter++)); - populateKeyset(new PhilipsDVD1a(guiObject, counter++)); - populateKeyset(new PhilipsDVD1b(guiObject, counter++)); - populateKeyset(new PhilipsDVD1c(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 PhilipsVCR1b(guiObject, counter++)); - populateKeyset(new PhilipsVCR1c(guiObject, counter++)); - populateKeyset(new PhilipsSat1(guiObject, counter++)); - populateKeyset(new PhilipsSat2(guiObject, counter++)); - populateKeyset(new PhilipsSat2a(guiObject, counter++)); - populateKeyset(new PhilipsSat3(guiObject, counter++)); - populateKeyset(new PhilipsAudio1(guiObject, counter++)); - populateKeyset(new PhilipsAudio1a(guiObject, counter++)); - populateKeyset(new PhilipsAudio1b(guiObject, counter++)); - populateKeyset(new PhilipsAudio2(guiObject, counter++)); - populateKeyset(new PhilipsAudio3(guiObject, counter++)); - populateKeyset(new PhilipsAudio4(guiObject, counter++)); - - populateKeyset(new PinnaclePCTV1(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 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 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 SamsungTV1(guiObject, counter++)); - populateKeyset(new SamsungTV1a(guiObject, counter++)); - populateKeyset(new SamsungTV1b(guiObject, counter++)); - populateKeyset(new SamsungTV1c(guiObject, counter++)); - populateKeyset(new SamsungTV1d(guiObject, counter++)); - populateKeyset(new SamsungTV1e(guiObject, counter++)); - populateKeyset(new SamsungTV1f(guiObject, counter++)); - populateKeyset(new SamsungTV2(guiObject, counter++)); - populateKeyset(new SamsungTV2a(guiObject, counter++)); - populateKeyset(new SamsungVCR1(guiObject, counter++)); - populateKeyset(new SamsungVCR1a(guiObject, counter++)); - populateKeyset(new SamsungVCR1b(guiObject, counter++)); - populateKeyset(new SamsungVCR1c(guiObject, counter++)); - populateKeyset(new SamsungVCR1d(guiObject, counter++)); - populateKeyset(new SamsungVCR1e(guiObject, counter++)); - populateKeyset(new SamsungDVD1(guiObject, counter++)); - populateKeyset(new SamsungDVD1a(guiObject, counter++)); - populateKeyset(new SamsungDVD1b(guiObject, counter++)); - populateKeyset(new SamsungDVD2(guiObject, counter++)); - populateKeyset(new SamsungAC1(guiObject, counter++)); - populateKeyset(new SamsungDVBT1(guiObject, counter++)); - - populateKeyset(new SanyoVCR1(guiObject, counter++)); - populateKeyset(new SanyoDVD1(guiObject, counter++)); - populateKeyset(new SanyoTV1(guiObject, counter++)); - populateKeyset(new SanyoTV1a(guiObject, counter++)); - populateKeyset(new SanyoTV1b(guiObject, counter++)); - populateKeyset(new SanyoTV1c(guiObject, counter++)); - populateKeyset(new SanyoTV1d(guiObject, counter++)); - populateKeyset(new SanyoProjector(guiObject, counter++)); - - populateKeyset(new SharpTV1(guiObject, counter++)); - populateKeyset(new SharpTV1a(guiObject, counter++)); - populateKeyset(new SharpTV1b(guiObject, counter++)); - populateKeyset(new SharpTV1c(guiObject, counter++)); - populateKeyset(new SharpTV1d(guiObject, counter++)); - populateKeyset(new SharpTV1e(guiObject, counter++)); - populateKeyset(new SharpVCR1(guiObject, counter++)); - populateKeyset(new SharpReceiver1(guiObject, counter++)); - populateKeyset(new SharpAC1(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 SonyTV1c(guiObject, counter++)); - populateKeyset(new SonyAmp1(guiObject, counter++)); - populateKeyset(new SonyAmp2(guiObject, counter++)); - populateKeyset(new SonyAudio1(guiObject, counter++)); - populateKeyset(new SonyAudio1a(guiObject, counter++)); - populateKeyset(new SonyDAT1(guiObject, counter++)); - populateKeyset(new SonyDVD1(guiObject, counter++)); - populateKeyset(new SonyDVD1a(guiObject, counter++)); - populateKeyset(new SonyDVD1b(guiObject, counter++)); - populateKeyset(new SonyDVD1c(guiObject, counter++)); - populateKeyset(new SonyVCR1(guiObject, counter++)); - populateKeyset(new SonyVCR1a(guiObject, counter++)); - populateKeyset(new SonyVCR1b(guiObject, counter++)); - populateKeyset(new SonyReceiver1(guiObject, counter++)); - - populateKeyset(new Tivo1(guiObject, counter++)); - populateKeyset(new Tivo1a(guiObject, counter++)); - populateKeyset(new Tivo1b(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 ToshibaTV1c(guiObject, counter++)); - populateKeyset(new ToshibaTV1d(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 ToshibaDisc1a(guiObject, counter++)); - populateKeyset(new ToshibaDisc1b(guiObject, counter++)); - populateKeyset(new ToshibaDisc1c(guiObject, counter++)); - populateKeyset(new ToshibaDisc1d(guiObject, counter++)); - - populateKeyset(new VestelTV1(guiObject, counter++)); - populateKeyset(new VestelTV2(guiObject, counter++)); - - populateKeyset(new VirginSTB1(guiObject, counter++)); - - populateKeyset(new VizioTV1(guiObject, counter++)); - - populateKeyset(new WDMediaPlayer1(guiObject, counter++)); - populateKeyset(new WDMediaPlayer1a(guiObject, counter++)); - - populateKeyset(new WestinghouseTV1(guiObject, counter++)); - populateKeyset(new WestinghouseTV2(guiObject, counter++)); - - populateKeyset(new YamahaDVD1(guiObject, counter++)); - populateKeyset(new YamahaDVD1a(guiObject, counter++)); - populateKeyset(new YamahaAudio1(guiObject, counter++)); - populateKeyset(new YamahaAudio1a(guiObject, counter++)); - populateKeyset(new YamahaAudio2(guiObject, counter++)); - populateKeyset(new YamahaAudio2a(guiObject, counter++)); - populateKeyset(new YamahaAudio2b(guiObject, counter++)); - populateKeyset(new YamahaAudio2c(guiObject, counter++)); - populateKeyset(new YamahaAudio2d(guiObject, counter++)); - populateKeyset(new YamahaAudio3(guiObject, counter++)); - populateKeyset(new YamahaAudio4(guiObject, counter++)); - populateKeyset(new YamahaTV1(guiObject, counter++)); - populateKeyset(new YamahaKaraoke1(guiObject, counter++)); - - populateKeyset(new ZenithC32V37(guiObject, counter++)); + setupKeyset(new AcerTV1(counter++)); + setupKeyset(new AcerPC1(counter++)); + + setupKeyset(new AdmiralTV1(counter++)); + setupKeyset(new AdmiralTV2(counter++)); + setupKeyset(new AdmiralVCR1(counter++)); + + setupKeyset(new AiwaVCR1(counter++)); + setupKeyset(new AiwaVCR2(counter++)); + setupKeyset(new AiwaVCR3(counter++)); + setupKeyset(new AiwaAudio1(counter++)); + setupKeyset(new AiwaAudio1a(counter++)); + setupKeyset(new AiwaAudio2(counter++)); + setupKeyset(new AiwaAudio2a(counter++)); + setupKeyset(new AiwaAudio2b(counter++)); + setupKeyset(new AiwaAudio2c(counter++)); + setupKeyset(new AiwaAudio3(counter++)); + setupKeyset(new AiwaAudio4(counter++)); + setupKeyset(new AiwaAudio5(counter++)); + setupKeyset(new AiwaAudio6(counter++)); + setupKeyset(new AiwaCarStereo1(counter++)); + setupKeyset(new AiwaDVD1(counter++)); + + setupKeyset(new AppleWhiteRemote(counter++)); + + setupKeyset(new BekoTV1(counter++)); + + setupKeyset(new BoseRadio1(counter++)); + setupKeyset(new BoseRadio2(counter++)); + setupKeyset(new BoseRadio3(counter++)); + setupKeyset(new BoseHomeTheater1(counter++)); + + setupKeyset(new CambridgeCD1(counter++)); + setupKeyset(new CambridgeAudio1(counter++)); + setupKeyset(new CambridgeAudio2(counter++)); + setupKeyset(new CambridgeAudio3(counter++)); + setupKeyset(new CambridgeDVD1(counter++)); + + setupKeyset(new DaewooTV1(counter++)); + setupKeyset(new DaewooTV2(counter++)); + setupKeyset(new DaewooTV3(counter++)); + setupKeyset(new DaewooTV4(counter++)); + setupKeyset(new DaewooDVD1(counter++)); + setupKeyset(new DaewooVCR1(counter++)); + setupKeyset(new DaewooVCR2(counter++)); + + setupKeyset(new DenonDVD1(counter++)); + setupKeyset(new DenonDVD2(counter++)); + setupKeyset(new DenonDVD3(counter++)); + setupKeyset(new DenonReceiver1(counter++)); + setupKeyset(new DenonReceiver1a(counter++)); + setupKeyset(new DenonReceiver1b(counter++)); + setupKeyset(new DenonReceiver1c(counter++)); + setupKeyset(new DenonReceiver1d(counter++)); + setupKeyset(new DenonReceiver1e(counter++)); + setupKeyset(new DenonReceiver1f(counter++)); + setupKeyset(new DenonReceiver2(counter++)); + setupKeyset(new DenonReceiver2a(counter++)); + setupKeyset(new DenonReceiver3(counter++)); + setupKeyset(new DenonAudio1(counter++)); + setupKeyset(new DenonAudio1a(counter++)); + setupKeyset(new DenonAudio1b(counter++)); + setupKeyset(new DenonAudio1c(counter++)); + setupKeyset(new DenonAudio1d(counter++)); + setupKeyset(new DenonAudio2(counter++)); + setupKeyset(new DenonAudio3(counter++)); + setupKeyset(new DenonAudio4(counter++)); + + setupKeyset(new DigitalStreamReceiver(counter++)); + + setupKeyset(new DirectvReceiver1(counter++)); + + setupKeyset(new DishReceiver1(counter++)); + setupKeyset(new DishReceiver1a(counter++)); + setupKeyset(new DishReceiver1b(counter++)); + setupKeyset(new DishReceiver1c(counter++)); + setupKeyset(new DishReceiver1d(counter++)); + setupKeyset(new DishReceiver1e(counter++)); + setupKeyset(new DishReceiver1f(counter++)); + setupKeyset(new DishReceiver1g(counter++)); + setupKeyset(new DishReceiver1h(counter++)); + setupKeyset(new DishReceiver1i(counter++)); + setupKeyset(new DishReceiver1j(counter++)); + setupKeyset(new DishReceiver1k(counter++)); + setupKeyset(new DishReceiver1l(counter++)); + setupKeyset(new DishReceiver1m(counter++)); + setupKeyset(new DishReceiver1n(counter++)); + setupKeyset(new DishReceiver1o(counter++)); + + setupKeyset(new EiTV1(counter++)); + + setupKeyset(new ElgatoEyeTV1(counter++)); + + setupKeyset(new EmersonTV1(counter++)); + setupKeyset(new EmersonDVD1(counter++)); + + setupKeyset(new FortecReceiver1(counter++)); + setupKeyset(new FortecReceiver2(counter++)); + + setupKeyset(new GoldStarTV1(counter++)); + setupKeyset(new GoldStarTV2(counter++)); + setupKeyset(new GoldStarVCR1(counter++)); + setupKeyset(new GoldStarVCR1a(counter++)); + setupKeyset(new GoldStarVCR1b(counter++)); + setupKeyset(new GoldStarVCR1c(counter++)); + setupKeyset(new GoldStarCD1(counter++)); + + setupKeyset(new GrundigSat1(counter++)); + setupKeyset(new GrundigSat2(counter++)); + setupKeyset(new GrundigAmp1(counter++)); + setupKeyset(new GrundigAudio1(counter++)); + setupKeyset(new GrundigAudio2(counter++)); + setupKeyset(new GrundigVCR1(counter++)); + setupKeyset(new GrundigVCR1a(counter++)); + setupKeyset(new GrundigTV1(counter++)); + setupKeyset(new GrundigTV2(counter++)); + setupKeyset(new GrundigTV3(counter++)); + setupKeyset(new GrundigDVD1(counter++)); + + setupKeyset(new HaierTV1(counter++)); + + setupKeyset(new HauppaugePCTV1(counter++)); + setupKeyset(new HauppaugePCTV1a(counter++)); + setupKeyset(new HauppaugePCTV1b(counter++)); + setupKeyset(new HauppaugePCTV1c(counter++)); + setupKeyset(new HauppaugePCTV2(counter++)); + + setupKeyset(new HitachiTV1(counter++)); + setupKeyset(new HitachiTV1a(counter++)); + setupKeyset(new HitachiTV1b(counter++)); + setupKeyset(new HitachiTV1c(counter++)); + setupKeyset(new HitachiTV2(counter++)); + setupKeyset(new HitachiTV3(counter++)); + setupKeyset(new HitachiProjector(counter++)); + setupKeyset(new HitachiDVD1(counter++)); + setupKeyset(new HitachiAudio1(counter++)); + setupKeyset(new HitachiVCR1(counter++)); + + setupKeyset(new HomecastReceiver1(counter++)); + setupKeyset(new HomecastReceiver2(counter++)); + + setupKeyset(new HPRemote1(counter++)); + + setupKeyset(new HuaweiSTB1(counter++)); + setupKeyset(new HuaweiSTB2(counter++)); + + setupKeyset(new JVCSat1(counter++)); + setupKeyset(new JVCSat2(counter++)); + setupKeyset(new JVCVCR1(counter++)); + setupKeyset(new JVCVCR1a(counter++)); + setupKeyset(new JVCVCRBmode1(counter++)); + setupKeyset(new JVCVCRBmode1a(counter++)); + setupKeyset(new JVCTV1(counter++)); + setupKeyset(new JVCTV1a(counter++)); + setupKeyset(new JVCTV1b(counter++)); + setupKeyset(new JVCTV1c(counter++)); + setupKeyset(new JVCTV1d(counter++)); + setupKeyset(new JVCDAT1(counter++)); + setupKeyset(new JVCCarDeck1(counter++)); + setupKeyset(new JVCAudio1(counter++)); + setupKeyset(new JVCAudio1a(counter++)); + setupKeyset(new JVCAudio1b(counter++)); + setupKeyset(new JVCAudio2(counter++)); + setupKeyset(new JVCDVD1(counter++)); + + setupKeyset(new KenwoodAudio1(counter++)); + setupKeyset(new KenwoodComponent1(counter++)); + setupKeyset(new KenwoodComponent2(counter++)); + setupKeyset(new KenwoodComponent3(counter++)); + setupKeyset(new KenwoodCD1(counter++)); + setupKeyset(new KenwoodDVD1(counter++)); + setupKeyset(new KenwoodTV1(counter++)); + + setupKeyset(new LGTV1(counter++)); + setupKeyset(new LGTV1a(counter++)); + setupKeyset(new LGTV1b(counter++)); + setupKeyset(new LGTV1c(counter++)); + setupKeyset(new LGTV2(counter++)); + setupKeyset(new LGTV2a(counter++)); + setupKeyset(new LGTV2b(counter++)); + setupKeyset(new LGDisc1(counter++)); + setupKeyset(new LGDisc2(counter++)); + setupKeyset(new LGDisc2a(counter++)); + setupKeyset(new LGVCR1(counter++)); + setupKeyset(new LGVCR1a(counter++)); + setupKeyset(new LGVCR1b(counter++)); + setupKeyset(new LGAC1(counter++)); + + setupKeyset(new LogitechSpeakers(counter++)); + + setupKeyset(new MagnavoxDVD1(counter++)); + setupKeyset(new MagnavoxVCR1(counter++)); + setupKeyset(new MagnavoxConverterBox1(counter++)); + setupKeyset(new MagnavoxTV1(counter++)); + + setupKeyset(new MCERemote1(counter++)); + setupKeyset(new MCERemote1a(counter++)); + setupKeyset(new MCERemote1b(counter++)); + setupKeyset(new MCERemote1c(counter++)); + setupKeyset(new MCERemote1d(counter++)); + setupKeyset(new MCERemote1e(counter++)); + setupKeyset(new MCERemote1f(counter++)); + setupKeyset(new MCERemote1g(counter++)); + + setupKeyset(new MitsubishiTV1(counter++)); + setupKeyset(new MitsubishiTV1a(counter++)); + setupKeyset(new MitsubishiVCR1(counter++)); + setupKeyset(new MitsubishiVCR1a(counter++)); + + setupKeyset(new Motorola4DTV(counter++)); + setupKeyset(new MotorolaSTB1(counter++)); + setupKeyset(new MotorolaSTB1a(counter++)); + setupKeyset(new MotorolaSTB1b(counter++)); + setupKeyset(new MotorolaSkyDigital(counter++)); + + setupKeyset(new NokiaGenericVCR(counter++)); + + setupKeyset(new OnidaTV1(counter++)); + setupKeyset(new OnidaDVD1(counter++)); + + setupKeyset(new PanasonicCarAudio(counter++)); + setupKeyset(new PanasonicSat1(counter++)); + setupKeyset(new PanasonicSat1a(counter++)); + setupKeyset(new PanasonicTV1(counter++)); + setupKeyset(new PanasonicTV1a(counter++)); + setupKeyset(new PanasonicTV1b(counter++)); + setupKeyset(new PanasonicVCR1(counter++)); + setupKeyset(new PanasonicVCR1a(counter++)); + setupKeyset(new PanasonicVCR1b(counter++)); + setupKeyset(new PanasonicVCR1c(counter++)); + setupKeyset(new PanasonicDVD1(counter++)); + setupKeyset(new PanasonicDVD1a(counter++)); + setupKeyset(new PanasonicAudio1(counter++)); + setupKeyset(new PanasonicAC1(counter++)); + + setupKeyset(new PhilcoTV(counter++)); + + setupKeyset(new PhilipsTV1(counter++)); + setupKeyset(new PhilipsTV1a(counter++)); + setupKeyset(new PhilipsTV1b(counter++)); + setupKeyset(new PhilipsTV1c(counter++)); + setupKeyset(new PhilipsTV1d(counter++)); + setupKeyset(new PhilipsTV1e(counter++)); + setupKeyset(new PhilipsTV1f(counter++)); + setupKeyset(new PhilipsTV2(counter++)); + setupKeyset(new PhilipsTV2a(counter++)); + setupKeyset(new PhilipsTV2b(counter++)); + setupKeyset(new PhilipsTV3(counter++)); + setupKeyset(new PhilipsDVD1(counter++)); + setupKeyset(new PhilipsDVD1a(counter++)); + setupKeyset(new PhilipsDVD1b(counter++)); + setupKeyset(new PhilipsDVD1c(counter++)); + setupKeyset(new PhilipsDVD1d(counter++)); + setupKeyset(new PhilipsDVD2(counter++)); + setupKeyset(new PhilipsDVD3(counter++)); + setupKeyset(new PhilipsDVD3a(counter++)); + setupKeyset(new PhilipsDVD4(counter++)); + setupKeyset(new PhilipsVCR1(counter++)); + setupKeyset(new PhilipsVCR1a(counter++)); + setupKeyset(new PhilipsVCR1b(counter++)); + setupKeyset(new PhilipsVCR1c(counter++)); + setupKeyset(new PhilipsSat1(counter++)); + setupKeyset(new PhilipsSat2(counter++)); + setupKeyset(new PhilipsSat2a(counter++)); + setupKeyset(new PhilipsSat3(counter++)); + setupKeyset(new PhilipsAudio1(counter++)); + setupKeyset(new PhilipsAudio1a(counter++)); + setupKeyset(new PhilipsAudio1b(counter++)); + setupKeyset(new PhilipsAudio2(counter++)); + setupKeyset(new PhilipsAudio3(counter++)); + setupKeyset(new PhilipsAudio4(counter++)); + + setupKeyset(new PinnaclePCTV1(counter++)); + setupKeyset(new PinnaclePCTV2(counter++)); + setupKeyset(new PinnaclePCTV3(counter++)); + + setupKeyset(new PioneerTV1(counter++)); + setupKeyset(new PioneerTV2(counter++)); + setupKeyset(new PioneerTV3(counter++)); + setupKeyset(new PioneerAudio1(counter++)); + setupKeyset(new PioneerAudio1a(counter++)); + setupKeyset(new PioneerAudio2(counter++)); + setupKeyset(new PioneerAudio3(counter++)); + setupKeyset(new PioneerAudio4(counter++)); + setupKeyset(new PioneerAudio5(counter++)); + setupKeyset(new PioneerCD1(counter++)); + setupKeyset(new PioneerLaserDisc1(counter++)); + setupKeyset(new PioneerDVD1(counter++)); + + setupKeyset(new RaiteDVD1(counter++)); + + setupKeyset(new RCATV1(counter++)); + setupKeyset(new RCATV1a(counter++)); + setupKeyset(new RCATV1b(counter++)); +// setupKeyset(new RCAAux1(counter++)); +// setupKeyset(new RCAAux2(counter++)); +// setupKeyset(new RCAAux2a(counter++)); + setupKeyset(new RCAVCR1(counter++)); + setupKeyset(new RCAVCR1a(counter++)); + setupKeyset(new RCADVD1(counter++)); + setupKeyset(new RCADVD1a(counter++)); + setupKeyset(new RCASat1(counter++)); + setupKeyset(new RCASat2(counter++)); + + setupKeyset(new RokuBox1(counter++)); + setupKeyset(new RokuBox2(counter++)); + + setupKeyset(new SabaTV1(counter++)); + setupKeyset(new SabaTV2(counter++)); + + setupKeyset(new SagemTVBox1(counter++)); + setupKeyset(new SagemTVBox1a(counter++)); + + setupKeyset(new SamsungTV1(counter++)); + setupKeyset(new SamsungTV1a(counter++)); + setupKeyset(new SamsungTV1b(counter++)); + setupKeyset(new SamsungTV1c(counter++)); + setupKeyset(new SamsungTV1d(counter++)); + setupKeyset(new SamsungTV1e(counter++)); + setupKeyset(new SamsungTV1f(counter++)); + setupKeyset(new SamsungTV2(counter++)); + setupKeyset(new SamsungTV2a(counter++)); + setupKeyset(new SamsungVCR1(counter++)); + setupKeyset(new SamsungVCR1a(counter++)); + setupKeyset(new SamsungVCR1b(counter++)); + setupKeyset(new SamsungVCR1c(counter++)); + setupKeyset(new SamsungVCR1d(counter++)); + setupKeyset(new SamsungVCR1e(counter++)); + setupKeyset(new SamsungDVD1(counter++)); + setupKeyset(new SamsungDVD1a(counter++)); + setupKeyset(new SamsungDVD1b(counter++)); + setupKeyset(new SamsungDVD2(counter++)); + setupKeyset(new SamsungAC1(counter++)); + setupKeyset(new SamsungDVBT1(counter++)); + + setupKeyset(new SanyoVCR1(counter++)); + setupKeyset(new SanyoDVD1(counter++)); + setupKeyset(new SanyoTV1(counter++)); + setupKeyset(new SanyoTV1a(counter++)); + setupKeyset(new SanyoTV1b(counter++)); + setupKeyset(new SanyoTV1c(counter++)); + setupKeyset(new SanyoTV1d(counter++)); + setupKeyset(new SanyoProjector(counter++)); + + setupKeyset(new SharpTV1(counter++)); + setupKeyset(new SharpTV1a(counter++)); + setupKeyset(new SharpTV1b(counter++)); + setupKeyset(new SharpTV1c(counter++)); + setupKeyset(new SharpTV1d(counter++)); + setupKeyset(new SharpTV1e(counter++)); + setupKeyset(new SharpVCR1(counter++)); + setupKeyset(new SharpReceiver1(counter++)); + setupKeyset(new SharpAC1(counter++)); + + setupKeyset(new SkyReceiver1(counter++)); + setupKeyset(new SkyReceiver1a(counter++)); + + setupKeyset(new SonyTV1(counter++)); + setupKeyset(new SonyTV1a(counter++)); + setupKeyset(new SonyTV1b(counter++)); + setupKeyset(new SonyTV1c(counter++)); + setupKeyset(new SonyAmp1(counter++)); + setupKeyset(new SonyAmp2(counter++)); + setupKeyset(new SonyAudio1(counter++)); + setupKeyset(new SonyAudio1a(counter++)); + setupKeyset(new SonyDAT1(counter++)); + setupKeyset(new SonyDVD1(counter++)); + setupKeyset(new SonyDVD1a(counter++)); + setupKeyset(new SonyDVD1b(counter++)); + setupKeyset(new SonyDVD1c(counter++)); + setupKeyset(new SonyVCR1(counter++)); + setupKeyset(new SonyVCR1a(counter++)); + setupKeyset(new SonyVCR1b(counter++)); + setupKeyset(new SonyReceiver1(counter++)); + + setupKeyset(new Tivo1(counter++)); + setupKeyset(new Tivo1a(counter++)); + setupKeyset(new Tivo1b(counter++)); + setupKeyset(new Tivo1c(counter++)); + setupKeyset(new Tivo1d(counter++)); + + setupKeyset(new TopfieldPVR1(counter++)); + setupKeyset(new TopfieldSat1(counter++)); + + setupKeyset(new ToshibaTV1(counter++)); + setupKeyset(new ToshibaTV1a(counter++)); + setupKeyset(new ToshibaTV1b(counter++)); + setupKeyset(new ToshibaTV1c(counter++)); + setupKeyset(new ToshibaTV1d(counter++)); + setupKeyset(new ToshibaTV1e(counter++)); + setupKeyset(new ToshibaTV1f(counter++)); + setupKeyset(new ToshibaTV1g(counter++)); + setupKeyset(new ToshibaTV1h(counter++)); + setupKeyset(new ToshibaVCR1(counter++)); + setupKeyset(new ToshibaVCR1a(counter++)); + setupKeyset(new ToshibaDisc1(counter++)); + setupKeyset(new ToshibaDisc1a(counter++)); + setupKeyset(new ToshibaDisc1b(counter++)); + setupKeyset(new ToshibaDisc1c(counter++)); + setupKeyset(new ToshibaDisc1d(counter++)); + + setupKeyset(new VestelTV1(counter++)); + setupKeyset(new VestelTV2(counter++)); + + setupKeyset(new VirginSTB1(counter++)); + + setupKeyset(new VizioTV1(counter++)); + + setupKeyset(new WDMediaPlayer1(counter++)); + setupKeyset(new WDMediaPlayer1a(counter++)); + + setupKeyset(new WestinghouseTV1(counter++)); + setupKeyset(new WestinghouseTV2(counter++)); + + setupKeyset(new YamahaDVD1(counter++)); + setupKeyset(new YamahaDVD1a(counter++)); + setupKeyset(new YamahaAudio1(counter++)); + setupKeyset(new YamahaAudio1a(counter++)); + setupKeyset(new YamahaAudio2(counter++)); + setupKeyset(new YamahaAudio2a(counter++)); + setupKeyset(new YamahaAudio2b(counter++)); + setupKeyset(new YamahaAudio2c(counter++)); + setupKeyset(new YamahaAudio2d(counter++)); + setupKeyset(new YamahaAudio3(counter++)); + setupKeyset(new YamahaAudio4(counter++)); + setupKeyset(new YamahaTV1(counter++)); + setupKeyset(new YamahaKaraoke1(counter++)); + + setupKeyset(new ZenithC32V37(counter++)); // Start the thread running: commandThread.start(); @@ -624,14 +631,29 @@ QString PIRKeysetManager::getDisplayName( void PIRKeysetManager::populateKeyset( + QObject *guiObject, + unsigned int keysetID) +{ + PIRKeysetCollection::iterator i = keysetsInfo.find(keysetID); + + if (i == keysetsInfo.end()) + { + // Should have some sort of error message here! + return; + } + + i->second->populateProtocol(guiObject); + i->second->moveToThread(&commandThread); +} + + +void PIRKeysetManager::setupKeyset( PIRKeysetMetaData *keyset) { // Set up the keyset collection: keysetsInfo[keyset->getID()] = keyset; - keyset->moveProtocolToThread(&commandThread); - - // Also, set up a name-based index into the collection: + // Set up a name-based index into the collection: makeIndex [QString(makeManager.getMakeString(keyset->getMake()))] [QString(keyset->getKeysetName())] diff --git a/pirkeysetmanager.h b/pirkeysetmanager.h index 85b99ff..aed42ce 100644 --- a/pirkeysetmanager.h +++ b/pirkeysetmanager.h @@ -23,8 +23,7 @@ typedef std::map PIRKeysetMakeIndex; class PIRKeysetManager { public: - PIRKeysetManager( - QObject *guiObject); + PIRKeysetManager(); ~PIRKeysetManager(); @@ -57,9 +56,12 @@ public: PIRKeysetWidgetItem *kwi, unsigned int keysetID) const; -private: - // This needs to be improved: void populateKeyset( + QObject *guiObject, + unsigned int keysetID); + +private: + void setupKeyset( PIRKeysetMetaData *keyset); PIRKeysetCollection keysetsInfo; diff --git a/pirkeysetmetadata.cpp b/pirkeysetmetadata.cpp index e71ddcf..82987ce 100644 --- a/pirkeysetmetadata.cpp +++ b/pirkeysetmetadata.cpp @@ -9,9 +9,10 @@ PIRKeysetMetaData::PIRKeysetMetaData( const char *r, PIRMakeName m, unsigned int i) - : keysetName(r), - make(m), - id(i) + : threadableProtocol(NULL), + index(i), + keysetName(r), + make(m) { } @@ -22,10 +23,14 @@ bool PIRKeysetMetaData::hasKey( } -void PIRKeysetMetaData::moveProtocolToThread( +void PIRKeysetMetaData::moveToThread( QThread *thread) { - threadableProtocol->moveToThread(thread); + if (threadableProtocol) + { + // Do I need some error checking here? + threadableProtocol->moveToThread(thread); + } } @@ -43,7 +48,7 @@ void PIRKeysetMetaData::populateDeviceTypes( unsigned int PIRKeysetMetaData::getID() const { - return id; + return index; } @@ -94,7 +99,6 @@ void PIRKeysetMetaData::addSIRC12Key( if (key != Unmapped_Key) { keys[key] = name; - threadableProtocol->addSIRCKey(key, addressData, 5, commandData); } } diff --git a/pirkeysetmetadata.h b/pirkeysetmetadata.h index f3e3b23..c961b00 100644 --- a/pirkeysetmetadata.h +++ b/pirkeysetmetadata.h @@ -9,6 +9,7 @@ #include class QThread; +class QObject; class PIRKeysetWidgetItem; class PIRProtocol; @@ -51,7 +52,10 @@ public: const char *getKeysetName() const; - void moveProtocolToThread( + virtual void populateProtocol( + QObject *guiObject) = 0; + + void moveToThread( QThread *thread); void populateDeviceTypes( @@ -141,21 +145,20 @@ protected: unsigned long data, unsigned int bits); + void setKeysetName( + const char *name); + KeyCollection keys; DeviceCollection controlledDevices; PIRProtocol *threadableProtocol; - - void setKeysetName( - const char *name); + unsigned int index; private: const char *keysetName; PIRMakeName make; PIRDeviceTypeCollection deviceTypes; - - unsigned int id; }; diff --git a/pirmakenames.cpp b/pirmakenames.cpp index e04219c..7dfcc20 100644 --- a/pirmakenames.cpp +++ b/pirmakenames.cpp @@ -27,6 +27,7 @@ PIRMakeMgr::PIRMakeMgr() makes[Hauppauge_Make] = "Hauppauge"; makes[Hitachi_Make] = "Hitachi"; makes[Homecast_Make] = "Homecast"; + makes[HP_Make] = "HP"; makes[Huawei_Make] = "Huawei"; makes[JVC_Make] = "JVC"; makes[Kenwood_Make] = "Kenwood"; @@ -35,6 +36,7 @@ PIRMakeMgr::PIRMakeMgr() makes[Magnavox_Make] = "Magnavox"; makes[Microsoft_Make] = "Microsoft"; makes[Mitsubishi_Make] = "Mitsubishi"; + makes[Motorola_Make] = "Motorola"; makes[Nokia_Make] = "Nokia"; makes[Onida_Make] = "Onida"; makes[Panasonic_Make] = "Panasonic"; diff --git a/pirmakenames.h b/pirmakenames.h index a7c0ffa..260675b 100644 --- a/pirmakenames.h +++ b/pirmakenames.h @@ -28,6 +28,7 @@ enum PIRMakeName{ Hauppauge_Make, Hitachi_Make, Homecast_Make, + HP_Make, Huawei_Make, JVC_Make, Kenwood_Make, @@ -36,6 +37,7 @@ enum PIRMakeName{ Magnavox_Make, Microsoft_Make, Mitsubishi_Make, + Motorola_Make, Nokia_Make, Onida_Make, Panasonic_Make, diff --git a/pirrx51hardware.cpp b/pirrx51hardware.cpp index 5ee10ee..256b450 100644 --- a/pirrx51hardware.cpp +++ b/pirrx51hardware.cpp @@ -8,11 +8,9 @@ #include #include timeval previousTime; -#else -//#ifndef DEBUGGING +#endif // DEBUGGING #include #include -#endif // DEBUGGING #include // Includes I'm using for error handling stuff: @@ -64,8 +62,7 @@ void PIRRX51Hardware::openLircDevice() #ifdef DEBUGGING // check the current time: gettimeofday(&previousTime, NULL); -#else -//#ifndef DEBUGGING +#endif // DEBUGGING fileDescriptor = open(PATH_TO_LIRC_DEVICE, O_WRONLY); if (fileDescriptor == -1) @@ -75,7 +72,6 @@ void PIRRX51Hardware::openLircDevice() ss << "Error is " << strerror(errno) << "\n"; throw PIRException(ss.str()); } -#endif // DEBUGGING } @@ -144,7 +140,7 @@ void PIRRX51Hardware::sendCommandToDevice() ++blah; } std::cout << std::endl; -#else +#endif // DEBUGGING if (write(fileDescriptor, buffer, index * sizeof(int)) == -1) { std::stringstream ss; @@ -152,7 +148,6 @@ void PIRRX51Hardware::sendCommandToDevice() ss << "IR device returned error: " << strerror(errno) << "\n"; throw PIRException(ss.str()); } -#endif // DEBUGGING // Reset the index: index = 0; @@ -166,7 +161,7 @@ void PIRRX51Hardware::setCarrierFrequency( #ifdef DEBUGGING std::cout << "Setting frequency to " << frequency << "\n"; -#else +#endif // DEBUGGING if (ioctl(fileDescriptor, _IOW('i', 0x13, __u32), &frequency) == -1) { std::stringstream ss; @@ -174,7 +169,6 @@ void PIRRX51Hardware::setCarrierFrequency( ss << "IR device returned error: " << strerror(errno) << "\n"; throw PIRException(ss.str()); } -#endif // DEBUGGING } @@ -185,7 +179,7 @@ void PIRRX51Hardware::setDutyCycle( #ifdef DEBUGGING std::cout << "Setting duty cycle to " << dutyCycle << "\n"; -#else +#endif // DEBUGGING if (ioctl(fileDescriptor, _IOW('i', 0x15, __u32), &dutyCycle) == -1) { std::stringstream ss; @@ -193,5 +187,4 @@ void PIRRX51Hardware::setDutyCycle( ss << "IR device returned error: " << strerror(errno) << "\n"; throw PIRException(ss.str()); } -#endif // DEBUGGING } diff --git a/protocols/giprotocol.cpp b/protocols/giprotocol.cpp new file mode 100644 index 0000000..feac5e1 --- /dev/null +++ b/protocols/giprotocol.cpp @@ -0,0 +1,149 @@ +#include "giprotocol.h" + +#include "pirrx51hardware.h" + +#include "pirexception.h" + +// Some global communications stuff: +#include +extern bool commandInFlight; +extern QMutex commandIFMutex; + +// This G.I./Motorola protocol appears to have the following specifications: +// A "zero" is encoded with a 500 usec pulse, 2250 usec space. +// A "one" is encoded with a 500 usec pulse, and 4500 usec space. +// The header is a 9000 usec pulse, 4500 usec space. +// Commands end with a trailing 500 usec pulse. +// A repeat block is a 9000 usec pulse, 2250 usec space, then a trailing pulse. +// Each command runs for 100000 usec before another can be executed. +// The carrier frequency is 38 kHz. + +GIProtocol::GIProtocol( + QObject *guiObject, + unsigned int index) + : SpaceProtocol( + guiObject, index, + 500, 2250, + 500, 4500, + 9000, 4500, + 500, + 100000, true), + repeatPulse(9000), + repeatSpace(2250) +{ +} + + +void GIProtocol::startSendingCommand( + unsigned int threadableID, + PIRKeyName command) +{ + // Exceptions here are problematic; I'll try to weed them out by putting the + // whole thing in a try/catch block: + try + { + // First, check if we are meant to be the recipient of this command: + if (threadableID != id) return; + + clearRepeatFlag(); + + KeycodeCollection::const_iterator i = keycodes.find(command); + + // Do we even have this key defined? + if (i == keycodes.end()) + { + std::string s = "Tried to send a non-existent command.\n"; + throw PIRException(s); + } + + // construct the device: + PIRRX51Hardware rx51device(carrierFrequency, dutyCycle); + + int repeatCount = 0; + int commandDuration = 0; + while (repeatCount < MAX_REPEAT_COUNT) + { + // If we are currently repeating, send a repeat block. + if (repeatCount) + { + commandDuration = generateRepeatCommand(rx51device); + } + else + { + commandDuration = generateStandardCommand((*i).second, rx51device); + } + + // Now, tell the device to send the whole command: + rx51device.sendCommandToDevice(); + + // sleep until the next repetition of command: + sleepUntilRepeat(commandDuration); + + // Check whether we've reached the minimum required number of repetitons: + if (repeatCount >= minimumRepetitions) + { + // Check whether we've been asked to stop: + if (checkRepeatFlag()) + { + QMutexLocker cifLocker(&commandIFMutex); + commandInFlight = false; + return; + } + } + + ++repeatCount; + } + } + catch (PIRException e) + { + // inform the gui: + emit commandFailed(e.getError().c_str()); + } + + QMutexLocker cifLocker(&commandIFMutex); + commandInFlight = false; +} + + +int GIProtocol::generateStandardCommand( + const PIRKeyBits &pkb, + PIRRX51Hardware &rx51device) +{ + int duration = 0; + + // First, the "header" pulse: + rx51device.addPair(headerPulse, headerSpace); + duration += (headerPulse + headerSpace); + + // The GI protocol consists of a 4-bit device code and an 8-bit command. + // These are sent in reverse order. Finally, a checksum is added at the + // end. I am lacking enough information to calculate the checksum right + // now, so I'm going to dump all 16 bits into the "firstCode" in MSB + // order, and reverse them here: + + duration += pushReverseBits(pkb.firstCode, rx51device); + + // Finally add the "trail": + rx51device.addSingle(trailerPulse); + duration += trailerPulse; + + return duration; +} + + +int GIProtocol::generateRepeatCommand( + PIRRX51Hardware &rx51device) +{ + int duration = 0; + + // Add the repeat pulse: + rx51device.addPair(repeatPulse, repeatSpace); + duration += (repeatPulse + repeatSpace); + + // Add the trailer: + rx51device.addSingle(trailerPulse); + duration += trailerPulse; + + return duration; +} + diff --git a/protocols/giprotocol.h b/protocols/giprotocol.h new file mode 100644 index 0000000..4c24da9 --- /dev/null +++ b/protocols/giprotocol.h @@ -0,0 +1,34 @@ +#ifndef GIPROTOCOL_H +#define GIPROTOCOL_H + +#include "spaceprotocol.h" + +class PIRRX51Hardware; + +// The "G.I." protocol appears to be used by some Motorola boxes. + +class GIProtocol: public SpaceProtocol +{ +public: + GIProtocol( + QObject *guiObject, + unsigned int index); + +public slots: + void startSendingCommand( + unsigned int threadableID, + PIRKeyName command); + +private: + unsigned int repeatPulse; + unsigned int repeatSpace; + + int generateStandardCommand( + const PIRKeyBits &bits, + PIRRX51Hardware &device); + + int generateRepeatCommand( + PIRRX51Hardware &device); +}; + +#endif // GIPROTOCOL_H diff --git a/protocols/rc6skyprotocol.cpp b/protocols/rc6skyprotocol.cpp index 53c882a..d6e469b 100644 --- a/protocols/rc6skyprotocol.cpp +++ b/protocols/rc6skyprotocol.cpp @@ -19,7 +19,8 @@ extern QMutex commandIFMutex; // The RC6 header block starts with the normal 2666 usec pulse, 888 usec space. // The next bit is fixed as a "1", as usual. // The next three bits are 110, marking this as a mode 6 protocol. -// The trailer bit has an 888 usec biphase. It is a toggle bit. +// The trailer bit has an 888 usec biphase. It is normally a toggle bit, but +// for Sky, it appears to be fixed at "0". // Next comes 8 bits of address, 4 bits I don't know about (subdevice?), // and finally 8 bits of command. // A space of (at least) 2666 usec must follow any command. @@ -89,23 +90,12 @@ void RC6SkyProtocol::startSendingCommand( duration += biphaseUnit; rx51device.addSingle(2 * biphaseUnit); // bit 2 space + bit 3 space; duration += 2 * biphaseUnit; - - if (keypressCount % 2) - { - rx51device.addSingle(biphaseUnit); // bit 3 pulse; - duration += biphaseUnit; - rx51device.addSingle(2 * biphaseUnit); // trailer space - duration += 2 * biphaseUnit; - buffer = 2 * biphaseUnit; // trailer pulse goes into the buffer - bufferContainsPulse = true; - } - else - { - rx51device.addSingle(3 * biphaseUnit); // bit 3 + trailer pulses - duration += 3 * biphaseUnit; - buffer = 2 * biphaseUnit; // trailer space goes into the buffer - bufferContainsSpace = true; - } + rx51device.addSingle(biphaseUnit); // bit 3 pulse; + duration += biphaseUnit; + rx51device.addSingle(2 * biphaseUnit); // trailer space + duration += 2 * biphaseUnit; + buffer = 2 * biphaseUnit; // trailer pulse goes into the buffer + bufferContainsPulse = true; // Now, we can start the normal buffering process: diff --git a/qtc_packaging/debian_fremantle/changelog b/qtc_packaging/debian_fremantle/changelog index dd1519e..d25c206 100644 --- a/qtc_packaging/debian_fremantle/changelog +++ b/qtc_packaging/debian_fremantle/changelog @@ -1,3 +1,10 @@ +pierogi (0.6.8) unstable; urgency=low + * Finally, some work to improve memory management, although much remains to be done. + * Fixed a subtle bug in the Sky protocol. + * Made a first pass at keysets for HP and Motorola. + + -- John Pietrzak Sun, 19 Feb 2012 11:56:18 -0500 + pierogi (0.6.7) unstable; urgency=low * First pass at keysets for Huawei, Onida, Vestel, Virgin Media, and Vizio. * Added a Sharp Air Conditioner keyset diff --git a/qtc_packaging/debian_fremantle/control b/qtc_packaging/debian_fremantle/control index 58975a3..882dd6d 100644 --- a/qtc_packaging/debian_fremantle/control +++ b/qtc_packaging/debian_fremantle/control @@ -11,8 +11,8 @@ Architecture: armel Depends: ${shlibs:Depends}, ${misc:Depends} Description: Universal Infrared (IR) Remote Control for N900 Pierogi is a Universal Infrared Remote Control app for the Nokia N900. It is independent from the LIRC server, and stores all configuration info internally. -XB-Maemo-Upgrade-Description: Another quick Keysets update - This update contains a first pass at keysets for Huawei, Onida, Vestel, Virgin Media, and Vizio, as well as an A/C keyset for Sharp. +XB-Maemo-Upgrade-Description: Memory management improved + A large update this time, revamping the way keysets are allocated. Also, a fix for the Sky/Sky+ keysets, and a first pass at keysets for HP and Motorola. XSBC-Bugtracker: https://garage.maemo.org/tracker/?func=add&group_id=2286&atid=7641 XB-Maemo-Display-Name: Pierogi XB-Maemo-Icon-26: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEwAACxMBAJqcGAAAEChJREFUaIHtmFmsXudVhp/1TXv/+x/OOZ4TO66dZmBo0jZJoxBQW8ookAq0mIhJQhUXcAGIAhICRClDb4q4YBRDGSoBFS2ikQoUSkpNIEkbnJQ0cVL7xLUd2/GZfKZ/2MP3fYuLE6LUDQEFQi/oe7e/X7/2++71an1rvfAlfAn/vyH/2Q+Hbzp89M47rvm1aw/0XvPs5ea+M5/b+OiJB5/88FX/1Vee4kvjagEC6Dt/+ns++Ya7Xn2ndWX2zkvKLV070Xp72Vy6PG4vLa0/8pcffuytlxcvr3wxSL8Q7qpnBXjzW+64M/QC1hiTUq0xWbHWihjf3TBvwqtene46e377/Z9swztWz59/9ovA+3nYqw9uv/uWH/y27/iat3rv1AcnkARjCSHgQ2FdqNT5Hgf27bpxfsF+/yTms2vPXjkJGL4Ilvo8AXfcfes9P/kTx96/sHtEKKwYURCHMULWjsnmhMlkXSbbG5J1m317Rr073nDknutvPPy2wZ6FA9syOzFbm7X/lwI+z0Jf+dob7jlw3UGsA8ioJlJWZpMpXUzEVGPFUpYW6xSqgeQ80bu/5tpbX/u6L7/1mvvnv+nPPvu3dwFw++2eEye6V1rA8xU4esvRr7/nnm9+z959C7hgVEQEMWxvbtE0nYoYYhxL7DJZjRZlya691zCc2y0qqPcq1+6vDp1f3r7UhbnF2RNPzF5p8rDTdQTQX3rvj11609fedo31EEqPNZa6bnjm7Clyakk5UlW7mN+9gKYZw+EuCBUiUA1203Yt0+01zjz1VJptPWtX1mZ84v6zf/nYE59779LppU++UgLcfwi44caD1zinIKJGDKpIU8/omimYoM4NWdg1J8ElEuhg6MkCvhiSESRNsXkmB665zmyWXncfcLJnz/Dtd9127dtOP33hn/75gUvfe+H0hYuvhIB86NChXbv3zZFF1bsgoLRtw3h7HaMd1hZiTY33Geug7BUSvEUNYKCdXcGZlqpX4Qplbu6oNG3UohDZtXu/XH/TdW8ajj7z4MO7ez/36YdOv/9/WwA33Hr4R3zwrQveOwf1dJvJZJvpeBvjoOh59u4/SGlm9IfzlFUBBkQcMW1Sb62QUkI1I5pw0lF1M7FuSt4TNO/bLUeOvOXab/9O/nh5efNP/uLP/+ETT55a/4Wzj589/j8VYHffvHv41Xfd9jOve/31ryoLb0R2rLO5tUE9ndDrlQyGQ8oS5kYjXGERieQYqSeb1OMVJqufQ0wPX1b0ewOMQSwR5y2+LPHOibGlQVqqasjBa689evjQwg+Ywvhzi5c//hyXl3WPuD3Vnptvvvnwm6wT1dRKypGuS7TNlJynDIZHCMHiQ0CskrqWGDtCWWIlo9aRZhsYU2KrEqO1kCdIEXBZwBbSpRbvS6xLErNRDh9kMBqxf9/gZ1dXZ/c/8fBn/w7IL6cC7pZbD//UzTcfwAqSsgCe6eQyuatxRglFxdxcn6IUvDOogoSC6dYq9fYa0/E5+nuvpywDqut4rVBbEqcrpDglY7DVQeqtc7hynrIsxZrIcDhiNP8V+q6f3//Rum44e/4yT51aO3VlffyRSxfXPnFhaXr8yuLi+Cph9rkqPX/mBtXwDS4MELGoJkUzQkJzLdZYykLRXKtmjzWVqCqqSSfrl6g3zyGFR5p1Uu6Is7GYakERI9urK9pfGGFMQCRjjZHcTDWpx2AwJspoWMnmaq29ysuNN15H09qbjhw58M47bnv1Oy+cX35o5XX7F1evbN136dzGw89IscjiYvMFFej1+vPWW1QziGINYq3HSMA6C0SscWIl03Y1sa2xoS9KDd4SwgDHDIlQhHlyO8UP9mFtKSJCzlHjeF1sb4E4HZPjtthehbM9jIVerxREQLJed2iPrCxfYTxpec1rjtw1HL7+rq7b/r7HP/PYhe3NrSc3Xvfap598fO23zjx14fHnBRR9c8aJ3u6LAksGyVr1K2ZTLzk2zLYv4WW3FsVeNGdJsWO6cVrjbBOLx6Qav+dGMAO0m4iJS2SF/p79KuKxdORmXZmMpTCBLlsVrXCi0uUJvTIznWyrNZ69+4Ys7JojpqBnz5xm45mTjEa7uPPuNx/U3B0M3n+DSP1DbTtjPN7kt379Y+9wVTBzYgPOCkYsYpyEUGCNo4s1WQ1qgqAdmhWNDcaI5BQRalKbIRnEeYwvUR3iwhwxduJDD2OtUlUy21iDXGMkSyg8mUTG4L1Q9voym05w3gAWY5CFXbvwwaDJELspwQecB6FSjJc5W3LnVx/6Tbc9bpK3ZqeHu4A1QgiOohzQNTO6aMg5YyTRzTaxCElB2zXoprTJMSufxQ4ivWqOToV28zLEGSxchw/zpA4wDqHEWQdGMOLxxiBEiuBJeYgSERXEGIrSk2KflHbe712BCw6DINmharTfGxb26Jcd3n/LrUff2BsM1BrBGCPWC84HVDOby4tYEjk1BN9nvD1mtr6E1JcxKM6MKEd7MdqQuzHd+kWsNOKDIbYJX1ZkrOh0E3JL2aski0NzRlONrw6h4lGN5JQQa4mxw7o+IhawDIYVvVGF9yVYxVqDYHnwoSd/zSw9szpeX10mx05SPZXY7gyRRa+iGgwRZ6lnV2imNVkV6wqKahcqGWwPHLRtS1fPaLeexYdK0myb6doSqKXeWpVc17hqH+Vor0g5h+QMucMYg3OKDxbnS5SEdeBDADLCToWc9zjrcSFgTRBjnYjJbF0ZXzQbk+ljy0uXaJuGLjbadTW5m2KkozcYUJRzNLOOWT1jur1CTmNcYUhqURmABHKMWGswRmgmK9pNO7pasdZDzJq7Bgl9CLsVP8C5HmJLxBeIEYwkrAEQBIuIJWsGFJFE2SvxwWMthBDUWof3ha6sbF+wo33zG6Ohe8sNNxzYb51I1oQzJUY6sTbjXA/nCt3aXAXjRHNCxehg/ghuVOGKCqsN4jLV/F4xtsD6nlQLB1SowXvUF0iuxViDQVA8zjmRmOjqTdpp0q5rmEzHIhLI2et00hHbGYNRn/n5CucDxlkRUUmJTtW6D/zBR99hTp04tbqxvvUvKXU55w5rrCRtJKZE1oQNJdXcHlnYf0S2t1apmylt24rxXpwfSujNSWxbMVpKbBNhMMJXFUUlEga7xNgSLyKiCdGEihWxVrouEdOOx1VqMdZI10FKiawiOUUJwchofig2BDFGRXJGsyrglpeXWFpamjiAja3miqasMbY4Z4BAzmCzEEIgGejRZ8v3mc4mqPSYjDep+gPEBEyoEOMwrkDjBGOVLGBcH0ODsSWaZiAexJC6KV09QaQgiSfHCbNZjTEOTYY21kDHaH6eajDCmA5RSAa0U0SsLJ4+dx6eG6efODv+vdiN3103lRpj6BU7cVHKineBqtqNVgv43hz1tGZ74zJrm+tMJhP6VWS0+xCikdw1JALGeUQ8YbAfm1tSOyYTyDgMlqyO7Cu6qKytTalniRgFpGI8UzS3XH/jTRRlj5RaMI7YKQZD1pn8y/0nxn/4Ox/5OkDMsWPH7LmHT14eb20S21piF1EiaIvmDiWDZqwUWO8pqxH90QEwPeoOZo0Qm4aMBRuwxYCMIQM5NeTYktqWFBvUWHJWkvSIuU8bC6azSN3srKxtkxCNjOb7FL0SY/PO3vFcCBhTy3Ra88D9j3545cLKIqDugx/8oAJsbW3n/lxhcnSqWBFRjOyM6G23iTGWspgnm4QyYDqep5nALAqz8QahN8SYRCjm0ay0TaLIkRQzSoGthnSdElOk7oTtrRkx1nT1NooiMkAl0R9WVP0SJJLZWZLAkbWj66KefOK0njx16V1Xj6c0KRy65SsGt2O9FMEgOKwxqEQ0TcmpRUXxrqIq57GhJFQLpAybWy1tSrTdFEMQTA9CxXTa0OVO6mbMxvqEre2JbG6OWb54kenkCk3dIa6PcwN6VZ9Xf9nNzC/spax6iAiaFEGp21ZzhKZN8vM/+9v7lxYvPr9bP58LXbw0/eVTp8ffdfsde+ZSFzE0RHEY/HMBaiZ1E1ocKomi1wOjIHuZTVaZ1pHgStQ0alsnLhhy1yHWqGJlY2OJrD2NMYkaCwTEBHqDOfqDAXPzB9C8BdYi6kj1FFUlK2jOiHj5t0c/Pb46j30+F1p5dmXTD/dW17+qelNVBZw1iChIQnAY4zFkcmbngnEZZwXnHAqkriFGS91MpGkauuiom8ysjlI3ibqJxJgl54wNA4regN6wz559BxmO9hBCSco1AKqZHBNZMzGhbYecO/MM7/+je3/48jNrj75QwBfE62/42q9646/88luOi7ZalIWU5Yi2XcMYSygGGGOxxu+0RmcRIzvku5a6qZluTTV2WWI3I2eLYlXEivUB55xa72Q4t4BxnuD6WNfDWEtOLTEZUqxJqaOLSVOGpo78ye/+6cp9Hz/5dUtnlh6/mu/V6bQ8/I8P/tPSs7dx4MC8NI3T3qCUwC5SnGKtJSdDlojkFkkeVHbGAG8JxuPcPKnrSHlI17VoBmMNRTHHTthn8KFCjMX5gpRaYlRyiojvAx6hIMZNFCObVzb52PFT37jyIuQ/z0IvRBiMbr7+6O5bjAv0ilKM8ZolY10pzlkQ0a6dkVJLzh2KoAJijRzd/000aUVUohahRyhLvA8UvaEYK1ix+GIBsVaMFKgAGFUgJZWui+SkTKednD97lg/9+b1//8jxJ3/1xXi+qIVeiB/9ybf+1du/++5vF2vUGS9F6WlmY3LeIW/FIs6BxOes4Ekpqg9DAYMxjqRGxThxboQxPU2pEWsCObfkHBECTbNFTBlNfZ1NNmVrY5Vffe/v/83qOb57cXFx66U4mhc7PHbsmAX49f7r335leRmiSJdcrusxWROqDqQk5kzXNmisyTGSYmKyMaFtZ2CElDKIRwRy7ohxihWDUCL06bpE09SIVMSIrq+dlaef+hQf+fC9PHTf4rc+R/4lP/KLWujkyZMKCMePa39+7vpd8/611XAksR3Tda0iRkI5T8odOWeUnU6lCr7ogRghJ3LOkBXNUbrYkNsZsaulaxti2zKrt5hOxsxmtXaR/MB9f20+fvzEB//tVPODVy6uXngp4v+Bl1T3Qrz1HW9747FvOXB8194FjHOIZHWuJ854yGMwCRSyqFrnRcQgGBQ0pyhJDTkmUofO2khKEclRzp+7yGceu3DmqafH73vgbz/9nhfw+m+ldC9agRfDZx998hyjw2UzWbvJS+yX/VE0OYiqilgla0ZzVlDJKZNzIkUFFbG2z2R7haaZaoxTbWczGY+35MK5JT5072d/+OwzxY+d+PinPvbf5fKyBAA89ciT9w1vuPPe9eXla/b0u1uKXk8wZa7KAeLnadqZpNhqzkLbNYCVtmu0LPYy3lpCsTKrG3n0xBn+9ZGVj33ykbVffOijj7xv+fz5+uWQhy+8B/5L3HHgVU+/+91/fOx9wI+/5103tPncmwfpqd9YWKjKqizVhVIwGXJmOmlZWd5kbePBlaXN8Idd4/56S8OZBz7w95dgp1k8xKdeLvcv4Uv438C/A7Q6fneUaSRcAAAAAElFTkSuQmCC -- 1.7.9.5