Log In
New Account
  
Home My Page Project Cloud Code Snippets Project Openings Pierogi
Summary Forums Tracker Lists Tasks Docs News SCM Files
authorJohn Pietrzak <john@pietrzak.org>
Thu, 1 Mar 2012 01:10:29 +0000 (20:10 -0500)
committerJohn Pietrzak <john@pietrzak.org>
Thu, 1 Mar 2012 01:10:29 +0000 (20:10 -0500)
This commit includes a new, more flexible GUI based around the concept of
"control panels", a new control panel for Air Conditioners, many new keysets,
and a variety of smaller bug fixes.

106 files changed:
doc/about.html
doc/documentation.html
forms/piradjustform.cpp [new file with mode: 0644]
forms/piradjustform.h [new file with mode: 0644]
forms/piradjustform.ui [new file with mode: 0644]
forms/pirairconditionerform.cpp [new file with mode: 0644]
forms/pirairconditionerform.h [new file with mode: 0644]
forms/pirairconditionerform.ui [new file with mode: 0644]
forms/pirfavoritesform.cpp [new file with mode: 0644]
forms/pirfavoritesform.h [new file with mode: 0644]
forms/pirfavoritesform.ui [new file with mode: 0644]
forms/pirinputform.cpp [new file with mode: 0644]
forms/pirinputform.h [new file with mode: 0644]
forms/pirinputform.ui [new file with mode: 0644]
forms/pirkeypadform.cpp [new file with mode: 0644]
forms/pirkeypadform.h [new file with mode: 0644]
forms/pirkeypadform.ui [new file with mode: 0644]
forms/pirmainform.cpp [new file with mode: 0644]
forms/pirmainform.h [new file with mode: 0644]
forms/pirmainform.ui [new file with mode: 0644]
forms/pirmedia2form.cpp [new file with mode: 0644]
forms/pirmedia2form.h [new file with mode: 0644]
forms/pirmedia2form.ui [new file with mode: 0644]
forms/pirmediaform.cpp [new file with mode: 0644]
forms/pirmediaform.h [new file with mode: 0644]
forms/pirmediaform.ui [new file with mode: 0644]
forms/pirmenuform.cpp [new file with mode: 0644]
forms/pirmenuform.h [new file with mode: 0644]
forms/pirmenuform.ui [new file with mode: 0644]
forms/pirtvform.cpp [new file with mode: 0644]
forms/pirtvform.h [new file with mode: 0644]
forms/pirtvform.ui [new file with mode: 0644]
forms/pirutilityform.cpp [new file with mode: 0644]
forms/pirutilityform.h [new file with mode: 0644]
forms/pirutilityform.ui [new file with mode: 0644]
keysets/aoc.cpp [new file with mode: 0644]
keysets/aoc.h [new file with mode: 0644]
keysets/arcam.cpp [new file with mode: 0644]
keysets/arcam.h [new file with mode: 0644]
keysets/dell.cpp [new file with mode: 0644]
keysets/dell.h [new file with mode: 0644]
keysets/dse.cpp [new file with mode: 0644]
keysets/dse.h [new file with mode: 0644]
keysets/dynex.cpp [new file with mode: 0644]
keysets/dynex.h [new file with mode: 0644]
keysets/foxtel.cpp
keysets/foxtel.h
keysets/harmankardon.cpp [new file with mode: 0644]
keysets/harmankardon.h [new file with mode: 0644]
keysets/kathrein.cpp [new file with mode: 0644]
keysets/kathrein.h [new file with mode: 0644]
keysets/lg.cpp
keysets/logitech.cpp
keysets/logitech.h
keysets/panasonic.cpp
keysets/samsung.cpp
keysets/sharp.cpp
keysets/sony.cpp
keysets/sony.h
keysets/starsat.cpp [new file with mode: 0644]
keysets/starsat.h [new file with mode: 0644]
keysets/viewsat.cpp [new file with mode: 0644]
keysets/viewsat.h [new file with mode: 0644]
keysets/wd.cpp
keysets/wd.h
main.cpp
mainwindow.cpp
mainwindow.h
mainwindow.ui
pierogi.pro
pierogi.pro.user
pirkeynames.h
pirkeysetmanager.cpp
pirkeysetmanager.h
pirkeysetmetadata.cpp
pirkeysetmetadata.h
pirkeysetwidgetitem.cpp
pirkeysetwidgetitem.h
pirmakenames.cpp
pirmakenames.h
pirpanelmanager.cpp [new file with mode: 0644]
pirpanelmanager.h [new file with mode: 0644]
pirpanelnames.h [new file with mode: 0644]
pirpanelselectionform.cpp [new file with mode: 0644]
pirpanelselectionform.h [new file with mode: 0644]
pirpanelselectionform.ui [new file with mode: 0644]
pirsecondaryform.cpp [deleted file]
pirsecondaryform.h [deleted file]
pirsecondaryform.ui [deleted file]
pirselectdeviceform.cpp [new file with mode: 0644]
pirselectdeviceform.h [new file with mode: 0644]
pirselectdeviceform.ui [new file with mode: 0644]
pirselectkeysetform.cpp
pirselectkeysetform.h
pirselectkeysetform.ui
protocols/aiwaprotocol.cpp
protocols/dishprotocol.cpp
protocols/jvcprotocol.cpp
protocols/kathreinprotocol.cpp [new file with mode: 0644]
protocols/kathreinprotocol.h [new file with mode: 0644]
protocols/nokia32protocol.cpp [new file with mode: 0644]
protocols/nokia32protocol.h [new file with mode: 0644]
protocols/sharpprotocol.cpp
protocols/sircprotocol.cpp
qtc_packaging/debian_fremantle/changelog
qtc_packaging/debian_fremantle/control

index 7cfaa7f..d534987 100644 (file)
@@ -9,7 +9,7 @@ Pierogi UIRC
 <h2 align="center">A Universal Infrared Remote Control</h2>
 
 <p align="center">
-Version 1.0 - <i>A Fistful of Pierogis</i>
+Version 1.1 - <i>For a Few Pierogies More</i>
 </p>
 
 <p>
index a793cd1..29e7cf7 100644 (file)
@@ -40,39 +40,39 @@ the features of Pierogi is provided below.
 <h2>Using Pierogi</h2>
 
 <p>
-The current Pierogi design is built around a tabbed window, each tab containing
-a group of related buttons.  Depending on the keyset that has been selected,
-some of these buttons will be active, others inactive.  Active buttons are ones
-which have been associated with a command in the current keyset.  Pressing an
+The current Pierogi design is built around a series of control panels, with
+each panel containing a group of related buttons.  Depending on the keyset
+chosen, some of these buttons will be active, others inactive.  Pressing an
 active button will begin repeating the associated command; letting up on the
 button will stop the command.
 </p>
 
 <p>
-Keysets can be chosen using the "Select Keyset" option in the drop-down menu.
-If you have a particular keyset you use often, it can be stored in the
-"favorites" tab for quick access.
+Keysets can be chosen using either the "Select Keyset by Name" or "Select
+Keyset by Device" options in the drop-down menu.  If you have a particular
+keyset you use often, it can be stored in the "favorites" panel for quick
+access.
 </p>
 
 <h3>Main Window</h3>
 
-<h4>Main Tab</h4>
+<h4>Main Panel</h4>
 
-<p>The Main tab contains just the power, volume, mute, and channel buttons.
+<p>The Main panel contains just the power, volume, mute, and channel buttons.
 It is intended to be a quick way to get to the most important, commonly used
-controls.  The name of the current keyset is also provided in this tab.</p>
+controls.  The name of the current keyset is also provided in this panel.</p>
 
-<h4>Utility Tab</h4>
+<h4>Utility Panel</h4>
 
-<p>The Utility tab contains a selection of commonly useful controls, such as
+<p>The Utility panel contains a selection of commonly useful controls, such as
 "Sleep", "Input", "Closed Captions / Subtitles", and the color buttons.
-This tab is intended to be a quick way to reach the most frequently used
+This panel is intended to be a quick way to reach the most frequently used
 buttons; as such, the selection may be updated in future versions of Pierogi.
 </p>
 
-<h4>Keypad Tab</h4>
+<h4>Keypad Panel</h4>
 
-<p>This tab provides a numeric keypad and a handful of associated commands,
+<p>This panel provides a numeric keypad and a handful of associated commands,
 intended mainly for use with televisions.  The "Prev Channel" button should
 take you to the previously selected channel, if any.  The "Dash" button
 should allow you to specify a digital subchannel, as in "16-4".  The "+100"
@@ -82,82 +82,116 @@ Double Digit" button is used on very old televisions that normally expect
 channels to be represented by just a single digit; pressing this should
 allow you to enter a second digit.</p>
 
-<h4>Menu Tab</h4>
+<h4>Menu Panel</h4>
 
-<p>This tab contains buttons used to enter and exit a menu, navigate within
+<p>This panel contains buttons used to enter and exit a menu, navigate within
 a menu, and select menu entries.  The "Menu" button is meant to enter the
 main system menu of a given device; "Guide" is a content-related menu available
 on many modern devices; and "Disc Menu" is used to access the menu interface
 provided with DVD and Blu-Ray media.</p>
 
-<h4>Media Tab</h4>
+<h4>Media Panel</h4>
 
-<p>Many of the most important playback commands are represented on this tab.
+<p>Many of the most important playback commands are represented on this panel.
 "Play", "Pause", and "Stop" are the most common ones, along with "Reverse"
 (often called rewind) and "Fast Forward".  A variety of other less common
 navigation controls are included, along with the "Eject" command.</p>
 
-<h4>Favorite Tab</h4>
+<h4>Media2 Panel</h4>
 
-<p>As there are numerous keysets available in Pierogi, a "Favorite" tab has
-been implemented.  To add a favorite keyset to the tab, first select that
-keyset from the "Select Keyset" window.  Then, navigate to the Favorite tab
-and press "Add Current Keyset".</p>
+<p>This is another panel of media buttons, containing a mix of commands useful
+for DVD players, VCRs, audio devices, and possibly other devices.  The content
+of this page may change in the future.</p>
+
+<h4>TV Panel</h4>
 
-<p>Once you have added some keysets to the favorites list, you can tell
-Pierogi to use one by simply selecting that keyset from the list.</p>
+<p>This panel contains several more TV-oriented buttons, including controls for
+picture-in-picture, teletext, and some graphics and audio controls.  The
+content of this page is subject to change.</p>
 
-<p>A keyset can be removed from the list by selecting it and pressing
-"Remove Selected Keyset".</p>
+<h4>Input Panel</h4>
 
 <p>
-Also note that the volume control keys on the top left side of the N900 can
-be used to step through the list of favorite keysets, no matter what tab
-you are currently using.
+Many devices have multiple sources for their data, whether it be television
+signals piped in over the air or through a cable, or audio from a variety of
+stereo components.  It is unlikely that Pierogi will ever be able to list all
+of the various possible input buttons, but this panel contains a few of them.
 </p>
 
+<h4>Adjust Panel</h4>
+
+<p>
+A handful of the various audio and video adjustment buttons are placed in
+this panel.
+</p>
 
-<h3>Select Keyset Window</h3>
+<h4>Air Conditioner Panel</h4>
 
-<p>The Select Keyset window presents a list of all the keysets currently
-available in Pierogi.  As this list is fairly long, buttons have been added
-at the top of the window that allows you to choose the make and/or type of
-device you are trying to control; all keysets not associated with the chosen
-make or type will be hidden.  To use a keyset, simply select it from the list,
-and then close the window (by pressing the return arrow at the top right of
-the screen).</p>
+<p>
+This panel includes several controls commonly found on remotes used for
+air conditioners.
+</p>
 
-<h3>Secondary Buttons Window</h3>
+<h4>Favorites Panel</h4>
 
-<h4>TV Tab</h4>
+<p>
+As there are numerous keysets available in Pierogi, a "Favorites" panel has
+been implemented.  To add a favorite keyset to the panel, first select that
+keyset from either the "Select Keyset by Name" or "Select Keyset by Device"
+windows.  Then, navigate to the Favorites panel and press "Add Current Keyset".
+</p>
 
-<p>This page contains several more TV-oriented buttons, including controls for
-picture-in-picture, teletext, and some graphics and audio controls.  The
-content of this page is subject to change.</p>
+<p>
+Once you have added some keysets to the favorites list, you can tell
+Pierogi to use one by simply selecting that keyset from the list.  You can
+also switch between keysets on the favorites list by pressing either of the
+volume control keys on the top left side of the N900; this allows you to
+change the keyset regardless of which panel is currently visible.
+</p>
 
-<h4>Media2 Tab</h4>
+<p>
+A keyset can be removed from the list by selecting it and pressing
+"Remove Selected Keyset".
+</p>
 
-<p>This is another page of media buttons, containing a mix of commands useful
-for DVD players, VCRs, audio devices, and possibly other devices.  The content
-of this page may change in the future.</p>
 
-<h4>Input Tab</h4>
+<h3>Select Keyset by Name Window</h3>
 
 <p>
-Many devices have multiple sources for their data, whether it be television
-signals piped in over the air or through a cable, or audio from a variety of
-stereo components.  It is unlikely that Pierogi will ever be able to list all
-of the various possible input buttons, but this tab contains a few of them.
+The Select Keyset by Name window presents a list of all the keysets currently
+available in Pierogi.  As this list is fairly long, a button has been added
+at the top of the window that allows you to filter the list by the make of the
+device you are trying to control; all keysets not associated with the chosen
+make will be hidden.  To use a keyset, simply select it from the list,
+and then close the window (by pressing the return arrow at the top right of
+the screen).
 </p>
 
-<h4>Adjust Tab</h4>
+
+<h3>Select Keyset by Device Window</h3>
+
+<p>
+Similar to the Select by Name window, this window provides a list of the
+devices known to work with Pierogi.  This list can be filtered either by
+the make or the type of device.  Choosing an entry from this list will
+activate the keyset associated with the chosen device.
+</p>
+
+<p>
+Please note that this is nowhere near an exhaustive list of the devices
+Pierogi can control!
+</p>
+
+
+<h3>Manage Panels Window</h3>
 
 <p>
-A handful of the various audio and video adjustment buttons are placed on
-this tab.  Actual volume controls will likely remain on the main window,
-however.
+Each of the panels available in Pierogi can be switched on or off using this
+window.  Simply set a check in the panel's checkbox to make it available in
+the main window, and un-check it to make the panel go away.
 </p>
 
+
 <h2>Design Rationale</h2>
 
 <p>Here I collect my thoughts on the how and why of creating Pierogi.</p>
