Advanced Settings Panel
[pierogi] / keysets / pinnacle.cpp
index cf49c53..3bad6b5 100644 (file)
@@ -1,8 +1,7 @@
 #include "pinnacle.h"
-#include "rc5protocol.h"
+#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);
 
@@ -30,7 +40,7 @@ PinnaclePCTV1::PinnaclePCTV1(
   addKey("btn_8", Eight_Key, 0x21, 6);
   addKey("btn_9", Nine_Key, 0x12, 6);
   addKey("btn_0", Zero_Key, 0x27, 6);
-  addKey("key_screen", Unmapped_Key, 0x24, 6);
+  addKey("key_screen", AspectRatio_Key, 0x24, 6);
   addKey("key_t", Unmapped_Key, 0x2A, 6);
   addKey("key_rewind", Rewind_Key, 0x2D, 6);
   addKey("key_playpause", Play_Key, 0x30, 6);
@@ -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);
 
@@ -58,7 +78,7 @@ PinnaclePCTV2::PinnaclePCTV2(
   addKey("play-pause", Pause_Key, 0x06, 6);
   addKey("stop", Stop_Key, 0x05, 6);
   addKey("exit", Exit_Key, 0x03, 6);
-  addKey("screen", Unmapped_Key, 0x02, 6);
+  addKey("screen", AspectRatio_Key, 0x02, 6);
   addKey("rew", Rewind_Key, 0x04, 6);
   addKey("ff", FastForward_Key, 0x07, 6);
   addKey("mute", Mute_Key, 0x00, 6);
@@ -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);