Advanced Settings Panel
[pierogi] / pirkeysetmetadata.h
index c961b00..09569f5 100644 (file)
@@ -3,37 +3,21 @@
 
 #include "pirkeynames.h"
 #include "pirmakenames.h"
-#include "pirdevicetypenames.h"
+//#include "pirdevicetypenames.h"
+
+#include "pirdeviceinfo.h"
 
 #include <map>
-#include <list>
+//#include <list>
 
 class QThread;
 class QObject;
 
-class PIRKeysetWidgetItem;
+class PIRSelectDeviceForm;
 class PIRProtocol;
 
 typedef std::map<PIRKeyName, const char *> KeyCollection;
 
-class DeviceInfo
-{
-public:
-  DeviceInfo(
-    PIRMakeName ma,
-    const char *mo,
-    PIRDeviceTypeName t)
-  : make(ma),
-    model(mo),
-    type(t)
-  {}
-
-  PIRMakeName make;
-  const char *model;
-  PIRDeviceTypeName type;
-};
-
-typedef std::list<DeviceInfo> DeviceCollection;
 
 class PIRKeysetMetaData
 {
@@ -43,6 +27,8 @@ public:
     PIRMakeName make,
     unsigned int index);
 
+  ~PIRKeysetMetaData();
+
   bool hasKey(
     PIRKeyName name) const;
 
@@ -52,14 +38,26 @@ public:
 
   const char *getKeysetName() const;
 
+  unsigned int getCarrierFrequency() const;
+
+  void setCarrierFrequency(
+    unsigned int carrierFrequency);
+
+  unsigned int getDutyCycle() const;
+
+  void setDutyCycle(
+    unsigned int dutyCycle);
+
   virtual void populateProtocol(
     QObject *guiObject) = 0;
 
+  bool clearProtocol();
+
   void moveToThread(
     QThread *thread);
 
-  void populateDeviceTypes(
-    PIRKeysetWidgetItem *kwi) const;
+  static void populateDevices(
+    PIRSelectDeviceForm *sdf);
 
 protected:
   void addControlledDevice(
@@ -109,6 +107,12 @@ protected:
     unsigned int addressData,
     unsigned int commandData);
 
+  void addPanOldKey(
+    const char *name,
+    PIRKeyName key,
+    unsigned int addressData,
+    unsigned int commandData);
+
   void addPioneerKey(
     const char *name,
     PIRKeyName key,
@@ -137,6 +141,12 @@ protected:
     unsigned int firstCommand,
     unsigned int secondCommand);
 
+  void addXMPKey(
+    const char *name,
+    PIRKeyName key,
+    unsigned int firstCommand,
+    unsigned int secondCommand);
+
   void setPreData(
     unsigned long data,
     unsigned int bits);
@@ -150,15 +160,14 @@ protected:
 
   KeyCollection keys;
 
-  DeviceCollection controlledDevices;
-
   PIRProtocol *threadableProtocol;
   unsigned int index;
 
 private:
   const char *keysetName;
   PIRMakeName make;
-  PIRDeviceTypeCollection deviceTypes;
+  static PIRDeviceCollection controlledDevices;
+//  PIRDeviceTypeCollection deviceTypes;
 };