diff --git a/forms/piradjustform.cpp b/forms/piradjustform.cpp
new file mode 100644 (file)
index 0000000..6889e78
--- /dev/null
@@ -0,0 +1,202 @@
+#include "piradjustform.h"
+#include "ui_piradjustform.h"
+
+#include "mainwindow.h"
+#include "pirkeysetmanager.h"
+
+PIRAdjustForm::PIRAdjustForm(MainWindow *mw) :
+  QWidget(0),
+  ui(new Ui::PIRAdjustForm),
+  mainWindow(mw)
+{
+  ui->setupUi(this);
+}
+
+PIRAdjustForm::~PIRAdjustForm()
+{
+  delete ui;
+}
+
+
+void PIRAdjustForm::enableButtons(
+  const PIRKeysetManager *keyset,
+  unsigned int id)
+{
+  emit bassUpEnabled(keyset->hasKey(id, BassUp_Key));
+  emit trebleUpEnabled(keyset->hasKey(id, TrebleUp_Key));
+  emit enhancedBassEnabled(keyset->hasKey(id, EnhancedBass_Key));
+  emit noiseReductionEnabled(keyset->hasKey(id, NoiseReduction_Key));
+  emit bassDownEnabled(keyset->hasKey(id, BassDown_Key));
+  emit trebleDownEnabled(keyset->hasKey(id, TrebleDown_Key));
+  emit balanceLeftEnabled(keyset->hasKey(id, BalanceLeft_Key));
+  emit balanceRightEnabled(keyset->hasKey(id, BalanceRight_Key));
+  emit surroundEnabled(keyset->hasKey(id, Surround_Key));
+  emit colorUpEnabled(keyset->hasKey(id, ColorUp_Key));
+  emit brightnessUpEnabled(keyset->hasKey(id, BrightnessUp_Key));
+  emit contrastUpEnabled(keyset->hasKey(id, ContrastUp_Key));
+  emit zoomEnabled(keyset->hasKey(id, Zoom_Key));
+  emit colorDownEnabled(keyset->hasKey(id, ColorDown_Key));
+  emit brightnessDownEnabled(keyset->hasKey(id, BrightnessDown_Key));
+  emit contrastDownEnabled(keyset->hasKey(id, ContrastDown_Key));
+}
+
+
+void PIRAdjustForm::on_bassUpButton_pressed()
+{
+  mainWindow->startRepeating(BassUp_Key);
+}
+
+void PIRAdjustForm::on_bassUpButton_released()
+{
+  mainWindow->stopRepeating();
+}
+
+void PIRAdjustForm::on_trebleUpButton_pressed()
+{
+  mainWindow->startRepeating(TrebleUp_Key);
+}
+
+void PIRAdjustForm::on_trebleUpButton_released()
+{
+  mainWindow->stopRepeating();
+}
+
+void PIRAdjustForm::on_enhancedBassButton_pressed()
+{
+  mainWindow->startRepeating(EnhancedBass_Key);
+}
+
+void PIRAdjustForm::on_enhancedBassButton_released()
+{
+  mainWindow->stopRepeating();
+}
+
+void PIRAdjustForm::on_noiseReductionButton_pressed()
+{
+  mainWindow->startRepeating(NoiseReduction_Key);
+}
+
+void PIRAdjustForm::on_noiseReductionButton_released()
+{
+  mainWindow->stopRepeating();
+}
+
+void PIRAdjustForm::on_bassDownButton_pressed()
+{
+  mainWindow->startRepeating(BassDown_Key);
+}
+
+void PIRAdjustForm::on_bassDownButton_released()
+{
+  mainWindow->stopRepeating();
+}
+
+void PIRAdjustForm::on_trebleDownButton_pressed()
+{
+  mainWindow->startRepeating(TrebleDown_Key);
+}
+
+void PIRAdjustForm::on_trebleDownButton_released()
+{
+  mainWindow->stopRepeating();
+}
+
+void PIRAdjustForm::on_balanceLeftButton_pressed()
+{
+  mainWindow->startRepeating(BalanceLeft_Key);
+}
+
+void PIRAdjustForm::on_balanceLeftButton_released()
+{
+  mainWindow->stopRepeating();
+}
+
+void PIRAdjustForm::on_balanceRightButton_pressed()
+{
+  mainWindow->startRepeating(BalanceRight_Key);
+}
+
+void PIRAdjustForm::on_balanceRightButton_released()
+{
+  mainWindow->stopRepeating();
+}
+
+void PIRAdjustForm::on_surroundButton_pressed()
+{
+  mainWindow->startRepeating(Surround_Key);
+}
+
+void PIRAdjustForm::on_surroundButton_released()
+{
+  mainWindow->stopRepeating();
+}
+
+void PIRAdjustForm::on_colorUpButton_pressed()
+{
+  mainWindow->startRepeating(ColorUp_Key);
+}
+
+void PIRAdjustForm::on_colorUpButton_released()
+{
+  mainWindow->stopRepeating();
+}
+
+void PIRAdjustForm::on_brightnessUpButton_pressed()
+{
+  mainWindow->startRepeating(BrightnessUp_Key);
+}
+
+void PIRAdjustForm::on_brightnessUpButton_released()
+{
+  mainWindow->stopRepeating();
+}
+
+void PIRAdjustForm::on_contrastUpButton_pressed()
+{
+  mainWindow->startRepeating(ContrastUp_Key);
+}
+
+void PIRAdjustForm::on_contrastUpButton_released()
+{
+  mainWindow->stopRepeating();
+}
+
+void PIRAdjustForm::on_zoomButton_pressed()
+{
+  mainWindow->startRepeating(Zoom_Key);
+}
+
+void PIRAdjustForm::on_zoomButton_released()
+{
+  mainWindow->stopRepeating();
+}
+
+void PIRAdjustForm::on_colorDownButton_pressed()
+{
+  mainWindow->startRepeating(ColorDown_Key);
+}
+
+void PIRAdjustForm::on_colorDownButton_released()
+{
+  mainWindow->stopRepeating();
+}
+
+void PIRAdjustForm::on_brightnessDownButton_pressed()
+{
+  mainWindow->startRepeating(BrightnessDown_Key);
+}
+
+void PIRAdjustForm::on_brightnessDownButton_released()
+{
+  mainWindow->stopRepeating();
+}
+
+void PIRAdjustForm::on_contrastDownButton_pressed()
+{
+  mainWindow->startRepeating(ContrastDown_Key);
+}
+
+void PIRAdjustForm::on_contrastDownButton_released()
+{
+  mainWindow->stopRepeating();
+}
diff --git a/forms/piradjustform.h b/forms/piradjustform.h
new file mode 100644 (file)
index 0000000..043825b
--- /dev/null
@@ -0,0 +1,83 @@
+#ifndef PIRADJUSTFORM_H
+#define PIRADJUSTFORM_H
+
+#include <QWidget>
+
+class MainWindow;
+class PIRKeysetManager;
+
+namespace Ui {
+class PIRAdjustForm;
+}
+
+class PIRAdjustForm : public QWidget
+{
+  Q_OBJECT
+  
+public:
+  PIRAdjustForm(MainWindow *mw);
+  ~PIRAdjustForm();
+
+  void enableButtons(
+    const PIRKeysetManager *keyset,
+    unsigned int id);
+
+signals:
+  void bassUpEnabled(bool);
+  void trebleUpEnabled(bool);
+  void enhancedBassEnabled(bool);
+  void noiseReductionEnabled(bool);
+  void bassDownEnabled(bool);
+  void trebleDownEnabled(bool);
+  void balanceLeftEnabled(bool);
+  void balanceRightEnabled(bool);
+  void surroundEnabled(bool);
+  void colorUpEnabled(bool);
+  void brightnessUpEnabled(bool);
+  void contrastUpEnabled(bool);
+  void zoomEnabled(bool);
+  void colorDownEnabled(bool);
+  void brightnessDownEnabled(bool);
+  void contrastDownEnabled(bool);
+
+private slots:
+  void on_bassUpButton_pressed();
+  void on_bassUpButton_released();
+  void on_trebleUpButton_pressed();
+  void on_trebleUpButton_released();
+  void on_enhancedBassButton_pressed();
+  void on_enhancedBassButton_released();
+  void on_noiseReductionButton_pressed();
+  void on_noiseReductionButton_released();
+  void on_bassDownButton_pressed();
+  void on_bassDownButton_released();
+  void on_trebleDownButton_pressed();
+  void on_trebleDownButton_released();
+  void on_balanceLeftButton_pressed();
+  void on_balanceLeftButton_released();
+  void on_balanceRightButton_pressed();
+  void on_balanceRightButton_released();
+  void on_colorUpButton_pressed();
+  void on_colorUpButton_released();
+  void on_brightnessUpButton_pressed();
+  void on_brightnessUpButton_released();
+  void on_contrastUpButton_pressed();
+  void on_contrastUpButton_released();
+  void on_colorDownButton_pressed();
+  void on_colorDownButton_released();
+  void on_brightnessDownButton_pressed();
+  void on_brightnessDownButton_released();
+  void on_contrastDownButton_pressed();
+  void on_contrastDownButton_released();
+  void on_surroundButton_pressed();
+  void on_surroundButton_released();
+  void on_zoomButton_pressed();
+  void on_zoomButton_released();
+
+private:
+  Ui::PIRAdjustForm *ui;
+
+  MainWindow *mainWindow;
+};
+
+#endif // PIRADJUSTFORM_H
diff --git a/forms/piradjustform.ui b/forms/piradjustform.ui
new file mode 100644 (file)
index 0000000..eee3fbb
--- /dev/null
@@ -0,0 +1,638 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>PIRAdjustForm</class>
+ <widget class="QWidget" name="PIRAdjustForm">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>800</width>
+    <height>480</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>Form</string>
+  </property>
+  <layout class="QGridLayout" name="gridLayout">
+   <property name="leftMargin">
+    <number>8</number>
+   </property>
+   <property name="topMargin">
+    <number>0</number>
+   </property>
+   <property name="rightMargin">
+    <number>8</number>
+   </property>
+   <property name="bottomMargin">
+    <number>8</number>
+   </property>
+   <item row="0" column="0">
+    <widget class="QPushButton" name="bassUpButton">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text">
+      <string>Bass</string>
+     </property>
+     <property name="icon">
+      <iconset resource="../PierogiResources.qrc">
+       <normaloff>:/icons/arrow_top_icon&amp;48.png</normaloff>:/icons/arrow_top_icon&amp;48.png</iconset>
+     </property>
+     <property name="iconSize">
+      <size>
+       <width>48</width>
+       <height>48</height>
+      </size>
+     </property>
+    </widget>
+   </item>
+   <item row="0" column="1">
+    <widget class="QPushButton" name="trebleUpButton">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text">
+      <string>Treble</string>
+     </property>
+     <property name="icon">
+      <iconset resource="../PierogiResources.qrc">
+       <normaloff>:/icons/arrow_top_icon&amp;48.png</normaloff>:/icons/arrow_top_icon&amp;48.png</iconset>
+     </property>
+     <property name="iconSize">
+      <size>
+       <width>48</width>
+       <height>48</height>
+      </size>
+     </property>
+    </widget>
+   </item>
+   <item row="0" column="2">
+    <widget class="QPushButton" name="enhancedBassButton">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text">
+      <string>Enhanced Bass</string>
+     </property>
+    </widget>
+   </item>
+   <item row="0" column="3">
+    <widget class="QPushButton" name="noiseReductionButton">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text">
+      <string>Noise Reduction</string>
+     </property>
+    </widget>
+   </item>
+   <item row="1" column="0">
+    <widget class="QPushButton" name="bassDownButton">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text">
+      <string>Bass</string>
+     </property>
+     <property name="icon">
+      <iconset resource="../PierogiResources.qrc">
+       <normaloff>:/icons/arrow_bottom_icon&amp;48.png</normaloff>:/icons/arrow_bottom_icon&amp;48.png</iconset>
+     </property>
+     <property name="iconSize">
+      <size>
+       <width>48</width>
+       <height>48</height>
+      </size>
+     </property>
+    </widget>
+   </item>
+   <item row="1" column="1">
+    <widget class="QPushButton" name="trebleDownButton">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text">
+      <string>Treble</string>
+     </property>
+     <property name="icon">
+      <iconset resource="../PierogiResources.qrc">
+       <normaloff>:/icons/arrow_bottom_icon&amp;48.png</normaloff>:/icons/arrow_bottom_icon&amp;48.png</iconset>
+     </property>
+     <property name="iconSize">
+      <size>
+       <width>48</width>
+       <height>48</height>
+      </size>
+     </property>
+    </widget>
+   </item>
+   <item row="1" column="2">
+    <widget class="QPushButton" name="balanceLeftButton">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text">
+      <string>Balance</string>
+     </property>
+     <property name="icon">
+      <iconset resource="../PierogiResources.qrc">
+       <normaloff>:/icons/arrow_left_icon&amp;48.png</normaloff>:/icons/arrow_left_icon&amp;48.png</iconset>
+     </property>
+     <property name="iconSize">
+      <size>
+       <width>48</width>
+       <height>48</height>
+      </size>
+     </property>
+    </widget>
+   </item>
+   <item row="1" column="3">
+    <widget class="QPushButton" name="balanceRightButton">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text">
+      <string>Balance</string>
+     </property>
+     <property name="icon">
+      <iconset resource="../PierogiResources.qrc">
+       <normaloff>:/icons/arrow_right_icon&amp;48.png</normaloff>:/icons/arrow_right_icon&amp;48.png</iconset>
+     </property>
+     <property name="iconSize">
+      <size>
+       <width>48</width>
+       <height>48</height>
+      </size>
+     </property>
+    </widget>
+   </item>
+   <item row="2" column="0">
+    <widget class="QPushButton" name="surroundButton">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text">
+      <string>Surround</string>
+     </property>
+    </widget>
+   </item>
+   <item row="2" column="1">
+    <widget class="QPushButton" name="colorUpButton">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text">
+      <string>Color</string>
+     </property>
+     <property name="icon">
+      <iconset resource="../PierogiResources.qrc">
+       <normaloff>:/icons/arrow_top_icon&amp;48.png</normaloff>:/icons/arrow_top_icon&amp;48.png</iconset>
+     </property>
+     <property name="iconSize">
+      <size>
+       <width>48</width>
+       <height>48</height>
+      </size>
+     </property>
+    </widget>
+   </item>
+   <item row="2" column="2">
+    <widget class="QPushButton" name="brightnessUpButton">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text">
+      <string>Brightness</string>
+     </property>
+     <property name="icon">
+      <iconset resource="../PierogiResources.qrc">
+       <normaloff>:/icons/arrow_top_icon&amp;48.png</normaloff>:/icons/arrow_top_icon&amp;48.png</iconset>
+     </property>
+     <property name="iconSize">
+      <size>
+       <width>48</width>
+       <height>48</height>
+      </size>
+     </property>
+    </widget>
+   </item>
+   <item row="2" column="3">
+    <widget class="QPushButton" name="contrastUpButton">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text">
+      <string>Contrast</string>
+     </property>
+     <property name="icon">
+      <iconset resource="../PierogiResources.qrc">
+       <normaloff>:/icons/arrow_top_icon&amp;48.png</normaloff>:/icons/arrow_top_icon&amp;48.png</iconset>
+     </property>
+     <property name="iconSize">
+      <size>
+       <width>48</width>
+       <height>48</height>
+      </size>
+     </property>
+    </widget>
+   </item>
+   <item row="3" column="0">
+    <widget class="QPushButton" name="zoomButton">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text">
+      <string>Zoom</string>
+     </property>
+    </widget>
+   </item>
+   <item row="3" column="1">
+    <widget class="QPushButton" name="colorDownButton">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text">
+      <string>Color</string>
+     </property>
+     <property name="icon">
+      <iconset resource="../PierogiResources.qrc">
+       <normaloff>:/icons/arrow_bottom_icon&amp;48.png</normaloff>:/icons/arrow_bottom_icon&amp;48.png</iconset>
+     </property>
+     <property name="iconSize">
+      <size>
+       <width>48</width>
+       <height>48</height>
+      </size>
+     </property>
+    </widget>
+   </item>
+   <item row="3" column="2">
+    <widget class="QPushButton" name="brightnessDownButton">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text">
+      <string>Brightness</string>
+     </property>
+     <property name="icon">
+      <iconset resource="../PierogiResources.qrc">
+       <normaloff>:/icons/arrow_bottom_icon&amp;48.png</normaloff>:/icons/arrow_bottom_icon&amp;48.png</iconset>
+     </property>
+     <property name="iconSize">
+      <size>
+       <width>48</width>
+       <height>48</height>
+      </size>
+     </property>
+    </widget>
+   </item>
+   <item row="3" column="3">
+    <widget class="QPushButton" name="contrastDownButton">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text">
+      <string>Contrast</string>
+     </property>
+     <property name="icon">
+      <iconset resource="../PierogiResources.qrc">
+       <normaloff>:/icons/arrow_bottom_icon&amp;48.png</normaloff>:/icons/arrow_bottom_icon&amp;48.png</iconset>
+     </property>
+     <property name="iconSize">
+      <size>
+       <width>48</width>
+       <height>48</height>
+      </size>
+     </property>
+    </widget>
+   </item>
+  </layout>
+ </widget>
+ <resources>
+  <include location="../PierogiResources.qrc"/>
+ </resources>
+ <connections>
+  <connection>
+   <sender>PIRAdjustForm</sender>
+   <signal>bassUpEnabled(bool)</signal>
+   <receiver>bassUpButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>102</x>
+     <y>64</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>PIRAdjustForm</sender>
+   <signal>trebleUpEnabled(bool)</signal>
+   <receiver>trebleUpButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>300</x>
+     <y>64</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>PIRAdjustForm</sender>
+   <signal>enhancedBassEnabled(bool)</signal>
+   <receiver>enhancedBassButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>499</x>
+     <y>64</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>PIRAdjustForm</sender>
+   <signal>noiseReductionEnabled(bool)</signal>
+   <receiver>noiseReductionButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>697</x>
+     <y>64</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>PIRAdjustForm</sender>
+   <signal>bassDownEnabled(bool)</signal>
+   <receiver>bassDownButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>102</x>
+     <y>182</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>PIRAdjustForm</sender>
+   <signal>trebleDownEnabled(bool)</signal>
+   <receiver>trebleDownButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>300</x>
+     <y>182</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>PIRAdjustForm</sender>
+   <signal>balanceLeftEnabled(bool)</signal>
+   <receiver>balanceLeftButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>499</x>
+     <y>182</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>PIRAdjustForm</sender>
+   <signal>balanceRightEnabled(bool)</signal>
+   <receiver>balanceRightButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>697</x>
+     <y>182</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>PIRAdjustForm</sender>
+   <signal>surroundEnabled(bool)</signal>
+   <receiver>surroundButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>102</x>
+     <y>301</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>PIRAdjustForm</sender>
+   <signal>colorUpEnabled(bool)</signal>
+   <receiver>colorUpButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>300</x>
+     <y>301</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>PIRAdjustForm</sender>
+   <signal>brightnessUpEnabled(bool)</signal>
+   <receiver>brightnessUpButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>499</x>
+     <y>301</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>PIRAdjustForm</sender>
+   <signal>contrastUpEnabled(bool)</signal>
+   <receiver>contrastUpButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>697</x>
+     <y>301</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>PIRAdjustForm</sender>
+   <signal>zoomEnabled(bool)</signal>
+   <receiver>zoomButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>102</x>
+     <y>419</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>PIRAdjustForm</sender>
+   <signal>colorDownEnabled(bool)</signal>
+   <receiver>colorDownButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>300</x>
+     <y>419</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>PIRAdjustForm</sender>
+   <signal>brightnessDownEnabled(bool)</signal>
+   <receiver>brightnessDownButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>499</x>
+     <y>419</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>PIRAdjustForm</sender>
+   <signal>contrastDownEnabled(bool)</signal>
+   <receiver>contrastDownButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>697</x>
+     <y>419</y>
+    </hint>
+   </hints>
+  </connection>
+ </connections>
+ <slots>
+  <signal>bassUpEnabled(bool)</signal>
+  <signal>trebleUpEnabled(bool)</signal>
+  <signal>enhancedBassEnabled(bool)</signal>
+  <signal>noiseReductionEnabled(bool)</signal>
+  <signal>bassDownEnabled(bool)</signal>
+  <signal>trebleDownEnabled(bool)</signal>
+  <signal>balanceLeftEnabled(bool)</signal>
+  <signal>balanceRightEnabled(bool)</signal>
+  <signal>surroundEnabled(bool)</signal>
+  <signal>colorUpEnabled(bool)</signal>
+  <signal>brightnessUpEnabled(bool)</signal>
+  <signal>contrastUpEnabled(bool)</signal>
+  <signal>zoomEnabled(bool)</signal>
+  <signal>colorDownEnabled(bool)</signal>
+  <signal>brightnessDownEnabled(bool)</signal>
+  <signal>contrastDownEnabled(bool)</signal>
+ </slots>
+</ui>
diff --git a/forms/pirairconditionerform.cpp b/forms/pirairconditionerform.cpp
new file mode 100644 (file)
index 0000000..d2b0555
--- /dev/null
@@ -0,0 +1,157 @@
+#include "pirairconditionerform.h"
+#include "ui_pirairconditionerform.h"
+
+#include "mainwindow.h"
+#include "pirkeysetmanager.h"
+
+PIRAirConditionerForm::PIRAirConditionerForm(MainWindow *mw) :
+  QWidget(0),
+  ui(new Ui::PIRAirConditionerForm),
+  mainWindow(mw)
+{
+  ui->setupUi(this);
+}
+
+PIRAirConditionerForm::~PIRAirConditionerForm()
+{
+  delete ui;
+}
+
+
+void PIRAirConditionerForm::enableButtons(
+  const PIRKeysetManager *keyset,
+  unsigned int id)
+{
+  emit oscillateEnabled(keyset->hasKey(id, Oscillate_Key));
+  emit powerEnabled(keyset->hasKey(id, Power_Key));
+  emit timerEnabled(keyset->hasKey(id, Timer_Key));
+  emit modeEnabled(keyset->hasKey(id, Mode_Key));
+  emit fanFasterEnabled(keyset->hasKey(id, FanFaster_Key));
+  emit heatEnabled(keyset->hasKey(id, Heat_Key));
+  emit fanEnabled(keyset->hasKey(id, Fan_Key));
+  emit tempUpEnabled(keyset->hasKey(id, TempUp_Key));
+  emit fanSlowerEnabled(keyset->hasKey(id, FanSlower_Key));
+  emit energySaveEnabled(keyset->hasKey(id, EnergySave_Key));
+  emit coolEnabled(keyset->hasKey(id, Cool_Key));
+  emit tempDownEnabled(keyset->hasKey(id, TempDown_Key));
+}
+
+void PIRAirConditionerForm::on_oscillateButton_pressed()
+{
+  mainWindow->startRepeating(Oscillate_Key);
+}
+
+void PIRAirConditionerForm::on_oscillateButton_released()
+{
+  mainWindow->stopRepeating();
+}
+
+void PIRAirConditionerForm::on_powerButton_pressed()
+{
+  mainWindow->startRepeating(Power_Key);
+}
+
+void PIRAirConditionerForm::on_powerButton_released()
+{
+  mainWindow->stopRepeating();
+}
+
+void PIRAirConditionerForm::on_timerButton_pressed()
+{
+  mainWindow->startRepeating(Timer_Key);
+}
+
+void PIRAirConditionerForm::on_timerButton_released()
+{
+  mainWindow->stopRepeating();
+}
+
+void PIRAirConditionerForm::on_modeButton_pressed()
+{
+  mainWindow->startRepeating(Mode_Key);
+}
+
+void PIRAirConditionerForm::on_modeButton_released()
+{
+  mainWindow->stopRepeating();
+}
+
+void PIRAirConditionerForm::on_fanFasterButton_pressed()
+{
+  mainWindow->startRepeating(FanFaster_Key);
+}
+
+void PIRAirConditionerForm::on_fanFasterButton_released()
+{
+  mainWindow->stopRepeating();
+}
+
+void PIRAirConditionerForm::on_heatButton_pressed()
+{
+  mainWindow->startRepeating(Heat_Key);
+}
+
+void PIRAirConditionerForm::on_heatButton_released()
+{
+  mainWindow->stopRepeating();
+}
+
+void PIRAirConditionerForm::on_fanButton_pressed()
+{
+  mainWindow->startRepeating(Fan_Key);
+}
+
+void PIRAirConditionerForm::on_fanButton_released()
+{
+  mainWindow->stopRepeating();
+}
+
+void PIRAirConditionerForm::on_tempUpButton_pressed()
+{
+  mainWindow->startRepeating(TempUp_Key);
+}
+
+void PIRAirConditionerForm::on_tempUpButton_released()
+{
+  mainWindow->stopRepeating();
+}
+
+void PIRAirConditionerForm::on_fanSlowerButton_pressed()
+{
+  mainWindow->startRepeating(FanSlower_Key);
+}
+
+void PIRAirConditionerForm::on_fanSlowerButton_released()
+{
+  mainWindow->stopRepeating();
+}
+
+void PIRAirConditionerForm::on_energySaveButton_pressed()
+{
+  mainWindow->startRepeating(EnergySave_Key);
+}
+
+void PIRAirConditionerForm::on_energySaveButton_released()
+{
+  mainWindow->stopRepeating();
+}
+
+void PIRAirConditionerForm::on_coolButton_pressed()
+{
+  mainWindow->startRepeating(Cool_Key);
+}
+
+void PIRAirConditionerForm::on_coolButton_released()
+{
+  mainWindow->stopRepeating();
+}
+
+void PIRAirConditionerForm::on_tempDownButton_pressed()
+{
+  mainWindow->startRepeating(TempDown_Key);
+}
+
+void PIRAirConditionerForm::on_tempDownButton_released()
+{
+  mainWindow->stopRepeating();
+}
diff --git a/forms/pirairconditionerform.h b/forms/pirairconditionerform.h
new file mode 100644 (file)
index 0000000..698e973
--- /dev/null
@@ -0,0 +1,71 @@
+#ifndef PIRAIRCONDITIONERFORM_H
+#define PIRAIRCONDITIONERFORM_H
+
+#include <QWidget>
+
+class MainWindow;
+class PIRKeysetManager;
+
+namespace Ui {
+class PIRAirConditionerForm;
+}
+
+class PIRAirConditionerForm : public QWidget
+{
+  Q_OBJECT
+  
+public:
+  PIRAirConditionerForm(MainWindow *mw);
+  ~PIRAirConditionerForm();
+
+  void enableButtons(
+    const PIRKeysetManager *keyset,
+    unsigned int id);
+
+signals:
+  void oscillateEnabled(bool);
+  void powerEnabled(bool);
+  void timerEnabled(bool);
+  void modeEnabled(bool);
+  void fanFasterEnabled(bool);
+  void heatEnabled(bool);
+  void fanEnabled(bool);
+  void tempUpEnabled(bool);
+  void fanSlowerEnabled(bool);
+  void energySaveEnabled(bool);
+  void coolEnabled(bool);
+  void tempDownEnabled(bool);
+  
+private slots:
+  void on_oscillateButton_pressed();
+  void on_oscillateButton_released();
+  void on_powerButton_pressed();
+  void on_powerButton_released();
+  void on_timerButton_pressed();
+  void on_timerButton_released();
+  void on_modeButton_pressed();
+  void on_modeButton_released();
+  void on_fanFasterButton_pressed();
+  void on_fanFasterButton_released();
+  void on_heatButton_pressed();
+  void on_heatButton_released();
+  void on_fanButton_pressed();
+  void on_fanButton_released();
+  void on_tempUpButton_pressed();
+  void on_tempUpButton_released();
+  void on_fanSlowerButton_pressed();
+  void on_fanSlowerButton_released();
+  void on_energySaveButton_pressed();
+  void on_energySaveButton_released();
+  void on_coolButton_pressed();
+  void on_coolButton_released();
+  void on_tempDownButton_pressed();
+  void on_tempDownButton_released();
+
+private:
+  Ui::PIRAirConditionerForm *ui;
+
+  MainWindow *mainWindow;
+};
+
+#endif // PIRAIRCONDITIONERFORM_H
diff --git a/forms/pirairconditionerform.ui b/forms/pirairconditionerform.ui
new file mode 100644 (file)
index 0000000..2627502
--- /dev/null
@@ -0,0 +1,438 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>PIRAirConditionerForm</class>
+ <widget class="QWidget" name="PIRAirConditionerForm">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>800</width>
+    <height>480</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>Form</string>
+  </property>
+  <layout class="QGridLayout" name="gridLayout">
+   <property name="leftMargin">
+    <number>8</number>
+   </property>
+   <property name="topMargin">
+    <number>0</number>
+   </property>
+   <property name="rightMargin">
+    <number>8</number>
+   </property>
+   <property name="bottomMargin">
+    <number>8</number>
+   </property>
+   <item row="0" column="0">
+    <widget class="QPushButton" name="oscillateButton">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text">
+      <string>Oscillate</string>
+     </property>
+    </widget>
+   </item>
+   <item row="0" column="1">
+    <widget class="QPushButton" name="powerButton">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text">
+      <string>Power</string>
+     </property>
+     <property name="icon">
+      <iconset resource="../PierogiResources.qrc">
+       <normaloff>:/icons/on-off_icon&amp;48.png</normaloff>:/icons/on-off_icon&amp;48.png</iconset>
+     </property>
+     <property name="iconSize">
+      <size>
+       <width>48</width>
+       <height>48</height>
+      </size>
+     </property>
+    </widget>
+   </item>
+   <item row="0" column="2">
+    <widget class="QPushButton" name="timerButton">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text">
+      <string>Timer</string>
+     </property>
+     <property name="icon">
+      <iconset resource="../PierogiResources.qrc">
+       <normaloff>:/icons/clock_icon&amp;48.png</normaloff>:/icons/clock_icon&amp;48.png</iconset>
+     </property>
+     <property name="iconSize">
+      <size>
+       <width>48</width>
+       <height>48</height>
+      </size>
+     </property>
+    </widget>
+   </item>
+   <item row="0" column="3">
+    <widget class="QPushButton" name="modeButton">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text">
+      <string>Mode</string>
+     </property>
+    </widget>
+   </item>
+   <item row="4" column="0">
+    <widget class="QPushButton" name="fanSlowerButton">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text">
+      <string>Fan Slower</string>
+     </property>
+    </widget>
+   </item>
+   <item row="4" column="1">
+    <widget class="QPushButton" name="energySaveButton">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text">
+      <string>EnergySave</string>
+     </property>
+    </widget>
+   </item>
+   <item row="4" column="2">
+    <widget class="QPushButton" name="coolButton">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text">
+      <string>Cool</string>
+     </property>
+    </widget>
+   </item>
+   <item row="4" column="3">
+    <widget class="QPushButton" name="tempDownButton">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Ignored">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text">
+      <string>Temp Down</string>
+     </property>
+     <property name="icon">
+      <iconset resource="../PierogiResources.qrc">
+       <normaloff>:/icons/arrow_bottom_icon&amp;48.png</normaloff>:/icons/arrow_bottom_icon&amp;48.png</iconset>
+     </property>
+     <property name="iconSize">
+      <size>
+       <width>48</width>
+       <height>48</height>
+      </size>
+     </property>
+    </widget>
+   </item>
+   <item row="3" column="2">
+    <widget class="QPushButton" name="fanButton">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text">
+      <string>Fan</string>
+     </property>
+    </widget>
+   </item>
+   <item row="3" column="0">
+    <widget class="QPushButton" name="fanFasterButton">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text">
+      <string>Fan Faster</string>
+     </property>
+    </widget>
+   </item>
+   <item row="3" column="3">
+    <widget class="QPushButton" name="tempUpButton">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text">
+      <string>Temp Up</string>
+     </property>
+     <property name="icon">
+      <iconset resource="../PierogiResources.qrc">
+       <normaloff>:/icons/arrow_top_icon&amp;48.png</normaloff>:/icons/arrow_top_icon&amp;48.png</iconset>
+     </property>
+     <property name="iconSize">
+      <size>
+       <width>48</width>
+       <height>48</height>
+      </size>
+     </property>
+    </widget>
+   </item>
+   <item row="3" column="1">
+    <widget class="QPushButton" name="heatButton">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text">
+      <string>Heat</string>
+     </property>
+    </widget>
+   </item>
+  </layout>
+ </widget>
+ <resources>
+  <include location="../PierogiResources.qrc"/>
+ </resources>
+ <connections>
+  <connection>
+   <sender>PIRAirConditionerForm</sender>
+   <signal>oscillateEnabled(bool)</signal>
+   <receiver>oscillateButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>100</x>
+     <y>79</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>PIRAirConditionerForm</sender>
+   <signal>powerEnabled(bool)</signal>
+   <receiver>powerButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>300</x>
+     <y>79</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>PIRAirConditionerForm</sender>
+   <signal>timerEnabled(bool)</signal>
+   <receiver>timerButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>499</x>
+     <y>79</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>PIRAirConditionerForm</sender>
+   <signal>modeEnabled(bool)</signal>
+   <receiver>modeButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>699</x>
+     <y>79</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>PIRAirConditionerForm</sender>
+   <signal>fanFasterEnabled(bool)</signal>
+   <receiver>fanFasterButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>100</x>
+     <y>239</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>PIRAirConditionerForm</sender>
+   <signal>heatEnabled(bool)</signal>
+   <receiver>heatButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>300</x>
+     <y>239</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>PIRAirConditionerForm</sender>
+   <signal>fanEnabled(bool)</signal>
+   <receiver>fanButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>499</x>
+     <y>239</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>PIRAirConditionerForm</sender>
+   <signal>tempUpEnabled(bool)</signal>
+   <receiver>tempUpButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>699</x>
+     <y>239</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>PIRAirConditionerForm</sender>
+   <signal>fanSlowerEnabled(bool)</signal>
+   <receiver>fanSlowerButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>100</x>
+     <y>400</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>PIRAirConditionerForm</sender>
+   <signal>energySaveEnabled(bool)</signal>
+   <receiver>energySaveButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>300</x>
+     <y>400</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>PIRAirConditionerForm</sender>
+   <signal>coolEnabled(bool)</signal>
+   <receiver>coolButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>499</x>
+     <y>400</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>PIRAirConditionerForm</sender>
+   <signal>tempDownEnabled(bool)</signal>
+   <receiver>tempDownButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>699</x>
+     <y>400</y>
+    </hint>
+   </hints>
+  </connection>
+ </connections>
+ <slots>
+  <signal>oscillateEnabled(bool)</signal>
+  <signal>powerEnabled(bool)</signal>
+  <signal>timerEnabled(bool)</signal>
+  <signal>modeEnabled(bool)</signal>
+  <signal>fanFasterEnabled(bool)</signal>
+  <signal>heatEnabled(bool)</signal>
+  <signal>fanEnabled(bool)</signal>
+  <signal>tempUpEnabled(bool)</signal>
+  <signal>fanSlowerEnabled(bool)</signal>
+  <signal>energySaveEnabled(bool)</signal>
+  <signal>coolEnabled(bool)</signal>
+  <signal>tempDownEnabled(bool)</signal>
+ </slots>
+</ui>
diff --git a/forms/pirfavoritesform.cpp b/forms/pirfavoritesform.cpp
new file mode 100644 (file)
index 0000000..adaa656
--- /dev/null
@@ -0,0 +1,111 @@
+#include "pirfavoritesform.h"
+#include "ui_pirfavoritesform.h"
+
+#include "mainwindow.h"
+//#include "pirkeysetmanager.h"
+#include "pirkeysetwidgetitem.h"
+
+#include <QMaemo5InformationBox>
+
+PIRFavoritesForm::PIRFavoritesForm(
+  MainWindow *mw)
+  : QWidget(0),
+    ui(new Ui::PIRFavoritesForm),
+    mainWindow(mw)
+{
+  ui->setupUi(this);
+}
+
+PIRFavoritesForm::~PIRFavoritesForm()
+{
+  delete ui;
+}
+
+
+void PIRFavoritesForm::selectPrevFavKeyset()
+{
+  int size = ui->favoriteKeysetsWidget->count();
+
+  if (size == 0)
+  {
+    // No favorites, so nothing to do!
+    return;
+  }
+
+  int position = ui->favoriteKeysetsWidget->currentRow();
+
+  --position;
+  if (position < 0)
+  {
+    position = size - 1;
+  }
+
+  ui->favoriteKeysetsWidget->setCurrentRow(
+    position,
+    QItemSelectionModel::ClearAndSelect);
+
+  mainWindow->keysetSelectionChanged(
+    ui->favoriteKeysetsWidget->currentItem());
+
+  // Tell the user about the change:
+  QMaemo5InformationBox::information(
+    0,
+    ui->favoriteKeysetsWidget->item(position)->text());
+}
+
+
+void PIRFavoritesForm::selectNextFavKeyset()
+{
+  int size = ui->favoriteKeysetsWidget->count();
+
+  if (size == 0)
+  {
+    // No favorites, so just return:
+    return;
+  }
+
+  int position = ui->favoriteKeysetsWidget->currentRow();
+
+  ++position;
+  if (position == size)
+  {
+    position = 0;
+  }
+
+  ui->favoriteKeysetsWidget->setCurrentRow(
+    position,
+    QItemSelectionModel::ClearAndSelect);
+
+  mainWindow->keysetSelectionChanged(
+    ui->favoriteKeysetsWidget->currentItem());
+
+  // Tell the user about the change:
+  QMaemo5InformationBox::information(
+    0,
+    ui->favoriteKeysetsWidget->item(position)->text());
+}
+
+
+void PIRFavoritesForm::addItem(
+  PIRKeysetWidgetItem *item)
+{
+  ui->favoriteKeysetsWidget->addItem(item);
+}
+
+
+QListWidget *PIRFavoritesForm::getFavoritesListWidget()
+{
+  return ui->favoriteKeysetsWidget;
+}
+
+
+void PIRFavoritesForm::on_addKeysetButton_clicked()
+{
+  mainWindow->addCurrentKeyset(ui->favoriteKeysetsWidget);
+}
+
+
+void PIRFavoritesForm::on_removeKeysetButton_clicked()
+{
+  mainWindow->removeFavoriteKeyset(ui->favoriteKeysetsWidget);
+}
diff --git a/forms/pirfavoritesform.h b/forms/pirfavoritesform.h
new file mode 100644 (file)
index 0000000..5e86b54
--- /dev/null
@@ -0,0 +1,44 @@
+#ifndef PIRFAVORITESFORM_H
+#define PIRFAVORITESFORM_H
+
+#include <QWidget>
+
+class MainWindow;
+//class PIRKeysetManager;
+class PIRKeysetWidgetItem;
+class QListWidget;
+
+namespace Ui {
+class PIRFavoritesForm;
+}
+
+class PIRFavoritesForm : public QWidget
+{
+  Q_OBJECT
+  
+public:
+//  explicit PIRFavoritesForm(QWidget *parent = 0);
+  PIRFavoritesForm(
+    MainWindow *mw);
+
+  ~PIRFavoritesForm();
+
+  void selectPrevFavKeyset();
+  void selectNextFavKeyset();
+
+  void addItem(
+    PIRKeysetWidgetItem *item);
+
+  QListWidget *getFavoritesListWidget();
+
+private slots:
+  void on_addKeysetButton_clicked();
+  void on_removeKeysetButton_clicked();
+  
+private:
+  Ui::PIRFavoritesForm *ui;
+
+  MainWindow *mainWindow;
+};
+
+#endif // PIRFAVORITESFORM_H
diff --git a/forms/pirfavoritesform.ui b/forms/pirfavoritesform.ui
new file mode 100644 (file)
index 0000000..8aaded9
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>PIRFavoritesForm</class>
+ <widget class="QWidget" name="PIRFavoritesForm">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>800</width>
+    <height>480</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>Form</string>
+  </property>
+  <layout class="QGridLayout" name="gridLayout">
+   <property name="leftMargin">
+    <number>8</number>
+   </property>
+   <property name="topMargin">
+    <number>0</number>
+   </property>
+   <property name="rightMargin">
+    <number>8</number>
+   </property>
+   <property name="bottomMargin">
+    <number>8</number>
+   </property>
+   <item row="0" column="0">
+    <widget class="QPushButton" name="addKeysetButton">
+     <property name="text">
+      <string>Add Current Keyset</string>
+     </property>
+    </widget>
+   </item>
+   <item row="0" column="1">
+    <widget class="QPushButton" name="removeKeysetButton">
+     <property name="text">
+      <string>Remove Selected Keyset</string>
+     </property>
+    </widget>
+   </item>
+   <item row="1" column="0" colspan="2">
+    <widget class="QListWidget" name="favoriteKeysetsWidget"/>
+   </item>
+  </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/forms/pirinputform.cpp b/forms/pirinputform.cpp
new file mode 100644 (file)
index 0000000..acaf555
--- /dev/null
@@ -0,0 +1,158 @@
+#include "pirinputform.h"
+#include "ui_pirinputform.h"
+
+#include "mainwindow.h"
+#include "pirkeysetmanager.h"
+
+PIRInputForm::PIRInputForm(MainWindow *mw)
+  : QWidget(0),
+    ui(new Ui::PIRInputForm),
+    mainWindow(mw)
+{
+  ui->setupUi(this);
+}
+
+PIRInputForm::~PIRInputForm()
+{
+  delete ui;
+}
+
+
+void PIRInputForm::enableButtons(
+  const PIRKeysetManager *keyset,
+  unsigned int id)
+{
+  emit cdInputEnabled(keyset->hasKey(id, CDInput_Key));
+  emit tapeInputEnabled(keyset->hasKey(id, TapeInput_Key));
+  emit phonoInputEnabled(keyset->hasKey(id, PhonoInput_Key));
+  emit tunerInputEnabled(keyset->hasKey(id, TunerInput_Key));
+  emit pcInputEnabled(keyset->hasKey(id, PCInput_Key));
+  emit hdmiInputEnabled(keyset->hasKey(id, HDMIInput_Key));
+  emit dvdInputEnabled(keyset->hasKey(id, DVDInput_Key));
+  emit vcrInputEnabled(keyset->hasKey(id, VCRInput_Key));
+  emit antennaInputEnabled(keyset->hasKey(id, AntennaInput_Key));
+  emit cableInputEnabled(keyset->hasKey(id, CableInput_Key));
+  emit satelliteInputEnabled(keyset->hasKey(id, SatInput_Key));
+  emit auxInputEnabled(keyset->hasKey(id, AuxInput_Key));
+}
+
+
+void PIRInputForm::on_cdInputButton_pressed()
+{
+  mainWindow->startRepeating(CDInput_Key);
+}
+
+void PIRInputForm::on_cdInputButton_released()
+{
+  mainWindow->stopRepeating();
+}
+
+void PIRInputForm::on_tapeInputButton_pressed()
+{
+  mainWindow->startRepeating(TapeInput_Key);
+}
+
+void PIRInputForm::on_tapeInputButton_released()
+{
+  mainWindow->stopRepeating();
+}
+
+void PIRInputForm::on_phonoInputButton_pressed()
+{
+  mainWindow->startRepeating(PhonoInput_Key);
+}
+
+void PIRInputForm::on_phonoInputButton_released()
+{
+  mainWindow->stopRepeating();
+}
+
+void PIRInputForm::on_tunerInputButton_pressed()
+{
+  mainWindow->startRepeating(TunerInput_Key);
+}
+
+void PIRInputForm::on_tunerInputButton_released()
+{
+  mainWindow->stopRepeating();
+}
+
+void PIRInputForm::on_pcInputButton_pressed()
+{
+  mainWindow->startRepeating(PCInput_Key);
+}
+
+void PIRInputForm::on_pcInputButton_released()
+{
+  mainWindow->stopRepeating();
+}
+
+void PIRInputForm::on_hdmiInputButton_pressed()
+{
+  mainWindow->startRepeating(HDMIInput_Key);
+}
+
+void PIRInputForm::on_hdmiInputButton_released()
+{
+  mainWindow->stopRepeating();
+}
+
+void PIRInputForm::on_dvdInputButton_pressed()
+{
+  mainWindow->startRepeating(DVDInput_Key);
+}
+
+void PIRInputForm::on_dvdInputButton_released()
+{
+  mainWindow->stopRepeating();
+}
+
+void PIRInputForm::on_vcrInputButton_pressed()
+{
+  mainWindow->startRepeating(VCRInput_Key);
+}
+
+void PIRInputForm::on_vcrInputButton_released()
+{
+  mainWindow->stopRepeating();
+}
+
+void PIRInputForm::on_antennaInputButton_pressed()
+{
+  mainWindow->startRepeating(AntennaInput_Key);
+}
+
+void PIRInputForm::on_antennaInputButton_released()
+{
+  mainWindow->stopRepeating();
+}
+
+void PIRInputForm::on_cableInputButton_pressed()
+{
+  mainWindow->startRepeating(CableInput_Key);
+}
+
+void PIRInputForm::on_cableInputButton_released()
+{
+  mainWindow->stopRepeating();
+}
+
+void PIRInputForm::on_satelliteInputButton_pressed()
+{
+  mainWindow->startRepeating(SatInput_Key);
+}
+
+void PIRInputForm::on_satelliteInputButton_released()
+{
+  mainWindow->stopRepeating();
+}
+
+void PIRInputForm::on_auxInputButton_pressed()
+{
+  mainWindow->startRepeating(AuxInput_Key);
+}
+
+void PIRInputForm::on_auxInputButton_released()
+{
+  mainWindow->stopRepeating();
+}
diff --git a/forms/pirinputform.h b/forms/pirinputform.h
new file mode 100644 (file)
index 0000000..e87e95d
--- /dev/null
@@ -0,0 +1,71 @@
+#ifndef PIRINPUTFORM_H
+#define PIRINPUTFORM_H
+
+#include <QWidget>
+
+class MainWindow;
+class PIRKeysetManager;
+
+namespace Ui {
+class PIRInputForm;
+}
+
+class PIRInputForm : public QWidget
+{
+  Q_OBJECT
+  
+public:
+  PIRInputForm(MainWindow *mw);
+  ~PIRInputForm();
+
+  void enableButtons(
+    const PIRKeysetManager *keyset,
+    unsigned int id);
+
+signals:
+  void cdInputEnabled(bool);
+  void tapeInputEnabled(bool);
+  void phonoInputEnabled(bool);
+  void tunerInputEnabled(bool);
+  void pcInputEnabled(bool);
+  void hdmiInputEnabled(bool);
+  void dvdInputEnabled(bool);
+  void vcrInputEnabled(bool);
+  void antennaInputEnabled(bool);
+  void cableInputEnabled(bool);
+  void satelliteInputEnabled(bool);
+  void auxInputEnabled(bool);
+
+private slots:
+  void on_cdInputButton_pressed();
+  void on_cdInputButton_released();
+  void on_tapeInputButton_pressed();
+  void on_tapeInputButton_released();
+  void on_phonoInputButton_pressed();
+  void on_phonoInputButton_released();
+  void on_tunerInputButton_pressed();
+  void on_tunerInputButton_released();
+  void on_pcInputButton_pressed();
+  void on_pcInputButton_released();
+  void on_hdmiInputButton_pressed();
+  void on_hdmiInputButton_released();
+  void on_dvdInputButton_pressed();
+  void on_dvdInputButton_released();
+  void on_vcrInputButton_pressed();
+  void on_vcrInputButton_released();
+  void on_antennaInputButton_pressed();
+  void on_antennaInputButton_released();
+  void on_cableInputButton_pressed();
+  void on_cableInputButton_released();
+  void on_satelliteInputButton_pressed();
+  void on_satelliteInputButton_released();
+  void on_auxInputButton_pressed();
+  void on_auxInputButton_released();
+
+private:
+  Ui::PIRInputForm *ui;
+
+  MainWindow *mainWindow;
+};
+
+#endif // PIRINPUTFORM_H
diff --git a/forms/pirinputform.ui b/forms/pirinputform.ui
new file mode 100644 (file)
index 0000000..00fac49
--- /dev/null
@@ -0,0 +1,396 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>PIRInputForm</class>
+ <widget class="QWidget" name="PIRInputForm">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>800</width>
+    <height>480</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>Form</string>
+  </property>
+  <layout class="QGridLayout" name="gridLayout">
+   <property name="leftMargin">
+    <number>8</number>
+   </property>
+   <property name="topMargin">
+    <number>0</number>
+   </property>
+   <property name="rightMargin">
+    <number>8</number>
+   </property>
+   <property name="bottomMargin">
+    <number>8</number>
+   </property>
+   <item row="0" column="0">
+    <widget class="QPushButton" name="cdInputButton">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text">
+      <string>CD</string>
+     </property>
+    </widget>
+   </item>
+   <item row="0" column="1">
+    <widget class="QPushButton" name="tapeInputButton">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text">
+      <string>Tape</string>
+     </property>
+    </widget>
+   </item>
+   <item row="0" column="2">
+    <widget class="QPushButton" name="phonoInputButton">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text">
+      <string>Phono</string>
+     </property>
+    </widget>
+   </item>
+   <item row="0" column="3">
+    <widget class="QPushButton" name="tunerInputButton">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text">
+      <string>Tuner</string>
+     </property>
+    </widget>
+   </item>
+   <item row="1" column="0">
+    <widget class="QPushButton" name="pcInputButton">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text">
+      <string>PC</string>
+     </property>
+    </widget>
+   </item>
+   <item row="1" column="1">
+    <widget class="QPushButton" name="hdmiInputButton">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text">
+      <string>HDMI</string>
+     </property>
+    </widget>
+   </item>
+   <item row="1" column="2">
+    <widget class="QPushButton" name="dvdInputButton">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text">
+      <string>DVD</string>
+     </property>
+    </widget>
+   </item>
+   <item row="1" column="3">
+    <widget class="QPushButton" name="vcrInputButton">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text">
+      <string>VCR</string>
+     </property>
+    </widget>
+   </item>
+   <item row="2" column="0">
+    <widget class="QPushButton" name="antennaInputButton">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text">
+      <string>Antenna</string>
+     </property>
+    </widget>
+   </item>
+   <item row="2" column="1">
+    <widget class="QPushButton" name="cableInputButton">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text">
+      <string>Cable</string>
+     </property>
+    </widget>
+   </item>
+   <item row="2" column="2">
+    <widget class="QPushButton" name="satelliteInputButton">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text">
+      <string>Satellite</string>
+     </property>
+    </widget>
+   </item>
+   <item row="2" column="3">
+    <widget class="QPushButton" name="auxInputButton">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text">
+      <string>Aux</string>
+     </property>
+    </widget>
+   </item>
+  </layout>
+ </widget>
+ <resources/>
+ <connections>
+  <connection>
+   <sender>PIRInputForm</sender>
+   <signal>cdInputEnabled(bool)</signal>
+   <receiver>cdInputButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>102</x>
+     <y>83</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>PIRInputForm</sender>
+   <signal>tapeInputEnabled(bool)</signal>
+   <receiver>tapeInputButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>300</x>
+     <y>83</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>PIRInputForm</sender>
+   <signal>phonoInputEnabled(bool)</signal>
+   <receiver>phonoInputButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>499</x>
+     <y>83</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>PIRInputForm</sender>
+   <signal>tunerInputEnabled(bool)</signal>
+   <receiver>tunerInputButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>697</x>
+     <y>83</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>PIRInputForm</sender>
+   <signal>pcInputEnabled(bool)</signal>
+   <receiver>pcInputButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>102</x>
+     <y>241</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>PIRInputForm</sender>
+   <signal>hdmiInputEnabled(bool)</signal>
+   <receiver>hdmiInputButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>300</x>
+     <y>241</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>PIRInputForm</sender>
+   <signal>dvdInputEnabled(bool)</signal>
+   <receiver>dvdInputButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>499</x>
+     <y>241</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>PIRInputForm</sender>
+   <signal>vcrInputEnabled(bool)</signal>
+   <receiver>vcrInputButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>697</x>
+     <y>241</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>PIRInputForm</sender>
+   <signal>antennaInputEnabled(bool)</signal>
+   <receiver>antennaInputButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>102</x>
+     <y>399</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>PIRInputForm</sender>
+   <signal>cableInputEnabled(bool)</signal>
+   <receiver>cableInputButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>300</x>
+     <y>399</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>PIRInputForm</sender>
+   <signal>satelliteInputEnabled(bool)</signal>
+   <receiver>satelliteInputButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>499</x>
+     <y>399</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>PIRInputForm</sender>
+   <signal>auxInputEnabled(bool)</signal>
+   <receiver>auxInputButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>697</x>
+     <y>399</y>
+    </hint>
+   </hints>
+  </connection>
+ </connections>
+ <slots>
+  <signal>cdInputEnabled(bool)</signal>
+  <signal>tapeInputEnabled(bool)</signal>
+  <signal>phonoInputEnabled(bool)</signal>
+  <signal>tunerInputEnabled(bool)</signal>
+  <signal>pcInputEnabled(bool)</signal>
+  <signal>hdmiInputEnabled(bool)</signal>
+  <signal>dvdInputEnabled(bool)</signal>
+  <signal>vcrInputEnabled(bool)</signal>
+  <signal>antennaInputEnabled(bool)</signal>
+  <signal>cableInputEnabled(bool)</signal>
+  <signal>satelliteInputEnabled(bool)</signal>
+  <signal>auxInputEnabled(bool)</signal>
+ </slots>
+</ui>
diff --git a/forms/pirkeypadform.cpp b/forms/pirkeypadform.cpp
new file mode 100644 (file)
index 0000000..db03cd0
--- /dev/null
@@ -0,0 +1,202 @@
+#include "pirkeypadform.h"
+#include "ui_pirkeypadform.h"
+
+#include "mainwindow.h"
+#include "pirkeysetmanager.h"
+
+PIRKeypadForm::PIRKeypadForm(MainWindow *mw) :
+  QWidget(0),
+  ui(new Ui::PIRKeypadForm),
+  mainWindow(mw)
+{
+  ui->setupUi(this);
+}
+
+PIRKeypadForm::~PIRKeypadForm()
+{
+  delete ui;
+}
+
+
+void PIRKeypadForm::enableButtons(
+  const PIRKeysetManager *keyset,
+  unsigned int id)
+{
+  emit zeroEnabled(keyset->hasKey(id, Zero_Key));
+  emit oneEnabled(keyset->hasKey(id, One_Key));
+  emit twoEnabled(keyset->hasKey(id, Two_Key));
+  emit threeEnabled(keyset->hasKey(id, Three_Key));
+  emit fourEnabled(keyset->hasKey(id, Four_Key));
+  emit fiveEnabled(keyset->hasKey(id, Five_Key));
+  emit sixEnabled(keyset->hasKey(id, Six_Key));
+  emit sevenEnabled(keyset->hasKey(id, Seven_Key));
+  emit eightEnabled(keyset->hasKey(id, Eight_Key));
+  emit nineEnabled(keyset->hasKey(id, Nine_Key));
+  emit enterEnabled(keyset->hasKey(id, Enter_Key));
+  emit clearEnabled(keyset->hasKey(id, Clear_Key));
+  emit dashEnabled(keyset->hasKey(id, Dash_Key));
+  emit plusOneHundredEnabled(keyset->hasKey(id, PlusOneHundred_Key));
+  emit doubleDigitEnabled(keyset->hasKey(id, DoubleDigit_Key));
+  emit prevChannelEnabled(keyset->hasKey(id, PrevChannel_Key));
+}
+
+
+void PIRKeypadForm::on_oneButton_pressed()
+{
+  mainWindow->startRepeating(One_Key);
+}
+
+void PIRKeypadForm::on_oneButton_released()
+{
+  mainWindow->stopRepeating();
+}
+
+void PIRKeypadForm::on_twoButton_pressed()
+{
+  mainWindow->startRepeating(Two_Key);
+}
+
+void PIRKeypadForm::on_twoButton_released()
+{
+  mainWindow->stopRepeating();
+}
+
+void PIRKeypadForm::on_threeButton_pressed()
+{
+  mainWindow->startRepeating(Three_Key);
+}
+
+void PIRKeypadForm::on_threeButton_released()
+{
+  mainWindow->stopRepeating();
+}
+
+void PIRKeypadForm::on_fourButton_pressed()
+{
+  mainWindow->startRepeating(Four_Key);
+}
+
+void PIRKeypadForm::on_fourButton_released()
+{
+  mainWindow->stopRepeating();
+}
+
+void PIRKeypadForm::on_fiveButton_pressed()
+{
+  mainWindow->startRepeating(Five_Key);
+}
+
+void PIRKeypadForm::on_fiveButton_released()
+{
+  mainWindow->stopRepeating();
+}
+
+void PIRKeypadForm::on_sixButton_pressed()
+{
+  mainWindow->startRepeating(Six_Key);
+}
+
+void PIRKeypadForm::on_sixButton_released()
+{
+  mainWindow->stopRepeating();
+}
+
+void PIRKeypadForm::on_sevenButton_pressed()
+{
+  mainWindow->startRepeating(Seven_Key);
+}
+
+void PIRKeypadForm::on_sevenButton_released()
+{
+  mainWindow->stopRepeating();
+}
+
+void PIRKeypadForm::on_eightButton_pressed()
+{
+  mainWindow->startRepeating(Eight_Key);
+}
+
+void PIRKeypadForm::on_eightButton_released()
+{
+  mainWindow->stopRepeating();
+}
+
+void PIRKeypadForm::on_nineButton_pressed()
+{
+  mainWindow->startRepeating(Nine_Key);
+}
+
+void PIRKeypadForm::on_nineButton_released()
+{
+  mainWindow->stopRepeating();
+}
+
+void PIRKeypadForm::on_zeroButton_pressed()
+{
+  mainWindow->startRepeating(Zero_Key);
+}
+
+void PIRKeypadForm::on_zeroButton_released()
+{
+  mainWindow->stopRepeating();
+}
+
+void PIRKeypadForm::on_enterButton_pressed()
+{
+  mainWindow->startRepeating(Enter_Key);
+}
+
+void PIRKeypadForm::on_enterButton_released()
+{
+  mainWindow->stopRepeating();
+}
+
+void PIRKeypadForm::on_clearButton_pressed()
+{
+  mainWindow->startRepeating(Clear_Key);
+}
+
+void PIRKeypadForm::on_clearButton_released()
+{
+  mainWindow->stopRepeating();
+}
+
+void PIRKeypadForm::on_prevChannelButton_pressed()
+{
+  mainWindow->startRepeating(PrevChannel_Key);
+}
+
+void PIRKeypadForm::on_prevChannelButton_released()
+{
+  mainWindow->stopRepeating();
+}
+
+void PIRKeypadForm::on_plusOneHundredButton_pressed()
+{
+  mainWindow->startRepeating(PlusOneHundred_Key);
+}
+
+void PIRKeypadForm::on_plusOneHundredButton_released()
+{
+  mainWindow->stopRepeating();
+}
+
+void PIRKeypadForm::on_dashButton_pressed()
+{
+  mainWindow->startRepeating(Dash_Key);
+}
+
+void PIRKeypadForm::on_dashButton_released()
+{
+  mainWindow->stopRepeating();
+}
+
+void PIRKeypadForm::on_doubleDigitButton_pressed()
+{
+  mainWindow->startRepeating(DoubleDigit_Key);
+}
+
+void PIRKeypadForm::on_doubleDigitButton_released()
+{
+  mainWindow->stopRepeating();
+}
diff --git a/forms/pirkeypadform.h b/forms/pirkeypadform.h
new file mode 100644 (file)
index 0000000..7fec8b2
--- /dev/null
@@ -0,0 +1,84 @@
+#ifndef PIRKEYPADFORM_H
+#define PIRKEYPADFORM_H
+
+#include <QWidget>
+
+class MainWindow;
+class PIRKeysetManager;
+
+namespace Ui {
+class PIRKeypadForm;
+}
+
+class PIRKeypadForm : public QWidget
+{
+  Q_OBJECT
+
+public:
+//  explicit PIRKeypadForm(QWidget *parent = 0);
+  PIRKeypadForm(MainWindow *mw);
+  ~PIRKeypadForm();
+
+  void enableButtons(
+    const PIRKeysetManager *keyset,
+    unsigned int id);
+
+signals:
+  void zeroEnabled(bool);
+  void oneEnabled(bool);
+  void twoEnabled(bool);
+  void threeEnabled(bool);
+  void fourEnabled(bool);
+  void fiveEnabled(bool);
+  void sixEnabled(bool);
+  void sevenEnabled(bool);
+  void eightEnabled(bool);
+  void nineEnabled(bool);
+  void enterEnabled(bool);
+  void clearEnabled(bool);
+  void dashEnabled(bool);
+  void plusOneHundredEnabled(bool);
+  void doubleDigitEnabled(bool);
+  void prevChannelEnabled(bool);
+
+private slots:
+  void on_oneButton_pressed();
+  void on_oneButton_released();
+  void on_twoButton_pressed();
+  void on_twoButton_released();
+  void on_threeButton_pressed();
+  void on_threeButton_released();
+  void on_fourButton_pressed();
+  void on_fourButton_released();
+  void on_fiveButton_pressed();
+  void on_fiveButton_released();
+  void on_sixButton_pressed();
+  void on_sixButton_released();
+  void on_sevenButton_pressed();
+  void on_sevenButton_released();
+  void on_eightButton_pressed();
+  void on_eightButton_released();
+  void on_nineButton_pressed();
+  void on_nineButton_released();
+  void on_zeroButton_pressed();
+  void on_zeroButton_released();
+  void on_enterButton_pressed();
+  void on_enterButton_released();
+  void on_clearButton_pressed();
+  void on_clearButton_released();
+  void on_prevChannelButton_pressed();
+  void on_prevChannelButton_released();
+  void on_plusOneHundredButton_pressed();
+  void on_plusOneHundredButton_released();
+  void on_dashButton_pressed();
+  void on_dashButton_released();
+  void on_doubleDigitButton_pressed();
+  void on_doubleDigitButton_released();
+
+private:
+  Ui::PIRKeypadForm *ui;
+
+  MainWindow *mainWindow;
+};
+
+#endif // PIRKEYPADFORM_H
diff --git a/forms/pirkeypadform.ui b/forms/pirkeypadform.ui
new file mode 100644 (file)
index 0000000..825519a
--- /dev/null
@@ -0,0 +1,534 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>PIRKeypadForm</class>
+ <widget class="QWidget" name="PIRKeypadForm">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>800</width>
+    <height>480</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>Form</string>
+  </property>
+  <layout class="QGridLayout" name="gridLayout">
+   <property name="leftMargin">
+    <number>8</number>
+   </property>
+   <property name="topMargin">
+    <number>0</number>
+   </property>
+   <property name="rightMargin">
+    <number>8</number>
+   </property>
+   <property name="bottomMargin">
+    <number>8</number>
+   </property>
+   <item row="0" column="0">
+    <widget class="QPushButton" name="oneButton">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text">
+      <string>1</string>
+     </property>
+    </widget>
+   </item>
+   <item row="0" column="1">
+    <widget class="QPushButton" name="twoButton">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text">
+      <string>2</string>
+     </property>
+    </widget>
+   </item>
+   <item row="0" column="2">
+    <widget class="QPushButton" name="threeButton">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text">
+      <string>3</string>
+     </property>
+    </widget>
+   </item>
+   <item row="0" column="3">
+    <widget class="QPushButton" name="dashButton">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text">
+      <string>Dash</string>
+     </property>
+     <property name="icon">
+      <iconset resource="../PierogiResources.qrc">
+       <normaloff>:/icons/dash.png</normaloff>:/icons/dash.png</iconset>
+     </property>
+     <property name="iconSize">
+      <size>
+       <width>48</width>
+       <height>48</height>
+      </size>
+     </property>
+    </widget>
+   </item>
+   <item row="1" column="0">
+    <widget class="QPushButton" name="fourButton">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text">
+      <string>4</string>
+     </property>
+    </widget>
+   </item>
+   <item row="1" column="1">
+    <widget class="QPushButton" name="fiveButton">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text">
+      <string>5</string>
+     </property>
+    </widget>
+   </item>
+   <item row="1" column="2">
+    <widget class="QPushButton" name="sixButton">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text">
+      <string>6</string>
+     </property>
+    </widget>
+   </item>
+   <item row="1" column="3">
+    <widget class="QPushButton" name="plusOneHundredButton">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text">
+      <string>+100</string>
+     </property>
+    </widget>
+   </item>
+   <item row="2" column="0">
+    <widget class="QPushButton" name="sevenButton">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text">
+      <string>7</string>
+     </property>
+    </widget>
+   </item>
+   <item row="2" column="1">
+    <widget class="QPushButton" name="eightButton">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text">
+      <string>8</string>
+     </property>
+    </widget>
+   </item>
+   <item row="2" column="2">
+    <widget class="QPushButton" name="nineButton">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text">
+      <string>9</string>
+     </property>
+    </widget>
+   </item>
+   <item row="2" column="3">
+    <widget class="QPushButton" name="doubleDigitButton">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text">
+      <string>-/-- Double Digit</string>
+     </property>
+    </widget>
+   </item>
+   <item row="3" column="0">
+    <widget class="QPushButton" name="clearButton">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text">
+      <string>Clear</string>
+     </property>
+     <property name="iconSize">
+      <size>
+       <width>48</width>
+       <height>48</height>
+      </size>
+     </property>
+    </widget>
+   </item>
+   <item row="3" column="1">
+    <widget class="QPushButton" name="zeroButton">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text">
+      <string>0</string>
+     </property>
+    </widget>
+   </item>
+   <item row="3" column="2">
+    <widget class="QPushButton" name="enterButton">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text">
+      <string>Enter</string>
+     </property>
+    </widget>
+   </item>
+   <item row="3" column="3">
+    <widget class="QPushButton" name="prevChannelButton">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text">
+      <string>Prev Channel</string>
+     </property>
+    </widget>
+   </item>
+  </layout>
+ </widget>
+ <resources>
+  <include location="../PierogiResources.qrc"/>
+ </resources>
+ <connections>
+  <connection>
+   <sender>PIRKeypadForm</sender>
+   <signal>oneEnabled(bool)</signal>
+   <receiver>oneButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>102</x>
+     <y>64</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>PIRKeypadForm</sender>
+   <signal>twoEnabled(bool)</signal>
+   <receiver>twoButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>300</x>
+     <y>64</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>PIRKeypadForm</sender>
+   <signal>threeEnabled(bool)</signal>
+   <receiver>threeButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>499</x>
+     <y>64</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>PIRKeypadForm</sender>
+   <signal>fourEnabled(bool)</signal>
+   <receiver>fourButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>102</x>
+     <y>182</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>PIRKeypadForm</sender>
+   <signal>fiveEnabled(bool)</signal>
+   <receiver>fiveButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>300</x>
+     <y>182</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>PIRKeypadForm</sender>
+   <signal>sixEnabled(bool)</signal>
+   <receiver>sixButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>499</x>
+     <y>182</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>PIRKeypadForm</sender>
+   <signal>sevenEnabled(bool)</signal>
+   <receiver>sevenButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>102</x>
+     <y>301</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>PIRKeypadForm</sender>
+   <signal>eightEnabled(bool)</signal>
+   <receiver>eightButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>300</x>
+     <y>301</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>PIRKeypadForm</sender>
+   <signal>nineEnabled(bool)</signal>
+   <receiver>nineButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>499</x>
+     <y>301</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>PIRKeypadForm</sender>
+   <signal>zeroEnabled(bool)</signal>
+   <receiver>zeroButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>300</x>
+     <y>419</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>PIRKeypadForm</sender>
+   <signal>clearEnabled(bool)</signal>
+   <receiver>clearButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>102</x>
+     <y>419</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>PIRKeypadForm</sender>
+   <signal>enterEnabled(bool)</signal>
+   <receiver>enterButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>499</x>
+     <y>419</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>PIRKeypadForm</sender>
+   <signal>dashEnabled(bool)</signal>
+   <receiver>dashButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>697</x>
+     <y>64</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>PIRKeypadForm</sender>
+   <signal>plusOneHundredEnabled(bool)</signal>
+   <receiver>plusOneHundredButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>697</x>
+     <y>182</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>PIRKeypadForm</sender>
+   <signal>doubleDigitEnabled(bool)</signal>
+   <receiver>doubleDigitButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>697</x>
+     <y>301</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>PIRKeypadForm</sender>
+   <signal>prevChannelEnabled(bool)</signal>
+   <receiver>prevChannelButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>697</x>
+     <y>419</y>
+    </hint>
+   </hints>
+  </connection>
+ </connections>
+ <slots>
+  <signal>oneEnabled(bool)</signal>
+  <signal>twoEnabled(bool)</signal>
+  <signal>threeEnabled(bool)</signal>
+  <signal>fourEnabled(bool)</signal>
+  <signal>fiveEnabled(bool)</signal>
+  <signal>sixEnabled(bool)</signal>
+  <signal>sevenEnabled(bool)</signal>
+  <signal>eightEnabled(bool)</signal>
+  <signal>nineEnabled(bool)</signal>
+  <signal>zeroEnabled(bool)</signal>
+  <signal>clearEnabled(bool)</signal>
+  <signal>enterEnabled(bool)</signal>
+  <signal>dashEnabled(bool)</signal>
+  <signal>plusOneHundredEnabled(bool)</signal>
+  <signal>doubleDigitEnabled(bool)</signal>
+  <signal>prevChannelEnabled(bool)</signal>
+ </slots>
+</ui>
diff --git a/forms/pirmainform.cpp b/forms/pirmainform.cpp
new file mode 100644 (file)
index 0000000..6fcc2ea
--- /dev/null
@@ -0,0 +1,100 @@
+#include "pirmainform.h"
+#include "ui_pirmainform.h"
+
+#include "mainwindow.h"
+#include "pirkeysetmanager.h"
+
+// Ugly global:
+extern PIRMakeMgr makeManager;
+
+
+PIRMainForm::PIRMainForm(
+  MainWindow *mw)
+  : QWidget(0),
+    ui(new Ui::PIRMainForm),
+    mainWindow(mw)
+{
+  ui->setupUi(this);
+}
+
+PIRMainForm::~PIRMainForm()
+{
+  delete ui;
+}
+
+
+void PIRMainForm::enableButtons(
+  const PIRKeysetManager *keyset,
+  unsigned int id)
+{
+  emit powerEnabled(keyset->hasKey(id, Power_Key));
+  emit volumeUpEnabled(keyset->hasKey(id, VolumeUp_Key));
+  emit volumeDownEnabled(keyset->hasKey(id, VolumeDown_Key));
+  emit channelUpEnabled(keyset->hasKey(id, ChannelUp_Key));
+  emit channelDownEnabled(keyset->hasKey(id, ChannelDown_Key));
+  emit muteEnabled(keyset->hasKey(id, Mute_Key));
+
+  emit keysetMakeChanged(makeManager.getMakeString(keyset->getMake(id)));
+  emit keysetNameChanged(keyset->getDisplayName(id));
+}
+
+
+void PIRMainForm::on_powerButton_pressed()
+{
+  mainWindow->startRepeating(Power_Key);
+}
+
+void PIRMainForm::on_powerButton_released()
+{
+  mainWindow->stopRepeating();
+}
+
+void PIRMainForm::on_mainChannelUpButton_pressed()
+{
+  mainWindow->startRepeating(ChannelUp_Key);
+}
+
+void PIRMainForm::on_mainChannelUpButton_released()
+{
+  mainWindow->stopRepeating();
+}
+
+void PIRMainForm::on_mainChannelDownButton_pressed()
+{
+  mainWindow->startRepeating(ChannelDown_Key);
+}
+
+void PIRMainForm::on_mainChannelDownButton_released()
+{
+  mainWindow->stopRepeating();
+}
+
+void PIRMainForm::on_mainVolumeUp_pressed()
+{
+  mainWindow->startRepeating(VolumeUp_Key);
+}
+
+void PIRMainForm::on_mainVolumeUp_released()
+{
+  mainWindow->stopRepeating();
+}
+
+void PIRMainForm::on_mainVolumeDownButton_pressed()
+{
+  mainWindow->startRepeating(VolumeDown_Key);
+}
+
+void PIRMainForm::on_mainVolumeDownButton_released()
+{
+  mainWindow->stopRepeating();
+}
+
+void PIRMainForm::on_muteButton_pressed()
+{
+  mainWindow->startRepeating(Mute_Key);
+}
+
+void PIRMainForm::on_muteButton_released()
+{
+  mainWindow->stopRepeating();
+}
diff --git a/forms/pirmainform.h b/forms/pirmainform.h
new file mode 100644 (file)
index 0000000..125ed17
--- /dev/null
@@ -0,0 +1,57 @@
+#ifndef PIRMAINFORM_H
+#define PIRMAINFORM_H
+
+#include <QWidget>
+
+class MainWindow;
+class PIRKeysetManager;
+
+namespace Ui {
+class PIRMainForm;
+}
+
+class PIRMainForm : public QWidget
+{
+  Q_OBJECT
+
+public:
+//  explicit PIRMainForm(QWidget *parent = 0);
+  PIRMainForm(MainWindow *mw);
+  ~PIRMainForm();
+
+  void enableButtons(
+    const PIRKeysetManager *keyset,
+    unsigned int id);
+
+signals:
+  void powerEnabled(bool);
+  void volumeUpEnabled(bool);
+  void volumeDownEnabled(bool);
+  void channelUpEnabled(bool);
+  void channelDownEnabled(bool);
+  void muteEnabled(bool);
+
+  void keysetMakeChanged(QString);
+  void keysetNameChanged(QString);
+
+private slots:
+  void on_powerButton_pressed();
+  void on_powerButton_released();
+  void on_mainChannelUpButton_pressed();
+  void on_mainChannelUpButton_released();
+  void on_mainChannelDownButton_pressed();
+  void on_mainChannelDownButton_released();
+  void on_mainVolumeUp_pressed();
+  void on_mainVolumeUp_released();
+  void on_mainVolumeDownButton_pressed();
+  void on_mainVolumeDownButton_released();
+  void on_muteButton_pressed();
+  void on_muteButton_released();
+
+private:
+  Ui::PIRMainForm *ui;
+
+  MainWindow *mainWindow;
+};
+
+#endif // PIRMAINFORM_H
diff --git a/forms/pirmainform.ui b/forms/pirmainform.ui
new file mode 100644 (file)
index 0000000..d27c99b
--- /dev/null
@@ -0,0 +1,392 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>PIRMainForm</class>
+ <widget class="QWidget" name="PIRMainForm">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>800</width>
+    <height>480</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>Form</string>
+  </property>
+  <layout class="QGridLayout" name="gridLayout">
+   <property name="leftMargin">
+    <number>8</number>
+   </property>
+   <property name="topMargin">
+    <number>0</number>
+   </property>
+   <property name="rightMargin">
+    <number>8</number>
+   </property>
+   <property name="bottomMargin">
+    <number>8</number>
+   </property>
+   <item row="0" column="0">
+    <widget class="QPushButton" name="mainChannelUpButton">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text">
+      <string>Channel Up</string>
+     </property>
+     <property name="icon">
+      <iconset resource="../PierogiResources.qrc">
+       <normaloff>:/icons/br_up_icon&amp;48.png</normaloff>:/icons/br_up_icon&amp;48.png</iconset>
+     </property>
+     <property name="iconSize">
+      <size>
+       <width>48</width>
+       <height>48</height>
+      </size>
+     </property>
+    </widget>
+   </item>
+   <item row="0" column="1" rowspan="2">
+    <layout class="QVBoxLayout" name="verticalLayout_2">
+     <property name="spacing">
+      <number>-1</number>
+     </property>
+     <property name="leftMargin">
+      <number>0</number>
+     </property>
+     <item>
+      <widget class="QPushButton" name="powerButton">
+       <property name="sizePolicy">
+        <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+         <horstretch>0</horstretch>
+         <verstretch>0</verstretch>
+        </sizepolicy>
+       </property>
+       <property name="layoutDirection">
+        <enum>Qt::LeftToRight</enum>
+       </property>
+       <property name="text">
+        <string>Power</string>
+       </property>
+       <property name="icon">
+        <iconset resource="../PierogiResources.qrc">
+         <normaloff>:/icons/on-off_icon&amp;48.png</normaloff>:/icons/on-off_icon&amp;48.png</iconset>
+       </property>
+       <property name="iconSize">
+        <size>
+         <width>48</width>
+         <height>48</height>
+        </size>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <spacer name="verticalSpacer">
+       <property name="orientation">
+        <enum>Qt::Vertical</enum>
+       </property>
+       <property name="sizeType">
+        <enum>QSizePolicy::Minimum</enum>
+       </property>
+       <property name="sizeHint" stdset="0">
+        <size>
+         <width>20</width>
+         <height>20</height>
+        </size>
+       </property>
+      </spacer>
+     </item>
+     <item>
+      <widget class="QLabel" name="makeLabel">
+       <property name="sizePolicy">
+        <sizepolicy hsizetype="Preferred" vsizetype="Minimum">
+         <horstretch>0</horstretch>
+         <verstretch>0</verstretch>
+        </sizepolicy>
+       </property>
+       <property name="text">
+        <string>Keyset Make</string>
+       </property>
+       <property name="alignment">
+        <set>Qt::AlignCenter</set>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <widget class="QLabel" name="nameLabel">
+       <property name="sizePolicy">
+        <sizepolicy hsizetype="Preferred" vsizetype="Minimum">
+         <horstretch>0</horstretch>
+         <verstretch>0</verstretch>
+        </sizepolicy>
+       </property>
+       <property name="text">
+        <string>Keyset Name</string>
+       </property>
+       <property name="alignment">
+        <set>Qt::AlignCenter</set>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <spacer name="verticalSpacer_2">
+       <property name="orientation">
+        <enum>Qt::Vertical</enum>
+       </property>
+       <property name="sizeType">
+        <enum>QSizePolicy::Minimum</enum>
+       </property>
+       <property name="sizeHint" stdset="0">
+        <size>
+         <width>20</width>
+         <height>20</height>
+        </size>
+       </property>
+      </spacer>
+     </item>
+     <item>
+      <widget class="QPushButton" name="muteButton">
+       <property name="sizePolicy">
+        <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+         <horstretch>0</horstretch>
+         <verstretch>0</verstretch>
+        </sizepolicy>
+       </property>
+       <property name="text">
+        <string>Mute</string>
+       </property>
+       <property name="icon">
+        <iconset resource="../PierogiResources.qrc">
+         <normaloff>:/icons/sound_mute_icon&amp;48.png</normaloff>:/icons/sound_mute_icon&amp;48.png</iconset>
+       </property>
+       <property name="iconSize">
+        <size>
+         <width>48</width>
+         <height>48</height>
+        </size>
+       </property>
+      </widget>
+     </item>
+    </layout>
+   </item>
+   <item row="0" column="2">
+    <widget class="QPushButton" name="mainVolumeUp">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="layoutDirection">
+      <enum>Qt::LeftToRight</enum>
+     </property>
+     <property name="text">
+      <string>Volume Up</string>
+     </property>
+     <property name="icon">
+      <iconset resource="../PierogiResources.qrc">
+       <normaloff>:/icons/sound_high_icon&amp;48.png</normaloff>:/icons/sound_high_icon&amp;48.png</iconset>
+     </property>
+     <property name="iconSize">
+      <size>
+       <width>48</width>
+       <height>48</height>
+      </size>
+     </property>
+    </widget>
+   </item>
+   <item row="1" column="0">
+    <widget class="QPushButton" name="mainChannelDownButton">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text">
+      <string>Channel Down</string>
+     </property>
+     <property name="icon">
+      <iconset resource="../PierogiResources.qrc">
+       <normaloff>:/icons/br_down_icon&amp;48.png</normaloff>:/icons/br_down_icon&amp;48.png</iconset>
+     </property>
+     <property name="iconSize">
+      <size>
+       <width>48</width>
+       <height>48</height>
+      </size>
+     </property>
+    </widget>
+   </item>
+   <item row="1" column="2">
+    <widget class="QPushButton" name="mainVolumeDownButton">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text">
+      <string>Volume Down</string>
+     </property>
+     <property name="icon">
+      <iconset resource="../PierogiResources.qrc">
+       <normaloff>:/icons/sound_low_icon&amp;48.png</normaloff>:/icons/sound_low_icon&amp;48.png</iconset>
+     </property>
+     <property name="iconSize">
+      <size>
+       <width>48</width>
+       <height>48</height>
+      </size>
+     </property>
+    </widget>
+   </item>
+  </layout>
+ </widget>
+ <resources>
+  <include location="../PierogiResources.qrc"/>
+ </resources>
+ <connections>
+  <connection>
+   <sender>PIRMainForm</sender>
+   <signal>channelUpEnabled(bool)</signal>
+   <receiver>mainChannelUpButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>135</x>
+     <y>123</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>PIRMainForm</sender>
+   <signal>channelDownEnabled(bool)</signal>
+   <receiver>mainChannelDownButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>135</x>
+     <y>360</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>PIRMainForm</sender>
+   <signal>muteEnabled(bool)</signal>
+   <receiver>muteButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>399</x>
+     <y>383</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>PIRMainForm</sender>
+   <signal>powerEnabled(bool)</signal>
+   <receiver>powerButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>399</x>
+     <y>96</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>PIRMainForm</sender>
+   <signal>volumeUpEnabled(bool)</signal>
+   <receiver>mainVolumeUp</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>664</x>
+     <y>123</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>PIRMainForm</sender>
+   <signal>volumeDownEnabled(bool)</signal>
+   <receiver>mainVolumeDownButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>664</x>
+     <y>360</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>PIRMainForm</sender>
+   <signal>keysetMakeChanged(QString)</signal>
+   <receiver>makeLabel</receiver>
+   <slot>setText(QString)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>399</x>
+     <y>224</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>PIRMainForm</sender>
+   <signal>keysetNameChanged(QString)</signal>
+   <receiver>nameLabel</receiver>
+   <slot>setText(QString)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>399</x>
+     <y>250</y>
+    </hint>
+   </hints>
+  </connection>
+ </connections>
+ <slots>
+  <signal>channelUpEnabled(bool)</signal>
+  <signal>channelDownEnabled(bool)</signal>
+  <signal>powerEnabled(bool)</signal>
+  <signal>muteEnabled(bool)</signal>
+  <signal>volumeUpEnabled(bool)</signal>
+  <signal>volumeDownEnabled(bool)</signal>
+  <signal>keysetMakeChanged(QString)</signal>
+  <signal>keysetNameChanged(QString)</signal>
+ </slots>
+</ui>
diff --git a/forms/pirmedia2form.cpp b/forms/pirmedia2form.cpp
new file mode 100644 (file)
index 0000000..0020cd5
--- /dev/null
@@ -0,0 +1,202 @@
+#include "pirmedia2form.h"
+#include "ui_pirmedia2form.h"
+
+#include "mainwindow.h"
+#include "pirkeysetmanager.h"
+
+PIRMedia2Form::PIRMedia2Form(MainWindow *mw)
+  : QWidget(0),
+    ui(new Ui::PIRMedia2Form),
+    mainWindow(mw)
+{
+  ui->setupUi(this);
+}
+
+PIRMedia2Form::~PIRMedia2Form()
+{
+  delete ui;
+}
+
+
+void PIRMedia2Form::enableButtons(
+  const PIRKeysetManager *km,
+  unsigned int id)
+{
+  emit tunerBandEnabled(km->hasKey(id, TunerBand_Key));
+  emit programEnabled(km->hasKey(id, Program_Key));
+  emit memoryEnabled(km->hasKey(id, Memory_Key));
+  emit callEnabled(km->hasKey(id, Call_Key));
+  emit autoTrackingEnabled(km->hasKey(id, AutoTracking_Key));
+  emit trackingMinusEnabled(km->hasKey(id, TrackingMinus_Key));
+  emit trackingPlusEnabled(km->hasKey(id, TrackingPlus_Key));
+  emit vhsSpeedEnabled(km->hasKey(id, VHSSpeed_Key));
+  emit slowEnabled(km->hasKey(id, Slow_Key));
+  emit slowMinusEnabled(km->hasKey(id, SlowMinus_Key));
+  emit slowPlusEnabled(km->hasKey(id, SlowPlus_Key));
+  emit nextDiscEnabled(km->hasKey(id, NextDisc_Key));
+  emit repeatEnabled(km->hasKey(id, Repeat_Key));
+  emit repeatABEnabled(km->hasKey(id, RepeatAB_Key));
+  emit randomEnabled(km->hasKey(id, Random_Key));
+  emit discTitleEnabled(km->hasKey(id, DiscTitle_Key));
+}
+
+
+void PIRMedia2Form::on_tunerBandButton_pressed()
+{
+  mainWindow->startRepeating(TunerBand_Key);
+}
+
+void PIRMedia2Form::on_tunerBandButton_released()
+{
+  mainWindow->stopRepeating();
+}
+
+void PIRMedia2Form::on_programButton_pressed()
+{
+  mainWindow->startRepeating(Program_Key);
+}
+
+void PIRMedia2Form::on_programButton_released()
+{
+  mainWindow->stopRepeating();
+}
+
+void PIRMedia2Form::on_memoryButton_pressed()
+{
+  mainWindow->startRepeating(Memory_Key);
+}
+
+void PIRMedia2Form::on_memoryButton_released()
+{
+  mainWindow->stopRepeating();
+}
+
+void PIRMedia2Form::on_callButton_pressed()
+{
+  mainWindow->startRepeating(Call_Key);
+}
+
+void PIRMedia2Form::on_callButton_released()
+{
+  mainWindow->stopRepeating();
+}
+
+void PIRMedia2Form::on_autoTrackingButton_pressed()
+{
+  mainWindow->startRepeating(AutoTracking_Key);
+}
+
+void PIRMedia2Form::on_autoTrackingButton_released()
+{
+  mainWindow->stopRepeating();
+}
+
+void PIRMedia2Form::on_trackingMinusButton_pressed()
+{
+  mainWindow->startRepeating(TrackingMinus_Key);
+}
+
+void PIRMedia2Form::on_trackingMinusButton_released()
+{
+  mainWindow->stopRepeating();
+}
+
+void PIRMedia2Form::on_trackingPlusButton_pressed()
+{
+  mainWindow->startRepeating(TrackingPlus_Key);
+}
+
+void PIRMedia2Form::on_trackingPlusButton_released()
+{
+  mainWindow->stopRepeating();
+}
+
+void PIRMedia2Form::on_vhsSpeedButton_pressed()
+{
+  mainWindow->startRepeating(VHSSpeed_Key);
+}
+
+void PIRMedia2Form::on_vhsSpeedButton_released()
+{
+  mainWindow->stopRepeating();
+}
+
+void PIRMedia2Form::on_slowButton_pressed()
+{
+  mainWindow->startRepeating(Slow_Key);
+}
+
+void PIRMedia2Form::on_slowButton_released()
+{
+  mainWindow->stopRepeating();
+}
+
+void PIRMedia2Form::on_slowMinusButton_pressed()
+{
+  mainWindow->startRepeating(SlowMinus_Key);
+}
+
+void PIRMedia2Form::on_slowMinusButton_released()
+{
+  mainWindow->stopRepeating();
+}
+
+void PIRMedia2Form::on_slowPlusButton_pressed()
+{
+  mainWindow->startRepeating(SlowPlus_Key);
+}
+
+void PIRMedia2Form::on_slowPlusButton_released()
+{
+  mainWindow->stopRepeating();
+}
+
+void PIRMedia2Form::on_discSelectButton_pressed()
+{
+  mainWindow->startRepeating(NextDisc_Key);
+}
+
+void PIRMedia2Form::on_discSelectButton_released()
+{
+  mainWindow->stopRepeating();
+}
+
+void PIRMedia2Form::on_repeatButton_pressed()
+{
+  mainWindow->startRepeating(Repeat_Key);
+}
+
+void PIRMedia2Form::on_repeatButton_released()
+{
+  mainWindow->stopRepeating();
+}
+
+void PIRMedia2Form::on_repeatABButton_pressed()
+{
+  mainWindow->startRepeating(RepeatAB_Key);
+}
+
+void PIRMedia2Form::on_repeatABButton_released()
+{
+  mainWindow->stopRepeating();
+}
+
+void PIRMedia2Form::on_randomButton_pressed()
+{
+  mainWindow->startRepeating(Random_Key);
+}
+
+void PIRMedia2Form::on_randomButton_released()
+{
+  mainWindow->stopRepeating();
+}
+
+void PIRMedia2Form::on_discTitleButton_pressed()
+{
+  mainWindow->startRepeating(DiscTitle_Key);
+}
+
+void PIRMedia2Form::on_discTitleButton_released()
+{
+  mainWindow->stopRepeating();
+}
diff --git a/forms/pirmedia2form.h b/forms/pirmedia2form.h
new file mode 100644 (file)
index 0000000..f233b5e
--- /dev/null
@@ -0,0 +1,83 @@
+#ifndef PIRMEDIA2FORM_H
+#define PIRMEDIA2FORM_H
+
+#include <QWidget>
+
+class MainWindow;
+class PIRKeysetManager;
+
+namespace Ui {
+class PIRMedia2Form;
+}
+
+class PIRMedia2Form : public QWidget
+{
+  Q_OBJECT
+  
+public:
+  PIRMedia2Form(MainWindow *mw);
+  ~PIRMedia2Form();
+
+  void enableButtons(
+    const PIRKeysetManager *keyset,
+    unsigned int id);
+
+signals:
+  void tunerBandEnabled(bool);
+  void programEnabled(bool);
+  void memoryEnabled(bool);
+  void callEnabled(bool);
+  void autoTrackingEnabled(bool);
+  void trackingMinusEnabled(bool);
+  void trackingPlusEnabled(bool);
+  void vhsSpeedEnabled(bool);
+  void slowEnabled(bool);
+  void slowMinusEnabled(bool);
+  void slowPlusEnabled(bool);
+  void nextDiscEnabled(bool);
+  void repeatEnabled(bool);
+  void repeatABEnabled(bool);
+  void randomEnabled(bool);
+  void discTitleEnabled(bool);
+
+private slots:
+  void on_tunerBandButton_pressed();
+  void on_tunerBandButton_released();
+  void on_programButton_pressed();
+  void on_programButton_released();
+  void on_memoryButton_pressed();
+  void on_memoryButton_released();
+  void on_callButton_pressed();
+  void on_callButton_released();
+  void on_autoTrackingButton_pressed();
+  void on_autoTrackingButton_released();
+  void on_trackingMinusButton_pressed();
+  void on_trackingMinusButton_released();
+  void on_trackingPlusButton_pressed();
+  void on_trackingPlusButton_released();
+  void on_vhsSpeedButton_pressed();
+  void on_vhsSpeedButton_released();
+  void on_slowButton_pressed();
+  void on_slowButton_released();
+  void on_slowMinusButton_pressed();
+  void on_slowMinusButton_released();
+  void on_slowPlusButton_pressed();
+  void on_slowPlusButton_released();
+  void on_discSelectButton_pressed();
+  void on_discSelectButton_released();
+  void on_repeatButton_pressed();
+  void on_repeatButton_released();
+  void on_repeatABButton_pressed();
+  void on_repeatABButton_released();
+  void on_randomButton_pressed();
+  void on_randomButton_released();
+  void on_discTitleButton_pressed();
+  void on_discTitleButton_released();
+  
+private:
+  Ui::PIRMedia2Form *ui;
+
+  MainWindow *mainWindow;
+};
+
+#endif // PIRMEDIA2FORM_H
diff --git a/forms/pirmedia2form.ui b/forms/pirmedia2form.ui
new file mode 100644 (file)
index 0000000..f4a43ef
--- /dev/null
@@ -0,0 +1,516 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>PIRMedia2Form</class>
+ <widget class="QWidget" name="PIRMedia2Form">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>800</width>
+    <height>480</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>Form</string>
+  </property>
+  <layout class="QGridLayout" name="gridLayout">
+   <property name="leftMargin">
+    <number>8</number>
+   </property>
+   <property name="topMargin">
+    <number>0</number>
+   </property>
+   <property name="rightMargin">
+    <number>8</number>
+   </property>
+   <property name="bottomMargin">
+    <number>8</number>
+   </property>
+   <item row="0" column="0">
+    <widget class="QPushButton" name="tunerBandButton">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text">
+      <string>Tuner Band</string>
+     </property>
+    </widget>
+   </item>
+   <item row="1" column="0">
+    <widget class="QPushButton" name="autoTrackingButton">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text">
+      <string>Auto Tracking</string>
+     </property>
+    </widget>
+   </item>
+   <item row="0" column="1">
+    <widget class="QPushButton" name="programButton">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text">
+      <string>Program</string>
+     </property>
+    </widget>
+   </item>
+   <item row="1" column="1">
+    <widget class="QPushButton" name="trackingMinusButton">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text">
+      <string>Tracking -</string>
+     </property>
+    </widget>
+   </item>
+   <item row="0" column="2">
+    <widget class="QPushButton" name="memoryButton">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text">
+      <string>Memory</string>
+     </property>
+    </widget>
+   </item>
+   <item row="1" column="2">
+    <widget class="QPushButton" name="trackingPlusButton">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text">
+      <string>Tracking +</string>
+     </property>
+    </widget>
+   </item>
+   <item row="0" column="3">
+    <widget class="QPushButton" name="callButton">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text">
+      <string>Call</string>
+     </property>
+    </widget>
+   </item>
+   <item row="1" column="3">
+    <widget class="QPushButton" name="vhsSpeedButton">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text">
+      <string>SP/LP/EP</string>
+     </property>
+    </widget>
+   </item>
+   <item row="2" column="3">
+    <widget class="QPushButton" name="discSelectButton">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text">
+      <string>Disc Select</string>
+     </property>
+    </widget>
+   </item>
+   <item row="2" column="0">
+    <widget class="QPushButton" name="slowButton">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text">
+      <string>Slow</string>
+     </property>
+    </widget>
+   </item>
+   <item row="3" column="0">
+    <widget class="QPushButton" name="repeatButton">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text">
+      <string>Repeat</string>
+     </property>
+    </widget>
+   </item>
+   <item row="2" column="1">
+    <widget class="QPushButton" name="slowMinusButton">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text">
+      <string>Slow -</string>
+     </property>
+    </widget>
+   </item>
+   <item row="3" column="1">
+    <widget class="QPushButton" name="repeatABButton">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text">
+      <string>Repeat AB</string>
+     </property>
+    </widget>
+   </item>
+   <item row="2" column="2">
+    <widget class="QPushButton" name="slowPlusButton">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text">
+      <string>Slow +</string>
+     </property>
+    </widget>
+   </item>
+   <item row="3" column="2">
+    <widget class="QPushButton" name="randomButton">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text">
+      <string>Random</string>
+     </property>
+    </widget>
+   </item>
+   <item row="3" column="3">
+    <widget class="QPushButton" name="discTitleButton">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text">
+      <string>Disc Title</string>
+     </property>
+    </widget>
+   </item>
+  </layout>
+ </widget>
+ <resources/>
+ <connections>
+  <connection>
+   <sender>PIRMedia2Form</sender>
+   <signal>tunerBandEnabled(bool)</signal>
+   <receiver>tunerBandButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>102</x>
+     <y>64</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>PIRMedia2Form</sender>
+   <signal>programEnabled(bool)</signal>
+   <receiver>programButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>300</x>
+     <y>64</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>PIRMedia2Form</sender>
+   <signal>memoryEnabled(bool)</signal>
+   <receiver>memoryButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>499</x>
+     <y>64</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>PIRMedia2Form</sender>
+   <signal>callEnabled(bool)</signal>
+   <receiver>callButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>697</x>
+     <y>64</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>PIRMedia2Form</sender>
+   <signal>autoTrackingEnabled(bool)</signal>
+   <receiver>autoTrackingButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>102</x>
+     <y>182</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>PIRMedia2Form</sender>
+   <signal>trackingMinusEnabled(bool)</signal>
+   <receiver>trackingMinusButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>300</x>
+     <y>182</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>PIRMedia2Form</sender>
+   <signal>trackingPlusEnabled(bool)</signal>
+   <receiver>trackingPlusButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>499</x>
+     <y>182</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>PIRMedia2Form</sender>
+   <signal>vhsSpeedEnabled(bool)</signal>
+   <receiver>vhsSpeedButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>697</x>
+     <y>182</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>PIRMedia2Form</sender>
+   <signal>slowEnabled(bool)</signal>
+   <receiver>slowButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>102</x>
+     <y>301</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>PIRMedia2Form</sender>
+   <signal>slowMinusEnabled(bool)</signal>
+   <receiver>slowMinusButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>300</x>
+     <y>301</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>PIRMedia2Form</sender>
+   <signal>slowPlusEnabled(bool)</signal>
+   <receiver>slowPlusButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>499</x>
+     <y>301</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>PIRMedia2Form</sender>
+   <signal>nextDiscEnabled(bool)</signal>
+   <receiver>discSelectButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>697</x>
+     <y>301</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>PIRMedia2Form</sender>
+   <signal>repeatEnabled(bool)</signal>
+   <receiver>repeatButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>102</x>
+     <y>419</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>PIRMedia2Form</sender>
+   <signal>repeatABEnabled(bool)</signal>
+   <receiver>repeatABButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>300</x>
+     <y>419</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>PIRMedia2Form</sender>
+   <signal>randomEnabled(bool)</signal>
+   <receiver>randomButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>499</x>
+     <y>419</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>PIRMedia2Form</sender>
+   <signal>discTitleEnabled(bool)</signal>
+   <receiver>discTitleButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>697</x>
+     <y>419</y>
+    </hint>
+   </hints>
+  </connection>
+ </connections>
+ <slots>
+  <signal>tunerBandEnabled(bool)</signal>
+  <signal>programEnabled(bool)</signal>
+  <signal>memoryEnabled(bool)</signal>
+  <signal>callEnabled(bool)</signal>
+  <signal>autoTrackingEnabled(bool)</signal>
+  <signal>trackingMinusEnabled(bool)</signal>
+  <signal>trackingPlusEnabled(bool)</signal>
+  <signal>vhsSpeedEnabled(bool)</signal>
+  <signal>slowEnabled(bool)</signal>
+  <signal>slowMinusEnabled(bool)</signal>
+  <signal>slowPlusEnabled(bool)</signal>
+  <signal>nextDiscEnabled(bool)</signal>
+  <signal>repeatEnabled(bool)</signal>
+  <signal>repeatABEnabled(bool)</signal>
+  <signal>randomEnabled(bool)</signal>
+  <signal>discTitleEnabled(bool)</signal>
+ </slots>
+</ui>
diff --git a/forms/pirmediaform.cpp b/forms/pirmediaform.cpp
new file mode 100644 (file)
index 0000000..cd490e7
--- /dev/null
@@ -0,0 +1,159 @@
+#include "pirmediaform.h"
+#include "ui_pirmediaform.h"
+
+#include "mainwindow.h"
+#include "pirkeysetmanager.h"
+
+PIRMediaForm::PIRMediaForm(
+  MainWindow *mw)
+  : QWidget(0),
+    ui(new Ui::PIRMediaForm),
+    mainWindow(mw)
+{
+  ui->setupUi(this);
+}
+
+PIRMediaForm::~PIRMediaForm()
+{
+  delete ui;
+}
+
+
+void PIRMediaForm::enableButtons(
+  const PIRKeysetManager *keyset,
+  unsigned int id)
+{
+  emit nextEnabled(keyset->hasKey(id, Next_Key));
+  emit previousEnabled(keyset->hasKey(id, Previous_Key));
+  emit advanceEnabled(keyset->hasKey(id, Advance_Key));
+  emit replayEnabled(keyset->hasKey(id, Replay_Key));
+  emit stepForwardEnabled(keyset->hasKey(id, StepForward_Key));
+  emit stepBackEnabled(keyset->hasKey(id, StepBack_Key));
+  emit fastForwardEnabled(keyset->hasKey(id, FastForward_Key));
+  emit reverseEnabled(keyset->hasKey(id, Rewind_Key));
+  emit playEnabled(keyset->hasKey(id, Play_Key));
+  emit pauseEnabled(keyset->hasKey(id, Pause_Key));
+  emit stopEnabled(keyset->hasKey(id, Stop_Key));
+  emit ejectEnabled(keyset->hasKey(id, Eject_Key));
+}
+
+
+void PIRMediaForm::on_mediaPreviousButton_pressed()
+{
+  mainWindow->startRepeating(Previous_Key);
+}
+
+void PIRMediaForm::on_mediaPreviousButton_released()
+{
+  mainWindow->stopRepeating();
+}
+
+void PIRMediaForm::on_mediaNextButton_pressed()
+{
+  mainWindow->startRepeating(Next_Key);
+}
+
+void PIRMediaForm::on_mediaNextButton_released()
+{
+  mainWindow->stopRepeating();
+}
+
+void PIRMediaForm::on_replayButton_pressed()
+{
+  mainWindow->startRepeating(Replay_Key);
+}
+
+void PIRMediaForm::on_replayButton_released()
+{
+  mainWindow->stopRepeating();
+}
+
+void PIRMediaForm::on_advanceButton_pressed()
+{
+  mainWindow->startRepeating(Advance_Key);
+}
+
+void PIRMediaForm::on_advanceButton_released()
+{
+  mainWindow->stopRepeating();
+}
+
+void PIRMediaForm::on_stepBackButton_pressed()
+{
+  mainWindow->startRepeating(StepBack_Key);
+}
+
+void PIRMediaForm::on_stepBackButton_released()
+{
+  mainWindow->stopRepeating();
+}
+
+void PIRMediaForm::on_stepForwardButton_pressed()
+{
+  mainWindow->startRepeating(StepForward_Key);
+}
+
+void PIRMediaForm::on_stepForwardButton_released()
+{
+  mainWindow->stopRepeating();
+}
+
+void PIRMediaForm::on_reverseButton_pressed()
+{
+  mainWindow->startRepeating(Rewind_Key);
+}
+
+void PIRMediaForm::on_reverseButton_released()
+{
+  mainWindow->stopRepeating();
+}
+
+void PIRMediaForm::on_fastForwardButton_pressed()
+{
+  mainWindow->startRepeating(FastForward_Key);
+}
+
+void PIRMediaForm::on_fastForwardButton_released()
+{
+  mainWindow->stopRepeating();
+}
+
+void PIRMediaForm::on_playButton_pressed()
+{
+  mainWindow->startRepeating(Play_Key);
+}
+
+void PIRMediaForm::on_playButton_released()
+{
+  mainWindow->stopRepeating();
+}
+
+void PIRMediaForm::on_pauseButton_pressed()
+{
+  mainWindow->startRepeating(Pause_Key);
+}
+
+void PIRMediaForm::on_pauseButton_released()
+{
+  mainWindow->stopRepeating();
+}
+
+void PIRMediaForm::on_stopButton_pressed()
+{
+  mainWindow->startRepeating(Stop_Key);
+}
+
+void PIRMediaForm::on_stopButton_released()
+{
+  mainWindow->stopRepeating();
+}
+
+void PIRMediaForm::on_ejectButton_pressed()
+{
+  mainWindow->startRepeating(Eject_Key);
+}
+
+void PIRMediaForm::on_ejectButton_released()
+{
+  mainWindow->stopRepeating();
+}
diff --git a/forms/pirmediaform.h b/forms/pirmediaform.h
new file mode 100644 (file)
index 0000000..586e8fb
--- /dev/null
@@ -0,0 +1,72 @@
+#ifndef PIRMEDIAFORM_H
+#define PIRMEDIAFORM_H
+
+#include <QWidget>
+
+class MainWindow;
+class PIRKeysetManager;
+
+namespace Ui {
+class PIRMediaForm;
+}
+
+class PIRMediaForm : public QWidget
+{
+  Q_OBJECT
+
+public:
+//  explicit PIRMediaForm(QWidget *parent = 0);
+  PIRMediaForm(MainWindow *mw);
+  ~PIRMediaForm();
+
+  void enableButtons(
+    const PIRKeysetManager *keyset,
+    unsigned int id);
+
+signals:
+  void playEnabled(bool);
+  void pauseEnabled(bool);
+  void stopEnabled(bool);
+  void fastForwardEnabled(bool);
+  void reverseEnabled(bool);
+  void nextEnabled(bool);
+  void previousEnabled(bool);
+  void stepForwardEnabled(bool);
+  void stepBackEnabled(bool);
+  void advanceEnabled(bool);
+  void replayEnabled(bool);
+  void ejectEnabled(bool);
+
+private slots:
+  void on_mediaPreviousButton_pressed();
+  void on_mediaPreviousButton_released();
+  void on_mediaNextButton_pressed();
+  void on_mediaNextButton_released();
+  void on_replayButton_pressed();
+  void on_replayButton_released();
+  void on_advanceButton_pressed();
+  void on_advanceButton_released();
+  void on_stepBackButton_pressed();
+  void on_stepBackButton_released();
+  void on_stepForwardButton_pressed();
+  void on_stepForwardButton_released();
+  void on_reverseButton_pressed();
+  void on_reverseButton_released();
+  void on_fastForwardButton_pressed();
+  void on_fastForwardButton_released();
+  void on_playButton_pressed();
+  void on_playButton_released();
+  void on_pauseButton_pressed();
+  void on_pauseButton_released();
+  void on_stopButton_pressed();
+  void on_stopButton_released();
+  void on_ejectButton_pressed();
+  void on_ejectButton_released();
+
+private:
+  Ui::PIRMediaForm *ui;
+
+  MainWindow *mainWindow;
+};
+
+#endif // PIRMEDIAFORM_H
diff --git a/forms/pirmediaform.ui b/forms/pirmediaform.ui
new file mode 100644 (file)
index 0000000..bbbcb85
--- /dev/null
@@ -0,0 +1,518 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>PIRMediaForm</class>
+ <widget class="QWidget" name="PIRMediaForm">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>800</width>
+    <height>480</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>Form</string>
+  </property>
+  <layout class="QGridLayout" name="gridLayout">
+   <property name="leftMargin">
+    <number>8</number>
+   </property>
+   <property name="topMargin">
+    <number>0</number>
+   </property>
+   <property name="rightMargin">
+    <number>8</number>
+   </property>
+   <property name="bottomMargin">
+    <number>8</number>
+   </property>
+   <item row="0" column="0">
+    <widget class="QPushButton" name="mediaPreviousButton">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text">
+      <string>Previous</string>
+     </property>
+     <property name="icon">
+      <iconset resource="../PierogiResources.qrc">
+       <normaloff>:/icons/rewind_previous_icon&amp;48.png</normaloff>:/icons/rewind_previous_icon&amp;48.png</iconset>
+     </property>
+     <property name="iconSize">
+      <size>
+       <width>48</width>
+       <height>48</height>
+      </size>
+     </property>
+    </widget>
+   </item>
+   <item row="0" column="1">
+    <widget class="QPushButton" name="mediaNextButton">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text">
+      <string>Next</string>
+     </property>
+     <property name="icon">
+      <iconset resource="../PierogiResources.qrc">
+       <normaloff>:/icons/fastforward_next_icon&amp;48.png</normaloff>:/icons/fastforward_next_icon&amp;48.png</iconset>
+     </property>
+     <property name="iconSize">
+      <size>
+       <width>48</width>
+       <height>48</height>
+      </size>
+     </property>
+    </widget>
+   </item>
+   <item row="0" column="2">
+    <widget class="QPushButton" name="replayButton">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text">
+      <string>Replay</string>
+     </property>
+     <property name="icon">
+      <iconset resource="../PierogiResources.qrc">
+       <normaloff>:/icons/undo_icon&amp;48.png</normaloff>:/icons/undo_icon&amp;48.png</iconset>
+     </property>
+     <property name="iconSize">
+      <size>
+       <width>48</width>
+       <height>48</height>
+      </size>
+     </property>
+    </widget>
+   </item>
+   <item row="0" column="3">
+    <widget class="QPushButton" name="advanceButton">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text">
+      <string>Advance</string>
+     </property>
+     <property name="icon">
+      <iconset resource="../PierogiResources.qrc">
+       <normaloff>:/icons/redo_icon&amp;48.png</normaloff>:/icons/redo_icon&amp;48.png</iconset>
+     </property>
+     <property name="iconSize">
+      <size>
+       <width>48</width>
+       <height>48</height>
+      </size>
+     </property>
+    </widget>
+   </item>
+   <item row="1" column="0">
+    <widget class="QPushButton" name="stepBackButton">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text">
+      <string>Step Back</string>
+     </property>
+     <property name="icon">
+      <iconset resource="../PierogiResources.qrc">
+       <normaloff>:/icons/playback_prev_icon&amp;48.png</normaloff>:/icons/playback_prev_icon&amp;48.png</iconset>
+     </property>
+     <property name="iconSize">
+      <size>
+       <width>48</width>
+       <height>48</height>
+      </size>
+     </property>
+    </widget>
+   </item>
+   <item row="1" column="1">
+    <widget class="QPushButton" name="stepForwardButton">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text">
+      <string>Step Fwd</string>
+     </property>
+     <property name="icon">
+      <iconset resource="../PierogiResources.qrc">
+       <normaloff>:/icons/playback_next_icon&amp;48.png</normaloff>:/icons/playback_next_icon&amp;48.png</iconset>
+     </property>
+     <property name="iconSize">
+      <size>
+       <width>48</width>
+       <height>48</height>
+      </size>
+     </property>
+    </widget>
+   </item>
+   <item row="1" column="2">
+    <widget class="QPushButton" name="reverseButton">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text">
+      <string>Reverse</string>
+     </property>
+     <property name="icon">
+      <iconset resource="../PierogiResources.qrc">
+       <normaloff>:/icons/playback_rew_icon&amp;48.png</normaloff>:/icons/playback_rew_icon&amp;48.png</iconset>
+     </property>
+     <property name="iconSize">
+      <size>
+       <width>48</width>
+       <height>48</height>
+      </size>
+     </property>
+    </widget>
+   </item>
+   <item row="1" column="3">
+    <widget class="QPushButton" name="fastForwardButton">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text">
+      <string>Fast Fwd</string>
+     </property>
+     <property name="icon">
+      <iconset resource="../PierogiResources.qrc">
+       <normaloff>:/icons/playback_ff_icon&amp;48.png</normaloff>:/icons/playback_ff_icon&amp;48.png</iconset>
+     </property>
+     <property name="iconSize">
+      <size>
+       <width>48</width>
+       <height>48</height>
+      </size>
+     </property>
+    </widget>
+   </item>
+   <item row="2" column="0">
+    <widget class="QPushButton" name="playButton">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text">
+      <string>Play</string>
+     </property>
+     <property name="icon">
+      <iconset resource="../PierogiResources.qrc">
+       <normaloff>:/icons/playback_play_icon&amp;48.png</normaloff>:/icons/playback_play_icon&amp;48.png</iconset>
+     </property>
+     <property name="iconSize">
+      <size>
+       <width>48</width>
+       <height>48</height>
+      </size>
+     </property>
+    </widget>
+   </item>
+   <item row="2" column="1">
+    <widget class="QPushButton" name="pauseButton">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text">
+      <string>Pause</string>
+     </property>
+     <property name="icon">
+      <iconset resource="../PierogiResources.qrc">
+       <normaloff>:/icons/playback_pause_icon&amp;48.png</normaloff>:/icons/playback_pause_icon&amp;48.png</iconset>
+     </property>
+     <property name="iconSize">
+      <size>
+       <width>48</width>
+       <height>48</height>
+      </size>
+     </property>
+    </widget>
+   </item>
+   <item row="2" column="2">
+    <widget class="QPushButton" name="stopButton">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text">
+      <string>Stop</string>
+     </property>
+     <property name="icon">
+      <iconset resource="../PierogiResources.qrc">
+       <normaloff>:/icons/playback_stop_icon&amp;48.png</normaloff>:/icons/playback_stop_icon&amp;48.png</iconset>
+     </property>
+     <property name="iconSize">
+      <size>
+       <width>48</width>
+       <height>48</height>
+      </size>
+     </property>
+    </widget>
+   </item>
+   <item row="2" column="3">
+    <widget class="QPushButton" name="ejectButton">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text">
+      <string>Eject</string>
+     </property>
+     <property name="icon">
+      <iconset resource="../PierogiResources.qrc">
+       <normaloff>:/icons/eject_icon&amp;48.png</normaloff>:/icons/eject_icon&amp;48.png</iconset>
+     </property>
+     <property name="iconSize">
+      <size>
+       <width>48</width>
+       <height>48</height>
+      </size>
+     </property>
+    </widget>
+   </item>
+  </layout>
+ </widget>
+ <resources>
+  <include location="../PierogiResources.qrc"/>
+ </resources>
+ <connections>
+  <connection>
+   <sender>PIRMediaForm</sender>
+   <signal>previousEnabled(bool)</signal>
+   <receiver>mediaPreviousButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>102</x>
+     <y>83</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>PIRMediaForm</sender>
+   <signal>nextEnabled(bool)</signal>
+   <receiver>mediaNextButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>300</x>
+     <y>83</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>PIRMediaForm</sender>
+   <signal>replayEnabled(bool)</signal>
+   <receiver>replayButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>499</x>
+     <y>83</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>PIRMediaForm</sender>
+   <signal>advanceEnabled(bool)</signal>
+   <receiver>advanceButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>697</x>
+     <y>83</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>PIRMediaForm</sender>
+   <signal>stepBackEnabled(bool)</signal>
+   <receiver>stepBackButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>102</x>
+     <y>241</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>PIRMediaForm</sender>
+   <signal>stepForwardEnabled(bool)</signal>
+   <receiver>stepForwardButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>300</x>
+     <y>241</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>PIRMediaForm</sender>
+   <signal>reverseEnabled(bool)</signal>
+   <receiver>reverseButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>499</x>
+     <y>241</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>PIRMediaForm</sender>
+   <signal>playEnabled(bool)</signal>
+   <receiver>playButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>102</x>
+     <y>399</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>PIRMediaForm</sender>
+   <signal>pauseEnabled(bool)</signal>
+   <receiver>pauseButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>300</x>
+     <y>399</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>PIRMediaForm</sender>
+   <signal>fastForwardEnabled(bool)</signal>
+   <receiver>fastForwardButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>697</x>
+     <y>241</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>PIRMediaForm</sender>
+   <signal>stopEnabled(bool)</signal>
+   <receiver>stopButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>499</x>
+     <y>399</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>PIRMediaForm</sender>
+   <signal>ejectEnabled(bool)</signal>
+   <receiver>ejectButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>697</x>
+     <y>399</y>
+    </hint>
+   </hints>
+  </connection>
+ </connections>
+ <slots>
+  <signal>previousEnabled(bool)</signal>
+  <signal>nextEnabled(bool)</signal>
+  <signal>replayEnabled(bool)</signal>
+  <signal>advanceEnabled(bool)</signal>
+  <signal>stepBackEnabled(bool)</signal>
+  <signal>stepForwardEnabled(bool)</signal>
+  <signal>reverseEnabled(bool)</signal>
+  <signal>fastForwardEnabled(bool)</signal>
+  <signal>playEnabled(bool)</signal>
+  <signal>pauseEnabled(bool)</signal>
+  <signal>stopEnabled(bool)</signal>
+  <signal>ejectEnabled(bool)</signal>
+ </slots>
+</ui>
diff --git a/forms/pirmenuform.cpp b/forms/pirmenuform.cpp
new file mode 100644 (file)
index 0000000..9a8561c
--- /dev/null
@@ -0,0 +1,126 @@
+#include "pirmenuform.h"
+#include "ui_pirmenuform.h"
+
+#include "mainwindow.h"
+#include "pirkeysetmanager.h"
+
+PIRMenuForm::PIRMenuForm(
+  MainWindow *mw)
+  : QWidget(0),
+    ui(new Ui::PIRMenuForm),
+    mainWindow(mw)
+{
+  ui->setupUi(this);
+}
+
+PIRMenuForm::~PIRMenuForm()
+{
+  delete ui;
+}
+
+
+void PIRMenuForm::enableButtons(
+  const PIRKeysetManager *keyset,
+  unsigned int id)
+{
+  emit upEnabled(keyset->hasKey(id, Up_Key));
+  emit downEnabled(keyset->hasKey(id, Down_Key));
+  emit leftEnabled(keyset->hasKey(id, Left_Key));
+  emit rightEnabled(keyset->hasKey(id, Right_Key));
+  emit selectEnabled(keyset->hasKey(id, Select_Key));
+  emit menuEnabled(keyset->hasKey(id, Menu_Key));
+  emit exitEnabled(keyset->hasKey(id, Exit_Key));
+  emit guideEnabled(keyset->hasKey(id, Guide_Key));
+  emit discMenuEnabled(keyset->hasKey(id, DiscMenu_Key));
+}
+
+
+void PIRMenuForm::on_upButton_pressed()
+{
+  mainWindow->startRepeating(Up_Key);
+}
+
+void PIRMenuForm::on_upButton_released()
+{
+  mainWindow->stopRepeating();
+}
+
+void PIRMenuForm::on_leftButton_pressed()
+{
+  mainWindow->startRepeating(Left_Key);
+}
+
+void PIRMenuForm::on_leftButton_released()
+{
+  mainWindow->stopRepeating();
+}
+
+void PIRMenuForm::on_rightButton_pressed()
+{
+  mainWindow->startRepeating(Right_Key);
+}
+
+void PIRMenuForm::on_rightButton_released()
+{
+  mainWindow->stopRepeating();
+}
+
+void PIRMenuForm::on_downButton_pressed()
+{
+  mainWindow->startRepeating(Down_Key);
+}
+
+void PIRMenuForm::on_downButton_released()
+{
+  mainWindow->stopRepeating();
+}
+
+void PIRMenuForm::on_selectButton_pressed()
+{
+  mainWindow->startRepeating(Select_Key);
+}
+
+void PIRMenuForm::on_selectButton_released()
+{
+  mainWindow->stopRepeating();
+}
+
+void PIRMenuForm::on_menuButton_pressed()
+{
+  mainWindow->startRepeating(Menu_Key);
+}
+
+void PIRMenuForm::on_menuButton_released()
+{
+  mainWindow->stopRepeating();
+}
+
+void PIRMenuForm::on_exitButton_pressed()
+{
+  mainWindow->startRepeating(Exit_Key);
+}
+
+void PIRMenuForm::on_exitButton_released()
+{
+  mainWindow->stopRepeating();
+}
+
+void PIRMenuForm::on_guideButton_pressed()
+{
+  mainWindow->startRepeating(Guide_Key);
+}
+
+void PIRMenuForm::on_guideButton_released()
+{
+  mainWindow->stopRepeating();
+}
+
+void PIRMenuForm::on_discMenuButton_pressed()
+{
+  mainWindow->startRepeating(DiscMenu_Key);
+}
+
+void PIRMenuForm::on_discMenuButton_released()
+{
+  mainWindow->stopRepeating();
+}
diff --git a/forms/pirmenuform.h b/forms/pirmenuform.h
new file mode 100644 (file)
index 0000000..070a9c1
--- /dev/null
@@ -0,0 +1,63 @@
+#ifndef PIRMENUFORM_H
+#define PIRMENUFORM_H
+
+#include <QWidget>
+
+class MainWindow;
+class PIRKeysetManager;
+
+namespace Ui {
+class PIRMenuForm;
+}
+
+class PIRMenuForm : public QWidget
+{
+  Q_OBJECT
+
+public:
+//  explicit PIRMenuForm(QWidget *parent = 0);
+  PIRMenuForm(MainWindow *mw);
+  ~PIRMenuForm();
+
+  void enableButtons(
+    const PIRKeysetManager *keyset,
+    unsigned int id);
+
+signals:
+  void menuEnabled(bool);
+  void upEnabled(bool);
+  void downEnabled(bool);
+  void leftEnabled(bool);
+  void rightEnabled(bool);
+  void selectEnabled(bool);
+  void exitEnabled(bool);
+  void guideEnabled(bool);
+  void discMenuEnabled(bool);
+
+private slots:
+  void on_upButton_pressed();
+  void on_upButton_released();
+  void on_leftButton_pressed();
+  void on_leftButton_released();
+  void on_rightButton_pressed();
+  void on_rightButton_released();
+  void on_downButton_pressed();
+  void on_downButton_released();
+  void on_selectButton_pressed();
+  void on_selectButton_released();
+  void on_menuButton_pressed();
+  void on_menuButton_released();
+  void on_exitButton_pressed();
+  void on_exitButton_released();
+  void on_guideButton_pressed();
+  void on_guideButton_released();
+  void on_discMenuButton_pressed();
+  void on_discMenuButton_released();
+
+private:
+  Ui::PIRMenuForm *ui;
+
+  MainWindow *mainWindow;
+};
+
+#endif // PIRMENUFORM_H
diff --git a/forms/pirmenuform.ui b/forms/pirmenuform.ui
new file mode 100644 (file)
index 0000000..7b2327f
--- /dev/null
@@ -0,0 +1,348 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>PIRMenuForm</class>
+ <widget class="QWidget" name="PIRMenuForm">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>800</width>
+    <height>480</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>Form</string>
+  </property>
+  <layout class="QGridLayout" name="gridLayout">
+   <property name="leftMargin">
+    <number>8</number>
+   </property>
+   <property name="topMargin">
+    <number>0</number>
+   </property>
+   <property name="rightMargin">
+    <number>8</number>
+   </property>
+   <property name="bottomMargin">
+    <number>8</number>
+   </property>
+   <item row="0" column="0">
+    <widget class="QPushButton" name="guideButton">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text">
+      <string>Guide</string>
+     </property>
+    </widget>
+   </item>
+   <item row="0" column="1">
+    <widget class="QPushButton" name="upButton">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text">
+      <string>Up</string>
+     </property>
+     <property name="icon">
+      <iconset resource="../PierogiResources.qrc">
+       <normaloff>:/icons/arrow_top_icon&amp;48.png</normaloff>:/icons/arrow_top_icon&amp;48.png</iconset>
+     </property>
+     <property name="iconSize">
+      <size>
+       <width>48</width>
+       <height>48</height>
+      </size>
+     </property>
+    </widget>
+   </item>
+   <item row="0" column="2">
+    <widget class="QPushButton" name="menuButton">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text">
+      <string>Menu</string>
+     </property>
+    </widget>
+   </item>
+   <item row="1" column="0">
+    <widget class="QPushButton" name="leftButton">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text">
+      <string>Left</string>
+     </property>
+     <property name="icon">
+      <iconset resource="../PierogiResources.qrc">
+       <normaloff>:/icons/arrow_left_icon&amp;48.png</normaloff>:/icons/arrow_left_icon&amp;48.png</iconset>
+     </property>
+     <property name="iconSize">
+      <size>
+       <width>48</width>
+       <height>48</height>
+      </size>
+     </property>
+    </widget>
+   </item>
+   <item row="1" column="1">
+    <widget class="QPushButton" name="selectButton">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text">
+      <string>Select</string>
+     </property>
+    </widget>
+   </item>
+   <item row="1" column="2">
+    <widget class="QPushButton" name="rightButton">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text">
+      <string>Right</string>
+     </property>
+     <property name="icon">
+      <iconset resource="../PierogiResources.qrc">
+       <normaloff>:/icons/arrow_right_icon&amp;48.png</normaloff>:/icons/arrow_right_icon&amp;48.png</iconset>
+     </property>
+     <property name="iconSize">
+      <size>
+       <width>48</width>
+       <height>48</height>
+      </size>
+     </property>
+    </widget>
+   </item>
+   <item row="2" column="0">
+    <widget class="QPushButton" name="discMenuButton">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text">
+      <string>Disc Menu</string>
+     </property>
+    </widget>
+   </item>
+   <item row="2" column="1">
+    <widget class="QPushButton" name="downButton">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text">
+      <string>Down</string>
+     </property>
+     <property name="icon">
+      <iconset resource="../PierogiResources.qrc">
+       <normaloff>:/icons/arrow_bottom_icon&amp;48.png</normaloff>:/icons/arrow_bottom_icon&amp;48.png</iconset>
+     </property>
+     <property name="iconSize">
+      <size>
+       <width>48</width>
+       <height>48</height>
+      </size>
+     </property>
+    </widget>
+   </item>
+   <item row="2" column="2">
+    <widget class="QPushButton" name="exitButton">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text">
+      <string>Exit</string>
+     </property>
+    </widget>
+   </item>
+  </layout>
+ </widget>
+ <resources>
+  <include location="../PierogiResources.qrc"/>
+ </resources>
+ <connections>
+  <connection>
+   <sender>PIRMenuForm</sender>
+   <signal>guideEnabled(bool)</signal>
+   <receiver>guideButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>135</x>
+     <y>83</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>PIRMenuForm</sender>
+   <signal>upEnabled(bool)</signal>
+   <receiver>upButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>399</x>
+     <y>83</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>PIRMenuForm</sender>
+   <signal>menuEnabled(bool)</signal>
+   <receiver>menuButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>664</x>
+     <y>83</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>PIRMenuForm</sender>
+   <signal>leftEnabled(bool)</signal>
+   <receiver>leftButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>135</x>
+     <y>241</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>PIRMenuForm</sender>
+   <signal>selectEnabled(bool)</signal>
+   <receiver>selectButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>399</x>
+     <y>241</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>PIRMenuForm</sender>
+   <signal>rightEnabled(bool)</signal>
+   <receiver>rightButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>664</x>
+     <y>241</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>PIRMenuForm</sender>
+   <signal>discMenuEnabled(bool)</signal>
+   <receiver>discMenuButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>135</x>
+     <y>399</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>PIRMenuForm</sender>
+   <signal>downEnabled(bool)</signal>
+   <receiver>downButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>399</x>
+     <y>399</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>PIRMenuForm</sender>
+   <signal>exitEnabled(bool)</signal>
+   <receiver>exitButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>664</x>
+     <y>399</y>
+    </hint>
+   </hints>
+  </connection>
+ </connections>
+ <slots>
+  <signal>guideEnabled(bool)</signal>
+  <signal>upEnabled(bool)</signal>
+  <signal>menuEnabled(bool)</signal>
+  <signal>leftEnabled(bool)</signal>
+  <signal>selectEnabled(bool)</signal>
+  <signal>rightEnabled(bool)</signal>
+  <signal>discMenuEnabled(bool)</signal>
+  <signal>downEnabled(bool)</signal>
+  <signal>exitEnabled(bool)</signal>
+ </slots>
+</ui>
diff --git a/forms/pirtvform.cpp b/forms/pirtvform.cpp
new file mode 100644 (file)
index 0000000..9753dfe
--- /dev/null
@@ -0,0 +1,202 @@
+#include "pirtvform.h"
+#include "ui_pirtvform.h"
+
+#include "mainwindow.h"
+#include "pirkeysetmanager.h"
+
+PIRTVForm::PIRTVForm(MainWindow *mw) :
+  QWidget(0),
+  ui(new Ui::PIRTVForm),
+  mainWindow(mw)
+{
+  ui->setupUi(this);
+}
+
+PIRTVForm::~PIRTVForm()
+{
+  delete ui;
+}
+
+
+void PIRTVForm::enableButtons(
+  const PIRKeysetManager *km,
+  unsigned int id)
+{
+  emit teletextEnabled(km->hasKey(id, Teletext_Key));
+  emit teletextSizeEnabled(km->hasKey(id, TeletextSize_Key));
+  emit favoritesEnabled(km->hasKey(id, Favorites_Key));
+  emit pageUpEnabled(km->hasKey(id, PageUp_Key));
+  emit teletextHoldEnabled(km->hasKey(id, TeletextHold_Key));
+  emit teletextRevealEnabled(km->hasKey(id, TeletextReveal_Key));
+  emit liveTVEnabled(km->hasKey(id, LiveTV_Key));
+  emit pageDownEnabled(km->hasKey(id, PageDown_Key));
+  emit pipEnabled(km->hasKey(id, PIP_Key));
+  emit pipSwapEnabled(km->hasKey(id, PIPSwap_Key));
+  emit pipMoveEnabled(km->hasKey(id, PIPMove_Key));
+  emit pipSourceEnabled(km->hasKey(id, PIPSource_Key));
+  emit pipChannelUpEnabled(km->hasKey(id, PIPChannelUp_Key));
+  emit pipChannelDownEnabled(km->hasKey(id, PIPChannelDown_Key));
+  emit pipPauseEnabled(km->hasKey(id, PIPPause_Key));
+  emit pipSizeEnabled(km->hasKey(id, PIPSize_Key));
+}
+
+
+void PIRTVForm::on_teletextButton_pressed()
+{
+  mainWindow->startRepeating(Teletext_Key);
+}
+
+void PIRTVForm::on_teletextButton_released()
+{
+  mainWindow->stopRepeating();
+}
+
+void PIRTVForm::on_teletextSizeButton_pressed()
+{
+  mainWindow->startRepeating(TeletextSize_Key);
+}
+
+void PIRTVForm::on_teletextSizeButton_released()
+{
+  mainWindow->stopRepeating();
+}
+
+void PIRTVForm::on_favoritesButton_pressed()
+{
+  mainWindow->startRepeating(Favorites_Key);
+}
+
+void PIRTVForm::on_favoritesButton_released()
+{
+  mainWindow->stopRepeating();
+}
+
+void PIRTVForm::on_pageUpButton_pressed()
+{
+  mainWindow->startRepeating(PageUp_Key);
+}
+
+void PIRTVForm::on_pageUpButton_released()
+{
+  mainWindow->stopRepeating();
+}
+
+void PIRTVForm::on_teletextHoldButton_pressed()
+{
+  mainWindow->startRepeating(TeletextHold_Key);
+}
+
+void PIRTVForm::on_teletextHoldButton_released()
+{
+  mainWindow->stopRepeating();
+}
+
+void PIRTVForm::on_teletextRevealButton_pressed()
+{
+  mainWindow->startRepeating(TeletextReveal_Key);
+}
+
+void PIRTVForm::on_teletextRevealButton_released()
+{
+  mainWindow->stopRepeating();
+}
+
+void PIRTVForm::on_liveTVButton_pressed()
+{
+  mainWindow->startRepeating(LiveTV_Key);
+}
+
+void PIRTVForm::on_liveTVButton_released()
+{
+  mainWindow->stopRepeating();
+}
+
+void PIRTVForm::on_pageDownButton_pressed()
+{
+  mainWindow->startRepeating(PageDown_Key);
+}
+
+void PIRTVForm::on_pageDownButton_released()
+{
+  mainWindow->stopRepeating();
+}
+
+void PIRTVForm::on_pipButton_pressed()
+{
+  mainWindow->startRepeating(PIP_Key);
+}
+
+void PIRTVForm::on_pipButton_released()
+{
+  mainWindow->stopRepeating();
+}
+
+void PIRTVForm::on_pipSwapButton_pressed()
+{
+  mainWindow->startRepeating(PIPSwap_Key);
+}
+
+void PIRTVForm::on_pipSwapButton_released()
+{
+  mainWindow->stopRepeating();
+}
+
+void PIRTVForm::on_pipMoveButton_pressed()
+{
+  mainWindow->startRepeating(PIPMove_Key);
+}
+
+void PIRTVForm::on_pipMoveButton_released()
+{
+  mainWindow->stopRepeating();
+}
+
+void PIRTVForm::on_pipSourceButton_pressed()
+{
+  mainWindow->startRepeating(PIPSource_Key);
+}
+
+void PIRTVForm::on_pipSourceButton_released()
+{
+  mainWindow->stopRepeating();
+}
+
+void PIRTVForm::on_pipChannelUpButton_pressed()
+{
+  mainWindow->startRepeating(PIPChannelUp_Key);
+}
+
+void PIRTVForm::on_pipChannelUpButton_released()
+{
+  mainWindow->stopRepeating();
+}
+
+void PIRTVForm::on_pipChannelDownButton_pressed()
+{
+  mainWindow->startRepeating(PIPChannelDown_Key);
+}
+
+void PIRTVForm::on_pipChannelDownButton_released()
+{
+  mainWindow->stopRepeating();
+}
+
+void PIRTVForm::on_pipPauseButton_pressed()
+{
+  mainWindow->startRepeating(PIPPause_Key);
+}
+
+void PIRTVForm::on_pipPauseButton_released()
+{
+  mainWindow->stopRepeating();
+}
+
+void PIRTVForm::on_pipSizeButton_pressed()
+{
+  mainWindow->startRepeating(PIPSize_Key);
+}
+
+void PIRTVForm::on_pipSizeButton_released()
+{
+  mainWindow->stopRepeating();
+}
diff --git a/forms/pirtvform.h b/forms/pirtvform.h
new file mode 100644 (file)
index 0000000..3aae5bf
--- /dev/null
@@ -0,0 +1,83 @@
+#ifndef PIRTVFORM_H
+#define PIRTVFORM_H
+
+#include <QWidget>
+
+class MainWindow;
+class PIRKeysetManager;
+
+namespace Ui {
+class PIRTVForm;
+}
+
+class PIRTVForm : public QWidget
+{
+  Q_OBJECT
+  
+public:
+  PIRTVForm(MainWindow *mw);
+  ~PIRTVForm();
+
+  void enableButtons(
+    const PIRKeysetManager *keyset,
+    unsigned int id);
+
+signals:
+  void teletextEnabled(bool);
+  void teletextSizeEnabled(bool);
+  void favoritesEnabled(bool);
+  void pageUpEnabled(bool);
+  void teletextHoldEnabled(bool);
+  void teletextRevealEnabled(bool);
+  void liveTVEnabled(bool);
+  void pageDownEnabled(bool);
+  void pipEnabled(bool);
+  void pipSwapEnabled(bool);
+  void pipMoveEnabled(bool);
+  void pipSourceEnabled(bool);
+  void pipChannelUpEnabled(bool);
+  void pipChannelDownEnabled(bool);
+  void pipPauseEnabled(bool);
+  void pipSizeEnabled(bool);
+
+private slots:
+  void on_teletextButton_pressed();
+  void on_teletextButton_released();
+  void on_teletextSizeButton_pressed();
+  void on_teletextSizeButton_released();
+  void on_favoritesButton_pressed();
+  void on_favoritesButton_released();
+  void on_pageUpButton_pressed();
+  void on_pageUpButton_released();
+  void on_teletextHoldButton_pressed();
+  void on_teletextHoldButton_released();
+  void on_teletextRevealButton_pressed();
+  void on_teletextRevealButton_released();
+  void on_liveTVButton_pressed();
+  void on_liveTVButton_released();
+  void on_pageDownButton_pressed();
+  void on_pageDownButton_released();
+  void on_pipButton_pressed();
+  void on_pipButton_released();
+  void on_pipSwapButton_pressed();
+  void on_pipSwapButton_released();
+  void on_pipMoveButton_pressed();
+  void on_pipMoveButton_released();
+  void on_pipSourceButton_pressed();
+  void on_pipSourceButton_released();
+  void on_pipChannelUpButton_pressed();
+  void on_pipChannelUpButton_released();
+  void on_pipChannelDownButton_pressed();
+  void on_pipChannelDownButton_released();
+  void on_pipPauseButton_pressed();
+  void on_pipPauseButton_released();
+  void on_pipSizeButton_pressed();
+  void on_pipSizeButton_released();
+
+private:
+  Ui::PIRTVForm *ui;
+
+  MainWindow *mainWindow;
+};
+
+#endif // PIRTVFORM_H
diff --git a/forms/pirtvform.ui b/forms/pirtvform.ui
new file mode 100644 (file)
index 0000000..51ae510
--- /dev/null
@@ -0,0 +1,558 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>PIRTVForm</class>
+ <widget class="QWidget" name="PIRTVForm">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>800</width>
+    <height>480</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>Form</string>
+  </property>
+  <layout class="QGridLayout" name="gridLayout">
+   <property name="leftMargin">
+    <number>8</number>
+   </property>
+   <property name="topMargin">
+    <number>0</number>
+   </property>
+   <property name="rightMargin">
+    <number>8</number>
+   </property>
+   <property name="bottomMargin">
+    <number>8</number>
+   </property>
+   <item row="0" column="0">
+    <widget class="QPushButton" name="teletextButton">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text">
+      <string>Teletext</string>
+     </property>
+    </widget>
+   </item>
+   <item row="0" column="1">
+    <widget class="QPushButton" name="teletextSizeButton">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text">
+      <string>Txt Size</string>
+     </property>
+    </widget>
+   </item>
+   <item row="0" column="2">
+    <widget class="QPushButton" name="favoritesButton">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text">
+      <string>Favorites</string>
+     </property>
+    </widget>
+   </item>
+   <item row="0" column="3">
+    <widget class="QPushButton" name="pageUpButton">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text">
+      <string>Page Up</string>
+     </property>
+     <property name="icon">
+      <iconset resource="../PierogiResources.qrc">
+       <normaloff>:/icons/arrow_top_icon&amp;48.png</normaloff>:/icons/arrow_top_icon&amp;48.png</iconset>
+     </property>
+     <property name="iconSize">
+      <size>
+       <width>48</width>
+       <height>48</height>
+      </size>
+     </property>
+    </widget>
+   </item>
+   <item row="1" column="0">
+    <widget class="QPushButton" name="teletextHoldButton">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text">
+      <string>Txt Hold</string>
+     </property>
+    </widget>
+   </item>
+   <item row="1" column="1">
+    <widget class="QPushButton" name="teletextRevealButton">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text">
+      <string>Txt Reveal</string>
+     </property>
+    </widget>
+   </item>
+   <item row="1" column="2">
+    <widget class="QPushButton" name="liveTVButton">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text">
+      <string>Live TV</string>
+     </property>
+    </widget>
+   </item>
+   <item row="1" column="3">
+    <widget class="QPushButton" name="pageDownButton">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text">
+      <string>Page Down</string>
+     </property>
+     <property name="icon">
+      <iconset resource="../PierogiResources.qrc">
+       <normaloff>:/icons/arrow_bottom_icon&amp;48.png</normaloff>:/icons/arrow_bottom_icon&amp;48.png</iconset>
+     </property>
+     <property name="iconSize">
+      <size>
+       <width>48</width>
+       <height>48</height>
+      </size>
+     </property>
+    </widget>
+   </item>
+   <item row="2" column="0">
+    <widget class="QPushButton" name="pipButton">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text">
+      <string>Picture in Picture</string>
+     </property>
+    </widget>
+   </item>
+   <item row="2" column="1">
+    <widget class="QPushButton" name="pipSwapButton">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text">
+      <string>PIP Swap</string>
+     </property>
+    </widget>
+   </item>
+   <item row="2" column="2">
+    <widget class="QPushButton" name="pipMoveButton">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text">
+      <string>PIP Move</string>
+     </property>
+    </widget>
+   </item>
+   <item row="2" column="3">
+    <widget class="QPushButton" name="pipChannelUpButton">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text">
+      <string>PIP Ch Up</string>
+     </property>
+     <property name="icon">
+      <iconset resource="../PierogiResources.qrc">
+       <normaloff>:/icons/br_up_icon&amp;48.png</normaloff>:/icons/br_up_icon&amp;48.png</iconset>
+     </property>
+     <property name="iconSize">
+      <size>
+       <width>48</width>
+       <height>48</height>
+      </size>
+     </property>
+    </widget>
+   </item>
+   <item row="3" column="0">
+    <widget class="QPushButton" name="pipSourceButton">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text">
+      <string>PIP Source</string>
+     </property>
+    </widget>
+   </item>
+   <item row="3" column="1">
+    <widget class="QPushButton" name="pipSizeButton">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text">
+      <string>PIP Size</string>
+     </property>
+    </widget>
+   </item>
+   <item row="3" column="2">
+    <widget class="QPushButton" name="pipPauseButton">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text">
+      <string>PIP Pause</string>
+     </property>
+    </widget>
+   </item>
+   <item row="3" column="3">
+    <widget class="QPushButton" name="pipChannelDownButton">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text">
+      <string>PIP Ch Down</string>
+     </property>
+     <property name="icon">
+      <iconset resource="../PierogiResources.qrc">
+       <normaloff>:/icons/br_down_icon&amp;48.png</normaloff>:/icons/br_down_icon&amp;48.png</iconset>
+     </property>
+     <property name="iconSize">
+      <size>
+       <width>48</width>
+       <height>48</height>
+      </size>
+     </property>
+    </widget>
+   </item>
+  </layout>
+ </widget>
+ <resources>
+  <include location="../PierogiResources.qrc"/>
+ </resources>
+ <connections>
+  <connection>
+   <sender>PIRTVForm</sender>
+   <signal>teletextEnabled(bool)</signal>
+   <receiver>teletextButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>102</x>
+     <y>64</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>PIRTVForm</sender>
+   <signal>teletextSizeEnabled(bool)</signal>
+   <receiver>teletextSizeButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>300</x>
+     <y>64</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>PIRTVForm</sender>
+   <signal>favoritesEnabled(bool)</signal>
+   <receiver>favoritesButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>499</x>
+     <y>64</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>PIRTVForm</sender>
+   <signal>pageUpEnabled(bool)</signal>
+   <receiver>pageUpButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>697</x>
+     <y>64</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>PIRTVForm</sender>
+   <signal>teletextHoldEnabled(bool)</signal>
+   <receiver>teletextHoldButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>102</x>
+     <y>182</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>PIRTVForm</sender>
+   <signal>teletextRevealEnabled(bool)</signal>
+   <receiver>teletextRevealButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>300</x>
+     <y>182</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>PIRTVForm</sender>
+   <signal>liveTVEnabled(bool)</signal>
+   <receiver>liveTVButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>499</x>
+     <y>182</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>PIRTVForm</sender>
+   <signal>pageDownEnabled(bool)</signal>
+   <receiver>pageDownButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>697</x>
+     <y>182</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>PIRTVForm</sender>
+   <signal>pipEnabled(bool)</signal>
+   <receiver>pipButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>102</x>
+     <y>301</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>PIRTVForm</sender>
+   <signal>pipSwapEnabled(bool)</signal>
+   <receiver>pipSwapButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>300</x>
+     <y>301</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>PIRTVForm</sender>
+   <signal>pipMoveEnabled(bool)</signal>
+   <receiver>pipMoveButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>499</x>
+     <y>301</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>PIRTVForm</sender>
+   <signal>pipChannelUpEnabled(bool)</signal>
+   <receiver>pipChannelUpButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>697</x>
+     <y>301</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>PIRTVForm</sender>
+   <signal>pipSourceEnabled(bool)</signal>
+   <receiver>pipSourceButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>102</x>
+     <y>419</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>PIRTVForm</sender>
+   <signal>pipSizeEnabled(bool)</signal>
+   <receiver>pipSizeButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>300</x>
+     <y>419</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>PIRTVForm</sender>
+   <signal>pipPauseEnabled(bool)</signal>
+   <receiver>pipPauseButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>499</x>
+     <y>419</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>PIRTVForm</sender>
+   <signal>pipChannelDownEnabled(bool)</signal>
+   <receiver>pipChannelDownButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>697</x>
+     <y>419</y>
+    </hint>
+   </hints>
+  </connection>
+ </connections>
+ <slots>
+  <signal>teletextEnabled(bool)</signal>
+  <signal>teletextSizeEnabled(bool)</signal>
+  <signal>favoritesEnabled(bool)</signal>
+  <signal>pageUpEnabled(bool)</signal>
+  <signal>teletextHoldEnabled(bool)</signal>
+  <signal>teletextRevealEnabled(bool)</signal>
+  <signal>liveTVEnabled(bool)</signal>
+  <signal>pageDownEnabled(bool)</signal>
+  <signal>pipEnabled(bool)</signal>
+  <signal>pipSwapEnabled(bool)</signal>
+  <signal>pipMoveEnabled(bool)</signal>
+  <signal>pipChannelUpEnabled(bool)</signal>
+  <signal>pipSourceEnabled(bool)</signal>
+  <signal>pipSizeEnabled(bool)</signal>
+  <signal>pipPauseEnabled(bool)</signal>
+  <signal>pipChannelDownEnabled(bool)</signal>
+ </slots>
+</ui>
diff --git a/forms/pirutilityform.cpp b/forms/pirutilityform.cpp
new file mode 100644 (file)
index 0000000..7032db5
--- /dev/null
@@ -0,0 +1,171 @@
+#include "pirutilityform.h"
+#include "ui_pirutilityform.h"
+
+#include "mainwindow.h"
+#include "pirkeysetmanager.h"
+
+PIRUtilityForm::PIRUtilityForm(
+  MainWindow *mw)
+  : QWidget(0),
+    ui(new Ui::PIRUtilityForm),
+    mainWindow(mw)
+{
+  ui->setupUi(this);
+}
+
+PIRUtilityForm::~PIRUtilityForm()
+{
+  delete ui;
+}
+
+
+void PIRUtilityForm::enableButtons(
+  const PIRKeysetManager *keyset,
+  unsigned int id)
+{
+  emit redEnabled(keyset->hasKey(id, Red_Key));
+  emit greenEnabled(keyset->hasKey(id, Green_Key));
+  emit yellowEnabled(keyset->hasKey(id, Yellow_Key));
+  emit blueEnabled(keyset->hasKey(id, Blue_Key));
+  emit pictureModeEnabled(keyset->hasKey(id, PictureMode_Key));
+  emit soundModeEnabled(keyset->hasKey(id, SoundMode_Key));
+  emit aspectRatioEnabled(keyset->hasKey(id, AspectRatio_Key));
+  emit audioEnabled(keyset->hasKey(id, Audio_Key));
+  emit infoEnabled(keyset->hasKey(id, Info_Key));
+  emit captionsEnabled(keyset->hasKey(id, Captions_Key));
+  emit sleepEnabled(keyset->hasKey(id, Sleep_Key));
+  emit inputEnabled(keyset->hasKey(id, Input_Key));
+}
+
+
+void PIRUtilityForm::on_redButton_pressed()
+{
+  mainWindow->startRepeating(Red_Key);
+}
+
+void PIRUtilityForm::on_redButton_released()
+{
+  mainWindow->stopRepeating();
+}
+
+void PIRUtilityForm::on_greenButton_pressed()
+{
+  mainWindow->startRepeating(Green_Key);
+}
+
+void PIRUtilityForm::on_greenButton_released()
+{
+  mainWindow->stopRepeating();
+}
+
+void PIRUtilityForm::on_yellowButton_pressed()
+{
+  mainWindow->startRepeating(Yellow_Key);
+}
+
+void PIRUtilityForm::on_yellowButton_released()
+{
+  mainWindow->stopRepeating();
+}
+
+void PIRUtilityForm::on_blueButton_pressed()
+{
+  mainWindow->startRepeating(Blue_Key);
+}
+
+void PIRUtilityForm::on_blueButton_released()
+{
+  mainWindow->stopRepeating();
+}
+
+void PIRUtilityForm::on_pictureModeButton_pressed()
+{
+  mainWindow->startRepeating(PictureMode_Key);
+}
+
+void PIRUtilityForm::on_pictureModeButton_released()
+{
+  mainWindow->stopRepeating();
+}
+
+void PIRUtilityForm::on_soundModeButton_pressed()
+{
+  mainWindow->startRepeating(SoundMode_Key);
+}
+
+void PIRUtilityForm::on_soundModeButton_released()
+{
+  mainWindow->stopRepeating();
+}
+
+void PIRUtilityForm::on_aspectRatioButton_pressed()
+{
+  mainWindow->startRepeating(AspectRatio_Key);
+}
+
+void PIRUtilityForm::on_aspectRatioButton_released()
+{
+  mainWindow->stopRepeating();
+}
+
+/*
+void PIRUtilityForm::on_surroundButton_pressed()
+{
+  mainWindow->startRepeating(Surround_Key);
+}
+
+void PIRUtilityForm::on_surroundButton_released()
+{
+  mainWindow->stopRepeating();
+}
+*/
+
+void PIRUtilityForm::on_audioButton_pressed()
+{
+  mainWindow->startRepeating(Audio_Key);
+}
+
+void PIRUtilityForm::on_audioButton_released()
+{
+  mainWindow->stopRepeating();
+}
+
+void PIRUtilityForm::on_infoButton_pressed()
+{
+  mainWindow->startRepeating(Info_Key);
+}
+
+void PIRUtilityForm::on_infoButton_released()
+{
+  mainWindow->stopRepeating();
+}
+
+void PIRUtilityForm::on_captionButton_pressed()
+{
+  mainWindow->startRepeating(Captions_Key);
+}
+
+void PIRUtilityForm::on_captionButton_released()
+{
+  mainWindow->stopRepeating();
+}
+
+void PIRUtilityForm::on_inputButton_pressed()
+{
+  mainWindow->startRepeating(Input_Key);
+}
+
+void PIRUtilityForm::on_inputButton_released()
+{
+  mainWindow->stopRepeating();
+}
+
+void PIRUtilityForm::on_sleepButton_pressed()
+{
+  mainWindow->startRepeating(Sleep_Key);
+}
+
+void PIRUtilityForm::on_sleepButton_released()
+{
+  mainWindow->stopRepeating();
+}
diff --git a/forms/pirutilityform.h b/forms/pirutilityform.h
new file mode 100644 (file)
index 0000000..fb56cb1
--- /dev/null
@@ -0,0 +1,72 @@
+#ifndef PIRUTILITYFORM_H
+#define PIRUTILITYFORM_H
+
+#include <QWidget>
+
+class MainWindow;
+class PIRKeysetManager;
+
+namespace Ui {
+class PIRUtilityForm;
+}
+
+class PIRUtilityForm : public QWidget
+{
+  Q_OBJECT
+
+public:
+//  explicit PIRUtilityForm(QWidget *parent = 0);
+  PIRUtilityForm(MainWindow *mw);
+  ~PIRUtilityForm();
+
+  void enableButtons(
+    const PIRKeysetManager *keyset,
+    unsigned int id);
+
+signals:
+  void redEnabled(bool);
+  void greenEnabled(bool);
+  void yellowEnabled(bool);
+  void blueEnabled(bool);
+  void pictureModeEnabled(bool);
+  void soundModeEnabled(bool);
+  void aspectRatioEnabled(bool);
+  void audioEnabled(bool);
+  void infoEnabled(bool);
+  void captionsEnabled(bool);
+  void inputEnabled(bool);
+  void sleepEnabled(bool);
+
+private slots:
+  void on_redButton_pressed();
+  void on_redButton_released();
+  void on_greenButton_pressed();
+  void on_greenButton_released();
+  void on_yellowButton_pressed();
+  void on_yellowButton_released();
+  void on_blueButton_pressed();
+  void on_blueButton_released();
+  void on_pictureModeButton_pressed();
+  void on_pictureModeButton_released();
+  void on_soundModeButton_pressed();
+  void on_soundModeButton_released();
+  void on_aspectRatioButton_pressed();
+  void on_aspectRatioButton_released();
+  void on_audioButton_pressed();
+  void on_audioButton_released();
+  void on_infoButton_pressed();
+  void on_infoButton_released();
+  void on_captionButton_pressed();
+  void on_captionButton_released();
+  void on_inputButton_pressed();
+  void on_inputButton_released();
+  void on_sleepButton_pressed();
+  void on_sleepButton_released();
+
+private:
+  Ui::PIRUtilityForm *ui;
+
+  MainWindow *mainWindow;
+};
+
+#endif // PIRUTILITYFORM_H
diff --git a/forms/pirutilityform.ui b/forms/pirutilityform.ui
new file mode 100644 (file)
index 0000000..ad53ba1
--- /dev/null
@@ -0,0 +1,438 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>PIRUtilityForm</class>
+ <widget class="QWidget" name="PIRUtilityForm">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>800</width>
+    <height>480</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>Form</string>
+  </property>
+  <layout class="QGridLayout" name="gridLayout">
+   <property name="leftMargin">
+    <number>8</number>
+   </property>
+   <property name="topMargin">
+    <number>0</number>
+   </property>
+   <property name="rightMargin">
+    <number>8</number>
+   </property>
+   <property name="bottomMargin">
+    <number>8</number>
+   </property>
+   <item row="0" column="0">
+    <widget class="QPushButton" name="redButton">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text">
+      <string>Red</string>
+     </property>
+     <property name="icon">
+      <iconset resource="../PierogiResources.qrc">
+       <normaloff>:/icons/red_square.png</normaloff>:/icons/red_square.png</iconset>
+     </property>
+     <property name="iconSize">
+      <size>
+       <width>48</width>
+       <height>48</height>
+      </size>
+     </property>
+    </widget>
+   </item>
+   <item row="0" column="1">
+    <widget class="QPushButton" name="greenButton">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text">
+      <string>Green</string>
+     </property>
+     <property name="icon">
+      <iconset resource="../PierogiResources.qrc">
+       <normaloff>:/icons/green_square.png</normaloff>:/icons/green_square.png</iconset>
+     </property>
+     <property name="iconSize">
+      <size>
+       <width>48</width>
+       <height>48</height>
+      </size>
+     </property>
+    </widget>
+   </item>
+   <item row="0" column="2">
+    <widget class="QPushButton" name="yellowButton">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text">
+      <string>Yellow</string>
+     </property>
+     <property name="icon">
+      <iconset resource="../PierogiResources.qrc">
+       <normaloff>:/icons/yellow_square.png</normaloff>:/icons/yellow_square.png</iconset>
+     </property>
+     <property name="iconSize">
+      <size>
+       <width>48</width>
+       <height>48</height>
+      </size>
+     </property>
+    </widget>
+   </item>
+   <item row="0" column="3">
+    <widget class="QPushButton" name="blueButton">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text">
+      <string>Blue</string>
+     </property>
+     <property name="icon">
+      <iconset resource="../PierogiResources.qrc">
+       <normaloff>:/icons/blue_square.png</normaloff>:/icons/blue_square.png</iconset>
+     </property>
+     <property name="iconSize">
+      <size>
+       <width>48</width>
+       <height>48</height>
+      </size>
+     </property>
+    </widget>
+   </item>
+   <item row="1" column="0">
+    <widget class="QPushButton" name="soundModeButton">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text">
+      <string>Sound Mode</string>
+     </property>
+    </widget>
+   </item>
+   <item row="1" column="1">
+    <widget class="QPushButton" name="aspectRatioButton">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text">
+      <string>Aspect Ratio</string>
+     </property>
+    </widget>
+   </item>
+   <item row="1" column="2">
+    <widget class="QPushButton" name="audioButton">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text">
+      <string>I/II Audio</string>
+     </property>
+    </widget>
+   </item>
+   <item row="1" column="3">
+    <widget class="QPushButton" name="infoButton">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text">
+      <string>Info</string>
+     </property>
+    </widget>
+   </item>
+   <item row="2" column="0">
+    <widget class="QPushButton" name="pictureModeButton">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text">
+      <string>Picture Mode</string>
+     </property>
+    </widget>
+   </item>
+   <item row="2" column="1">
+    <widget class="QPushButton" name="inputButton">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text">
+      <string>Input</string>
+     </property>
+    </widget>
+   </item>
+   <item row="2" column="2">
+    <widget class="QPushButton" name="sleepButton">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text">
+      <string>Sleep</string>
+     </property>
+    </widget>
+   </item>
+   <item row="2" column="3">
+    <widget class="QPushButton" name="captionButton">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text">
+      <string>CC / Subtitle</string>
+     </property>
+    </widget>
+   </item>
+  </layout>
+ </widget>
+ <resources>
+  <include location="../PierogiResources.qrc"/>
+ </resources>
+ <connections>
+  <connection>
+   <sender>PIRUtilityForm</sender>
+   <signal>redEnabled(bool)</signal>
+   <receiver>redButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>102</x>
+     <y>83</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>PIRUtilityForm</sender>
+   <signal>greenEnabled(bool)</signal>
+   <receiver>greenButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>300</x>
+     <y>83</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>PIRUtilityForm</sender>
+   <signal>yellowEnabled(bool)</signal>
+   <receiver>yellowButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>499</x>
+     <y>83</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>PIRUtilityForm</sender>
+   <signal>blueEnabled(bool)</signal>
+   <receiver>blueButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>697</x>
+     <y>83</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>PIRUtilityForm</sender>
+   <signal>soundModeEnabled(bool)</signal>
+   <receiver>soundModeButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>102</x>
+     <y>241</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>PIRUtilityForm</sender>
+   <signal>aspectRatioEnabled(bool)</signal>
+   <receiver>aspectRatioButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>300</x>
+     <y>241</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>PIRUtilityForm</sender>
+   <signal>audioEnabled(bool)</signal>
+   <receiver>audioButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>499</x>
+     <y>241</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>PIRUtilityForm</sender>
+   <signal>infoEnabled(bool)</signal>
+   <receiver>infoButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>697</x>
+     <y>241</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>PIRUtilityForm</sender>
+   <signal>pictureModeEnabled(bool)</signal>
+   <receiver>pictureModeButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>102</x>
+     <y>399</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>PIRUtilityForm</sender>
+   <signal>inputEnabled(bool)</signal>
+   <receiver>inputButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>300</x>
+     <y>399</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>PIRUtilityForm</sender>
+   <signal>sleepEnabled(bool)</signal>
+   <receiver>sleepButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>499</x>
+     <y>399</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>PIRUtilityForm</sender>
+   <signal>captionsEnabled(bool)</signal>
+   <receiver>captionButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>697</x>
+     <y>399</y>
+    </hint>
+   </hints>
+  </connection>
+ </connections>
+ <slots>
+  <signal>redEnabled(bool)</signal>
+  <signal>greenEnabled(bool)</signal>
+  <signal>yellowEnabled(bool)</signal>
+  <signal>blueEnabled(bool)</signal>
+  <signal>soundModeEnabled(bool)</signal>
+  <signal>aspectRatioEnabled(bool)</signal>
+  <signal>audioEnabled(bool)</signal>
+  <signal>infoEnabled(bool)</signal>
+  <signal>pictureModeEnabled(bool)</signal>
+  <signal>inputEnabled(bool)</signal>
+  <signal>sleepEnabled(bool)</signal>
+  <signal>captionsEnabled(bool)</signal>
+ </slots>
+</ui>
diff --git a/keysets/aoc.cpp b/keysets/aoc.cpp
new file mode 100644 (file)
index 0000000..d318784
--- /dev/null
@@ -0,0 +1,55 @@
+#include "aoc.h"
+#include "protocols/necprotocol.h"
+
+
+AOCTV1::AOCTV1(
+  unsigned int index)
+  : PIRKeysetMetaData(
+      "TV Keyset 1",
+      AOC_Make,
+      index)
+{
+}
+
+
+void AOCTV1::populateProtocol(
+  QObject *guiObject)
+{
+  if (threadableProtocol)
+  {
+    // Keyset already populated.
+    return;
+  }
+
+  threadableProtocol = new NECProtocol(guiObject, index, true, true);
+
+  setPreData(0xBD00, 16);
+
+  addKey("POWER", Power_Key, 0x01, 8);
+  addKey("MUTE", Mute_Key, 0x04, 8);
+  addKey("TVVIDEO", Input_Key, 0x05, 8);
+  addKey("MENU", Menu_Key, 0x0A, 8);
+  addKey("RIGHT", Right_Key, 0x0C, 8);
+
+  addKey("LEFT", Left_Key, 0x10, 8);
+  addKey("PIP", PIP_Key, 0x12, 8);
+  addKey("SLEEP", Sleep_Key, 0x13, 8);
+  addKey("WIDE", AspectRatio_Key, 0x14, 8);
+  addKey("1", One_Key, 0x15, 8);
+  addKey("2", Two_Key, 0x16, 8);
+  addKey("3", Three_Key, 0x17, 8);
+  addKey("UP", Up_Key, 0x18, 8);
+  addKey("4", Four_Key, 0x19, 8);
+  addKey("5", Five_Key, 0x1A, 8);
+  addKey("6", Six_Key, 0x1B, 8);
+  addKey("DOWN", Down_Key, 0x1C, 8);
+  addKey("7", Seven_Key,0x1D, 8);
+  addKey("8", Eight_Key, 0x1E, 8);
+  addKey("9", Nine_Key, 0x1F, 8);
+
+  addKey("INFO", Info_Key, 0x40, 8);
+  addKey("0", Zero_Key, 0x41, 8);
+  addKey("PRECH", PrevChannel_Key, 0x44, 8);
+  addKey("PLUSMINUS", Unmapped_Key, 0x4B, 8);
+  addKey("PC", PCInput_Key, 0x45, 8);
+}
diff --git a/keysets/aoc.h b/keysets/aoc.h
new file mode 100644 (file)
index 0000000..34af85b
--- /dev/null
@@ -0,0 +1,18 @@
+#ifndef AOC_H
+#define AOC_H
+
+#include "pirkeysetmetadata.h"
+
+class QObject;
+
+class AOCTV1: public PIRKeysetMetaData
+{
+public:
+  AOCTV1(
+    unsigned int index);
+
+  virtual void populateProtocol(
+    QObject *guiObject);
+};
+
+#endif // AOC_H
diff --git a/keysets/arcam.cpp b/keysets/arcam.cpp
new file mode 100644 (file)
index 0000000..ac220de
--- /dev/null
@@ -0,0 +1,56 @@
+#include "arcam.h"
+#include "protocols/rc5protocol.h"
+
+
+ArcamReceiver1::ArcamReceiver1(
+  unsigned int index)
+  : PIRKeysetMetaData(
+      "Receiver Keyset 1",
+      Arcam_Make,
+      index)
+{
+}
+
+
+void ArcamReceiver1::populateProtocol(
+  QObject *guiObject)
+{
+  if (threadableProtocol)
+  {
+    // Keyset already populated.
+    return;
+  }
+
+  threadableProtocol = new RC5Protocol(guiObject, index);
+
+  addKey("right", Right_Key, 0x0410, 13);
+  addKey("left", Left_Key, 0x0411, 13);
+  addKey("down", Down_Key, 0x0415, 13);
+  addKey("up", Up_Key, 0x0416, 13);
+  addKey("ok", Select_Key, 0x0417, 13);
+  addKey("test", Unmapped_Key, 0x0418, 13);
+
+  addKey("sat", SatInput_Key, 0x1400, 13);
+  addKey("5-1", Surround_Key, 0x1402, 13); // ?
+  addKey("dvd", DVDInput_Key, 0x1404, 13);
+  addKey("tape", TapeInput_Key, 0x1405, 13);
+  addKey("vcr", VCRInput_Key, 0x1406, 13);
+  addKey("cd", CDInput_Key, 0x1407, 13);
+  addKey("aux", AuxInput_Key, 0x1408, 13);
+  addKey("power", Power_Key, 0x140C, 13);
+  addKey("mute", Mute_Key, 0x140D, 13); // "silent"
+
+  addKey("volup", VolumeUp_Key, 0x1410, 13);
+  addKey("voldown", VolumeDown_Key, 0x1411, 13);
+  addKey("mode", Mode_Key, 0x1420, 13);
+  addKey("trim", Unmapped_Key, 0x1425, 13);
+  addKey("sleep", Sleep_Key, 0x142A, 13);
+
+  addKey("am", TunerBand_Key, 0x1434, 13); // Also wrong!
+  addKey("fm", TunerInput_Key, 0x1435, 13); // Not right!
+  addKey("tmode", FMMode_Key, 0x1436, 13); // ?
+  addKey("info", Info_Key, 0x1437, 13);
+  addKey("p+", ChannelUp_Key, 0x1438, 13);
+  addKey("p-", ChannelDown_Key, 0x1439, 13);
+  addKey("dyn", Unmapped_Key, 0x143E, 13);
+}
diff --git a/keysets/arcam.h b/keysets/arcam.h
new file mode 100644 (file)
index 0000000..5bdac7e
--- /dev/null
@@ -0,0 +1,18 @@
+#ifndef ARCAM_H
+#define ARCAM_H
+
+#include "pirkeysetmetadata.h"
+
+class QObject;
+
+class ArcamReceiver1: public PIRKeysetMetaData
+{
+public:
+  ArcamReceiver1(
+    unsigned int index);
+
+  virtual void populateProtocol(
+    QObject *guiObject);
+};
+
+#endif // ARCAM_H
diff --git a/keysets/dell.cpp b/keysets/dell.cpp
new file mode 100644 (file)
index 0000000..064bedd
--- /dev/null
@@ -0,0 +1,51 @@
+#include "dell.h"
+#include "protocols/mceprotocol.h"
+
+
+DellRemote1::DellRemote1(
+  unsigned int index)
+  : PIRKeysetMetaData(
+      "Remote Keyset 1",
+      Dell_Make,
+      index)
+{
+}
+
+
+void DellRemote1::populateProtocol(
+  QObject *guiObject)
+{
+  if (threadableProtocol)
+  {
+    // Keyset already populated.
+    return;
+  }
+
+  threadableProtocol = new MCEProtocol(guiObject, index, 0x801C);
+
+  setPreData(0x2B, 7);
+
+  addKey("vol_off", Mute_Key, 0x0D, 8);
+
+  addKey("vol+", VolumeUp_Key, 0x10, 8);
+  addKey("vol-", VolumeDown_Key, 0x11, 8);
+
+  addKey("next", Next_Key, 0x20, 8);
+  addKey("prev", Previous_Key, 0x21, 8);
+  addKey("play_pause", Play_Key, 0x2C, 8);
+  addKey("play_pause", Pause_Key, 0x2C, 8);
+  addKey("forward", FastForward_Key, 0x2E, 8);
+  addKey("rewind", Rewind_Key, 0x2F, 8);
+  addKey("stop", Stop_Key, 0x31, 8);
+
+  addKey("cross_up", Up_Key, 0x58, 8);
+  addKey("cross_down", Down_Key, 0x59, 8);
+  addKey("cross_left", Left_Key, 0x5A, 8);
+  addKey("cross_right", Right_Key, 0x5B, 8);
+  addKey("cross_enter", Select_Key, 0x5C, 8);
+
+  addKey("up", PageUp_Key, 0xCE, 8);
+  addKey("down", PageDown_Key, 0xCF, 8);
+
+  addKey("back", Exit_Key, 0xA4, 8);
+}
diff --git a/keysets/dell.h b/keysets/dell.h
new file mode 100644 (file)
index 0000000..4dea012
--- /dev/null
@@ -0,0 +1,18 @@
+#ifndef DELL_H
+#define DELL_H
+
+#include "pirkeysetmetadata.h"
+
+class QObject;
+
+class DellRemote1: public PIRKeysetMetaData
+{
+public:
+  DellRemote1(
+    unsigned int index);
+
+  virtual void populateProtocol(
+    QObject *guiObject);
+};
+
+#endif // DELL_H
diff --git a/keysets/dse.cpp b/keysets/dse.cpp
new file mode 100644 (file)
index 0000000..9a6a253
--- /dev/null
@@ -0,0 +1,142 @@
+#include "dse.h"
+#include "protocols/necprotocol.h"
+
+
+DSEDVD1::DSEDVD1(
+  unsigned int index)
+  : PIRKeysetMetaData(
+      "DVD Keyset 1",
+      DSE_Make,
+      index)
+{
+}
+
+
+void DSEDVD1::populateProtocol(
+  QObject *guiObject)
+{
+  if (threadableProtocol)
+  {
+    // Keyset already populated.
+    return;
+  }
+
+  threadableProtocol = new NECProtocol(guiObject, index, false, true);
+
+  setPreData(0x00, 8);
+
+  addKey("Power", Power_Key, 0x0C, 8);
+  addKey("Open/Close", Eject_Key, 0x0D, 8);
+  addKey("Subtitle", Captions_Key, 0x1E, 8);
+  addKey("Angle", Angle_Key, 0x1F, 8);
+  addKey("Language", Audio_Key, 0x1C, 8);
+  addKey("Resume", Unmapped_Key, 0x1D, 8);
+  addKey("Setup", Menu_Key, 0x14, 8);
+  addKey("Time", Unmapped_Key, 0x09, 8);
+  addKey("Title", DiscTitle_Key, 0x15, 8);
+  addKey("Menu", DiscMenu_Key, 0x16, 8);
+  addKey("A-B", RepeatAB_Key, 0x17, 8);
+  addKey("1", One_Key, 0x00, 8);
+  addKey("2", Two_Key, 0x01, 8);
+  addKey("3", Three_Key, 0x02, 8);
+  addKey("4", Four_Key, 0x03, 8);
+  addKey("5", Five_Key, 0x04, 8);
+  addKey("6", Six_Key, 0x05, 8);
+  addKey("7", Seven_Key, 0x06, 8);
+  addKey("8", Eight_Key, 0x07, 8);
+  addKey("9", Nine_Key, 0x08, 8);
+  addKey("0", Zero_Key, 0x0A, 8);
+  addKey("10+", DoubleDigit_Key, 0x0B, 8);
+  addKey("<<", Rewind_Key, 0x40, 8);
+  addKey(">>", FastForward_Key, 0x41, 8);
+  addKey(">||", Play_Key, 0x44, 8);
+  addKey(">||", Pause_Key, 0x44, 8);
+  addKey("|<<", Previous_Key, 0x42, 8);
+  addKey("Stop", Stop_Key, 0x45, 8);
+  addKey(">>|", Next_Key, 0x43, 8);
+  addKey("Return", Exit_Key, 0x19, 8);
+  addKey("PBC", Unmapped_Key, 0x1A, 8);
+  addKey("Zoom", Zoom_Key, 0x1B, 8);
+  addKey("Repeat", Repeat_Key, 0x18, 8);
+  addKey("LeftArrow", Left_Key, 0x12, 8);
+  addKey("RightArrow", Right_Key, 0x13, 8);
+  addKey("UpArrow", Up_Key, 0x10, 8);
+  addKey("DownArrow", Down_Key, 0x11, 8);
+  addKey("Enter", Select_Key, 0x0E, 8);
+  addKey("OSD", Info_Key, 0x48, 8);
+  addKey("Step", StepForward_Key, 0x49, 8);
+  addKey("3D(*)", Unmapped_Key, 0x4A, 8);
+  addKey("Vol+", VolumeUp_Key, 0x4B, 8);
+  addKey("Vol-", VolumeDown_Key, 0x4F, 8);
+  addKey("View", Unmapped_Key, 0x4C, 8);
+  addKey("Slow", Slow_Key, 0x4D, 8);
+  addKey("Mute", Mute_Key, 0x4E, 8);
+  addKey("N/P", Unmapped_Key, 0x50, 8);
+  addKey("RAN", Unmapped_Key, 0x51, 8);
+  addKey("R/L", Unmapped_Key, 0x52, 8);
+  addKey("Prog", Program_Key, 0x53, 8);
+}
+
+
+DSESat1::DSESat1(
+  unsigned int index)
+  : PIRKeysetMetaData(
+      "Sat Keyset 1",
+      DSE_Make,
+      index)
+{
+}
+
+
+void DSESat1::populateProtocol(
+  QObject *guiObject)
+{
+  if (threadableProtocol)
+  {
+    // Keyset already populated.
+    return;
+  }
+
+  threadableProtocol = new NECProtocol(guiObject, index, false, true);
+
+  setPreData(0x00, 8);
+
+  addKey("Ch_Up", ChannelUp_Key, 0x00, 8);
+  addKey("Ch_Up", Up_Key, 0x00, 8);
+  addKey("Ch_Down", ChannelDown_Key, 0x01, 8);
+  addKey("Ch_Down", Down_Key, 0x01, 8);
+  addKey("Vol+", VolumeUp_Key, 0x02, 8);
+  addKey("Vol+", Right_Key, 0x02, 8);
+  addKey("Vol-", VolumeDown_Key, 0x03, 8);
+  addKey("Vol-", Left_Key, 0x03, 8);
+  addKey("Audio", Audio_Key, 0x04, 8);
+  addKey("Menu", Menu_Key, 0x05, 8);
+  addKey("UHF", Unmapped_Key, 0x06, 8);
+  addKey("Page Up", PageUp_Key, 0x07, 8);
+  addKey("Mute", Mute_Key, 0x08, 8);
+  addKey("Fav", Favorites_Key, 0x09, 8);
+  addKey("Power", Power_Key, 0x0A, 8);
+  addKey("Blue/System", Blue_Key, 0x0B, 8); 
+  addKey("TV/R", Input_Key, 0x0C, 8);
+  addKey("Yellow/F2", Yellow_Key, 0x0E, 8);
+  addKey("Pause", Pause_Key, 0x0F, 8);
+
+  addKey("0", Zero_Key, 0x10, 8);
+  addKey("1", One_Key, 0x11, 8);
+  addKey("2", Two_Key, 0x12, 8);
+  addKey("3", Three_Key, 0x13, 8);
+  addKey("4", Four_Key, 0x14, 8);
+  addKey("5", Five_Key, 0x15, 8);
+  addKey("6", Six_Key, 0x16, 8);
+  addKey("7", Seven_Key, 0x17, 8);
+  addKey("8", Eight_Key, 0x18, 8);
+  addKey("9", Nine_Key, 0x19, 8);
+  addKey("Info", Info_Key, 0x1A, 8);
+  addKey("EPG", Guide_Key, 0x1B, 8);
+  addKey("Exit", Exit_Key, 0x1C, 8);
+  addKey("Page Down", PageDown_Key, 0x1D, 8);
+  addKey("Green/F3", Green_Key, 0x1E, 8);
+  addKey("OK", Select_Key, 0x1F, 8);
+
+  addKey("Red/F1", Red_Key, 0x40, 8);
+}
diff --git a/keysets/dse.h b/keysets/dse.h
new file mode 100644 (file)
index 0000000..3fbf4e6
--- /dev/null
@@ -0,0 +1,28 @@
+#ifndef DSE_H
+#define DSE_H
+
+#include "pirkeysetmetadata.h"
+
+class QObject;
+
+class DSEDVD1: public PIRKeysetMetaData
+{
+public:
+  DSEDVD1(
+    unsigned int index);
+
+  virtual void populateProtocol(
+    QObject *guiObject);
+};
+
+class DSESat1: public PIRKeysetMetaData
+{
+public:
+  DSESat1(
+    unsigned int index);
+
+  virtual void populateProtocol(
+    QObject *guiObject);
+};
+
+#endif // DSE_H
diff --git a/keysets/dynex.cpp b/keysets/dynex.cpp
new file mode 100644 (file)
index 0000000..02d6e57
--- /dev/null
@@ -0,0 +1,72 @@
+#include "dynex.h"
+#include "protocols/necprotocol.h"
+
+
+DynexTV1::DynexTV1(
+  unsigned int index)
+  : PIRKeysetMetaData(
+      "TV Keyset 1",
+      Dynex_Make,
+      index)
+{
+}
+
+
+void DynexTV1::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);
+
+  addKey("1", One_Key, 0x00, 8);
+  addKey("2", Two_Key, 0x01, 8);
+  addKey("3", Three_Key, 0x02, 8);
+  addKey("4", Four_Key, 0x03, 8);
+  addKey("5", Five_Key, 0x04, 8);
+  addKey("6", Six_Key, 0x05, 8);
+  addKey("7", Seven_Key, 0x06, 8);
+  addKey("8", Eight_Key, 0x07, 8);
+  addKey("9", Nine_Key, 0x08, 8);
+  addKey("0", Zero_Key, 0x09, 8);
+  addKey("CHUp", ChannelUp_Key, 0x0A, 8);
+  addKey("CHDown", ChannelDown_Key, 0x0B, 8);
+  addKey("VolUp", VolumeUp_Key, 0x0C, 8);
+  addKey("VolDown", VolumeDown_Key, 0x0D, 8);
+  addKey("Mute", Mute_Key, 0x0E, 8);
+  addKey("Power", Power_Key, 0x0F, 8);
+
+  addKey("recall", PrevChannel_Key, 0x10, 8);
+  addKey("mts/sap", Audio_Key, 0x11, 8);
+  addKey("Sleep", Sleep_Key, 0x13, 8);
+  addKey("Menu", Menu_Key, 0x14, 8);
+  addKey("right arrow", Right_Key, 0x15, 8);
+  addKey("left arrow", Left_Key, 0x16, 8);
+  addKey("info/display", Info_Key, 0x17, 8);
+  addKey("Enter", Select_Key, 0x18, 8);
+  addKey("Reset", Reset_Key, 0x19, 8);
+  addKey("exit", Exit_Key, 0x1B, 8);
+  addKey("ccd", Captions_Key, 0x1C, 8);
+  addKey("input", Input_Key, 0x1D, 8);
+
+  addKey("dot(.)", Dash_Key, 0x41, 8);
+  addKey("up arrow", Up_Key, 0x42, 8);
+  addKey("down arrow", Down_Key, 0x43, 8);
+  addKey("zoom", Zoom_Key, 0x44, 8);
+  addKey("guide", Guide_Key, 0x45, 8);
+  addKey("audio", SoundMode_Key, 0x48, 8);
+  addKey("picture", PictureMode_Key, 0x49, 8);
+  addKey("favorite", Favorites_Key, 0x4B, 8);
+  addKey("comp", PCInput_Key, 0x4D, 8);
+  addKey("hdmi", HDMIInput_Key, 0x50, 8);
+  addKey("video", AuxInput_Key, 0x4C, 8);
+  addKey("tv", AntennaInput_Key, 0x4F, 8);
+
+  addKey("ch-list", Unmapped_Key, 0x86, 8);
+}
diff --git a/keysets/dynex.h b/keysets/dynex.h
new file mode 100644 (file)
index 0000000..bb79760
--- /dev/null
@@ -0,0 +1,18 @@
+#ifndef DYNEX_H
+#define DYNEX_H
+
+#include "pirkeysetmetadata.h"
+
+class QObject;
+
+class DynexTV1: public PIRKeysetMetaData
+{
+public:
+  DynexTV1(
+    unsigned int index);
+
+  virtual void populateProtocol(
+    QObject *guiObject);
+};
+
+#endif // DYNEX_H
index be14584..5be9212 100644 (file)
@@ -1,5 +1,6 @@
 #include "foxtel.h"
 #include "protocols/necprotocol.h"
+#include "protocols/nokia32protocol.h"
 
 
 FoxtelSTB1::FoxtelSTB1(
@@ -59,3 +60,76 @@ void FoxtelSTB1::populateProtocol(
   addKey("Unknown4", Unmapped_Key, 0x1E, 8);
   addKey("Prog-", ChannelDown_Key, 0x1F, 8);
 }
+
+
+FoxtelSTB2::FoxtelSTB2(
+  unsigned int index)
+  : PIRKeysetMetaData(
+      "STB Keyset 2",
+      Foxtel_Make,
+      index)
+{
+}
+
+
+void FoxtelSTB2::populateProtocol(
+  QObject *guiObject)
+{
+  if (threadableProtocol)
+  {
+    // Keyset already populated.
+    return;
+  }
+
+  threadableProtocol = new Nokia32Protocol(guiObject, index);
+
+  setPreData(0x21A0, 16);
+  setPostData(0x26, 7);
+
+  addKey("0", Zero_Key, 0x00, 8);
+  addKey("1", One_Key, 0x01, 8);
+  addKey("2", Two_Key, 0x02, 8);
+  addKey("3", Three_Key, 0x03, 8);
+  addKey("4", Four_Key, 0x04, 8);
+  addKey("5", Five_Key, 0x05, 8);
+  addKey("6", Six_Key, 0x06, 8);
+  addKey("7", Seven_Key, 0x07, 8);
+  addKey("8", Eight_Key, 0x08, 8);
+  addKey("9", Nine_Key, 0x09, 8);
+  addKey("power", Power_Key, 0x0C, 8);
+  addKey("mute", Mute_Key, 0x0D, 8);
+  addKey("display/info", Info_Key, 0x0F, 8);
+  addKey("exit", Info_Key, 0x0F, 8);
+
+  addKey("vol up", VolumeUp_Key, 0x10, 8);
+  addKey("vol down", VolumeDown_Key, 0x11, 8);
+  addKey("channel up", ChannelUp_Key, 0x20, 8);
+  addKey("channel down", ChannelDown_Key, 0x21, 8);
+  addKey("fast fwd", FastForward_Key, 0x28, 8);
+  addKey("rewind", Rewind_Key, 0x29, 8);
+  addKey("play", Play_Key, 0x2C, 8);
+
+  addKey("pause", Pause_Key, 0x30, 8);
+  addKey("stop", Stop_Key, 0x31, 8);
+  addKey("record", Record_Key, 0x37, 8);
+  addKey("tv/vcr", Input_Key, 0x38, 8);
+
+  addKey("Setup", Unmapped_Key, 0x54, 8);
+  addKey("up arrow", Up_Key, 0x58, 8);
+  addKey("down arrow", Down_Key, 0x59, 8);
+  addKey("left arrow", Left_Key, 0x5A, 8);
+  addKey("right arrow", Right_Key, 0x5B, 8);
+  addKey("select", Select_Key, 0x5C, 8);
+
+  addKey("red", Red_Key, 0x6D, 8);
+  addKey("green", Green_Key, 0x6E, 8);
+  addKey("yellow", Yellow_Key, 0x6F, 8);
+  addKey("blue", Blue_Key, 0x70, 8);
+  addKey("help", Unmapped_Key, 0x81, 8);
+  addKey("last/prev ch", PrevChannel_Key, 0x83, 8);
+  addKey("Foxtel", Unmapped_Key, 0x8E, 8);
+  addKey("program/guide", Guide_Key, 0xCC, 8);
+  addKey("BoxOffice", Unmapped_Key, 0xD5, 8);
+  addKey("Planner", Unmapped_Key, 0xF4, 8);
+  addKey("Active", Menu_Key, 0xFD, 8);
+}
index 24c2d59..ea9a4d9 100644 (file)
@@ -15,4 +15,14 @@ public:
     QObject *guiObject);
 };
 
+class FoxtelSTB2: public PIRKeysetMetaData
+{
+public:
+  FoxtelSTB2(
+    unsigned int index);
+
+  virtual void populateProtocol(
+    QObject *guiObject);
+};
+
 #endif // FOXTEL_H
diff --git a/keysets/harmankardon.cpp b/keysets/harmankardon.cpp
new file mode 100644 (file)
index 0000000..8ba3adb
--- /dev/null
@@ -0,0 +1,472 @@
+#include "harmankardon.h"
+#include "protocols/necprotocol.h"
+
+
+HarmanKardonAmp1::HarmanKardonAmp1(
+  unsigned int index)
+  : PIRKeysetMetaData(
+      "Amp/Receiver Component 1",
+      HarmanKardon_Make,
+      index)
+{
+}
+
+
+void HarmanKardonAmp1::populateProtocol(
+  QObject *guiObject)
+{
+  if (threadableProtocol)
+  {
+    // Keyset already populated.
+    return;
+  }
+
+  threadableProtocol = new NECProtocol(guiObject, index, true, true);
+
+  setPreData(0x7080, 16);
+
+  addKey("CD_STOP", Stop_Key, 0x01, 8);
+  addKey("CD_PLAY", Play_Key, 0x02, 8);
+  addKey("CD_PAUSE", Pause_Key, 0x03, 8);
+  addKey("CD_NEXT", Next_Key, 0x04, 8);
+  addKey("CD_PREV", Previous_Key, 0x05, 8);
+  addKey("CD_FWD", FastForward_Key, 0x06, 8);
+  addKey("CD_BKW", Rewind_Key, 0x07, 8);
+  addKey("CD_AB", RepeatAB_Key, 0x0B, 8);
+  addKey("CD_INTRO", Unmapped_Key, 0x0D, 8);
+
+  addKey("CD_DISC", NextDisc_Key, 0x50, 8);
+
+  addKey("FM", TunerBand_Key, 0x81, 8); // "am/fm"
+  addKey("AM", Unmapped_Key, 0x82, 8);
+  addKey("TUNEUP", ChannelUp_Key, 0x84, 8);
+  addKey("TUNEDN", ChannelDown_Key, 0x85, 8);
+  addKey("mem", Memory_Key, 0x86, 8);
+  addKey("1", One_Key, 0x87, 8);
+  addKey("2", Two_Key, 0x88, 8);
+  addKey("3", Three_Key, 0x89, 8);
+  addKey("4", Four_Key, 0x8A, 8);
+  addKey("5", Five_Key, 0x8B, 8);
+  addKey("6", Six_Key, 0x8C, 8);
+  addKey("7", Seven_Key, 0x8D, 8);
+  addKey("8", Eight_Key, 0x8E, 8);
+  addKey("shift", Unmapped_Key, 0x8F, 8);
+
+  addKey("seek-st", Unmapped_Key, 0x91, 8);
+  addKey("tun-m", Unmapped_Key, 0x93, 8);
+  addKey("PSCAN", Scan_Key, 0x96, 8);
+  addKey("direct", Unmapped_Key, 0x9B, 8);
+  addKey("9", Nine_Key, 0x9D, 8);
+  addKey("0", Zero_Key, 0x9E, 8);
+  addKey("pow_off", PowerOff_Key, 0x9F, 8);
+
+  addKey("STANDBY", Power_Key, 0xC0, 8); // "pow_on"
+  addKey("MUTE", Mute_Key, 0xC1, 8);
+  addKey("Phono", PhonoInput_Key, 0xC2, 8);
+  addKey("TUNER", TunerInput_Key, 0xC3, 8);
+  addKey("CD", CDInput_Key, 0xC4, 8);
+  addKey("video", Unmapped_Key, 0xC6, 8);
+  addKey("VOLUP", VolumeUp_Key, 0xC7, 8);
+  addKey("VOLDN", VolumeDown_Key, 0xC8, 8);
+  addKey("VCR1", VCRInput_Key, 0xCA, 8);
+  addKey("VCR2", Unmapped_Key, 0xCB, 8);
+  addKey("source_tape", TapeInput_Key, 0xCC, 8);
+  addKey("TAPEMON", Unmapped_Key, 0xCD, 8); // "Tape2"
+  addKey("TVAUX", AuxInput_Key, 0xCE, 8);
+
+  addKey("source_dvd", DVDInput_Key, 0xD0, 8);
+  addKey("source_vid4", Unmapped_Key, 0xD1, 8);
+  addKey("aux2", Unmapped_Key, 0xD5, 8);
+  addKey("S_REARUP", RearVolumeUp_Key, 0xD7, 8);
+  addKey("S_REARDN", RearVolumeDown_Key, 0xD8, 8);
+  addKey("S_CNTUP", CenterVolumeUp_Key, 0xD9, 8);
+  addKey("S_CNTDN", CenterVolumeDown_Key, 0xDA, 8);
+  addKey("SLEEP", Sleep_Key, 0xDB, 8);
+  addKey("DISPLAY", Info_Key, 0xDC, 8);
+}
+
+
+HarmanKardonAmp2::HarmanKardonAmp2(
+  unsigned int index)
+  : PIRKeysetMetaData(
+      "Amp Component 2",
+      HarmanKardon_Make,
+      index)
+{
+}
+
+
+void HarmanKardonAmp2::populateProtocol(
+  QObject *guiObject)
+{
+  if (threadableProtocol)
+  {
+    // Keyset already populated.
+    return;
+  }
+
+  threadableProtocol = new NECProtocol(guiObject, index, true, true);
+
+  setPreData(0x7686, 16);
+
+  addKey("on", PowerOn_Key, 0x40, 8);
+  addKey("off", PowerOff_Key, 0x41, 8);
+  addKey("speaker1", Unmapped_Key, 0x42, 8);
+  addKey("speaker2", Unmapped_Key, 0x43, 8);
+  addKey("phono", PhonoInput_Key, 0x44, 8);
+  addKey("cd", CDInput_Key, 0x48, 8);
+  addKey("vid1", Unmapped_Key, 0x4B, 8);
+  addKey("vid2", Unmapped_Key, 0x4C, 8);
+  addKey("vid3", Unmapped_Key, 0x4D, 8);
+  addKey("fm", Unmapped_Key, 0x46, 8);
+  addKey("am", Unmapped_Key, 0x45, 8);
+  addKey("tapemon", Unmapped_Key, 0x4A, 8);
+  addKey("vol+", VolumeUp_Key, 0x54, 8);
+  addKey("vol-", VolumeDown_Key, 0x53, 8);
+  addKey("mute", Mute_Key, 0x5A, 8);
+  addKey("dimmer", Unmapped_Key, 0x5C, 8);
+  addKey("sleep", Sleep_Key, 0x5B, 8);
+}
+
+
+HarmanKardonReceiver2::HarmanKardonReceiver2(
+  unsigned int index)
+  : PIRKeysetMetaData(
+      "Receiver Component 2",
+      HarmanKardon_Make,
+      index)
+{
+}
+
+
+void HarmanKardonReceiver2::populateProtocol(
+  QObject *guiObject)
+{
+  if (threadableProtocol)
+  {
+    // Keyset already populated.
+    return;
+  }
+
+  threadableProtocol = new NECProtocol(guiObject, index, true, true);
+
+  setPreData(0x7080, 16);
+
+  addKey("fm_mode", FMMode_Key, 0x3C, 8);
+  addKey("auto_preset", Unmapped_Key, 0x61, 8);
+  addKey("1", One_Key, 0x31, 8);
+  addKey("2", Two_Key, 0x32, 8);
+  addKey("3", Three_Key, 0x33, 8);
+  addKey("4", Four_Key, 0x34, 8);
+  addKey("5", Five_Key, 0x35, 8);
+  addKey("6", Six_Key, 0x36, 8);
+  addKey("7", Seven_Key, 0x37, 8);
+  addKey("8", Eight_Key, 0x38, 8);
+  addKey("9", Nine_Key, 0x39, 8);
+  addKey("direct", Unmapped_Key, 0x6A, 8);
+  addKey("0", Zero_Key, 0x30, 8);
+  addKey("clear", Clear_Key, 0x2F, 8);
+  addKey("memory", Memory_Key, 0x2E, 8);
+  addKey("up", Up_Key, 0x28, 8);
+  addKey("left", Left_Key, 0x3F, 8);
+  addKey("ok", Select_Key, 0x6D, 8);
+  addKey("right", Right_Key, 0x3E, 8);
+  addKey("down", Down_Key, 0x29, 8);
+  addKey("preset_scan", Scan_Key, 0x2D, 8);
+  addKey("tune_up", ChannelUp_Key, 0x76, 8);
+  addKey("tune_down", ChannelDown_Key, 0x77, 8);
+  addKey("prev", Previous_Key, 0x25, 8);
+  addKey("pause", Pause_Key, 0x23, 8);
+  addKey("next", Next_Key, 0x24, 8);
+  addKey("rev", Rewind_Key, 0x27, 8);
+  addKey("play", Play_Key, 0x22, 8);
+  addKey("ffw", FastForward_Key, 0x26, 8);
+  addKey("rec", Record_Key, 0x60, 8);
+  addKey("stop", Stop_Key, 0x21, 8);
+}
+
+
+HarmanKardonTape1::HarmanKardonTape1(
+  unsigned int index)
+  : PIRKeysetMetaData(
+      "Tape Component 1",
+      HarmanKardon_Make,
+      index)
+{
+}
+
+
+void HarmanKardonTape1::populateProtocol(
+  QObject *guiObject)
+{
+  if (threadableProtocol)
+  {
+    // Keyset already populated:
+    return;
+  }
+
+  threadableProtocol = new NECProtocol(guiObject, index, true, true);
+
+  setPreData(0x7282, 16);
+
+  addKey("C_NEXT", Next_Key, 0x01, 8);
+  addKey("C_PREV", Previous_Key, 0x02, 8);
+  addKey("C_STOP", Stop_Key, 0x03, 8);
+  addKey("C_FWD", FastForward_Key, 0x04, 8);
+  addKey("C_BKW", Rewind_Key, 0x05, 8);
+//  addKey("C_REC", Record_Key, 0x06, 8);
+  addKey("CassDeckPause", Pause_Key, 0x06, 8);
+
+  addKey("C_SELECT", Select_Key, 0x1D, 8);
+
+  addKey("dolby", NoiseReduction_Key, 0x50, 8);
+  addKey("delay", Unmapped_Key, 0x52, 8);
+  addKey("spkr", Unmapped_Key, 0x53, 8);
+  addKey("digital", Unmapped_Key, 0x54, 8);
+  addKey("surr", Surround_Key, 0x58, 8);
+  addKey("osd", Info_Key, 0x5C, 8);
+  addKey("ch", Unmapped_Key, 0x5D, 8);
+
+  addKey("set", Select_Key, 0x84, 8);
+  addKey("S_OFF", Unmapped_Key, 0x89, 8);
+//  addKey("S_DELAY", Unmapped_Key, 0x8A, 8);
+  addKey("^", Up_Key, 0x8A, 8);
+  addKey("v", Down_Key, 0x8B, 8);
+  addKey("S_TEST", Unmapped_Key, 0x8C, 8);
+  addKey("S_CNTMODE", Unmapped_Key, 0x8D, 8);
+  addKey("Theater", Unmapped_Key, 0x92, 8);
+  addKey("Stadium", Unmapped_Key, 0x94, 8);
+  addKey("night", Unmapped_Key, 0x96, 8);
+  addKey("stereo", Unmapped_Key, 0x9B, 8);
+  addKey("S_3STEREO", Unmapped_Key, 0x9D, 8);
+  addKey("S_PROLOGIC", Unmapped_Key, 0x9F, 8);
+
+  addKey("dts_surr", Unmapped_Key, 0xA0, 8);
+  addKey("dts_neo:6", Unmapped_Key, 0xA1, 8);
+  addKey("<", Left_Key, 0xC1, 8);
+  addKey(">", Right_Key, 0xC2, 8);
+  addKey("preset+", ChannelUp_Key, 0xD0, 8);
+  addKey("preset-", ChannelDown_Key, 0xD1, 8);
+  addKey("clear", Clear_Key, 0xD9, 8);
+  addKey("logic_7", Unmapped_Key, 0xDA, 8);
+  addKey("source_6/8ch", Unmapped_Key, 0xDB, 8);
+  addKey("d.skip", NextDisc_Key, 0xDD, 8);
+  addKey("mroom", Unmapped_Key, 0xDF, 8);
+}
+
+
+HarmanKardonDVD1::HarmanKardonDVD1(
+  unsigned int index)
+  : PIRKeysetMetaData(
+      "DVD Keyset 1",
+      HarmanKardon_Make,
+      index)
+{
+}
+
+
+void HarmanKardonDVD1::populateProtocol(
+  QObject *guiObject)
+{
+  if (threadableProtocol)
+  {
+    // Keyset already populated.
+    return;
+  }
+
+  threadableProtocol = new NECProtocol(guiObject, index, true, true);
+
+  setPreData(0x7282, 16);
+
+  addKey("Open/Close", Eject_Key, 0x20, 8);
+  addKey("ON", PowerOn_Key, 0x21, 8);
+  addKey("OFF", PowerOff_Key, 0x22, 8);
+  addKey("Title", DiscTitle_Key, 0x23, 8);
+  addKey("Menu", DiscMenu_Key, 0x24, 8);
+  addKey("Return", Exit_Key, 0x25, 8);
+  addKey("Up", Up_Key, 0x26, 8);
+  addKey("Down", Down_Key, 0x27, 8);
+  addKey("Left", Left_Key, 0x28, 8);
+  addKey("Right", Right_Key, 0x29, 8);
+  addKey("Enter", Select_Key, 0x2A, 8);
+  addKey("Play", Play_Key, 0x2B, 8);
+  addKey("Pause", Pause_Key, 0x2C, 8);
+  addKey("Stop", Stop_Key, 0x2D, 8);
+  addKey("SearchBack", Rewind_Key, 0x2E, 8);
+  addKey("SearchForward", FastForward_Key, 0x2F, 8);
+
+  addKey("Prev.", Previous_Key, 0x30, 8);
+  addKey("Next", Next_Key, 0x31, 8);
+  addKey("Subtitle", Unmapped_Key, 0x33, 8);
+  addKey("SubtitleON/OFF", Captions_Key, 0x34, 8);
+  addKey("Audio", Audio_Key, 0x35, 8);
+  addKey("Angle", Angle_Key, 0x36, 8);
+  addKey("Status", Info_Key, 0x39, 8);
+  addKey("SlowBack", SlowMinus_Key, 0x3A, 8);
+  addKey("SlowForward", SlowPlus_Key, 0x3B, 8);
+  addKey("StepBack", StepBack_Key, 0x3C, 8);
+  addKey("StepForward", StepForward_Key, 0x3D, 8);
+  addKey("Zoom", Zoom_Key, 0x3E, 8);
+
+  addKey("0", Zero_Key, 0x60, 8);
+  addKey("1", One_Key, 0x61, 8);
+  addKey("2", Two_Key, 0x62, 8);
+  addKey("3", Three_Key, 0x63, 8);
+  addKey("4", Four_Key, 0x64, 8);
+  addKey("5", Five_Key, 0x65, 8);
+  addKey("6", Six_Key, 0x66, 8);
+  addKey("7", Seven_Key, 0x67, 8);
+  addKey("8", Eight_Key, 0x68, 8);
+  addKey("9", Nine_Key, 0x69, 8);
+  addKey("Prog.", Program_Key, 0x6A, 8);
+  addKey("Check", Unmapped_Key, 0x6B, 8);
+  addKey("Clear", Clear_Key, 0x6C, 8);
+  addKey("Random", Random_Key, 0x6D, 8);
+  addKey("Repeat", Repeat_Key, 0x6E, 8);
+  addKey("A-B", RepeatAB_Key, 0x6F, 8);
+
+  addKey("Playlist", Unmapped_Key, 0xB0, 8);
+}
+
+
+HarmanKardonDVD1a::HarmanKardonDVD1a(
+  unsigned int index)
+  : HarmanKardonDVD1(index)
+{
+  setKeysetName("DVD Keyset 1a");
+}
+
+
+void HarmanKardonDVD1a::populateProtocol(
+  QObject *guiObject)
+{
+  if (threadableProtocol)
+  {
+    // Keyset already populated.
+    return;
+  }
+
+  HarmanKardonDVD1::populateProtocol(guiObject);
+
+  addKey("OSD", Unmapped_Key, 0x24, 8);
+  addKey("Subtitle", Captions_Key, 0x33, 8);
+  addKey("Disc/Menu", DiscMenu_Key, 0x4C, 8);
+  addKey("Info", Info_Key, 0x4D, 8);
+  addKey("V.Off", Unmapped_Key, 0x4E, 8);
+  addKey("Display", Unmapped_Key, 0xB3, 8);
+  addKey("Pic+", Unmapped_Key, 0xB4, 8);
+  addKey("Pic-", Unmapped_Key, 0xB5, 8);
+}
+
+
+HarmanKardonCD1::HarmanKardonCD1(
+  unsigned int index)
+  : PIRKeysetMetaData(
+      "CD Keyset 1",
+      HarmanKardon_Make,
+      index)
+{
+}
+
+
+void HarmanKardonCD1::populateProtocol(
+  QObject *guiObject)
+{
+  if (threadableProtocol)
+  {
+    // Keyset already populated.
+    return;
+  }
+
+  threadableProtocol = new NECProtocol(guiObject, index, true, true);
+
+  setPreData(0x4A83, 16);
+
+  addKey("1", One_Key, 0x1C, 8);
+  addKey("2", Two_Key, 0x1D, 8);
+  addKey("3", Three_Key, 0x1E, 8);
+  addKey("4", Four_Key, 0x1F, 8);
+  addKey("5", Five_Key, 0x18, 8);
+  addKey("6", Six_Key, 0x19, 8);
+  addKey("7", Seven_Key, 0x1A, 8);
+  addKey("8", Eight_Key, 0x1B, 8);
+  addKey("9", Nine_Key, 0x14, 8);
+  addKey("0", Zero_Key, 0x15, 8);
+  addKey("intro", Unmapped_Key, 0x10, 8);
+  addKey("prog/rev", Program_Key, 0x16, 8);
+  addKey("tape_size", Unmapped_Key, 0x17, 8);
+  addKey("edit", Unmapped_Key, 0x0E, 8);
+  addKey("repeat_1/all", Repeat_Key, 0x0C, 8);
+  addKey("repeat_a/b", RepeatAB_Key, 0x0D, 8);
+  addKey("random", Random_Key, 0x11, 8);
+  addKey("delete", Unmapped_Key, 0x0A, 8);
+  addKey("display", Info_Key, 0x12, 8);
+  addKey("time", Unmapped_Key, 0x0F, 8);
+  addKey("skip_backward", Previous_Key, 0x04, 8);
+  addKey("skip_forward", Next_Key, 0x05, 8);
+  addKey("pause", Pause_Key, 0x07, 8);
+  addKey("stop", Stop_Key, 0x0B, 8);
+  addKey("fast_backward", Rewind_Key, 0x00, 8);
+  addKey("fast_forward", FastForward_Key, 0x01, 8);
+  addKey("play", Play_Key, 0x03, 8);
+}
+
+
+HarmanKardonCD2::HarmanKardonCD2(
+  unsigned int index)
+  : PIRKeysetMetaData(
+      "CD Keyset 2",
+      HarmanKardon_Make,
+      index)
+{
+}
+
+
+void HarmanKardonCD2::populateProtocol(
+  QObject *guiObject)
+{
+  if (threadableProtocol)
+  {
+    // Keyset already populated.
+    return;
+  }
+
+  threadableProtocol = new NECProtocol(guiObject, index, true, true);
+
+  setPreData(0x7080, 16);
+
+  addKey("stop", Stop_Key, 0x01, 8);
+  addKey("play", Play_Key, 0x02, 8);
+  addKey("pause", Pause_Key, 0x03, 8);
+  addKey("skipnext", Next_Key, 0x04, 8);
+  addKey("skipprev", Previous_Key, 0x05, 8);
+  addKey("searchnext", FastForward_Key, 0x06, 8);
+  addKey("searchprev", Rewind_Key, 0x07, 8);
+  addKey("repeat", Repeat_Key, 0x0A, 8);
+  addKey("ab", RepeatAB_Key, 0x0B, 8);
+  addKey("intro", Unmapped_Key, 0x0D, 8);
+  addKey("program", Program_Key, 0x0E, 8);
+  addKey("clear", Clear_Key, 0x0F, 8);
+
+  addKey("1", One_Key, 0x11, 8);
+  addKey("2", Two_Key, 0x12, 8);
+  addKey("3", Three_Key, 0x13, 8);
+  addKey("4", Four_Key, 0x14, 8);
+  addKey("5", Five_Key, 0x15, 8);
+  addKey("6", Six_Key, 0x16, 8);
+  addKey("7", Seven_Key, 0x17, 8);
+  addKey("8", Eight_Key, 0x18, 8);
+  addKey("9", Nine_Key, 0x19, 8);
+  addKey("check", Unmapped_Key, 0x1B, 8);
+  addKey("time", Unmapped_Key, 0x1C, 8);
+  addKey("display", Info_Key, 0x1D, 8);
+
+  addKey("0", Zero_Key, 0x40, 8);
+  addKey("edit", Unmapped_Key, 0x4C, 8);
+  addKey("random", Random_Key, 0x4D, 8);
+
+  addKey("CD_DISC", NextDisc_Key, 0x50, 8);
+  addKey("on", PowerOn_Key, 0x56, 8);
+  addKey("off", PowerOff_Key, 0x57, 8);
+  addKey("tapesize", Unmapped_Key, 0x5C, 8);
+}
diff --git a/keysets/harmankardon.h b/keysets/harmankardon.h
new file mode 100644 (file)
index 0000000..032a5f3
--- /dev/null
@@ -0,0 +1,88 @@
+#ifndef HARMANKARDON_H
+#define HARMANKARDON_H
+
+#include "pirkeysetmetadata.h"
+
+class QObject;
+
+class HarmanKardonAmp1: public PIRKeysetMetaData
+{
+public:
+  HarmanKardonAmp1(
+    unsigned int index);
+
+  virtual void populateProtocol(
+    QObject *guiObject);
+};
+
+class HarmanKardonAmp2: public PIRKeysetMetaData
+{
+public:
+  HarmanKardonAmp2(
+    unsigned int index);
+
+  virtual void populateProtocol(
+    QObject *guiObject);
+};
+
+class HarmanKardonReceiver2: public PIRKeysetMetaData
+{
+public:
+  HarmanKardonReceiver2(
+    unsigned int index);
+
+  virtual void populateProtocol(
+    QObject *guiObject);
+};
+
+class HarmanKardonTape1: public PIRKeysetMetaData
+{
+public:
+  HarmanKardonTape1(
+    unsigned int index);
+
+  virtual void populateProtocol(
+    QObject *guiObject);
+};
+
+class HarmanKardonDVD1: public PIRKeysetMetaData
+{
+public:
+  HarmanKardonDVD1(
+    unsigned int index);
+
+  virtual void populateProtocol(
+    QObject *guiObject);
+};
+
+class HarmanKardonDVD1a: public HarmanKardonDVD1
+{
+public:
+  HarmanKardonDVD1a(
+    unsigned int index);
+
+  virtual void populateProtocol(
+    QObject *guiObject);
+};
+
+class HarmanKardonCD1: public PIRKeysetMetaData
+{
+public:
+  HarmanKardonCD1(
+    unsigned int index);
+
+  virtual void populateProtocol(
+    QObject *guiObject);
+};
+
+class HarmanKardonCD2: public PIRKeysetMetaData
+{
+public:
+  HarmanKardonCD2(
+    unsigned int index);
+
+  virtual void populateProtocol(
+    QObject *guiObject);
+};
+
+#endif // HARMANKARDON_H
diff --git a/keysets/kathrein.cpp b/keysets/kathrein.cpp
new file mode 100644 (file)
index 0000000..5806178
--- /dev/null
@@ -0,0 +1,195 @@
+#include "kathrein.h"
+#include "protocols/kathreinprotocol.h"
+#include "protocols/nokia32protocol.h"
+#include "protocols/mceprotocol.h"
+
+
+KathreinSat1::KathreinSat1(
+  unsigned int index)
+  : PIRKeysetMetaData(
+      "Sat Keyset 1",
+      Kathrein_Make,
+      index)
+{
+}
+
+
+void KathreinSat1::populateProtocol(
+  QObject *guiObject)
+{
+  if (threadableProtocol)
+  {
+    // Keyset already populated.
+    return;
+  }
+
+  threadableProtocol = new KathreinProtocol(guiObject, index);
+
+  setPreData(0x0, 4);
+
+  addKey("ab", Unmapped_Key, 0x23, 8);
+  addKey("f", Unmapped_Key, 0x9B, 8);
+  addKey("off", PowerOff_Key, 0x25, 8);
+  addKey("l", Unmapped_Key, 0x57, 8);
+  addKey("mid", Unmapped_Key, 0x59, 8);
+  addKey("i", Unmapped_Key, 0x19, 8);
+  addKey("clock", Unmapped_Key, 0x21, 8);
+  addKey("tv", Input_Key, 0x1F, 8);
+  addKey("up", Up_Key, 0x2F, 8);
+  addKey("dwn", Down_Key, 0x31, 8);
+  addKey("ok", Select_Key, 0x1D, 8);
+  addKey("vol-", VolumeDown_Key, 0x2D, 8);
+  addKey("vol+", VolumeUp_Key, 0x2B, 8);
+  addKey("mute", Mute_Key, 0x27, 8);
+  addKey("stero", Audio_Key, 0x85, 8);
+  addKey("r", Unmapped_Key, 0x1B, 8);
+  addKey("0", Zero_Key, 0x01, 8);
+  addKey("1", One_Key, 0x03, 8);
+  addKey("2", Two_Key, 0x05, 8);
+  addKey("3", Three_Key, 0x07, 8);
+  addKey("4", Four_Key, 0x09, 8);
+  addKey("5", Five_Key, 0x0B, 8);
+  addKey("6", Six_Key, 0x0D, 8);
+  addKey("7", Seven_Key, 0x0F, 8);
+  addKey("8", Eight_Key, 0x11, 8);
+  addKey("9", Nine_Key, 0x13, 8);
+}
+
+
+KathreinSat2::KathreinSat2(
+  unsigned int index)
+  : PIRKeysetMetaData(
+      "Sat Keyset 2",
+      Kathrein_Make,
+      index)
+{
+}
+
+
+void KathreinSat2::populateProtocol(
+  QObject *guiObject)
+{
+  if (threadableProtocol)
+  {
+    // Keyset already populated
+    return;
+  }
+
+  threadableProtocol = new Nokia32Protocol(guiObject, index);
+
+  setPreData(0x2290, 16);
+  setPostData(0x00, 7);
+
+  addKey("0", Zero_Key, 0x00, 8);
+  addKey("1", One_Key, 0x01, 8);
+  addKey("2", Two_Key, 0x02, 8);
+  addKey("3", Three_Key, 0x03, 8);
+  addKey("4", Four_Key, 0x04, 8);
+  addKey("5", Five_Key, 0x05, 8);
+  addKey("6", Six_Key, 0x06, 8);
+  addKey("7", Seven_Key, 0x07, 8);
+  addKey("8", Eight_Key, 0x08, 8);
+  addKey("9", Nine_Key, 0x09, 8);
+  addKey("power", Power_Key, 0x0C, 8);
+  addKey("mute", Mute_Key, 0x0D, 8);
+  addKey("+10{-/--}", DoubleDigit_Key, 0x0F, 8);
+
+  addKey("vol+", VolumeUp_Key, 0x10, 8);
+  addKey("vol-", VolumeDown_Key, 0x11, 8);
+  addKey("ch+", ChannelUp_Key, 0x1E, 8);
+  addKey("ch-", ChannelDown_Key, 0x1F, 8);
+
+  addKey("FFWD", FastForward_Key, 0x20, 8);
+  addKey("REW", Rewind_Key, 0x21, 8);
+  addKey("pause", Pause_Key, 0x31, 8);
+  addKey("B/STOP", Stop_Key, 0x31, 8);
+  addKey("A", Record_Key, 0x37, 8); // "Record"
+  addKey("PLAY", Play_Key, 0x38, 8);
+  addKey("PAUSE", Pause_Key, 0x39, 8);
+  addKey("rewind", Teletext_Key, 0x3C, 8); // "Teletext"
+
+  addKey("C", Menu_Key, 0x54, 8); // "Menu"
+  addKey("exit", Exit_Key, 0x55, 8);
+  addKey("up", Up_Key, 0x58, 8);
+  addKey("down", Down_Key, 0x59, 8);
+  addKey("left", Left_Key, 0x5A, 8);
+  addKey("right", Right_Key, 0x5B, 8);
+  addKey("select", Select_Key, 0x5C, 8);
+
+  addKey("ffwd", Red_Key, 0x6D, 8); // "Red"
+  addKey("stop", Green_Key, 0x6E, 8); // "Green"
+  addKey("record", Yellow_Key, 0x6F, 8); // "Yellow"
+  addKey("auto", Blue_Key, 0x70, 8); // "Blue"
+
+  addKey("menu", Guide_Key, 0xCC, 8); // "Guide"
+}
+
+
+KathreinSat3::KathreinSat3(
+  unsigned int index)
+  : PIRKeysetMetaData(
+      "Sat Keyset 3",
+      Kathrein_Make,
+      index)
+{
+}
+
+
+void KathreinSat3::populateProtocol(
+  QObject *guiObject)
+{
+  if (threadableProtocol)
+  {
+    // Keyset already populated.
+    return;
+  }
+
+  threadableProtocol = new MCEProtocol(guiObject, index, 0x8046);
+
+  setPreData(0x00, 7);
+
+  addKey("num_0", Zero_Key, 0x00, 8);
+  addKey("num_1", One_Key, 0x01, 8);
+  addKey("num_2", Two_Key, 0x02, 8);
+  addKey("num_3", Three_Key, 0x03, 8);
+  addKey("num_4", Four_Key, 0x04, 8);
+  addKey("num_5", Five_Key, 0x05, 8);
+  addKey("num_6", Six_Key, 0x06, 8);
+  addKey("num_7", Seven_Key, 0x07, 8);
+  addKey("num_8", Eight_Key, 0x08, 8);
+  addKey("num_9", Nine_Key, 0x09, 8);
+  addKey("Power", Power_Key, 0x0C, 8);
+  addKey("Mute", Mute_Key, 0x0D, 8);
+  addKey("Info", Info_Key, 0x0F, 8);
+
+  addKey("VOL+", VolumeUp_Key, 0x10, 8);
+  addKey("VOL-", VolumeDown_Key, 0x11, 8);
+  addKey("CH+", ChannelUp_Key, 0x1E, 8);
+  addKey("CH-", ChannelDown_Key, 0x1F, 8);
+
+  addKey("ffwd", FastForward_Key, 0x20, 8);
+  addKey("rewind", Rewind_Key, 0x21, 8);
+  addKey("Stop", Stop_Key, 0x31, 8);
+  addKey("Record", Record_Key, 0x37, 8);
+  addKey("Play", Play_Key, 0x38, 8);
+  addKey("Pause", Pause_Key, 0x39, 8);
+  addKey("Teletext", Teletext_Key, 0x3C, 8);
+  addKey("Archive", Unmapped_Key, 0x46, 8);
+
+  addKey("Menu", Menu_Key, 0x54, 8);
+  addKey("Last_ch", PrevChannel_Key, 0x55, 8);
+  addKey("Exit", Exit_Key, 0x55, 8);
+  addKey("up_arrow", Up_Key, 0x58, 8);
+  addKey("down_arrow", Down_Key, 0x59, 8);
+  addKey("left_arrow", Left_Key, 0x5A, 8);
+  addKey("right_arrow", Right_Key, 0x5B, 8);
+  addKey("Select", Select_Key, 0x5C, 8);
+
+  addKey("Red", Red_Key, 0x6D, 8);
+  addKey("Green", Green_Key, 0x6E, 8);
+  addKey("Yellow", Yellow_Key, 0x6F, 8);
+  addKey("Blue", Blue_Key, 0x70, 8);
+  addKey("Help", Unmapped_Key, 0x81, 8);
+  addKey("Guide", Guide_Key, 0xCC, 8);
+  addKey("Media", Unmapped_Key, 0xD5, 8);
+}
diff --git a/keysets/kathrein.h b/keysets/kathrein.h
new file mode 100644 (file)
index 0000000..8f14979
--- /dev/null
@@ -0,0 +1,38 @@
+#ifndef KATHREIN_H
+#define KATHREIN_H
+
+#include "pirkeysetmetadata.h"
+
+class QObject;
+
+class KathreinSat1: public PIRKeysetMetaData
+{
+public:
+  KathreinSat1(
+    unsigned int index);
+
+  virtual void populateProtocol(
+    QObject *guiObject);
+};
+
+class KathreinSat2: public PIRKeysetMetaData
+{
+public:
+  KathreinSat2(
+    unsigned int index);
+
+  virtual void populateProtocol(
+    QObject *guiObject);
+};
+
+class KathreinSat3: public PIRKeysetMetaData
+{
+public:
+  KathreinSat3(
+    unsigned int index);
+
+  virtual void populateProtocol(
+    QObject *guiObject);
+};
+
+#endif // KATHREIN_H
index ea36139..60df8d3 100644 (file)
@@ -692,9 +692,9 @@ void LGAC1::populateProtocol(
   setPreData(0x6681, 16);
 
   addKey("power", Power_Key, 0x81, 8);
-  addKey("temp up", Red_Key, 0x85, 8);
-  addKey("temp down", Blue_Key, 0x8A, 8);
-  addKey("timer", Sleep_Key, 0x90, 8);
-  addKey("fan speed", SoundMode_Key, 0x99, 8);
-  addKey("mode", PictureMode_Key, 0x9B, 8);
+  addKey("temp up", TempUp_Key, 0x85, 8);
+  addKey("temp down", TempDown_Key, 0x8A, 8);
+  addKey("timer", Timer_Key, 0x90, 8);
+  addKey("fan speed", FanFaster_Key, 0x99, 8);
+  addKey("mode", Mode_Key, 0x9B, 8);
 }
index e03f25b..5c7792a 100644 (file)
@@ -44,3 +44,79 @@ void LogitechSpeakers::populateProtocol(
   addKey("settings", Blue_Key, 0x1F, 8);
   addKey("vol+", VolumeUp_Key, 0x1A, 8);
 }
+
+
+LogitechSqueezebox::LogitechSqueezebox(
+  unsigned int index)
+  : PIRKeysetMetaData(
+      "Squeezebox Keyset",
+      Logitech_Make,
+      index)
+{
+}
+
+
+void LogitechSqueezebox::populateProtocol(
+  QObject *guiObject)
+{
+  if (threadableProtocol)
+  {
+    // Keyset already populated
+    return;
+  }
+
+  threadableProtocol = new NECProtocol(guiObject, index, false, true);
+
+  setPreData(0x6E, 8);
+
+  addKey("Add", Unmapped_Key, 0x06, 8);
+  addKey("Brightness", Unmapped_Key, 0x20, 8);
+  addKey("Browse", Unmapped_Key, 0x0E, 8);
+  addKey("BrowseAlbum", Unmapped_Key, 0x3E, 8);
+  addKey("BrowseArtist", Unmapped_Key, 0x2E, 8);
+  addKey("BrowseMusic", Unmapped_Key, 0x4E, 8);
+  addKey("BrowsePlayList", Unmapped_Key, 0x5E, 8);
+  addKey("DirectionDown", Down_Key, 0x0D, 8);
+  addKey("DirectionLeft", Left_Key, 0x09, 8);
+  addKey("DirectionRight", Right_Key, 0x0B, 8);
+  addKey("DirectionUp", Up_Key, 0x07, 8);
+  addKey("FastForward", FastForward_Key, 0x05, 8);
+  addKey("Favorite", Favorites_Key, 0x18, 8);
+  addKey("Home", Menu_Key, 0x44, 8);
+  addKey("Mute", Mute_Key, 0x23, 8);
+  addKey("NextTrack", Next_Key, 0x05, 8);
+  addKey("NowPlaying", Info_Key, 0x1E, 8);
+  addKey("Pause", Pause_Key, 0x04, 8);
+  addKey("Play", Play_Key, 0x08, 8);
+  addKey("PowerOff", PowerOff_Key, 0xE1, 8);
+  addKey("PowerOn", PowerOn_Key, 0xF1, 8);
+  addKey("PowerToggle", Power_Key, 0x02, 8);
+  addKey("Preset1", Unmapped_Key, 0x51, 8);
+  addKey("Preset2", Unmapped_Key, 0x52, 8);
+  addKey("Preset3", Unmapped_Key, 0x53, 8);
+  addKey("Preset4", Unmapped_Key, 0x54, 8);
+  addKey("Preset5", Unmapped_Key, 0x55, 8);
+  addKey("Preset6", Unmapped_Key, 0x56, 8);
+  addKey("PreviousTrack", Previous_Key, 0x03, 8);
+  addKey("Rewind", Rewind_Key, 0x03, 8);
+  addKey("Search", Unmapped_Key, 0x1A, 8);
+  addKey("SearchAlbum", Unmapped_Key, 0x3A, 8);
+  addKey("SearchArtist", Unmapped_Key, 0x2A, 8);
+  addKey("SearchSong", Unmapped_Key, 0x4A, 8);
+  addKey("Select/Ok", Select_Key, 0x08, 8);
+  addKey("Shuffle", Random_Key, 0x1B, 8);
+  addKey("Size", Unmapped_Key, 0x1F, 8);
+  addKey("Sleep", Sleep_Key, 0x1D, 8);
+  addKey("VolumeDown", VolumeDown_Key, 0x00, 8);
+  addKey("VolumeUp", VolumeUp_Key, 0x01, 8);
+  addKey("0", Zero_Key, 0x19, 8);
+  addKey("1", One_Key, 0x0F, 8);
+  addKey("2", Two_Key, 0x10, 8);
+  addKey("3", Three_Key, 0x11, 8);
+  addKey("4", Four_Key, 0x12, 8);
+  addKey("5", Five_Key, 0x13, 8);
+  addKey("6", Six_Key, 0x14, 8);
+  addKey("7", Seven_Key, 0x15, 8);
+  addKey("8", Eight_Key, 0x16, 8);
+  addKey("9", Nine_Key, 0x17, 8);
+}
index f5e010f..ac044dd 100644 (file)
@@ -15,4 +15,14 @@ public:
     QObject *guiObject);
 };
 
+class LogitechSqueezebox: public PIRKeysetMetaData
+{
+public:
+  LogitechSqueezebox(
+    unsigned int index);
+
+  virtual void populateProtocol(
+    QObject *guiObject);
+};
+
 #endif // LOGITECH_H
index b366087..47f9de6 100644 (file)
@@ -847,11 +847,11 @@ void PanasonicAC1::populateProtocol(
   setPreData(0x6681, 16);
 
   addKey("Operation", Power_Key, 0x81, 8);
-  addKey("Air Swing", Yellow_Key, 0x83, 8);
-  addKey("Temp Up", Red_Key, 0x85, 8);
-  addKey("Temp Down", Blue_Key, 0x8A, 8);
-  addKey("Economy", Green_Key, 0x8D, 8);
-  addKey("Timer", Sleep_Key, 0x90, 8);
-  addKey("Fan Speed", SoundMode_Key, 0x99, 8);
-  addKey("Mode", PictureMode_Key, 0x9B, 8);
+  addKey("Air Swing", Oscillate_Key, 0x83, 8);
+  addKey("Temp Up", TempUp_Key, 0x85, 8);
+  addKey("Temp Down", TempDown_Key, 0x8A, 8);
+  addKey("Economy", EnergySave_Key, 0x8D, 8);
+  addKey("Timer", Timer_Key, 0x90, 8);
+  addKey("Fan Speed", FanFaster_Key, 0x99, 8);
+  addKey("Mode", Mode_Key, 0x9B, 8);
 }
index f1ddbb8..50a1621 100644 (file)
@@ -844,7 +844,7 @@ void SamsungDVD2::populateProtocol(
 SamsungAC1::SamsungAC1(
   unsigned int index)
   : PIRKeysetMetaData(
-      "Air Conditioner Keyset 1",
+      "Air Conditioner 1",
       Samsung_Make,
       index)
 {
@@ -878,15 +878,15 @@ void SamsungAC1::populateProtocol(
 
   addKey("TIMER", Timer_Key, 0xA4, 8);
   addKey("SLEEP", Sleep_Key, 0xE4, 8);
-  addKey("TEMP+", VolumeUp_Key, 0x4C, 8);
-  addKey("TEMP-", VolumeDown_Key, 0x8C, 8);
-  addKey("FAN", One_Key, 0x9C, 8);
-  addKey("COOL", Two_Key, 0x3C, 8);
-  addKey("HEAT", Three_Key, 0x5C, 8);
-  addKey("FAN_HIGH", Four_Key, 0xEC, 8);
-  addKey("FAN_MED", Five_Key, 0x6C, 8);
-  addKey("FAN_LOW", Six_Key, 0xAC, 8);
-  addKey("SWING", Seven_Key, 0x94, 8);
+  addKey("TEMP+", TempUp_Key, 0x4C, 8);
+  addKey("TEMP-", TempDown_Key, 0x8C, 8);
+  addKey("FAN", Fan_Key, 0x9C, 8);
+  addKey("COOL", Cool_Key, 0x3C, 8);
+  addKey("HEAT", Heat_Key, 0x5C, 8);
+  addKey("FAN_HIGH", FanFaster_Key, 0xEC, 8);
+  addKey("FAN_MED", Unmapped_Key, 0x6C, 8);
+  addKey("FAN_LOW", FanSlower_Key, 0xAC, 8);
+  addKey("SWING", Oscillate_Key, 0x94, 8);
   addKey("POWER", Power_Key, 0xFC, 8);
 }
 
index cdcd61b..1214b07 100644 (file)
@@ -449,14 +449,14 @@ void SharpAC1::populateProtocol(
 
   setPreData(0xF508, 16);
 
-  addKey("Fan Faster", VolumeUp_Key, 0x01, 8);
-  addKey("Energy Save", Green_Key, 0x02, 8);
-  addKey("Fan Slower", VolumeDown_Key, 0x04, 8);
-  addKey("Timer", Sleep_Key, 0x06, 8);
-  addKey("Fan", Yellow_Key, 0x07, 8);
-  addKey("Cool", Blue_Key, 0x09, 8);
-  addKey("Temp/Timer-", ChannelDown_Key, 0x0D, 8);
-  addKey("Temp/Timer+", ChannelUp_Key, 0x0E, 8);
-  addKey("Auto/Cool", Info_Key, 0x0F, 8);
+  addKey("Fan Faster", FanFaster_Key, 0x01, 8);
+  addKey("Energy Save", EnergySave_Key, 0x02, 8);
+  addKey("Fan Slower", FanSlower_Key, 0x04, 8);
+  addKey("Timer", Timer_Key, 0x06, 8);
+  addKey("Fan", Fan_Key, 0x07, 8);
+  addKey("Cool", Cool_Key, 0x09, 8);
+  addKey("Temp/Timer-", TempDown_Key, 0x0D, 8);
+  addKey("Temp/Timer+", TempUp_Key, 0x0E, 8);
+  addKey("Auto/Cool", Mode_Key, 0x0F, 8);
   addKey("power", Power_Key, 0x11, 8);
 }
index feef80c..132db18 100644 (file)
@@ -933,3 +933,133 @@ void SonyReceiver1::populateProtocol(
   addSIRC15Key("LEFT", Left_Key, 0xB0, 0x7A);
   addSIRC15Key("RIGHT", Right_Key, 0xB0, 0x7B);
 }
+
+
+SonyCD1::SonyCD1(
+  unsigned int index)
+  : PIRKeysetMetaData(
+      "CD Keyset 1",
+      Sony_Make,
+      index)
+{
+}
+
+
+void SonyCD1::populateProtocol(
+  QObject *guiObject)
+{
+  if (threadableProtocol)
+  {
+    // Keyset already populated.
+    return;
+  }
+
+  threadableProtocol = new SIRCProtocol(guiObject, index);
+
+  addSIRC12Key("1", One_Key, 0x11, 0x00);
+  addSIRC12Key("2", Two_Key, 0x11, 0x01);
+  addSIRC12Key("3", Three_Key, 0x11, 0x02);
+  addSIRC12Key("4", Four_Key, 0x11, 0x03);
+  addSIRC12Key("5", Five_Key, 0x11, 0x04);
+  addSIRC12Key("6", Six_Key, 0x11, 0x05);
+  addSIRC12Key("7", Seven_Key, 0x11, 0x06);
+  addSIRC12Key("8", Eight_Key, 0x11, 0x07);
+  addSIRC12Key("9", Nine_Key, 0x11, 0x08);
+  addSIRC12Key("ENTER", Enter_Key, 0x11, 0x0B);
+  addSIRC12Key("check", Unmapped_Key, 0x11, 0x0D);
+  addSIRC12Key("clear", Clear_Key, 0x11, 0x0F);
+
+  addSIRC12Key("vol+", VolumeUp_Key, 0x11, 0x12);
+  addSIRC12Key("vol-", VolumeDown_Key, 0x11, 0x13);
+  addSIRC12Key("mute", Mute_Key, 0x11, 0x14);
+  addSIRC12Key("power", Power_Key, 0x11, 0x15);
+  addSIRC12Key("eject", Eject_Key, 0x11, 0x16);
+  addSIRC12Key("C.INDEX", Unmapped_Key, 0x11, 0x18);
+  addSIRC12Key("FILE", Memory_Key, 0x11, 0x19);
+  addSIRC12Key("BANK", Call_Key, 0x11, 0x1A); // "file recall"
+  addSIRC12Key("continue", Unmapped_Key, 0x11, 0x1D);
+  addSIRC12Key("single", Unmapped_Key, 0x11, 0x1E);
+  addSIRC12Key("pgm", Program_Key, 0x11, 0x1F);
+
+  addSIRC12Key("10", Zero_Key, 0x11, 0x20); // "0"
+  addSIRC12Key(">10", DoubleDigit_Key, 0x11, 0x27);
+  addSIRC12Key("DISPLAY", Info_Key, 0x11, 0x28); // "time"
+  addSIRC12Key("a-b", RepeatAB_Key, 0x11, 0x2A);
+  addSIRC12Key("repeat", Repeat_Key, 0x11, 0x2C);
+  addSIRC12Key("POWER_ON", PowerOn_Key, 0x11, 0x2E);
+  addSIRC12Key("POWER_OFF", PowerOff_Key, 0x11, 0x2F);
+
+  addSIRC12Key("|<<", Previous_Key, 0x11, 0x30);
+  addSIRC12Key(">>|", Next_Key, 0x11, 0x31);
+  addSIRC12Key("play", Play_Key, 0x11, 0x32);
+  addSIRC12Key("<<", Rewind_Key, 0x11, 0x33);
+  addSIRC12Key(">>", FastForward_Key, 0x11, 0x34);
+  addSIRC12Key("shuffle", Random_Key, 0x11, 0x35);
+  addSIRC12Key("cd_ind_dec", Unmapped_Key, 0x11, 0x36);
+  addSIRC12Key("cd_ind_inc", Unmapped_Key, 0x11, 0x37);
+  addSIRC12Key("stop", Stop_Key, 0x11, 0x38);
+  addSIRC12Key("PAUSE", Pause_Key, 0x11, 0x39);
+  addSIRC12Key("SLOW--", SlowMinus_Key, 0x11, 0x3A);
+  addSIRC12Key("SLOW++", SlowPlus_Key, 0x11, 0x3B);
+  addSIRC12Key("musicscan", Unmapped_Key, 0x11, 0x3C); // "intro"
+  addSIRC12Key("prevDisc", PrevDisc_Key, 0x11, 0x3D);
+  addSIRC12Key("disc_skip", NextDisc_Key, 0x11, 0x3E);
+
+  addSIRC12Key("disc_1", Unmapped_Key, 0x11, 0x40);
+  addSIRC12Key("disc_2", Unmapped_Key, 0x11, 0x41);
+  addSIRC12Key("disc_3", Unmapped_Key, 0x11, 0x42);
+  addSIRC12Key("disc_4", Unmapped_Key, 0x11, 0x43);
+  addSIRC12Key("disc_5", Unmapped_Key, 0x11, 0x44);
+  addSIRC12Key("DISC", Unmapped_Key, 0x11, 0x4A);
+  addSIRC12Key("AUTO_SPACE", Unmapped_Key, 0x11, 0x4E);
+
+  addSIRC12Key("fader", Unmapped_Key, 0x11, 0x5F); // "mute"
+
+  addSIRC12Key("LEVEL_FILE", Unmapped_Key, 0x11, 0x68);
+}
+
+
+SonyCD1a::SonyCD1a(
+  unsigned int index)
+  : SonyCD1(index)
+{
+  setKeysetName("CD Keyset 1a");
+}
+
+
+void SonyCD1a::populateProtocol(
+  QObject *guiObject)
+{
+  if (threadableProtocol)
+  {
+    // Keyset already populated.
+    return;
+  }
+
+  SonyCD1::populateProtocol(guiObject);
+
+  addSIRC12Key("a-b", RepeatAB_Key, 0x11, 0x2D);
+}
+
+
+SonyCD1b::SonyCD1b(
+  unsigned int index)
+  : SonyCD1(index)
+{
+  setKeysetName("CD Keyset 1b");
+}
+
+
+void SonyCD1b::populateProtocol(
+  QObject *guiObject)
+{
+  if (threadableProtocol)
+  {
+    // Keyset already populated.
+    return;
+  }
+
+  SonyCD1::populateProtocol(guiObject);
+
+  addSIRC12Key("display", Info_Key, 0x11, 0x56);
+}
index 2afd53b..3ceb575 100644 (file)
@@ -191,4 +191,35 @@ public:
     QObject *guiObject);
 };
 
+
+class SonyCD1: public PIRKeysetMetaData
+{
+public:
+  SonyCD1(
+    unsigned int index);
+
+  virtual void populateProtocol(
+    QObject *guiObject);
+};
+
+class SonyCD1a: public SonyCD1
+{
+public:
+  SonyCD1a(
+    unsigned int index);
+
+  virtual void populateProtocol(
+    QObject *guiObject);
+};
+
+class SonyCD1b: public SonyCD1
+{
+public:
+  SonyCD1b(
+    unsigned int index);
+
+  virtual void populateProtocol(
+    QObject *guiObject);
+};
+
 #endif // SONY_H
diff --git a/keysets/starsat.cpp b/keysets/starsat.cpp
new file mode 100644 (file)
index 0000000..8ef4b84
--- /dev/null
@@ -0,0 +1,71 @@
+#include "starsat.h"
+#include "protocols/necprotocol.h"
+
+
+StarsatSat1::StarsatSat1(
+  unsigned int index)
+  : PIRKeysetMetaData(
+      "Sat Keyset 1",
+      Starsat_Make,
+      index)
+{
+}
+
+
+void StarsatSat1::populateProtocol(
+  QObject *guiObject)
+{
+  if (threadableProtocol)
+  {
+    // Keyset already populated.
+    return;
+  }
+
+  threadableProtocol = new NECProtocol(guiObject, index, true, true);
+
+  setPreData(0x4040, 16);
+
+  addKey("0", Zero_Key, 0x00, 8);
+  addKey("1", One_Key, 0x01, 8);
+  addKey("2", Two_Key, 0x02, 8);
+  addKey("3", Three_Key, 0x03, 8);
+  addKey("4", Four_Key, 0x04, 8);
+  addKey("5", Five_Key, 0x05, 8);
+  addKey("6", Six_Key, 0x06, 8);
+  addKey("7", Seven_Key, 0x07, 8);
+  addKey("8", Eight_Key, 0x08, 8);
+  addKey("9", Nine_Key, 0x09, 8);
+  addKey("Power", Power_Key, 0x0A, 8);
+  addKey("UP", Up_Key, 0x0B, 8);
+  addKey("Mute", Mute_Key, 0x0C, 8);
+  addKey("OK", Select_Key, 0x0D, 8);
+  addKey("Down", Down_Key, 0x0E, 8);
+  addKey("TV/SAT", Input_Key, 0x0F, 8);
+
+  addKey("Left", Left_Key, 0x10, 8);
+  addKey("Right", Right_Key, 0x11, 8);
+  addKey("Time", Unmapped_Key, 0x12, 8);
+  addKey("Audio", Audio_Key, 0x13, 8);
+  addKey("Text", Teletext_Key, 0x14, 8);
+  addKey("VOL+", VolumeUp_Key, 0x15, 8);
+  addKey("Read", Red_Key, 0x16, 8);
+  addKey("Sabz", Green_Key, 0x17, 8);
+  addKey("Yellowe", Yellow_Key, 0x18, 8);
+  addKey("Bule", Blue_Key, 0x19, 8);
+  addKey("EPG", Guide_Key, 0x1A, 8);
+  addKey("LAN", Unmapped_Key, 0x1B, 8);
+  addKey("VOL-", VolumeDown_Key, 0x1C, 8);
+  addKey("Media", Unmapped_Key, 0x1D, 8);
+  addKey("CH-", ChannelDown_Key, 0x1E, 8);
+  addKey("CH+", ChannelUp_Key, 0x1F, 8);
+
+  addKey("MENU", Menu_Key, 0x40, 8);
+  addKey("Exit", Exit_Key, 0x41, 8);
+  addKey("i", Info_Key, 0x42, 8);
+  addKey("RCL", PrevChannel_Key, 0x43, 8);
+  addKey("A-Z", Unmapped_Key, 0x44, 8);
+  addKey("Sat", Unmapped_Key, 0x45, 8);
+  addKey("FUNC", Unmapped_Key, 0x46, 8);
+  addKey("FAV", Favorites_Key, 0x47, 8);
+//  addKey(">^", Unmapped_Key, 0x0B, 8);
+}
diff --git a/keysets/starsat.h b/keysets/starsat.h
new file mode 100644 (file)
index 0000000..3f62fc4
--- /dev/null
@@ -0,0 +1,18 @@
+#ifndef STARSAT
+#define STARSAT
+
+#include "pirkeysetmetadata.h"
+
+class QObject;
+
+class StarsatSat1: public PIRKeysetMetaData
+{
+public:
+  StarsatSat1(
+    unsigned int index);
+
+  virtual void populateProtocol(
+    QObject *guiObject);
+};
+
+#endif // STARSAT
diff --git a/keysets/viewsat.cpp b/keysets/viewsat.cpp
new file mode 100644 (file)
index 0000000..85aeb45
--- /dev/null
@@ -0,0 +1,92 @@
+#include "viewsat.h"
+#include "protocols/necprotocol.h"
+
+
+ViewsatSat1::ViewsatSat1(
+  unsigned int index)
+  : PIRKeysetMetaData(
+      "Satellite Keyset 1",
+      Viewsat_Make,
+      index)
+{
+}
+
+
+void ViewsatSat1::populateProtocol(
+  QObject *guiObject)
+{
+  if (threadableProtocol)
+  {
+    // Keyset already populated.
+    return;
+  }
+
+  threadableProtocol = new NECProtocol(guiObject, index, true, true);
+
+  setPreData(0xFF20, 16);
+
+  addKey("1", One_Key, 0x00, 8);
+  addKey("2", Two_Key, 0x01, 8);
+  addKey("3", Three_Key, 0x02, 8);
+  addKey("4", Four_Key, 0x03, 8);
+  addKey("5", Five_Key, 0x04, 8);
+  addKey("6", Six_Key, 0x05, 8);
+  addKey("7", Seven_Key, 0x06, 8);
+  addKey("8", Eight_Key, 0x07, 8);
+  addKey("9", Nine_Key, 0x08, 8);
+  addKey("0", Zero_Key, 0x09, 8);
+  addKey("CH-Up", ChannelUp_Key, 0x0A, 8);
+  addKey("Up", Up_Key, 0x0A, 8);
+  addKey("CH-Down", ChannelDown_Key, 0x0B, 8);
+  addKey("Down", Down_Key, 0x0B, 8);
+  addKey("Vol-Up", VolumeUp_Key, 0x0C, 8);
+  addKey("Right", Right_Key, 0x0C, 8);
+  addKey("Vol-Down", VolumeDown_Key, 0x0D, 8);
+  addKey("Left", Left_Key, 0x0D, 8);
+  addKey("Mute", Mute_Key, 0x0E, 8);
+  addKey("Power", Power_Key, 0x0F, 8);
+
+  addKey("Page-Up", PageUp_Key, 0x10, 8);
+  addKey("Exit", Exit_Key, 0x11, 8);
+  addKey("Sat", SatInput_Key, 0x12, 8);
+  addKey("Menu", Menu_Key, 0x13, 8);
+  addKey("Fav", Favorites_Key, 0x14, 8);
+  addKey("input", Input_Key, 0x15, 8);
+  addKey("Guide", Guide_Key, 0x16, 8);
+  addKey("Pause", Pause_Key, 0x17, 8);
+  addKey("F1", Unmapped_Key, 0x18, 8);
+  addKey("OK", Select_Key, 0x19, 8);
+  addKey("CH-Return", PrevChannel_Key, 0x1A, 8); // "last"
+  addKey("Music/TV", TunerInput_Key, 0x1B, 8); // "radio"
+  addKey("F4", Unmapped_Key, 0x1C, 8);
+  addKey("Page-Down", PageDown_Key, 0x1D, 8);
+  addKey("Info", Info_Key, 0x1E, 8);
+  addKey("Audio", Audio_Key, 0x1F, 8);
+
+  addKey("F2", Unmapped_Key, 0x40, 8);
+  addKey("F3", Unmapped_Key, 0x41, 8);
+  addKey("Help", Unmapped_Key, 0x42, 8); // "color"
+}
+
+
+ViewsatSat1a::ViewsatSat1a(
+  unsigned int index)
+  : ViewsatSat1(index)
+{
+  setKeysetName("Satellite Keyset 1a");
+}
+
+
+void ViewsatSat1a::populateProtocol(
+  QObject *guiObject)
+{
+  if (threadableProtocol)
+  {
+    // Keyset already populated.
+    return;
+  }
+
+  ViewsatSat1::populateProtocol(guiObject);
+
+  addKey("NTSC/PAL", Unmapped_Key, 0x15, 8);
+}
diff --git a/keysets/viewsat.h b/keysets/viewsat.h
new file mode 100644 (file)
index 0000000..312e286
--- /dev/null
@@ -0,0 +1,28 @@
+#ifndef VIEWSAT_H
+#define VIEWSAT_H
+
+#include "pirkeysetmetadata.h"
+
+class QObject;
+
+class ViewsatSat1: public PIRKeysetMetaData
+{
+public:
+  ViewsatSat1(
+    unsigned int index);
+
+  virtual void populateProtocol(
+    QObject *guiObject);
+};
+
+class ViewsatSat1a: public ViewsatSat1
+{
+public:
+  ViewsatSat1a(
+    unsigned int index);
+
+  virtual void populateProtocol(
+    QObject *guiObject);
+};
+
+#endif // VIEWSAT_H
index 9097b75..abc0a87 100644 (file)
@@ -89,3 +89,30 @@ void WDMediaPlayer1a::populateProtocol(
   addKey("5", Five_Key, 0xED, 8);
   addKey("0", Zero_Key, 0xEE, 8);
 }
+
+
+WDMediaPlayer1b::WDMediaPlayer1b(
+  unsigned int index)
+  : WDMediaPlayer1a(index)
+{
+  setKeysetName("Media Player Keyset 1b");
+}
+
+
+void WDMediaPlayer1b::populateProtocol(
+  QObject *guiObject)
+{
+  if (threadableProtocol)
+  {
+    // Keyset already populated.
+    return;
+  }
+
+  WDMediaPlayer1a::populateProtocol(guiObject);
+
+  addKey("0", Zero_Key, 0x11, 8);
+  addKey("1", One_Key, 0x18, 8);
+  addKey("2", Two_Key, 0x19, 8);
+  addKey("4", Four_Key, 0x1C, 8);
+  addKey("5", Five_Key, 0x1D, 8);
+}
index 47c24c2..787893b 100644 (file)
@@ -25,4 +25,14 @@ public:
     QObject *guiObject);
 };
 
+class WDMediaPlayer1b: public WDMediaPlayer1a
+{
+public:
+  WDMediaPlayer1b(
+    unsigned int index);
+
+  virtual void populateProtocol(
+    QObject *guiObject);
+};
+
 #endif // WD_H
index c2ad2b1..8833525 100644 (file)
--- a/main.cpp
+++ b/main.cpp
@@ -15,7 +15,6 @@ int main(int argc, char *argv[])
   app.setupRockerSwitch(&mainWindow);
 
   mainWindow.showExpanded();
-  app.setupRockerSwitch(mainWindow.getSecondaryWindow());
 
   app.connect(
     &app,
index 1b5ee5e..692b64c 100644 (file)
@@ -4,15 +4,17 @@
 #include <QtCore/QCoreApplication>
 #include <QMutex>
 #include <QtGui/QMessageBox>
+//#include <QtGui>
 #include <QSettings>
-#include <QMaemo5InformationBox>
 
 #include "pirkeysetwidgetitem.h"
 #include "pirselectkeysetform.h"
-#include "pirsecondaryform.h"
+#include "pirselectdeviceform.h"
+#include "pirpanelselectionform.h"
 #include "pirdocumentationform.h"
 #include "piraboutform.h"
 #include "pirkeysetmanager.h"
+#include "pirpanelmanager.h"
 
 //#define DEBUGGING
 
@@ -35,7 +37,8 @@ MainWindow::MainWindow(QWidget *parent)
   : QMainWindow(parent),
     ui(new Ui::MainWindow),
     selectKeysetForm(0),
-    secondaryForm(0),
+    selectDeviceForm(0),
+    panelSelectionForm(0),
     documentationForm(0),
     aboutForm(0),
     currentKeyset(0)
@@ -45,20 +48,26 @@ MainWindow::MainWindow(QWidget *parent)
   // Make this a Maemo 5 stacked widget:
   setAttribute(Qt::WA_Maemo5StackedWindow);
 
-  // Collect the keysets:
+  // Create the managers:
   myKeysets = new PIRKeysetManager();
+  myPanels = new PIRPanelManager(this);
 
   // Set up the keyset selection window:
   selectKeysetForm = new PIRSelectKeysetForm(this);
 
-  // Set up the secondary buttons window:
-  secondaryForm = new PIRSecondaryForm(this);
+  // Set up the device selection window:
+  selectDeviceForm = new PIRSelectDeviceForm(this);
 
-  myKeysets->populateGuiWidget(selectKeysetForm);
+  // Set up the panel selection window:
+  panelSelectionForm = new PIRPanelSelectionForm(this);
+
+  myKeysets->populateSelectionWidgets(selectKeysetForm, selectDeviceForm);
+//  myPanels->setupPanels(panelSelectionForm);
 
   // Remember any favorites the user has already set:
   populateFavorites();
 
+  // Retrieve the user's most recent keyset (if any):
   QSettings settings("pietrzak.org", "Pierogi");
   if (settings.contains("currentKeysetName"))
   {
@@ -71,26 +80,64 @@ MainWindow::MainWindow(QWidget *parent)
 
   enableButtons();
 
+  QListWidget *fkw = myPanels->getFavoritesListWidget();
+
   connect(
-    ui->favoriteKeysetsWidget,
+    fkw,
     SIGNAL(itemActivated(QListWidgetItem *)),
     this,
     SLOT(keysetSelectionChanged(QListWidgetItem *)),
     Qt::QueuedConnection);
 
-  // Make sure the two selection lists don't show different selections:
+  // Make sure the three selection lists don't show different selections:
   QListWidget *klw = selectKeysetForm->getKeysetListWidget();
+  QListWidget *dlw = selectDeviceForm->getDeviceListWidget();
+
+  // favorites -> keyset name
   connect(
-    ui->favoriteKeysetsWidget,
+    fkw,
     SIGNAL(itemActivated(QListWidgetItem *)),
     klw,
     SLOT(clearSelection()),
     Qt::QueuedConnection);
 
+  // favorites -> device name
+  connect(
+    fkw,
+    SIGNAL(itemActivated(QListWidgetItem *)),
+    dlw,
+    SLOT(clearSelection()),
+    Qt::QueuedConnection);
+
+  // keyset name -> favorites
   connect(
     klw,
     SIGNAL(itemActivated(QListWidgetItem *)),
-    ui->favoriteKeysetsWidget,
+    fkw,
+    SLOT(clearSelection()),
+    Qt::QueuedConnection);
+
+  // device name -> favorites
+  connect(
+    dlw,
+    SIGNAL(itemActivated(QListWidgetItem *)),
+    fkw,
+    SLOT(clearSelection()),
+    Qt::QueuedConnection);
+
+  // keyset name -> device name
+  connect(
+    klw,
+    SIGNAL(itemActivated(QListWidgetItem *)),
+    dlw,
+    SLOT(clearSelection()),
+    Qt::QueuedConnection);
+
+  // device name -> keyset name
+  connect(
+    dlw,
+    SIGNAL(itemActivated(QListWidgetItem *)),
+    klw,
     SLOT(clearSelection()),
     Qt::QueuedConnection);
 
@@ -115,6 +162,8 @@ MainWindow::~MainWindow()
 {
   delete myKeysets;
   if (selectKeysetForm) delete selectKeysetForm;
+  if (selectDeviceForm) delete selectDeviceForm;
+  if (panelSelectionForm) delete panelSelectionForm;
   if (documentationForm) delete documentationForm;
   if (aboutForm) delete aboutForm;
   delete ui;
@@ -181,80 +230,7 @@ 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));
-  emit volumeUpEnabled(myKeysets->hasKey(currentKeyset, VolumeUp_Key));
-  emit volumeDownEnabled(myKeysets->hasKey(currentKeyset, VolumeDown_Key));
-  emit channelUpEnabled(myKeysets->hasKey(currentKeyset, ChannelUp_Key));
-  emit channelDownEnabled(myKeysets->hasKey(currentKeyset, ChannelDown_Key));
-  emit muteEnabled(myKeysets->hasKey(currentKeyset, Mute_Key));
-
-  // Main tab labels:
-  emit keysetMakeChanged(
-    makeManager.getMakeString(myKeysets->getMake(currentKeyset)));
-  emit keysetNameChanged(myKeysets->getDisplayName(currentKeyset));
-
-  // Utility keys:
-  emit redEnabled(myKeysets->hasKey(currentKeyset, Red_Key));
-  emit greenEnabled(myKeysets->hasKey(currentKeyset, Green_Key));
-  emit yellowEnabled(myKeysets->hasKey(currentKeyset, Yellow_Key));
-  emit blueEnabled(myKeysets->hasKey(currentKeyset, Blue_Key));
-  emit pictureModeEnabled(myKeysets->hasKey(currentKeyset, PictureMode_Key));
-  emit soundModeEnabled(myKeysets->hasKey(currentKeyset, SoundMode_Key));
-  emit aspectRatioEnabled(myKeysets->hasKey(currentKeyset, AspectRatio_Key));
-//  emit surroundEnabled(myKeysets->hasKey(currentKeyset, Surround_Key));
-  emit audioEnabled(myKeysets->hasKey(currentKeyset, Audio_Key));
-  emit infoEnabled(myKeysets->hasKey(currentKeyset, Info_Key));
-  emit captionsEnabled(myKeysets->hasKey(currentKeyset, Captions_Key));
-  emit sleepEnabled(myKeysets->hasKey(currentKeyset, Sleep_Key));
-  emit inputEnabled(myKeysets->hasKey(currentKeyset, Input_Key));
-
-  // Keypad keys
-  emit zeroEnabled(myKeysets->hasKey(currentKeyset, Zero_Key));
-  emit oneEnabled(myKeysets->hasKey(currentKeyset, One_Key));
-  emit twoEnabled(myKeysets->hasKey(currentKeyset, Two_Key));
-  emit threeEnabled(myKeysets->hasKey(currentKeyset, Three_Key));
-  emit fourEnabled(myKeysets->hasKey(currentKeyset, Four_Key));
-  emit fiveEnabled(myKeysets->hasKey(currentKeyset, Five_Key));
-  emit sixEnabled(myKeysets->hasKey(currentKeyset, Six_Key));
-  emit sevenEnabled(myKeysets->hasKey(currentKeyset, Seven_Key));
-  emit eightEnabled(myKeysets->hasKey(currentKeyset, Eight_Key));
-  emit nineEnabled(myKeysets->hasKey(currentKeyset, Nine_Key));
-  emit enterEnabled(myKeysets->hasKey(currentKeyset, Enter_Key));
-  emit clearEnabled(myKeysets->hasKey(currentKeyset, Clear_Key));
-  emit dashEnabled(myKeysets->hasKey(currentKeyset, Dash_Key));
-  emit plusOneHundredEnabled(myKeysets->hasKey(currentKeyset, PlusOneHundred_Key));
-  emit doubleDigitEnabled(myKeysets->hasKey(currentKeyset, DoubleDigit_Key));
-  emit prevChannelEnabled(myKeysets->hasKey(currentKeyset, PrevChannel_Key));
-
-  // Menu keys:
-  emit upEnabled(myKeysets->hasKey(currentKeyset, Up_Key));
-  emit downEnabled(myKeysets->hasKey(currentKeyset, Down_Key));
-  emit leftEnabled(myKeysets->hasKey(currentKeyset, Left_Key));
-  emit rightEnabled(myKeysets->hasKey(currentKeyset, Right_Key));
-  emit selectEnabled(myKeysets->hasKey(currentKeyset, Select_Key));
-  emit menuEnabled(myKeysets->hasKey(currentKeyset, Menu_Key));
-  emit exitEnabled(myKeysets->hasKey(currentKeyset, Exit_Key));
-  emit guideEnabled(myKeysets->hasKey(currentKeyset, Guide_Key));
-  emit discMenuEnabled(myKeysets->hasKey(currentKeyset, DiscMenu_Key));
-
-  // Media keys:
-  emit nextEnabled(myKeysets->hasKey(currentKeyset, Next_Key));
-  emit previousEnabled(myKeysets->hasKey(currentKeyset, Previous_Key));
-  emit advanceEnabled(myKeysets->hasKey(currentKeyset, Advance_Key));
-  emit replayEnabled(myKeysets->hasKey(currentKeyset, Replay_Key));
-  emit stepForwardEnabled(myKeysets->hasKey(currentKeyset, StepForward_Key));
-  emit stepBackEnabled(myKeysets->hasKey(currentKeyset, StepBack_Key));
-  emit fastForwardEnabled(myKeysets->hasKey(currentKeyset, FastForward_Key));
-  emit reverseEnabled(myKeysets->hasKey(currentKeyset, Rewind_Key));
-  emit playEnabled(myKeysets->hasKey(currentKeyset, Play_Key));
-  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);
+  myPanels->enableButtons(myKeysets, currentKeyset);
 }
 
 
@@ -268,583 +244,6 @@ void MainWindow::receivedExternalWarning(
 }
 
 
-// Main tab buttons:
-
-void MainWindow::on_powerButton_pressed()
-{
-  startRepeating(Power_Key);
-}
-
-void MainWindow::on_powerButton_released()
-{
-  stopRepeating();
-}
-
-void MainWindow::on_mainChannelUpButton_pressed()
-{
-  startRepeating(ChannelUp_Key);
-}
-
-void MainWindow::on_mainChannelUpButton_released()
-{
-  stopRepeating();
-}
-
-void MainWindow::on_mainChannelDownButton_pressed()
-{
-  startRepeating(ChannelDown_Key);
-}
-
-void MainWindow::on_mainChannelDownButton_released()
-{
-  stopRepeating();
-}
-
-void MainWindow::on_mainVolumeUp_pressed()
-{
-  startRepeating(VolumeUp_Key);
-}
-
-void MainWindow::on_mainVolumeUp_released()
-{
-  stopRepeating();
-}
-
-void MainWindow::on_mainVolumeDownButton_pressed()
-{
-  startRepeating(VolumeDown_Key);
-}
-
-void MainWindow::on_mainVolumeDownButton_released()
-{
-  stopRepeating();
-}
-
-void MainWindow::on_muteButton_pressed()
-{
-  startRepeating(Mute_Key);
-}
-
-void MainWindow::on_muteButton_released()
-{
-  stopRepeating();
-}
-
-
-// Utility tab buttons:
-
-void MainWindow::on_redButton_pressed()
-{
-  startRepeating(Red_Key);
-}
-
-void MainWindow::on_redButton_released()
-{
-  stopRepeating();
-}
-
-void MainWindow::on_greenButton_pressed()
-{
-  startRepeating(Green_Key);
-}
-
-void MainWindow::on_greenButton_released()
-{
-  stopRepeating();
-}
-
-void MainWindow::on_yellowButton_pressed()
-{
-  startRepeating(Yellow_Key);
-}
-
-void MainWindow::on_yellowButton_released()
-{
-  stopRepeating();
-}
-
-void MainWindow::on_blueButton_pressed()
-{
-  startRepeating(Blue_Key);
-}
-
-void MainWindow::on_blueButton_released()
-{
-  stopRepeating();
-}
-
-void MainWindow::on_pictureModeButton_pressed()
-{
-  startRepeating(PictureMode_Key);
-}
-
-void MainWindow::on_pictureModeButton_released()
-{
-  stopRepeating();
-}
-
-void MainWindow::on_soundModeButton_pressed()
-{
-  startRepeating(SoundMode_Key);
-}
-
-void MainWindow::on_soundModeButton_released()
-{
-  stopRepeating();
-}
-
-void MainWindow::on_aspectRatioButton_pressed()
-{
-  startRepeating(AspectRatio_Key);
-}
-
-void MainWindow::on_aspectRatioButton_released()
-{
-  stopRepeating();
-}
-
-/*
-void MainWindow::on_surroundButton_pressed()
-{
-  startRepeating(Surround_Key);
-}
-
-void MainWindow::on_surroundButton_released()
-{
-  stopRepeating();
-}
-*/
-
-void MainWindow::on_audioButton_pressed()
-{
-  startRepeating(Audio_Key);
-}
-
-void MainWindow::on_audioButton_released()
-{
-  stopRepeating();
-}
-
-void MainWindow::on_infoButton_pressed()
-{
-  startRepeating(Info_Key);
-}
-
-void MainWindow::on_infoButton_released()
-{
-  stopRepeating();
-}
-
-void MainWindow::on_captionButton_pressed()
-{
-  startRepeating(Captions_Key);
-}
-
-void MainWindow::on_captionButton_released()
-{
-  stopRepeating();
-}
-
-void MainWindow::on_inputButton_pressed()
-{
-  startRepeating(Input_Key);
-}
-
-void MainWindow::on_inputButton_released()
-{
-  stopRepeating();
-}
-
-void MainWindow::on_sleepButton_pressed()
-{
-  startRepeating(Sleep_Key);
-}
-
-void MainWindow::on_sleepButton_released()
-{
-  stopRepeating();
-}
-
-
-// Keypad tab buttons:
-
-void MainWindow::on_oneButton_pressed()
-{
-  startRepeating(One_Key);
-}
-
-void MainWindow::on_oneButton_released()
-{
-  stopRepeating();
-}
-
-void MainWindow::on_twoButton_pressed()
-{
-  startRepeating(Two_Key);
-}
-
-void MainWindow::on_twoButton_released()
-{
-  stopRepeating();
-}
-
-void MainWindow::on_threeButton_pressed()
-{
-  startRepeating(Three_Key);
-}
-
-void MainWindow::on_threeButton_released()
-{
-  stopRepeating();
-}
-
-void MainWindow::on_fourButton_pressed()
-{
-  startRepeating(Four_Key);
-}
-
-void MainWindow::on_fourButton_released()
-{
-  stopRepeating();
-}
-
-void MainWindow::on_fiveButton_pressed()
-{
-  startRepeating(Five_Key);
-}
-
-void MainWindow::on_fiveButton_released()
-{
-  stopRepeating();
-}
-
-void MainWindow::on_sixButton_pressed()
-{
-  startRepeating(Six_Key);
-}
-
-void MainWindow::on_sixButton_released()
-{
-  stopRepeating();
-}
-
-void MainWindow::on_sevenButton_pressed()
-{
-  startRepeating(Seven_Key);
-}
-
-void MainWindow::on_sevenButton_released()
-{
-  stopRepeating();
-}
-
-void MainWindow::on_eightButton_pressed()
-{
-  startRepeating(Eight_Key);
-}
-
-void MainWindow::on_eightButton_released()
-{
-  stopRepeating();
-}
-
-void MainWindow::on_nineButton_pressed()
-{
-  startRepeating(Nine_Key);
-}
-
-void MainWindow::on_nineButton_released()
-{
-  stopRepeating();
-}
-
-void MainWindow::on_zeroButton_pressed()
-{
-  startRepeating(Zero_Key);
-}
-
-void MainWindow::on_zeroButton_released()
-{
-  stopRepeating();
-}
-
-void MainWindow::on_enterButton_pressed()
-{
-  startRepeating(Enter_Key);
-}
-
-void MainWindow::on_enterButton_released()
-{
-  stopRepeating();
-}
-
-void MainWindow::on_clearButton_pressed()
-{
-  startRepeating(Clear_Key);
-}
-
-void MainWindow::on_clearButton_released()
-{
-  stopRepeating();
-}
-
-void MainWindow::on_prevChannelButton_pressed()
-{
-  startRepeating(PrevChannel_Key);
-}
-
-void MainWindow::on_prevChannelButton_released()
-{
-  stopRepeating();
-}
-
-void MainWindow::on_plusOneHundredButton_pressed()
-{
-  startRepeating(PlusOneHundred_Key);
-}
-
-void MainWindow::on_plusOneHundredButton_released()
-{
-  stopRepeating();
-}
-
-void MainWindow::on_dashButton_pressed()
-{
-  startRepeating(Dash_Key);
-}
-
-void MainWindow::on_dashButton_released()
-{
-  stopRepeating();
-}
-
-void MainWindow::on_doubleDigitButton_pressed()
-{
-  startRepeating(DoubleDigit_Key);
-}
-
-void MainWindow::on_doubleDigitButton_released()
-{
-  stopRepeating();
-}
-
-
-// Menu tab buttons:
-
-void MainWindow::on_upButton_pressed()
-{
-  startRepeating(Up_Key);
-}
-
-void MainWindow::on_upButton_released()
-{
-  stopRepeating();
-}
-
-void MainWindow::on_leftButton_pressed()
-{
-  startRepeating(Left_Key);
-}
-
-void MainWindow::on_leftButton_released()
-{
-  stopRepeating();
-}
-
-void MainWindow::on_rightButton_pressed()
-{
-  startRepeating(Right_Key);
-}
-
-void MainWindow::on_rightButton_released()
-{
-  stopRepeating();
-}
-
-void MainWindow::on_downButton_pressed()
-{
-  startRepeating(Down_Key);
-}
-
-void MainWindow::on_downButton_released()
-{
-  stopRepeating();
-}
-
-void MainWindow::on_selectButton_pressed()
-{
-  startRepeating(Select_Key);
-}
-
-void MainWindow::on_selectButton_released()
-{
-  stopRepeating();
-}
-
-void MainWindow::on_menuButton_pressed()
-{
-  startRepeating(Menu_Key);
-}
-
-void MainWindow::on_menuButton_released()
-{
-  stopRepeating();
-}
-
-void MainWindow::on_exitButton_pressed()
-{
-  startRepeating(Exit_Key);
-}
-
-void MainWindow::on_exitButton_released()
-{
-  stopRepeating();
-}
-
-void MainWindow::on_guideButton_pressed()
-{
-  startRepeating(Guide_Key);
-}
-
-void MainWindow::on_guideButton_released()
-{
-  stopRepeating();
-}
-
-void MainWindow::on_discMenuButton_pressed()
-{
-  startRepeating(DiscMenu_Key);
-}
-
-void MainWindow::on_discMenuButton_released()
-{
-  stopRepeating();
-}
-
-
-// Media tab buttons:
-
-void MainWindow::on_mediaPreviousButton_pressed()
-{
-  startRepeating(Previous_Key);
-}
-
-void MainWindow::on_mediaPreviousButton_released()
-{
-  stopRepeating();
-}
-
-void MainWindow::on_mediaNextButton_pressed()
-{
-  startRepeating(Next_Key);
-}
-
-void MainWindow::on_mediaNextButton_released()
-{
-  stopRepeating();
-}
-
-void MainWindow::on_replayButton_pressed()
-{
-  startRepeating(Replay_Key);
-}
-
-void MainWindow::on_replayButton_released()
-{
-  stopRepeating();
-}
-
-void MainWindow::on_advanceButton_pressed()
-{
-  startRepeating(Advance_Key);
-}
-
-void MainWindow::on_advanceButton_released()
-{
-  stopRepeating();
-}
-
-void MainWindow::on_stepBackButton_pressed()
-{
-  startRepeating(StepBack_Key);
-}
-
-void MainWindow::on_stepBackButton_released()
-{
-  stopRepeating();
-}
-
-void MainWindow::on_stepForwardButton_pressed()
-{
-  startRepeating(StepForward_Key);
-}
-
-void MainWindow::on_stepForwardButton_released()
-{
-  stopRepeating();
-}
-
-void MainWindow::on_reverseButton_pressed()
-{
-  startRepeating(Rewind_Key);
-}
-
-void MainWindow::on_reverseButton_released()
-{
-  stopRepeating();
-}
-
-void MainWindow::on_fastForwardButton_pressed()
-{
-  startRepeating(FastForward_Key);
-}
-
-void MainWindow::on_fastForwardButton_released()
-{
-  stopRepeating();
-}
-
-void MainWindow::on_playButton_pressed()
-{
-  startRepeating(Play_Key);
-}
-
-void MainWindow::on_playButton_released()
-{
-  stopRepeating();
-}
-
-void MainWindow::on_pauseButton_pressed()
-{
-  startRepeating(Pause_Key);
-}
-
-void MainWindow::on_pauseButton_released()
-{
-  stopRepeating();
-}
-
-void MainWindow::on_stopButton_pressed()
-{
-  startRepeating(Stop_Key);
-}
-
-void MainWindow::on_stopButton_released()
-{
-  stopRepeating();
-}
-
-void MainWindow::on_ejectButton_pressed()
-{
-  startRepeating(Eject_Key);
-}
-
-void MainWindow::on_ejectButton_released()
-{
-  stopRepeating();
-}
-
-
 // Menu actions:
 
 void MainWindow::on_actionSelectKeyset_triggered()
@@ -852,14 +251,14 @@ void MainWindow::on_actionSelectKeyset_triggered()
   selectKeysetForm->show();
 }
 
-void MainWindow::on_actionSecondary_Buttons_triggered()
+void MainWindow::on_actionSelect_Device_By_Name_triggered()
 {
-  if (!secondaryForm)
-  {
-    secondaryForm = new PIRSecondaryForm(this);
-  }
+  selectDeviceForm->show();
+}
 
-  secondaryForm->show();
+void MainWindow::on_actionArrange_Button_Panels_triggered()
+{
+  panelSelectionForm->show();
 }
 
 void MainWindow::on_actionAbout_triggered()
@@ -926,16 +325,17 @@ void MainWindow::finalCleanup()
 }
 
 
-void MainWindow::on_addKeysetButton_clicked()
+void MainWindow::addCurrentKeyset(
+  QListWidget *qlw)
 {
   // Is the current keyset already a favorite?
-  int count = ui->favoriteKeysetsWidget->count();
+  int count = qlw->count();
   int index = 0;
   PIRKeysetWidgetItem *kwi = NULL;
   while (index < count)
   {
     kwi = dynamic_cast<PIRKeysetWidgetItem *>(
-      ui->favoriteKeysetsWidget->item(index));
+      qlw->item(index));
 
     if (kwi && (kwi->getID() == currentKeyset))
     {
@@ -952,8 +352,7 @@ void MainWindow::on_addKeysetButton_clicked()
   name.append(" ");
   name.append(myKeysets->getDisplayName(currentKeyset));
 
-  ui->favoriteKeysetsWidget->addItem(
-    new PIRKeysetWidgetItem(name, currentKeyset, make));
+  qlw->addItem(new PIRKeysetWidgetItem(name, currentKeyset, make));
 
   // And, add the keyset id to the persistent list:
   QSettings settings("pietrzak.org", "Pierogi");
@@ -975,11 +374,12 @@ void MainWindow::on_addKeysetButton_clicked()
 }
 
 
-void MainWindow::on_removeKeysetButton_clicked()
+void MainWindow::removeFavoriteKeyset(
+  QListWidget *qlw)
 {
   // Deleting an item removes it from the list, so just grab the currently
   // selected item and delete it:
-  QListWidgetItem *item = ui->favoriteKeysetsWidget->currentItem();
+  QListWidgetItem *item = qlw->currentItem();
 
   if (item) delete item;
 
@@ -991,7 +391,7 @@ void MainWindow::on_removeKeysetButton_clicked()
 
   settings.remove("favorites");
 
-  int count = ui->favoriteKeysetsWidget->count();
+  int count = qlw->count();
 
   // If the count is empty, we can stop right here:
   if (count == 0) return;
@@ -1002,8 +402,7 @@ void MainWindow::on_removeKeysetButton_clicked()
   settings.beginWriteArray("favorites");
   while (index < count)
   {
-    kwi = dynamic_cast<PIRKeysetWidgetItem *>(
-      ui->favoriteKeysetsWidget->item(index));
+    kwi = dynamic_cast<PIRKeysetWidgetItem *>(qlw->item(index));
 
     settings.setArrayIndex(index);
 //    settings.setValue("keysetID", kwi->getID());
@@ -1020,6 +419,7 @@ void MainWindow::on_removeKeysetButton_clicked()
   settings.endArray();
 }
 
+
 void MainWindow::populateFavorites()
 {
   QSettings settings("pietrzak.org", "Pierogi");
@@ -1042,7 +442,7 @@ void MainWindow::populateFavorites()
     if (kwi)
     {
       // Keyset does exist, so continue:
-      ui->favoriteKeysetsWidget->addItem(kwi);
+      myPanels->addFavoritesItem(kwi);
     }
 
     ++index;
@@ -1071,69 +471,88 @@ void MainWindow::stopRepeating()
 }
 
 
-QWidget *MainWindow::getSecondaryWindow()
+void MainWindow::selectPrevFavKeyset()
 {
-  return secondaryForm;
+  myPanels->selectPrevFavKeyset();
 }
 
 
-void MainWindow::selectPrevFavKeyset()
+void MainWindow::selectNextFavKeyset()
 {
-  int size = ui->favoriteKeysetsWidget->count();
+  myPanels->selectNextFavKeyset();
+}
 
-  if (size == 0)
-  {
-    // No favorites, so nothing to do!
-    return;
-  }
 
-  int position = ui->favoriteKeysetsWidget->currentRow();
+void MainWindow::managePanel(
+  PIRPanelName name,
+  int state)
+{
+  myPanels->managePanel(name, state);
+}
 
-  --position;
-  if (position < 0)
-  {
-    position = size - 1;
-  }
 
-  ui->favoriteKeysetsWidget->setCurrentRow(
-    position,
-    QItemSelectionModel::ClearAndSelect);
+void MainWindow::insertPanel(
+  int index,
+  QWidget *panel,
+  const QString &displayName)
+{
+  ui->stackedButtonsWidget->insertWidget(index, panel);
+  ui->selectPanelComboBox->insertItem(index, displayName);
+}
 
-  keysetSelectionChanged(ui->favoriteKeysetsWidget->currentItem());
 
-  // Tell the user about the change:
-  QMaemo5InformationBox::information(
-    0,
-    ui->favoriteKeysetsWidget->item(position)->text());
+void MainWindow::removePanel(
+  int index,
+  QWidget *panel)
+{
+  ui->stackedButtonsWidget->removeWidget(panel);
+  ui->selectPanelComboBox->removeItem(index);
 }
 
 
-void MainWindow::selectNextFavKeyset()
+void MainWindow::on_prevPanelButton_clicked()
 {
-  int size = ui->favoriteKeysetsWidget->count();
+  int count = ui->selectPanelComboBox->count();
 
-  if (size == 0)
+  // No need to do anything if there are less than two panels available:
+  if (count < 2) return;
+
+  int index = ui->selectPanelComboBox->currentIndex();
+  if (index == 0)
   {
-    // No favorites, so just return:
-    return;
+    index = count - 1;
+  }
+  else
+  {
+    --index;
   }
 
-  int position = ui->favoriteKeysetsWidget->currentRow();
+  ui->selectPanelComboBox->setCurrentIndex(index);
+}
+
+
+void MainWindow::on_nextPanelButton_clicked()
+{
+  int count = ui->selectPanelComboBox->count();
+
+  // No need to do anything if there are less than two panels available:
+  if (count < 2) return;
 
-  ++position;
-  if (position == size)
+  int index = ui->selectPanelComboBox->currentIndex();
+  if (index == count - 1)
   {
-    position = 0;
+    index = 0;
+  }
+  else
+  {
+    ++index;
   }
 
-  ui->favoriteKeysetsWidget->setCurrentRow(
-    position,
-    QItemSelectionModel::ClearAndSelect);
+  ui->selectPanelComboBox->setCurrentIndex(index);
+}
 
-  keysetSelectionChanged(ui->favoriteKeysetsWidget->currentItem());
 
-  // Tell the user about the change:
-  QMaemo5InformationBox::information(
-    0,
-    ui->favoriteKeysetsWidget->item(position)->text());
+void MainWindow::on_selectPanelComboBox_currentIndexChanged(int index)
+{
+  ui->stackedButtonsWidget->setCurrentIndex(index);
 }
index 514b3db..9385686 100644 (file)
@@ -4,14 +4,18 @@
 #include <QtGui/QMainWindow>
 
 #include "pirkeynames.h"
+#include "pirpanelnames.h"
 #include "pirmodprobe.h"
 
+class QListWidget;
 class QListWidgetItem;
 class PIRSelectKeysetForm;
-class PIRSecondaryForm;
+class PIRSelectDeviceForm;
+class PIRPanelSelectionForm;
 class PIRDocumentationForm;
 class PIRAboutForm;
 class PIRKeysetManager;
+class PIRPanelManager;
 
 namespace Ui {
     class MainWindow;
@@ -41,117 +45,29 @@ public:
 
   void stopRepeating();
 
-  // This is a bit of a hack:
-  QWidget *getSecondaryWindow();
+  void managePanel(
+    PIRPanelName name,
+    int state);
 
-signals:
-  // Main keys
-  void powerEnabled(bool);
-  void volumeUpEnabled(bool);
-  void volumeDownEnabled(bool);
-  void channelUpEnabled(bool);
-  void channelDownEnabled(bool);
-  void muteEnabled(bool);
-
-  // Utility keys:
-  void redEnabled(bool);
-  void greenEnabled(bool);
-  void yellowEnabled(bool);
-  void blueEnabled(bool);
-  void pictureModeEnabled(bool);
-  void soundModeEnabled(bool);
-  void aspectRatioEnabled(bool);
-//  void surroundEnabled(bool);
-  void audioEnabled(bool);
-  void infoEnabled(bool);
-  void captionsEnabled(bool);
-  void inputEnabled(bool);
-  void sleepEnabled(bool);
-
-  // Keypad
-  void zeroEnabled(bool);
-  void oneEnabled(bool);
-  void twoEnabled(bool);
-  void threeEnabled(bool);
-  void fourEnabled(bool);
-  void fiveEnabled(bool);
-  void sixEnabled(bool);
-  void sevenEnabled(bool);
-  void eightEnabled(bool);
-  void nineEnabled(bool);
-  void enterEnabled(bool);
-  void clearEnabled(bool);
-  void dashEnabled(bool);
-  void plusOneHundredEnabled(bool);
-  void doubleDigitEnabled(bool);
-  void prevChannelEnabled(bool);
-
-  // Menu Keys
-  void menuEnabled(bool);
-  void upEnabled(bool);
-  void downEnabled(bool);
-  void leftEnabled(bool);
-  void rightEnabled(bool);
-  void selectEnabled(bool);
-  void exitEnabled(bool);
-  void guideEnabled(bool);
-  void discMenuEnabled(bool);
-
-  // Media keys
-  void playEnabled(bool);
-  void pauseEnabled(bool);
-  void stopEnabled(bool);
-  void fastForwardEnabled(bool);
-  void reverseEnabled(bool);
-  void nextEnabled(bool);
-  void previousEnabled(bool);
-  void stepForwardEnabled(bool);
-  void stepBackEnabled(bool);
-  void advanceEnabled(bool);
-  void replayEnabled(bool);
-  void ejectEnabled(bool);
-
-/*
-  // Media2 Keys
-  void discTitleEnabled(bool);
-  void discSelectEnabled(bool);
-  void vhsSpeedEnabled(bool);
-  void trackingMinusEnabled(bool);
-  void trackingPlusEnabled(bool);
-  void autoTrackingEnabled(bool);
-  void pageUpEnabled(bool);
-  void pageDownEnabled(bool);
-  void slowEnabled(bool);
-  void slowPlusEnabled(bool);
-  void slowMinusEnabled(bool);
-  void programEnabled(bool);
-  void tunerBandEnabled(bool);
-  void repeatEnabled(bool);
-  void repeatABEnabled(bool);
-  void randomEnabled(bool);
-
-  // TV Keys
-  void pictureModeEnabled(bool);
-  void soundModeEnabled(bool);
-  void liveTVEnabled(bool);
-  void favoritesEnabled(bool);
-  void teletextEnabled(bool);
-  void teletextHoldEnabled(bool);
-  void teletextRevealEnabled(bool);
-  void teletextSizeEnabled(bool);
-  void pipEnabled(bool);
-  void pipSwapEnabled(bool);
-  void pipMoveEnabled(bool);
-  void pipSourceEnabled(bool);
-  void pipChannelUpEnabled(bool);
-  void pipChannelDownEnabled(bool);
-  void pipPauseEnabled(bool);
-  void pipSizeEnabled(bool);
-*/
-
-  void keysetMakeChanged(QString);
-  void keysetNameChanged(QString);
+  void insertPanel(
+    int index,
+    QWidget *panel,
+    const QString &displayName);
+
+  void removePanel(
+    int index,
+    QWidget *panel);
+
+  // Favorites panel actions:
+  void addCurrentKeyset(
+    QListWidget *qlw);
+
+  void removeFavoriteKeyset(
+    QListWidget *qlw);
 
+  void enableButtons();
+
+signals:
   void buttonPressed(
     unsigned int keysetID,
     PIRKeyName name);
@@ -165,228 +81,37 @@ public slots:
   void selectPrevFavKeyset();
   void selectNextFavKeyset();
 
+  void keysetSelectionChanged(
+    QListWidgetItem *item);
+
 private slots:
-  // Main tab slots:
-  void on_powerButton_pressed();
-  void on_powerButton_released();
-  void on_mainChannelUpButton_pressed();
-  void on_mainChannelUpButton_released();
-  void on_mainChannelDownButton_pressed();
-  void on_mainChannelDownButton_released();
-  void on_mainVolumeUp_pressed();
-  void on_mainVolumeUp_released();
-  void on_mainVolumeDownButton_pressed();
-  void on_mainVolumeDownButton_released();
-  void on_muteButton_pressed();
-  void on_muteButton_released();
-
-  // Utility tab slots:
-  void on_redButton_pressed();
-  void on_redButton_released();
-  void on_greenButton_pressed();
-  void on_greenButton_released();
-  void on_yellowButton_pressed();
-  void on_yellowButton_released();
-  void on_blueButton_pressed();
-  void on_blueButton_released();
-  void on_pictureModeButton_pressed();
-  void on_pictureModeButton_released();
-  void on_soundModeButton_pressed();
-  void on_soundModeButton_released();
-  void on_aspectRatioButton_pressed();
-  void on_aspectRatioButton_released();
-//  void on_surroundButton_pressed();
-//  void on_surroundButton_released();
-  void on_audioButton_pressed();
-  void on_audioButton_released();
-  void on_infoButton_pressed();
-  void on_infoButton_released();
-  void on_captionButton_pressed();
-  void on_captionButton_released();
-  void on_inputButton_pressed();
-  void on_inputButton_released();
-  void on_sleepButton_pressed();
-  void on_sleepButton_released();
-
-  // Keypad tab slots:
-  void on_oneButton_pressed();
-  void on_oneButton_released();
-  void on_twoButton_pressed();
-  void on_twoButton_released();
-  void on_threeButton_pressed();
-  void on_threeButton_released();
-  void on_fourButton_pressed();
-  void on_fourButton_released();
-  void on_fiveButton_pressed();
-  void on_fiveButton_released();
-  void on_sixButton_pressed();
-  void on_sixButton_released();
-  void on_sevenButton_pressed();
-  void on_sevenButton_released();
-  void on_eightButton_pressed();
-  void on_eightButton_released();
-  void on_nineButton_pressed();
-  void on_nineButton_released();
-  void on_zeroButton_pressed();
-  void on_zeroButton_released();
-  void on_enterButton_pressed();
-  void on_enterButton_released();
-  void on_clearButton_pressed();
-  void on_clearButton_released();
-  void on_prevChannelButton_pressed();
-  void on_prevChannelButton_released();
-  void on_plusOneHundredButton_pressed();
-  void on_plusOneHundredButton_released();
-  void on_dashButton_pressed();
-  void on_dashButton_released();
-  void on_doubleDigitButton_pressed();
-  void on_doubleDigitButton_released();
-
-  // Menu tab slots:
-  void on_upButton_pressed();
-  void on_upButton_released();
-  void on_leftButton_pressed();
-  void on_leftButton_released();
-  void on_rightButton_pressed();
-  void on_rightButton_released();
-  void on_downButton_pressed();
-  void on_downButton_released();
-  void on_selectButton_pressed();
-  void on_selectButton_released();
-  void on_menuButton_pressed();
-  void on_menuButton_released();
-  void on_exitButton_pressed();
-  void on_exitButton_released();
-  void on_guideButton_pressed();
-  void on_guideButton_released();
-  void on_discMenuButton_pressed();
-  void on_discMenuButton_released();
-
-  // Media tab slots:
-  void on_mediaPreviousButton_pressed();
-  void on_mediaPreviousButton_released();
-  void on_mediaNextButton_pressed();
-  void on_mediaNextButton_released();
-  void on_replayButton_pressed();
-  void on_replayButton_released();
-  void on_advanceButton_pressed();
-  void on_advanceButton_released();
-  void on_stepBackButton_pressed();
-  void on_stepBackButton_released();
-  void on_stepForwardButton_pressed();
-  void on_stepForwardButton_released();
-  void on_reverseButton_pressed();
-  void on_reverseButton_released();
-  void on_fastForwardButton_pressed();
-  void on_fastForwardButton_released();
-  void on_playButton_pressed();
-  void on_playButton_released();
-  void on_pauseButton_pressed();
-  void on_pauseButton_released();
-  void on_stopButton_pressed();
-  void on_stopButton_released();
-  void on_ejectButton_pressed();
-  void on_ejectButton_released();
-
-/*
-  // Media2 tab slots:
-  void on_discTitleButton_pressed();
-  void on_discTitleButton_released();
-  void on_discSelectButton_pressed();
-  void on_discSelectButton_released();
-  void on_vhsSpeedButton_pressed();
-  void on_vhsSpeedButton_released();
-  void on_trackingPlusButton_pressed();
-  void on_trackingPlusButton_released();
-  void on_trackingMinusButton_pressed();
-  void on_trackingMinusButton_released();
-  void on_autoTrackingButton_pressed();
-  void on_autoTrackingButton_released();
-  void on_pageUpButton_pressed();
-  void on_pageUpButton_released();
-  void on_pageDownButton_pressed();
-  void on_pageDownButton_released();
-  void on_slowButton_pressed();
-  void on_slowButton_released();
-  void on_slowMinusButton_pressed();
-  void on_slowMinusButton_released();
-  void on_slowPlusButton_pressed();
-  void on_slowPlusButton_released();
-  void on_programButton_pressed();
-  void on_programButton_released();
-  void on_tunerBandButton_pressed();
-  void on_tunerBandButton_released();
-  void on_repeatButton_pressed();
-  void on_repeatButton_released();
-  void on_repeatABButton_pressed();
-  void on_repeatABButton_released();
-  void on_randomButton_pressed();
-  void on_randomButton_released();
-
-  // TV Tab slots:
-  void on_pictureModeButton_pressed();
-  void on_pictureModeButton_released();
-  void on_soundModeButton_pressed();
-  void on_soundModeButton_released();
-  void on_liveTVButton_pressed();
-  void on_liveTVButton_released();
-  void on_favoritesButton_pressed();
-  void on_favoritesButton_released();
-  void on_teletextButton_pressed();
-  void on_teletextButton_released();
-  void on_teletextHoldButton_pressed();
-  void on_teletextHoldButton_released();
-  void on_teletextRevealButton_pressed();
-  void on_teletextRevealButton_released();
-  void on_teletextSizeButton_pressed();
-  void on_teletextSizeButton_released();
-  void on_pipOnOffButton_pressed();
-  void on_pipOnOffButton_released();
-  void on_pipSwapButton_pressed();
-  void on_pipSwapButton_released();
-  void on_pipPositionButton_pressed();
-  void on_pipPositionButton_released();
-  void on_pipSourceButton_pressed();
-  void on_pipSourceButton_released();
-  void on_pipChannelUpButton_pressed();
-  void on_pipChannelUpButton_released();
-  void on_pipChannelDownButton_pressed();
-  void on_pipChannelDownButton_released();
-  void on_pipPauseButton_pressed();
-  void on_pipPauseButton_released();
-  void on_pipSizeButton_pressed();
-  void on_pipSizeButton_released();
-*/
-
-  // Favorites tab actions:
-  void on_addKeysetButton_clicked();
-  void on_removeKeysetButton_clicked();
-
-  // Menu actions:
   void on_actionSelectKeyset_triggered();
-  void on_actionSecondary_Buttons_triggered();
+  void on_actionSelect_Device_By_Name_triggered();
+  void on_actionArrange_Button_Panels_triggered();
   void on_actionAbout_triggered();
   void on_actionDocumentation_triggered();
 
-  // Internal actions:
-  void keysetSelectionChanged(
-    QListWidgetItem *item);
+  void on_prevPanelButton_clicked();
+  void on_nextPanelButton_clicked();
+  void on_selectPanelComboBox_currentIndexChanged(int index);
 
+  // Internal actions:
   void finalCleanup();
 
 private:
-  void enableButtons();
-
   void populateFavorites();
+//  void setupTabs();
 
   Ui::MainWindow *ui;
 
   PIRSelectKeysetForm *selectKeysetForm;
-  PIRSecondaryForm *secondaryForm;
+  PIRSelectDeviceForm *selectDeviceForm;
+  PIRPanelSelectionForm *panelSelectionForm;
   PIRDocumentationForm *documentationForm;
   PIRAboutForm *aboutForm;
 
   PIRKeysetManager *myKeysets;
+  PIRPanelManager *myPanels;
 
   unsigned int currentKeyset;
 
index 8fc81c2..4e30f06 100644 (file)
      <verstretch>0</verstretch>
     </sizepolicy>
    </property>
-   <layout class="QGridLayout" name="gridLayout_2">
-    <property name="margin">
+   <layout class="QGridLayout" name="gridLayout">
+    <property name="leftMargin">
+     <number>0</number>
+    </property>
+    <property name="topMargin">
+     <number>8</number>
+    </property>
+    <property name="rightMargin">
+     <number>0</number>
+    </property>
+    <property name="bottomMargin">
      <number>0</number>
     </property>
     <item row="0" column="0">
-     <widget class="QTabWidget" name="buttonsWidget">
+     <widget class="QPushButton" name="prevPanelButton">
+      <property name="icon">
+       <iconset resource="PierogiResources.qrc">
+        <normaloff>:/icons/arrow_left_icon&amp;48.png</normaloff>:/icons/arrow_left_icon&amp;48.png</iconset>
+      </property>
+      <property name="iconSize">
+       <size>
+        <width>36</width>
+        <height>36</height>
+       </size>
+      </property>
+     </widget>
+    </item>
+    <item row="0" column="1">
+     <widget class="QComboBox" name="selectPanelComboBox">
       <property name="sizePolicy">
-       <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+       <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
         <horstretch>0</horstretch>
         <verstretch>0</verstretch>
        </sizepolicy>
       </property>
-      <property name="tabPosition">
-       <enum>QTabWidget::North</enum>
+     </widget>
+    </item>
+    <item row="0" column="2">
+     <widget class="QPushButton" name="nextPanelButton">
+      <property name="text">
+       <string/>
       </property>
-      <property name="tabShape">
-       <enum>QTabWidget::Rounded</enum>
+      <property name="icon">
+       <iconset resource="PierogiResources.qrc">
+        <normaloff>:/icons/arrow_right_icon&amp;48.png</normaloff>:/icons/arrow_right_icon&amp;48.png</iconset>
       </property>
-      <property name="currentIndex">
-       <number>0</number>
+      <property name="iconSize">
+       <size>
+        <width>36</width>
+        <height>36</height>
+       </size>
+      </property>
+     </widget>
+    </item>
+    <item row="1" column="0" colspan="3">
+     <widget class="QStackedWidget" name="stackedButtonsWidget">
+      <property name="sizePolicy">
+       <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+        <horstretch>0</horstretch>
+        <verstretch>0</verstretch>
+       </sizepolicy>
       </property>
-      <widget class="QWidget" name="mainTab">
-       <property name="sizePolicy">
-        <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
-         <horstretch>0</horstretch>
-         <verstretch>0</verstretch>
-        </sizepolicy>
-       </property>
-       <attribute name="title">
-        <string>Main</string>
-       </attribute>
-       <layout class="QGridLayout" name="gridLayout_4">
-        <property name="margin">
-         <number>8</number>
-        </property>
-        <item row="0" column="0">
-         <widget class="QPushButton" name="mainChannelUpButton">
-          <property name="sizePolicy">
-           <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
-            <horstretch>0</horstretch>
-            <verstretch>0</verstretch>
-           </sizepolicy>
-          </property>
-          <property name="text">
-           <string>Channel Up</string>
-          </property>
-          <property name="icon">
-           <iconset resource="PierogiResources.qrc">
-            <normaloff>:/icons/br_up_icon&amp;48.png</normaloff>:/icons/br_up_icon&amp;48.png</iconset>
-          </property>
-          <property name="iconSize">
-           <size>
-            <width>48</width>
-            <height>48</height>
-           </size>
-          </property>
-         </widget>
-        </item>
-        <item row="0" column="1" rowspan="2">
-         <layout class="QVBoxLayout" name="verticalLayout_2">
-          <property name="spacing">
-           <number>-1</number>
-          </property>
-          <property name="leftMargin">
-           <number>0</number>
-          </property>
-          <item>
-           <widget class="QPushButton" name="powerButton">
-            <property name="sizePolicy">
-             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
-              <horstretch>0</horstretch>
-              <verstretch>0</verstretch>
-             </sizepolicy>
-            </property>
-            <property name="layoutDirection">
-             <enum>Qt::LeftToRight</enum>
-            </property>
-            <property name="text">
-             <string>Power</string>
-            </property>
-            <property name="icon">
-             <iconset resource="PierogiResources.qrc">
-              <normaloff>:/icons/on-off_icon&amp;48.png</normaloff>:/icons/on-off_icon&amp;48.png</iconset>
-            </property>
-            <property name="iconSize">
-             <size>
-              <width>48</width>
-              <height>48</height>
-             </size>
-            </property>
-           </widget>
-          </item>
-          <item>
-           <spacer name="verticalSpacer">
-            <property name="orientation">
-             <enum>Qt::Vertical</enum>
-            </property>
-            <property name="sizeType">
-             <enum>QSizePolicy::Minimum</enum>
-            </property>
-            <property name="sizeHint" stdset="0">
-             <size>
-              <width>20</width>
-              <height>20</height>
-             </size>
-            </property>
-           </spacer>
-          </item>
-          <item>
-           <widget class="QLabel" name="makeLabel">
-            <property name="sizePolicy">
-             <sizepolicy hsizetype="Preferred" vsizetype="Minimum">
-              <horstretch>0</horstretch>
-              <verstretch>0</verstretch>
-             </sizepolicy>
-            </property>
-            <property name="text">
-             <string>Keyset Make</string>
-            </property>
-            <property name="alignment">
-             <set>Qt::AlignCenter</set>
-            </property>
-           </widget>
-          </item>
-          <item>
-           <widget class="QLabel" name="nameLabel">
-            <property name="sizePolicy">
-             <sizepolicy hsizetype="Preferred" vsizetype="Minimum">
-              <horstretch>0</horstretch>
-              <verstretch>0</verstretch>
-             </sizepolicy>
-            </property>
-            <property name="text">
-             <string>Keyset Name</string>
-            </property>
-            <property name="alignment">
-             <set>Qt::AlignCenter</set>
-            </property>
-           </widget>
-          </item>
-          <item>
-           <spacer name="verticalSpacer_2">
-            <property name="orientation">
-             <enum>Qt::Vertical</enum>
-            </property>
-            <property name="sizeType">
-             <enum>QSizePolicy::Minimum</enum>
-            </property>
-            <property name="sizeHint" stdset="0">
-             <size>
-              <width>20</width>
-              <height>20</height>
-             </size>
-            </property>
-           </spacer>
-          </item>
-          <item>
-           <widget class="QPushButton" name="muteButton">
-            <property name="sizePolicy">
-             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
-              <horstretch>0</horstretch>
-              <verstretch>0</verstretch>
-             </sizepolicy>
-            </property>
-            <property name="text">
-             <string>Mute</string>
-            </property>
-            <property name="icon">
-             <iconset resource="PierogiResources.qrc">
-              <normaloff>:/icons/sound_mute_icon&amp;48.png</normaloff>:/icons/sound_mute_icon&amp;48.png</iconset>
-            </property>
-            <property name="iconSize">
-             <size>
-              <width>48</width>
-              <height>48</height>
-             </size>
-            </property>
-           </widget>
-          </item>
-         </layout>
-        </item>
-        <item row="0" column="2">
-         <widget class="QPushButton" name="mainVolumeUp">
-          <property name="sizePolicy">
-           <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
-            <horstretch>0</horstretch>
-            <verstretch>0</verstretch>
-           </sizepolicy>
-          </property>
-          <property name="layoutDirection">
-           <enum>Qt::LeftToRight</enum>
-          </property>
-          <property name="text">
-           <string>Volume Up</string>
-          </property>
-          <property name="icon">
-           <iconset resource="PierogiResources.qrc">
-            <normaloff>:/icons/sound_high_icon&amp;48.png</normaloff>:/icons/sound_high_icon&amp;48.png</iconset>
-          </property>
-          <property name="iconSize">
-           <size>
-            <width>48</width>
-            <height>48</height>
-           </size>
-          </property>
-         </widget>
-        </item>
<