Welcome to the first commit of the first version of my very first app.
authorJohn Pietrzak <john@pietrzak.org>
Sun, 1 Jan 2012 23:27:49 +0000 (18:27 -0500)
committerJohn Pietrzak <john@pietrzak.org>
Sun, 1 Jan 2012 23:27:49 +0000 (18:27 -0500)
Might be a few unnecessary files here, might be missing a few necessary ones,
I'm still getting the hang of all this.  I'll hopefully have everything
cleaned up soon.

96 files changed:
PierogiResources.qrc [new file with mode: 0644]
deployment.pri [new file with mode: 0644]
doc/about.html [new file with mode: 0644]
doc/documentation.html [new file with mode: 0644]
icons/PierogiIcon.png [new file with mode: 0644]
icons/arrow_bottom_icon&48.png [new file with mode: 0755]
icons/arrow_left_icon&48.png [new file with mode: 0755]
icons/arrow_right_icon&48.png [new file with mode: 0755]
icons/arrow_top_icon&48.png [new file with mode: 0755]
icons/blue_square.png [new file with mode: 0644]
icons/br_down_icon&48.png [new file with mode: 0755]
icons/br_up_icon&48.png [new file with mode: 0755]
icons/clock_icon&48.png [new file with mode: 0755]
icons/dash.png [new file with mode: 0644]
icons/eject_icon&48.png [new file with mode: 0755]
icons/fastforward_next_icon&48.png [new file with mode: 0755]
icons/green_square.png [new file with mode: 0644]
icons/on-off_icon&48.png [new file with mode: 0755]
icons/playback_ff_icon&48.png [new file with mode: 0755]
icons/playback_next_icon&48.png [new file with mode: 0755]
icons/playback_pause_icon&48.png [new file with mode: 0755]
icons/playback_play_icon&48.png [new file with mode: 0755]
icons/playback_prev_icon&48.png [new file with mode: 0755]
icons/playback_rew_icon&48.png [new file with mode: 0755]
icons/playback_stop_icon&48.png [new file with mode: 0755]
icons/red_record_icon.png [new file with mode: 0644]
icons/red_square.png [new file with mode: 0644]
icons/redo_icon&48.png [new file with mode: 0755]
icons/rewind_previous_icon&48.png [new file with mode: 0755]
icons/sound_high_icon&48.png [new file with mode: 0755]
icons/sound_low_icon&48.png [new file with mode: 0755]
icons/sound_mute_icon&48.png [new file with mode: 0755]
icons/undo_icon&48.png [new file with mode: 0755]
icons/yellow_square.png [new file with mode: 0644]
keysets/apple.cpp [new file with mode: 0644]
keysets/apple.h [new file with mode: 0644]
keysets/ei.cpp [new file with mode: 0644]
keysets/ei.h [new file with mode: 0644]
keysets/goldstar.cpp [new file with mode: 0644]
keysets/goldstar.h [new file with mode: 0644]
keysets/hauppauge.cpp [new file with mode: 0644]
keysets/hauppauge.h [new file with mode: 0644]
keysets/lg.cpp [new file with mode: 0644]
keysets/lg.h [new file with mode: 0644]
keysets/nokia.cpp [new file with mode: 0644]
keysets/nokia.h [new file with mode: 0644]
keysets/panasonic.cpp [new file with mode: 0644]
keysets/panasonic.h [new file with mode: 0644]
keysets/samsung.cpp [new file with mode: 0644]
keysets/samsung.h [new file with mode: 0644]
keysets/sanyo.cpp [new file with mode: 0644]
keysets/sanyo.h [new file with mode: 0644]
keysets/sharp.cpp [new file with mode: 0644]
keysets/sharp.h [new file with mode: 0644]
keysets/sony.cpp [new file with mode: 0644]
keysets/sony.h [new file with mode: 0644]
keysets/toshiba.cpp [new file with mode: 0644]
keysets/toshiba.h [new file with mode: 0644]
keysets/zenith.cpp [new file with mode: 0644]
keysets/zenith.h [new file with mode: 0644]
main.cpp [new file with mode: 0644]
mainwindow.cpp [new file with mode: 0644]
mainwindow.h [new file with mode: 0644]
mainwindow.ui [new file with mode: 0644]
necprotocol.cpp [new file with mode: 0644]
necprotocol.h [new file with mode: 0644]
pierogi.desktop [new file with mode: 0644]
pierogi.pro [new file with mode: 0644]
pierogi.pro.user [new file with mode: 0644]
pierogi64.png [new file with mode: 0644]
pierogi_harmattan.desktop [new file with mode: 0644]
piraboutform.cpp [new file with mode: 0644]
piraboutform.h [new file with mode: 0644]
piraboutform.ui [new file with mode: 0644]
pirdevice.cpp [new file with mode: 0644]
pirdevice.h [new file with mode: 0644]
pirdocumentationform.cpp [new file with mode: 0644]
pirdocumentationform.h [new file with mode: 0644]
pirdocumentationform.ui [new file with mode: 0644]
pirexception.cpp [new file with mode: 0644]
pirexception.h [new file with mode: 0644]
pirkeynames.h [new file with mode: 0644]
pirkeysetmanager.cpp [new file with mode: 0644]
pirkeysetmanager.h [new file with mode: 0644]
pirkeysetmetadata.cpp [new file with mode: 0644]
pirkeysetmetadata.h [new file with mode: 0644]
pirkeysetwidgetitem.cpp [new file with mode: 0644]
pirkeysetwidgetitem.h [new file with mode: 0644]
pirmakenames.cpp [new file with mode: 0644]
pirmakenames.h [new file with mode: 0644]
pirprotocol.cpp [new file with mode: 0644]
pirprotocol.h [new file with mode: 0644]
rc5protocol.cpp [new file with mode: 0644]
rc5protocol.h [new file with mode: 0644]
selectionwindow.cpp [new file with mode: 0644]
selectionwindow.h [new file with mode: 0644]

diff --git a/PierogiResources.qrc b/PierogiResources.qrc
new file mode 100644 (file)
index 0000000..af8072e
--- /dev/null
@@ -0,0 +1,37 @@
+<RCC>
+    <qresource prefix="/">
+        <file>icons/arrow_bottom_icon&amp;48.png</file>
+        <file>icons/arrow_left_icon&amp;48.png</file>
+        <file>icons/arrow_right_icon&amp;48.png</file>
+        <file>icons/arrow_top_icon&amp;48.png</file>
+        <file>icons/clock_icon&amp;48.png</file>
+        <file>icons/eject_icon&amp;48.png</file>
+        <file>icons/fastforward_next_icon&amp;48.png</file>
+        <file>icons/on-off_icon&amp;48.png</file>
+        <file>icons/playback_ff_icon&amp;48.png</file>
+        <file>icons/playback_next_icon&amp;48.png</file>
+        <file>icons/playback_pause_icon&amp;48.png</file>
+        <file>icons/playback_play_icon&amp;48.png</file>
+        <file>icons/playback_prev_icon&amp;48.png</file>
+        <file>icons/playback_rec_icon&amp;48.png</file>
+        <file>icons/playback_rew_icon&amp;48.png</file>
+        <file>icons/playback_stop_icon&amp;48.png</file>
+        <file>icons/redo_icon&amp;48.png</file>
+        <file>icons/rewind_previous_icon&amp;48.png</file>
+        <file>icons/sound_high_icon&amp;48.png</file>
+        <file>icons/sound_low_icon&amp;48.png</file>
+        <file>icons/sound_mute_icon&amp;48.png</file>
+        <file>icons/undo_icon&amp;48.png</file>
+        <file>icons/br_down_icon&amp;48.png</file>
+        <file>icons/br_up_icon&amp;48.png</file>
+        <file>icons/blue_square.png</file>
+        <file>icons/green_square.png</file>
+        <file>icons/red_square.png</file>
+        <file>icons/yellow_square.png</file>
+        <file>icons/red_record_icon.png</file>
+        <file>icons/dash.png</file>
+        <file>icons/PierogiIcon.png</file>
+        <file>doc/about.html</file>
+        <file>doc/documentation.html</file>
+    </qresource>
+</RCC>
diff --git a/deployment.pri b/deployment.pri
new file mode 100644 (file)
index 0000000..ef657d6
--- /dev/null
@@ -0,0 +1,124 @@
+# checksum 0x9ca8 version 0x60002
+# This file was generated by an application wizard of Qt Creator.
+# The code below handles deployment to Symbian and Maemo, aswell as copying
+# of the application data to shadow build directories on desktop.
+# It is recommended not to modify this file, since newer versions of Qt Creator
+# may offer an updated version of it.
+
+defineTest(qtcAddDeployment) {
+for(deploymentfolder, DEPLOYMENTFOLDERS) {
+    item = item$${deploymentfolder}
+    itemsources = $${item}.sources
+    $$itemsources = $$eval($${deploymentfolder}.source)
+    itempath = $${item}.path
+    $$itempath= $$eval($${deploymentfolder}.target)
+    export($$itemsources)
+    export($$itempath)
+    DEPLOYMENT += $$item
+}
+
+MAINPROFILEPWD = $$PWD
+
+symbian {
+    isEmpty(ICON):exists($${TARGET}.svg):ICON = $${TARGET}.svg
+    isEmpty(TARGET.EPOCHEAPSIZE):TARGET.EPOCHEAPSIZE = 0x20000 0x2000000
+} else:win32 {
+    copyCommand =
+    for(deploymentfolder, DEPLOYMENTFOLDERS) {
+        source = $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source)
+        source = $$replace(source, /, \\)
+        sourcePathSegments = $$split(source, \\)
+        target = $$OUT_PWD/$$eval($${deploymentfolder}.target)/$$last(sourcePathSegments)
+        target = $$replace(target, /, \\)
+        !isEqual(source,$$target) {
+            !isEmpty(copyCommand):copyCommand += &&
+            isEqual(QMAKE_DIR_SEP, \\) {
+                copyCommand += $(COPY_DIR) \"$$source\" \"$$target\"
+            } else {
+                source = $$replace(source, \\\\, /)
+                target = $$OUT_PWD/$$eval($${deploymentfolder}.target)
+                target = $$replace(target, \\\\, /)
+                copyCommand += test -d \"$$target\" || mkdir -p \"$$target\" && cp -r \"$$source\" \"$$target\"
+            }
+        }
+    }
+    !isEmpty(copyCommand) {
+        copyCommand = @echo Copying application data... && $$copyCommand
+        copydeploymentfolders.commands = $$copyCommand
+        first.depends = $(first) copydeploymentfolders
+        export(first.depends)
+        export(copydeploymentfolders.commands)
+        QMAKE_EXTRA_TARGETS += first copydeploymentfolders
+    }
+} else:unix {
+    maemo5 {
+        desktopfile.files = $${TARGET}.desktop
+        desktopfile.path = /usr/share/applications/hildon
+        icon.files = $${TARGET}64.png
+        icon.path = /usr/share/icons/hicolor/64x64/apps
+    } else:!isEmpty(MEEGO_VERSION_MAJOR) {
+        desktopfile.files = $${TARGET}_harmattan.desktop
+        desktopfile.path = /usr/share/applications
+        icon.files = $${TARGET}80.png
+        icon.path = /usr/share/icons/hicolor/80x80/apps
+    } else { # Assumed to be a Desktop Unix
+        copyCommand =
+        for(deploymentfolder, DEPLOYMENTFOLDERS) {
+            source = $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source)
+            source = $$replace(source, \\\\, /)
+            macx {
+                target = $$OUT_PWD/$${TARGET}.app/Contents/Resources/$$eval($${deploymentfolder}.target)
+            } else {
+                target = $$OUT_PWD/$$eval($${deploymentfolder}.target)
+            }
+            target = $$replace(target, \\\\, /)
+            sourcePathSegments = $$split(source, /)
+            targetFullPath = $$target/$$last(sourcePathSegments)
+            !isEqual(source,$$targetFullPath) {
+                !isEmpty(copyCommand):copyCommand += &&
+                copyCommand += $(MKDIR) \"$$target\"
+                copyCommand += && $(COPY_DIR) \"$$source\" \"$$target\"
+            }
+        }
+        !isEmpty(copyCommand) {
+            copyCommand = @echo Copying application data... && $$copyCommand
+            copydeploymentfolders.commands = $$copyCommand
+            first.depends = $(first) copydeploymentfolders
+            export(first.depends)
+            export(copydeploymentfolders.commands)
+            QMAKE_EXTRA_TARGETS += first copydeploymentfolders
+        }
+    }
+    installPrefix = /opt/$${TARGET}
+    for(deploymentfolder, DEPLOYMENTFOLDERS) {
+        item = item$${deploymentfolder}
+        itemfiles = $${item}.files
+        $$itemfiles = $$eval($${deploymentfolder}.source)
+        itempath = $${item}.path
+        $$itempath = $${installPrefix}/$$eval($${deploymentfolder}.target)
+        export($$itemfiles)
+        export($$itempath)
+        INSTALLS += $$item
+    }
+
+    !isEmpty(desktopfile.path) {
+        export(icon.files)
+        export(icon.path)
+        export(desktopfile.files)
+        export(desktopfile.path)
+        INSTALLS += icon desktopfile
+    }
+
+    target.path = $${installPrefix}/bin
+    export(target.path)
+    INSTALLS += target
+}
+
+export (ICON)
+export (INSTALLS)
+export (DEPLOYMENT)
+export (TARGET.EPOCHEAPSIZE)
+export (TARGET.CAPABILITY)
+export (LIBS)
+export (QMAKE_EXTRA_TARGETS)
+}
diff --git a/doc/about.html b/doc/about.html
new file mode 100644 (file)
index 0000000..961bc64
--- /dev/null
@@ -0,0 +1,15 @@
+<html>
+<head>
+</head>
+<body>
+<h1 align="center"><img src="qrc:///icons/PierogiIcon.png"> Pierogi</h1>
+<h2 align="center">A Universal Infrared Remote Control</h2>
+
+<p>Copyright 2012 by John Pietrzak.  Released under the GPL version 2.0.</p>
+
+<p>Icons provided by <a href="http://www.gentleface.com">Gentleface</a>.</p>
+
+<p>Please send any questions or comments to:
+<a href="mailto:jpietrzak8@gmail.com">jpietrzak8@gmail.com</a></p>
+</body>
+</html>
diff --git a/doc/documentation.html b/doc/documentation.html
new file mode 100644 (file)
index 0000000..7d5a637
--- /dev/null
@@ -0,0 +1,286 @@
+<html>
+<head>
+</head>
+<body>
+
+<h1>Pierogi Documentation</h1>
+
+<p>
+The Pierogi universal infrared remote controller is a single self-contained
+app capable of sending IR commands to pretty much any IR-controlled device.
+At the moment, it is oriented towards television, VCR, DVD, and Blu-ray
+devices, but a few other types of device have had their command sets entered.
+</p>
+
+<p>
+Commands are collected into "keysets".  As each manufacturer tends to reuse
+a given set of command encodings rather than re-invent the wheel each
+time they come out with a new product, a large number of devices can be
+controlled by a single keyset.
+</p>
+
+<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
+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.
+</p>
+
+<h3>Main Tab</h3>
+
+<p>The Main tab contains just the power, volume, 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>
+
+<h3>Utility Tab</h3>
+
+<p>The Utility tab contains a selection of commonly useful controls, such as
+"Mute", "Sleep", "Input", "Closed Captions / Subtitles", and the color buttons.
+The exact selection of buttons on this tab will probably change to reflect
+which commands turn out to be the most popular.</p>
+
+<h3>Keypad Tab</h3>
+
+<p>This tab 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"
+button is used for television sets which normally expect only two digits
+per channel; using this button allows you to enter a third digit.  The "-/--
+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>
+
+<h3>Menu Tab</h3>
+
+<p>This tab 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; the "Info" and "Guide" buttons are
+targeted towards entering other useful menus when available.</p>
+
+<h3>Media Tab</h3>
+
+<p>Many of the most important playback commands are represented on this tab.
+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>
+
+<h3>Misc Tab</h3>
+
+<p>This tab contains a selection of buttons that did not fit into any of the
+previous tabs.  The content of this tab is subject to change.</p>
+
+<h3>Favorites Tab</h3>
+
+<p>As there are numerous keysets available in Pierogi, a "favorites" 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 Favorites tab
+and press "Add Current Keyset".</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.</p>
+
+<p>A keyset can be removed from the list by selecting it and pressing
+"Remove Selected Keyset".</p>
+
+<h3>Select Keyset Window</h3>
+
+<p>The Select Keyset 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 choose the make (or brand) of
+the device you are trying to control; once a make has been selected, all
+keysets not associated with that make will be hidden.  To use a keyset,
+simply select it from the list, and close the window (by pressing the
+return arrow at the top right of the screen).</p>
+
+<h2>Design Rationale</h2>
+
+<p>Here I collect my thoughts on the how and why of creating Pierogi.</p>
+
+<h3>Hasn't this been done before?</h3>
+
+<p>Yes, remote control software has already been written.  In particular,
+the <a href="http://irreco.garage.maemo.org/">Irreco / QtIrreco</a> project
+creates beautiful virtual remote controls.  I've also used the
+<a href="http://thp.io/2010/raemote/">Raemote</a> widget to control my Apple
+computers.  But these programs have their shortcomings; in particular, they
+are not universal.  Each simulated remote control in QtIrreco is a completely
+separate animal.  I would like to have a standard set of buttons that I can
+use on all sorts of different hardware.</p>
+
+<h3>What's up with LIRC?</h3>
+
+<p>Just as Irreco and Raemote do, I want to leverage the work of the 
+<a href="http://www.lirc.org/">Linux Infrared Remote Control</a> project.
+The LIRC project is, at the moment, by far the most influential open-source
+effort working with consumer IR.  And the N900 comes with a device driver
+built specifically for use with LIRC!  But, you see, I have a problem.  I
+don't want to do things the way LIRC wants to do things.</p>
+
+<p>The N900 is different from other Linux systems using IR -- rather than
+being the machine at which you point a remote control, this machine <i>is</i>
+the remote control.  Which is not what LIRC was made for; the heart of the
+LIRC project is a server that will sit and wait for messages to arrive from
+the IR hardware.  Although it can also broadcast IR data back out (when using
+hardware that supports 2-way IR communication), that is not its primary
+purpose.</p>
+
+<p>I believe there are three disadvantages to using the LIRC server as it
+currently exists.  First, there isn't much point to running a daemon on
+the N900 to manage the IR device; no messages are ever going to come in from
+the output-only hardware on the N900, so why sit and listen for them?</p>
+
+<p>The second problem is somewhat larger.  LIRC uses configuration files to
+describe the command set for each remote control.  And there are a lot of them.
+A whole lot.  We're talking thousands of files here, and each file can describe
+many remote controls.  This is not a problem for Raemote or Irreco, as they
+only need to deal with one config file at a time.  But if you're aiming to
+manage the whole lot of them, you need to find a way to deal with the
+multitudes.</p>
+
+<p>The third problem is more subtle, but really tough to crack.  You see, the
+whole point of LIRC is to take the commands it receives from the IR port and
+translate them into something recognizable.  As such, each config file provides
+a mapping from numeric commands to human-readable strings.  (These strings
+are normally based on the labels used on the remote control itself.)  This is a
+serious problem for a universal controller!  Take, for example, the "power"
+button found on most remote controls.  In some config files, the string for
+this is "power".  Others have "Power", or "POWER".  You can also find "pwr",
+"PWR", "ON/OFF", "ON-OFF", "ONOFF", "POWER_ON_OFF", "KEY_POWER", "Operate",
+"Standby", and who knows what else.  And, you've gotta be careful not to get
+confused by strings like "SUBTITLE_ON/OFF" or "TV_ON_TIMER".  How is an app to
+know which key to map all these strings to?</p>
+
+<h3>So how is Pierogi different?</h3>
+
+<p>
+Pierogi attempts to answer these problems.  First, it talks directly to the
+/dev/lirc0 device, no server middleman needed.  Yes, you can halt (or even
+uninstall!) the lircd daemon, and still use Pierogi.  Second, the entire
+set of LIRC config files are being processed and combined into a small(er)
+set of related families of commands.  The third problem mentioned above is a
+bit harder to solve; I'm currently mapping each LIRC config file string by
+hand to a corresponding Pierogi key.  Naturally, this process will be fraught
+with errors; I intend to keep updating Pierogi as these errors are found and
+fixed.
+</p>
+
+<h2>Internal Design Notes</h2>
+
+<p>If you're interested in the ugly details of the code, read on!</p>
+
+<h3>What's up with the name of this app?</h3>
+
+<p>Lately I've been naming my projects after tasty foods.  In particular,
+I've been working my way through the pasta-oriented dishes.  (My previous
+project, "Linguine", has gotten bogged down, so I moved on to this one...)</p>
+
+<h3>Why use Qt?</h3>
+
+<p>I'm a C++ kind of guy, it just makes sense to me to use a C++ kind of
+interface.  The Qt classes have everything you need to set up a decent UI,
+and Qt Creator makes coding up a project for the N900 relatively
+painless.  Check it out for yourself at
+<a href="http://qt.nokia.com/">the Qt webpage</a>.
+</p>
+
+<h3>The simplest device ever!</h3>
+
+<p>If you ever wanted to learn how to work with device drivers on Linux, the
+N900's infrared port is the device you want to start with.  It's not 
+much more than a flashlight: You turn it on.  You turn it off.  You turn it on
+again.  You turn it off again.  You really can't get much simpler than that.
+Interaction with the "/dev/lirc0" device involves no more than handing
+it an array of integers: the first integer being an amount of time to keep the
+light lit (in microseconds), the second being an amount of time to leave it
+switched off, the third on, the fourth off, and so on.</p>
+
+<p>Well, ok, so it involves just a little bit more than that.  You don't want
+to leave the light stuck in the "on" state when you are finished, so the driver
+demands that the last item in every array be an "on" amount -- after finishing
+that timer, the IR will stay off until the next command arrives.
+</p>
+
+<p>
+Also, in an attempt to weed out any confusing signals from natural IR sources
+in the environment, consumer IR devices are "pulsed" at a particular
+frequency.  So you're really turning a strobelight on and off, not just a
+flashlight.  When the receiver sees that the light is coming from a strobelight
+pulsing at the desired frequency, it can be assured that that signal came from
+an actual remote control.  The N900's device driver allows you to set the
+frequency anywhere between 20000 Hz and 500000 Hz.  38000 Hz seems to the most
+popular frequency used by modern remote controls, at least from what you find
+in LIRC config files.  Also, you can set how long each pulse needs to be held,
+in terms of a percentage: 25% means turning the light on for just one quarter
+of the pulse, 33% means leaving it on for one third, etc.  This is called the
+"duty cycle", and can be anywhere between 0 and 100 percent.  LIRC's default
+duty cycle is 50 percent.
+</p>
+
+<p>And that's about it.  I've been using a 
+<a href="http://svn.jacekowski.org/host_mode/trunk/drivers/input/lirc/lirc_rx51.c">web page</a>
+that lists the source code for the IR device driver.  I'm not sure if there's
+a better location out there for N900 source code, but this seems accurate
+so far.</p>
+
+<h3>You did <i>what</i> to the LIRC daemon?</h3>
+
+<p>
+Well, ok, yeah, I've cannibalized the transmission code out of the LIRC
+server and dumped it into my app.  Sort of.  I can't really keep my hands off
+of code once I've seen it, so I've rewritten it in C++, reorganizing it in
+an object-oriented manner along the way.</p>
+
+<p>
+Here's one way in which I disagree with the authors of LIRC: they've managed
+to cram support for practically every protocol used by every remote control
+ever made into a single codepath.  So, there's a single "transmit" function,
+sorting through a massive pile of flags, conditional statements, and some
+really funky delayed-action buffering to make everything work.  The simple act
+of splitting the code into one routine for the RC5 (biphase) protocol and
+another for the NEC (space-encoded) protocol makes it much easier to read, at
+least to my eyes.  (I haven't yet implemented the RC6 protocol.)
+</p>
+
+<h2>Attribution</h2>
+
+<p>I've fallen in love with the Gentleface Mono Icon Set.  Of the creative
+commons icon sets available, theirs stands head and shoulders above the rest.
+Find their work at <a href="http://www.gentleface.com">www.gentleface.com</a>.
+
+<h2>References</h2>
+
+<p>A set of links to some resources I've used while writing the code.</p>
+
+<ul>
+<li><a href="http://en.wikipedia.org/wiki/Consumer_IR">Wiki page</a> with
+general info on consumer IR
+
+<li>A <a href="http://www.sbprojects.com/knowledge/ir/index.php">good introduction</a>
+to the theory and practice behind consumer IR devices
+
+<li>A <a href="http://en.wikipedia.org/wiki/RC-5">Wiki for the RC-5 protocol</a>
+
+<li><a href="http://www.sbprojects.com/knowledge/ir/nec.php">Info on the NEC protocol</a>
+
+<li><a href="http://www2.renesas.com/faq/en/mi_com/f_com_remo.html">More info on the NEC protocol</a>
+
+<li>The heart of it all, the
+<a href="http://www.lirc.org/">Linux Infrared Remote Control</a> project.
+
+<li>Link to (what appears to be) the source code for the N900's
+<a href="http://svn.jacekowski.org/host_mode/trunk/drivers/input/lirc/lirc_rx51.c">/dev/lirc0 device driver</a>.
+<ul>
+
+</body>
+</html>
diff --git a/icons/PierogiIcon.png b/icons/PierogiIcon.png
new file mode 100644 (file)
index 0000000..8fed1ec
Binary files /dev/null and b/icons/PierogiIcon.png differ
diff --git a/icons/arrow_bottom_icon&48.png b/icons/arrow_bottom_icon&48.png
new file mode 100755 (executable)
index 0000000..0538371
Binary files /dev/null and b/icons/arrow_bottom_icon&48.png differ
diff --git a/icons/arrow_left_icon&48.png b/icons/arrow_left_icon&48.png
new file mode 100755 (executable)
index 0000000..a374ead
Binary files /dev/null and b/icons/arrow_left_icon&48.png differ
diff --git a/icons/arrow_right_icon&48.png b/icons/arrow_right_icon&48.png
new file mode 100755 (executable)
index 0000000..ac01b33
Binary files /dev/null and b/icons/arrow_right_icon&48.png differ
diff --git a/icons/arrow_top_icon&48.png b/icons/arrow_top_icon&48.png
new file mode 100755 (executable)
index 0000000..e7464d0
Binary files /dev/null and b/icons/arrow_top_icon&48.png differ
diff --git a/icons/blue_square.png b/icons/blue_square.png
new file mode 100644 (file)
index 0000000..dcd8cf5
Binary files /dev/null and b/icons/blue_square.png differ
diff --git a/icons/br_down_icon&48.png b/icons/br_down_icon&48.png
new file mode 100755 (executable)
index 0000000..fdfb40b
Binary files /dev/null and b/icons/br_down_icon&48.png differ
diff --git a/icons/br_up_icon&48.png b/icons/br_up_icon&48.png
new file mode 100755 (executable)
index 0000000..fd79003
Binary files /dev/null and b/icons/br_up_icon&48.png differ
diff --git a/icons/clock_icon&48.png b/icons/clock_icon&48.png
new file mode 100755 (executable)
index 0000000..d88b64a
Binary files /dev/null and b/icons/clock_icon&48.png differ
diff --git a/icons/dash.png b/icons/dash.png
new file mode 100644 (file)
index 0000000..624585d
Binary files /dev/null and b/icons/dash.png differ
diff --git a/icons/eject_icon&48.png b/icons/eject_icon&48.png
new file mode 100755 (executable)
index 0000000..75e5995
Binary files /dev/null and b/icons/eject_icon&48.png differ
diff --git a/icons/fastforward_next_icon&48.png b/icons/fastforward_next_icon&48.png
new file mode 100755 (executable)
index 0000000..8a97fbf
Binary files /dev/null and b/icons/fastforward_next_icon&48.png differ
diff --git a/icons/green_square.png b/icons/green_square.png
new file mode 100644 (file)
index 0000000..05c3f11
Binary files /dev/null and b/icons/green_square.png differ
diff --git a/icons/on-off_icon&48.png b/icons/on-off_icon&48.png
new file mode 100755 (executable)
index 0000000..4cfad95
Binary files /dev/null and b/icons/on-off_icon&48.png differ
diff --git a/icons/playback_ff_icon&48.png b/icons/playback_ff_icon&48.png
new file mode 100755 (executable)
index 0000000..4b39a1d
Binary files /dev/null and b/icons/playback_ff_icon&48.png differ
diff --git a/icons/playback_next_icon&48.png b/icons/playback_next_icon&48.png
new file mode 100755 (executable)
index 0000000..f4201ce
Binary files /dev/null and b/icons/playback_next_icon&48.png differ
diff --git a/icons/playback_pause_icon&48.png b/icons/playback_pause_icon&48.png
new file mode 100755 (executable)
index 0000000..effb3a6
Binary files /dev/null and b/icons/playback_pause_icon&48.png differ
diff --git a/icons/playback_play_icon&48.png b/icons/playback_play_icon&48.png
new file mode 100755 (executable)
index 0000000..ae0321c
Binary files /dev/null and b/icons/playback_play_icon&48.png differ
diff --git a/icons/playback_prev_icon&48.png b/icons/playback_prev_icon&48.png
new file mode 100755 (executable)
index 0000000..b00247d
Binary files /dev/null and b/icons/playback_prev_icon&48.png differ
diff --git a/icons/playback_rew_icon&48.png b/icons/playback_rew_icon&48.png
new file mode 100755 (executable)
index 0000000..b10fd8b
Binary files /dev/null and b/icons/playback_rew_icon&48.png differ
diff --git a/icons/playback_stop_icon&48.png b/icons/playback_stop_icon&48.png
new file mode 100755 (executable)
index 0000000..9866799
Binary files /dev/null and b/icons/playback_stop_icon&48.png differ
diff --git a/icons/red_record_icon.png b/icons/red_record_icon.png
new file mode 100644 (file)
index 0000000..ca84056
Binary files /dev/null and b/icons/red_record_icon.png differ
diff --git a/icons/red_square.png b/icons/red_square.png
new file mode 100644 (file)
index 0000000..b2bc663
Binary files /dev/null and b/icons/red_square.png differ
diff --git a/icons/redo_icon&48.png b/icons/redo_icon&48.png
new file mode 100755 (executable)
index 0000000..7b5a13c
Binary files /dev/null and b/icons/redo_icon&48.png differ
diff --git a/icons/rewind_previous_icon&48.png b/icons/rewind_previous_icon&48.png
new file mode 100755 (executable)
index 0000000..eb5be08
Binary files /dev/null and b/icons/rewind_previous_icon&48.png differ
diff --git a/icons/sound_high_icon&48.png b/icons/sound_high_icon&48.png
new file mode 100755 (executable)
index 0000000..d3ebae0
Binary files /dev/null and b/icons/sound_high_icon&48.png differ
diff --git a/icons/sound_low_icon&48.png b/icons/sound_low_icon&48.png
new file mode 100755 (executable)
index 0000000..cab3361
Binary files /dev/null and b/icons/sound_low_icon&48.png differ
diff --git a/icons/sound_mute_icon&48.png b/icons/sound_mute_icon&48.png
new file mode 100755 (executable)
index 0000000..21c3ba6
Binary files /dev/null and b/icons/sound_mute_icon&48.png differ
diff --git a/icons/undo_icon&48.png b/icons/undo_icon&48.png
new file mode 100755 (executable)
index 0000000..2b4d922
Binary files /dev/null and b/icons/undo_icon&48.png differ
diff --git a/icons/yellow_square.png b/icons/yellow_square.png
new file mode 100644 (file)
index 0000000..5520eb4
Binary files /dev/null and b/icons/yellow_square.png differ
diff --git a/keysets/apple.cpp b/keysets/apple.cpp
new file mode 100644 (file)
index 0000000..943da86
--- /dev/null
@@ -0,0 +1,53 @@
+#include "apple.h"
+#include "necprotocol.h"
+#include "pirmakenames.h"
+
+// Based on LIRC Apple_A1156 config file
+AppleWhiteRemote::AppleWhiteRemote(
+  QObject *guiObject,
+  unsigned int index)
+  : PIRKeysetMetaData(
+    "White Remote",
+    Apple_Make,
+    index)
+{
+  addControlledDevice(Apple_Make, "Mac Mini", Computer_Device);
+
+  // Set up the threadable object:
+  NECProtocol *np = new NECProtocol(
+    guiObject,
+    index,
+    574, 547,   // zero pulse, zero space
+    574, 1668,  // one pulse, one space
+    37600,      // gap
+    false);     // gap is not constant length
+
+  threadableProtocol = np;
+
+  np->setHeaderPair(9000, 4500);
+  np->setTrailerPulse(567);
+  np->setRepeatPair(9000, 2250);
+
+  np->setPreData(0x77e1, 16);
+  np->setPostData(0xc5, 8);
+
+  // Finally, add the keys:
+
+// Menu oriented:
+  addKey("menu", Menu_Key, 0x40, 8);
+  addKey("+", Up_Key, 0xD0, 8);
+  addKey("-", Down_Key, 0xB0, 8);
+  addKey("|<<", Left_Key, 0x10, 8);
+  addKey(">>|", Right_Key, 0xE0, 8);
+  addKey(">||", Select_Key, 0x20, 8);
+
+// Media oriented:
+  addKey("+", VolumeUp_Key, 0xD0, 8);
+  addKey("-", VolumeDown_Key, 0xB0, 8);
+  addKey("|<<", Rewind_Key, 0x10, 8);
+  addKey(">>|", FastForward_Key, 0xE0, 8);
+  addKey(">||", Play_Key, 0x20, 8);
+  addKey(">||", Pause_Key, 0x20, 8);
+  addKey("|<<", Previous_Key, 0x10, 8);
+  addKey(">>|", Next_Key, 0xE0, 8);
+}
diff --git a/keysets/apple.h b/keysets/apple.h
new file mode 100644 (file)
index 0000000..2b28523
--- /dev/null
@@ -0,0 +1,16 @@
+#ifndef APPLE_H
+#define APPLE_H
+
+#include "pirkeysetmetadata.h"
+
+#include <QObject>
+
+class AppleWhiteRemote: public PIRKeysetMetaData
+{
+public:
+  AppleWhiteRemote(
+    QObject *guiObject,
+    unsigned int index);
+};
+
+#endif // APPLE_H
diff --git a/keysets/ei.cpp b/keysets/ei.cpp
new file mode 100644 (file)
index 0000000..7314628
--- /dev/null
@@ -0,0 +1,76 @@
+#include "ei.h"
+#include "rc5protocol.h"
+
+// Based on LIRC Ei-TV90 config file
+EiKeyset::EiKeyset(
+  QObject *guiObject,
+  unsigned int index)
+  : PIRKeysetMetaData(
+      "Ei-TV90",
+      Ei_Make,
+      index)
+{
+  addControlledDevice(Ei_Make, "COLOR 51100", TV_Device);
+  addControlledDevice(Ei_Make, "COLOR 55100", TV_Device);
+  addControlledDevice(Ei_Make, "COLOR 63105", TV_Device);
+  addControlledDevice(Ei_Make, "COLOR 56105", TV_Device);
+  addControlledDevice(Ei_Make, "COLOR 72105", TV_Device);
+
+  RC5Protocol *rp = new RC5Protocol(
+    guiObject,
+    index,
+    931, 836,
+    969,
+    113205, 2);
+
+  threadableProtocol = rp;
+
+  rp->setPreData(0x10, 5);
+
+  rp->setToggleBit(2);
+
+  addKey("i", Unmapped_Key, 0x35, 8);
+  addKey("a", Unmapped_Key, 0x37, 8);
+  addKey("b", Unmapped_Key, 0x36, 8);
+  addKey("c", Unmapped_Key, 0x32, 8);
+  addKey("d", Unmapped_Key, 0x34, 8);
+  addKey("Page Down", Unmapped_Key, 0x0B, 8);
+  addKey("Page Up", Unmapped_Key, 0x0A, 8);
+  addKey("TV in TXT", Unmapped_Key, 0x2D, 8);
+  addKey("Stop TXT", Unmapped_Key, 0x29, 8);
+  addKey("Time TXT", Unmapped_Key, 0x2A, 8);
+  addKey("TV", Unmapped_Key, 0x3F, 8);
+  addKey("TXT On", Unmapped_Key, 0x3C, 8);
+  addKey("?", Unmapped_Key, 0x2C, 8);
+  addKey("Zoom", Unmapped_Key, 0x2B, 8);
+  addKey("Background TV", Unmapped_Key, 0x2E, 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("0", Zero_Key, 0x00, 8);
+  addKey("LIGHT-", Unmapped_Key, 0x13, 8);
+  addKey("LIGHT+", Unmapped_Key, 0x12, 8);
+  addKey("COLOR-", Unmapped_Key, 0x15, 8);
+  addKey("COLOR+", Unmapped_Key, 0x14, 8);
+  addKey("CONTRAST-", Unmapped_Key, 0x1D, 8);
+  addKey("CONTRAST+", Unmapped_Key, 0x1C, 8);
+  addKey("VOLUME-", VolumeDown_Key, 0x11, 8);
+  addKey("VOLUME+", VolumeUp_Key, 0x10, 8);
+  addKey("->*", Unmapped_Key, 0x1E, 8);
+  addKey("AV", Input_Key, 0x38, 8);
+  addKey("-/--", Unmapped_Key, 0x0A, 8);
+  addKey("TV_STATUS", Info_Key, 0x0F, 8);
+  addKey("SLEEP", Sleep_Key, 0x26, 8);
+  addKey("P<P", Unmapped_Key, 0x22, 8);
+  addKey("->*<-PP", Unmapped_Key, 0x0E, 8);
+  addKey("P-", ChannelDown_Key, 0x21, 8);
+  addKey("P+", ChannelUp_Key, 0x20, 8);
+  addKey("MUTE", Mute_Key, 0x0D, 8);
+  addKey("ON-OFF", Power_Key, 0x0C, 8);
+}
diff --git a/keysets/ei.h b/keysets/ei.h
new file mode 100644 (file)
index 0000000..64aa32c
--- /dev/null
@@ -0,0 +1,16 @@
+#ifndef EI_H
+#define EI_H
+
+#include "pirkeysetmetadata.h"
+
+#include <QObject>
+
+class EiKeyset: public PIRKeysetMetaData
+{
+public:
+  EiKeyset(
+    QObject *guiObject,
+    unsigned int index);
+};
+
+#endif // EI_H
diff --git a/keysets/goldstar.cpp b/keysets/goldstar.cpp
new file mode 100644 (file)
index 0000000..32e7323
--- /dev/null
@@ -0,0 +1,297 @@
+#include "goldstar.h"
+#include "necprotocol.h"
+#include "rc5protocol.h"
+
+GoldStarTV1::GoldStarTV1(
+  QObject *guiObject,
+  unsigned int index)
+  : PIRKeysetMetaData(
+      "105-210A TV",
+      GoldStar_Make,
+      index)
+{
+  addControlledDevice(GoldStar_Make, "105-210A", TV_Device);
+
+  NECProtocol *np = new NECProtocol(
+    guiObject,
+    index,
+    600, 500,
+    600, 1600,
+    10800, true);
+
+  threadableProtocol = np;
+
+  np->setHeaderPair(9000, 4500);
+  np->setTrailerPulse(600);
+  np->setRepeatPair(9000, 2250);
+
+  np->setPreData(0x20DF, 16);
+
+  addKey("power", Power_Key, 0x10EF, 16);
+  addKey("mute", Mute_Key, 0x906F, 16);
+  addKey("1", One_Key, 0x8877, 16);
+  addKey("2", Two_Key, 0x48B7, 16);
+  addKey("3", Three_Key, 0xC837, 16);
+  addKey("4", Four_Key, 0x28D7, 16);
+  addKey("5", Five_Key, 0xA857, 16);
+  addKey("6", Six_Key, 0x6897, 16);
+  addKey("7", Seven_Key, 0xE817, 16);
+  addKey("8", Eight_Key, 0x18E7, 16);
+  addKey("9", Nine_Key, 0x9867, 16);
+  addKey("0", Zero_Key, 0x08F7, 16);
+  addKey("lowhigh", DoubleDigit_Key, 0x38C7, 16);
+  addKey("recall", PrevChannel_Key, 0xD827, 16);
+  addKey("prup", ChannelUp_Key, 0x00FF, 16);
+  addKey("prdown", ChannelDown_Key, 0x807F, 16);
+  addKey("volup", VolumeUp_Key, 0x40BF, 16);
+  addKey("voldown", VolumeDown_Key, 0xC03F, 16);
+  addKey("ok", Select_Key, 0x22DD, 16);
+//  addKey("ok", Enter_Key, 0x22DD, 16);
+  addKey("prup", Up_Key, 0x00FF, 16);
+  addKey("voldown", Left_Key, 0xC03F, 16);
+  addKey("volup", Right_Key, 0x40BF, 16);
+  addKey("prdown", Down_Key, 0x807F, 16);
+  addKey("tvav", Input_Key, 0xD02F, 16);
+  addKey("menu", Menu_Key, 0xC23D, 16);
+  addKey("psm", Unmapped_Key, 0xF20D, 16);
+  addKey("sleep", Sleep_Key, 0x708F, 16);
+  addKey("qview", Unmapped_Key, 0x58A7, 16);
+  addKey("picture", PictureMode_Key, 0x30CF, 16);
+}
+
+
+GoldStarTV2::GoldStarTV2(
+  QObject *guiObject,
+  unsigned int index)
+  : PIRKeysetMetaData(
+      "TV Keyset 2",
+      GoldStar_Make,
+      index)
+{
+  RC5Protocol *rp = new RC5Protocol(
+    guiObject,
+    index,
+    899, 783,
+    962,
+    107722, true);
+
+  threadableProtocol = rp;
+
+  rp->setPreData(0x40, 7);
+
+  rp->setToggleBit(2);
+
+  addKey("0", Zero_Key, 0x00, 6);
+  addKey("1", One_Key, 0x01, 6);
+  addKey("2", Two_Key, 0x02, 6);
+  addKey("3", Three_Key, 0x03, 6);
+  addKey("4", Four_Key, 0x04, 6);
+  addKey("5", Five_Key, 0x05, 6);
+  addKey("6", Six_Key, 0x06, 6);
+  addKey("7", Seven_Key, 0x07, 6);
+  addKey("8", Eight_Key, 0x08, 6);
+  addKey("9", Nine_Key, 0x09, 6);
+  addKey("MUTE", Mute_Key, 0x0D, 6);
+  addKey("POWER", Power_Key, 0x0C, 6);
+  addKey("TV", Unmapped_Key, 0x3F, 6);
+  addKey("AV", Unmapped_Key, 0x38, 6);
+  addKey("LOOP", Unmapped_Key, 0x22, 6);
+  addKey("-/--", DoubleDigit_Key, 0x0A, 6);
+  addKey("PP", Unmapped_Key, 0x0E, 6);
+  addKey("MENU", Menu_Key, 0x3B, 6);
+  addKey("OK", Select_Key, 0x25, 6);
+  addKey("OK", Enter_Key, 0x25, 6);
+  addKey("VOL-", VolumeDown_Key, 0x11, 6);
+  addKey("VOL+", VolumeUp_Key, 0x10, 6);
+  addKey("PROG-", ChannelDown_Key, 0x21, 6);
+  addKey("PROG+", ChannelUp_Key, 0x20, 6);
+  addKey("<=", Unmapped_Key, 0x0B, 6);
+  addKey("=", Unmapped_Key, 0x3C, 6);
+  addKey("RED", Red_Key, 0x37, 6);
+  addKey("GREEN", Green_Key, 0x36, 6);
+  addKey("YELLOW", Yellow_Key, 0x32, 6);
+  addKey("BLUE", Blue_Key, 0x34, 6);
+  addKey("=/", Unmapped_Key, 0x2E, 6);
+  addKey("=o", Unmapped_Key, 0x2A, 6);
+  addKey("=?", Unmapped_Key, 0x2C, 6);
+  addKey("=i", Unmapped_Key, 0x35, 6);
+  addKey("=^", Unmapped_Key, 0x2B, 6);
+  addKey(">=<", Unmapped_Key, 0x29, 6);
+  addKey("=X", Unmapped_Key, 0x2D, 6);
+  addKey("=M", Unmapped_Key, 0x3E, 6);
+}
+
+
+GoldStarVCR1::GoldStarVCR1(
+  QObject *guiObject,
+  unsigned int index)
+  : PIRKeysetMetaData(
+      "VCR Keyset 1",
+      GoldStar_Make,
+      index)
+{
+  addControlledDevice(GoldStar_Make, "GSE-Q204P", VCR_Device);
+  addControlledDevice(GoldStar_Make, "QUISY 500", VCR_Device);
+
+  NECProtocol *np = new NECProtocol(
+    guiObject,
+    index,
+    600, 500,
+    600, 1600,
+    108000, true);
+
+  threadableProtocol = np;
+
+  np->setHeaderPair(9000, 4500);
+  np->setTrailerPulse(600);
+  np->setRepeatPair(9000, 2250);
+
+  np->setPreData(0x7689, 16);
+
+  addKey("power", Power_Key, 0x28D7, 16);
+  addKey("eject", Eject_Key, 0x00FF, 16);
+  addKey("a_trk", AutoTracking_Key, 0xFA05, 16);
+  addKey("tracking+", TrackingPlus_Key, 0x22DD, 16);
+  addKey("tracking-", TrackingMinus_Key, 0xA25D, 16);
+  addKey("prog+", ChannelUp_Key, 0x18E7, 16);
+  addKey("prog-", ChannelDown_Key, 0x9867, 16);
+  addKey("child_lock", Unmapped_Key, 0xFC03, 16);
+  addKey("play", Play_Key, 0x10EF, 16);
+  addKey("<rew", Rewind_Key, 0x40BF, 16);
+  addKey("ff>", FastForward_Key, 0xC03F, 16);
+  addKey("pause||", Pause_Key, 0xD02F, 16);
+  addKey("stop", Stop_Key, 0x807F, 16);
+  addKey("record", Record_Key, 0x906F, 16);
+  addKey("reset", Reset_Key, 0xB24D, 16);
+  addKey("clock_count", Unmapped_Key, 0x32CD, 16); // "memory"
+  addKey("show_view", Unmapped_Key, 0xE21D, 16);
+  addKey("menu", Menu_Key, 0x6897, 16);
+  addKey("up", Up_Key, 0x41BE, 16);
+  addKey("down", Down_Key, 0x916E, 16);
+  addKey("right", Right_Key, 0x09F6, 16);
+  addKey("left", Left_Key, 0xC13E, 16);
+//  addKey("ok", Enter_Key, 0x718E, 16);
+  addKey("ok", Select_Key, 0x718E, 16);
+  addKey("clear", Clear_Key, 0xF807, 16);
+  addKey("display", Info_Key, 0x7887, 16);
+  addKey("1", One_Key, 0xA05F, 16);
+  addKey("2", Two_Key, 0x609F, 16);
+  addKey("3", Three_Key, 0xE01F, 16);
+  addKey("4", Four_Key, 0x30CF, 16);
+  addKey("5", Five_Key, 0xB04F, 16);
+  addKey("6", Six_Key, 0x708F, 16);
+  addKey("7", Seven_Key, 0xF00F, 16);
+  addKey("8", Eight_Key, 0x38C7, 16);
+  addKey("9", Nine_Key, 0xB847, 16);
+  addKey("0", Zero_Key, 0x20DF, 16);
+  addKey("preset", Unmapped_Key, 0x728D, 16);
+  addKey("viss", Unmapped_Key, 0x827D, 16);
+  addKey("vps", Unmapped_Key, 0x926D, 16);
+  addKey("tv_vcr", Input_Key, 0xA857, 16);
+  addKey("sp/lp", VHSSpeed_Key, 0x12ED, 16);
+  addKey("length", Unmapped_Key, 0xD22D, 16);
+  addKey("start", Unmapped_Key, 0x52AD, 16);
+  addKey("f/a", Unmapped_Key, 0x08F7, 16);
+}
+
+
+GoldStarVCR1a::GoldStarVCR1a(
+  QObject *guiObject,
+  unsigned int index)
+  : GoldStarVCR1(guiObject, index)
+{
+  setKeysetName("VCR Keyset 1a");
+
+  addKey("slow", Unmapped_Key, 0xC837, 16);
+  addKey("slow+", Unmapped_Key, 0x58A7, 16);
+  addKey("slow-", Unmapped_Key, 0xD827, 16);
+}
+
+
+GoldStarVCR1b::GoldStarVCR1b(
+  QObject *guiObject,
+  unsigned int index)
+  : GoldStarVCR1(guiObject, index)
+{
+  setKeysetName("VCR Keyset 1b");
+
+  addKey("BACK", Exit_Key, 0x32CD, 16);
+}
+
+
+GoldStarVCR1c::GoldStarVCR1c(
+  QObject *guiObject,
+  unsigned int index)
+  : GoldStarVCR1(guiObject, index)
+{
+  setKeysetName("VCR Keyset 1c");
+
+  addKey("trk+", TrackingPlus_Key, 0x7788, 16);
+  addKey("trk-", TrackingMinus_Key, 0xB748, 16);
+  addKey("a.trk", AutoTracking_Key, 0x17E8, 16);
+  addKey("a.repeart", Unmapped_Key, 0xAF50, 16);
+}
+
+
+GoldStarVCR1d::GoldStarVCR1d(
+  QObject *guiObject,
+  unsigned int index)
+  : GoldStarVCR1(guiObject, index)
+{
+  setKeysetName("VCR Keyset 1d");
+  
+  addKey("TU_AV", Input_Key, 0x6A95, 16);
+}
+
+
+// Based on LIRC 6710S-6000A config file
+GoldStarCD1::GoldStarCD1(
+  QObject *guiObject,
+  unsigned int index)
+  : PIRKeysetMetaData(
+      "CD Player Keyset 1",
+      GoldStar_Make,
+      index)
+{
+  addControlledDevice(GoldStar_Make, "FFH-272A/L", Audio_Device);
+
+  NECProtocol *np = new NECProtocol(
+    guiObject,
+    index,
+    600, 500,
+    600, 1600,
+    108000, true);
+
+  threadableProtocol = np;
+
+  np->setHeaderPair(4500, 4500);
+  np->setTrailerPulse(600);
+  np->setRepeatPair(600, 1600);
+  np->setRepeatNeedsHeader(true);
+
+  np->setPreData(0x0808, 16);
+  np->setPostData(0x1, 1);
+
+  addKey("power", Power_Key, 0x3C43, 15);
+  addKey("mute", Mute_Key, 0x7C03, 15);
+  addKey("cd", Unmapped_Key, 0x601F, 15);
+  addKey("tape", Unmapped_Key, 0x0877, 15);
+  addKey("aux", Unmapped_Key, 0x4837, 15);
+  addKey("fm", Unmapped_Key, 0x007F, 15);
+  addKey("mw", Unmapped_Key, 0x403F, 15);
+  addKey("lw", Unmapped_Key, 0x205F, 15);
+  addKey("pre-", ChannelDown_Key, 0x245B, 15);
+  addKey("pre+", ChannelUp_Key, 0x641B, 15);
+  addKey("ply/pau", Play_Key, 0x106F, 15);
+  addKey("stop", Stop_Key, 0x502F, 15);
+  addKey("prev", Previous_Key, 0x304F, 15);
+  addKey("next", Next_Key, 0x700F, 15);
+  addKey("prog", Unmapped_Key, 0x5926, 15);
+  addKey("repeat", Replay_Key, 0x3946, 15);
+  addKey("random", Unmapped_Key, 0x057A, 15);
+  addKey("dskip", Unmapped_Key, 0x2956, 15);
+  addKey("remain", Unmapped_Key, 0x453A, 15);
+  addKey("eqpatt", Unmapped_Key, 0x017E, 15);
+  addKey("vol-", VolumeDown_Key, 0x344B, 15);
+  addKey("vol+", VolumeUp_Key, 0x740B, 15);
+}
diff --git a/keysets/goldstar.h b/keysets/goldstar.h
new file mode 100644 (file)
index 0000000..e617611
--- /dev/null
@@ -0,0 +1,79 @@
+#ifndef GOLDSTAR_H
+#define GOLDSTAR_H
+
+#include "pirkeysetmetadata.h"
+
+#include <QObject>
+
+class GoldStarTV1: public PIRKeysetMetaData
+{
+public:
+  GoldStarTV1(
+    QObject *guiObject,
+    unsigned int index);
+};
+
+
+class GoldStarTV2: public PIRKeysetMetaData
+{
+public:
+  GoldStarTV2(
+    QObject *guiObject,
+    unsigned int index);
+};
+
+
+class GoldStarVCR1: public PIRKeysetMetaData
+{
+public:
+  GoldStarVCR1(
+    QObject *guiObject,
+    unsigned int index);
+};
+
+
+class GoldStarVCR1a: public GoldStarVCR1
+{
+public:
+  GoldStarVCR1a(
+    QObject *guiObject,
+    unsigned int index);
+};
+
+
+class GoldStarVCR1b: public GoldStarVCR1
+{
+public:
+  GoldStarVCR1b(
+    QObject *guiObject,
+    unsigned int index);
+};
+
+
+class GoldStarVCR1c: public GoldStarVCR1
+{
+public:
+  GoldStarVCR1c(
+    QObject *guiObject,
+    unsigned int index);
+};
+
+
+class GoldStarVCR1d: public GoldStarVCR1
+{
+public:
+  GoldStarVCR1d(
+    QObject *guiObject,
+    unsigned int index);
+};
+
+
+class GoldStarCD1: public PIRKeysetMetaData
+{
+public:
+  GoldStarCD1(
+    QObject *guiObject,
+    unsigned int index);
+};
+
+#endif // GOLDSTAR_H
diff --git a/keysets/hauppauge.cpp b/keysets/hauppauge.cpp
new file mode 100644 (file)
index 0000000..b451f38
--- /dev/null
@@ -0,0 +1,129 @@
+#include "hauppauge.h"
+#include "rc5protocol.h"
+
+HauppaugeGeneric::HauppaugeGeneric(
+  QObject *guiObject,
+  unsigned int index)
+  : PIRKeysetMetaData(
+      "Generic Remote",
+      Hauppauge_Make,
+      index)
+{
+  RC5Protocol *rp = new RC5Protocol(
+    guiObject,
+    index,
+    950, 820,     // biphase pulse
+    1000,         // lead pulse
+    114000, true); // constant-length gap
+
+  threadableProtocol = rp;
+
+  rp->setPreData(0x17, 5);
+
+  rp->setToggleBit(2);
+
+  addKey("Power", Power_Key, 0xBD, 8);
+  addKey("Go", Unmapped_Key, 0xBB, 8);
+  addKey("TV", Unmapped_Key, 0x9C, 8);
+  addKey("Videos", Unmapped_Key, 0x98, 8);
+  addKey("Music", Unmapped_Key, 0x99, 8);
+  addKey("Pictures", Unmapped_Key, 0x9A, 8);
+  addKey("Guide", Unmapped_Key, 0x9B, 8);
+  addKey("Radio", Unmapped_Key, 0x8C, 8);
+  addKey("Up", Up_Key, 0x94, 8);
+  addKey("Down", Down_Key, 0x95, 8);
+  addKey("Left", Left_Key, 0x96, 8);
+  addKey("Right", Right_Key, 0x97, 8);
+  addKey("Ok", Enter_Key, 0xA5, 8);
+  addKey("Ok", Select_Key, 0xA5, 8);
+  addKey("Back/Exit", Exit_Key, 0x9F, 8);
+  addKey("Menu/i", Menu_Key, 0x8D, 8);
+  addKey("Vol+", VolumeUp_Key, 0x90, 8);
+  addKey("Vol-", VolumeDown_Key, 0x91, 8);
+  addKey("Prev.Ch", PrevChannel_Key, 0x92, 8);
+  addKey("Mute", Mute_Key, 0x8F, 8);
+  addKey("Ch+", ChannelUp_Key, 0xA0, 8);
+  addKey("Ch-", ChannelDown_Key, 0xA1, 8);
+  addKey("Record", Record_Key, 0xB7, 8);
+  addKey("Stop", Stop_Key, 0xB6, 8);
+  addKey("Rewind", Rewind_Key, 0xB2, 8);
+  addKey("Play", Play_Key, 0xB5, 8);
+  addKey("Forward", FastForward_Key, 0xB4, 8);
+  addKey("Replay/SkipBackward", Replay_Key, 0xA4, 8);
+  addKey("Pause", Pause_Key, 0xB0, 8);
+  addKey("SkipForward", Advance_Key, 0x9E, 8);
+  addKey("1", One_Key, 0x81, 8);
+  addKey("2", Two_Key, 0x82, 8);
+  addKey("3", Three_Key, 0x83, 8);
+  addKey("4", Four_Key, 0x84, 8);
+  addKey("5", Five_Key, 0x85, 8);
+  addKey("6", Six_Key, 0x86, 8);
+  addKey("7", Seven_Key, 0x87, 8);
+  addKey("8", Eight_Key, 0x88, 8);
+  addKey("9", Nine_Key, 0x89, 8);
+  addKey("0", Zero_Key, 0x80, 8);
+  addKey("Asterix", Unmapped_Key, 0x8A, 8);
+  addKey("sub/cc", Captions_Key, 0x8E, 8);
+  addKey("Red", Red_Key, 0x8B, 8);
+  addKey("Green", Green_Key, 0xAE, 8);
+  addKey("Yellow", Yellow_Key, 0xB8, 8);
+  addKey("Blue", Blue_Key, 0xA9, 8);
+}
+
+
+// Based on LIRC Sony_RM-V302-DVD010 config file
+HauppaugeTV1::HauppaugeTV1(
+  QObject *guiObject,
+  unsigned int index)
+  : PIRKeysetMetaData(
+      "TV Keyset 1",
+      Hauppauge_Make,
+      index)
+{
+  addControlledDevice(Hauppauge_Make, "PVR-250", TV_Device);
+
+  RC5Protocol *rp = new RC5Protocol(
+    guiObject,
+    index,
+    889, 889,
+    889,
+    113792, true);
+
+  threadableProtocol = rp;
+
+  rp->setToggleBit(2);
+
+  addKey("POWER", Power_Key, 0x150C, 13);
+  addKey("1", One_Key, 0x1525, 13);
+  addKey("2", Two_Key, 0x1526, 13);
+  addKey("3", Three_Key, 0x1527, 13);
+  addKey("4", Four_Key, 0x1519, 13);
+  addKey("5", Five_Key, 0x153D, 13);
+  addKey("6", Six_Key, 0x1516, 13);
+  addKey("7", Seven_Key, 0x1517, 13);
+  addKey("8", Eight_Key, 0x1518, 13);
+  addKey("9", Nine_Key, 0x152B, 13);
+  addKey("0", Zero_Key, 0x151D, 13);
+  addKey("VOL+", VolumeUp_Key, 0x1810, 13);
+  addKey("VOL-", VolumeDown_Key, 0x1811, 13);
+  addKey("CH+", ChannelUp_Key, 0x1534, 13);
+  addKey("CH-", ChannelDown_Key, 0x1533, 13);
+  addKey("TV/VIDEO", Input_Key, 0x1500, 13);
+  addKey("DISPLAY", Info_Key, 0x1532, 13);
+  addKey("SLEEP", Sleep_Key, 0x1510, 13);
+  addKey("MUTE", Mute_Key, 0x180D, 13);
+  addKey("RECALL", PrevChannel_Key, 0x1501, 13);
+  addKey("UP", Up_Key, 0x1502, 13);
+  addKey("DOWN", Down_Key, 0x1508, 13);
+  addKey("LEFT", Left_Key, 0x1504, 13);
+  addKey("RIGHT", Right_Key, 0x1506, 13);
+  addKey("MENU", Menu_Key, 0x1503, 13);
+  addKey("OK", Enter_Key, 0x1505, 13);
+  addKey("OK", Select_Key, 0x1505, 13);
+  addKey("SEEK-", Rewind_Key, 0x1535, 13);
+  addKey("PLAY", Play_Key, 0x1530, 13);
+  addKey("SEEK+", FastForward_Key, 0x1536, 13);
+  addKey("PAUSE", Pause_Key, 0x153C, 13);
+  addKey("STOP", Stop_Key, 0x1520, 13);
+}
+
diff --git a/keysets/hauppauge.h b/keysets/hauppauge.h
new file mode 100644 (file)
index 0000000..9d9295c
--- /dev/null
@@ -0,0 +1,25 @@
+#ifndef HAUPPAUGE_H
+#define HAUPPAUGE_H
+
+#include "pirkeysetmetadata.h"
+
+#include <QObject>
+
+class HauppaugeGeneric: public PIRKeysetMetaData
+{
+public:
+  HauppaugeGeneric(
+    QObject *guiObject,
+    unsigned int index);
+};
+
+
+class HauppaugeTV1: public PIRKeysetMetaData
+{
+public:
+  HauppaugeTV1(
+    QObject *guiObject,
+    unsigned int index);
+};
+
+#endif // HAUPPAUGE_H
diff --git a/keysets/lg.cpp b/keysets/lg.cpp
new file mode 100644 (file)
index 0000000..e809eab
--- /dev/null
@@ -0,0 +1,535 @@
+#include "lg.h"
+#include "necprotocol.h"
+#include "rc5protocol.h"
+#include "pirmakenames.h"
+
+LGTV1::LGTV1(
+  QObject *guiObject,
+  unsigned int index)
+  : PIRKeysetMetaData(
+      "TV Keyset 1",
+      LG_Make,
+      index)
+{
+  NECProtocol *np = new NECProtocol(
+    guiObject,
+    index,
+    600, 533,
+    600, 1652,
+    107753, true);
+
+  threadableProtocol = np;
+
+  np->setHeaderPair(9000, 4500);
+  np->setTrailerPulse(600);
+  np->setRepeatPair(9000, 2250);
+
+  np->setPreData(0x20DF, 16);
+
+//  np->setMinimumRepetitions(2);
+
+  addKey("power", Power_Key, 0x10EF, 16);
+  addKey("input", Input_Key, 0xD02F, 16);
+  addKey("energy", Unmapped_Key, 0xA956, 16); // "EYEASTERISK"
+  addKey("tv/radio", Unmapped_Key, 0x0FF0, 16);
+  addKey("avmode", Unmapped_Key, 0x0CF3, 16); // "UPDATE"
+  addKey("1", One_Key, 0x8877, 16);
+  addKey("2", Two_Key, 0x48B7, 16);
+  addKey("3", Three_Key, 0xC837, 16);
+  addKey("4", Four_Key, 0x28D7, 16);
+  addKey("5", Five_Key, 0xA857, 16);
+  addKey("6", Six_Key, 0x6897, 16);
+  addKey("7", Seven_Key, 0xE817, 16);
+  addKey("8", Eight_Key, 0x18E7, 16);
+  addKey("9", Nine_Key, 0x9867, 16);
+  addKey("0", Zero_Key, 0x08F7, 16);
+  addKey("list", Unmapped_Key, 0xCA35, 16);
+  addKey("qview", Unmapped_Key, 0x58A7, 16);
+  addKey("vol+", VolumeUp_Key, 0x40BF, 16);
+  addKey("vol-", VolumeDown_Key, 0xC03F, 16);
+  addKey("mute", Mute_Key, 0x906F, 16);
+  addKey("p+", ChannelUp_Key, 0x00FF, 16);
+  addKey("p-", ChannelDown_Key, 0x807F, 16);
+  addKey("up", Up_Key, 0x02FD, 16);
+  addKey("down", Down_Key, 0x827D, 16);
+  addKey("left", Left_Key, 0xE01F, 16);
+  addKey("right", Right_Key, 0x609F, 16);
+  addKey("ok", Select_Key, 0x22DD, 16);
+  addKey("menu", Menu_Key, 0xC23D, 16);
+  addKey("return/exit", Exit_Key, 0x14EB, 16);
+  addKey("red", Red_Key, 0x4EB1, 16);
+  addKey("green", Green_Key, 0x8E71, 16);
+  addKey("yellow", Yellow_Key, 0xC639, 16);
+  addKey("blue", Blue_Key, 0x8679, 16);
+  addKey("green/stop", Stop_Key, 0x8E71, 16);
+  addKey("yellow/play", Play_Key, 0xC639, 16);
+  addKey("blue/pause", Pause_Key, 0x8679, 16);
+  addKey("text", Unmapped_Key, 0x04FB, 16);
+  addKey("topt", Unmapped_Key, 0x847B, 16);
+  addKey("topt/rev", Rewind_Key, 0x847B, 16);
+  addKey("subtitle", Captions_Key, 0x9C63, 16); // "cc"
+  addKey("subtitle/ffw", FastForward_Key, 0x9C63, 16);
+  addKey("rec", Record_Key, 0xBD42, 16);
+  addKey("simplink", Unmapped_Key, 0x7E81, 16);
+  addKey("qmenu", Unmapped_Key, 0xA25D, 16);
+  addKey("info", Info_Key, 0x55AA, 16);
+  addKey("guide", Guide_Key, 0xD52A, 16);
+  addKey("fav", Unmapped_Key, 0x7887, 16);
+  addKey("brt.w", Unmapped_Key, 0x7689, 16);
+  addKey("sound", Unmapped_Key, 0xB04F, 16);
+  addKey("auto", Unmapped_Key, 0x2AD5, 16);
+  addKey("comp-rgb-dvi", Unmapped_Key, 0x19E6, 16);
+  addKey("sleep", Sleep_Key, 0x708F, 16);
+  addKey("sap", Unmapped_Key, 0x50AF, 16);
+  addKey("ratio", AspectRatio_Key, 0x9E61, 16);
+  addKey("video", Unmapped_Key, 0xB24D, 16); // "apc", "PSM"
+  addKey("picture", Unmapped_Key, 0x30CF, 16);
+  addKey("review", Unmapped_Key, 0x58A7, 16);
+  addKey("memory/erase", Unmapped_Key, 0xAA55, 16);
+  addKey("sound", Unmapped_Key, 0x4AB5, 16); // "SSM"
+  addKey("INDEX", Unmapped_Key, 0xE41B, 16);
+  addKey("MIX", Unmapped_Key, 0x24DB, 16);
+  addKey("TIME", Unmapped_Key, 0x649B, 16);
+  addKey("TV/PC", Unmapped_Key, 0x0AF5, 16);
+  addKey("xstudio", Unmapped_Key, 0x3EC1, 16);
+}
+
+
+LGTV1a::LGTV1a(
+  QObject *guiObject,
+  unsigned int index)
+  : LGTV1(guiObject, index)
+{
+  setKeysetName("TV Keyset 1a");
+
+  addKey("exit", Exit_Key, 0xDA25, 16);
+  addKey("pip", PIP_Key, 0x06F9, 16);
+//  addKey("pop", Unmapped_Key, 0x8679, 16);
+  addKey("swap", PIPSwap_Key, 0xC639, 16);
+  addKey("*", Unmapped_Key, 0x9C63, 16);
+  addKey("pipch-", Unmapped_Key, 0x4EB1, 16);
+  addKey("pipch+", Unmapped_Key, 0x8E71, 16);
+  addKey("pipinput", Unmapped_Key, 0x8679, 16);
+  addKey("freeze", Unmapped_Key, 0xA659, 16);
+  addKey("zoom", Unmapped_Key, 0xDE21, 16);
+  addKey("signal", Unmapped_Key, 0x6996, 16);
+  addKey("adjust", Unmapped_Key, 0xD32C, 16);
+}
+
+
+LGTV1b::LGTV1b(
+  QObject *guiObject,
+  unsigned int index)
+  : LGTV1(guiObject, index)
+{
+  setKeysetName("TV Keyset 1b");
+
+  addKey("Vol-/Left_Arrow", Left_Key, 0xC03F, 16);
+  addKey("Vol+/Right_Arrow", Right_Key, 0x40BF, 16);
+  addKey("PR+/Up_Arrow", Up_Key, 0x00FF, 16);
+  addKey("PR-/Down_Arrow", Down_Key, 0x807F, 16);
+  addKey("I/II", DoubleDigit_Key, 0x50AF, 16);
+  addKey("orange", Red_Key, 0x03FC, 16);
+  addKey("green", Green_Key, 0xC33C, 16);
+  addKey("yellow", Yellow_Key, 0x837C, 16);
+  addKey("blue", Blue_Key, 0x43BC, 16);
+}
+
+
+LGTV1c::LGTV1c(
+  QObject *guiObject,
+  unsigned int index)
+  : LGTV1(guiObject, index)
+{
+  setKeysetName("TV Keyset 1c");
+
+  addKey("stop", Stop_Key, 0x8D72, 16);
+  addKey("play", Play_Key, 0x0DF2, 16);
+  addKey("pause", Pause_Key, 0x5DA2, 16);
+  addKey("rec", Record_Key, 0xBD42, 16);
+  addKey("backward", Rewind_Key, 0xF10E, 16);
+  addKey("forward", FastForward_Key, 0x718E, 16);
+  addKey("pip", PIP_Key, 0x06F9, 16);
+}
+
+
+LGTV2::LGTV2(
+  QObject *guiObject,
+  unsigned int index)
+  : PIRKeysetMetaData(
+      "TV Keyset 2",
+      LG_Make,
+      index)
+{
+  RC5Protocol *rp = new RC5Protocol(
+    guiObject,
+    index,
+    800, 800,
+    800,
+    107000, true);
+
+  threadableProtocol = rp;
+
+  rp->setPreData(0x10, 5);
+
+  rp->setToggleBit(2);
+
+  addKey("POWER", Power_Key, 0x0C, 8);
+  addKey("DRP", Unmapped_Key, 0x14, 8);
+  addKey("TVAV", Unmapped_Key, 0x38, 8);
+  addKey("TURBOSOUND", Unmapped_Key, 0x24, 8);
+  addKey("TURBOPICTURE", Unmapped_Key, 0x13, 8);
+  addKey("PIP", PIP_Key, 0x3A, 8);
+  addKey("TEXT", Unmapped_Key, 0x3C, 8);
+  addKey("PR-MINUS", Unmapped_Key, 0x37, 8);
+  addKey("PR-PLUS", Unmapped_Key, 0x36, 8);
+  addKey("SWAP", PIPSwap_Key, 0x32, 8);
+  addKey("INPUT", Input_Key, 0x34, 8);
+  addKey("MENU", Menu_Key, 0x3B, 8);
+  addKey("MUTE", Mute_Key, 0x0D, 8);
+  addKey("PROGUP", ChannelUp_Key, 0x20, 8);
+  addKey("PROGDOWN", ChannelDown_Key, 0x21, 8);
+  addKey("VOLDOWN", VolumeDown_Key, 0x11, 8);
+  addKey("VOLUP", VolumeUp_Key, 0x10, 8);
+  addKey("OK", Select_Key, 0x25, 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("0", Zero_Key, 0x00, 8);
+  addKey("PSM", Unmapped_Key, 0x0E, 8); // preset picture
+  addKey("SSM", Unmapped_Key, 0x16, 8); // preset sound
+  addKey("POS", Unmapped_Key, 0x2D, 8); // position, "UPDATE"
+  addKey("2-12PIP", Unmapped_Key, 0x35, 8); // strobe, "KEY_SHOP"
+  addKey("STILL", Pause_Key, 0x29, 8); // "KEY_PAUSE", "HOLD"
+  addKey("SIZE", Unmapped_Key, 0x2B, 8);  // "KEY_SAVE"
+  addKey("TIME", Unmapped_Key, 0x2A, 8);
+  addKey("REVEAL", Unmapped_Key, 0x2C, 8); // "KEY_REDO"
+  addKey("MIX", Unmapped_Key, 0x2E, 8);  // "KEY_MAX"
+  addKey("SLEEP", Sleep_Key, 0x3E, 8);
+  addKey("LIST", Unmapped_Key, 0x0F, 8);
+  addKey("I-II", DoubleDigit_Key, 0x23, 8);
+  addKey("ARC", AspectRatio_Key, 0x33, 8);
+  addKey("EYE", Unmapped_Key, 0x12, 8);
+  addKey("KEY_MEDIA", Unmapped_Key, 0x15, 8);
+}
+
+
+LGTV2a::LGTV2a(
+  QObject *guiObject,
+  unsigned int index)
+  : LGTV2(guiObject, index)
+{
+  setKeysetName("TV Keyset 2a");
+
+  addKey("KEY_RED", Red_Key, 0x37, 8);
+  addKey("KEY_GREEN", Green_Key, 0x36, 8);
+  addKey("KEY_YELLOW", Yellow_Key, 0x32, 8);
+  addKey("KEY_BLUE", Blue_Key, 0x34, 8);
+}
+
+
+LGTV2b::LGTV2b(
+  QObject *guiObject,
+  unsigned int index)
+  : LGTV2(guiObject, index)
+{
+  setKeysetName("TV Keyset 2b");
+
+  addKey("EYE/*", Unmapped_Key, 0x37, 8);
+  addKey("I/II/*", DoubleDigit_Key, 0x36, 8);
+  addKey("Q.VIEW", Unmapped_Key, 0x32, 8);
+  addKey("LIST", Unmapped_Key, 0x34, 8);
+  addKey("sleep", Sleep_Key, 0x26, 8); // might need separate class
+}
+
+
+LGDisc1::LGDisc1(
+  QObject *guiObject,
+  unsigned int index)
+  : PIRKeysetMetaData(
+      "DVD/BD Keyset 1",
+      LG_Make,
+      index)
+{
+  NECProtocol *np = new NECProtocol(
+    guiObject,
+    index,
+    563, 559,
+    563, 1681,
+    108234, true);
+
+  threadableProtocol = np;
+
+  np->setHeaderPair(4500, 4500);
+  np->setTrailerPulse(545);
+  np->setRepeatPair(531, 1710);
+  np->setRepeatNeedsHeader(true);
+
+  np->setPreData(0x3434, 16);
+
+  np->setMinimumRepetitions(1);
+
+  addKey("power", Power_Key, 0x7887, 16);
+  addKey("open-close", Eject_Key, 0x59A6, 16);
+  addKey("cd-dvd", Unmapped_Key, 0xC03F, 16);
+  addKey("band", Unmapped_Key, 0x9A65, 16);
+  addKey("aux", Unmapped_Key, 0x906F, 16);
+//  addKey("aux", Unmapped_Key, 0x51AE, 16);
+  addKey("1", One_Key, 0x827D, 16);
+  addKey("2", Two_Key, 0x42BD, 16);
+  addKey("3", Three_Key, 0xC23D, 16);
+  addKey("4", Four_Key, 0x22DD, 16);
+  addKey("5", Five_Key, 0xA25D, 16);
+  addKey("6", Six_Key, 0x629D, 16);
+  addKey("7", Seven_Key, 0xE21D, 16);
+  addKey("8", Eight_Key, 0x12ED, 16);
+  addKey("9", Nine_Key, 0x926D, 16);
+  addKey("0", Zero_Key, 0xD22D, 16);
+  addKey("sleep", Sleep_Key, 0x43BC, 16);
+  addKey("audio", Language_Key, 0x05FA, 16);
+  addKey("sound", Unmapped_Key, 0x857A, 16);
+  addKey("s-title", Unmapped_Key, 0xD52A, 16);
+  addKey("return", Exit_Key, 0x45BA, 16);
+  addKey("setup", Menu_Key, 0xA55A, 16);
+  addKey("display", Info_Key, 0xC53A, 16);
+  addKey("menu", DiscMenu_Key, 0x25DA, 16);
+  addKey("title", DiscTitle_Key, 0xF50A, 16);
+  addKey("up", Up_Key, 0xE51A, 16);
+  addKey("down", Down_Key, 0x659A, 16);
+  addKey("left", Left_Key, 0x15EA, 16);
+  addKey("right", Right_Key, 0x956A, 16);
+  addKey("enter", Select_Key, 0x55AA, 16);
+  addKey("plus", Unmapped_Key, 0xC837, 16); // "pr_preset_up"
+  addKey("minus", Unmapped_Key, 0x48B7, 16);  // "pr_preset_down"
+  addKey("<<", Rewind_Key, 0x8D72, 16);
+  addKey(">>", FastForward_Key, 0x4DB2, 16);
+  addKey("volume+", VolumeUp_Key, 0xE817, 16);
+  addKey("volume-", VolumeDown_Key, 0x6897, 16);
+  addKey("<<<", Unmapped_Key, 0x609F, 16);
+  addKey(">>>", Unmapped_Key, 0xE01F, 16);
+  addKey("stop", Stop_Key, 0xA05F, 16);
+  addKey("pause", Pause_Key, 0xF20D, 16);
+  addKey("play", Play_Key, 0x20DF, 16);
+  addKey("mute", Mute_Key, 0xF807, 16);
+  addKey("program", Program_Key, 0xB24D, 16);
+  addKey("clear", Clear_Key, 0x0DF2, 16);
+  addKey("repeat", Unmapped_Key, 0x728D, 16);
+  addKey("repeata-b", Unmapped_Key, 0xB54A, 16);
+  addKey("marker", Unmapped_Key, 0x2DD2, 16);
+  addKey("search", Unmapped_Key, 0xCD32, 16);
+  addKey("angle", Unmapped_Key, 0x35CA, 16);
+  addKey("zoom", Unmapped_Key, 0x758A, 16);
+  addKey("rds", Unmapped_Key, 0x06F9, 16);
+  addKey("pty", Unmapped_Key, 0x8E71, 16);
+  addKey("pty-search", Unmapped_Key, 0x9C63, 16);
+  addKey("dimmer", Unmapped_Key, 0x7A85, 16);
+  addKey("tv_radio", Unmapped_Key, 0x41BE, 16);
+  addKey("text", Unmapped_Key, 0xDE21, 16);
+  addKey("caption", Captions_Key, 0x56A9, 16);
+  addKey("guide", Guide_Key, 0xD629, 16);
+  addKey("i_ii", DoubleDigit_Key, 0x5EA1, 16);
+  addKey("exit_cancel", Unmapped_Key, 0x9669, 16);
+}
+
+
+LGDisc2::LGDisc2(
+  QObject *guiObject,
+  unsigned int index)
+  : PIRKeysetMetaData(
+      "DVD/BD Keyset 2",
+      LG_Make,
+      index)
+{
+  NECProtocol *np = new NECProtocol(
+    guiObject,
+    index,
+    600, 550,
+    600, 1650,
+    107000, true);
+
+  threadableProtocol = np;
+
+  np->setHeaderPair(4500, 4500);
+  np->setTrailerPulse(600);
+  np->setRepeatPair(600, 550);
+  np->setRepeatNeedsHeader(true);
+
+  np->setPreData(0xB4B4, 16);
+
+//  np->setMinimumRepetitions(3);
+
+  addKey("POWER", Power_Key, 0x0CF3, 16);
+  addKey("OPEN/CLOSE", Eject_Key, 0x6C93, 16);
+  addKey("1", One_Key, 0xDC23, 16);
+  addKey("2", Two_Key, 0x3CC3, 16);
+  addKey("3", Three_Key, 0xBC43, 16);
+  addKey("4", Four_Key, 0x7C83, 16);
+  addKey("5", Five_Key, 0xFC03, 16);
+  addKey("6", Six_Key, 0x02FD, 16);
+  addKey("7", Seven_Key, 0x827D, 16);
+  addKey("8", Eight_Key, 0x42BD, 16);
+  addKey("9", Nine_Key, 0xC23D, 16);
+  addKey("0", Zero_Key, 0x22DD, 16);
+  addKey("CLEAR", Clear_Key, 0x629D, 16);
+  addKey("SCAN-BACK", Rewind_Key, 0x4CB3, 16); // <<
+  addKey("SCAN-FORWARD", FastForward_Key, 0xCC33, 16); // >>
+  addKey("SKIP-BACK", Previous_Key, 0xAC53, 16); // |<<
+  addKey("SKIP-FORWARD", Next_Key, 0x2CD3, 16);  // >>|
+  addKey("PAUSE", Pause_Key, 0x1CE3, 16);
+  addKey("PLAY", Play_Key, 0x8C73, 16);
+  addKey("STOP", Stop_Key, 0x9C63, 16);
+  addKey("DVD-MENU", DiscMenu_Key, 0xD22D, 16);
+  addKey("TITLE", DiscTitle_Key, 0x52AD, 16);
+  addKey("UP", Up_Key, 0xE21D, 16);
+  addKey("LEFT", Left_Key, 0x9A65, 16);
+  addKey("RIGHT", Right_Key, 0x5AA5, 16);
+  addKey("DOWN", Down_Key, 0x12ED, 16);
+  addKey("ENTER", Select_Key, 0x1AE5, 16); // "ok"
+  addKey("DISPLAY", Info_Key, 0x5CA3, 16);
+  addKey("RETURN", Exit_Key, 0xA25D, 16);
+  addKey("AUDIO", Unmapped_Key, 0xF20D, 16);
+  addKey("SUBTITLE", Captions_Key, 0x0AF5, 16);
+  addKey("ANGLE", Unmapped_Key, 0x32CD, 16);
+  addKey("SETUP", Menu_Key, 0x6A95, 16);
+  addKey("MARKER", Unmapped_Key, 0x8679, 16);
+  addKey("SEARCH", Unmapped_Key, 0x46B9, 16); // "random"
+  addKey("PROGRAM", Program_Key, 0xEA15, 16);
+  addKey("ZOOM", Unmapped_Key, 0x26D9, 16);
+  addKey("REPEAT", Unmapped_Key, 0xCA35, 16);
+  addKey("A-B", Unmapped_Key, 0xAA55, 16); // "lp"
+  addKey("RANDOM", Unmapped_Key, 0x8A75, 16); // "cm-skip"
+  addKey("STAR", Unmapped_Key, 0x7A85, 16);
+  addKey("DVD", Unmapped_Key, 0x8F70, 16);
+  addKey("KEY_PIP", PIP_Key, 0xFA05, 16);
+  addKey("KEY_RESOLUTION", AspectRatio_Key, 0xAF50, 16);
+  addKey("PowerOn", Unmapped_Key, 0xAE51, 16);
+  addKey("PowerOff", Unmapped_Key, 0x6E91, 16);
+}
+
+
+LGDisc2a::LGDisc2a(
+  QObject *guiObject,
+  unsigned int index)
+  : LGDisc2(guiObject, index)
+{
+  setKeysetName("DVD/BD Keyset 2a");
+
+  addKey("KEY_CLEAR", Clear_Key, 0x3EC1, 16);
+  addKey("KEY_A", Unmapped_Key, 0x3EC1, 16);
+  addKey("KEY_RED", Red_Key, 0x3EC1, 16);
+  addKey("KEY_B", Unmapped_Key, 0xBE41, 16);
+  addKey("KEY_GREEN", Green_Key, 0xBE41, 16);
+  addKey("KEY_C", Unmapped_Key, 0x7E81, 16);
+  addKey("KEY_YELLOW", Yellow_Key, 0x7E81, 16);
+  addKey("KEY_D", Unmapped_Key, 0xFE01, 16);
+  addKey("KEY_BLUE", Blue_Key, 0xFE01, 16);
+  addKey("KEY_HOME", Menu_Key, 0xE619, 16);
+}
+
+
+LGVCR1::LGVCR1(
+  QObject *guiObject,
+  unsigned int index)
+  : PIRKeysetMetaData(
+      "VCR Keyset 1",
+      LG_Make,
+      index)
+{
+  NECProtocol *np = new NECProtocol(
+    guiObject,
+    index,
+    600, 550,
+    600, 1650,
+    107753, true);
+
+  threadableProtocol = np;
+
+  np->setHeaderPair(9000, 4500);
+  np->setTrailerPulse(600);
+  np->setRepeatPair(9000, 2250);
+
+  np->setPreData(0x7689, 16);
+
+  addKey("power", Power_Key, 0x28D7, 16);
+  addKey("rew", Rewind_Key, 0x40BF, 16);
+  addKey("play", Play_Key, 0x10EF, 16);
+  addKey("ff", FastForward_Key, 0xC03F, 16);
+  addKey("rec", Record_Key, 0x906F, 16);
+  addKey("stop", Stop_Key, 0x807F, 16);
+  addKey("p/still", Pause_Key, 0xD02F, 16);
+  addKey("eject", Eject_Key, 0x00FF, 16);
+  addKey("1", One_Key, 0xA05F, 16);
+  addKey("2", Two_Key, 0x609F, 16);
+  addKey("3", Three_Key, 0xE01F, 16);
+  addKey("4", Four_Key, 0x30CF, 16);
+  addKey("5", Five_Key, 0xB04F, 16);
+  addKey("6", Six_Key, 0x708F, 16);
+  addKey("7", Seven_Key, 0xF00F, 16);
+  addKey("8", Eight_Key, 0x38C7, 16);
+  addKey("9", Nine_Key, 0xB847, 16);
+  addKey("0", Zero_Key, 0x20DF, 16);
+  addKey("mute", Mute_Key, 0xBA45, 16);
+  addKey("tv/av", Unmapped_Key, 0x6A95, 16);
+  addKey("menu", Menu_Key, 0x6897, 16);  // "setup", "I"
+  addKey("clear/reset", Clear_Key, 0xF807, 16);  // might be wrong
+  addKey("timer-prog", Program_Key, 0x5CA3, 16);
+  addKey("pr+", ChannelUp_Key, 0x18E7, 16);
+  addKey("pr-", ChannelDown_Key, 0x9867, 16);
+  addKey("vol+", VolumeUp_Key, 0x1AE5, 16);
+  addKey("vol-", VolumeDown_Key, 0x9A65, 16);
+  addKey("pr+", Up_Key, 0x18E7, 16);
+  addKey("vol-", Left_Key, 0x9A65, 16);
+  addKey("ok", Select_Key, 0x7887, 16);
+  addKey("vol+", Right_Key, 0x1AE5, 16);
+  addKey("pr-", Down_Key, 0x9867, 16);
+  addKey("sleep", Sleep_Key, 0x3AC5, 16);
+  addKey("system", Unmapped_Key, 0x3BC4, 16);
+  addKey("qview", Unmapped_Key, 0xEE11, 16);
+  addKey("auto", Unmapped_Key, 0xFA05, 16); // "A.TRK"
+  addKey("trk-", Unmapped_Key, 0x22DD, 16);
+  addKey("trk+", Unmapped_Key, 0xA25D, 16);
+  addKey("clock/count", Unmapped_Key, 0x32CD, 16);
+  addKey("viss", Unmapped_Key, 0x827D, 16); // "marker-search"
+  addKey("VCR", Unmapped_Key, 0x8F70, 16);
+  addKey("tv/vcr", Input_Key, 0xA857, 16);
+  addKey("audio", Unmapped_Key, 0x837C, 16);
+  addKey("c/lock", Unmapped_Key, 0xFC03, 16);
+  addKey("repeat", Unmapped_Key, 0x6D92, 16);
+  addKey("lp", VHSSpeed_Key, 0x12ED, 16);
+  addKey("cm-skip", Unmapped_Key, 0xBB44, 16);
+  addKey("ez_POWER_OFF", Unmapped_Key, 0x1DE2, 16);
+  addKey("*", Unmapped_Key, 0xE21D, 16);
+}
+
+
+LGVCR1a::LGVCR1a(
+  QObject *guiObject,
+  unsigned int index)
+  : LGVCR1(guiObject, index)
+{
+  setKeysetName("VCR Keyset 1a");
+
+  addKey("power", Power_Key, 0xBE41, 16);
+}
+
+
+LGVCR1b::LGVCR1b(
+  QObject *guiObject,
+  unsigned int index)
+  : LGVCR1(guiObject, index)
+{
+  setKeysetName("VCR Keyset 1b");
+
+  addKey("menu-left", Left_Key, 0xC13E, 16);
+  addKey("menu-right", Right_Key, 0x09F6, 16);
+  addKey("menu-up", Up_Key, 0x41BE, 16);
+  addKey("menu-down", Down_Key, 0x916E, 16);
+  addKey("ok", Select_Key, 0x718E, 16);
+}
+
diff --git a/keysets/lg.h b/keysets/lg.h
new file mode 100644 (file)
index 0000000..e00226a
--- /dev/null
@@ -0,0 +1,112 @@
+#ifndef LG_H
+#define LG_H
+
+#include "pirkeysetmetadata.h"
+
+#include <QObject>
+
+class LGTV1: public PIRKeysetMetaData
+{
+public:
+  LGTV1(
+    QObject *guiObject,
+    unsigned int index);
+};
+
+class LGTV1a: public LGTV1
+{
+public:
+  LGTV1a(
+    QObject *guiObject,
+    unsigned int index);
+};
+
+class LGTV1b: public LGTV1
+{
+public:
+  LGTV1b(
+    QObject *guiObject,
+    unsigned int index);
+};
+
+class LGTV1c: public LGTV1
+{
+public:
+  LGTV1c(
+    QObject *guiObject,
+    unsigned int index);
+};
+
+class LGTV2: public PIRKeysetMetaData
+{
+public:
+  LGTV2(
+    QObject *guiObject,
+    unsigned int index);
+};
+
+class LGTV2a: public LGTV2
+{
+public:
+  LGTV2a(
+    QObject *guiObject,
+    unsigned int index);
+};
+
+class LGTV2b: public LGTV2
+{
+public:
+  LGTV2b(
+    QObject *guiObject,
+    unsigned int index);
+};
+
+class LGDisc1: public PIRKeysetMetaData
+{
+public:
+  LGDisc1(
+    QObject *guiObject,
+    unsigned int index);
+};
+
+class LGDisc2: public PIRKeysetMetaData
+{
+public:
+  LGDisc2(
+    QObject *guiObject,
+    unsigned int index);
+};
+
+class LGDisc2a: public LGDisc2
+{
+public:
+  LGDisc2a(
+    QObject *guiObject,
+    unsigned int index);
+};
+
+class LGVCR1: public PIRKeysetMetaData
+{
+public:
+  LGVCR1(
+    QObject *guiObject,
+    unsigned int index);
+};
+
+class LGVCR1a: public LGVCR1
+{
+public:
+  LGVCR1a(
+    QObject *guiObject,
+    unsigned int index);
+};
+
+class LGVCR1b: public LGVCR1
+{
+public:
+  LGVCR1b(
+    QObject *guiObject,
+    unsigned int index);
+};
+
+#endif // LG_H
diff --git a/keysets/nokia.cpp b/keysets/nokia.cpp
new file mode 100644 (file)
index 0000000..b6bc20d
--- /dev/null
@@ -0,0 +1,56 @@
+#include "nokia.h"
+#include "necprotocol.h"
+
+NokiaGenericVCR::NokiaGenericVCR(
+  QObject *guiObject,
+  unsigned int index)
+  : PIRKeysetMetaData(
+      "Generic VCR",
+      Nokia_Make,
+      index)
+{
+  NECProtocol *np = new NECProtocol(
+    guiObject,
+    index,
+    272, 737,
+    272, 1711,
+    42100, false);
+
+  threadableProtocol = np;
+
+  np->setTrailerPulse(272);
+
+  np->setMinimumRepetitions(3);
+
+  np->setPreData(0x6, 3);
+
+  addKey("Power", Power_Key, 0x1A2, 12);
+  addKey("1", One_Key, 0x202, 12);
+  addKey("2", Two_Key, 0x102, 12);
+  addKey("3", Three_Key, 0x302, 12);
+  addKey("4", Four_Key, 0x082, 12);
+  addKey("5", Five_Key, 0x282, 12);
+  addKey("6", Six_Key, 0x182, 12);
+  addKey("7", Seven_Key, 0x382, 12);
+  addKey("8", Eight_Key, 0x042, 12);
+  addKey("9", Nine_Key, 0x242, 12);
+  addKey("0", Zero_Key, 0x142, 12);
+  addKey("Timer", Unmapped_Key, 0x262, 12);
+  addKey("Clear", Clear_Key, 0x012, 12);
+  addKey("P+", ChannelUp_Key, 0x222, 12);
+  addKey("P-", ChannelDown_Key, 0x122, 12);
+  addKey("Up", Up_Key, 0x112, 12);
+  addKey("Down", Down_Key, 0x392, 12);
+  addKey("Left", Left_Key, 0x312, 12);
+  addKey("Right", Right_Key, 0x212, 12);
+  addKey("Ok", Enter_Key, 0x166, 12);
+  addKey("Ok", Select_Key, 0x166, 12);
+  addKey("Red", Red_Key, 0x252, 12);
+  addKey("Green", Green_Key, 0x292, 12);
+  addKey("Yellow", Yellow_Key, 0x032, 12);
+  addKey("Blue", Blue_Key, 0x3D2, 12);
+  addKey("Rec", Record_Key, 0x052, 12);
+  addKey("Clock", Unmapped_Key, 0x1C2, 12);
+  addKey("Prog", Unmapped_Key, 0x066, 12);
+  addKey("PIP", PIP_Key, 0x0C6, 12);
+}
diff --git a/keysets/nokia.h b/keysets/nokia.h
new file mode 100644 (file)
index 0000000..0815f62
--- /dev/null
@@ -0,0 +1,16 @@
+#ifndef NOKIA_H
+#define NOKIA_H
+
+#include "pirkeysetmetadata.h"
+
+#include <QObject>
+
+class NokiaGenericVCR: public PIRKeysetMetaData
+{
+public:
+  NokiaGenericVCR(
+    QObject *guiObject,
+    unsigned int index);
+};
+
+#endif // NOKIA_H
diff --git a/keysets/panasonic.cpp b/keysets/panasonic.cpp
new file mode 100644 (file)
index 0000000..6fc8d83
--- /dev/null
@@ -0,0 +1,602 @@
+#include "panasonic.h"
+#include "necprotocol.h"
+
+PanasonicAmp::PanasonicAmp(
+  QObject *guiObject,
+  unsigned int index)
+  : PIRKeysetMetaData(
+      "Amp Keyset",
+      Panasonic_Make,
+      index)
+{
+  NECProtocol *np = new NECProtocol(
+    guiObject,
+    index,
+    400, 400,
+    400, 1200,
+    76000, false);
+
+  threadableProtocol = np;
+
+  np->setHeaderPair(4000, 1600);
+  np->setTrailerPulse(400);
+
+  np->setPreData(0x80080A86, 32);
+
+  np->setMinimumRepetitions(4);
+
+  np->setCarrierFrequency(36000);
+
+  addKey("POWER", Power_Key, 0xFDBB, 16);
+  addKey("VOL+", VolumeUp_Key, 0x0D4B, 16);
+  addKey("VOL-", VolumeDown_Key, 0x4DCB, 16);
+  addKey("SLEEP", Sleep_Key, 0x3D7B, 16);
+  addKey("DISPLAY", Info_Key, 0xF17B, 16);
+}
+
+
+PanasonicCarAudio::PanasonicCarAudio(
+  QObject *guiObject,
+  unsigned int index)
+  : PIRKeysetMetaData(
+      "Car Audio Keyset",
+      Panasonic_Make,
+      index)
+{
+  NECProtocol *np = new NECProtocol(
+    guiObject,
+    index,
+    665, 465,
+    665, 1595,
+    108609, true);
+
+  threadableProtocol = np;
+
+  np->setHeaderPair(9148, 4424);
+  np->setTrailerPulse(667);
+
+  np->setPreData(0x8156, 16);
+
+  addKey("Power", Power_Key, 0x48B7, 16);
+  addKey("PRG", Unmapped_Key, 0x38C7, 16);
+  addKey("Mode", Unmapped_Key, 0x58A7, 16);
+  addKey("ATT", Unmapped_Key, 0x28D7, 16);
+  addKey("Vol_Up", VolumeUp_Key, 0xB847, 16);
+  addKey("Vol_Down", VolumeDown_Key, 0x9867, 16);
+  addKey("Tune/Track_Up", ChannelUp_Key, 0xF807, 16);
+  addKey("Tune/Track_Down", ChannelDown_Key, 0x7887, 16);
+}
+
+
+PanasonicSat1::PanasonicSat1(
+  QObject *guiObject,
+  unsigned int index)
+  : PIRKeysetMetaData(
+      "Satellite Keyset 1",
+      Panasonic_Make,
+      index)
+{
+  NECProtocol *np = new NECProtocol(
+    guiObject,
+    index,
+    500, 400,
+    500, 1212,
+    74500, false);
+
+  threadableProtocol = np;
+
+  np->setHeaderPair(3565, 1700);
+  np->setTrailerPulse(500);
+
+  np->setPreData(0x40040140, 32);
+
+  addKey("POWER", Power_Key, 0xBDFC, 16);
+  addKey("CH+", ChannelUp_Key, 0xEDAC, 16);
+//  addKey("CH+", ChannelUp_Key, 0x2D6C, 16);
+  addKey("CH-", ChannelDown_Key, 0x6D2C, 16);
+//  addKey("CH-", ChannelDown_Key, 0xADEC, 16);
+  addKey("R_TUNE", Unmapped_Key, 0x8BCA, 16);
+  addKey("GUIDE", Guide_Key, 0xA3E2, 16);
+  addKey("MENU", Menu_Key, 0x2362, 16);
+  addKey("EXIT", Exit_Key, 0x6322, 16);
+  addKey("LEFT", Left_Key, 0xB3F2, 16);
+  addKey("RIGHT", Right_Key, 0x7332, 16);
+  addKey("UP", Up_Key, 0x5312, 16);
+  addKey("DOWN", Down_Key, 0xD392, 16);
+  addKey("FAV", Unmapped_Key, 0x0B4A, 16);
+  addKey("INFO", Info_Key, 0x9DDC, 16);
+  addKey("1", One_Key, 0x0544, 16);
+  addKey("2", Two_Key, 0x85C4, 16);
+  addKey("3", Three_Key, 0x4504, 16);
+  addKey("4", Four_Key, 0xC584, 16);
+  addKey("5", Five_Key, 0x2564, 16);
+  addKey("6", Six_Key, 0xA5E4, 16);
+  addKey("7", Seven_Key, 0x6524, 16);
+  addKey("8", Eight_Key, 0xE5A4, 16);
+  addKey("9", Nine_Key, 0x1554, 16);
+  addKey("0", Zero_Key, 0x95D4, 16);
+  addKey("LOGO_TUNE", Unmapped_Key, 0xABEA, 16);
+  addKey("ALT_AUD", Unmapped_Key, 0x1D5C, 16);
+  addKey("TV/DSS", Input_Key, 0x3D7C, 16);
+  addKey("REC", Record_Key, 0x4302, 16);
+  addKey("ACTION", Select_Key, 0xC382, 16);
+  addKey("PROG", Unmapped_Key, 0x5110, 16);
+  addKey("TXT", Unmapped_Key, 0x7B3A, 16);
+  addKey("STTL", Unmapped_Key, 0xFBBA, 16);
+  addKey("GUIDE", Guide_Key, 0xCB8A, 16);
+//  addKey("EXIT", Unmapped_Key, 0xF3B2, 16);
+  addKey("RED", Red_Key, 0x3776, 16);
+  addKey("GREEN", Green_Key, 0xB7F6, 16);
+  addKey("YELLOW", Yellow_Key, 0xF7B6, 16);
+  addKey("BLUE", Blue_Key, 0x7736, 16);
+}
+
+
+PanasonicSat1a::PanasonicSat1a(
+  QObject *guiObject,
+  unsigned int index)
+  : PanasonicSat1(guiObject, index)
+{
+  setKeysetName("Satellite Keyset 1a");
+  addKey("EXIT", Exit_Key, 0xF3B2, 16);
+  addKey("CH+", ChannelUp_Key, 0x4D0C, 16);
+  addKey("CH-", ChannelDown_Key, 0xCD8C, 16);
+}
+
+
+PanasonicTV1::PanasonicTV1(
+  QObject *guiObject,
+  unsigned int index)
+  : PIRKeysetMetaData(
+      "TV Keyset 1",
+      Panasonic_Make,
+      index)
+{
+  NECProtocol *np = new NECProtocol(
+    guiObject,
+    index,
+    500, 400,
+    500, 1250,
+    75000, false);
+
+  threadableProtocol = np;
+
+  np->setHeaderPair(3500, 1700);
+  np->setTrailerPulse(500);
+
+  np->setPreData(0x400401, 24);
+
+//  np->setMinRepeat(1);
+
+  addKey("POWER", Power_Key, 0x00BCBD, 24);
+  addKey("MUTE", Mute_Key, 0x004C4D, 24);
+  addKey("PICTURE", Unmapped_Key, 0x006061, 24);
+  addKey("SOUND", Unmapped_Key, 0x00E0E1, 24);
+  addKey("ACTION", Enter_Key, 0x004A4B, 24);
+  addKey("ACTION", Select_Key, 0x004A4B, 24);
+  addKey("UP", Up_Key, 0x005253, 24);
+  addKey("DOWN", Down_Key, 0x00D2D3, 24);
+  addKey("RIGHT", Right_Key, 0x00F2F3, 24);
+  addKey("LEFT", Left_Key, 0x007273, 24);
+  addKey("PROG_UP", ChannelUp_Key, 0x002C2D, 24);
+  addKey("PROG_DOWN", ChannelDown_Key, 0x00ACAD, 24);
+  addKey("VOLUME_UP", VolumeUp_Key, 0x000405, 24);
+  addKey("VOLUME_DOWN", VolumeDown_Key, 0x008485, 24);
+  addKey("RECALL", PrevChannel_Key, 0x009C9D, 24);
+  addKey("TV/AV", Input_Key, 0x00A0A1, 24);
+  addKey("RED", Red_Key, 0x000E0F, 24);
+  addKey("GREEN", Green_Key, 0x008E8F, 24);
+  addKey("YELLOW", Yellow_Key, 0x004E4F, 24);
+  addKey("BLUE", Blue_Key, 0x00CECF, 24);
+  addKey("1", One_Key, 0x000809, 24);
+  addKey("2", Two_Key, 0x008889, 24);
+  addKey("3", Three_Key, 0x004849, 24);
+  addKey("4", Four_Key, 0x00C8C9, 24);
+  addKey("5", Five_Key, 0x002829, 24);
+  addKey("6", Six_Key, 0x00A8A9, 24);
+  addKey("7", Seven_Key, 0x006869, 24);
+  addKey("8", Eight_Key, 0x00E8E9, 24);
+  addKey("9", Nine_Key, 0x001819, 24);
+  addKey("0", Zero_Key, 0x009899, 24);
+  addKey("C", Clear_Key, 0x005C5D, 24);
+  addKey("-/--", DoubleDigit_Key, 0x00DCDD, 24); // Might also be Dash_Key
+  addKey("SURROUND", Surround_Key, 0x008C8D, 24);
+  addKey("MULTIWINDOW", Unmapped_Key, 0x006766, 24);
+  addKey("N", Unmapped_Key, 0x003031, 24);
+  addKey("STR", Unmapped_Key, 0x00ABAA, 24);
+  addKey("TIMER", Unmapped_Key, 0x00F0F1, 24);
+  addKey("HELP", Unmapped_Key, 0x003534, 24);
+  addKey("R-TUNE", Unmapped_Key, 0x00ECED, 24);
+  addKey("GAME", Unmapped_Key, 0x00DDDC, 24);
+  addKey("S", Unmapped_Key, 0x007071, 24);
+  addKey("S_MENU", Unmapped_Key, 0x008A8B, 24);
+  addKey("P_MENU", Unmapped_Key, 0x000A0B, 24);
+  addKey("SAP", Unmapped_Key, 0x00CCCD, 24);
+  addKey("FM/TV", Unmapped_Key, 0x007776, 24);
+  addKey("Exit", Unmapped_Key, 0x00CBCA, 24);
+  addKey("Return", Unmapped_Key, 0x002B2A, 24);
+  addKey("MOOD_LIGHT", Unmapped_Key, 0x008584, 24);
+
+  addKey("ASPECT", Unmapped_Key, 0x207B5A, 24);
+
+  addKey("PROG", Unmapped_Key, 0x405110, 24);
+  addKey("MENU", Unmapped_Key, 0x402362, 24);
+  addKey("EXIT", Exit_Key, 0x406322, 24);
+  addKey("GUIDE", Guide_Key, 0x40A3E2, 24);
+  addKey("TV", Unmapped_Key, 0x400C4D, 24);
+
+  addKey("TV/TEXT", Unmapped_Key, 0x80C041, 24);
+  addKey("FP", Unmapped_Key, 0x80A021, 24);
+  addKey("INDEX", Unmapped_Key, 0x801091, 24);
+  addKey("HOLD", Unmapped_Key, 0x809011, 24);
+  addKey("TIMETEXT", Unmapped_Key, 0x80D051, 24);
+  addKey("REVEAL", Unmapped_Key, 0x8038B9, 24);
+  addKey("FTB", Unmapped_Key, 0x8030B1, 24);
+  addKey("Display_Cancel", Unmapped_Key, 0x8020A1, 24);
+  addKey("List/F.Text", Unmapped_Key, 0x80B839, 24);
+
+  addKey("DIRECTREC", Record_Key, 0x909100, 24);
+  addKey("Link", Unmapped_Key, 0x908D1C, 24);
+  addKey("Option", Unmapped_Key, 0x90E574, 24);
+  addKey("SDCard", Unmapped_Key, 0x90D544, 24);
+  addKey("Guide", Unmapped_Key, 0x90E170, 24);
+  addKey("prog-", Unmapped_Key, 0x900B9A, 24);
+}
+
+
+PanasonicTV1a::PanasonicTV1a(
+  QObject *guiObject,
+  unsigned int index)
+  : PanasonicTV1(guiObject, index)
+{
+  setKeysetName("TV Keyset 1a");
+  // Overwrite some of the keys:
+  addKey("OK", Select_Key, 0x009293, 24);
+  addKey("MENU", Menu_Key, 0x006061, 24);
+}
+
+
+PanasonicTV1b::PanasonicTV1b(
+  QObject *guiObject,
+  unsigned int index)
+  : PanasonicTV1(guiObject, index)
+{
+  setKeysetName("TV Keyset 1b");
+
+  addControlledDevice(Panasonic_Make, "Viera TX-32LZD80", TV_Device);
+  addControlledDevice(Panasonic_Make, "Viera 42PZ700U", TV_Device);
+
+  addKey("Menu", Menu_Key, 0x004A4B, 24);
+  addKey("OK", Select_Key, 0x009293, 24);
+  addKey("Guide", Guide_Key, 0x90E170, 24);
+//  addKey("Exit", Exit_Key, 0x00CBCA, 24);
+  addKey("Info", Info_Key, 0x009C9D, 24);
+  addKey("Exit", Exit_Key, 0x9059C8, 24);
+}
+
+
+PanasonicVCR1::PanasonicVCR1(
+  QObject *guiObject,
+  unsigned int index)
+  : PIRKeysetMetaData(
+      "VCR Keyset 1",
+      Panasonic_Make,
+      index)
+{
+  NECProtocol *np = new NECProtocol(
+    guiObject,
+    index,
+    550, 330,
+    550, 1200,
+    75000, false);
+
+  threadableProtocol = np;
+
+  np->setHeaderPair(3600, 1650);
+  np->setTrailerPulse(550);
+
+  np->setPreData(0x400409, 24);
+
+  addKey("POWER", Power_Key, 0x00BCB5, 24);
+  addKey("PROGRAMME^", ChannelUp_Key, 0x002C25, 24);
+  addKey("PROGRAMMEv", ChannelDown_Key, 0x00ACA5, 24);
+  addKey("REC", Record_Key, 0x001019, 24);
+  addKey("PAUSE", Pause_Key, 0x006069, 24);
+  addKey("PLAY", Play_Key, 0x005059, 24);
+  addKey("STOP", Stop_Key, 0x000009, 24);
+  addKey("FORWARD", FastForward_Key, 0x00C0C9, 24);
+  addKey("REWIND", Rewind_Key, 0x004049, 24);
+  addKey("INFO", Info_Key, 0x009C95, 24);
+  addKey("1", One_Key, 0x000801, 24);
+  addKey("2", Two_Key, 0x008881, 24);
+  addKey("3", Three_Key, 0x004841, 24);
+  addKey("4", Four_Key, 0x00C8C1, 24);
+  addKey("5", Five_Key, 0x002821, 24);
+  addKey("6", Six_Key, 0x00A8A1, 24);
+  addKey("7", Seven_Key, 0x006861, 24);
+  addKey("8", Eight_Key, 0x00E8E1, 24);
+  addKey("9", Nine_Key, 0x001811, 24);
+  addKey("0", Zero_Key, 0x009891, 24);
+  addKey("100", PlusOneHundred_Key, 0x00A7AE, 24);
+  addKey("TV-SAT", Input_Key, 0x006C65, 24);
+  addKey("TRACKING_MINUS", Unmapped_Key, 0x004D44, 24);
+  addKey("TRACKING_PLUS", Unmapped_Key, 0x008D84, 24);
+  addKey("TRACKING_AUTO", Unmapped_Key, 0x000D04, 24);
+  addKey("STILL", StepForward_Key, 0x003039, 24);  // also "ADV"
+  addKey("INDEXL", Unmapped_Key, 0x00929B, 24);
+  addKey("INDEXR", Unmapped_Key, 0x00525B, 24);
+  addKey("AV", Unmapped_Key, 0x00030A, 24);
+  addKey("-/--", DoubleDigit_Key, 0x00DCD5, 24);
+  addKey("REPLAY", Replay_Key, 0x00EFE6, 24);
+  addKey("DIRECT_TV_REC", Unmapped_Key, 0x00434A, 24);
+  addKey("TIMERREC", Timer_Key, 0x002D24, 24);
+  addKey("COUNTER_RESET", Unmapped_Key, 0x002A23, 24);
+  addKey("AUDIO", Unmapped_Key, 0x00CCC5, 24);
+  addKey("SLOW", Unmapped_Key, 0x00F0F9, 24);
+  addKey("INDEX", Unmapped_Key, 0x00020B, 24);
+  addKey("+", Unmapped_Key, 0x007178, 24);
+  addKey("-", Unmapped_Key, 0x00F1F8, 24);
+  addKey("mem_rep", Unmapped_Key, 0x00CAC3, 24);
+  addKey("time_search", Unmapped_Key, 0x00222B, 24);
+  addKey("monitor", Unmapped_Key, 0x008980, 24);
+  addKey("repeat", Unmapped_Key, 0x000F06, 24);
+  addKey("memory", Unmapped_Key, 0x008F86, 24);
+  addKey("sleep", Sleep_Key, 0x004F46, 24);
+  addKey("rew2", Unmapped_Key, 0x00CFC6, 24);
+  addKey("cm-zero", Unmapped_Key, 0x001F16, 24);
+  addKey("CLOCK/COUNTER", Unmapped_Key, 0x006A63, 24);
+  addKey("TAPE_REMAIN", Unmapped_Key, 0x00AAA3, 24);
+  addKey("mesecam", Unmapped_Key, 0x00939A, 24);
+  addKey("zerostop", Unmapped_Key, 0x00AFA6, 24);
+  addKey("sap/hi-fi", Unmapped_Key, 0x00676E, 24);
+
+  addKey("DISPLAY", Unmapped_Key, 0x80FA73, 24);
+  addKey("SEARCH", Unmapped_Key, 0x80B930, 24);
+  addKey("SPEED", VHSSpeed_Key, 0x8050D9, 24);
+  addKey("SHOWVIEW", Unmapped_Key, 0x80BA33, 24);
+  addKey("MENU", Menu_Key, 0x806AE3, 24);
+  addKey("OK", Select_Key, 0x801A93, 24);
+  addKey("EXIT", Exit_Key, 0x8066EF, 24);
+  addKey("CHECK+", Unmapped_Key, 0x800980, 24);
+  addKey("CHECK-", Unmapped_Key, 0x808900, 24);
+  addKey("DATE+", Unmapped_Key, 0x8049C0, 24);
+  addKey("DATE-", Unmapped_Key, 0x80C940, 24);
+  addKey("ON+", Unmapped_Key, 0x8029A0, 24);
+  addKey("ON-", Unmapped_Key, 0x80A920, 24);
+  addKey("OFF+", Unmapped_Key, 0x8069E0, 24);
+  addKey("OFF-", Unmapped_Key, 0x80E960, 24);
+  addKey("PROG/CHECK", Program_Key, 0x808009, 24);
+  addKey("CANCEL", Clear_Key, 0x809019, 24);
+  addKey("TAPE", Unmapped_Key, 0x80078E, 24);
+  addKey("ADD/DELETE", Unmapped_Key, 0x808C05, 24);
+  addKey("RADIO_TUNE", Unmapped_Key, 0x801C95, 24);
+  addKey("VPS/PDC", Unmapped_Key, 0x8060E9, 24);
+  addKey("OffTimer", Unmapped_Key, 0x801099, 24);
+  addKey("rotate", Unmapped_Key, 0x8040C9, 24);
+  addKey("rotatedown", Unmapped_Key, 0x80C049, 24);
+  addKey("set", Unmapped_Key, 0x8020A9, 24);
+  addKey("clear", Unmapped_Key, 0x80A029, 24);
+
+  addKey("TV/TEXT", Unmapped_Key, 0xA0EA43, 24);
+  addKey("STILL_ALBUM", Unmapped_Key, 0xA0C46D, 24);
+  addKey("ExtLink", Unmapped_Key, 0xA0DA73, 24);
+  addKey("I-Timer", Unmapped_Key, 0xA0FC55, 24);
+  addKey("PROG_PLAY", Unmapped_Key, 0xA05CF5, 24);
+
+// These are fishy:
+//  addKey("RESET_STORE", Unmapped_Key, 0x801A93, 24);
+}
+
+
+PanasonicVCR1a::PanasonicVCR1a(
+  QObject *guiObject,
+  unsigned int index)
+  : PanasonicVCR1(guiObject, index)
+{
+  setKeysetName("VCR Keyset 1a");
+
+  addKey("DISPLAY", Info_Key, 0x80FA73, 24);
+  addKey("AV", Input_Key, 0x00030A, 24);
+  addKey("OSD", Info_Key, 0x00EAE3, 24);
+}
+
+
+PanasonicVCR1b::PanasonicVCR1b(
+  QObject *guiObject,
+  unsigned int index)
+  : PanasonicVCR1(guiObject, index)
+{
+  setKeysetName("VCR Keyset 1b");
+
+  addKey("clear", Clear_Key, 0x8050D9, 24);
+  addKey("prog", Program_Key, 0x00FFF6, 24);
+  addKey("repeat", Unmapped_Key, 0x009F96, 24);
+}
+
+
+PanasonicVCR1c::PanasonicVCR1c(
+  QObject *guiObject,
+  unsigned int index)
+  : PanasonicVCR1(guiObject, index)
+{
+  setKeysetName("VCR Keyset 1c");
+
+  addKey("rotate", Up_Key, 0x8040C9, 24);
+  addKey("rotatedown", Down_Key, 0x80C049, 24);
+  addKey("set", Select_Key, 0x8020A9, 24);
+  addKey("clear", Exit_Key, 0x80A029, 24);
+}
+
+
+PanasonicDVD1::PanasonicDVD1(
+  QObject *guiObject,
+  unsigned int index)
+  : PIRKeysetMetaData(
+      "DVD Keyset 1",
+      Panasonic_Make,
+      index)
+{
+  NECProtocol *np = new NECProtocol(
+    guiObject,
+    index,
+    500, 400,
+    500, 1200,
+    75000, false);
+
+  threadableProtocol = np;
+
+  np->setHeaderPair(3500, 1650);
+  np->setTrailerPulse(500);
+
+  np->setPreData(0x40040D00, 32);
+
+  addKey("POWER", Power_Key, 0xBCB1, 16);
+  addKey("PLAY", Play_Key, 0x505D, 16);
+  addKey("REW", Rewind_Key, 0x202D, 16);
+  addKey("FF", FastForward_Key, 0xA0AD, 16);
+  addKey("STOP", Stop_Key, 0x000D, 16);
+  addKey("PAUSE", Pause_Key, 0x606D, 16);
+  addKey("PREV", Previous_Key, 0x929F, 16);
+  addKey("NEXT", Next_Key, 0x525F, 16);
+  addKey("UP", Up_Key, 0xA1AC, 16);
+  addKey("LEFT", Left_Key, 0xE1EC, 16);
+  addKey("RIGHT", Right_Key, 0x111C, 16);
+  addKey("DOWN", Down_Key, 0x616C, 16);
+  addKey("ACTION", Select_Key, 0x414C, 16);
+  addKey("RETURN", Exit_Key, 0x818C, 16);
+  addKey("MENU", Menu_Key, 0x010C, 16);
+  addKey("INFO", Info_Key, 0x4944, 16);
+  addKey("1", One_Key, 0x0805, 16);
+  addKey("2", Two_Key, 0x8885, 16);
+  addKey("3", Three_Key, 0x4845, 16);
+  addKey("4", Four_Key, 0xC8C5, 16);
+  addKey("5", Five_Key, 0x2825, 16);
+  addKey("6", Six_Key, 0xA8A5, 16);
+  addKey("7", Seven_Key, 0x6865, 16);
+  addKey("8", Eight_Key, 0xE8E5, 16);
+  addKey("9", Nine_Key, 0x1815, 16);
+  addKey("0", Zero_Key, 0x9895, 16);
+  addKey("CANCEL", Clear_Key, 0xC1CC, 16);
+  addKey("+10", DoubleDigit_Key, 0x919C, 16);
+  addKey("inputselect", Input_Key, 0x919C, 16);
+//  addKey("R-TUNE", Unmapped_Key, 0xD9D4, 16);
+  addKey("TOP_MENU", Unmapped_Key, 0xD9D4, 16);
+  addKey("OPEN/CLOSE", Eject_Key, 0x808D, 16);
+//  addKey("TV-SAT", Input_Key, 0x808D, 16);
+  addKey("CH_DOWN", ChannelDown_Key, 0xE0ED, 16);
+  addKey("CH_UP", ChannelUp_Key, 0xF0FD, 16);
+  addKey("SLEEP", Sleep_Key, 0xD7DA, 16);
+  addKey("SUBTITLE", Captions_Key, 0x8984, 16);
+  addKey("AUDIO", Unmapped_Key, 0xCCC1, 16);
+  addKey("ANGLE", Unmapped_Key, 0x0904, 16);
+  addKey("QUICK_REPLAY", Replay_Key, 0xD1DC, 16);
+  addKey("PROGRAM", Program_Key, 0x515C, 16);
+  addKey("RANDOM", Unmapped_Key, 0xB2BF, 16);
+  addKey("REPEAT", Unmapped_Key, 0x313C, 16);
+  addKey("A-B_REPEAT", Unmapped_Key, 0x121F, 16);
+  addKey("A.SRD", Unmapped_Key, 0x7974, 16);
+  addKey("BASS", Unmapped_Key, 0x2B26, 16);
+  addKey("CINEMA", Unmapped_Key, 0x030E, 16);
+  addKey("D.ENH", Unmapped_Key, 0xABA6, 16);
+  addKey("ZOOM", Unmapped_Key, 0x838E, 16);
+  addKey("POSITION_MEMORY", Unmapped_Key, 0x626F, 16);
+  addKey("ONETOUCH_MEMORY", Unmapped_Key, 0x6B66, 16);
+  addKey("GROUP", Unmapped_Key, 0x070A, 16);
+  addKey("PLAY_MODE", Unmapped_Key, 0xB1BC, 16);
+  addKey("SETUP", Unmapped_Key, 0x2924, 16);
+  addKey("CINEMA", Unmapped_Key, 0x030E, 16);
+  addKey("VOLUMEUP", VolumeUp_Key, 0xC6CB, 16);
+  addKey("VOLUMEDOWN", VolumeDown_Key, 0x262B, 16);
+  addKey("showview", Unmapped_Key, 0xFEF3, 16);
+  addKey("manualskip", Unmapped_Key, 0x323F, 16);
+  addKey("functions", Unmapped_Key, 0xEAE7, 16);
+  addKey("progcheck", Unmapped_Key, 0x3E33, 16);
+  addKey("status", Unmapped_Key, 0xFAF7, 16);
+  addKey("timeslip", Unmapped_Key, 0xD2DF, 16);
+  addKey("rec", Record_Key, 0x101D, 16);
+  addKey("recmode", Unmapped_Key, 0x8A87, 16);
+  addKey("extlink", Unmapped_Key, 0xC4C9, 16);
+  addKey("timer", Unmapped_Key, 0x1E13, 16);
+  addKey("createchapter", Unmapped_Key, 0x1A17, 16);
+  addKey("erase", Unmapped_Key, 0x222F, 16);
+  addKey("frec", Unmapped_Key, 0xE3EE, 16);
+  addKey("DISC", Unmapped_Key, 0xEDE0, 16);
+  addKey("SEQUENTIAL", Unmapped_Key, 0xFDF0, 16);
+  addKey("FL_SELECT", Unmapped_Key, 0x6D60, 16);
+  addKey("i", Unmapped_Key, 0x666B, 16);
+//  addKey("EXIT", Unmapped_Key, 0x808A07, 24);
+//  addKey("RED", Unmapped_Key, 0x80820F, 24);
+//  addKey("GREEN", Unmapped_Key, 0x8042CF, 24);
+}
+
+
+PanasonicDVD1a::PanasonicDVD1a(
+  QObject *guiObject,
+  unsigned int index)
+  : PanasonicDVD1(guiObject, index)
+{
+  setKeysetName("DVD Keyset 1a");
+
+  addKey("channel2up", ChannelUp_Key, 0x2C21, 16);
+  addKey("channel2down", ChannelDown_Key, 0xACA1, 16);
+  addKey("DELETE", Clear_Key, 0x222F, 16);
+  addKey("INPUT_SELECT", Input_Key, 0x0A07, 16);
+}
+
+
+PanasonicAudio::PanasonicAudio(
+  QObject *guiObject,
+  unsigned int index)
+  : PIRKeysetMetaData(
+      "Audio System Keyset",
+      Panasonic_Make,
+      index)
+{
+  addControlledDevice(Panasonic_Make, "RX-DS25", Audio_Device);
+
+  NECProtocol *np = new NECProtocol(
+    guiObject,
+    index,
+    516, 358,
+    516, 1220,
+    83895, false);
+
+  threadableProtocol = np;
+
+  np->setHeaderPair(3581, 1655);
+  np->setTrailerPulse(524);
+
+  np->setPreData(0x40040543, 32);
+
+  np->setMinimumRepetitions(1);
+
+  addKey("power", Power_Key, 0xFDBB, 16);
+  addKey("tape", Unmapped_Key, 0x3573, 16);
+  addKey("1", One_Key, 0x094F, 16);
+  addKey("2", Two_Key, 0x89CF, 16);
+  addKey("3", Three_Key, 0x490F, 16);
+  addKey("4", Four_Key, 0xC98F, 16);
+  addKey("5", Five_Key, 0x296F, 16);
+  addKey("6", Six_Key, 0xA9EF, 16);
+  addKey("7", Seven_Key, 0x692F, 16);
+  addKey("8", Eight_Key, 0xE9AF, 16);
+  addKey("9", Nine_Key, 0x195F, 16);
+  addKey("+10", Unmapped_Key, 0xF9BF, 16);
+  addKey("10/0", Zero_Key, 0x99DF, 16);
+  addKey("cancel", Clear_Key, 0xB1F7, 16);
+  addKey("program", Unmapped_Key, 0xD197, 16);
+  addKey("tuner-band", Unmapped_Key, 0x1D5B, 16);
+  addKey("tuning-", ChannelDown_Key, 0x5711, 16);
+  addKey("tuning+", ChannelUp_Key, 0x97D1, 16);
+  addKey("fm-mode", Unmapped_Key, 0x2761, 16);
+  addKey("cd", Unmapped_Key, 0x6D2B, 16);
+  addKey("prev", Previous_Key, 0x2167, 16);
+  addKey("next", Next_Key, 0xA1E7, 16);
+  addKey("stop-clear", Stop_Key, 0x0147, 16);
+  addKey("play-pause", Play_Key, 0xE1A7, 16);
+  addKey("play-pause", Pause_Key, 0xE1A7, 16);
+  addKey("repeat", Unmapped_Key, 0x81C7, 16);
+  addKey("xbs", Unmapped_Key, 0x6B2D, 16);
+  addKey("vol-", VolumeDown_Key, 0x8DCB, 16);
+  addKey("vol+", VolumeUp_Key, 0x0D4B, 16);
+}
diff --git a/keysets/panasonic.h b/keysets/panasonic.h
new file mode 100644 (file)
index 0000000..5b8fc71
--- /dev/null
@@ -0,0 +1,120 @@
+#ifndef PANASONIC_H
+#define PANASONIC_H
+
+#include "pirkeysetmetadata.h"
+
+#include <QObject>
+
+class PanasonicAmp: public PIRKeysetMetaData
+{
+public:
+  PanasonicAmp(
+    QObject *guiObject,
+    unsigned int index);
+};
+
+class PanasonicCarAudio: public PIRKeysetMetaData
+{
+public:
+  PanasonicCarAudio(
+    QObject *guiObject,
+    unsigned int index);
+};
+
+class PanasonicSat1: public PIRKeysetMetaData
+{
+public:
+  PanasonicSat1(
+    QObject *guiObject,
+    unsigned int index);
+};
+
+class PanasonicSat1a: public PanasonicSat1
+{
+public:
+  PanasonicSat1a(
+    QObject *guiObject,
+    unsigned int index);
+};
+
+class PanasonicTV1: public PIRKeysetMetaData
+{
+public:
+  PanasonicTV1(
+    QObject *guiObject,
+    unsigned int index);
+};
+
+class PanasonicTV1a: public PanasonicTV1
+{
+public:
+  PanasonicTV1a(
+    QObject *guiObject,
+    unsigned int index);
+};
+
+class PanasonicTV1b: public PanasonicTV1
+{
+public:
+  PanasonicTV1b(
+    QObject *guiObject,
+    unsigned int index);
+};
+
+class PanasonicVCR1: public PIRKeysetMetaData
+{
+public:
+  PanasonicVCR1(
+    QObject *guiObject,
+    unsigned int index);
+};
+
+class PanasonicVCR1a: public PanasonicVCR1
+{
+public:
+  PanasonicVCR1a(
+    QObject *guiObject,
+    unsigned int index);
+};
+
+class PanasonicVCR1b: public PanasonicVCR1
+{
+public:
+  PanasonicVCR1b(
+    QObject *guiObject,
+    unsigned int index);
+};
+
+class PanasonicVCR1c: public PanasonicVCR1
+{
+public:
+  PanasonicVCR1c(
+    QObject *guiObject,
+    unsigned int index);
+};
+
+class PanasonicDVD1: public PIRKeysetMetaData
+{
+public:
+  PanasonicDVD1(
+    QObject *guiObject,
+    unsigned int index);
+};
+
+class PanasonicDVD1a: public PanasonicDVD1
+{
+public:
+  PanasonicDVD1a(
+    QObject *guiObject,
+    unsigned int index);
+};
+
+class PanasonicAudio: public PIRKeysetMetaData
+{
+public:
+  PanasonicAudio(
+    QObject *guiObject,
+    unsigned int index);
+};
+
+#endif // PANASONIC_H
diff --git a/keysets/samsung.cpp b/keysets/samsung.cpp
new file mode 100644 (file)
index 0000000..30789a6
--- /dev/null
@@ -0,0 +1,697 @@
+#include "samsung.h"
+#include "necprotocol.h"
+#include "rc5protocol.h"
+
+SamsungTV1::SamsungTV1(
+  QObject *guiObject,
+  unsigned int index)
+  : PIRKeysetMetaData(
+      "TV Keyset 1",
+      Samsung_Make,
+      index)
+{
+  addControlledDevice(Samsung_Make, "SyncMaster 192MP", TV_Device);
+  addControlledDevice(Samsung_Make, "LN32C530F1FXZA", TV_Device);
+
+  NECProtocol *np = new NECProtocol(
+    guiObject,
+    index,
+    600, 500,
+    600, 1600,
+    107500, true);
+
+  threadableProtocol = np;
+
+  np->setHeaderPair(4500, 4500);
+  np->setTrailerPulse(600);
+
+  np->setPreData(0xE0E0, 16);
+
+  addKey("Power", Power_Key, 0x40BF, 16);
+  addKey("Channel Up", ChannelUp_Key, 0x48B7, 16);
+  addKey("Channel Down", ChannelDown_Key, 0x08F7, 16);
+  addKey("Volume Up", VolumeUp_Key, 0xE01F, 16);
+  addKey("Volume Down", VolumeDown_Key, 0xD02F, 16);
+  addKey("TV/Video", Input_Key, 0x807F, 16);
+  addKey("1", One_Key, 0x20DF, 16);
+  addKey("2", Two_Key, 0xA05F, 16);
+  addKey("3", Three_Key, 0x609F, 16);
+  addKey("4", Four_Key, 0x10EF, 16);
+  addKey("5", Five_Key, 0x906F, 16);
+  addKey("6", Six_Key, 0x50AF, 16);
+  addKey("7", Seven_Key, 0x30CF, 16);
+  addKey("8", Eight_Key, 0xB04F, 16);
+  addKey("9", Nine_Key, 0x708F, 16);
+  addKey("0", Zero_Key, 0x8877, 16);
+  addKey("-/--", DoubleDigit_Key, 0xC43B, 16);
+  addKey("+100", PlusOneHundred_Key, 0xC43B, 16);
+  addKey("DASH", Dash_Key, 0xC43B, 16);
+  addKey("Sleep", Sleep_Key, 0xC03F, 16);
+  addKey("PrevCh", PrevChannel_Key, 0xC837, 16);
+  addKey("Mute", Mute_Key, 0xF00F, 16);
+  addKey("Display", Info_Key, 0xF807, 16);
+  addKey("Menu", Menu_Key, 0x58A7, 16);
+  addKey("Red", Red_Key, 0x36C9, 16);
+  addKey("Green", Green_Key, 0x28D7, 16);
+  addKey("Yellow", Yellow_Key, 0xA857, 16);
+  addKey("Blue", Blue_Key, 0x6897, 16);
+  addKey("Up", Up_Key, 0x06F9, 16);
+  addKey("Down", Down_Key, 0x8679, 16);
+  addKey("Left", Left_Key, 0xA659, 16);
+  addKey("Right", Right_Key, 0x46B9, 16);
+//  addKey("Enter", Enter_Key, 0x16E9, 16);
+  addKey("Enter", Select_Key, 0x16E9, 16);
+  addKey("Exit", Exit_Key, 0xB44B, 16);
+  addKey("PIP", PIP_Key, 0x04FB, 16);
+  addKey("Swap", PIPSwap_Key, 0x847B, 16);
+  addKey("Closed Captions", Captions_Key, 0xA45B, 16); // "SUBTITLE"
+  addKey("Guide", Guide_Key, 0xF20D, 16);
+  addKey("Play", Play_Key, 0xE21D, 16);
+  addKey("PLAY-PAUSE", Pause_Key, 0xE21D, 16);
+  addKey("Stop", Stop_Key, 0x629D, 16);
+  addKey("Fast Forward", FastForward_Key, 0x12ED, 16);
+  addKey("Rewind", Rewind_Key, 0xA25D, 16);
+  addKey("Record", Record_Key, 0x926D, 16);
+  addKey("PMode", PictureMode_Key, 0x14EB, 16); // "p.std"
+  addKey("SMode", SoundMode_Key, 0xD42B, 16);
+  addKey("PSize", AspectRatio_Key, 0x7C83, 16);
+  addKey("ch.scan", Scan_Key, 0x8C73, 16);  // "h.scan"
+  addKey("surf", Unmapped_Key, 0xBC43, 16); // "r.surf"
+  addKey("turbo", Unmapped_Key, 0xA659, 16);
+  addKey("ttx/mix", Unmapped_Key, 0x34CB, 16); // "teletext"
+  addKey("tv", Unmapped_Key, 0xD827, 16);
+  addKey("mts", Language_Key, 0x00FF, 16); // "dual"
+  addKey("PIP.SOURCE", PIPSource_Key, 0x24DB, 16);
+  addKey("ch-mgr", Unmapped_Key, 0xD629, 16); // "CH_LIST"
+  addKey("srs", Surround_Key, 0x7689, 16);
+  addKey("size", Unmapped_Key, 0xF40B, 16); // PIP size?
+  addKey("PIP.chan+", Unmapped_Key, 0x4CB3, 16); // "AUDCH_UP"
+  addKey("position", PIPMove_Key, 0x44BB, 16);
+  addKey("PIP.chan-", Unmapped_Key, 0xCC33, 16); // "AUDCH_DOWN"
+  addKey("pc", Unmapped_Key, 0x9669, 16);
+  addKey("TV-DTV", Unmapped_Key, 0xC23D, 16);
+  addKey("D.MENU", DiscMenu_Key, 0x718E, 16);
+  addKey("STILL", Unmapped_Key, 0x42BD, 16);
+  addKey("WISELINK", Unmapped_Key, 0x31CE, 16); // "W.Link", "Media.P"
+  addKey("ANTENNA", Unmapped_Key, 0x6C93, 16);
+  addKey("ANYNET", Unmapped_Key, 0xE916, 16);
+  addKey("FAV-CH", Favorites_Key, 0x22DD, 16);
+  addKey("RETURN", Unmapped_Key, 0x1AE5, 16);
+  addKey("E.SAVING", Unmapped_Key, 0xEE11, 16);
+  addKey("Tools", Unmapped_Key, 0xD22D, 16);
+  addKey("E.Mode", Unmapped_Key, 0x29D6, 16);
+  addKey("HDMI", Unmapped_Key, 0xD12E, 16);
+  addKey("Content", Unmapped_Key, 0x9E61, 16);
+  addKey("Internet", Unmapped_Key, 0xC936, 16);
+  addKey("AD", Unmapped_Key, 0xE41B, 16);
+}
+
+
+SamsungTV1a::SamsungTV1a(
+  QObject *guiObject,
+  unsigned int index)
+  : SamsungTV1(guiObject, index)
+{
+  setKeysetName("TV Keyset 1a");
+
+  addKey("turbo", Unmapped_Key, 0xC837, 16);
+  addKey("s.menu", SoundMode_Key, 0x28D7, 16);
+  addKey("s.std", Unmapped_Key, 0xA857, 16);
+  addKey("p.std", Unmapped_Key, 0x6897, 16);
+}
+
+
+SamsungTV1b::SamsungTV1b(
+  QObject *guiObject,
+  unsigned int index)
+  : SamsungTV1(guiObject, index)
+{
+  setKeysetName("TV Keyset 1b");
+
+  addKey("Red", Red_Key, 0x847B, 16);
+  addKey("Exit", Exit_Key, 0x34CB, 16);
+}
+
+
+SamsungTV1c::SamsungTV1c(
+  QObject *guiObject,
+  unsigned int index)
+  : SamsungTV1(guiObject, index)
+{
+  setKeysetName("TV Keyset 1c");
+
+  // Some remotes apparently use channel and volume keys for navigation:
+  addKey("up", Up_Key, 0x48B7, 16);
+  addKey("down", Down_Key, 0x08F7, 16);
+  addKey("left", Left_Key, 0xD02F, 16);
+  addKey("right", Right_Key, 0xE01F, 16);
+  addKey("center", Unmapped_Key, 0x58A7, 16);
+}
+
+
+SamsungTV1d::SamsungTV1d(
+  QObject *guiObject,
+  unsigned int index)
+  : SamsungTV1(guiObject, index)
+{
+  setKeysetName("TV Keyset 1d");
+
+  addKey("turbo", Unmapped_Key, 0x26D9, 16);
+}
+
+
+SamsungTV1e::SamsungTV1e(
+  QObject *guiObject,
+  unsigned int index)
+  : SamsungTV1(guiObject, index)
+{
+  setKeysetName("TV Keyset 1e");
+
+  addKey("p.mode", PictureMode_Key, 0x6897, 16);
+}
+
+
+// This one overrides the color keys:
+SamsungTV1f::SamsungTV1f(
+  QObject *guiObject,
+  unsigned int index)
+  : SamsungTV1(guiObject, index)
+{
+  setKeysetName("TV Keyset 1f");
+
+  addKey("p-mode", PictureMode_Key, 0x36C9, 16);
+  addKey("s-mode", SoundMode_Key, 0x28D7, 16);
+  addKey("still", Unmapped_Key, 0xA857, 16);
+  addKey("p-size", AspectRatio_Key, 0x6897, 16);
+}
+
+
+// Not sure that this even is a Samsung TV...
+SamsungTV2::SamsungTV2(
+  QObject *guiObject,
+  unsigned int index)
+  : PIRKeysetMetaData(
+      "TV Keyset 2 (dubious)",
+      Samsung_Make,
+      index)
+{
+  RC5Protocol *rp = new RC5Protocol(
+    guiObject,
+    index,
+    900, 850,
+    900,
+    110000, true);
+
+  threadableProtocol = rp;
+
+  rp->setToggleBit(2);
+
+  addKey("1", One_Key, 0x1001, 13);
+  addKey("2", Two_Key, 0x1002, 13);
+  addKey("3", Three_Key, 0x1003, 13);
+  addKey("4", Four_Key, 0x1004, 13);
+  addKey("5", Five_Key, 0x1005, 13);
+  addKey("6", Six_Key, 0x1006, 13);
+  addKey("7", Seven_Key, 0x1007, 13);
+  addKey("8", Eight_Key, 0x1008, 13);
+  addKey("9", Nine_Key, 0x1009, 13);
+  addKey("0", Zero_Key, 0x1000, 13);
+  addKey("TV", Unmapped_Key, 0x103F, 13);
+  addKey("Power", Power_Key, 0x100C, 13);
+  addKey("Video", Unmapped_Key, 0x1038, 13);
+  addKey("Display", Info_Key, 0x100F, 13); // [+]
+  addKey("Sleep", Sleep_Key, 0x1026, 13);
+  addKey("-/--", DoubleDigit_Key, 0x100A, 13);
+  addKey("P.STD", PictureMode_Key, 0x100E, 13); // "Colour"
+  addKey("Mute", Mute_Key, 0x100D, 13);
+  addKey("P.Size", AspectRatio_Key, 0x1016, 13);
+  addKey("Vol-", VolumeDown_Key, 0x0015, 13);
+  addKey("Vol+", VolumeUp_Key, 0x0016, 13);
+  addKey("CH/P_UP", ChannelUp_Key, 0x0010, 13);
+  addKey("CH/P_DOWN", ChannelDown_Key, 0x0011, 13);
+  addKey("Menu", Menu_Key, 0x0012, 13);
+  addKey("TTX/MIX", Unmapped_Key, 0x103C, 13);
+  addKey("Red", Red_Key, 0x002B, 13);
+  addKey("Green", Green_Key, 0x002C, 13);
+  addKey("Yellow", Yellow_Key, 0x002D, 13);
+  addKey("Blue", Blue_Key, 0x002E, 13);
+  addKey(">>", FastForward_Key, 0x101E, 13);
+  addKey("colour+", Unmapped_Key, 0x1014, 13);
+  addKey("colour-", Unmapped_Key, 0x1015, 13);
+  addKey("brightness+", Unmapped_Key, 0x1012, 13);
+  addKey("brightness-", Unmapped_Key, 0x1013, 13);
+  addKey("contrast+", Unmapped_Key, 0x101C, 13);
+  addKey("contrast-", Unmapped_Key, 0x101D, 13);
+}
+
+
+SamsungTV2a::SamsungTV2a(
+  QObject *guiObject,
+  unsigned int index)
+  : SamsungTV2(guiObject, index)
+{
+  setKeysetName("TV Keyset 2a");
+
+  addKey("volume+", VolumeUp_Key, 0x1010, 13);
+  addKey("volume-", VolumeDown_Key, 0x1011, 13);
+  addKey("prog+", ChannelUp_Key, 0x1020, 13);
+  addKey("prog-", ChannelDown_Key, 0x1021, 13);
+}
+
+
+SamsungVCR1::SamsungVCR1(
+  QObject *guiObject,
+  unsigned int index)
+  : PIRKeysetMetaData(
+      "VCR(DVD) Keyset 1",
+      Samsung_Make,
+      index)
+{
+  NECProtocol *np = new NECProtocol(
+    guiObject,
+    index,
+    600, 500,
+    600, 1650,
+    113837, true);
+
+  threadableProtocol = np;
+
+  np->setHeaderPair(4500, 4500);
+  np->setTrailerPulse(600);
+
+  np->setPreData(0xA0A0, 16);
+
+  addKey("Power", Power_Key, 0x40BF, 16);
+  addKey("Eject", Eject_Key, 0x04FB, 16);
+  addKey("TV/Video", Input_Key, 0x807F, 16); // TV/Video
+  addKey("One", One_Key, 0x20DF, 16);
+  addKey("Two", Two_Key, 0xA05F, 16);
+  addKey("Three", Three_Key, 0x609F, 16);
+  addKey("Four", Four_Key, 0x10EF, 16);
+  addKey("Five", Five_Key, 0x906F, 16);
+  addKey("Six", Six_Key, 0x50AF, 16);
+  addKey("Seven", Seven_Key, 0x30CF, 16);
+  addKey("Eight", Eight_Key, 0xB04F, 16);
+  addKey("Nine", Nine_Key, 0x708F, 16);
+  addKey("Zero", Zero_Key, 0x8877, 16);
+  addKey("Clear", Clear_Key, 0xB847, 16); // "CNT.RESET"
+  addKey("Rewind", Rewind_Key, 0x18E7, 16);
+  addKey("Stop", Stop_Key, 0xA857, 16);
+  addKey("Play", Play_Key, 0x9867, 16);
+  addKey("play/pause", Pause_Key, 0x9867, 16);
+  addKey("FastForward", FastForward_Key, 0x58A7, 16);
+  addKey("Menu", Menu_Key, 0xF807, 16);
+  addKey("Captions", Captions_Key, 0x44BB, 16);
+  addKey("Info", Info_Key, 0x7887, 16); // "display"
+  addKey("Exit", Exit_Key, 0xB847, 16);
+  addKey("Up", Up_Key, 0xF40B, 16);
+  addKey("Down", Down_Key, 0x946B, 16);
+  addKey("Left", Left_Key, 0xBE41, 16);
+  addKey("Right", Right_Key, 0x7E81, 16);
+//  addKey("Enter", Enter_Key, 0x3AC5, 16);
+  addKey("Enter", Select_Key, 0x3AC5, 16); // "ok"
+  addKey("Record", Record_Key, 0x28D7, 16);
+  addKey("ChannelUp", ChannelUp_Key, 0x48B7, 16);
+  addKey("ChannelDown", ChannelDown_Key, 0x08F7, 16);
+  addKey("mark/search", Unmapped_Key, 0xD42B, 16); // "index"
+  addKey("auto_track", AutoTracking_Key, 0x847B, 16);
+  addKey("ipc", Unmapped_Key, 0xAE51, 16);
+  addKey("input", Unmapped_Key, 0x24DB, 16);
+  addKey("trk_up", TrackingPlus_Key, 0x34CB, 16); // "FINE_UP"
+  addKey("trk_down", TrackingMinus_Key, 0xB44B, 16); // "FINE_DOWN"
+  addKey("progressive/speed", VHSSpeed_Key, 0x5CA3, 16); // "SP-LP"
+  addKey("dub", Unmapped_Key, 0x748B, 16);
+  addKey("timer", Sleep_Key, 0x0CF3, 16); // "MONITOR"
+  addKey("100+", PlusOneHundred_Key, 0x649B, 16);
+  addKey("shift", Unmapped_Key, 0xA45B, 16);
+  addKey("Dma", Unmapped_Key, 0xC639, 16);
+  addKey("A.REP", Unmapped_Key, 0xC03F, 16);
+  addKey("SYSTEM", Unmapped_Key, 0x4CB3, 16);
+  addKey("VPS", Unmapped_Key, 0x0E71, 16);
+  addKey("BAND", Unmapped_Key, 0x621D, 16);
+  addKey("Q_PRO", Unmapped_Key, 0x5E21, 16);
+  addKey("SHOWVIEW", Unmapped_Key, 0x0679, 16);
+  addKey("SLOW_DOWN", Unmapped_Key, 0x740B, 16);
+  addKey("SLOW_UP", Unmapped_Key, 0x641B, 16);
+  addKey("PRESET", Unmapped_Key, 0x5629, 16);
+}
+
+
+SamsungVCR1a::SamsungVCR1a(
+  QObject *guiObject,
+  unsigned int index)
+  : SamsungVCR1(guiObject, index)
+{
+  setKeysetName("VCR(DVD) Keyset 1a");
+
+  addKey("power", Power_Key, 0x12ED, 16);
+  addKey("clear", Clear_Key, 0x8C73, 16);
+  addKey("audio", Language_Key, 0xBC43, 16);
+  addKey("dvd", Unmapped_Key, 0xAA55, 16);
+  addKey("vcr", Unmapped_Key, 0x14EB, 16);
+  addKey("input_sel", Unmapped_Key, 0x9A65, 16);
+  addKey("menu", Menu_Key, 0x16E9, 16);
+  addKey("up", Up_Key, 0x34CB, 16);
+  addKey("down", Down_Key, 0xB44B, 16);
+  addKey("left", Left_Key, 0xE817, 16);
+  addKey("right", Right_Key, 0xC837, 16);
+  addKey("enter", Select_Key, 0xC23D, 16); // "ok"
+  addKey("disc_menu", DiscMenu_Key, 0x06F9, 16);
+  addKey("mode/repeat", Unmapped_Key, 0x6699, 16);
+  addKey("angle/timer", Unmapped_Key, 0xA25D, 16);
+}
+
+
+SamsungVCR1b::SamsungVCR1b(
+  QObject *guiObject,
+  unsigned int index)
+  : SamsungVCR1(guiObject, index)
+{
+  setKeysetName("VCR(DVD) Keyset 1b");
+
+  addKey("audio", Language_Key, 0x44BB, 16); // "output"
+  addKey("Input", Input_Key, 0x24DB, 16);
+  addKey("+", Unmapped_Key, 0x649B, 16);
+  addKey("-", Unmapped_Key, 0x14EB, 16);
+  addKey("slowup", Unmapped_Key, 0xC837, 16);
+  addKey("slowdown", Unmapped_Key, 0xE817, 16);
+  addKey("reset", Clear_Key, 0xB847, 16); // "CLR/RST"
+  addKey("pause", Pause_Key, 0x6897, 16); // "P/S"
+  addKey("shuttle<", Unmapped_Key, 0xBE41, 16);
+  addKey("shuttle>", Unmapped_Key, 0x7E81, 16);
+  addKey("showview", Unmapped_Key, 0x0CF3, 16);
+  addKey("index", Unmapped_Key, 0xD42B, 16);
+  addKey("mark", Unmapped_Key, 0xF40B, 16);
+  addKey("erase", Unmapped_Key, 0x946B, 16);
+  addKey("prog", Program_Key, 0xF807, 16);
+  addKey("clk/cnt", Unmapped_Key, 0xCC33, 16);
+  addKey("aft", Unmapped_Key, 0x2ED1, 16);
+  addKey("SYSTEM", Menu_Key, 0x9669, 16);
+  addKey("A.TRK", AutoTracking_Key, 0x847B, 16);
+  addKey("Q-PRO", Unmapped_Key, 0xBC43, 16);
+  addKey("PICTURE", PictureMode_Key, 0xAE51, 16);
+  addKey("OK_UP", Up_Key, 0x4AB5, 16);
+  addKey("OK_DOWN", Down_Key, 0x0AF5, 16);
+  addKey("OK_LEFT", Left_Key, 0xCE31, 16);
+  addKey("OK_RIGHT", Right_Key, 0xEE11, 16);
+  addKey("Band", Unmapped_Key, 0xC43B, 16);
+  addKey("Preset", Unmapped_Key, 0xAC53, 16);
+  addKey("Search", Unmapped_Key, 0x8C73, 16);
+  addKey("Memory", Unmapped_Key, 0x38C7, 16);
+}
+
+
+SamsungVCR1c::SamsungVCR1c(
+  QObject *guiObject,
+  unsigned int index)
+  : SamsungVCR1a(guiObject, index)
+{
+  setKeysetName("VCR(DVD) Keyset 1c");
+
+  addKey("eject", Eject_Key, 0x4CB3, 16);
+  addKey("vol_up", VolumeUp_Key, 0xC639, 16);
+  addKey("vol_down", VolumeDown_Key, 0x02FD, 16);
+  addKey("prev_ch", PrevChannel_Key, 0x2AD5, 16);
+  addKey("up", Up_Key, 0x7887, 16);
+  addKey("down", Down_Key, 0x8C73, 16);
+  addKey("left", Left_Key, 0x6699, 16);
+  addKey("right", Right_Key, 0x00FF, 16);
+  addKey("speed", VHSSpeed_Key, 0x06F9, 16);
+  addKey("timer", Sleep_Key, 0x44BB, 16);
+  addKey("return", Exit_Key, 0xBC43, 16);
+}
+
+
+// Combo VCR/TV:
+SamsungVCR1d::SamsungVCR1d(
+  QObject *guiObject,
+  unsigned int index)
+  : SamsungVCR1(guiObject, index)
+{
+  setKeysetName("VCR/TV Combo Keyset 1d");
+
+  addKey("eject", Eject_Key, 0x4CB3, 16);
+  addKey("P-STD", PictureMode_Key, 0xF609, 16);
+  addKey("MUTE", Mute_Key, 0xF00F, 16);
+  addKey("VOL+", VolumeUp_Key, 0xE01F, 16);
+  addKey("VOL-", VolumeDown_Key, 0xD02F, 16);
+  addKey("PRE-CH", PrevChannel_Key, 0x54AB, 16);
+  addKey("P./STILL", Pause_Key, 0x6897, 16);
+  addKey("REPEAT", Unmapped_Key, 0xEC13, 16);
+  addKey("TRK+", TrackingPlus_Key, 0xB44B, 16);
+  addKey("TRK-", TrackingMinus_Key, 0x34CB, 16);
+}
+
+
+SamsungVCR1e::SamsungVCR1e(
+  QObject *guiObject,
+  unsigned int index)
+  : SamsungVCR1(guiObject, index)
+{
+  setKeysetName("VCR(DVD) Keyset 1e");
+
+  addKey("OPEN/CLOSE", Eject_Key, 0x4CB3, 16);
+  addKey("AUDIO", Unmapped_Key, 0x16E9, 16);
+  addKey("MODE/REPEAT", Unmapped_Key, 0x6699, 16);
+  addKey("ZOOM", Unmapped_Key, 0x5CA3, 16);
+  addKey("CLOCK/COUNTER", Unmapped_Key, 0x8C73, 16);
+  addKey("ANGLE", Unmapped_Key, 0x2AD5, 16);
+  addKey("3D_SOUND", Surround_Key, 0x649B, 16);
+  addKey("DVD", Unmapped_Key, 0xAA55, 16);
+  addKey("VCR", Unmapped_Key, 0x14EB, 16);
+  addKey("INPUT_SEL", Unmapped_Key, 0x9A65, 16);
+  addKey("DIGEST", Unmapped_Key, 0x00FF, 16);
+  addKey("TRK_UP", TrackingPlus_Key, 0xC639, 16);
+  addKey("TRK_DOWN", TrackingMinus_Key, 0x02FD, 16);
+  addKey("DISC_MENU", DiscMenu_Key, 0xF807, 16);
+  addKey("UP", Up_Key, 0x34CB, 16);
+  addKey("DOWN", Down_Key, 0xB44B, 16);
+  addKey("RIGHT", Right_Key, 0xC837, 16);
+  addKey("LEFT", Left_Key, 0xE817, 16);
+  addKey("SETUP/ENTER", Menu_Key, 0xC23D, 16);
+  addKey("SETUP/ENTER", Select_Key, 0xC23D, 16);
+  addKey("RETURN", Exit_Key, 0xBC43, 16);
+  addKey("TITLE", DiscTitle_Key, 0x06F9, 16);
+}
+
+
+SamsungDVD1::SamsungDVD1(
+  QObject *guiObject,
+  unsigned int index)
+  : PIRKeysetMetaData(
+      "DVD Keyset 1",
+      Samsung_Make,
+      index)
+{
+  NECProtocol *np = new NECProtocol(
+    guiObject,
+    index,
+    600, 500,
+    600, 1600,
+    108000, true);
+
+  threadableProtocol = np;
+
+  np->setHeaderPair(9000, 4500);
+  np->setTrailerPulse(600);
+  np->setRepeatPair(9000, 4500);
+
+  np->setPreData(0x198133F, 26);
+
+  addKey("power", Power_Key, 0x8976, 16);
+  addKey("open_close", Eject_Key, 0x31CE, 16);
+  addKey("1", One_Key, 0x817E, 16);
+  addKey("2", Two_Key, 0x41BE, 16);
+  addKey("3", Three_Key, 0xC13E, 16);
+  addKey("4", Four_Key, 0x21DE, 16);
+  addKey("5", Five_Key, 0xA15E, 16);
+  addKey("6", Six_Key, 0x619E, 16);
+  addKey("7", Seven_Key, 0xE11E, 16);
+  addKey("8", Eight_Key, 0x11EE, 16);
+  addKey("9", Nine_Key, 0x916E, 16);
+  addKey("0", Zero_Key, 0x01FE, 16);
+  addKey("prog", Program_Key, 0xE51A, 16); // "Mode"
+  addKey("clear", Clear_Key, 0x25DA, 16); // "cancel"
+  addKey("step", StepForward_Key, 0x659A, 16);
+  addKey("replay", Replay_Key, 0x55AA, 16);
+  addKey("skip", Advance_Key, 0x758A, 16); // "digest"
+  addKey("|<<", Previous_Key, 0xF906, 16); // "skip-"
+  addKey(">>|", Next_Key, 0x857A, 16);
+  addKey("<<", Rewind_Key, 0x39C6, 16);
+  addKey(">>", FastForward_Key, 0x7986, 16);
+  addKey("stop", Stop_Key, 0x45BA, 16);
+  addKey("play", Play_Key, 0x05FA, 16);
+  addKey("play/pause", Pause_Key, 0x05FA, 16);
+  addKey("return", Exit_Key, 0xA956, 16);
+  addKey("menu", Menu_Key, 0xD12E, 16); // "setup"
+  addKey("info", Info_Key, 0xF10E, 16); // "display"
+  addKey("disc_menu", DiscMenu_Key, 0x29D6, 16);
+  addKey("left", Left_Key, 0x59A6, 16);
+  addKey("up", Up_Key, 0xE916, 16);
+  addKey("down", Down_Key, 0x19E6, 16);
+  addKey("right", Right_Key, 0x9966, 16);
+  addKey("enter", Select_Key, 0xD926, 16);
+  addKey("ez_view", Unmapped_Key, 0xF50A, 16); // s.fit
+  addKey("subtitle", Captions_Key, 0x09F6, 16);
+  addKey("audio", Language_Key, 0x718E, 16);
+  addKey("angle", Unmapped_Key, 0x49B6, 16);
+  addKey("repeat", Unmapped_Key, 0xB946, 16);
+  addKey("repeat_A-B", Unmapped_Key, 0x15EA, 16);
+  addKey("step_r", StepForward_Key, 0xEB14, 16);
+  addKey("step_l", StepBack_Key, 0x1BE4, 16);
+  addKey("jog_r", Unmapped_Key, 0x936C, 16);
+  addKey("jog_l", Unmapped_Key, 0x53AC, 16);
+  addKey("sacd/cd", Unmapped_Key, 0x6E91, 16);
+  addKey("bookmark", Unmapped_Key, 0x956A, 16);
+  addKey("index_pre", Unmapped_Key, 0x837C, 16);
+  addKey("index_next", Unmapped_Key, 0x639C, 16);
+  addKey("page_pre", Unmapped_Key, 0x23DC, 16);
+  addKey("page_next", Unmapped_Key, 0x639C, 16);
+  addKey("zoom", Unmapped_Key, 0x35CA, 16);
+  addKey("hdmi_sel", Unmapped_Key, 0xE41B, 16);
+  addKey("video_sel", Unmapped_Key, 0x44BB, 16);
+  addKey("3D_Sound", Unmapped_Key, 0xD52A, 16);
+  addKey("TopMenu", DiscTitle_Key, 0xC936, 16);
+}
+
+
+SamsungDVD1a::SamsungDVD1a(
+  QObject *guiObject,
+  unsigned int index)
+  : SamsungDVD1(guiObject, index)
+{
+  setKeysetName("DVD Keyset 1a");
+
+  addKey("hdmi_sel", Unmapped_Key, 0x15EA, 16);
+}
+
+
+SamsungDVD1b::SamsungDVD1b(
+  QObject *guiObject,
+  unsigned int index)
+  : SamsungDVD1(guiObject, index)
+{
+  setKeysetName("DVD Keyset 1b");
+
+  addKey("Zoom", Unmapped_Key, 0x55AA, 16);
+  addKey("i.replay", Replay_Key, 0xB54A, 16);
+  addKey("Volume_Con", Unmapped_Key, 0x35CA, 16);
+}
+
+
+SamsungDVD2::SamsungDVD2(
+  QObject *guiObject,
+  unsigned int index)
+  : PIRKeysetMetaData(
+      "DVD Keyset 2",
+      Samsung_Make,
+      index)
+{
+  NECProtocol *np = new NECProtocol(
+    guiObject,
+    index,
+    600, 500,
+    600, 1600,
+    108000, true);
+
+  threadableProtocol = np;
+
+  np->setHeaderPair(4500, 4500);
+  np->setTrailerPulse(600);
+
+  np->setPreData(0xC2CA, 16);
+
+  addKey("1", One_Key, 0x827D, 16);
+  addKey("2", Two_Key, 0x42BD, 16);
+  addKey("3", Three_Key, 0xC23D, 16);
+  addKey("4", Four_Key, 0x22DD, 16);
+  addKey("5", Five_Key, 0xA25D, 16);
+  addKey("6", Six_Key, 0x629D, 16);
+  addKey("7", Seven_Key, 0xE21D, 16);
+  addKey("8", Eight_Key, 0xFC03, 16);
+  addKey("9", Nine_Key, 0xEC13, 16);
+  addKey("0", Zero_Key, 0xF40B, 16);
+  addKey("remain", Unmapped_Key, 0x00FF, 16);
+  addKey("cancel", Unmapped_Key, 0xE817, 16);
+  addKey("prev", Previous_Key, 0xD827, 16);
+  addKey("stop", Stop_Key, 0xD02F, 16);
+  addKey("play", Play_Key, 0xC03F, 16);
+  addKey("next", Next_Key, 0xC837, 16);
+  addKey("VOL+", VolumeUp_Key, 0xCC33, 16);
+  addKey("VOL-", VolumeDown_Key, 0xDC23, 16);
+  addKey("ch+", ChannelUp_Key, 0xC43B, 16);
+  addKey("ch-", ChannelDown_Key, 0xD42B, 16);
+  addKey("super5.1", Surround_Key, 0xE619, 16);
+  addKey("UP", Up_Key, 0xB04F, 16);
+  addKey("DOWN", Down_Key, 0xA857, 16);
+  addKey("LEFT", Left_Key, 0xA45B, 16);
+  addKey("RIGHT", Right_Key, 0xB847, 16);
+  addKey("ENTER", Select_Key, 0xA05F, 16);
+  addKey("SLEEP", Sleep_Key, 0x847B, 16);
+//  addKey("MODE", Program_Key, 0x18E7, 16); // Might be wrong
+  addKey("TV-VIDEO", Input_Key, 0x18E7, 16);
+  addKey("DVD", Unmapped_Key, 0x9867, 16);
+  addKey("TUNER", Unmapped_Key, 0x906F, 16);
+  addKey("AUX", Unmapped_Key, 0x8877, 16);
+  addKey("MUTE", Mute_Key, 0x9C63, 16);
+  addKey("SUBTITLE", Captions_Key, 0x708F, 16);
+  addKey("MENU", Menu_Key, 0x6C93, 16);
+  addKey("INFO", Info_Key, 0x649B, 16);
+  addKey("AUDIO", Language_Key, 0x609F, 16);
+  addKey("RETURN", Exit_Key, 0x38C7, 16);
+  addKey("ZOOM", Unmapped_Key, 0xF00F, 16);
+  addKey("MUSIC", Unmapped_Key, 0x24DB, 16);
+  addKey("MOVIE", Unmapped_Key, 0x16E9, 16);
+  addKey("ASC", Unmapped_Key, 0x9669, 16);
+  addKey("TEST-TONE", Unmapped_Key, 0x2CD3, 16);
+  addKey("EZ-VIEW", Unmapped_Key, 0xE01F, 16);
+  addKey("PLII-MODE", Unmapped_Key, 0x20DF, 16);
+  addKey("PLII-EFFECT", Unmapped_Key, 0x30CF, 16);
+  addKey("SOUND-EDIT", SoundMode_Key, 0x28D7, 16);
+  addKey("STEP", Unmapped_Key, 0xBC43, 16);
+  addKey("REPEAT", Unmapped_Key, 0x6699, 16);
+  addKey("SLOW", Unmapped_Key, 0xAC53, 16);
+  addKey("LOGO", Unmapped_Key, 0x1CE3, 16);
+  addKey("HDMI-AUDIO", Unmapped_Key, 0x0EF1, 16);
+  addKey("SD-HD", AspectRatio_Key, 0x9A65, 16);
+  addKey("TUNER-MEMORY", Unmapped_Key, 0xB44B, 16);
+}
+
+
+SamsungAC1::SamsungAC1(
+  QObject *guiObject,
+  unsigned int index)
+  : PIRKeysetMetaData(
+      "Air Conditioner Keyset 1",
+      Samsung_Make,
+      index)
+{
+  NECProtocol *np = new NECProtocol(
+    guiObject,
+    index,
+    600, 500,
+    600, 1600,
+    60000, true);
+
+  threadableProtocol = np;
+
+  np->setHeaderPair(4500, 4500);
+  np->setTrailerPulse(600);
+
+  np->setPreData(0x804, 12);
+
+  np->setMinimumRepetitions(1);
+
+  addKey("TIMER", Unmapped_Key, 0xA4, 8);
+  addKey("SLEEP", Sleep_Key, 0xE4, 8);
+  addKey("TEMP+", Unmapped_Key, 0x4C, 8);
+  addKey("TEMP-", Unmapped_Key, 0x8C, 8);
+  addKey("FAN", Unmapped_Key, 0x9C, 8);
+  addKey("COOL", Unmapped_Key, 0x3C, 8);
+  addKey("HEAT", Unmapped_Key, 0x5C, 8);
+  addKey("FAN_HIGH", Unmapped_Key, 0xEC, 8);
+  addKey("FAN_MED", Unmapped_Key, 0x6C, 8);
+  addKey("FAN_LOW", Unmapped_Key, 0xAC, 8);
+  addKey("SWING", Unmapped_Key, 0x94, 8);
+  addKey("POWER", Power_Key, 0xFC, 8);
+}
diff --git a/keysets/samsung.h b/keysets/samsung.h
new file mode 100644 (file)
index 0000000..48cb80c
--- /dev/null
@@ -0,0 +1,176 @@
+#ifndef SAMSUNG_H
+#define SAMSUNG_H
+
+#include "pirkeysetmetadata.h"
+
+#include <QObject>
+
+class SamsungTV1: public PIRKeysetMetaData
+{
+public:
+  SamsungTV1(
+    QObject *guiObject,
+    unsigned int index);
+};
+
+
+class SamsungTV1a: public SamsungTV1
+{
+public:
+  SamsungTV1a(
+    QObject *guiObject,
+    unsigned int index);
+};
+
+
+class SamsungTV1b: public SamsungTV1
+{
+public:
+  SamsungTV1b(
+    QObject *guiObject,
+    unsigned int index);
+};
+
+
+class SamsungTV1c: public SamsungTV1
+{
+public:
+  SamsungTV1c(
+    QObject *guiObject,
+    unsigned int index);
+};
+
+
+class SamsungTV1d: public SamsungTV1
+{
+public:
+  SamsungTV1d(
+    QObject *guiObject,
+    unsigned int index);
+};
+
+
+class SamsungTV1e: public SamsungTV1
+{
+public:
+  SamsungTV1e(
+    QObject *guiObject,
+    unsigned int index);
+};
+
+
+class SamsungTV1f: public SamsungTV1
+{
+public:
+  SamsungTV1f(
+    QObject *guiObject,
+    unsigned int index);
+};
+
+
+class SamsungTV2: public PIRKeysetMetaData
+{
+public:
+  SamsungTV2(
+    QObject *guiObject,
+    unsigned int index);
+};
+
+class SamsungTV2a: public SamsungTV2
+{
+public:
+  SamsungTV2a(
+    QObject *guiObject,
+    unsigned int index);
+};
+
+class SamsungVCR1: public PIRKeysetMetaData
+{
+public:
+  SamsungVCR1(
+    QObject *guiObject,
+    unsigned int index);
+};
+
+
+class SamsungVCR1a: public SamsungVCR1
+{
+public:
+  SamsungVCR1a(
+    QObject *guiObject,
+    unsigned int index);
+};
+
+class SamsungVCR1b: public SamsungVCR1
+{
+public:
+  SamsungVCR1b(
+    QObject *guiObject,
+    unsigned int index);
+};
+
+class SamsungVCR1c: public SamsungVCR1a
+{
+public:
+  SamsungVCR1c(
+    QObject *guiObject,
+    unsigned int index);
+};
+
+class SamsungVCR1d: public SamsungVCR1
+{
+public:
+  SamsungVCR1d(
+    QObject *guiObject,
+    unsigned int index);
+};
+
+class SamsungVCR1e: public SamsungVCR1
+{
+public:
+  SamsungVCR1e(
+    QObject *guiObject,
+    unsigned int index);
+};
+
+class SamsungDVD1: public PIRKeysetMetaData
+{
+public:
+  SamsungDVD1(
+    QObject *guiObject,
+    unsigned int index);
+};
+
+class SamsungDVD1a: public SamsungDVD1
+{
+public:
+  SamsungDVD1a(
+    QObject *guiObject,
+    unsigned int index);
+};
+
+class SamsungDVD1b: public SamsungDVD1
+{
+public:
+  SamsungDVD1b(
+    QObject *guiObject,
+    unsigned int index);
+};
+
+class SamsungDVD2: public PIRKeysetMetaData
+{
+public:
+  SamsungDVD2(
+    QObject *guiObject,
+    unsigned int index);
+};
+
+class SamsungAC1: public PIRKeysetMetaData
+{
+public:
+  SamsungAC1(
+    QObject *guiObject,
+    unsigned int index);
+};
+
+#endif // SAMSUNG_H
diff --git a/keysets/sanyo.cpp b/keysets/sanyo.cpp
new file mode 100644 (file)
index 0000000..8875b67
--- /dev/null
@@ -0,0 +1,201 @@
+#include "sanyo.h"
+
+#include "necprotocol.h"
+
+SanyoVCR1::SanyoVCR1(
+  QObject *guiObject,
+  unsigned int index)
+  : PIRKeysetMetaData(
+      "VCR Keyset 1",
+      Sanyo_Make,
+      index)
+{
+  addControlledDevice(Sanyo_Make, "DVW-5000", VCR_Device);
+  addControlledDevice(Sanyo_Make, "DVW-5000", DVD_Device);
+
+  NECProtocol *np = new NECProtocol(
+    guiObject,
+    index,
+    627, 500,  // values for zero
+    627, 1626, // values for one
+    108754, true); // constant-length gap
+
+  threadableProtocol = np;
+
+  np->setHeaderPair(9000, 4500);
+  np->setTrailerPulse(626);
+  np->setRepeatPair(9000, 2250);
+
+  np->setPreData(0x8C73, 16);
+
+  // Add keys:
+  addKey("Power", Power_Key, 0xDA25, 16);
+  addKey("1", One_Key, 0x20DF, 16);
+  addKey("2", Two_Key, 0xA05F, 16);
+  addKey("3", Three_Key, 0x609F, 16);
+  addKey("4", Four_Key, 0xE01F, 16);
+  addKey("5", Five_Key, 0x30CF, 16);
+  addKey("6", Six_Key, 0xB04F, 16);
+  addKey("7", Seven_Key, 0x708F, 16);
+  addKey("8", Eight_Key, 0xF00F, 16);
+  addKey("9", Nine_Key, 0x38C7, 16);
+  addKey("0", Zero_Key, 0xB847, 16);
+  addKey("Cancel", Clear_Key, 0x52AD, 16);
+  addKey("Ch Up", ChannelUp_Key, 0x807F, 16);
+  addKey("Ch Down", ChannelDown_Key, 0x40BF, 16);
+  addKey("Rew", Rewind_Key, 0x48B7, 16);
+  addKey("Play", Play_Key, 0x28D7, 16);
+  addKey("FF", FastForward_Key, 0xC837, 16);
+  addKey("Rec", Record_Key, 0xA857, 16);
+  addKey("Stop", Stop_Key, 0x08F7, 16);
+  addKey("Pause", Pause_Key, 0x8877, 16);
+  addKey("TV/VCR", Input_Key, 0x10EF, 16);
+  addKey("Menu", Menu_Key, 0x53AC, 16);
+  addKey("Up", Up_Key, 0xE916, 16);
+  addKey("Down", Down_Key, 0x6996, 16);
+  addKey("Left", Left_Key, 0xA956, 16);
+  addKey("Right", Right_Key, 0x29D6, 16);
+  addKey("Ok", Select_Key, 0xD22D, 16);
+  addKey("Clock", Clock_Key, 0x6A95, 16);
+  addKey("Reset", Reset_Key, 0x22DD, 16);
+  addKey("Display", Info_Key, 0x32CD, 16);
+  addKey("Memory", Unmapped_Key, 0xC23D, 16); // "->0<-"
+  addKey("PROG", Program_Key, 0x629D, 16);
+  addKey("BLANK", Unmapped_Key, 0x0BF4, 16);
+  addKey("Monitor", Unmapped_Key, 0x8A75, 16);
+  addKey("ShowView", Unmapped_Key, 0x31CE, 16);
+  addKey("ATR", Unmapped_Key, 0xF807, 16);
+  addKey("Slow", Unmapped_Key, 0x58A7, 16);
+  addKey("SP/LP", VHSSpeed_Key, 0x7A85, 16);
+  addKey("VPS", Unmapped_Key, 0xF20D, 16); // "vps/pdc", "dpc"
+  addKey("Preset", Unmapped_Key, 0x7986, 16);
+  addKey("Input", Unmapped_Key, 0x7887, 16);  // need a subclass for this?
+  addKey("Audio", Language_Key, 0xC03F, 16);
+  addKey("Index", Unmapped_Key, 0x9867, 16);
+  addKey("+100", PlusOneHundred_Key, 0xD827, 16);
+  addKey("x2", Unmapped_Key, 0xD02F, 16);
+}
+
+
+SanyoTV1::SanyoTV1(
+  QObject *guiObject,
+  unsigned int index)
+  : PIRKeysetMetaData(
+      "TV Keyset 1",
+      Sanyo_Make,
+      index)
+{
+  addControlledDevice(Sanyo_Make, "DP32746", TV_Device);
+
+  NECProtocol *np = new NECProtocol(
+    guiObject,
+    index,
+    600, 1600,  // zero
+    600, 500,   // one
+    40000, false);  // gap, not constant length
+
+  threadableProtocol = np;
+
+  np->setHeaderPair(9000, 4500);
+  np->setTrailerPulse(600);
+  np->setRepeatPair(9000, 2250);
+
+  np->setPreData(0xE31C, 16);
+
+  addKey("Power", Power_Key, 0xB748, 16);
+//  addKey("audio_mode", Language_Key, 0xC738, 16);  // might be wrong
+  addKey("1", One_Key, 0x7F80, 16);
+  addKey("2", Two_Key, 0xBF40, 16);
+  addKey("3", Three_Key, 0x3FC0, 16);
+  addKey("4", Four_Key, 0xDF20, 16);
+  addKey("5", Five_Key, 0x5FA0, 16);
+  addKey("6", Six_Key, 0x9F60, 16);
+  addKey("7", Seven_Key, 0x1FE0, 16);
+  addKey("8", Eight_Key, 0xEF10, 16);
+  addKey("9", Nine_Key, 0x6F90, 16);
+  addKey("0", Zero_Key, 0xFF00, 16);
+  addKey("Channel Up", ChannelUp_Key, 0xAF50, 16);
+  addKey("Channel Down", ChannelDown_Key, 0x2FD0, 16);
+  addKey("Volume Up", VolumeUp_Key, 0x8F70, 16);
+  addKey("Volume Down", VolumeDown_Key, 0x0FF0, 16);
+  addKey("Mute", Mute_Key, 0xE718, 16);
+  addKey("Display", Info_Key, 0xCF30, 16);
+  addKey("Menu", Menu_Key, 0x17E8, 16);
+//  addKey("Enter", Enter_Key, 0xA758, 16);
+  addKey("Enter", Select_Key, 0xA758, 16);
+  addKey("Closed Captions", Captions_Key, 0x7788, 16);
+  addKey("Video Mode", Input_Key, 0x37C8, 16);
+  addKey("Sleep", Sleep_Key, 0x4FB0, 16);
+  addKey("Recall", PrevChannel_Key, 0x6798, 16);
+  addKey("PIP", PIP_Key, 0x25DA, 16);
+  addKey("Swap", PIPSwap_Key, 0x45BA, 16);
+  addKey("Red", Red_Key, 0x6D92, 16);
+  addKey("Green", Green_Key, 0xAD52, 16);
+  addKey("Yellow", Yellow_Key, 0x2DD2, 16);
+  addKey("Blue", Blue_Key, 0xCD32, 16);
+  addKey("Reset", Reset_Key, 0xC738, 16);
+  addKey("Menu +", Up_Key, 0x8778, 16); // menu +
+  addKey("Menu -", Down_Key, 0x07F8, 16); // menu - 
+//  addKey("image", AspectRatio_Key, 0x7788, 16);
+  addKey("Digicon", Guide_Key, 0x47B8, 16);
+}
+
+
+SanyoTV2::SanyoTV2(
+  QObject *guiObject,
+  unsigned int index)
+  : PIRKeysetMetaData(
+      "TV Keyset 2",
+      Sanyo_Make,
+      index)
+{
+  NECProtocol *np = new NECProtocol(
+    guiObject,
+    index,
+    600, 1600,
+    600, 500,
+    40000, false);
+
+  threadableProtocol = np;
+
+  np->setHeaderPair(9000, 4500);
+  np->setTrailerPulse(600);
+  np->setRepeatPair(9000, 2250);
+
+  np->setPreData(0xE31C, 16);
+
+  addKey("POWER", Power_Key, 0xC738, 16);
+  addKey("TV", Unmapped_Key, 0xD728, 16);
+  addKey("WIDE", AspectRatio_Key, 0x3DC2, 16);
+  addKey("1", One_Key, 0x7F80, 16);
+  addKey("2", Two_Key, 0xBF40, 16);
+  addKey("3", Three_Key, 0x3FC0, 16);
+  addKey("4", Four_Key, 0xDF20, 16);
+  addKey("5", Five_Key, 0x5FA0, 16);
+  addKey("6", Six_Key, 0x9F60, 16);
+  addKey("7", Seven_Key, 0x1FE0, 16);
+  addKey("8", Eight_Key, 0xEF10, 16);
+  addKey("9", Nine_Key, 0x6F90, 16);
+  addKey("0", Zero_Key, 0xFF00, 16);
+  addKey("-/--", DoubleDigit_Key, 0xAF50, 16);
+  addKey("CS", Unmapped_Key, 0x2FD0, 16);
+  addKey("SYMBOL_1", Unmapped_Key, 0xE718, 16);
+  addKey("SYMBOL_2", Unmapped_Key, 0x7788, 16);
+  addKey("MUTE", Mute_Key, 0x57A8, 16);
+  addKey("P--P", Unmapped_Key, 0x47B8, 16);
+  addKey("F/OK", Unmapped_Key, 0xA758, 16);
+  addKey("MENU", Menu_Key, 0x758A, 16);
+  addKey("VOL-", VolumeDown_Key, 0x17E8, 16);
+  addKey("VOL+", VolumeUp_Key, 0x9768, 16);
+  addKey("P+", ChannelUp_Key, 0xCF30, 16);
+  addKey("P-", ChannelDown_Key, 0x4FB0, 16);
+  addKey("RED", Red_Key, 0x6D92, 16);
+  addKey("GREEN", Green_Key, 0xAD52, 16);
+  addKey("YELLOW", Yellow_Key, 0x2DD2, 16);
+  addKey("BLUE", Blue_Key, 0xCD32, 16);
+  addKey("SYMBOL_3", Unmapped_Key, 0x6798, 16);
+  addKey("SYMBOL_4", Unmapped_Key, 0x956A, 16);
+  addKey("SYMBOL_5", Unmapped_Key, 0x8D72, 16);
+  addKey("TXT/TV", Unmapped_Key, 0x9D62, 16);
+  addKey("A-B", Language_Key, 0xFD02, 16);
+}
diff --git a/keysets/sanyo.h b/keysets/sanyo.h
new file mode 100644 (file)
index 0000000..c04360e
--- /dev/null
@@ -0,0 +1,32 @@
+#ifndef SANYO_H
+#define SANYO_H
+
+#include "pirkeysetmetadata.h"
+
+#include <QObject>
+
+class SanyoVCR1: public PIRKeysetMetaData
+{
+public:
+  SanyoVCR1(
+    QObject *guiObject,
+    unsigned int index);
+};
+
+class SanyoTV1: public PIRKeysetMetaData
+{
+public:
+  SanyoTV1(
+    QObject *guiObject,
+    unsigned int index);
+};
+
+class SanyoTV2: public PIRKeysetMetaData
+{
+public:
+  SanyoTV2(
+    QObject *guiObject,
+    unsigned int index);
+};
+
+#endif // SANYO_H
diff --git a/keysets/sharp.cpp b/keysets/sharp.cpp
new file mode 100644 (file)
index 0000000..186ce8e
--- /dev/null
@@ -0,0 +1,362 @@
+#include "sharp.h"
+#include "necprotocol.h"
+#include "pirmakenames.h"
+
+SharpTV1::SharpTV1(
+  QObject *guiObject,
+  unsigned int index)
+  : PIRKeysetMetaData(
+      "TV Keyset 1",
+      Sharp_Make,
+      index)
+{
+  NECProtocol *np = new NECProtocol(
+    guiObject,
+    index,
+    350, 650,
+    350, 1650,
+    64000, true);
+
+  threadableProtocol = np;
+
+  np->setTrailerPulse(350);
+
+//  np->setMinimumRepetitions(1);
+
+//  np->setToggleMask(0x3FF);
+
+  addKey("POWER", Power_Key, 0x41A2, 15);
+  addKey("TV/VIDEO", Input_Key, 0x4322, 15);
+  addKey("10+", Unmapped_Key, 0x43D2, 15);
+  addKey("20+", Unmapped_Key, 0x4032, 15);
+  addKey("30+", Unmapped_Key, 0x4232, 15);
+  addKey("40+", Unmapped_Key, 0x43C2, 15);
+  addKey("1", One_Key, 0x4202, 15);
+  addKey("2", Two_Key, 0x4102, 15);
+  addKey("3", Three_Key, 0x4302, 15);
+  addKey("4", Four_Key, 0x4082, 15);
+  addKey("5", Five_Key, 0x4282, 15);
+  addKey("6", Six_Key, 0x4242, 15);
+  addKey("7", Seven_Key, 0x4382, 15);
+  addKey("8", Eight_Key, 0x4042, 15);
+  addKey("9", Nine_Key, 0x4242, 15);
+  addKey("0", Zero_Key, 0x4142, 15);
+  addKey("CH_DOWN", ChannelDown_Key, 0x4122, 15);
+  addKey("CH_UP", ChannelUp_Key, 0x4222, 15);
+  addKey("TIMER", Sleep_Key, 0x4162, 15);
+  addKey("INFO", Info_Key, 0x4362, 15); // "disp_del" "TEXT"
+  addKey("CH_SWAP", PrevChannel_Key, 0x4392, 15); // "FLASHBACK", "ret"
+  addKey("MUTE", Mute_Key, 0x43A2, 15);  // "VOLUME_KILL"
+  addKey("VOL_DOWN", VolumeDown_Key, 0x42A2, 15);
+  addKey("VOL_UP", VolumeUp_Key, 0x40A2, 15);
+  addKey("stereo", Unmapped_Key, 0x40C2, 15); // "VpsPds"
+  addKey("AmPm", Unmapped_Key, 0x40BD, 15);
+  addKey("PROG", Program_Key, 0x42E2, 15);
+  addKey("MONO", Unmapped_Key, 0x40D2, 15);
+  addKey("SOUND_MODE", Unmapped_Key, 0x4062, 15); // I/II/I+II
+//  addKey("SINGLE_DOUBLE", DoubleDigit_Key, 0x42B2, 15);
+  addKey("TELETEXT", Unmapped_Key, 0x40B2, 15);
+  addKey("PICTURE", Unmapped_Key, 0x4132, 15);
+  addKey("REVEAL", Unmapped_Key, 0x4072, 15);
+  addKey("TOP_BOTTOM_FULL", Unmapped_Key, 0x43B2, 15);
+  addKey("HOLD", Unmapped_Key, 0x4332, 15);
+  addKey("TIME", Unmapped_Key, 0x40E2, 15);
+  addKey("RESET", Unmapped_Key, 0x412A, 15);
+  addKey("INDEX", Unmapped_Key, 0x40CA, 15);
+  addKey("COLOR_RED", Red_Key, 0x404A, 15);
+  addKey("COLOR_GREEN", Green_Key, 0x424A, 15);
+  addKey("COLOR_YELLOW", Yellow_Key, 0x414A, 15);
+  addKey("COLOR_BLUE", Blue_Key, 0x434A, 15);
+  addKey("BROWSE", Unmapped_Key, 0x43D2, 15);
+  addKey("BALANCE_LEFT", Unmapped_Key, 0x435A, 15);
+  addKey("BALANCE_RIGHT", Unmapped_Key, 0x40DA, 15);
+  addKey("TREBLE_DOWN", Unmapped_Key, 0x431A, 15);
+  addKey("TREBLE_UP", Unmapped_Key, 0x411A, 15);
+  addKey("BASS_DOWN", Unmapped_Key, 0x429A, 15);
+  addKey("BASS_UP", Unmapped_Key, 0x409A, 15);
+  addKey("WOOFER_DOWN", Unmapped_Key, 0x439A, 15);
+  addKey("WOOFER_UP", Unmapped_Key, 0x419A, 15);
+  addKey("PICTURE_NORMALIZE", Unmapped_Key, 0x4212, 15);
+  addKey("SOUND_NORMALIZE", Unmapped_Key, 0x4192, 15);
+  addKey("COLOR_DOWN", Unmapped_Key, 0x4292, 15);
+  addKey("COLOR_UP", Unmapped_Key, 0x4092, 15);
+  addKey("CONTRAST_DOWN", Unmapped_Key, 0x4312, 15);
+  addKey("CONTRAST_UP", Unmapped_Key, 0x4112, 15);
+  addKey("BRIGHTNESS_DOWN", Unmapped_Key, 0x4152, 15);
+  addKey("BRIGHTNESS_UP", Unmapped_Key, 0x4252, 15);
+  addKey("PROGRAM", Program_Key, 0x41B2, 15);
+  addKey("calendar", Unmapped_Key, 0x41BA, 15);
+  addKey("program_timer", Unmapped_Key, 0x4262, 15); // "on_timer"
+  addKey("message", Unmapped_Key, 0x4372, 15);
+  addKey("language", Language_Key, 0x407A, 15);
+  addKey("100", PlusOneHundred_Key, 0x4342, 15);
+  addKey("p/c", Unmapped_Key, 0x42F2, 15);
+  addKey("pr", Unmapped_Key, 0x420A, 15);
+  addKey("PICTURE", PictureMode_Key, 0x401A, 15);
+  addKey("SOUND", SoundMode_Key, 0x421A, 15);
+  addKey("FUNCTIONS", Unmapped_Key, 0x43EA, 15);
+  addKey("MENU", Menu_Key, 0x42CA, 15);
+  addKey("LOCK", Unmapped_Key, 0x422A, 15);
+  addKey("./..", DoubleDigit_Key, 0x40F2, 15); // "dual"
+  addKey("NR", Unmapped_Key, 0x4022, 15);
+  addKey("BACKLIGHT", Unmapped_Key, 0x3F46, 15); // "OPC"
+  addKey("ROTATE", Unmapped_Key, 0x3CC6, 15);
+  addKey("AV-", Unmapped_Key, 0x473A, 15); // reverse-direction input 
+  addKey("BT_END", Unmapped_Key, 0x42BE, 15);
+  addKey("SUBTITLE", Captions_Key, 0x3FE6, 15);
+  addKey("SUBPAGE", Unmapped_Key, 0x3ECE, 15);
+  addKey("DTV", Unmapped_Key, 0x4416, 15);
+  addKey("EPG", Guide_Key, 0x44E9, 15);
+  addKey("ESG", Unmapped_Key, 0x4796, 15);
+  addKey("RADIO", Unmapped_Key, 0x4496, 15);
+  addKey("AV_MODE", Unmapped_Key, 0x407E, 15);
+  addKey("SURROUND", Surround_Key, 0x41DA, 15);
+  addKey("DTV_MENU", Unmapped_Key, 0x4616, 15);
+  addKey("LIST", Unmapped_Key, 0x4516, 15);
+  addKey("TRUD", Unmapped_Key, 0x46EE, 15);
+  addKey("WIDE_MODES", AspectRatio_Key, 0x444E, 15);
+  addKey("ACTION", Unmapped_Key, 0x467E, 15);
+}
+
+
+SharpTV1a::SharpTV1a(
+  QObject *guiObject,
+  unsigned int index)
+  : SharpTV1(guiObject, index)
+{
+  setKeysetName("TV Keyset 1a");
+
+  addKey("Input", Input_Key, 0x40B2, 15);
+  addKey("Time", Sleep_Key, 0x41C2, 15);
+  addKey("Stop", Stop_Key, 0x4392, 15);
+  addKey("REC", Record_Key, 0x4052, 15);
+  addKey("Pause", Pause_Key, 0x4292, 15);
+  addKey("Play", Play_Key, 0x4112, 15);
+  addKey("REW", Rewind_Key, 0x4312, 15);
+  addKey("FF", FastForward_Key, 0x4212, 15);
+  addKey("TapeSpeed", VHSSpeed_Key, 0x43E2, 15);
+  addKey("ZeroBack", Unmapped_Key, 0x4306, 15);
+  addKey("Replay", Replay_Key, 0x43DD, 15);
+  addKey("SkipSearch", Advance_Key, 0x4026, 15);
+  addKey("Slow", Unmapped_Key, 0x4252, 15);
+  addKey("DPSS-", Unmapped_Key, 0x4032, 15);
+  addKey("DPSS+", Unmapped_Key, 0x43D2, 15);
+  addKey("Key", Unmapped_Key, 0x42C2, 15);
+}
+
+
+SharpTV1b::SharpTV1b(
+  QObject *guiObject,
+  unsigned int index)
+  : SharpTV1(guiObject, index)
+{
+  setKeysetName("TV Keyset 1b");
+
+  addKey("chScan", Scan_Key, 0x40E2, 15);
+  addKey("video", Input_Key, 0x424A, 15);
+  addKey("minus", Down_Key, 0x402A, 15); // "DOWN"
+  addKey("plus", Up_Key, 0x43CA, 15); // "UP"
+  addKey("setup", Menu_Key, 0x4012, 15);
+  addKey("fback_clr", Unmapped_Key, 0x43D2, 15);
+  addKey("FINE_TUNING", Unmapped_Key, 0x41C2, 15);
+  addKey("TIMER", Unmapped_Key, 0x432A, 15);
+  addKey("BLUE_BACK", Unmapped_Key, 0x4372, 15);
+  addKey("SKIP", Unmapped_Key, 0x438A, 15);
+  addKey("SYSTEM_SOUND", Unmapped_Key, 0x43DA, 15);
+  addKey("SYSTEM_COLOUR", Unmapped_Key, 0x423A, 15);
+}
+
+
+SharpTV1c::SharpTV1c(
+  QObject *guiObject,
+  unsigned int index)
+  : SharpTV1(guiObject, index)
+{
+  setKeysetName("TV Keyset 1c");
+
+  addKey("save_ch", Unmapped_Key, 0x420A, 15);
+  addKey("del_ch", Unmapped_Key, 0x42F2, 15);
+}
+
+
+SharpTV1d::SharpTV1d(
+  QObject *guiObject,
+  unsigned int index)
+  : SharpTV1(guiObject, index)
+{
+  setKeysetName("TV Keyset 1d");
+
+  addKey("P-MODE", PictureMode_Key, 0x42CA, 15);
+  addKey("S-MODE", SoundMode_Key, 0x4192, 15);
+}
+
+
+SharpTV1e::SharpTV1e(
+  QObject *guiObject,
+  unsigned int index)
+  : SharpTV1(guiObject, index)
+{
+  setKeysetName("TV Keyset 1e");
+
+  addKey("UP", Up_Key, 0x43AA, 15);
+  addKey("LEFT", Left_Key, 0x43AE, 15);
+  addKey("OK", Select_Key, 0x412A, 15);
+  addKey("RIGHT", Right_Key, 0x406E, 15);
+  addKey("DOWN", Down_Key, 0x4012, 15);
+  addKey("MENU", Menu_Key, 0x458E, 15);
+  addKey("RETURN", Exit_Key, 0x409E, 15);
+}
+
+
+SharpVCR1::SharpVCR1(
+  QObject *guiObject,
+  unsigned int index)
+  : PIRKeysetMetaData(
+      "VCR Keyset 1",
+      Sharp_Make,
+      index)
+{
+  NECProtocol *np = new NECProtocol(
+    guiObject,
+    index,
+    400, 600,
+    400, 1700,
+    64000, true);
+
+  threadableProtocol = np;
+
+  np->setTrailerPulse(400);
+
+//  np->setMinimumRepetitions(1);
+
+//  np->setToggleMask(0x3FF);
+
+  addKey("Power", Power_Key, 0x61A2, 15);
+  addKey("1", One_Key, 0x6202, 15);
+  addKey("2", Two_Key, 0x6102, 15);
+  addKey("3", Three_Key, 0x6302, 15);
+  addKey("4", Four_Key, 0x6082, 15);
+  addKey("5", Five_Key, 0x6282, 15);
+  addKey("6", Six_Key, 0x6182, 15);
+  addKey("7", Seven_Key, 0x6382, 15);
+  addKey("8", Eight_Key, 0x6042, 15);
+  addKey("9", Nine_Key, 0x6242, 15);
+  addKey("0", Zero_Key, 0x6142, 15);
+  addKey("Play", Play_Key, 0x6112, 15);
+  addKey("Stop", Stop_Key, 0x6392, 15);
+  addKey("Rec", Record_Key, 0x6052, 15);
+  addKey("Pause", Pause_Key, 0x6292, 15);
+  addKey("FF", FastForward_Key, 0x6212, 15);
+  addKey("Rew", Rewind_Key, 0x6312, 15);
+  addKey("./..", DoubleDigit_Key, 0x6342, 15);
+  addKey("InputSelect", Input_Key, 0x60B2, 15); // "simul"
+  addKey("ChnUp", ChannelUp_Key, 0x6222, 15);
+  addKey("ChnDn", ChannelDown_Key, 0x6122, 15);
+  addKey("Display", Info_Key, 0x60C6, 15);
+  addKey("ModeOsd", Unmapped_Key, 0x62C6, 15);
+  addKey("TV/VCR", Unmapped_Key, 0x6322, 15);
+  addKey("Menu", Menu_Key, 0x6066, 15);
+  addKey("Set", Select_Key, 0x6166, 15);
+  addKey("SV/V+/Timer", Unmapped_Key, 0x600E, 15);
+  addKey("Clear", Clear_Key, 0x6012, 15);
+  addKey("TimerOn/Off", Unmapped_Key, 0x6262, 15);
+  addKey("AudioOut", Surround_Key, 0x6062, 15);
+  addKey("SkipSearch", Unmapped_Key, 0x6026, 15);
+  addKey("ZeroBack", Unmapped_Key, 0x6306, 15);  // "MEMORY"
+  addKey("TapeSpeed", VHSSpeed_Key, 0x63E2, 15);
+  addKey("Slow", Unmapped_Key, 0x6252, 15);
+  addKey("DPSS-", Unmapped_Key, 0x6032, 15); // "slow-"
+  addKey("DPSS+", Unmapped_Key, 0x63D2, 15); // "slow+"
+  addKey("Key", Unmapped_Key, 0x62C2, 15);  // "C-LOCK", "tamper_proof"
+  addKey("Left", Left_Key, 0x62E6, 15);
+  addKey("Right", Right_Key, 0x6366, 15);
+  addKey("Up", Up_Key, 0x6266, 15);
+  addKey("Dn", Down_Key, 0x60E6, 15);
+  addKey("EJECT", Eject_Key, 0x6332, 15);
+  addKey("MUTE", Mute_Key, 0x63A2, 15);
+  addKey("PROG", Program_Key, 0x62E2, 15);
+  addKey("TRACKING_DOWN", TrackingMinus_Key, 0x6186, 15);
+  addKey("TRACKING_UP", TrackingPlus_Key, 0x6286, 15);
+  addKey("CLOCK", Unmapped_Key, 0x60D2, 15);
+  addKey("SEARCH", Unmapped_Key, 0x63B2, 15);
+  addKey("TIME", Unmapped_Key, 0x61C2, 15);
+  addKey("REC_TIME", Unmapped_Key, 0x63C2, 15); // "TIME-0"
+  addKey("F.ADV", Unmapped_Key, 0x6092, 15);
+  addKey("SHUTTLE0", Unmapped_Key, 0x61D6, 15);
+  addKey("SHUTTLE-1", Unmapped_Key, 0x6256, 15);
+  addKey("SHUTTLE-2", Unmapped_Key, 0x6356, 15);
+  addKey("SHUTTLE+1", Unmapped_Key, 0x6016, 15);
+  addKey("SHUTTLE+2", Unmapped_Key, 0x6116, 15);
+  addKey("SHUTTLE+3", Unmapped_Key, 0x6096, 15);
+  addKey("SHUTTLE+4", Unmapped_Key, 0x6196, 15);
+  addKey("SHUTTLE+5", Unmapped_Key, 0x6056, 15);
+  addKey("SHUTTLE+6", Unmapped_Key, 0x6156, 15);
+  addKey("repeat", Unmapped_Key, 0x6022, 15);
+  addKey("osp", Unmapped_Key, 0x60E2, 15);
+  addKey("vps", Unmapped_Key, 0x60C2, 15);
+  addKey("x2", Unmapped_Key, 0x6232, 15);
+  addKey("100", PlusOneHundred_Key, 0x6046, 15);
+  addKey("cancel", Unmapped_Key, 0x6086, 15);  // could be exit key
+}
+
+
+SharpReceiver1::SharpReceiver1(
+  QObject *guiObject,
+  unsigned int index)
+  : PIRKeysetMetaData(
+      "Receiver Keyset 1",
+      Sharp_Make,
+      index)
+{
+  NECProtocol *np = new NECProtocol(
+    guiObject,
+    index,
+    350, 650,
+    350, 1650,
+    67000, true);
+
+  threadableProtocol = np;
+
+  np->setTrailerPulse(350);
+
+//  np->setMinimumRepetitions(9);
+
+  addKey("POWER", Power_Key, 0x25A2, 15);
+  addKey("X-BASS", Unmapped_Key, 0x25D2, 15);
+  addKey("VOL-", VolumeDown_Key, 0x26A2, 15);
+  addKey("VOL+", VolumeUp_Key, 0x24A2, 15);
+  addKey("CD", Unmapped_Key, 0x2762, 15);
+  addKey("TUNER", Unmapped_Key, 0x2662, 15);
+  addKey("TAPE", Unmapped_Key, 0x2562, 15);
+  addKey("PHONO", Unmapped_Key, 0x26E2, 15);
+  addKey("FM", Unmapped_Key, 0x2532, 15);
+  addKey("MW", Unmapped_Key, 0x24B2, 15);
+  addKey("SW", Unmapped_Key, 0x254E, 15);
+  addKey("LW", Unmapped_Key, 0x2732, 15);
+  addKey("PRESET-", Unmapped_Key, 0x2522, 15);
+  addKey("PRESET+", Unmapped_Key, 0x2622, 15);
+  addKey("1", One_Key, 0x1602, 15);
+  addKey("2", Two_Key, 0x1502, 15);
+  addKey("3", Three_Key, 0x1702, 15);
+  addKey("4", Four_Key, 0x1482, 15);
+  addKey("5", Five_Key, 0x1682, 15);
+  addKey("6", Six_Key, 0x1582, 15);
+  addKey("7", Seven_Key, 0x1782, 15);
+  addKey("8", Eight_Key, 0x1442, 15);
+  addKey("9", Nine_Key, 0x1642, 15);
+  addKey("0", Zero_Key, 0x1542, 15);
+  addKey("+10", DoubleDigit_Key, 0x1472, 15);
+  addKey("MEMORY", Unmapped_Key, 0x1722, 15);
+  addKey("REPEAT", Unmapped_Key, 0x15B2, 15);
+  addKey("STOP", Stop_Key, 0x146D, 15);
+  addKey("PAUSE", Pause_Key, 0x1692, 15);
+  addKey("PLAY", Play_Key, 0x1512, 15);
+  addKey("REVIEW", Rewind_Key, 0x1562, 15);
+  addKey("CUE", FastForward_Key, 0x1662, 15);
+  addKey("APSS-", Unmapped_Key, 0x1712, 15);
+  addKey("APSS+", Unmapped_Key, 0x1612, 15);
+  addKey("CLEAR", Clear_Key, 0x1522, 15);
+  addKey("CALL", Unmapped_Key, 0x1622, 15);
+  addKey("TIME_DISPLAY", Unmapped_Key, 0x1762, 15);
+  addKey("RANDOM", Unmapped_Key, 0x15E2, 15);
+}
diff --git a/keysets/sharp.h b/keysets/sharp.h
new file mode 100644 (file)
index 0000000..cf0cf1e
--- /dev/null
@@ -0,0 +1,73 @@
+#ifndef SHARP_H
+#define SHARP_H
+
+#include "pirkeysetmetadata.h"
+
+#include <QObject>
+
+class SharpTV1: public PIRKeysetMetaData
+{
+public:
+  SharpTV1(
+    QObject *guiObject,
+    unsigned int index);
+};
+
+class SharpTV1a: public SharpTV1
+{
+public:
+  SharpTV1a(
+    QObject *guiObject,
+    unsigned int index);
+};
+
+class SharpTV1b: public SharpTV1
+{
+public:
+  SharpTV1b(
+    QObject *guiObject,
+    unsigned int index);
+};
+
+class SharpTV1c: public SharpTV1
+{
+public:
+  SharpTV1c(
+    QObject *guiObject,
+    unsigned int index);
+};
+
+class SharpTV1d: public SharpTV1
+{
+public:
+  SharpTV1d(
+    QObject *guiObject,
+    unsigned int index);
+};
+
+class SharpTV1e: public SharpTV1
+{
+public:
+  SharpTV1e(
+    QObject *guiObject,
+    unsigned int index);
+};
+
+class SharpVCR1: public PIRKeysetMetaData
+{
+public:
+  SharpVCR1(
+    QObject *guiObject,
+    unsigned int index);
+};
+
+
+class SharpReceiver1: public PIRKeysetMetaData
+{
+public:
+  SharpReceiver1(
+    QObject *guiObject,
+    unsigned int index);
+};
+
+#endif // SHARP_H
diff --git a/keysets/sony.cpp b/keysets/sony.cpp
new file mode 100644 (file)
index 0000000..bb87e21
--- /dev/null
@@ -0,0 +1,977 @@
+#include "sony.h"
+#include "necprotocol.h"
+
+
+SonyTV1::SonyTV1(
+  QObject *guiObject,
+  unsigned int index)
+  : PIRKeysetMetaData(
+      "TV Keyset 1",
+      Sony_Make,
+      index)
+{
+  addControlledDevice(Sony_Make, "Trinitron KDW-25", TV_Device);
+
+  NECProtocol *np = new NECProtocol(
+    guiObject,
+    index,
+    600, 600,
+    1200, 600,
+    45000, true);
+
+  threadableProtocol = np;
+
+  np->setHeaderPair(2400, 600);
+
+  np->setMinimumRepetitions(2);
+
+  //np->setCarrierFrequency(40000);
+  //np->setDutyCycle(33);
+
+  addKey("MUTE", Mute_Key, 0x290, 12); // 0x148
+  addKey("POWER", Power_Key, 0xA90, 12); // 0x548
+  addKey("TV-RETURN", Unmapped_Key, 0x1D0, 12); // teletext 0x0E8, also "analog"
+  addKey("TELETXT", Unmapped_Key, 0xFD0, 12);   // teletext 0x7E8
+  addKey("tv/video", Input_Key, 0xA50, 12); // 0x528
+  addKey("1", One_Key, 0x010, 12);   // 0x008
+  addKey("2", Two_Key, 0x810, 12);   // 0x408
+  addKey("3", Three_Key, 0x410, 12); // 0x208
+  addKey("4", Four_Key, 0xC10, 12);  // 0x608
+  addKey("5", Five_Key, 0x210, 12);  // 0x108
+  addKey("6", Six_Key, 0xA10, 12);   // 0x508
+  addKey("7", Seven_Key, 0x610, 12); // 0x308
+  addKey("8", Eight_Key, 0xE10, 12); // 0x708
+  addKey("9", Nine_Key, 0x110, 12);  // 0x088
+  addKey("0", Zero_Key, 0x910, 12);  // 0x488
+  addKey("?/INFO", Info_Key, 0x5D0, 12); // 0x2E8
+  addKey("-/--", DoubleDigit_Key, 0xB90, 12); // 0x5C8
+  addKey("OK", Select_Key, 0xA70, 12); // 0x538
+//  addKey("OK", Enter_Key, 0xA70, 12); // 0x538
+  addKey("MENU", Menu_Key, 0x070, 12); //0x038
+  addKey("UP/GREEN", Up_Key, 0xB38, 12); // 0x59C
+  addKey("DOWN/BLUE", Down_Key, 0xF38, 12); // 0x79C
+  addKey("RIGHT/+/YELLOW", Right_Key, 0x738, 12); // 0x39C
+  addKey("LEFT/-/RED", Left_Key, 0x338, 12); // 0x19C
+  addKey("LEFT/-/RED", Red_Key, 0x338, 12); // 0x19C
+  addKey("UP/GREEN", Green_Key, 0xB38, 12); // 0x59C
+  addKey("RIGHT/+/YELLOW", Yellow_Key, 0x738, 12); //0x39C
+  addKey("DOWN/BLUE", Blue_Key, 0xF38, 12); // 0x79C
+  addKey("VOLUME+", VolumeUp_Key, 0x490, 12); // 0x248
+  addKey("VOLUME-", VolumeDown_Key, 0xC90, 12); // 0x648
+  addKey("CHANNEL/PAGE+", ChannelUp_Key, 0x090, 12); // 0x048
+  addKey("CHANNEL/PAGE-", ChannelDown_Key, 0x890, 12); // 0x448
+  addKey("prev_ch", PrevChannel_Key, 0xDD0, 12); // 0x6E8 "jump", "refresh", "toggle"
+  addKey("1-", Unmapped_Key, 0x310, 12);
+  addKey("2-", Unmapped_Key, 0xB10, 12);
+  addKey("sleep", Sleep_Key, 0x6D0, 12); // 0x368
+  addKey("select", Unmapped_Key, 0x3F0, 12); // 0x1F8
+  addKey("normalise", Unmapped_Key, 0x690, 12); // 0x348 "reset"
+  addKey("C", Clear_Key, 0x710, 12); // 0x388
+  addKey("output", Unmapped_Key, 0x670, 12);  // 0x338
+  addKey("a/b", Language_Key, 0xE90, 12); // 0x748  "mts", "sap", "audio", "language"
+  addKey("stereo", Surround_Key, 0x950, 12); // Might be wrong
+  addKey("subtitles", Captions_Key, 0xD38, 12);
+  addKey("expand", Unmapped_Key, 0x938, 12);
+  addKey("shrink", Unmapped_Key, 0x538, 12);
+  addKey("favourite", Unmapped_Key, 0x530, 12);
+  addKey("setup", Program_Key, 0x370, 12);
+  addKey("tune_down", Unmapped_Key, 0xF70, 12);
+  addKey("tune_up", Unmapped_Key, 0x770, 12);
+  addKey("diamond", Unmapped_Key, 0x1F0, 12); // 0x0F8 "add"
+  addKey("asterisk", Unmapped_Key, 0x170, 12);
+  addKey("C00", Unmapped_Key, 0xF10, 12);
+  addKey("bucket", Unmapped_Key, 0x150, 12);
+  addKey("vt_inf", Unmapped_Key, 0x138, 12); // teletext info
+//  addKey("vt_dots", Unmapped_Key, 0xD38, 12); // teletext
+  addKey("time", Unmapped_Key, 0xD50, 12); // 0x6A8 teletext?
+  addKey("timer/block", Unmapped_Key, 0x0D0, 12); // 0x068
+  addKey("off/repeat", Unmapped_Key, 0x3D0, 12); // 0x1E8
+  addKey("cable", Unmapped_Key, 0x730, 12); // 0x398
+  addKey("auto_program", Unmapped_Key, 0xD70, 12); // 0x6B8
+  addKey("erase", Unmapped_Key, 0x9F0, 12); // 0x4F8
+  addKey("picture_up", Unmapped_Key, 0x190, 12); // 0x0C8
+  addKey("picture_down", Unmapped_Key, 0x990, 12); // 0x4C8
+  addKey("PIP", PIP_Key, 0xDB0, 12); // 0x6D8
+  addKey("PIP_SWAP", PIPSwap_Key, 0xFB0, 12); // 0x7D8
+  addKey("PIP_POSITION", PIPMove_Key, 0x7B0, 12); // 0x3D8
+  addKey("PIP_SOURCE", PIPSource_Key, 0xE70, 12); // 0x738
+  addKey("pip_ch+", PIPChannelUp_Key, 0x1B0, 12);
+  addKey("pip_ch-", PIPChannelDown_Key, 0x9B0, 12);
+  addKey("pipfreeze", Unmapped_Key, 0x3B0, 12);
+  addKey("piptv_video", Unmapped_Key, 0x5B0, 12);
+  addKey("Sat", Unmapped_Key, 0x8B0, 12); // 0x458
+  addKey("Settup_V", Unmapped_Key, 0x870, 12); // 0x438
+  addKey("Settup_A", Unmapped_Key, 0x470, 12); // 0x238
+  addKey("EXIT", Exit_Key, 0xC70, 12);
+  addKey("enter", Enter_Key, 0xD10, 12); // 0x688
+  addKey("picturemode", Unmapped_Key, 0x270, 12); // 0x138
+  addKey("ANT", Unmapped_Key, 0x550, 12);
+
+  addKey("16:9", AspectRatio_Key, 0x5E25, 15); // "WIDE"
+  addKey("DIGITAL", Unmapped_Key, 0x25EE, 15);
+  addKey("EPG", Guide_Key, 0x6D25, 15);
+  addKey("RETURN", Unmapped_Key, 0x62E9, 15);
+  addKey("TOOLS", Unmapped_Key, 0x36E9, 15);
+  addKey("theatre", Unmapped_Key, 0x03EE, 15);
+  addKey("SYNC_MENU", Unmapped_Key, 0x0D58, 15);
+  addKey("PREVIOUS", Previous_Key, 0x1EE9, 15);
+  addKey("STOP", Stop_Key, 0x0CE9, 15);
+  addKey("NEXT", Next_Key, 0x5EE9, 15);
+  addKey("I-MANUAL", Unmapped_Key, 0x6F58, 15);
+  addKey("SCENE", Unmapped_Key, 0x0F58, 15);
+  addKey("DIGITAL_ANALOG", Unmapped_Key, 0x58EE, 15);
+  addKey("FBACKWARD", Rewind_Key, 0x6CE9, 15);
+  addKey("PLAY", Play_Key, 0x2CE9, 15);
+  addKey("FFORWARD", FastForward_Key, 0x1CE9, 15);
+  addKey("INTERNET_VIDEO", Unmapped_Key, 0x4F58, 15);
+  addKey("FAVORITES", Unmapped_Key, 0x37EE, 15);
+  addKey("OPTIONS", Unmapped_Key, 0x36E9, 15);
+  addKey("PIP_Audio", Unmapped_Key, 0x1F25, 15);
+  addKey("Surround_Mode", Unmapped_Key, 0x7C25, 15);
+  addKey("DOT", Unmapped_Key, 0x5CE9, 15);
+  addKey("SOUND", Unmapped_Key, 0x6FE9, 15);
+  addKey("REPLAY", Replay_Key, 0x4FE9, 15);
+  addKey("ADVANCE", Advance_Key, 0x0FE9, 15);
+  addKey("PAUSE", Pause_Key, 0x4CE9, 15);
+}
+
+
+SonyTV1a::SonyTV1a(
+  QObject *guiObject,
+  unsigned int index)
+  : SonyTV1(guiObject, index)
+{
+  setKeysetName("TV Keyset 1a");
+
+  addControlledDevice(Sony_Make, "Trinitron KV-2184MT", TV_Device);
+  addControlledDevice(Sony_Make, "KV-M1420D", TV_Device);
+  addControlledDevice(Sony_Make, "KV-20FV10", TV_Device);
+  addControlledDevice(Sony_Make, "KV-27FX210", TV_Device);
+  addControlledDevice(Sony_Make, "KV-32FS210", TV_Device);
+  addControlledDevice(Sony_Make, "KV-36FS210", TV_Device);
+  addControlledDevice(Sony_Make, "KV-36FS13", TV_Device);
+  addControlledDevice(Sony_Make, "KDL-52X2000", TV_Device);
+  addControlledDevice(Sony_Make, "KDL-46X2000", TV_Device);
+  addControlledDevice(Sony_Make, "KDL-40X2000", TV_Device);
+
+  // Overwrite directional keys:
+  addKey("up", Up_Key, 0x2F0, 12); // 0x178
+  addKey("down", Down_Key, 0xAF0, 12); // 0x578
+  addKey("left", Left_Key, 0x2D0, 12); // 0x168
+  addKey("right", Right_Key, 0xCD0, 12); // 0x668
+}
+
+
+SonyTV1b::SonyTV1b(
+  QObject *guiObject,
+  unsigned int index)
+  : SonyTV1(guiObject, index)
+{
+  setKeysetName("TV Keyset 1b");
+
+  addKey("clear", Unmapped_Key, 0x2D0, 12); // 0x168
+  addKey("level_plus", Unmapped_Key, 0x2F0, 12); // 0x178
+  addKey("level_minus", Unmapped_Key, 0xAF0, 12); // 0x578
+  addKey("am/pm", Unmapped_Key, 0xCD0, 12); // 0x668
+}
+
+
+/*
+SonyTV1c::SonyTV1c(
+  QObject *guiObject,
+  unsigned int index)
+  : SonyTV1(guiObject, index)
+{
+  setKeysetName("TV Keyset 1c");
+
+  addKey("pip_move", PIPPosition_Key, 0x7B0, 12);
+  addKey("pip_swap", PIPSwap_Key, 0xFB0, 12);
+  addKey("pip_ch+", PIPChannelUp_Key, 0x1B0, 12);
+  addKey("pip_ch-", PIPChannelDown_Key, 0x9B0, 12);
+}
+*/
+
+
+// Note, deeper inheritance on this one:
+SonyTV1d::SonyTV1d(
+  QObject *guiObject,
+  unsigned int index)
+  : SonyTV1a(guiObject, index)
+{
+  setKeysetName("TV Keyset 1d");
+
+  addKey("play", Play_Key, 0xFB0, 12);
+  addKey("<<", Rewind_Key, 0x9B0, 12);
+  addKey(">>", FastForward_Key, 0x1B0, 12);
+  addKey("pause", Pause_Key, 0x3B0, 12);
+  addKey("stop", Stop_Key, 0x7B0, 12);
+  addKey("rec", Record_Key, 0x5B0, 12);
+
+  addKey("RED", Red_Key, 0x52E9, 15);
+  addKey("GREEN", Green_Key, 0x32E9, 15);
+  addKey("YELLOW", Yellow_Key, 0x72E9, 15);
+  addKey("BLUE", Blue_Key, 0x12E9, 15);
+  addKey("SUBTITLES", Captions_Key, 0x0AE9, 15); // this might be wrong
+}
+
+
+/*
+SonyTV2::SonyTV2(
+  QObject *guiObject,
+  unsigned int index)
+  : PIRKeysetMetaData(
+      "TV Keyset 2",
+      Sony_Make,
+      index)
+{
+  NECProtocol *np = new NECProtocol(
+    guiObject,
+    index,
+    1262, 515,
+    661, 515,
+    26187, false);
+
+  threadableProtocl = np;
+
+  np->setHeaderPair(2470, 515);
+  np->setTrailer(661);
+
+  addKey("MUTE", Mute_Key, 0x6B7, 11);
+  addKey("ON/STANDBY", Power_Key, 0x2B7, 11);
+  addKey("TV", Unmapped_Key, 0x717, 11); // teletext
+  addKey("TELETEXT", Unmapped_Key, 0x017, 11); // teletext
+  addKey("INPUT", Input_Key, 0x2D7, 11);
+  addKey("OUTPUT", Unmapped_Key, 0x4C7, 11);
+  addKey("1", One_Key, 0x7F7, 11);
+  addKey("2", Two_Key, 0x3F7, 11);
+  addKey("3", Three_Key, 0x5F7, 11);
+  addKey("4", Four_Key, 0x1F7, 11);
+  addKey("5", Five_Key, 0x6F7, 11);
+  addKey("6", Six_Key, 0x2F7, 11);
+  addKey("7", Seven_Key, 0x4F7, 11);
+  addKey("8", Eight_Key, 0x0F7, 11);
+  addKey("9", Nine_Key, 0x777, 11);
+  addKey("0", Zero_Key, 0x377, 11);
+  addKey("-/--", DoubleDigit_Key, 0x237, 11);
+  addKey("C", Clear_Key, 0x477, 11);
+  addKey("PIP", PIP_Key, 0x127, 11);
+  addKey("PIP_POSITION", PIPPosition_Key, 0x427, 11);
+  addKey("PIP_SWAP", PIPSwap_Key, 0x027, 11);
+  addKey("PIP_SOURCE", PIPSource_Key, 0x0C7, 11);
+  addKey("RED", Red_Key, 0x663, 11);
+  addKey("GREEN", Green_Key, 0x263, 11);
+  addKey("YELLOW", Yellow_Key, 0x463, 11);
+  addKey("BLUE", Blue_Key, 0x063, 11);
+  addKey("TELETEXT_HOLD", Unmapped_Key, 0x563, 11);
+  addKey("INFO", Info_Key, 0x517, 11);
+  addKey("SAT", Unmapped_Key, 0x3A7, 11);
+  addKey("VOLUME+", VolumeUp_Key, 0x5B7, 11);
+  addKey("VOLUME-", VolumeDown_Key, 0x1B7, 11);
+  addKey("PROGR+", ChannelUp_Key, 0x7B7, 11);
+  addKey("PROGR-", ChannelDown_Key, 0x3B7, 11);
+  addKey("PICTURE", Unmapped_Key, 0x3C7, 11);
+  addKey("SOUND", Unmapped_Key, 0x5C7, 11);
+  addKey("MENU", Menu_Key, 0x7C7, 11);
+  addKey("BACK", Left_Key, 0x697, 11);
+  addKey("UP", Up_Key, 0x687, 11);
+  addKey("DOWN", Down_Key, 0x287, 11);
+  addKey("OK", Enter_Key, 0x2C7, 11);
+  addKey("OK", Select_Key, 0x2C7, 11);
+  addKey("RGB1", Unmapped_Key, 0x1E7, 11);
+  addKey("RGB2", Unmapped_Key, 0x6E7, 11);
+  addKey("Line", Unmapped_Key, 0x7E7, 11);
+  addKey("Y-C", Unmapped_Key, 0x267, 11);
+  addKey("MTS-MPX", Unmapped_Key, 0x0B7, 11);
+  addKey("Still", Unmapped_Key, 0x627, 11);
+  addKey("PowerOn", Unmapped_Key, 0x457, 11);
+  addKey("PowerOff", Unmapped_Key, 0x057, 11);
+}
+*/
+
+
+SonyAmp1::SonyAmp1(
+  QObject *guiObject,
+  unsigned int index)
+  : PIRKeysetMetaData(
+      "Amp Keyset 1",
+      Sony_Make,
+      index)
+{
+  NECProtocol *np = new NECProtocol(
+    guiObject,
+    index,
+    600, 600,
+    1200, 600,
+    25000, false);
+
+  threadableProtocol = np;
+
+  np->setHeaderPair(2400, 600);
+
+  np->setPostData(0xC, 6);
+
+  np->setMinimumRepetitions(2);
+
+  addKey("VIDEO1", Unmapped_Key, 0x22, 7);
+  addKey("VIDEO2", Unmapped_Key, 0x3C, 7);
+  addKey("VIDEO3", Unmapped_Key, 0x21, 7);
+  addKey("VIDEO4", Unmapped_Key, 0x61, 7);
+  addKey("DVD", Unmapped_Key, 0x5F, 7);
+  addKey("LD", Unmapped_Key, 0x4C, 7);
+  addKey("TV2", Unmapped_Key, 0x2B, 7);
+  addKey("TV", Unmapped_Key, 0x0C, 7);
+  addKey("MD", Unmapped_Key, 0x4B, 7);
+  addKey("TAPE", Unmapped_Key, 0x62, 7);
+  addKey("DAT", Unmapped_Key, 0x31, 7);
+  addKey("CD", Unmapped_Key, 0x52, 7);
+  addKey("TUNER", Unmapped_Key, 0x42, 7);
+  addKey("PHONO", Unmapped_Key, 0x02, 7);
+  addKey("DIGITAL", Unmapped_Key, 0x11, 7);
+  addKey("5.1CH", Unmapped_Key, 0x27, 7);
+  addKey("VOL+", VolumeUp_Key, 0x24, 7);
+  addKey("VOL-", VolumeDown_Key, 0x64, 7);
+  addKey("MUTE", Mute_Key, 0x14, 7);
+  addKey("POWER", Power_Key, 0x54, 7);
+  addKey("SLEEP", Sleep_Key, 0x03, 7);
+  addKey("1", One_Key, 0x00, 7);
+  addKey("2", Two_Key, 0x40, 7);
+  addKey("3", Three_Key, 0x20, 7);
+  addKey("4", Four_Key, 0x60, 7);
+  addKey("5", Five_Key, 0x10, 7);
+  addKey("6", Six_Key, 0x50, 7);
+  addKey("7", Seven_Key, 0x30, 7);
+  addKey("8", Eight_Key, 0x70, 7);
+  addKey("9", Nine_Key, 0x08, 7);
+  addKey("0", Zero_Key, 0x48, 7);
+  addKey("ENTER", Enter_Key, 0x68, 7);
+}
+
+
+SonyAmp2::SonyAmp2(
+  QObject *guiObject,
+  unsigned int index)
+  : PIRKeysetMetaData(
+      "Amp Keyset 2",
+      Sony_Make,
+      index)
+{
+  NECProtocol *np = new NECProtocol(
+    guiObject,
+    index,
+    600, 600,
+    1200, 600,
+    44737, true);
+
+  threadableProtocol = np;
+
+  np->setHeaderPair(2400, 600);
+
+  np->setMinimumRepetitions(2);
+
+  addKey("power_on", Unmapped_Key, 0x741, 12);
+  addKey("power", Power_Key, 0xA81, 12);
+  addKey("up", Up_Key, 0x1E6, 12);
+  addKey("down", Down_Key, 0x9E6, 12);
+  addKey("left", Left_Key, 0x5E6, 12);
+  addKey("right", Right_Key, 0xDE6, 12);
+  addKey("shift", Unmapped_Key, 0xCD6, 12);
+  addKey("program_+", ChannelUp_Key, 0x096, 12);
+  addKey("program_-", ChannelDown_Key, 0x896, 12);
+  addKey("vol_+", VolumeUp_Key, 0x481, 12);
+  addKey("vol_-", VolumeDown_Key, 0xC81, 12);
+  addKey("mute", Mute_Key, 0x281, 12);
+  addKey("1", One_Key, 0x001, 12);
+  addKey("2", Two_Key, 0x801, 12);
+  addKey("3", Three_Key, 0x401, 12);
+  addKey("4", Four_Key, 0xC01, 12);
+  addKey("5", Five_Key, 0x201, 12);
+  addKey("6", Six_Key, 0xA01, 12);
+  addKey("7", Seven_Key, 0x601, 12);
+  addKey("8", Eight_Key, 0xE01, 12);
+  addKey("9", Nine_Key, 0x101, 12);
+  addKey("0", Zero_Key, 0x901, 12);
+  addKey("enter", Enter_Key, 0x301, 12);
+  addKey("video1", Unmapped_Key, 0x441, 12);
+  addKey("video2", Unmapped_Key, 0x781, 12);
+  addKey("video3", Unmapped_Key, 0x421, 12);
+  addKey("aux/vdp", Unmapped_Key, 0xB81, 12);
+  addKey("tuner", Unmapped_Key, 0x841, 12);
+  addKey("dvd", Unmapped_Key, 0xBE1, 12);
+  addKey("tv", Unmapped_Key, 0x561, 12);
+  addKey("cd", Unmapped_Key, 0xA41, 12);
+  addKey("tape", Unmapped_Key, 0xC41, 12);
+  addKey("phono", Unmapped_Key, 0x041, 12);
+  addKey("md/dat", Unmapped_Key, 0x4B08, 15); // note, longer command
+}
+
+
+SonyCD1::SonyCD1(
+  QObject *guiObject,
+  unsigned int index)
+  : PIRKeysetMetaData(
+      "CD Player Keyset 1",
+      Sony_Make,
+      index)
+{
+  NECProtocol *np = new NECProtocol(
+    guiObject,
+    index,
+    600, 600,
+    1200, 600,
+    45000, true);
+
+  threadableProtocol = np;
+
+  np->setHeaderPair(2400, 600);
+
+  addKey("DSG", Unmapped_Key, 0x8C6, 12);
+  addKey("DISPLAY", Info_Key, 0xD21, 12);
+  addKey("ON-OFF", Power_Key, 0xA81, 12);
+  addKey("CD", Unmapped_Key, 0x4D1, 12);
+  addKey("TUNER-BAND", Unmapped_Key, 0xF16, 12);
+  addKey("TAPE", Unmapped_Key, 0x2CE, 12);
+  addKey("DIR_MODE", Unmapped_Key, 0x28E, 12);
+  addKey("PLAY_MODE", Unmapped_Key, 0x371, 12);
+  addKey("REC", Record_Key, 0x78E, 12);
+  addKey("CD_REPEAT", Unmapped_Key, 0x351, 12);
+  addKey("STEREO-MONO", Unmapped_Key, 0x856, 12);
+  addKey("TUNING_MODE", Unmapped_Key, 0xE96, 12);
+  addKey("MEMORY", Unmapped_Key, 0x716, 12);
+  addKey("TIMER_SET", Unmapped_Key, 0xA61, 12);
+  addKey("TIMER_SELECT", Unmapped_Key, 0x461, 12); // also "clock_select"
+  addKey("SLEEP", Sleep_Key, 0x061, 12);
+  addKey("VOL+", VolumeUp_Key, 0x481, 12);
+  addKey("VOL-", VolumeDown_Key, 0xC81, 12);
+  addKey("md", Unmapped_Key, 0x961, 12);
+  addKey("tuner", Unmapped_Key, 0xF01, 12);
+  addKey("game", Unmapped_Key, 0x3E1, 12);
+  addKey("cd", Unmapped_Key, 0xA41, 12);
+  addKey("dimmer", Unmapped_Key, 0xB21, 12);
+  addKey("karaoke_mpx", Unmapped_Key, 0xFA1, 12);
+  addKey("effect_on_off", Unmapped_Key, 0xF81, 12);
+  addKey("display", Unmapped_Key, 0xD21, 12);
+  addKey("tv_video", Input_Key, 0xA50, 12);
+
+  addKey("game_mixing", Unmapped_Key, 0x6609, 15);
+  addKey("spectrum", Unmapped_Key, 0x1609, 15);
+  addKey("cinema_effect", Unmapped_Key, 0x0109, 15);
+  addKey("surround_speaker_mode", Surround_Key, 0x7D09, 15);
+  addKey("music_eq", Unmapped_Key, 0x0309, 15);
+  addKey("movie_eq", Unmapped_Key, 0x4309, 15);
+  addKey("game_eq", Unmapped_Key, 0x2309, 15);
+  addKey("p_file", Unmapped_Key, 0x4E09, 15);
+
+  addKey("KEY_PAUSE", Pause_Key, 0x9CB9C, 20);
+  addKey("KEY_STOP", Stop_Key, 0x1CB9C, 20);
+  addKey("KEY_PREV_SONG", Previous_Key, 0x0CB9C, 20);
+  addKey("KEY_NEXT_SONG", Next_Key, 0x8CB9C, 20);
+  addKey("KEY_PREV", Rewind_Key, 0xCCB9C, 20);
+  addKey("KEY_NEXT", FastForward_Key, 0x2CB9C, 20);
+  addKey("KEY_ENTER", Enter_Key, 0x30B9C, 20);
+  addKey("1", One_Key, 0x00B9C, 20);
+  addKey("2", Two_Key, 0x80B9C, 20);
+  addKey("3", Three_Key, 0x40B9C, 20);
+  addKey("4", Four_Key, 0xC0B9C, 20);
+  addKey("5", Five_Key, 0x20B9C, 20);
+  addKey("6", Six_Key, 0xA0B9C, 20);
+  addKey("7", Seven_Key, 0x60B9C, 20);
+  addKey("8", Eight_Key, 0xE0B9C, 20);
+  addKey("9", Nine_Key, 0x10B9C, 20);
+  addKey("0", Zero_Key, 0x90B9C, 20);
+  addKey("gt_10", DoubleDigit_Key, 0xB0B9C, 20);
+  addKey("special_menu", Menu_Key, 0xCAB8C, 20);
+  addKey("clear", Clear_Key, 0xF0B9C, 20);
+  addKey("repeat", Unmapped_Key, 0x34B9C, 20);
+  addKey("d_skip", Unmapped_Key, 0x7CB9C, 20);
+  addKey("on_screen", Unmapped_Key, 0xAAB8C, 20);
+  addKey("prev_r", Unmapped_Key, 0x6CB8C, 20);
+  addKey("next_r", Unmapped_Key, 0xECB8C, 20);
+  addKey("return", Exit_Key, 0x70B8C, 20);
+  addKey("album+", Unmapped_Key, 0xF6B8C, 20);
+  addKey("album-", Unmapped_Key, 0x76B8C, 20);
+  addKey("sharp", Unmapped_Key, 0xD6B8C, 20);
+  addKey("flat", Unmapped_Key, 0x36B8C, 20);
+  addKey("up", Up_Key, 0x1EB9C, 20);
+  addKey("down", Down_Key, 0x9EB9C, 20);
+  addKey("left", Left_Key, 0x5EB9C, 20);
+  addKey("right", Right_Key, 0xDEB9C, 20);
+}
+
+
+SonyCD1a::SonyCD1a(
+  QObject *guiObject,
+  unsigned int index)
+  : SonyCD1(guiObject, index)
+{
+  setKeysetName("CD Keyset 1a");
+
+  addKey("tape", Unmapped_Key, 0xC41, 12);
+
+  addKey("select", Select_Key, 0x4CB9C, 20);
+  addKey("play", Play_Key, 0x4CB9C, 20);
+  addKey("play_mode", Unmapped_Key, 0x64B9C, 20);
+  addKey("enter", Enter_Key, 0x3EB9C, 20);
+}
+
+
+SonyCD2::SonyCD2(
+  QObject *guiObject,
+  unsigned int index)
+  : PIRKeysetMetaData(
+      "CD Keyset 2",
+      Sony_Make,
+      index)
+{
+  NECProtocol *np = new NECProtocol(
+    guiObject,
+    index,
+    612, 588,
+    1210, 588,
+    45604, true);
+
+  threadableProtocol = np;
+
+  np->setHeaderPair(2412, 588);
+
+  np->setPostData(0x7, 4);
+
+  addKey("PLAY", Play_Key, 0x59, 7);
+  addKey("STOP", Stop_Key, 0x71, 7);
+  addKey("PAUSE", Pause_Key, 0x31, 7);
+  addKey("NEXT", Next_Key, 0x39, 7);
+  addKey("PREV", Previous_Key, 0x79, 7);
+  addKey("FAST_FORWARD", FastForward_Key, 0x69, 7);
+  addKey("FAST_BACKWARD", Rewind_Key, 0x19, 7);
+  addKey("FORWARD", StepForward_Key, 0x11, 7);
+  addKey("BACKWARD", StepBack_Key, 0x51, 7);
+  addKey("VOLUME_UP", VolumeUp_Key, 0x5B, 7);
+  addKey("VOLUME_DOWN", VolumeDown_Key, 0x1B, 7);
+  addKey("RED", Red_Key, 0x03, 7);
+  addKey("GREEN", Green_Key, 0x29, 7);
+  addKey("YELLOW", Yellow_Key, 0x23, 7);
+  addKey("BLUE", Blue_Key, 0x43, 7);
+  addKey("QUIT", Exit_Key, 0x4B, 7);
+  addKey("UP", Up_Key, 0x07, 7);
+  addKey("DOWN", Down_Key, 0x02, 7);
+  addKey("RIGHT", Right_Key, 0x75, 7);
+  addKey("LEFT", Left_Key, 0x55, 7);
+  addKey("OK", Enter_Key, 0x0D, 7);
+  addKey("MENU1", Menu_Key, 0x0D, 7); // This might be wrong
+  addKey("MENU2", Unmapped_Key, 0x65, 7);
+  addKey("1", One_Key, 0x7F, 7);
+  addKey("TWO", Two_Key, 0x3F, 7);
+  addKey("3", Three_Key, 0x5F, 7);
+  addKey("4", Four_Key, 0x1F, 7);
+  addKey("5", Five_Key, 0x6F, 7);
+  addKey("6", Six_Key, 0x2F, 7);
+  addKey("7", Seven_Key, 0x4F, 7);
+  addKey("8", Eight_Key, 0x0F, 7);
+  addKey("9", Nine_Key, 0x77, 7);
+  addKey("10", Unmapped_Key, 0x7D, 7);
+  addKey("11", Unmapped_Key, 0x3D, 7);
+  addKey("12", Unmapped_Key, 0x5D, 7);
+  addKey("13", Unmapped_Key, 0x1D, 7);
+  addKey("14", Unmapped_Key, 0x6D, 7);
+  addKey("15", Unmapped_Key, 0x2D, 7);
+  addKey("16", Unmapped_Key, 0x4D, 7);
+  addKey("17", Unmapped_Key, 0x7B, 7);
+  addKey("18", Unmapped_Key, 0x3B, 7);
+  addKey("19", Unmapped_Key, 0x0B, 7);
+  addKey("20", Unmapped_Key, 0x35, 7);
+  addKey("ZERO", Zero_Key, 0x0D, 7);
+  addKey("CHECK", Unmapped_Key, 0x27, 7);
+  addKey("CLEAR", Clear_Key, 0x07, 7);
+}
+
+
+SonyCD3::SonyCD3(
+  QObject *guiObject,
+  unsigned int index)
+  : PIRKeysetMetaData(
+      "CD Keyset 3",
+      Sony_Make,
+      index)
+{
+  NECProtocol *np = new NECProtocol(
+    guiObject,
+    index,
+    600, 600,
+    1200, 600,
+    44735, true);
+
+  threadableProtocol = np;
+
+  np->setHeaderPair(2400, 600);
+  np->setTrailerPulse(1200);
+
+  np->setPostData(0x08, 5);
+
+  np->setMinimumRepetitions(2);
+
+  addKey("|<<", Previous_Key, 0x03, 6);
+  addKey(">>|", Next_Key, 0x23, 6);
+  addKey("<<", Rewind_Key, 0x33, 6);
+  addKey(">>", FastForward_Key, 0x0B, 6);
+  addKey("play", Play_Key, 0x13, 6);
+  addKey("stop", Stop_Key, 0x07, 6);
+  addKey("pause", Pause_Key, 0x27, 6);
+  addKey("power_on", Unmapped_Key, 0x1D, 6);
+  addKey("power", Power_Key, 0x2A, 6);
+  addKey("1", One_Key, 0x00, 6);
+  addKey("2", Two_Key, 0x20, 6);
+  addKey("3", Three_Key, 0x10, 6);
+  addKey("4", Four_Key, 0x30, 6);
+  addKey("5", Five_Key, 0x08, 6);
+  addKey("6", Six_Key, 0x28, 6);
+  addKey("7", Seven_Key, 0x18, 6);
+  addKey("8", Eight_Key, 0x38, 6);
+  addKey("9", Nine_Key, 0x04, 6);
+  addKey("0", Zero_Key, 0x01, 6);
+  addKey("+10", DoubleDigit_Key, 0x39, 6);
+  addKey("enter", Enter_Key, 0x34, 6);
+  addKey("clear", Clear_Key, 0x3C, 6);
+  addKey("d_skip", Unmapped_Key, 0x1F, 6);
+  addKey("repeat", Unmapped_Key, 0x2D, 6);
+  addKey("continue", Unmapped_Key, 0x2E, 6);
+  addKey("shuffle", Unmapped_Key, 0x2B, 6);
+  addKey("program", Program_Key, 0x3E, 6);
+}
+
+
+SonyDAT1::SonyDAT1(
+  QObject *guiObject,
+  unsigned int index)
+  : PIRKeysetMetaData(
+      "DAT Keyset 1",
+      Sony_Make,
+      index)
+{
+  NECProtocol *np = new NECProtocol(
+    guiObject,
+    index,
+    600, 600,
+    1200, 600,
+    25000, false);
+
+  threadableProtocol = np;
+
+  np->setHeaderPair(2400, 600);
+
+  np->setPostData(0x07, 5);
+
+  np->setMinimumRepetitions(2);
+
+  np->setCarrierFrequency(40000);
+
+  addKey("1", One_Key, 0x00, 7);
+  addKey("2", Two_Key, 0x40, 7);
+  addKey("3", Three_Key, 0x20, 7);
+  addKey("4", Four_Key, 0x60, 7);
+  addKey("5", Five_Key, 0x10, 7);
+  addKey("6", Six_Key, 0x50, 7);
+  addKey("7", Seven_Key, 0x30, 7);
+  addKey("8", Eight_Key, 0x70, 7);
+  addKey("9", Nine_Key, 0x08, 7);
+  addKey("0", Zero_Key, 0x14, 7);
+  addKey("PLAY", Play_Key, 0x2F, 7);
+  addKey("PAUSE", Pause_Key, 0x4E, 7);
+  addKey("STOP", Stop_Key, 0x0E, 7);
+  addKey("<<", Rewind_Key, 0x6E, 7);
+  addKey(">>", FastForward_Key, 0x1E, 7);
+  addKey("|<<", Previous_Key, 0x0B, 7);
+  addKey(">>|", Next_Key, 0x4B, 7);
+  addKey("RECORD", Record_Key, 0x3E, 7);
+  addKey("VOL+", VolumeUp_Key, 0x24, 7);
+  addKey("VOL-", VolumeDown_Key, 0x64, 7);
+  addKey("POWER_ON", Unmapped_Key, 0x3A, 7);
+  addKey("POWER_OFF", Unmapped_Key, 0x7A, 7);
+  addKey("MUTE", Mute_Key, 0x14, 7);
+  addKey("POWER", Power_Key, 0x54, 7);
+  addKey("ENTER", Enter_Key, 0x68, 7);
+}
+
+
+SonyDVD1::SonyDVD1(
+  QObject *guiObject,
+  unsigned int index)
+  : PIRKeysetMetaData(
+      "DVD Keyset 1",
+      Sony_Make,
+      index)
+{
+  NECProtocol *np = new NECProtocol(
+    guiObject,
+    index,
+    600, 600,
+    1200, 600,
+    45000, true);
+
+  threadableProtocol = np;
+
+  np->setHeaderPair(2400, 600);
+
+  np->setMinimumRepetitions(2);
+
+//  np->setCarrierFrequency(40000);
+
+  addKey("power", Power_Key, 0xA8B92, 20);
+  addKey("Display", Info_Key, 0x2AB92, 20);
+  addKey("prev", Previous_Key, 0x0CB92, 20);
+  addKey("next", Next_Key, 0x8CB92, 20);
+  addKey("Replay", Replay_Key, 0x3AB92, 20);
+  addKey("Advance", Advance_Key, 0x28B46, 20);
+  addKey("ffwd", FastForward_Key, 0x2CB92, 20);
+  addKey("rew", Rewind_Key, 0xCCB92, 20);
+  addKey("play", Play_Key, 0x4CB92, 20);
+  addKey("pause", Pause_Key, 0x9CB92, 20);
+  addKey("stop", Stop_Key, 0x1CB92, 20);
+  addKey("Favorites", Unmapped_Key, 0x7AB46, 20);
+  addKey("Input", Input_Key, 0x48B92, 20);
+  addKey("Guide", Guide_Key, 0x68B46, 20);
+  addKey("return", Exit_Key, 0x70B92, 20);
+  addKey("Options", Unmapped_Key, 0xE8B46, 20);
+  addKey("menu", Menu_Key, 0xCAB92, 20); // "setup"
+  addKey("up", Up_Key, 0x9EB92, 20);
+  addKey("down", Down_Key, 0x5EB92, 20);
+  addKey("left", Left_Key, 0xDEB92, 20);
+  addKey("right", Right_Key, 0x3EB92, 20);
+  addKey("select", Select_Key, 0xD0B92, 20);
+  addKey("1", One_Key, 0x00B92, 20);
+  addKey("2", Two_Key, 0x80B92, 20);
+  addKey("3", Three_Key, 0x40B92, 20);
+  addKey("4", Four_Key, 0xC0B92, 20);
+  addKey("5", Five_Key, 0x20B92, 20);
+  addKey("6", Six_Key, 0xA0B92, 20);
+  addKey("7", Seven_Key, 0x60B92, 20);
+  addKey("8", Eight_Key, 0xE0B92, 20);
+  addKey("9", Nine_Key, 0x10B92, 20);
+  addKey("0", Zero_Key, 0x90B92, 20);
+  addKey("Ent", Enter_Key, 0xB0B92, 20);
+  addKey("Dot", Unmapped_Key, 0xB8B46, 20);
+  addKey("prog+", ChannelUp_Key, 0xC8B92, 20);
+  addKey("prog-", ChannelDown_Key, 0x28B92, 20);
+  addKey("rec", Record_Key, 0x98B92, 20);
+  addKey("RecPause", Unmapped_Key, 0x7CB92, 20);
+  addKey("RecStop", Unmapped_Key, 0xBCB92, 20);
+  addKey("top_menu", DiscTitle_Key, 0x58B92, 20); // "Title"
+  addKey("dvd_menu", DiscMenu_Key, 0xD8B92, 20);
+  addKey("F1", Unmapped_Key, 0x74B46, 20);
+  addKey("F2", Unmapped_Key, 0xF4B46, 20);
+  addKey("Red", Red_Key, 0xE6B46, 20);
+  addKey("Green", Green_Key, 0x16B46, 20);
+  addKey("Purple", Blue_Key, 0x66B46, 20);
+  addKey("Yellow", Yellow_Key, 0x96B46, 20);
+  addKey("Language", Language_Key, 0x26B92, 20);
+  addKey("subtitles", Captions_Key, 0xC6B92, 20); // "Subtitle_Change"
+  addKey("X2_BACK", Unmapped_Key, 0x6CB92, 20);
+  addKey("X2_FORWARD", Unmapped_Key, 0xECB92, 20);
+  addKey("SUBTITLE_ON_OFF", Unmapped_Key, 0x46B92, 20);
+  addKey("CLEAR", Clear_Key, 0xF0B92, 20);
+  addKey("SLOW_BACK", Unmapped_Key, 0x06B92, 20);
+  addKey("SLOW_FORWARD", Unmapped_Key, 0x86B92, 20);
+  addKey("STEP_BACK", StepBack_Key, 0x5CB92, 20);       // JOG-
+  addKey("STEP_FORWARD", StepForward_Key, 0xDCB92, 20); // JOG+
+  addKey("SEARCH_MODE", Unmapped_Key, 0xD2B92, 20);
+  addKey("TIME", Unmapped_Key, 0x14B92, 20);
+  addKey("DNR", Unmapped_Key, 0x12B92, 20);
+  addKey("TV_DVD", Unmapped_Key, 0x8AB92, 20);
+  addKey("surround", Surround_Key, 0x5AB92, 20);
+  addKey("open/close", Eject_Key, 0x68B92, 20);
+  addKey("a-b", Unmapped_Key, 0x54B92, 20);
+  addKey("shuffle", Unmapped_Key, 0xACB92, 20);
+  addKey("repeat", Unmapped_Key, 0x34B92, 20);
+  addKey("program", Program_Key, 0xF8B92, 20);
+  addKey("PICTUREMODE", Unmapped_Key, 0xDAB92, 20);
+  addKey("Picture_Navi", Unmapped_Key, 0x0AB92, 20);
+  addKey("DiscSkip", Unmapped_Key, 0x7CB46, 20);
+  addKey("SA-CD_MULTI/2CH", Unmapped_Key, 0x7AB92, 20);
+  addKey("SA-CD/CD", Unmapped_Key, 0xFAB92, 20);
+  addKey("ALBUM-MINUS", Unmapped_Key, 0x94B46, 20);
+  addKey("ALBUM-PLUS", Unmapped_Key, 0x54B46, 20);
+  addKey("ZOOM", Unmapped_Key, 0x9EB46, 20);
+  addKey("POWER_ON", Unmapped_Key, 0x74B92, 20);
+  addKey("POWER_OFF", Unmapped_Key, 0xF4B92, 20);
+  addKey("INDEX+", Unmapped_Key, 0xE4B92, 20);
+  addKey("INDEX-", Unmapped_Key, 0x64B92, 20);
+  addKey("ANGLE_CHANGE", Unmapped_Key, 0xA6B92, 20);
+  addKey("JOG_STOP", Unmapped_Key, 0x94B92, 20);
+}
+
+
+SonyDVD1a::SonyDVD1a(
+  QObject *guiObject,
+  unsigned int index)
+  : SonyDVD1(guiObject, index)
+{
+  setKeysetName("DVD Keyset 1a");
+
+  addKey("STEP_BACK", StepBack_Key, 0x04B92, 20);
+  addKey("STEP_FORWARD", StepForward_Key, 0x84B92, 20);
+  addKey("SLOW_BACK", Unmapped_Key, 0x44B92, 20);
+  addKey("SLOW_FORWARD", Unmapped_Key, 0xC4B92, 20);
+}
+
+
+SonyDVD1b::SonyDVD1b(
+  QObject *guiObject,
+  unsigned int index)
+  : SonyDVD1(guiObject, index)
+{
+  setKeysetName("DVD Keyset 1b");
+
+  addKey("SLOW-", Unmapped_Key, 0x4EB92, 20);
+  addKey("SLOW+", Unmapped_Key, 0xCEB92, 20);
+}
+
+
+SonyDVD1c::SonyDVD1c(
+  QObject *guiObject,
+  unsigned int index)
+  : SonyDVD1(guiObject, index)
+{
+  setKeysetName("DVD Keyset 1c");
+
+  addKey("up", Up_Key, 0x9CB92, 20);
+  addKey("down", Down_Key, 0x1CB92, 20);
+  addKey("left", Left_Key, 0xCCB92, 20);
+  addKey("right", Right_Key, 0x2CB92, 20);
+  addKey("ok", Select_Key, 0x4CB92, 7);
+  addKey("enter", Enter_Key, 0xD0B92, 7);
+}
+
+
+SonyVCR1::SonyVCR1(
+  QObject *guiObject,
+  unsigned int index)
+  : PIRKeysetMetaData(
+      "VCR Keyset 1",
+      Sony_Make,
+      index)
+{
+  NECProtocol *np = new NECProtocol(
+    guiObject,
+    index,
+    703, 517,
+    1301, 517,
+    45239, true);
+
+  threadableProtocol = np;
+
+  np->setHeaderPair(2499, 517);
+  np->setTrailerPulse(703);
+
+  np->setMinimumRepetitions(2);
+
+  addKey("pwon", Power_Key, 0x54D, 11);
+  addKey("1", One_Key, 0x00D, 11);
+  addKey("2", Two_Key, 0x40D, 11);
+  addKey("3", Three_Key, 0x20D, 11);
+  addKey("4", Four_Key, 0x60D, 11);
+  addKey("5", Five_Key, 0x10D, 11);
+  addKey("6", Six_Key, 0x50D, 11);
+  addKey("7", Seven_Key, 0x30D, 11);
+  addKey("8", Eight_Key, 0x70D, 11);
+  addKey("9", Nine_Key, 0x08D, 11);
+  addKey("0", Zero_Key, 0x48D, 11);
+  addKey("jump", PrevChannel_Key, 0x28D, 11); // might be wrong
+  addKey("red", Red_Key, 0x19C, 11);
+  addKey("green", Green_Key, 0x59C, 11);
+  addKey("blue", Blue_Key, 0x79C, 11);
+  addKey("rec", Record_Key, 0x5CD, 11);
+  addKey("up", Up_Key, 0x4CD, 11);
+  addKey("down", Down_Key, 0x0CD, 11);
+  addKey("left", Left_Key, 0x6CD, 11);
+  addKey("right", Right_Key, 0x1CD, 11);
+  addKey("ok", Select_Key, 0x2CD, 11);
+  addKey("prog-next", ChannelUp_Key, 0x04D, 11);
+  addKey("prog-prev", ChannelDown_Key, 0x44D, 11);
+  addKey("power_on", Unmapped_Key, 0x3AD, 11);
+  addKey("<<", Rewind_Key, 0x6CD, 11); // 0xD9A
+  addKey(">>", FastForward_Key, 0x1CD, 11); // 0x39A
+  addKey("play", Play_Key, 0x2CD, 11); // 0x59A
+  addKey("stop", Stop_Key, 0x0CD, 11); // 0x19A
+  addKey("pause", Pause_Key, 0x4CD, 11); // 0x99A
+  addKey("menu", Menu_Key, 0x59D, 11);
+  addKey("ant/sw", Unmapped_Key, 0x2AD, 11);
+  addKey("input", Input_Key, 0x79D, 11);
+  addKey("display", Info_Key, 0x2DD, 11);
+  addKey("ENT", Unmapped_Key, 0x68D, 11);
+  addKey("VOL_UP", VolumeUp_Key, 0x248, 11);
+  addKey("VOL_DOWN", VolumeDown_Key, 0x648, 11);
+}
+
+
+SonyVCR1a::SonyVCR1a(
+  QObject *guiObject,
+  unsigned int index)
+  : SonyVCR1(guiObject, index)
+{
+  setKeysetName("VCR Keyset 1a");
+
+  addKey("up", Up_Key, 0x21D, 11);  // 0x43A
+  addKey("down", Down_Key, 0x61D, 11);  // 0xC3A
+  addKey("left", Left_Key, 0x23D, 11);  // 0x47A
+  addKey("right", Right_Key, 0x43D, 11); // 0x87A
+  addKey("execute", Select_Key, 0x45D, 11); // 0x8BA
+  addKey("-/--", DoubleDigit_Key, 0x28D, 11);
+  addKey("SLEEP", Sleep_Key, 0x79D, 11); // 0xF3A
+}
+
+
+SonyReceiver1::SonyReceiver1(
+  QObject *guiObject,
+  unsigned int index)
+  : PIRKeysetMetaData(
+      "Receiver Keyset 1",
+      Sony_Make,
+      index)
+{
+  NECProtocol *np = new NECProtocol(
+    guiObject,
+    index,
+    693, 502,
+    1291, 502,
+    40006, true);
+
+  threadableProtocol = np;
+
+  np->setHeaderPair(2486, 498);
+
+  np->setMinimumRepetitions(1);
+
+  addKey("SLEEP", Sleep_Key, 0x030C, 15);
+  addKey("POWER", Power_Key, 0x540C, 15);
+  addKey("VIDEO1", Unmapped_Key, 0x220C, 15);
+  addKey("VIDEO2", Unmapped_Key, 0x3C0C, 15);
+  addKey("VIDEO3", Unmapped_Key, 0x210C, 15);
+  addKey("DVD", Unmapped_Key, 0x5F0C, 15);
+  addKey("SAT", Unmapped_Key, 0x600D, 15);
+  addKey("TV", Unmapped_Key, 0x2B0C, 15);
+  addKey("SA_CD", Unmapped_Key, 0x520C, 15);
+  addKey("TUNER", Unmapped_Key, 0x420C, 15);
+  addKey("2CH", Unmapped_Key, 0x410D, 15);
+  addKey("AFD", Unmapped_Key, 0x210D, 15);
+  addKey("MOVIE", Unmapped_Key, 0x610D, 15);
+  addKey("MUSIC", Unmapped_Key, 0x490D, 15);
+  addKey("1", One_Key, 0x000C, 15);
+  addKey("2", Two_Key, 0x400C, 15);
+  addKey("3", Three_Key, 0x200C, 15);
+  addKey("4", Four_Key, 0x600C, 15);
+  addKey("5", Five_Key, 0x100C, 15);
+  addKey("6", Six_Key, 0x500C, 15);
+  addKey("7", Seven_Key, 0x300C, 15);
+  addKey("8", Eight_Key, 0x700C, 15);
+  addKey("9", Nine_Key, 0x080C, 15);
+  addKey("0", Zero_Key, 0x480C, 15);
+  addKey("AMP_MENU", Menu_Key, 0x770D, 15);
+  addKey("DVD_MENU", Unmapped_Key, 0x5A0D, 15);
+  addKey("DISPLAY", Info_Key, 0x690C, 15);
+  addKey("MUTING", Mute_Key, 0x140C, 15);
+  addKey("LEFT", Left_Key, 0x2F0D, 15);
+  addKey("UP", Up_Key, 0x0F0D, 15);
+  addKey("RIGHT", Right_Key, 0x6F0D, 15);
+  addKey("DOWN", Down_Key, 0x4F0D, 15);
+  addKey("SELECT", Select_Key, 0x180C, 15);
+  addKey("VOLUME_UP", VolumeUp_Key, 0x240C, 15);
+  addKey("VOLUME_DOWN", VolumeDown_Key, 0x640C, 15);
+}
diff --git a/keysets/sony.h b/keysets/sony.h
new file mode 100644 (file)
index 0000000..60843e3
--- /dev/null
@@ -0,0 +1,169 @@
+#ifndef SONY_H
+#define SONY_H
+
+#include "pirkeysetmetadata.h"
+
+#include <QObject>
+
+class SonyTV1: public PIRKeysetMetaData
+{
+public:
+  SonyTV1(
+    QObject *guiObject,
+    unsigned int index);
+};
+
+
+class SonyTV1a: public SonyTV1
+{
+public:
+  SonyTV1a(
+    QObject *guiObject,
+    unsigned int index);
+};
+
+
+class SonyTV1b: public SonyTV1
+{
+public:
+  SonyTV1b(
+    QObject *guiObject,
+    unsigned int index);
+};
+
+
+class SonyTV1d: public SonyTV1a
+{
+public:
+  SonyTV1d(
+    QObject *guiObject,
+    unsigned int index);
+};
+
+
+class SonyAmp1: public PIRKeysetMetaData
+{
+public:
+  SonyAmp1(
+    QObject *guiObject,
+    unsigned int index);
+};
+
+
+class SonyAmp2: public PIRKeysetMetaData
+{
+public:
+  SonyAmp2(
+    QObject *guiObject,
+    unsigned int index);
+};
+
+
+class SonyCD1: public PIRKeysetMetaData
+{
+public:
+  SonyCD1(
+    QObject *guiObject,
+    unsigned int index);
+};
+
+
+class SonyCD1a: public SonyCD1
+{
+public:
+  SonyCD1a(
+    QObject *guiObject,
+    unsigned int index);
+};
+
+
+class SonyCD2: public PIRKeysetMetaData
+{
+public:
+  SonyCD2(
+    QObject *guiObject,
+    unsigned int index);
+};
+
+
+class SonyCD3: public PIRKeysetMetaData
+{
+public:
+  SonyCD3(
+    QObject *guiObject,
+    unsigned int index);
+};
+
+
+class SonyDAT1: public PIRKeysetMetaData
+{
+public:
+  SonyDAT1(
+    QObject *guiObject,
+    unsigned int index);
+};
+
+
+class SonyDVD1: public PIRKeysetMetaData
+{
+public:
+  SonyDVD1(
+    QObject *guiObject,
+    unsigned int index);
+};
+
+
+class SonyDVD1a: public SonyDVD1
+{
+public:
+  SonyDVD1a(
+    QObject *guiObject,
+    unsigned int index);
+};
+
+
+class SonyDVD1b: public SonyDVD1
+{
+public:
+  SonyDVD1b(
+    QObject *guiObject,
+    unsigned int index);
+};
+
+
+class SonyDVD1c: public SonyDVD1
+{
+public:
+  SonyDVD1c(
+    QObject *guiObject,
+    unsigned int index);
+};
+
+
+class SonyVCR1: public PIRKeysetMetaData
+{
+public:
+  SonyVCR1(
+    QObject *guiObject,
+    unsigned int index);
+};
+
+
+class SonyVCR1a: public SonyVCR1
+{
+public:
+  SonyVCR1a(
+    QObject *guiObject,
+    unsigned int index);
+};
+
+
+class SonyReceiver1: public PIRKeysetMetaData
+{
+public:
+  SonyReceiver1(
+    QObject *guiObject,
+    unsigned int index);
+};
+
+#endif // SONY_H
diff --git a/keysets/toshiba.cpp b/keysets/toshiba.cpp
new file mode 100644 (file)
index 0000000..52ca8f2
--- /dev/null
@@ -0,0 +1,375 @@
+#include "toshiba.h"
+#include "necprotocol.h"
+#include "pirmakenames.h"
+
+ToshibaTV1::ToshibaTV1(
+  QObject *guiObject,
+  unsigned int index)
+  : PIRKeysetMetaData(
+      "TV Keyset 1",
+      Toshiba_Make,
+      index)
+{
+  NECProtocol *np = new NECProtocol(
+    guiObject,
+    index,
+    600, 539,
+    600, 1672,
+    108000, true);
+
+  threadableProtocol = np;
+
+  np->setHeaderPair(9000, 4500);
+  np->setTrailerPulse(600);
+  np->setRepeatPair(9000, 2250);
+
+  np->setPreData(0x02FD, 16);
+
+  addKey("POWER", Power_Key, 0x48B7, 16);
+  addKey("1", One_Key, 0x807F, 16);
+  addKey("2", Two_Key, 0x40BF, 16);
+  addKey("3", Three_Key, 0xC03F, 16);
+  addKey("4", Four_Key, 0x20DF, 16);
+  addKey("5", Five_Key, 0xA05F, 16);
+  addKey("6", Six_Key, 0x609F, 16);
+  addKey("7", Seven_Key, 0xE01F, 16);
+  addKey("8", Eight_Key, 0x10EF, 16);
+  addKey("9", Nine_Key, 0x906F, 16);
+  addKey("0", Zero_Key, 0x00FF, 16);
+  addKey("TV", Unmapped_Key, 0x4EB1, 16);
+  addKey("SCART", Unmapped_Key, 0x28D7, 16); // "AV", "inputs", "source"
+  addKey("CALL", Unmapped_Key, 0x6897, 16);
+  addKey("-/--", DoubleDigit_Key, 0xD02F, 16);
+  addKey("DOULBY", Unmapped_Key, 0x5AA5, 16);
+  addKey("CLOCK", Unmapped_Key, 0x8E71, 16);  // "TIMER"
+  addKey("RED", Red_Key, 0x12ED, 16);
+  addKey("GREEN", Green_Key, 0x926D, 16);
+  addKey("YELLOW", Yellow_Key, 0x52AD, 16);
+  addKey("BLUE", Blue_Key, 0xD22D, 16);
+  addKey("MUTE", Mute_Key, 0x08F7, 16);
+  addKey("SIZE", AspectRatio_Key, 0x9A65, 16); // "WIDE"
+  addKey("P+", ChannelUp_Key, 0xD827, 16);
+  addKey("P-", ChannelDown_Key, 0xF807, 16);
+  addKey("V+", VolumeUp_Key, 0x58A7, 16);
+  addKey("V-", VolumeDown_Key, 0x7887, 16);
+  addKey("MENU", Menu_Key, 0xDA25, 16);
+  addKey("OK", Select_Key, 0x847B, 16);
+  addKey("P+", Up_Key, 0xD827, 16);
+  addKey("P-", Down_Key, 0xF807, 16);
+  addKey("V-", Left_Key, 0x7887, 16);
+  addKey("V+", Right_Key, 0x58A7, 16);
+  addKey("exit", Exit_Key, 0x1AE5, 16);
+  addKey("100", PlusOneHundred_Key, 0x50AF, 16);
+  addKey("recall", PrevChannel_Key, 0x38C7, 16);
+  addKey("tv/video", Input_Key, 0xF00F, 16); // "input"
+  addKey("fav+", Unmapped_Key, 0x9867, 16);
+  addKey("reset", Reset_Key, 0x30CF, 16);
+  addKey("cap/text", Captions_Key, 0xEA15, 16); // Image
+  addKey("1/2", Unmapped_Key, 0xC639, 16); // "cap1/cap2"
+  addKey("fav-", Unmapped_Key, 0xB847, 16);
+  addKey("still", Unmapped_Key, 0x32CD, 16);
+  addKey("locate", Unmapped_Key, 0x728D, 16);
+  addKey("swap", PIPSwap_Key, 0xCA35, 16); // Reduce
+  addKey("pip", PIP_Key, 0x8A75, 16);
+  addKey("pip_ch_up", Unmapped_Key, 0x52AD, 16); // Yellow
+  addKey("pip_ch_down", Unmapped_Key, 0xD22D, 16); // Blue
+  addKey("mts", Language_Key, 0xC837, 16); // "audio_stereo_2channel"
+  addKey("sleep", Sleep_Key, 0xA857, 16);  // Clock
+  addKey("BLANK", PictureMode_Key, 0x8877, 16); // "Contrast", "picture_preset"
+  addKey("Double_Arrow", Unmapped_Key, 0x4AB5, 16); // "swap", but not pip!; "back"
+//  addKey("?", Unmapped_Key, 0x2AD5, 16);
+  addKey("PIC_SIZE", AspectRatio_Key, 0x2AD5, 16); // "16:9"
+  addKey("Enlarge", Unmapped_Key, 0xB04F, 16);
+  addKey("multi", Unmapped_Key, 0x8976, 16);
+  addKey("source", Unmapped_Key, 0xF20D, 16);
+  addKey("info", Info_Key, 0xC936, 16);
+  addKey("favorite", Favorites_Key, 0x09F6, 16);
+  addKey("Tone", Unmapped_Key, 0xAA55, 16);
+  addKey("POP_DIR", Unmapped_Key, 0x649B, 16);
+  addKey("a/d", Unmapped_Key, 0x22DD, 16);
+  addKey("SEARCH", Unmapped_Key, 0xF10E, 16);
+
+  // teletext stuff:
+//  addKey("TXT/MIX", Unmapped_Key, 0xE817, 16);  // "ent", "ch_rtn"
+//  addKey("textindex", Unmapped_Key, 0xD42B, 16);
+//  addKey("textpages", Unmapped_Key, 0x34CB, 16);
+//  addKey("textanswer", Unmapped_Key, 0x2AD5, 16);
+//  addKey("texthold", Unmapped_Key, 0xCA35, 16);
+//  addKey("textzoom", Unmapped_Key, 0xB04F, 16);
+//  addKey("texttime", Unmapped_Key, 0xA857, 16);
+}
+
+
+ToshibaTV1a::ToshibaTV1a(
+  QObject *guiObject,
+  unsigned int index)
+  : ToshibaTV1(guiObject, index)
+{
+  setKeysetName("TV Keyset 1a");
+
+  addKey("enter", Select_Key, 0x01FE, 16);
+}
+
+
+ToshibaTV1b::ToshibaTV1b(
+  QObject *guiObject,
+  unsigned int index)
+  : ToshibaTV1(guiObject, index)
+{
+  setKeysetName("TV Keyset 1b");
+
+  addKey("menu", Menu_Key, 0x01FE, 16);
+  addKey("up", Up_Key, 0x41BE, 16); // "set+"
+  addKey("down", Down_Key, 0xC13E, 16); // "set-"
+  addKey("left", Left_Key, 0xB847, 16);
+  addKey("right", Right_Key, 0x9867, 16);
+//  addKey("enter", Select_Key, 0x916E, 16);
+  addKey("menu/enter", Select_Key, 0x01FE, 16);
+}
+
+
+ToshibaTV1c::ToshibaTV1c(
+  QObject *guiObject,
+  unsigned int index)
+  : ToshibaTV1(guiObject, index)
+{
+  setKeysetName("TV Keyset 1c");
+
+  addKey("exit", Exit_Key, 0xC23D, 16);
+  addKey("pipswap", PIPSwap_Key, 0x1AE5, 16);
+  addKey("osdinfo", Info_Key, 0x6897, 16);
+}
+
+
+ToshibaTV1d::ToshibaTV1d(
+  QObject *guiObject,
+  unsigned int index)
+  : ToshibaTV1(guiObject, index)
+{
+  setKeysetName("TV Keyset 1d");
+
+  addKey("Left", Left_Key, 0x42BD, 16);
+  addKey("Right", Right_Key, 0x02FD, 16);
+  addKey("Down", Down_Key, 0xB847, 16);
+  addKey("Up", Up_Key, 0x9867, 16);
+  addKey("Back", Exit_Key, 0xC23D, 16);
+  addKey("guide", Guide_Key, 0xA25D, 16);
+  addKey("tv/fav/radio", Favorites_Key, 0xE21D, 16); // might be wrong
+  addKey("info", Info_Key, 0x6897, 16); // might be wrong
+  addKey("subtitle", Captions_Key, 0x30CF, 16);
+  addKey("stillpicture", Unmapped_Key, 0x44BB, 16);
+  addKey("24-", Unmapped_Key, 0x2AD5, 16);
+  addKey("page-", Unmapped_Key, 0xCA35, 16);
+  addKey("page+", Unmapped_Key, 0xB04F, 16);
+  addKey("24+", Unmapped_Key, 0xA857, 16);
+}
+
+
+ToshibaTV1e::ToshibaTV1e(
+  QObject *guiObject,
+  unsigned int index)
+  : ToshibaTV1(guiObject, index)
+{
+  setKeysetName("TV Keyset 1e");
+
+  addKey("STOP", Stop_Key, 0xF20D, 16);
+  addKey("PLAY", Play_Key, 0x8A75, 16);
+  addKey("SKIPPREV", Previous_Key, 0x8877, 16);
+  addKey("SKIPNEXT", Next_Key, 0xCA35, 16);
+  addKey("frev", Rewind_Key, 0xD22D, 16);
+  addKey("FFWD", FastForward_Key, 0x52AD, 16);
+}
+
+
+ToshibaVCR1::ToshibaVCR1(
+  QObject *guiObject,
+  unsigned int index)
+  : PIRKeysetMetaData(
+      "VCR Keyset 1",
+      Toshiba_Make,
+      index)
+{
+  NECProtocol *np = new NECProtocol(
+    guiObject,
+    index,
+    600, 525,
+    600, 1650,
+    108000, true);
+
+  threadableProtocol = np;
+
+  np->setHeaderPair(9000, 4500);
+  np->setTrailerPulse(600);
+  np->setRepeatPair(9000, 2250);
+
+  np->setPreData(0x22DD, 16);
+
+  addKey("power", Power_Key, 0x48B7, 16);
+  addKey("1", One_Key, 0x807F, 16);
+  addKey("2", Two_Key, 0x40BF, 16);
+  addKey("3", Three_Key, 0xC03F, 16);
+  addKey("4", Four_Key, 0x20DF, 16);
+  addKey("5", Five_Key, 0xA05F, 16);
+  addKey("6", Six_Key, 0x609F, 16);
+  addKey("7", Seven_Key, 0xE01F, 16);
+  addKey("8", Eight_Key, 0x10EF, 16);
+  addKey("9", Nine_Key, 0x906F, 16);
+  addKey("0", Zero_Key, 0x50AF, 16);
+  addKey("input", Input_Key, 0xFA05, 16);
+  addKey("ch+", ChannelUp_Key, 0xD827, 16);
+  addKey("ch-", ChannelDown_Key, 0xF807, 16);
+  addKey("pause", Pause_Key, 0x08F7, 16);
+  addKey("play", Play_Key, 0xA857, 16);
+  addKey("rew", Rewind_Key, 0x9867, 16);
+  addKey("ff", FastForward_Key, 0xC837, 16);
+  addKey("eject", Eject_Key, 0xAF50, 16);
+  addKey("stop", Stop_Key, 0x28D7, 16);
+  addKey("previous", Previous_Key, 0xF906, 16);
+  addKey("skip", Next_Key, 0x7986, 16);
+  addKey("tv/vcr", Input_Key, 0x8877, 16);
+  addKey("record", Record_Key, 0x18E7, 16);
+  addKey("100", PlusOneHundred_Key, 0xD02F, 16);
+  addKey("recall", PrevChannel_Key, 0xC13E, 16);
+  addKey("slow/dir_fwd", StepForward_Key, 0xB04F, 16);
+}
+
+
+ToshibaVCR1a::ToshibaVCR1a(
+  QObject *guiObject,
+  unsigned int index)
+  : ToshibaVCR1(guiObject, index)
+{
+  setKeysetName("VCR Keyset 1a");
+
+  addKey("ch+", ChannelUp_Key, 0x7887, 16);
+  addKey("ch-", ChannelDown_Key, 0xF807, 16);
+}
+
+
+ToshibaDisc1::ToshibaDisc1(
+  QObject *guiObject,
+  unsigned int index)
+  : PIRKeysetMetaData(
+      "Disc Keyset 1",
+      Toshiba_Make,
+      index)
+{
+  NECProtocol *np = new NECProtocol(
+    guiObject,
+    index,
+    600, 539,
+    600, 1672,
+    108000, true);
+
+  threadableProtocol = np;
+
+  np->setHeaderPair(9000, 4500);
+  np->setTrailerPulse(600);
+  np->setRepeatPair(9000, 2250);
+
+  np->setPreData(0xA25D, 16);
+
+  addKey("power", Power_Key, 0x48B7, 16);
+  addKey("1", One_Key, 0x807F, 16);
+  addKey("2", Two_Key, 0x40BF, 16);
+  addKey("3", Three_Key, 0xC03F, 16);
+  addKey("4", Four_Key, 0x20DF, 16);
+  addKey("5", Five_Key, 0xA05F, 16);
+  addKey("6", Six_Key, 0x609F, 16);
+  addKey("7", Seven_Key, 0xE01F, 16);
+  addKey("8", Eight_Key, 0x10EF, 16);
+  addKey("9", Nine_Key, 0x906F, 16);
+  addKey("0", Zero_Key, 0x50AF, 16);
+  addKey("+10", DoubleDigit_Key, 0xA45B, 16);
+  addKey("vol-", VolumeDown_Key, 0x8A75, 16);
+  addKey("vol+", VolumeUp_Key, 0xB24D, 16);
+  addKey("ch+", ChannelUp_Key, 0x01FE, 16);
+  addKey("ch-", ChannelDown_Key, 0x817E, 16);
+  addKey("display", Info_Key, 0x6897, 16);
+  addKey("clear", Clear_Key, 0xF708, 16);
+  addKey("top_menu", DiscTitle_Key, 0x7B84, 16);
+  addKey("menu", DiscMenu_Key, 0x21DE, 16);
+  addKey("enter", Select_Key, 0x847B, 16); // "ok"
+  addKey("exit", Exit_Key, 0x44BB, 16);
+  addKey("up", Up_Key, 0x01FE, 16); // "ch+"
+  addKey("down", Down_Key, 0x817E, 16); // "ch-"
+  addKey("left", Left_Key, 0x8A75, 16); // "vol-"
+  addKey("right", Right_Key, 0xB24D, 16); // "vol+"
+  addKey("rew", Rewind_Key, 0x9867, 16);
+  addKey("play", Play_Key, 0xA857, 16);
+  addKey("ff", FastForward_Key, 0xC837, 16);
+  addKey("stop", Stop_Key, 0x28D7, 16);
+  addKey("pause", Pause_Key, 0x00FF, 16);
+  addKey("skip-", Previous_Key, 0xC43B, 16);
+  addKey("skip+", Next_Key, 0x24DB, 16);
+  addKey("eject", Eject_Key, 0xAF50, 16);
+  addKey("slow/dir-rev", StepBack_Key, 0x708F, 16);
+  addKey("slow/dir-fwd", StepForward_Key, 0xB04F, 16);
+  addKey("disc", DiscSelect_Key, 0x52AD, 16); // "DISC SELECT"
+  addKey("FL_DIMMER", Unmapped_Key, 0x827D, 16);
+  addKey("3D", Unmapped_Key, 0xC23D, 16);
+  addKey("KEY_ANGLE", Unmapped_Key, 0x946B, 16);
+  addKey("SUBTITLE", Captions_Key, 0x14EB, 16);
+  addKey("T", Unmapped_Key, 0x649B, 16);
+  addKey("RANDOM", Unmapped_Key, 0x748B, 16);
+  addKey("MEMORY", Unmapped_Key, 0x54AB, 16);
+  addKey("REPEAT", Unmapped_Key, 0xD42B, 16);
+  addKey("A-B_RPT", Unmapped_Key, 0x34CB, 16);
+  addKey("FlSelect", Unmapped_Key, 0xEB14, 16);
+  addKey("FlDim", Unmapped_Key, 0x827D, 16);
+}
+
+
+ToshibaDisc1a::ToshibaDisc1a(
+  QObject *guiObject,
+  unsigned int index)
+  : ToshibaDisc1(guiObject, index)
+{
+  setKeysetName("Disc Keyset 1a");
+
+  addKey("100", PlusOneHundred_Key, 0xA45B, 16);
+  addKey("action", Unmapped_Key, 0x21DE, 16);
+  addKey("setup", Menu_Key, 0x04FB, 16);
+  addKey("title", DiscTitle_Key, 0x7B84, 16);
+  addKey("audio", Language_Key, 0xE41B, 16);
+  addKey("menu/enter", Select_Key, 0x847B, 16); // also menu?
+}
+
+
+
+ToshibaDisc1b::ToshibaDisc1b(
+  QObject *guiObject,
+  unsigned int index)
+  : ToshibaDisc1(guiObject, index)
+{
+  setKeysetName("Disc Keyset 1b");
+
+  addKey("100", PlusOneHundred_Key, 0xA45B, 16);
+  addKey("enter", Select_Key, 0x21DE, 16);
+  addKey("mark", Unmapped_Key, 0x847B, 16);
+}
+
+
+ToshibaDisc1c::ToshibaDisc1c(
+  QObject *guiObject,
+  unsigned int index)
+  : ToshibaDisc1a(guiObject, index)
+{
+  setKeysetName("Disc Keyset 1c");
+
+  addKey("KEY_SLOW", Unmapped_Key, 0x649B, 16);
+  addKey("KEY_DVD", Unmapped_Key, 0x44BB, 16);
+  addKey("KEY_FAVORITES", Favorites_Key, 0x7B84, 16);
+  addKey("KEY_EJECTCD", Eject_Key, 0xFB04, 16);
+}
+
+
+ToshibaDisc1d::ToshibaDisc1d(
+  QObject *guiObject,
+  unsigned int index)
+  : ToshibaDisc1a(guiObject, index)
+{
+  setKeysetName("Disc Keyset 1d");
+
+  addKey("recall", PrevChannel_Key, 0x6897, 16);
+}
diff --git a/keysets/toshiba.h b/keysets/toshiba.h
new file mode 100644 (file)
index 0000000..30dc517
--- /dev/null
@@ -0,0 +1,111 @@
+#ifndef TOSHIBA_H
+#define TOSHIBA_H
+
+#include "pirkeysetmetadata.h"
+#include <QObject>
+
+class ToshibaTV1: public PIRKeysetMetaData
+{
+public:
+  ToshibaTV1(
+    QObject *guiObject,
+    unsigned int index);
+};
+
+class ToshibaTV1a: public ToshibaTV1
+{
+public:
+  ToshibaTV1a(
+    QObject *guiObject,
+    unsigned int index);
+};
+
+class ToshibaTV1b: public ToshibaTV1
+{
+public:
+  ToshibaTV1b(
+    QObject *guiObject,
+    unsigned int index);
+};
+
+class ToshibaTV1c: public ToshibaTV1
+{
+public:
+  ToshibaTV1c(
+    QObject *guiObject,
+    unsigned int index);
+};
+
+class ToshibaTV1d: public ToshibaTV1
+{
+public:
+  ToshibaTV1d(
+    QObject *guiObject,
+    unsigned int index);
+};
+
+class ToshibaTV1e: public ToshibaTV1
+{
+public:
+  ToshibaTV1e(
+    QObject *guiObject,
+    unsigned int index);
+};
+
+class ToshibaVCR1: public PIRKeysetMetaData
+{
+public:
+  ToshibaVCR1(
+    QObject *guiObject,
+    unsigned int index);
+};
+
+class ToshibaVCR1a: public ToshibaVCR1
+{
+public:
+  ToshibaVCR1a(
+    QObject *guiObject,
+    unsigned int index);
+};
+
+class ToshibaDisc1: public PIRKeysetMetaData
+{
+public:
+  ToshibaDisc1(
+    QObject *guiObject,
+    unsigned int index);
+};
+
+class ToshibaDisc1a: public ToshibaDisc1
+{
+public:
+  ToshibaDisc1a(
+    QObject *guiObject,
+    unsigned int index);
+};
+
+class ToshibaDisc1b: public ToshibaDisc1
+{
+public:
+  ToshibaDisc1b(
+    QObject *guiObject,
+    unsigned int index);
+};
+
+class ToshibaDisc1c: public ToshibaDisc1a
+{
+public:
+  ToshibaDisc1c(
+    QObject *guiObject,
+    unsigned int index);
+};
+
+class ToshibaDisc1d: public ToshibaDisc1a
+{
+public:
+  ToshibaDisc1d(
+    QObject *guiObject,
+    unsigned int index);
+};
+
+#endif // TOSHIBA_H
diff --git a/keysets/zenith.cpp b/keysets/zenith.cpp
new file mode 100644 (file)
index 0000000..1c94bc1
--- /dev/null
@@ -0,0 +1,71 @@
+#include "zenith.h"
+#include "necprotocol.h"
+
+// Based solely on LIRC Zenith_C32V37 config file
+ZenithC32V37::ZenithC32V37(
+  QObject *guiObject,
+  unsigned int index)
+  : PIRKeysetMetaData(
+      "C32V37 TV",
+      Zenith_Make,
+      index)
+{
+  addControlledDevice(Zenith_Make, "C32V37", TV_Device);
+
+  NECProtocol *np = new NECProtocol(
+    guiObject,
+    index,
+    581, 528,
+    581, 1663,
+    106773, true);
+
+  threadableProtocol = np;
+
+  np->setHeaderPair(9000, 4500);
+  np->setTrailerPulse(581);
+  np->setRepeatPair(9000, 2250);
+
+  np->setPreData(0x20DF, 16);
+
+  addKey("power", Power_Key, 0x10EF, 16);
+  addKey("tv/video", Input_Key, 0xD02F, 16);
+  addKey("front", Unmapped_Key, 0x8A75, 16);
+  addKey("comp/dvi", Unmapped_Key, 0x19E6, 16);
+  addKey("ratio", Unmapped_Key, 0x9E61, 16);
+  addKey("signal", Unmapped_Key, 0x6996, 16);
+  addKey("freeze", Unmapped_Key, 0xA659, 16);
+  addKey("1", One_Key, 0x8877, 16);
+  addKey("2", Two_Key, 0x48B7, 16);
+  addKey("3", Three_Key, 0xC837, 16);
+  addKey("4", Four_Key, 0x28D7, 16);
+  addKey("5", Five_Key, 0xA857, 16);
+  addKey("6", Six_Key, 0x6897, 16);
+  addKey("7", Seven_Key, 0xE817, 16);
+  addKey("8", Eight_Key, 0x18E7, 16);
+  addKey("9", Nine_Key, 0x9867, 16);
+  addKey("0", Zero_Key, 0x08F7, 16);
+  addKey("dash", Dash_Key, 0x32CD, 16);
+  addKey("flashbk", Unmapped_Key, 0x58A7, 16);
+  addKey("mute", Mute_Key, 0x906F, 16);
+  addKey("audio", Unmapped_Key, 0x50AF, 16);
+  addKey("VOL_UP", VolumeUp_Key, 0x40BF, 16);
+  addKey("VOL_DOWN", VolumeDown_Key, 0xC03F, 16);
+  addKey("CH_UP", ChannelUp_Key, 0x00FF, 16);
+  addKey("CH_DOWN", ChannelDown_Key, 0x807F, 16);
+  addKey("surf", Unmapped_Key, 0x7887, 16);
+  addKey("video", Unmapped_Key, 0xB24D, 16);
+  addKey("pip", PIP_Key, 0x06F9, 16);
+  addKey("pipch-", Unmapped_Key, 0x4EB1, 16);
+  addKey("pipch+", Unmapped_Key, 0x8E71, 16);
+  addKey("pcin", Unmapped_Key, 0x8679, 16);
+  addKey("info", Info_Key, 0x55AA, 16);
+  addKey("timer", Unmapped_Key, 0x708F, 16);
+  addKey("cc", Captions_Key, 0x9C63, 16);
+  addKey("swap", PIPSwap_Key, 0xC639, 16);
+  addKey("up", Up_Key, 0x02FD, 16);
+  addKey("left", Left_Key, 0xE01F, 16);
+  addKey("right", Right_Key, 0x609F, 16);
+  addKey("down", Down_Key, 0x827D, 16);
+  addKey("menu", Menu_Key, 0xC23D, 16);
+  addKey("exit", Exit_Key, 0xDA25, 16);
+}
diff --git a/keysets/zenith.h b/keysets/zenith.h
new file mode 100644 (file)
index 0000000..baf4e58
--- /dev/null
@@ -0,0 +1,16 @@
+#ifndef ZENITH_H
+#define ZENITH_H
+
+#include "pirkeysetmetadata.h"
+
+#include <QObject>
+
+class ZenithC32V37: public PIRKeysetMetaData
+{
+public:
+  ZenithC32V37(
+    QObject *guiObject,
+    unsigned int index);
+};
+
+#endif // ZENITH_H
diff --git a/main.cpp b/main.cpp
new file mode 100644 (file)
index 0000000..d396843
--- /dev/null
+++ b/main.cpp
@@ -0,0 +1,96 @@
+#include "mainwindow.h"
+
+/*
+#include <unistd.h> // for fork()
+#include <sys/types.h> // for pid_t
+#include <sys/wait.h> // for waitpid()
+#include "pirexception.h"
+#include <sstream>
+#include <errno.h>
+*/
+
+#include <QtGui/QApplication>
+
+/*
+int loadRX51Module()
+{
+  // First, fork off a child process:
+  pid_t pid = fork();
+
+  if (pid == -1)
+  {
+    // The fork failed!  Tell our user about the error:
+    std::stringstream ss;
+    ss << "Failed to fork a child process.\n";
+    ss << "Error returned was: " << strerror(errno) << "\n";
+    PIRException e(ss.str());
+    e.display();
+    return -1;
+  }
+  else if (pid == 0)
+  {
+    // We're inside the child process, so exec a modprobe:
+    execl("/sbin/modprobe", "/sbin/modprobe", "lirc_rx51", NULL);
+    // The execl call should overwrite the child process.  So, if we still
+    // exist at this point, an error has occurred:
+    std::stringstream ss;
+    ss << "Failed to successfully call execl().\n";
+    ss << "Error returned was: " << strerror(errno) << "\n";
+    PIRException e(ss.str());
+    e.display();
+    return -1;
+  }
+
+  // If we reach this point, we are inside the parent process.  So, we'll wait
+  // for the child process to complete:
+  int *stat_loc = NULL;
+  if (waitpid(pid, stat_loc, 0) == -1)
+  {
+    // The call to modprobe failed.
+    std::stringstream ss;
+    ss << "Call to modprobe failed.\n";
+    ss << "Error returned was: " << strerror(errno) << "\n";
+    PIRException e(ss.str());
+    e.display();
+    return -1;
+  }
+
+  if (stat_loc)
+  {
+    if (WIFEXITED(*stat_loc) == 0)
+    {
+      // modprobe encountered an error of some sort.
+      std::stringstream ss;
+      ss << "'modprobe' was unable to load the lirc_rx51 module.\n";
+      // Need better details about the error here!
+      PIRException e(ss.str());
+      e.display();
+      return -1;
+    }
+  }
+
+  // By this point, we should have successfully ensured the module is loaded.
+  return 0;
+}
+*/
+
+int main(int argc, char *argv[])
+{
+  QApplication app(argc, argv);
+
+  MainWindow mainWindow;
+  mainWindow.setOrientation(MainWindow::ScreenOrientationLockLandscape);
+  mainWindow.showExpanded();
+
+/*
+  // Make sure lirc_rx51 module is loaded:
+  if (loadRX51Module() != 0)
+  {
+    // Couldn't load module, quit:
+    app.quit();
+  }
+*/
+
+  return app.exec();
+}
+
diff --git a/mainwindow.cpp b/mainwindow.cpp
new file mode 100644 (file)
index 0000000..e27a342
--- /dev/null
@@ -0,0 +1,1076 @@
+#include "mainwindow.h"
+#include "ui_mainwindow.h"
+#include "pirkeysetwidgetitem.h"
+
+//#include "pirexception.h"
+
+#include <QtCore/QCoreApplication>
+#include <QMutex>
+#include <QtGui/QMessageBox>
+#include <QSettings>
+//#include <QDesktopServices>
+//#include <QUrl>
+
+//#include <iostream>
+
+extern PIRMakeMgr makeManager;
+
+
+MainWindow::MainWindow(QWidget *parent)
+  : QMainWindow(parent),
+    ui(new Ui::MainWindow),
+    mySelectionWindow(0),
+    documentationForm(0),
+    aboutForm(0),
+    currentKeyset(0)
+{
+  ui->setupUi(this);
+
+  // Make this a Maemo 5 stacked widget:
+  setAttribute(Qt::WA_Maemo5StackedWindow);
+
+  // Collect the keysets:
+  myKeysets = new PIRKeysetManager(this);
+
+  // Set up the keyset selection window:
+  mySelectionWindow = new SelectionWindow(this);
+
+  myKeysets->populateGuiWidget(mySelectionWindow);
+
+  // Remember any favorites the user has already set:
+  populateFavorites();
+
+  QSettings settings("pietrzak.org", "Pierogi");
+  if (settings.contains("currentKeyset"))
+  {
+    currentKeyset = settings.value("currentKeyset").toInt();
+  }
+
+  enableButtons();
+
+  connect(
+    ui->favoriteKeysetsWidget,
+    SIGNAL(itemActivated(QListWidgetItem *)),
+    this,
+    SLOT(keysetSelectionChanged(QListWidgetItem *)),
+    Qt::QueuedConnection);
+}
+
+
+MainWindow::~MainWindow()
+{
+  delete myKeysets;
+  delete mySelectionWindow;
+  if (documentationForm) delete documentationForm;
+  if (aboutForm) delete aboutForm;
+  delete ui;
+}
+
+
+void MainWindow::setOrientation(ScreenOrientation orientation)
+{
+#if defined(Q_OS_SYMBIAN)
+    // If the version of Qt on the device is < 4.7.2, that attribute won't work
+    if (orientation != ScreenOrientationAuto) {
+        const QStringList v = QString::fromAscii(qVersion()).split(QLatin1Char('.'));
+        if (v.count() == 3 && (v.at(0).toInt() << 16 | v.at(1).toInt() << 8 | v.at(2).toInt()) < 0x040702) {
+            qWarning("Screen orientation locking only supported with Qt 4.7.2 and above");
+            return;
+        }
+    }
+#endif // Q_OS_SYMBIAN
+
+    Qt::WidgetAttribute attribute;
+    switch (orientation) {
+#if QT_VERSION < 0x040702
+    // Qt < 4.7.2 does not yet have the Qt::WA_*Orientation attributes
+    case ScreenOrientationLockPortrait:
+        attribute = static_cast<Qt::WidgetAttribute>(128);
+        break;
+    case ScreenOrientationLockLandscape:
+        attribute = static_cast<Qt::WidgetAttribute>(129);
+        break;
+    default:
+    case ScreenOrientationAuto:
+        attribute = static_cast<Qt::WidgetAttribute>(130);
+        break;
+#else // QT_VERSION < 0x040702
+    case ScreenOrientationLockPortrait:
+        attribute = Qt::WA_LockPortraitOrientation;
+        break;
+    case ScreenOrientationLockLandscape:
+        attribute = Qt::WA_LockLandscapeOrientation;
+        break;
+    default:
+    case ScreenOrientationAuto:
+        attribute = Qt::WA_AutoOrientation;
+        break;
+#endif // QT_VERSION < 0x040702
+    };
+    setAttribute(attribute, true);
+}
+
+void MainWindow::showExpanded()
+{
+#if defined(Q_OS_SYMBIAN) || defined(Q_WS_SIMULATOR)
+    showFullScreen();
+#elif defined(Q_WS_MAEMO_5)
+    showMaximized();
+#else
+    show();
+#endif
+}
+
+
+void MainWindow::enableButtons()
+{
+  // 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));
+
+  // 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 aspectRatioEnabled(myKeysets->hasKey(currentKeyset, AspectRatio_Key));
+  emit surroundEnabled(myKeysets->hasKey(currentKeyset, Surround_Key));
+  emit languageEnabled(myKeysets->hasKey(currentKeyset, Language_Key));
+  emit favoritesEnabled(myKeysets->hasKey(currentKeyset, Favorites_Key));
+  emit captionsEnabled(myKeysets->hasKey(currentKeyset, Captions_Key));
+  emit sleepEnabled(myKeysets->hasKey(currentKeyset, Sleep_Key));
+  emit inputEnabled(myKeysets->hasKey(currentKeyset, Input_Key));
+  emit muteEnabled(myKeysets->hasKey(currentKeyset, Mute_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 menuEnabled(myKeysets->hasKey(currentKeyset, Menu_Key));
+  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 exitEnabled(myKeysets->hasKey(currentKeyset, Exit_Key));
+  emit infoEnabled(myKeysets->hasKey(currentKeyset, Info_Key));
+  emit guideEnabled(myKeysets->hasKey(currentKeyset, Guide_Key));
+
+  // Media keys:
+  emit playEnabled(myKeysets->hasKey(currentKeyset, Play_Key));
+  emit pauseEnabled(myKeysets->hasKey(currentKeyset, Pause_Key));
+  emit stopEnabled(myKeysets->hasKey(currentKeyset, Stop_Key));
+  emit fastForwardEnabled(myKeysets->hasKey(currentKeyset, FastForward_Key));
+  emit reverseEnabled(myKeysets->hasKey(currentKeyset, Rewind_Key));
+  emit nextEnabled(myKeysets->hasKey(currentKeyset, Next_Key));
+  emit previousEnabled(myKeysets->hasKey(currentKeyset, Previous_Key));
+  emit stepForwardEnabled(myKeysets->hasKey(currentKeyset, StepForward_Key));
+  emit stepBackEnabled(myKeysets->hasKey(currentKeyset, StepBack_Key));
+  emit advanceEnabled(myKeysets->hasKey(currentKeyset, Advance_Key));
+  emit replayEnabled(myKeysets->hasKey(currentKeyset, Replay_Key));
+  emit ejectEnabled(myKeysets->hasKey(currentKeyset, Eject_Key));
+
+  // Other keys:
+  emit pipEnabled(myKeysets->hasKey(currentKeyset, PIP_Key));
+  emit pipSwapEnabled(myKeysets->hasKey(currentKeyset, PIPSwap_Key));
+  emit pipMoveEnabled(myKeysets->hasKey(currentKeyset, PIPMove_Key));
+  emit pipSourceEnabled(myKeysets->hasKey(currentKeyset, PIPSource_Key));
+  emit scanEnabled(myKeysets->hasKey(currentKeyset, Scan_Key));
+  emit programEnabled(myKeysets->hasKey(currentKeyset, Program_Key));
+  emit pictureModeEnabled(myKeysets->hasKey(currentKeyset, PictureMode_Key));
+  emit soundModeEnabled(myKeysets->hasKey(currentKeyset, SoundMode_Key));
+  emit discTitleEnabled(myKeysets->hasKey(currentKeyset, DiscTitle_Key));
+  emit discMenuEnabled(myKeysets->hasKey(currentKeyset, DiscMenu_Key));
+  emit discSelectEnabled(myKeysets->hasKey(currentKeyset, DiscSelect_Key));
+  emit recordEnabled(myKeysets->hasKey(currentKeyset, Record_Key));
+  emit trackingMinusEnabled(myKeysets->hasKey(currentKeyset, TrackingMinus_Key));
+  emit trackingPlusEnabled(myKeysets->hasKey(currentKeyset, TrackingPlus_Key));
+  emit autoTrackingEnabled(myKeysets->hasKey(currentKeyset, AutoTracking_Key));
+  emit vhsSpeedEnabled(myKeysets->hasKey(currentKeyset, VHSSpeed_Key));
+
+  emit keysetMakeChanged(
+    makeManager.getMakeString(myKeysets->getMake(currentKeyset)));
+
+  emit keysetNameChanged(myKeysets->getDisplayName(currentKeyset));
+}
+
+
+void MainWindow::receivedExternalWarning(
+  const char *warning)
+{
+  QMessageBox errBox;
+  errBox.setText(warning);
+  errBox.setIcon(QMessageBox::Warning);
+  errBox.exec();
+}
+
+
+// Main tab buttons:
+
+void MainWindow::on_powerButton_pressed()
+{
+  emit buttonPressed(currentKeyset, Power_Key);
+}
+
+void MainWindow::on_powerButton_released()
+{
+  stopRepeating();
+}
+
+void MainWindow::on_mainChannelUpButton_pressed()
+{
+  emit buttonPressed(currentKeyset, ChannelUp_Key);
+}
+
+void MainWindow::on_mainChannelUpButton_released()
+{
+  stopRepeating();
+}
+
+void MainWindow::on_mainChannelDownButton_pressed()
+{
+  emit buttonPressed(currentKeyset, ChannelDown_Key);
+}
+
+void MainWindow::on_mainChannelDownButton_released()
+{
+  stopRepeating();
+}
+
+void MainWindow::on_mainVolumeUp_pressed()
+{
+  emit buttonPressed(currentKeyset, VolumeUp_Key);
+}
+
+void MainWindow::on_mainVolumeUp_released()
+{
+  stopRepeating();
+}
+
+void MainWindow::on_mainVolumeDownButton_pressed()
+{
+  emit buttonPressed(currentKeyset, VolumeDown_Key);
+}
+
+void MainWindow::on_mainVolumeDownButton_released()
+{
+  stopRepeating();
+}
+
+
+// Utility tab buttons:
+
+void MainWindow::on_redButton_pressed()
+{
+  emit buttonPressed(currentKeyset, Red_Key);
+}
+
+void MainWindow::on_redButton_released()
+{
+  stopRepeating();
+}
+
+void MainWindow::on_greenButton_pressed()
+{
+  emit buttonPressed(currentKeyset, Green_Key);
+}
+
+void MainWindow::on_greenButton_released()
+{
+  stopRepeating();
+}
+
+void MainWindow::on_yellowButton_pressed()
+{
+  emit buttonPressed(currentKeyset, Yellow_Key);
+}
+
+void MainWindow::on_yellowButton_released()
+{
+  stopRepeating();
+}
+
+void MainWindow::on_blueButton_pressed()
+{
+  emit buttonPressed(currentKeyset, Blue_Key);
+}
+
+void MainWindow::on_blueButton_released()
+{
+  stopRepeating();
+}
+
+void MainWindow::on_aspectRatioButton_pressed()
+{
+  emit buttonPressed(currentKeyset, AspectRatio_Key);
+}
+
+void MainWindow::on_aspectRatioButton_released()
+{
+  stopRepeating();
+}
+
+void MainWindow::on_surroundButton_pressed()
+{
+  emit buttonPressed(currentKeyset, Surround_Key);
+}
+
+void MainWindow::on_surroundButton_released()
+{
+  stopRepeating();
+}
+
+void MainWindow::on_languageButton_pressed()
+{
+  emit buttonPressed(currentKeyset, Language_Key);
+}
+
+void MainWindow::on_languageButton_released()
+{
+  stopRepeating();
+}
+
+void MainWindow::on_favoritesButton_pressed()
+{
+  emit buttonPressed(currentKeyset, Favorites_Key);
+}
+
+void MainWindow::on_favoritesButton_released()
+{
+  stopRepeating();
+}
+
+void MainWindow::on_captionButton_pressed()
+{
+  emit buttonPressed(currentKeyset, Captions_Key);
+}
+
+void MainWindow::on_captionButton_released()
+{
+  stopRepeating();
+}
+
+void MainWindow::on_inputButton_pressed()
+{
+  emit buttonPressed(currentKeyset, Input_Key);
+}
+
+void MainWindow::on_inputButton_released()
+{
+  stopRepeating();
+}
+
+void MainWindow::on_sleepButton_pressed()
+{
+  emit buttonPressed(currentKeyset, Sleep_Key);
+}
+
+void MainWindow::on_sleepButton_released()
+{
+  stopRepeating();
+}
+
+void MainWindow::on_muteButton_pressed()
+{
+  emit buttonPressed(currentKeyset, Mute_Key);
+}
+
+void MainWindow::on_muteButton_released()
+{
+  stopRepeating();
+}
+
+
+// Keypad tab buttons:
+
+void MainWindow::on_oneButton_pressed()
+{
+  emit buttonPressed(currentKeyset, One_Key);
+}
+
+void MainWindow::on_oneButton_released()
+{
+  stopRepeating();
+}
+
+void MainWindow::on_twoButton_pressed()
+{
+  emit buttonPressed(currentKeyset, Two_Key);
+}
+
+void MainWindow::on_twoButton_released()
+{
+  stopRepeating();
+}
+
+void MainWindow::on_threeButton_pressed()
+{
+  emit buttonPressed(currentKeyset, Three_Key);
+}
+
+void MainWindow::on_threeButton_released()
+{
+  stopRepeating();
+}
+
+void MainWindow::on_fourButton_pressed()
+{
+  emit buttonPressed(currentKeyset, Four_Key);
+}
+
+void MainWindow::on_fourButton_released()
+{
+  stopRepeating();
+}
+
+void MainWindow::on_fiveButton_pressed()
+{
+  emit buttonPressed(currentKeyset, Five_Key);
+}
+
+void MainWindow::on_fiveButton_released()
+{
+  stopRepeating();
+}
+
+void MainWindow::on_sixButton_pressed()
+{
+  emit buttonPressed(currentKeyset, Six_Key);
+}
+
+void MainWindow::on_sixButton_released()
+{
+  stopRepeating();
+}
+
+void MainWindow::on_sevenButton_pressed()
+{
+  emit buttonPressed(currentKeyset, Seven_Key);
+}
+
+void MainWindow::on_sevenButton_released()
+{
+  stopRepeating();
+}
+
+void MainWindow::on_eightButton_pressed()
+{
+  emit buttonPressed(currentKeyset, Eight_Key);
+}
+
+void MainWindow::on_eightButton_released()
+{
+  stopRepeating();
+}
+
+void MainWindow::on_nineButton_pressed()
+{
+  emit buttonPressed(currentKeyset, Nine_Key);
+}
+
+void MainWindow::on_nineButton_released()
+{
+  stopRepeating();
+}
+
+void MainWindow::on_zeroButton_pressed()
+{
+  emit buttonPressed(currentKeyset, Zero_Key);
+}
+
+void MainWindow::on_zeroButton_released()
+{
+  stopRepeating();
+}
+
+void MainWindow::on_enterButton_pressed()
+{
+  emit buttonPressed(currentKeyset, Enter_Key);
+}
+
+void MainWindow::on_enterButton_released()
+{
+  stopRepeating();
+}
+
+void MainWindow::on_clearButton_pressed()
+{
+  emit buttonPressed(currentKeyset, Clear_Key);
+}
+
+void MainWindow::on_clearButton_released()
+{
+  stopRepeating();
+}
+
+void MainWindow::on_prevChannelButton_pressed()
+{
+  emit buttonPressed(currentKeyset, PrevChannel_Key);
+}
+
+void MainWindow::on_prevChannelButton_released()
+{
+  stopRepeating();
+}
+
+void MainWindow::on_plusOneHundredButton_pressed()
+{
+  emit buttonPressed(currentKeyset, PlusOneHundred_Key);
+}
+
+void MainWindow::on_plusOneHundredButton_released()
+{
+  stopRepeating();
+}
+
+void MainWindow::on_dashButton_pressed()
+{
+  emit buttonPressed(currentKeyset, Dash_Key);
+}
+
+void MainWindow::on_dashButton_released()
+{
+  stopRepeating();
+}
+
+void MainWindow::on_doubleDigitButton_pressed()
+{
+  emit buttonPressed(currentKeyset, DoubleDigit_Key);
+}
+
+void MainWindow::on_doubleDigitButton_released()
+{
+  stopRepeating();
+}
+
+
+// Menu tab buttons:
+
+void MainWindow::on_upButton_pressed()
+{
+  emit buttonPressed(currentKeyset, Up_Key);
+}
+
+void MainWindow::on_upButton_released()
+{
+  stopRepeating();
+}
+
+void MainWindow::on_leftButton_pressed()
+{
+  emit buttonPressed(currentKeyset, Left_Key);
+}
+
+void MainWindow::on_leftButton_released()
+{
+  stopRepeating();
+}
+
+void MainWindow::on_rightButton_pressed()
+{
+  emit buttonPressed(currentKeyset, Right_Key);
+}
+
+void MainWindow::on_rightButton_released()
+{
+  stopRepeating();
+}
+
+void MainWindow::on_downButton_pressed()
+{
+  emit buttonPressed(currentKeyset, Down_Key);
+}
+
+void MainWindow::on_downButton_released()
+{
+  stopRepeating();
+}
+
+void MainWindow::on_selectButton_pressed()
+{
+  emit buttonPressed(currentKeyset, Select_Key);
+}
+
+void MainWindow::on_selectButton_released()
+{
+  stopRepeating();
+}
+
+void MainWindow::on_menuButton_pressed()
+{
+  emit buttonPressed(currentKeyset, Menu_Key);
+}
+
+void MainWindow::on_menuButton_released()
+{
+  stopRepeating();
+}
+
+void MainWindow::on_exitButton_pressed()
+{
+  emit buttonPressed(currentKeyset, Exit_Key);
+}
+
+void MainWindow::on_exitButton_released()
+{
+  stopRepeating();
+}
+
+
+
+// Media tab buttons:
+
+void MainWindow::on_mediaPreviousButton_pressed()
+{
+  emit buttonPressed(currentKeyset, Previous_Key);
+}
+
+void MainWindow::on_mediaPreviousButton_released()
+{
+  stopRepeating();
+}
+
+void MainWindow::on_mediaNextButton_pressed()
+{
+  emit buttonPressed(currentKeyset, Next_Key);
+}
+
+void MainWindow::on_mediaNextButton_released()
+{
+  stopRepeating();
+}
+
+void MainWindow::on_replayButton_pressed()
+{
+  emit buttonPressed(currentKeyset, Replay_Key);
+}
+
+void MainWindow::on_replayButton_released()
+{
+  stopRepeating();
+}
+
+void MainWindow::on_advanceButton_pressed()
+{
+  emit buttonPressed(currentKeyset, Advance_Key);
+}
+
+void MainWindow::on_advanceButton_released()
+{
+  stopRepeating();
+}
+
+void MainWindow::on_stepBackButton_pressed()
+{
+  emit buttonPressed(currentKeyset, StepBack_Key);
+}
+
+void MainWindow::on_stepBackButton_released()
+{
+  stopRepeating();
+}
+
+void MainWindow::on_stepForwardButton_pressed()
+{
+  emit buttonPressed(currentKeyset, StepForward_Key);
+}
+
+void MainWindow::on_stepForwardButton_released()
+{
+  stopRepeating();
+}
+
+void MainWindow::on_reverseButton_pressed()
+{
+  emit buttonPressed(currentKeyset, Rewind_Key);
+}
+
+void MainWindow::on_reverseButton_released()
+{
+  stopRepeating();
+}
+
+void MainWindow::on_fastForwardButton_pressed()
+{
+  emit buttonPressed(currentKeyset, FastForward_Key);
+}
+
+void MainWindow::on_fastForwardButton_released()
+{
+  stopRepeating();
+}
+
+void MainWindow::on_playButton_pressed()
+{
+  emit buttonPressed(currentKeyset, Play_Key);
+}
+
+void MainWindow::on_playButton_released()
+{
+  stopRepeating();
+}
+
+void MainWindow::on_pauseButton_pressed()
+{
+  emit buttonPressed(currentKeyset, Pause_Key);
+}
+
+void MainWindow::on_pauseButton_released()
+{
+  stopRepeating();
+}
+
+void MainWindow::on_stopButton_pressed()
+{
+  emit buttonPressed(currentKeyset, Stop_Key);
+}
+
+void MainWindow::on_stopButton_released()
+{
+  stopRepeating();
+}
+
+void MainWindow::on_ejectButton_pressed()
+{
+  emit buttonPressed(currentKeyset, Eject_Key);
+}
+
+void MainWindow::on_ejectButton_released()
+{
+  stopRepeating();
+}
+
+
+// Misc tab slots:
+
+void MainWindow::on_pipOnOffButton_pressed()
+{
+  emit buttonPressed(currentKeyset, PIP_Key);
+}
+
+void MainWindow::on_pipOnOffButton_released()
+{
+  stopRepeating();
+}
+
+void MainWindow::on_pipSwapButton_pressed()
+{
+  emit buttonPressed(currentKeyset, PIPSwap_Key);
+}
+
+void MainWindow::on_pipSwapButton_released()
+{
+  stopRepeating();
+}
+
+void MainWindow::on_pipPositionButton_pressed()
+{
+  emit buttonPressed(currentKeyset, PIPMove_Key);
+}
+
+void MainWindow::on_pipPositionButton_released()
+{
+  stopRepeating();
+}
+
+void MainWindow::on_pipSourceButton_pressed()
+{
+  emit buttonPressed(currentKeyset, PIPSource_Key);
+}
+
+void MainWindow::on_pipSourceButton_released()
+{
+  stopRepeating();
+}
+
+void MainWindow::on_scanButton_pressed()
+{
+  emit buttonPressed(currentKeyset, Scan_Key);
+}
+
+void MainWindow::on_scanButton_released()
+{
+  stopRepeating();
+}
+
+void MainWindow::on_programButton_pressed()
+{
+  emit buttonPressed(currentKeyset, Program_Key);
+}
+
+void MainWindow::on_programButton_released()
+{
+  stopRepeating();
+}
+
+void MainWindow::on_pictureModeButton_pressed()
+{
+  emit buttonPressed(currentKeyset, PictureMode_Key);
+}
+
+void MainWindow::on_pictureModeButton_released()
+{
+  stopRepeating();
+}
+
+void MainWindow::on_soundModeButton_pressed()
+{
+  emit buttonPressed(currentKeyset, SoundMode_Key);
+}
+
+void MainWindow::on_soundModeButton_released()
+{
+  stopRepeating();
+}
+
+void MainWindow::on_discTitleButton_pressed()
+{
+  emit buttonPressed(currentKeyset, DiscTitle_Key);
+}
+
+void MainWindow::on_discTitleButton_released()
+{
+  stopRepeating();
+}
+
+void MainWindow::on_discMenuButton_pressed()
+{
+  emit buttonPressed(currentKeyset, DiscMenu_Key);
+}
+
+void MainWindow::on_discMenuButton_released()
+{
+  stopRepeating();
+}
+
+void MainWindow::on_discSelectButton_pressed()
+{
+  emit buttonPressed(currentKeyset, DiscSelect_Key);
+}
+
+void MainWindow::on_discSelectButton_released()
+{
+  stopRepeating();
+}
+
+void MainWindow::on_trackingPlusButton_pressed()
+{
+  emit buttonPressed(currentKeyset, TrackingPlus_Key);
+}
+
+void MainWindow::on_trackingPlusButton_released()
+{
+  stopRepeating();
+}
+
+void MainWindow::on_trackingMinusButton_pressed()
+{
+  emit buttonPressed(currentKeyset, TrackingMinus_Key);
+}
+
+void MainWindow::on_trackingMinusButton_released()
+{
+  stopRepeating();
+}
+
+void MainWindow::on_autoTrackingButton_pressed()
+{
+  emit buttonPressed(currentKeyset, AutoTracking_Key);
+}
+
+void MainWindow::on_autoTrackingButton_released()
+{
+  stopRepeating();
+}
+
+void MainWindow::on_vhsSpeedButton_pressed()
+{
+  emit buttonPressed(currentKeyset, VHSSpeed_Key);
+}
+
+void MainWindow::on_vhsSpeedButton_released()
+{
+  stopRepeating();
+}
+
+void MainWindow::on_recordButton_pressed()
+{
+  emit buttonPressed(currentKeyset, Record_Key);
+}
+
+void MainWindow::on_recordButton_released()
+{
+  stopRepeating();
+}
+
+
+// Menu actions:
+
+void MainWindow::on_actionSelectKeyset_triggered()
+{
+  mySelectionWindow->show();
+}
+
+void MainWindow::on_actionAbout_triggered()
+{
+  if (!aboutForm)
+  {
+    aboutForm = new PIRAboutForm(this);
+  }
+
+  aboutForm->show();
+}
+
+void MainWindow::on_actionDocumentation_triggered()
+{
+  if (!documentationForm)
+  {
+    documentationForm = new PIRDocumentationForm(this);
+  }
+
+  documentationForm->show();
+}
+
+
+// Other actions:
+
+void MainWindow::keysetSelectionChanged(
+  QListWidgetItem *item)
+{
+  if (!item) return;  // Should probably say something here!
+
+  PIRKeysetWidgetItem *kwi = dynamic_cast<PIRKeysetWidgetItem *>(item);
+
+  if (!kwi) return; // Also need to say something here
+  
+  currentKeyset = kwi->getID();
+
+  QSettings settings("pietrzak.org", "Pierogi");
+  settings.setValue("currentKeyset", currentKeyset);
+
+  enableButtons();
+}
+
+
+void MainWindow::on_addKeysetButton_clicked()
+{
+  // Is the current keylist already a favorite?
+  int count = ui->favoriteKeysetsWidget->count();
+  int index = 0;
+  PIRKeysetWidgetItem *kwi = NULL;
+  while (index < count)
+  {
+    kwi = dynamic_cast<PIRKeysetWidgetItem *>(
+      ui->favoriteKeysetsWidget->item(index));
+
+    if (kwi && (kwi->getID() == currentKeyset))
+    {
+      // Current keyset already in list!  No need to continue.
+      return;
+    }
+    ++index;
+  }
+
+  // Ok, add the current keylist to the favorites:
+  PIRMakeName make = myKeysets->getMake(currentKeyset);
+
+  QString name = makeManager.getMakeString(make);
+  name.append(" ");
+  name.append(myKeysets->getDisplayName(currentKeyset));
+
+  ui->favoriteKeysetsWidget->addItem(
+    new PIRKeysetWidgetItem(name, currentKeyset, make));
+
+  // And, add the keylist id to the persistent list:
+  QSettings settings("pietrzak.org", "Pierogi");
+
+  int favSettingsSize = settings.beginReadArray("favorites");
+  settings.endArray();
+
+  settings.beginWriteArray("favorites");
+  settings.setArrayIndex(favSettingsSize);
+  settings.setValue("keylistID", currentKeyset);
+  settings.endArray();
+}
+
+
+void MainWindow::on_removeKeysetButton_clicked()
+{
+  // Deleting an item removes it from the list, so just grab the currently
+  // selected item and delete it:
+  QListWidgetItem *item = ui->favoriteKeysetsWidget->currentItem();
+
+  if (item) delete item;
+
+  // Remove this item from the persistent list.  Well, actually, it seems a
+  // little more convenient to just blow away the existing list of favorites
+  // and rewrite it, as modifying an existing QSettings array in the middle
+  // seems a bit hard...
+  QSettings settings("pietrzak.org", "Pierogi");
+
+  settings.remove("favorites");
+
+  int count = ui->favoriteKeysetsWidget->count();
+
+  // If the count is empty, we can stop right here:
+  if (count == 0) return;
+
+  int index = 0;
+  PIRKeysetWidgetItem *kwi = NULL;
+  settings.beginWriteArray("favorites");
+  while (index < count)
+  {
+    kwi = dynamic_cast<PIRKeysetWidgetItem *>(
+      ui->favoriteKeysetsWidget->item(index));
+
+    settings.setArrayIndex(index);
+    settings.setValue("keylistID", kwi->getID());
+    ++index;
+  }
+  settings.endArray();
+}
+
+void MainWindow::populateFavorites()
+{
+  QSettings settings("pietrzak.org", "Pierogi");
+
+  int size = settings.beginReadArray("favorites");
+  int index = 0;
+  PIRMakeName make;
+  QString name;
+  unsigned int id;
+
+  while (index < size)
+  {
+    settings.setArrayIndex(index);
+    id = settings.value("keylistID").toInt();
+    make = myKeysets->getMake(id);
+    name = makeManager.getMakeString(make);
+    name.append(" ");
+    name.append(myKeysets->getDisplayName(id));
+    ui->favoriteKeysetsWidget->addItem(
+      new PIRKeysetWidgetItem(name, id, make));
+    ++index;
+  }
+
+  settings.endArray();
+}
diff --git a/mainwindow.h b/mainwindow.h
new file mode 100644 (file)
index 0000000..e652395
--- /dev/null
@@ -0,0 +1,317 @@
+#ifndef MAINWINDOW_H
+#define MAINWINDOW_H
+
+#include <QtGui/QMainWindow>
+//#include <QThread>
+
+#include "selectionwindow.h"
+#include "pirdocumentationform.h"
+#include "piraboutform.h"
+#include "pirkeysetmanager.h"
+
+namespace Ui {
+    class MainWindow;
+}
+
+class MainWindow : public QMainWindow
+{
+  Q_OBJECT
+
+public:
+  enum ScreenOrientation {
+    ScreenOrientationLockPortrait,
+    ScreenOrientationLockLandscape,
+    ScreenOrientationAuto
+  };
+
+  explicit MainWindow(QWidget *parent = 0);
+  virtual ~MainWindow();
+
+  // Note that this will only have an effect on Symbian and Fremantle.
+  void setOrientation(ScreenOrientation orientation);
+
+  void showExpanded();
+
+signals:
+  // Main keys
+  void powerEnabled(bool);
+  void volumeUpEnabled(bool);
+  void volumeDownEnabled(bool);
+  void channelUpEnabled(bool);
+  void channelDownEnabled(bool);
+
+  // Utility keys:
+  void redEnabled(bool);
+  void greenEnabled(bool);
+  void yellowEnabled(bool);
+  void blueEnabled(bool);
+  void aspectRatioEnabled(bool);
+  void surroundEnabled(bool);
+  void languageEnabled(bool);
+  void favoritesEnabled(bool);
+  void captionsEnabled(bool);
+  void inputEnabled(bool);
+  void muteEnabled(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 infoEnabled(bool);
+  void guideEnabled(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);
+
+  // Other Keys
+  void pipEnabled(bool);
+  void pipSwapEnabled(bool);
+  void pipMoveEnabled(bool);
+  void pipSourceEnabled(bool);
+  void scanEnabled(bool);
+  void programEnabled(bool);
+  void pictureModeEnabled(bool);
+  void soundModeEnabled(bool);
+  void discTitleEnabled(bool);
+  void discMenuEnabled(bool);
+  void discSelectEnabled(bool);
+  void recordEnabled(bool);
+  void trackingMinusEnabled(bool);
+  void trackingPlusEnabled(bool);
+  void autoTrackingEnabled(bool);
+  void vhsSpeedEnabled(bool);
+
+  void keysetMakeChanged(QString);
+  void keysetNameChanged(QString);
+
+  void buttonPressed(
+    unsigned int keysetID,
+    PIRKeyName name);
+
+  void buttonReleased();
+
+public slots:
+  void receivedExternalWarning(
+    const char *warning);
+
+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();
+
+  // 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_aspectRatioButton_pressed();
+  void on_aspectRatioButton_released();
+  void on_surroundButton_pressed();
+  void on_surroundButton_released();
+  void on_languageButton_pressed();
+  void on_languageButton_released();
+  void on_favoritesButton_pressed();
+  void on_favoritesButton_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();
+  void on_muteButton_pressed();
+  void on_muteButton_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();
+
+  // 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();
+
+  // Misc tab slots:
+  void on_pipOnOffButton_pressed();
+  void on_pipOnOffButton_released();
+  void on_pipSwapButton_pressed();
+  void on_pipSwapButton_released();
+  void on_recordButton_pressed();
+  void on_recordButton_released();
+  void on_pipPositionButton_pressed();
+  void on_pipPositionButton_released();
+  void on_pipSourceButton_pressed();
+  void on_pipSourceButton_released();
+  void on_scanButton_pressed();
+  void on_scanButton_released();
+  void on_programButton_pressed();
+  void on_programButton_released();
+  void on_pictureModeButton_pressed();
+  void on_pictureModeButton_released();
+  void on_soundModeButton_pressed();
+  void on_soundModeButton_released();
+  void on_discTitleButton_pressed();
+  void on_discTitleButton_released();
+  void on_discMenuButton_pressed();
+  void on_discMenuButton_released();
+  void on_discSelectButton_pressed();
+  void on_discSelectButton_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_vhsSpeedButton_pressed();
+  void on_vhsSpeedButton_released();
+
+  // Favorites tab actions:
+  void on_addKeysetButton_clicked();
+  void on_removeKeysetButton_clicked();
+
+  // Menu actions:
+  void on_actionSelectKeyset_triggered();
+  void on_actionAbout_triggered();
+  void on_actionDocumentation_triggered();
+
+  // Internal actions:
+  void keysetSelectionChanged(
+    QListWidgetItem *item);
+
+private:
+  void enableButtons();
+
+  void stopRepeating();
+
+  void populateFavorites();
+
+  Ui::MainWindow *ui;
+
+  SelectionWindow *mySelectionWindow;
+  PIRDocumentationForm *documentationForm;
+  PIRAboutForm *aboutForm;
+
+  PIRKeysetManager *myKeysets;
+
+  unsigned int currentKeyset;
+};
+
+
+inline void MainWindow::stopRepeating()
+{
+  myKeysets->stopRepeating();
+}
+
+#endif // MAINWINDOW_H
diff --git a/mainwindow.ui b/mainwindow.ui
new file mode 100644 (file)
index 0000000..4357ea9
--- /dev/null
@@ -0,0 +1,2676 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>MainWindow</class>
+ <widget class="QMainWindow" name="MainWindow">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>800</width>
+    <height>445</height>
+   </rect>
+  </property>
+  <property name="sizePolicy">
+   <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+    <horstretch>0</horstretch>
+    <verstretch>0</verstretch>
+   </sizepolicy>
+  </property>
+  <property name="windowTitle">
+   <string>Pierogi Remote Control</string>
+  </property>
+  <widget class="QWidget" name="centralWidget">
+   <property name="sizePolicy">
+    <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+     <horstretch>0</horstretch>
+     <verstretch>0</verstretch>
+    </sizepolicy>
+   </property>
+   <layout class="QGridLayout" name="gridLayout_2">
+    <property name="margin">
+     <number>0</number>
+    </property>
+    <item row="0" column="0">
+     <widget class="QTabWidget" name="buttonsWidget">
+      <property name="sizePolicy">
+       <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+        <horstretch>0</horstretch>
+        <verstretch>0</verstretch>
+       </sizepolicy>
+      </property>
+      <property name="tabPosition">
+       <enum>QTabWidget::North</enum>
+      </property>
+      <property name="tabShape">
+       <enum>QTabWidget::Rounded</enum>
+      </property>
+      <property name="currentIndex">
+       <number>0</number>
+      </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">
+         <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 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="2" 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="2" 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>
+        <item row="2" column="1">
+         <layout class="QVBoxLayout" name="verticalLayout">
+          <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>
+         </layout>
+        </item>
+       </layout>
+      </widget>
+      <widget class="QWidget" name="utilityTab">
+       <attribute name="title">
+        <string>Utility</string>
+       </attribute>
+       <layout class="QGridLayout" name="gridLayout_6">
+        <property name="margin">
+         <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="2">
+         <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="3">
+         <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="4">
+         <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="2" column="2">
+         <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="3">
+         <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="4">
+         <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>
+        <item row="2" column="0">
+         <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>
+        <item row="1" column="0">
+         <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="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="1" column="3">
+         <widget class="QPushButton" name="languageButton">
+          <property name="sizePolicy">
+           <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+            <horstretch>0</horstretch>
+            <verstretch>0</verstretch>
+           </sizepolicy>
+          </property>
+          <property name="text">
+           <string>Language</string>
+          </property>
+         </widget>
+        </item>
+        <item row="1" column="4">
+         <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>
+       </layout>
+      </widget>
+      <widget class="QWidget" name="keypadTab">
+       <property name="sizePolicy">
+        <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+         <horstretch>0</horstretch>
+         <verstretch>0</verstretch>
+        </sizepolicy>
+       </property>
+       <attribute name="title">
+        <string>Keypad</string>
+       </attribute>
+       <layout class="QGridLayout" name="gridLayout_3">
+        <property name="margin">
+         <number>8</number>
+        </property>
+        <item row="1" 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="1" 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="1" 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="2" 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="2" 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="2" 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="3" 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="3" 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="3" 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="5" 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="5" 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="5" 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="1" 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="2" 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="5" 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>
+        <item row="3" 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>
+       </layout>
+      </widget>
+      <widget class="QWidget" name="menuTab">
+       <property name="sizePolicy">
+        <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+         <horstretch>0</horstretch>
+         <verstretch>0</verstretch>
+        </sizepolicy>
+       </property>
+       <attribute name="title">
+        <string>Menu</string>
+       </attribute>
+       <layout class="QGridLayout" name="gridLayout">
+        <property name="margin">
+         <number>8</number>
+        </property>
+        <item row="0" column="1">
+         <widget class="QPushButton" name="upButton">
+          <property name="sizePolicy">
+           <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
+            <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="Minimum" vsizetype="Minimum">
+            <horstretch>0</horstretch>
+            <verstretch>0</verstretch>
+           </sizepolicy>
+          </property>
+          <property name="text">
+           <string>Menu</string>
+          </property>
+         </widget>
+        </item>
+        <item row="1" column="1">
+         <widget class="QPushButton" name="selectButton">
+          <property name="sizePolicy">
+           <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
+            <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="Minimum" vsizetype="Minimum">
+            <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="1">
+         <widget class="QPushButton" name="downButton">
+          <property name="sizePolicy">
+           <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
+            <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="Minimum" vsizetype="Minimum">
+            <horstretch>0</horstretch>
+            <verstretch>0</verstretch>
+           </sizepolicy>
+          </property>
+          <property name="text">
+           <string>Exit</string>
+          </property>
+         </widget>
+        </item>
+        <item row="0" column="0">
+         <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="guideButton">
+          <property name="sizePolicy">
+           <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
+            <horstretch>0</horstretch>
+            <verstretch>0</verstretch>
+           </sizepolicy>
+          </property>
+          <property name="text">
+           <string>Guide</string>
+          </property>
+         </widget>
+        </item>
+        <item row="1" column="0">
+         <widget class="QPushButton" name="leftButton">
+          <property name="sizePolicy">
+           <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
+            <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>
+       </layout>
+      </widget>
+      <widget class="QWidget" name="mediaTab">
+       <property name="sizePolicy">
+        <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+         <horstretch>0</horstretch>
+         <verstretch>0</verstretch>
+        </sizepolicy>
+       </property>
+       <attribute name="title">
+        <string>Media</string>
+       </attribute>
+       <layout class="QGridLayout" name="gridLayout_7">
+        <property name="margin">
+         <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="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>
+        <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>
+       </layout>
+      </widget>
+      <widget class="QWidget" name="miscTab">
+       <property name="sizePolicy">
+        <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+         <horstretch>0</horstretch>
+         <verstretch>0</verstretch>
+        </sizepolicy>
+       </property>
+       <attribute name="title">
+        <string>Misc</string>
+       </attribute>
+       <layout class="QGridLayout" name="gridLayout_5">
+        <property name="margin">
+         <number>8</number>
+        </property>
+        <item row="0" column="0">
+         <widget class="QPushButton" name="pipOnOffButton">
+          <property name="sizePolicy">
+           <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+            <horstretch>0</horstretch>
+            <verstretch>0</verstretch>
+           </sizepolicy>
+          </property>
+          <property name="text">
+           <string>PIP On-Off</string>
+          </property>
+         </widget>
+        </item>
+        <item row="0" 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="0" column="2">
+         <widget class="QPushButton" name="pipPositionButton">
+          <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="0" column="3">
+         <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="1" column="0">
+         <widget class="QPushButton" name="scanButton">
+          <property name="sizePolicy">
+           <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+            <horstretch>0</horstretch>
+            <verstretch>0</verstretch>
+           </sizepolicy>
+          </property>
+          <property name="text">
+           <string>Scan</string>
+          </property>
+         </widget>
+        </item>
+        <item row="1" 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="2">
+         <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="1" column="3">
+         <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="2" column="0">
+         <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>
+        <item row="2" column="1">
+         <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="2">
+         <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="3">
+         <widget class="QPushButton" name="recordButton">
+          <property name="sizePolicy">
+           <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+            <horstretch>0</horstretch>
+            <verstretch>0</verstretch>
+           </sizepolicy>
+          </property>
+          <property name="text">
+           <string>Record</string>
+          </property>
+          <property name="icon">
+           <iconset resource="PierogiResources.qrc">
+            <normaloff>:/icons/red_record_icon.png</normaloff>:/icons/red_record_icon.png</iconset>
+          </property>
+          <property name="iconSize">
+           <size>
+            <width>48</width>
+            <height>48</height>
+           </size>
+          </property>
+         </widget>
+        </item>
+        <item row="4" column="2">
+         <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="4" 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="4" column="0">
+         <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="4" column="1">
+         <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>
+       </layout>
+      </widget>
+      <widget class="QWidget" name="favoritesTab">
+       <attribute name="title">
+        <string>Favorites</string>
+       </attribute>
+       <layout class="QGridLayout" name="gridLayout_8">
+        <property name="margin">
+         <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>
+     </widget>
+    </item>
+   </layout>
+  </widget>
+  <widget class="QMenuBar" name="menuBar">
+   <property name="geometry">
+    <rect>
+     <x>0</x>
+     <y>0</y>
+     <width>800</width>
+     <height>22</height>
+    </rect>
+   </property>
+   <widget class="QMenu" name="menuPierogi">
+    <property name="title">
+     <string>Pierogi</string>
+    </property>
+    <addaction name="actionSelectKeyset"/>
+    <addaction name="actionDocumentation"/>
+    <addaction name="actionAbout"/>
+   </widget>
+   <addaction name="menuPierogi"/>
+  </widget>
+  <action name="actionSelectKeyset">
+   <property name="text">
+    <string>Select Keyset</string>
+   </property>
+  </action>
+  <action name="actionAbout">
+   <property name="text">
+    <string>About</string>
+   </property>
+  </action>
+  <action name="actionDocumentation">
+   <property name="text">
+    <string>Documentation</string>
+   </property>
+  </action>
+ </widget>
+ <layoutdefault spacing="6" margin="11"/>
+ <resources>
+  <include location="PierogiResources.qrc"/>
+ </resources>
+ <connections>
+  <connection>
+   <sender>MainWindow</sender>
+   <signal>soundModeEnabled(bool)</signal>
+   <receiver>soundModeButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>222</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>692</x>
+     <y>199</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>MainWindow</sender>
+   <signal>reverseEnabled(bool)</signal>
+   <receiver>reverseButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>222</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>492</x>
+     <y>239</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>MainWindow</sender>
+   <signal>fastForwardEnabled(bool)</signal>
+   <receiver>fastForwardButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>222</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>678</x>
+     <y>239</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>MainWindow</sender>
+   <signal>pauseEnabled(bool)</signal>
+   <receiver>pauseButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>222</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>306</x>
+     <y>337</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>MainWindow</sender>
+   <signal>playEnabled(bool)</signal>
+   <receiver>playButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>222</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>120</x>
+     <y>337</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>MainWindow</sender>
+   <signal>stopEnabled(bool)</signal>
+   <receiver>stopButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>222</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>492</x>
+     <y>337</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>MainWindow</sender>
+   <signal>replayEnabled(bool)</signal>
+   <receiver>replayButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>222</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>492</x>
+     <y>141</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>MainWindow</sender>
+   <signal>advanceEnabled(bool)</signal>
+   <receiver>advanceButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>222</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>678</x>
+     <y>141</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>MainWindow</sender>
+   <signal>pipSwapEnabled(bool)</signal>
+   <receiver>pipSwapButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>222</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>306</x>
+     <y>150</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>MainWindow</sender>
+   <signal>pipEnabled(bool)</signal>
+   <receiver>pipOnOffButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>222</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>120</x>
+     <y>150</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>MainWindow</sender>
+   <signal>plusOneHundredEnabled(bool)</signal>
+   <receiver>plusOneHundredButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>222</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>677</x>
+     <y>106</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>MainWindow</sender>
+   <signal>keysetMakeChanged(QString)</signal>
+   <receiver>makeLabel</receiver>
+   <slot>setText(QString)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>222</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>399</x>
+     <y>283</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>MainWindow</sender>
+   <signal>dashEnabled(bool)</signal>
+   <receiver>dashButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>222</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>683</x>
+     <y>107</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>MainWindow</sender>
+   <signal>doubleDigitEnabled(bool)</signal>
+   <receiver>doubleDigitButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>222</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>683</x>
+     <y>289</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>MainWindow</sender>
+   <signal>greenEnabled(bool)</signal>
+   <receiver>greenButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>222</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>305</x>
+     <y>153</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>MainWindow</sender>
+   <signal>redEnabled(bool)</signal>
+   <receiver>redButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>222</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>116</x>
+     <y>153</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>MainWindow</sender>
+   <signal>yellowEnabled(bool)</signal>
+   <receiver>yellowButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>222</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>494</x>
+     <y>153</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>MainWindow</sender>
+   <signal>blueEnabled(bool)</signal>
+   <receiver>blueButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>222</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>683</x>
+     <y>153</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>MainWindow</sender>
+   <signal>inputEnabled(bool)</signal>
+   <receiver>inputButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>222</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>305</x>
+     <y>334</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>MainWindow</sender>
+   <signal>captionsEnabled(bool)</signal>
+   <receiver>captionButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>222</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>116</x>
+     <y>334</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>MainWindow</sender>
+   <signal>sleepEnabled(bool)</signal>
+   <receiver>sleepButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>222</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>494</x>
+     <y>334</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>MainWindow</sender>
+   <signal>muteEnabled(bool)</signal>
+   <receiver>muteButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>222</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>683</x>
+     <y>334</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>MainWindow</sender>
+   <signal>languageEnabled(bool)</signal>
+   <receiver>languageButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>222</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>497</x>
+     <y>246</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>MainWindow</sender>
+   <signal>aspectRatioEnabled(bool)</signal>
+   <receiver>aspectRatioButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>222</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>107</x>
+     <y>246</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>MainWindow</sender>
+   <signal>favoritesEnabled(bool)</signal>
+   <receiver>favoritesButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>222</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>692</x>
+     <y>246</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>MainWindow</sender>
+   <signal>ejectEnabled(bool)</signal>
+   <receiver>ejectButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>222</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>692</x>
+     <y>373</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>MainWindow</sender>
+   <signal>pipSourceEnabled(bool)</signal>
+   <receiver>pipSourceButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>222</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>692</x>
+     <y>104</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>MainWindow</sender>
+   <signal>pipMoveEnabled(bool)</signal>
+   <receiver>pipPositionButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>222</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>497</x>
+     <y>104</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>MainWindow</sender>
+   <signal>programEnabled(bool)</signal>
+   <receiver>programButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>222</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>302</x>
+     <y>199</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>MainWindow</sender>
+   <signal>scanEnabled(bool)</signal>
+   <receiver>scanButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>222</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>107</x>
+     <y>199</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>MainWindow</sender>
+   <signal>pictureModeEnabled(bool)</signal>
+   <receiver>pictureModeButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>222</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>497</x>
+     <y>199</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>MainWindow</sender>
+   <signal>discMenuEnabled(bool)</signal>
+   <receiver>discMenuButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>222</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>302</x>
+     <y>294</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>MainWindow</sender>
+   <signal>discTitleEnabled(bool)</signal>
+   <receiver>discTitleButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>222</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>107</x>
+     <y>294</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>MainWindow</sender>
+   <signal>recordEnabled(bool)</signal>
+   <receiver>recordButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>222</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>692</x>
+     <y>294</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>MainWindow</sender>
+   <signal>trackingMinusEnabled(bool)</signal>
+   <receiver>trackingMinusButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>222</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>107</x>
+     <y>389</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>MainWindow</sender>
+   <signal>trackingPlusEnabled(bool)</signal>
+   <receiver>trackingPlusButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>222</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>107</x>
+     <y>389</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>MainWindow</sender>
+   <signal>autoTrackingEnabled(bool)</signal>
+   <receiver>autoTrackingButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>222</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>497</x>
+     <y>389</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>MainWindow</sender>
+   <signal>vhsSpeedEnabled(bool)</signal>
+   <receiver>vhsSpeedButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>222</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>692</x>
+     <y>389</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>MainWindow</sender>
+   <signal>surroundEnabled(bool)</signal>
+   <receiver>surroundButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>222</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>302</x>
+     <y>246</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>MainWindow</sender>
+   <signal>discSelectEnabled(bool)</signal>
+   <receiver>discSelectButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>222</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>497</x>
+     <y>294</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>MainWindow</sender>
+   <signal>oneEnabled(bool)</signal>
+   <receiver>oneButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>792</x>
+     <y>33</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>45</x>
+     <y>110</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>MainWindow</sender>
+   <signal>twoEnabled(bool)</signal>
+   <receiver>twoButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>177</x>
+     <y>443</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>230</x>
+     <y>110</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>MainWindow</sender>
+   <signal>threeEnabled(bool)</signal>
+   <receiver>threeButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>479</x>
+     <y>439</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>417</x>
+     <y>110</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>MainWindow</sender>
+   <signal>fourEnabled(bool)</signal>
+   <receiver>fourButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>86</x>
+     <y>442</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>45</x>
+     <y>187</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>MainWindow</sender>
+   <signal>fiveEnabled(bool)</signal>
+   <receiver>fiveButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>269</x>
+     <y>442</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>230</x>
+     <y>187</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>MainWindow</sender>
+   <signal>sixEnabled(bool)</signal>
+   <receiver>sixButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>438</x>
+     <y>441</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>417</x>
+     <y>187</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>MainWindow</sender>
+   <signal>sevenEnabled(bool)</signal>
+   <receiver>sevenButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>90</x>
+     <y>442</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>45</x>
+     <y>266</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>MainWindow</sender>
+   <signal>eightEnabled(bool)</signal>
+   <receiver>eightButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>254</x>
+     <y>443</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>230</x>
+     <y>266</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>MainWindow</sender>
+   <signal>nineEnabled(bool)</signal>
+   <receiver>nineButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>550</x>
+     <y>442</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>417</x>
+     <y>266</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>MainWindow</sender>
+   <signal>powerEnabled(bool)</signal>
+   <receiver>powerButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>375</x>
+     <y>443</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>299</x>
+     <y>164</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>MainWindow</sender>
+   <signal>leftEnabled(bool)</signal>
+   <receiver>leftButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>104</x>
+     <y>442</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>119</x>
+     <y>246</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>MainWindow</sender>
+   <signal>zeroEnabled(bool)</signal>
+   <receiver>zeroButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>325</x>
+     <y>440</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>230</x>
+     <y>344</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>MainWindow</sender>
+   <signal>enterEnabled(bool)</signal>
+   <receiver>enterButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>547</x>
+     <y>441</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>417</x>
+     <y>344</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>MainWindow</sender>
+   <signal>upEnabled(bool)</signal>
+   <receiver>upButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>350</x>
+     <y>25</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>355</x>
+     <y>139</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>MainWindow</sender>
+   <signal>selectEnabled(bool)</signal>
+   <receiver>selectButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>310</x>
+     <y>440</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>309</x>
+     <y>245</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>MainWindow</sender>
+   <signal>stepBackEnabled(bool)</signal>
+   <receiver>stepBackButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>222</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>120</x>
+     <y>239</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>MainWindow</sender>
+   <signal>menuEnabled(bool)</signal>
+   <receiver>menuButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>577</x>
+     <y>85</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>570</x>
+     <y>138</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>MainWindow</sender>
+   <signal>downEnabled(bool)</signal>
+   <receiver>downButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>363</x>
+     <y>443</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>372</x>
+     <y>346</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>MainWindow</sender>
+   <signal>rightEnabled(bool)</signal>
+   <receiver>rightButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>702</x>
+     <y>48</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>699</x>
+     <y>232</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>MainWindow</sender>
+   <signal>exitEnabled(bool)</signal>
+   <receiver>exitButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>578</x>
+     <y>441</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>583</x>
+     <y>343</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>MainWindow</sender>
+   <signal>channelDownEnabled(bool)</signal>
+   <receiver>mainChannelDownButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>222</x>
+     <y>27</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>51</x>
+     <y>294</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>MainWindow</sender>
+   <signal>channelUpEnabled(bool)</signal>
+   <receiver>mainChannelUpButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>102</x>
+     <y>26</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>51</x>
+     <y>164</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>MainWindow</sender>
+   <signal>volumeUpEnabled(bool)</signal>
+   <receiver>mainVolumeUp</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>621</x>
+     <y>24</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>546</x>
+     <y>164</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>MainWindow</sender>
+   <signal>volumeDownEnabled(bool)</signal>
+   <receiver>mainVolumeDownButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>796</x>
+     <y>232</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>546</x>
+     <y>294</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>MainWindow</sender>
+   <signal>prevChannelEnabled(bool)</signal>
+   <receiver>prevChannelButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>595</x>
+     <y>443</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>602</x>
+     <y>110</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>MainWindow</sender>
+   <signal>clearEnabled(bool)</signal>
+   <receiver>clearButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>43</x>
+     <y>443</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>45</x>
+     <y>344</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>MainWindow</sender>
+   <signal>guideEnabled(bool)</signal>
+   <receiver>guideButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>222</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>151</x>
+     <y>337</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>MainWindow</sender>
+   <signal>infoEnabled(bool)</signal>
+   <receiver>infoButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>222</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>151</x>
+     <y>141</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>MainWindow</sender>
+   <signal>keysetNameChanged(QString)</signal>
+   <receiver>nameLabel</receiver>
+   <slot>setText(QString)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>222</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>399</x>
+     <y>301</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>MainWindow</sender>
+   <signal>nextEnabled(bool)</signal>
+   <receiver>mediaNextButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>222</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>306</x>
+     <y>141</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>MainWindow</sender>
+   <signal>previousEnabled(bool)</signal>
+   <receiver>mediaPreviousButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>222</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>120</x>
+     <y>141</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>MainWindow</sender>
+   <signal>stepForwardEnabled(bool)</signal>
+   <receiver>stepForwardButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>399</x>
+     <y>222</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>306</x>
+     <y>239</y>
+    </hint>
+   </hints>
+  </connection>
+ </connections>
+ <slots>
+  <signal>zeroEnabled(bool)</signal>
+  <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>powerEnabled(bool)</signal>
+  <signal>channelUpEnabled(bool)</signal>
+  <signal>channelDownEnabled(bool)</signal>
+  <signal>volumeUpEnabled(bool)</signal>
+  <signal>volumeDownEnabled(bool)</signal>
+  <signal>muteEnabled(bool)</signal>
+  <signal>clearEnabled(bool)</signal>
+  <signal>upEnabled(bool)</signal>
+  <signal>downEnabled(bool)</signal>
+  <signal>leftEnabled(bool)</signal>
+  <signal>rightEnabled(bool)</signal>
+  <signal>menuEnabled(bool)</signal>
+  <signal>enterEnabled(bool)</signal>
+  <signal>fastForwardEnabled(bool)</signal>
+  <signal>reverseEnabled(bool)</signal>
+  <signal>playEnabled(bool)</signal>
+  <signal>pauseEnabled(bool)</signal>
+  <signal>stopEnabled(bool)</signal>
+  <signal>inputEnabled(bool)</signal>
+  <signal>prevChannelEnabled(bool)</signal>
+  <signal>captionsEnabled(bool)</signal>
+  <signal>exitEnabled(bool)</signal>
+  <signal>infoEnabled(bool)</signal>
+  <signal>guideEnabled(bool)</signal>
+  <signal>keysetNameChanged(QString)</signal>
+  <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>recordEnabled(bool)</signal>
+  <signal>pipEnabled(bool)</signal>
+  <signal>pipSwapEnabled(bool)</signal>
+  <signal>sleepEnabled(bool)</signal>
+  <signal>ejectEnabled(bool)</signal>
+  <signal>redEnabled(bool)</signal>
+  <signal>greenEnabled(bool)</signal>
+  <signal>yellowEnabled(bool)</signal>
+  <signal>blueEnabled(bool)</signal>
+  <signal>keysetMakeChanged(QString)</signal>
+  <signal>plusOneHundredEnabled(bool)</signal>
+  <signal>dashEnabled(bool)</signal>
+  <signal>doubleDigitEnabled(bool)</signal>
+  <signal>surroundEnabled(bool)</signal>
+  <signal>selectEnabled(bool)</signal>
+  <signal>aspectRatioEnabled(bool)</signal>
+  <signal>languageEnabled(bool)</signal>
+  <signal>favoritesEnabled(bool)</signal>
+  <signal>pipMoveEnabled(bool)</signal>
+  <signal>pipSourceEnabled(bool)</signal>
+  <signal>scanEnabled(bool)</signal>
+  <signal>programEnabled(bool)</signal>
+  <signal>pictureModeEnabled(bool)</signal>
+  <signal>discTitleEnabled(bool)</signal>
+  <signal>discMenuEnabled(bool)</signal>
+  <signal>discSelectEnabled(bool)</signal>
+  <signal>trackingPlusEnabled(bool)</signal>
+  <signal>trackingMinusEnabled(bool)</signal>
+  <signal>autoTrackingEnabled(bool)</signal>
+  <signal>vhsSpeedEnabled(bool)</signal>
+  <signal>soundModeEnabled(bool)</signal>
+ </slots>
+</ui>
diff --git a/necprotocol.cpp b/necprotocol.cpp
new file mode 100644 (file)
index 0000000..15c6b2d
--- /dev/null
@@ -0,0 +1,230 @@
+#include "necprotocol.h"
+
+#include "pirexception.h"
+#include <string>
+//#include <iostream>
+
+NECProtocol::NECProtocol(
+  QObject *guiObject,
+  unsigned int index,
+  unsigned int zPulse,
+  unsigned int zSpace,
+  unsigned int oPulse,
+  unsigned int oSpace,
+  unsigned int gSpace,
+  bool iclflag)
+  : PIRProtocol(guiObject, index, gSpace, iclflag),
+    zeroPulse(zPulse),
+    zeroSpace(zSpace),
+    onePulse(oPulse),
+    oneSpace(oSpace),
+    hasTrailerPulse(false),
+    hasHeaderPair(false),
+    hasRepeatPair(false),
+    repeatNeedsHeader(false)
+{
+}
+
+void NECProtocol::setHeaderPair(
+  unsigned int pulse,
+  unsigned int space)
+{
+  headerPulse = pulse;
+  headerSpace = space;
+  hasHeaderPair = true;
+}
+
+void NECProtocol::setTrailerPulse(
+  unsigned int pulse)
+{
+  trailerPulse = pulse;
+  hasTrailerPulse = true;
+}
+
+void NECProtocol::setRepeatPair(
+  unsigned int pulse,
+  unsigned int space)
+{
+  repeatPulse = pulse;
+  repeatSpace = space;
+  hasRepeatPair = true;
+}
+
+void NECProtocol::setRepeatNeedsHeader(
+  bool flag)
+{
+  repeatNeedsHeader = flag;
+}
+
+void NECProtocol::setPreData(
+  unsigned long data,
+  unsigned int bits)
+{
+  appendToBitSeq(preData, data, bits);
+}
+
+void NECProtocol::setPostData(
+  unsigned long data,
+  unsigned int bits)
+{
+  appendToBitSeq(postData, data, bits);
+}
+
+void NECProtocol::startSendingCommand(
+  unsigned int threadableID,
+  PIRKeyName command)
+{
+  // Exceptions here are problematic; I'll try to weed them out by putting the
+  // whole thing in a try/catch block:
+  try
+  {
+    clearRepeatFlag();
+
+    // Check if we are meant to be the recipient of this command:
+    if (threadableID != id) return;
+
+    KeycodeCollection::const_iterator i = keycodes.find(command);
+
+    // Do we even have this key defined?
+    if (i == keycodes.end())
+    {
+      std::string s = "Tried to send a non-existent command.\n";
+      throw PIRException(s);
+    }
+
+    // construct the device:
+    PIRDevice device(carrierFrequency, dutyCycle);
+
+    int repeatCount = 0;
+    while (repeatCount < MAX_REPEAT_COUNT)
+    {
+      int commandDuration;
+
+      // If we are currently repeating, and have a special "repeat signal",
+      // use that signal.  Otherwise, generate a normal command string.
+      if ((hasRepeatPair) && repeatCount)
+      {
+        commandDuration = generateRepeatCommand(device);
+      }
+      else
+      {
+        commandDuration = generateStandardCommand((*i).second, device);
+      }
+
+      // Now, tell the device to send the whole command:
+      device.sendCommandToDevice();
+
+      // sleep until the next repetition of command:
+      sleepUntilRepeat(commandDuration);
+
+      // Check whether we've reached the minimum required number of repetitons:
+      if (repeatCount >= minimumRepetitions)
+      {
+        // Check whether we've been asked to stop:
+        if (checkRepeatFlag())
+        {
+          return;
+        }
+      }
+
+      ++repeatCount;
+    }
+  }
+  catch (PIRException e)
+  {
+    // inform the gui:
+    emit commandFailed(e.getError().c_str());
+  }
+}
+
+
+int NECProtocol::generateStandardCommand(
+  const CommandSequence &bits,
+  PIRDevice &device)
+{
+  int duration = 0;
+
+  // First, the "header" pulse (if any):
+  if (hasHeaderPair)
+  {
+    device.addPair(headerPulse, headerSpace);
+    duration += (headerPulse + headerSpace);
+  }
+
+  // Next, the "pre" data:
+  duration += pushBits(preData, device);
+
+  // Next, add the actual command:
+  duration += pushBits(bits, device);
+
+  // Next, add the "post" data:
+  duration += pushBits(postData, device);
+
+  // Finally add the "trail":
+  if (hasTrailerPulse)
+  {
+    device.addSingle(trailerPulse);
+    duration += trailerPulse;
+  }
+
+  return duration;
+}
+
+
+int NECProtocol::generateRepeatCommand(
+  PIRDevice &device)
+{
+  int duration = 0;
+
+  // Do we need the header?
+  if (repeatNeedsHeader)
+  {
+    // Do we even have a header?
+    if (hasHeaderPair)
+    {
+      // Ok, then add the header to the repeat:
+      device.addPair(headerPulse, headerSpace);
+      duration += (headerPulse + headerSpace);
+    }
+  }
+
+  // Add the repeat pulse:
+  device.addPair(repeatPulse, repeatSpace);
+  duration += (repeatPulse + repeatSpace);
+
+  // Finally add the trailer:
+  if (hasTrailerPulse)
+  {
+    device.addSingle(trailerPulse);
+    duration += trailerPulse;
+  }
+
+  return duration;
+}
+
+
+int NECProtocol::pushBits(
+  const CommandSequence &bits,
+  PIRDevice &device)
+{
+  int duration = 0;
+  CommandSequence::const_iterator i = bits.begin();
+  while (i != bits.end())
+  {
+    if (*i)
+    {
+      // Send the pulse for "One":
+      device.addPair(onePulse, oneSpace);
+      duration += (onePulse + oneSpace);
+    }
+    else
+    {
+      // Send the pulse for "Zero":
+      device.addPair(zeroPulse, zeroSpace);
+      duration += (zeroPulse + zeroSpace);
+    }
+    ++i;
+  }
+
+  return duration;
+}
diff --git a/necprotocol.h b/necprotocol.h
new file mode 100644 (file)
index 0000000..8610522
--- /dev/null
@@ -0,0 +1,104 @@
+#ifndef NECPROTOCOL_H
+#define NECPROTOCOL_H
+
+#include "pirprotocol.h"
+#include "pirdevice.h"
+
+//
+// The "NEC" Protocol is, more or less, followed by the majority of
+// remotes defined in the LIRC config files, which means it is probably
+// followed by most of the remotes out there.
+//
+// Remotes using this protocol seem to use a frequency of 38000 Hz, lead off
+// each command with a signal that should be unique to the manufacturer,
+// and mostly define 0s and 1s by the length of time between pulses...
+//
+
+class NECProtocol: public PIRProtocol
+{
+public:
+  // An NEC protocol will always have differing times for "zero" and "one".
+  // Also, all protocols have some space set between commands.  However,
+  // some protocols specify a fixed delay between the end of one
+  // command and the start of the next, and others specify each command be
+  // started at a precise interval (so the spacing between the end of one
+  // and the start of another may vary).
+  NECProtocol(
+    QObject *guiObject,
+    unsigned int index,
+    unsigned int zPulse,
+    unsigned int zSpace,
+    unsigned int oPulse,
+    unsigned int oSpace,
+    unsigned int gapSpace,
+    bool iclflag);
+
+  void setHeaderPair(
+    unsigned int pulse,
+    unsigned int space);
+
+  void setTrailerPulse(
+    unsigned int pulse);
+
+  void setRepeatPair(
+    unsigned int pulse,
+    unsigned int space);
+
+  void setPreData(
+    unsigned long data,
+    unsigned int bits);
+
+  void setPostData(
+    unsigned long data,
+    unsigned int bits);
+
+  void setRepeatNeedsHeader(
+    bool flag);
+
+public slots:
+  void startSendingCommand(
+    unsigned int threadableID,
+    PIRKeyName command);
+
+private:
+  // First, define what is used to represent 0 and 1:
+  unsigned int zeroPulse;
+  unsigned int zeroSpace;
+  unsigned int onePulse;
+  unsigned int oneSpace;
+
+  // A tailing on-request, not followed by a specific off time:
+  unsigned int trailerPulse;
+  bool hasTrailerPulse;
+
+  // Each remote key has a unique command sequence:
+//  KeyCommandMap commands;
+
+  // Some administrative data that most NEC Protocol remotes have:
+  unsigned int headerPulse;
+  unsigned int headerSpace;
+  bool hasHeaderPair;
+
+  // More administrative data wrapped around the actual command:
+  CommandSequence preData;
+  CommandSequence postData;
+
+  // A pulse that means "repeat the last command":
+  unsigned int repeatPulse;
+  unsigned int repeatSpace;
+  bool hasRepeatPair;
+  bool repeatNeedsHeader; // Put the header ahead of the repeat pulse
+
+  int generateStandardCommand(
+    const CommandSequence &bits,
+    PIRDevice &device);
+
+  int generateRepeatCommand(
+    PIRDevice &device);
+
+  int pushBits(
+    const CommandSequence &bits,
+    PIRDevice &device);
+};
+
+#endif // NECPROTOCOL_H
diff --git a/pierogi.desktop b/pierogi.desktop
new file mode 100644 (file)
index 0000000..94f2c0e
--- /dev/null
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=pierogi
+Exec=/opt/pierogi/bin/pierogi
+Icon=pierogi64
+X-Window-Icon=pierogi64
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/pierogi.pro b/pierogi.pro
new file mode 100644 (file)
index 0000000..57700d2
--- /dev/null
@@ -0,0 +1,164 @@
+# Add files and directories to ship with the application 
+# by adapting the examples below.
+# file1.source = myfile
+# dir1.source = mydir
+DEPLOYMENTFOLDERS = # file1 dir1
+
+symbian:TARGET.UID3 = 0xE0C0A793
+
+# Smart Installer package's UID
+# This UID is from the protected range 
+# and therefore the package will fail to install if self-signed
+# By default qmake uses the unprotected range value if unprotected UID is defined for the application
+# and 0x2002CCCF value if protected UID is given to the application
+#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
+
+# Allow network access on Symbian
+symbian:TARGET.CAPABILITY += NetworkServices
+
+# If your application uses the Qt Mobility libraries, uncomment
+# the following lines and add the respective components to the 
+# MOBILITY variable. 
+# CONFIG += mobility
+# MOBILITY +=
+
+SOURCES += main.cpp mainwindow.cpp \
+    pirdevice.cpp \
+    selectionwindow.cpp \
+    necprotocol.cpp \
+    rc5protocol.cpp \
+    pirmakenames.cpp \
+    pirdocumentationform.cpp \
+    piraboutform.cpp \
+    pirexception.cpp \
+    pirkeysetwidgetitem.cpp \
+    pirprotocol.cpp \
+    keysets/apple.cpp \
+    keysets/ei.cpp \
+    keysets/goldstar.cpp \
+    keysets/hauppauge.cpp \
+    keysets/lg.cpp \
+    keysets/nokia.cpp \
+    keysets/panasonic.cpp \
+    keysets/samsung.cpp \
+    keysets/sanyo.cpp \
+    keysets/sharp.cpp \
+    keysets/sony.cpp \
+    keysets/toshiba.cpp \
+    keysets/zenith.cpp \
+    pirkeysetmetadata.cpp \
+    pirkeysetmanager.cpp
+HEADERS += mainwindow.h \
+    pirdevice.h \
+    pirkeynames.h \
+    selectionwindow.h \
+    necprotocol.h \
+    rc5protocol.h \
+    pirmakenames.h \
+    pirdocumentationform.h \
+    piraboutform.h \
+    pirexception.h \
+    pirkeysetwidgetitem.h \
+    pirprotocol.h \
+    keysets/apple.h \
+    keysets/ei.h \
+    keysets/goldstar.h \
+    keysets/hauppauge.h \
+    keysets/lg.h \
+    keysets/nokia.h \
+    keysets/panasonic.h \
+    keysets/samsung.h \
+    keysets/sanyo.h \
+    keysets/sharp.h \
+    keysets/sony.h \
+    keysets/toshiba.h \
+    keysets/zenith.h \
+    pirkeysetmetadata.h \
+    pirkeysetmanager.h
+FORMS += mainwindow.ui \
+    pirdocumentationform.ui \
+    piraboutform.ui
+
+# Please do not modify the following two lines. Required for deployment.
+include(deployment.pri)
+qtcAddDeployment()
+
+OTHER_FILES += \
+    qtc_packaging/debian_fremantle/rules \
+    qtc_packaging/debian_fremantle/README \
+    qtc_packaging/debian_fremantle/copyright \
+    qtc_packaging/debian_fremantle/control \
+    qtc_packaging/debian_fremantle/compat \
+    qtc_packaging/debian_fremantle/changelog \
+    icons/black/sound_high_icon&48.png \
+    icons/arrow_bottom_icon&48.png \
+    icons/arrow_left_icon&48.png \
+    icons/arrow_right_icon&48.png \
+    icons/arrow_top_icon&48.png \
+    icons/blue_square.png \
+    icons/br_up_icon&48.png \
+    icons/clock_icon&48.png \
+    icons/dash.png \
+    icons/eject_icon&48.png \
+    icons/fastforward_next_icon&48.png \
+    icons/green_square.png \
+    icons/on-off_icon&48.png \
+    icons/PierogiIcon.png \
+    icons/playback_ff_icon&48.png \
+    icons/playback_next_icon&48.png \
+    icons/playback_pause_icon&48.png \
+    icons/playback_play_icon&48.png \
+    icons/playback_prev_icon&48.png \
+    icons/playback_rew_icon&48.png \
+    icons/playback_stop_icon&48.png \
+    icons/red_record_icon.png \
+    icons/red_square.png \
+    icons/redo_icon&48.png \
+    icons/rewind_previous_icon&48.png \
+    icons/sound_high_icon&48.png \
+    icons/sound_low_icon&48.png \
+    icons/sound_mute_icon&48.png \
+    icons/undo_icon&48.png \
+    icons/yellow_square.png \
+    doc/about.html \
+    doc/documentation.html
+
+RESOURCES += \
+    PierogiResources.qrc
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/pierogi.pro.user b/pierogi.pro.user
new file mode 100644 (file)
index 0000000..e8b3ee6
--- /dev/null
@@ -0,0 +1,529 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE QtCreatorProject>
+<!-- Written by Qt Creator 2.4.0, 2012-01-01T18:09:45. -->
+<qtcreator>
+ <data>
+  <variable>ProjectExplorer.Project.ActiveTarget</variable>
+  <value type="int">0</value>
+ </data>
+ <data>
+  <variable>ProjectExplorer.Project.EditorSettings</variable>
+  <valuemap type="QVariantMap">
+   <value type="bool" key="EditorConfiguration.AutoIndent">true</value>
+   <value type="bool" key="EditorConfiguration.AutoSpacesForTabs">false</value>
+   <valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.0">
+    <value type="QString" key="language">Cpp</value>
+    <valuemap type="QVariantMap" key="value">
+     <value type="QString" key="CurrentPreferences">CppGlobal</value>
+    </valuemap>
+   </valuemap>
+   <valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.1">
+    <value type="QString" key="language">QmlJS</value>
+    <valuemap type="QVariantMap" key="value">
+     <value type="QString" key="CurrentPreferences">QmlJSGlobal</value>
+    </valuemap>
+   </valuemap>
+   <value type="int" key="EditorConfiguration.CodeStyle.Count">2</value>
+   <value type="QByteArray" key="EditorConfiguration.Codec">System</value>
+   <value type="bool" key="EditorConfiguration.ConstrainTooltips">false</value>
+   <value type="int" key="EditorConfiguration.IndentSize">4</value>
+   <value type="bool" key="EditorConfiguration.MouseNavigation">true</value>
+   <value type="int" key="EditorConfiguration.PaddingMode">1</value>
+   <value type="bool" key="EditorConfiguration.ScrollWheelZooming">true</value>
+   <value type="int" key="EditorConfiguration.SmartBackspaceBehavior">0</value>
+   <value type="bool" key="EditorConfiguration.SpacesForTabs">true</value>
+   <value type="int" key="EditorConfiguration.TabKeyBehavior">0</value>
+   <value type="int" key="EditorConfiguration.TabSize">8</value>
+   <value type="bool" key="EditorConfiguration.UseGlobal">true</value>
+   <value type="int" key="EditorConfiguration.Utf8BomBehavior">1</value>
+   <value type="bool" key="EditorConfiguration.addFinalNewLine">true</value>
+   <value type="bool" key="EditorConfiguration.cleanIndentation">true</value>
+   <value type="bool" key="EditorConfiguration.cleanWhitespace">true</value>
+   <value type="bool" key="EditorConfiguration.inEntireDocument">false</value>
+  </valuemap>
+ </data>
+ <data>
+  <variable>ProjectExplorer.Project.PluginSettings</variable>
+  <valuemap type="QVariantMap"/>
+ </data>
+ <data>
+  <variable>ProjectExplorer.Project.Target.0</variable>
+  <valuemap type="QVariantMap">
+   <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Maemo5</value>
+   <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Maemo5</value>
+   <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Target.MaemoDeviceTarget</value>
+   <value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value>
+   <value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
+   <value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
+   <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
+    <value type="QString" key="ProjectExplorer.BuildCOnfiguration.ToolChain">Qt4ProjectManager.ToolChain.Maemo:/Users/john/QtSDK/Maemo/4.6.2/targets/fremantle-pr13/bin/gcc.arm-linux-generic-elf-32bit./Users/john/QtSDK/Maemo/4.6.2/targets/fremantle-pr13/bin/gdb</value>
+    <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
+     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
+      <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">false</value>
+      <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibraryAuto">true</value>
+      <value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value>
+      <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
+     </valuemap>
+     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
+      <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value>
+      <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value>
+      <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
+     </valuemap>
+     <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
+    </valuemap>
+    <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
+     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
+      <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value>
+      <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
+      <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
+     </valuemap>
+     <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
+    </valuemap>
+    <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
+    <value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
+    <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Qt for Fremantle PR1.3 Devices (Qt SDK) Release</value>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
+    <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value>
+    <value type="QString" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory">/Users/john/Develop/n900/pierogi-build-maemo-Qt_for_Fremantle_PR1_3_Devices__Qt_SDK__Release</value>
+    <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.QtVersionId">4</value>
+    <value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value>
+   </valuemap>
+   <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1">
+    <value type="QString" key="ProjectExplorer.BuildCOnfiguration.ToolChain">Qt4ProjectManager.ToolChain.Maemo:/Users/john/QtSDK/Maemo/4.6.2/targets/fremantle-pr13/bin/gcc.arm-linux-generic-elf-32bit./Users/john/QtSDK/Maemo/4.6.2/targets/fremantle-pr13/bin/gdb</value>
+    <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
+     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
+      <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">false</value>
+      <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibraryAuto">true</value>
+      <value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value>
+      <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
+     </valuemap>
+     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
+      <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value>
+      <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value>
+      <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
+     </valuemap>
+     <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
+    </valuemap>
+    <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
+     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
+      <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value>
+      <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
+      <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
+     </valuemap>
+     <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
+    </valuemap>
+    <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
+    <value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
+    <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Qt for Fremantle PR1.3 Devices (Qt SDK) Debug</value>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
+    <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">2</value>
+    <value type="QString" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory">/Users/john/Develop/n900/pierogi-build-maemo-Qt_for_Fremantle_PR1_3_Devices__Qt_SDK__Debug</value>
+    <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.QtVersionId">4</value>
+    <value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value>
+   </valuemap>
+   <value type="int" key="ProjectExplorer.Target.BuildConfigurationCount">2</value>
+   <valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0">
+    <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
+     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Create Debian Package</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">MaemoDebianPackageCreationStep</value>
+     </valuemap>
+     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName"></value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Install Debian package to sysroot</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">MaemoInstallDebianPackageToSysrootStep</value>
+     </valuemap>
+     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.2">
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy package via UTFS mount</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">MaemoMountAndInstallDeployStep</value>
+      <valuelist type="QVariantList" key="Qt4ProjectManager.MaemoRunConfiguration.LastDeployedFiles">
+       <value type="QString">/Users/john/Develop/n900/pierogi-build-maemo-Qt_for_Fremantle_PR1_3_Devices__Qt_SDK__Release/pierogi_0_0_1_armel.deb</value>
+       <value type="QString">/Users/john/Develop/n900/pierogi-build-maemo-Qt_for_Fremantle_PR1_3_Devices__Qt_SDK__Release/pierogi_0_0_1_armel.deb</value>
+      </valuelist>
+      <valuelist type="QVariantList" key="Qt4ProjectManager.MaemoRunConfiguration.LastDeployedHosts">
+       <value type="QString">192.168.0.15</value>
+       <value type="QString">localhost</value>
+      </valuelist>
+      <valuelist type="QVariantList" key="Qt4ProjectManager.MaemoRunConfiguration.LastDeployedRemotePaths">
+       <value type="QString"></value>
+       <value type="QString"></value>
+      </valuelist>
+      <valuelist type="QVariantList" key="Qt4ProjectManager.MaemoRunConfiguration.LastDeployedTimes">
+       <value type="QDateTime">2012-01-01T15:41:24</value>
+       <value type="QDateTime">2012-01-01T15:35:35</value>
+      </valuelist>
+     </valuemap>
+     <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">3</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value>
+    </valuemap>
+    <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build Debian Package and Install to Maemo5 Device</value>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">DeployToFremantleWithPackaging</value>
+    <value type="qulonglong" key="Qt4ProjectManager.MaemoRunConfiguration.DeviceId">2</value>
+   </valuemap>
+   <valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.1">
+    <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
+     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Copy files to sysroot</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">MaemoMakeInstallToSysrootStep</value>
+     </valuemap>
+     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy files via UTFS mount</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">MaemoMountAndCopyDeployStep</value>
+      <valuelist type="QVariantList" key="Qt4ProjectManager.MaemoRunConfiguration.LastDeployedFiles"/>
+      <valuelist type="QVariantList" key="Qt4ProjectManager.MaemoRunConfiguration.LastDeployedHosts"/>
+      <valuelist type="QVariantList" key="Qt4ProjectManager.MaemoRunConfiguration.LastDeployedRemotePaths"/>
+      <valuelist type="QVariantList" key="Qt4ProjectManager.MaemoRunConfiguration.LastDeployedTimes"/>
+     </valuemap>
+     <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value>
+    </valuemap>
+    <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Copy Files to Maemo5 Device</value>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">DeployToFremantleWithoutPackaging</value>
+    <value type="qulonglong" key="Qt4ProjectManager.MaemoRunConfiguration.DeviceId">1</value>
+   </valuemap>
+   <value type="int" key="ProjectExplorer.Target.DeployConfigurationCount">2</value>
+   <valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0">
+    <value type="bool" key="Analyzer.Project.UseGlobal">true</value>
+    <value type="bool" key="Analyzer.Project.UseGlobal">true</value>
+    <valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/>
+    <valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/>
+    <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value>
+    <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value>
+    <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value>
+    <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value>
+    <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value>
+    <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value>
+    <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value>
+    <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value>
+    <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value>
+    <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value>
+    <value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value>
+    <value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value>
+    <value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value>
+    <value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value>
+    <value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value>
+    <value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value>
+    <value type="int" key="Analyzer.Valgrind.NumCallers">25</value>
+    <value type="int" key="Analyzer.Valgrind.NumCallers">25</value>
+    <valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/>
+    <valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/>
+    <value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value>
+    <value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value>
+    <value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value>
+    <value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value>
+    <valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds">
+     <value type="int">0</value>
+     <value type="int">1</value>
+     <value type="int">2</value>
+     <value type="int">3</value>
+     <value type="int">4</value>
+     <value type="int">5</value>
+     <value type="int">6</value>
+     <value type="int">7</value>
+     <value type="int">8</value>
+     <value type="int">9</value>
+     <value type="int">10</value>
+     <value type="int">11</value>
+     <value type="int">12</value>
+     <value type="int">13</value>
+     <value type="int">14</value>
+    </valuelist>
+    <valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds">
+     <value type="int">0</value>
+     <value type="int">1</value>
+     <value type="int">2</value>
+     <value type="int">3</value>
+     <value type="int">4</value>
+     <value type="int">5</value>
+     <value type="int">6</value>
+     <value type="int">7</value>
+     <value type="int">8</value>
+     <value type="int">9</value>
+     <value type="int">10</value>
+     <value type="int">11</value>
+     <value type="int">12</value>
+     <value type="int">13</value>
+     <value type="int">14</value>
+    </valuelist>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">pierogi (on Remote Device)</value>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MaemoRunConfiguration</value>
+    <value type="QString" key="Qt4ProjectManager.MaemoRunConfiguration.Arguments"></value>
+    <value type="int" key="Qt4ProjectManager.MaemoRunConfiguration.BaseEnvironmentBase">1</value>
+    <valuelist type="QVariantList" key="Qt4ProjectManager.MaemoRunConfiguration.ExportedLocalDirs"/>
+    <value type="QString" key="Qt4ProjectManager.MaemoRunConfiguration.ProFile">pierogi.pro</value>
+    <valuelist type="QVariantList" key="Qt4ProjectManager.MaemoRunConfiguration.RemoteMountPoints"/>
+    <valuelist type="QVariantList" key="Qt4ProjectManager.MaemoRunConfiguration.UserEnvironmentChanges"/>
+    <value type="QString" key="RemoteLinux.RunConfig.AlternateRemoteExecutable"></value>
+    <value type="bool" key="RemoteLinux.RunConfig.UseAlternateRemoteExecutable">false</value>
+    <value type="uint" key="RunConfiguration.QmlDebugServerPort">3768</value>
+    <value type="bool" key="RunConfiguration.UseCppDebugger">true</value>
+    <value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
+    <value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">false</value>
+   </valuemap>
+   <value type="int" key="ProjectExplorer.Target.RunConfigurationCount">1</value>
+  </valuemap>
+ </data>
+ <data>
+  <variable>ProjectExplorer.Project.Target.1</variable>
+  <valuemap type="QVariantMap">
+   <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Qt Simulator</value>
+   <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Qt Simulator</value>
+   <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Target.QtSimulatorTarget</value>
+   <value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value>
+   <value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
+   <value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
+   <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
+    <value type="QString" key="ProjectExplorer.BuildCOnfiguration.ToolChain">ProjectExplorer.ToolChain.Gcc:/usr/bin/g++.x86-macos-generic-mach_o-64bit./usr/bin/gdb</value>
+    <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
+     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
+      <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">false</value>
+      <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibraryAuto">true</value>
+      <value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value>
+      <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
+     </valuemap>
+     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
+      <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value>
+      <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value>
+      <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
+     </valuemap>
+     <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
+    </valuemap>
+    <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
+     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
+      <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value>
+      <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
+      <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
+     </valuemap>
+     <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
+    </valuemap>
+    <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
+    <value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
+    <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Simulator Qt for GCC (Qt SDK) Debug</value>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
+    <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">2</value>
+    <value type="QString" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory">/Users/john/Develop/n900/pierogi-build-simulator-Simulator_Qt_for_GCC__Qt_SDK__Debug</value>
+    <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.QtVersionId">2</value>
+    <value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value>
+   </valuemap>
+   <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1">
+    <value type="QString" key="ProjectExplorer.BuildCOnfiguration.ToolChain">ProjectExplorer.ToolChain.Gcc:/usr/bin/g++.x86-macos-generic-mach_o-64bit./usr/bin/gdb</value>
+    <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
+     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
+      <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">false</value>
+      <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibraryAuto">true</value>
+      <value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value>
+      <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
+     </valuemap>
+     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
+      <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value>
+      <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value>
+      <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
+     </valuemap>
+     <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
+    </valuemap>
+    <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
+     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
+      <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value>
+      <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
+      <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
+     </valuemap>
+     <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
+    </valuemap>
+    <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
+    <value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
+    <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Simulator Qt for GCC (Qt SDK) Release</value>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
+    <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value>
+    <value type="QString" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory">/Users/john/Develop/n900/pierogi-build-simulator-Simulator_Qt_for_GCC__Qt_SDK__Release</value>
+    <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.QtVersionId">2</value>
+    <value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value>
+   </valuemap>
+   <value type="int" key="ProjectExplorer.Target.BuildConfigurationCount">2</value>
+   <valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0">
+    <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
+     <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">0</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value>
+    </valuemap>
+    <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">No deployment</value>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.DefaultDeployConfiguration</value>
+   </valuemap>
+   <value type="int" key="ProjectExplorer.Target.DeployConfigurationCount">1</value>
+   <valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0">
+    <value type="bool" key="Analyzer.Project.UseGlobal">true</value>
+    <value type="bool" key="Analyzer.Project.UseGlobal">true</value>
+    <valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/>
+    <valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/>
+    <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value>
+    <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value>
+    <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value>
+    <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value>
+    <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value>
+    <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value>
+    <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value>
+    <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value>
+    <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value>
+    <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value>
+    <value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value>
+    <value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value>
+    <value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value>
+    <value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value>
+    <value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value>
+    <value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value>
+    <value type="int" key="Analyzer.Valgrind.NumCallers">25</value>
+    <value type="int" key="Analyzer.Valgrind.NumCallers">25</value>
+    <valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/>
+    <valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/>
+    <value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value>
+    <value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value>
+    <value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value>
+    <value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value>
+    <valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds">
+     <value type="int">0</value>
+     <value type="int">1</value>
+     <value type="int">2</value>
+     <value type="int">3</value>
+     <value type="int">4</value>
+     <value type="int">5</value>
+     <value type="int">6</value>
+     <value type="int">7</value>
+     <value type="int">8</value>
+     <value type="int">9</value>
+     <value type="int">10</value>
+     <value type="int">11</value>
+     <value type="int">12</value>
+     <value type="int">13</value>
+     <value type="int">14</value>
+    </valuelist>
+    <valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds">
+     <value type="int">0</value>
+     <value type="int">1</value>
+     <value type="int">2</value>
+     <value type="int">3</value>
+     <value type="int">4</value>
+     <value type="int">5</value>
+     <value type="int">6</value>
+     <value type="int">7</value>
+     <value type="int">8</value>
+     <value type="int">9</value>
+     <value type="int">10</value>
+     <value type="int">11</value>
+     <value type="int">12</value>
+     <value type="int">13</value>
+     <value type="int">14</value>
+    </valuelist>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">pierogi</value>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration</value>
+    <value type="int" key="Qt4ProjectManager.Qt4RunConfiguration.BaseEnvironmentBase">2</value>
+    <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.CommandLineArguments"></value>
+    <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.ProFile">pierogi.pro</value>
+    <value type="bool" key="Qt4ProjectManager.Qt4RunConfiguration.UseDyldImageSuffix">false</value>
+    <value type="bool" key="Qt4ProjectManager.Qt4RunConfiguration.UseTerminal">false</value>
+    <valuelist type="QVariantList" key="Qt4ProjectManager.Qt4RunConfiguration.UserEnvironmentChanges"/>
+    <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory"></value>
+    <value type="uint" key="RunConfiguration.QmlDebugServerPort">3768</value>
+    <value type="bool" key="RunConfiguration.UseCppDebugger">true</value>
+    <value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
+    <value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">false</value>
+   </valuemap>
+   <value type="int" key="ProjectExplorer.Target.RunConfigurationCount">1</value>
+  </valuemap>
+ </data>
+ <data>
+  <variable>ProjectExplorer.Project.TargetCount</variable>
+  <value type="int">2</value>
+ </data>
+ <data>
+  <variable>ProjectExplorer.Project.Updater.EnvironmentId</variable>
+  <value type="QString">{89f2fff6-28a5-4dd8-955b-cb93cd3c3186}</value>
+ </data>
+ <data>
+  <variable>ProjectExplorer.Project.Updater.FileVersion</variable>
+  <value type="int">10</value>
+ </data>
+</qtcreator>
diff --git a/pierogi64.png b/pierogi64.png
new file mode 100644 (file)
index 0000000..8fed1ec
Binary files /dev/null and b/pierogi64.png differ
diff --git a/pierogi_harmattan.desktop b/pierogi_harmattan.desktop
new file mode 100644 (file)
index 0000000..6c65e39
--- /dev/null
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=pierogi
+Exec=/usr/bin/single-instance /opt/pierogi/bin/pierogi
+Icon=/usr/share/icons/hicolor/80x80/apps/pierogi80.png
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/piraboutform.cpp b/piraboutform.cpp
new file mode 100644 (file)
index 0000000..ab3221d
--- /dev/null
@@ -0,0 +1,17 @@
+#include "piraboutform.h"
+#include "ui_piraboutform.h"
+
+PIRAboutForm::PIRAboutForm(QWidget *parent) :
+  QWidget(parent),
+  ui(new Ui::PIRAboutForm)
+{
+  ui->setupUi(this);
+
+  setAttribute(Qt::WA_Maemo5StackedWindow);
+  setWindowFlags(windowFlags() | Qt::Window);
+}
+
+PIRAboutForm::~PIRAboutForm()
+{
+  delete ui;
+}
diff --git a/piraboutform.h b/piraboutform.h
new file mode 100644 (file)
index 0000000..7b37799
--- /dev/null
@@ -0,0 +1,22 @@
+#ifndef PIRABOUTFORM_H
+#define PIRABOUTFORM_H
+
+#include <QWidget>
+
+namespace Ui {
+class PIRAboutForm;
+}
+
+class PIRAboutForm : public QWidget
+{
+  Q_OBJECT
+  
+public:
+  explicit PIRAboutForm(QWidget *parent = 0);
+  ~PIRAboutForm();
+  
+private:
+  Ui::PIRAboutForm *ui;
+};
+
+#endif // PIRABOUTFORM_H
diff --git a/piraboutform.ui b/piraboutform.ui
new file mode 100644 (file)
index 0000000..7b86198
--- /dev/null
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>PIRAboutForm</class>
+ <widget class="QWidget" name="PIRAboutForm">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>800</width>
+    <height>445</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>Form</string>
+  </property>
+  <layout class="QGridLayout" name="gridLayout">
+   <property name="margin">
+    <number>0</number>
+   </property>
+   <item row="0" column="0">
+    <widget class="QScrollArea" name="scrollArea">
+     <property name="widgetResizable">
+      <bool>true</bool>
+     </property>
+     <widget class="QWidget" name="scrollAreaWidgetContents">
+      <property name="geometry">
+       <rect>
+        <x>0</x>
+        <y>0</y>
+        <width>798</width>
+        <height>443</height>
+       </rect>
+      </property>
+      <layout class="QGridLayout" name="gridLayout_2">
+       <property name="margin">
+        <number>0</number>
+       </property>
+       <item row="0" column="0">
+        <widget class="QTextBrowser" name="textBrowser">
+         <property name="source">
+          <url>
+           <string>qrc:/doc/about.html</string>
+          </url>
+         </property>
+         <property name="openExternalLinks">
+          <bool>true</bool>
+         </property>
+        </widget>
+       </item>
+      </layout>
+     </widget>
+    </widget>
+   </item>
+  </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/pirdevice.cpp b/pirdevice.cpp
new file mode 100644 (file)
index 0000000..0b67a44
--- /dev/null
@@ -0,0 +1,197 @@
+#include "pirdevice.h"
+
+//#define DEBUGGING
+
+// Needed system includes:
+#include <sys/ioctl.h>
+#ifdef DEBUGGING
+#include <iostream>
+#include <sys/time.h>
+timeval previousTime;
+#else
+//#ifndef DEBUGGING
+#include <linux/types.h>
+#include <linux/ioctl.h>
+#endif // DEBUGGING
+#include <fcntl.h>
+
+// Includes I'm using for error handling stuff:
+#include "pirexception.h"
+#include <errno.h>
+#include <sstream>
+
+// The N900's IR transmitter is controlled by a device driver created
+// specifically for the LIRC daemon:
+#define PATH_TO_LIRC_DEVICE "/dev/lirc0"
+
+// It appears that the frequency on this device can range between
+// 20000 on the low end and 500000 on the high end...
+// 38000 is the default for LIRC:
+//#define DEFAULT_FREQUENCY 38000
+
+// The duty cycle is a percentage (0-100), 50 is LIRC's default:
+//#define DEFAULT_DUTY_CYCLE 50
+
+
+PIRDevice::PIRDevice()
+  : fileDescriptor(-1),
+    index(0)
+{
+  openLircDevice();
+}
+
+
+PIRDevice::PIRDevice(
+  unsigned int frequency,
+  unsigned int dutyCycle)
+  : fileDescriptor(-1),
+    index(0)
+{
+  openLircDevice();
+  setCarrierFrequency(frequency);
+  setDutyCycle(dutyCycle);
+}
+
+
+PIRDevice::~PIRDevice()
+{
+  if (fileDescriptor >= 0) close(fileDescriptor);
+}
+
+
+void PIRDevice::openLircDevice()
+{
+#ifdef DEBUGGING
+  // check the current time:
+  gettimeofday(&previousTime, NULL);
+#else
+//#ifndef DEBUGGING
+  fileDescriptor = open(PATH_TO_LIRC_DEVICE, O_WRONLY);
+
+  if (fileDescriptor == -1)
+  {
+    std::stringstream ss;
+    ss << "Failed to connect to " << PATH_TO_LIRC_DEVICE << "\n";
+    ss << "Error is " << strerror(errno) << "\n";
+    throw PIRException(ss.str());
+  }
+#endif // DEBUGGING
+}
+
+
+void PIRDevice::addPair(
+  int pulse,
+  int space)
+{
+  if (index >= (BUFFER_SIZE - 1))
+  {
+    // Needed room for 2 ints, didn't have it.
+    throw PIRException("Buffer overflow in PIRCommandBuffer object.\n");
+  }
+
+  buffer[index] = pulse;
+  ++index;
+  buffer[index] = space;
+  ++index;
+}
+
+
+void PIRDevice::addSingle(
+  int single)
+{
+  if (index >= BUFFER_SIZE)
+  {
+    throw PIRException("Buffer overflow in PIRCommandBuffer object.\n");
+  }
+
+  buffer[index] = single;
+  ++index;
+}
+
+
+void PIRDevice::sendCommandToDevice()
+{
+  // Sanity check first:
+  if (!index)
+  {
+    // We have no data!
+    // We should probably complain here, but for now, just return.
+    return;
+  }
+
+  // Note: if the generated command string ends on a "space", we'll just
+  // go ahead and ignore that last value.  Want the light switched off
+  // permanently at the end of the command string, not temporarily.
+  // So, only odd-numbered strings of commands are allowed:
+  if ((index % 2) == 0)
+  {
+    --index;
+  }
+
+#ifdef DEBUGGING
+  timeval newTime;
+  gettimeofday(&newTime, NULL);
+  long microseconds = newTime.tv_usec - previousTime.tv_usec;
+  microseconds += (newTime.tv_sec - previousTime.tv_sec) * 1000000;
+  std::cout << "Time since last call to device: " << microseconds << std::endl;
+  previousTime = newTime;
+//#ifdef DEBUGGING
+  std::cout << "Sending array of ints to device:\n";
+  int blah = 0;
+  while (blah < index)
+  {
+    std::cout << "buffer[" << blah << "]: " << buffer[blah] << "\n";
+    ++blah;
+  }
+  std::cout << std::endl;
+#else
+  if (write(fileDescriptor, buffer, index * sizeof(int)) == -1)
+  {
+    std::stringstream ss;
+    ss << "Failed to send command.\n";
+    ss << "IR device returned error: " << strerror(errno) << "\n";
+    throw PIRException(ss.str());
+  }
+#endif // DEBUGGING
+
+  // Reset the index:
+  index = 0;
+}
+
+
+void PIRDevice::setCarrierFrequency(
+  unsigned int frequency)
+{
+//  if (!frequency) frequency = DEFAULT_FREQUENCY;
+
+#ifdef DEBUGGING
+  std::cout << "Setting frequency to " << frequency << "\n";
+#else
+  if (ioctl(fileDescriptor, _IOW('i', 0x13, __u32), &frequency) == -1)
+  {
+    std::stringstream ss;
+    ss << "Failed to set carrier frequency.\n";
+    ss << "IR device returned error: " << strerror(errno) << "\n";
+    throw PIRException(ss.str());
+  }
+#endif // DEBUGGING
+}
+
+
+void PIRDevice::setDutyCycle(
+  unsigned int dutyCycle)
+{
+//  if (dutyCycle > 100) dutyCycle = DEFAULT_DUTY_CYCLE;
+
+#ifdef DEBUGGING
+  std::cout << "Setting duty cycle to " << dutyCycle << "\n";
+#else
+  if (ioctl(fileDescriptor, _IOW('i', 0x15, __u32), &dutyCycle) == -1)
+  {
+    std::stringstream ss;
+    ss << "Failed to set duty cycle percentage.\n";
+    ss << "IR device returned error: " << strerror(errno) << "\n";
+    throw PIRException(ss.str());
+  }
+#endif // DEBUGGING
+}
diff --git a/pirdevice.h b/pirdevice.h
new file mode 100644 (file)
index 0000000..d9c5911
--- /dev/null
@@ -0,0 +1,51 @@
+#ifndef PIRDEVICE_H
+#define PIRDEVICE_H
+
+//
+// Encapsulates communication with the N900's IR hardware, using the LIRC
+// device that (hopefully) exists on all N900s.
+//
+
+// To my current knowledge, you can send a maximum of 256 integers to the 
+// N900's IR device driver, so that's probably a good limit to set:
+#define BUFFER_SIZE 256
+
+class PIRDevice
+{
+public:
+  PIRDevice();
+
+  PIRDevice(
+    unsigned int frequency,
+    unsigned int dutyCycle);
+
+  ~PIRDevice();
+
+  // Most remotes will just want to append pairs of on/off times:
+  void addPair(
+    int pulse,
+    int space);
+
+  // Some remotes need to specify the switching values individually:
+  void addSingle(
+    int single);
+
+  // Send the buffered pulses to the IR device:
+  void sendCommandToDevice();
+
+  void setCarrierFrequency(
+    unsigned int frequency);
+
+  void setDutyCycle(
+    unsigned int dutyCycle);
+
+private:
+  void openLircDevice();
+
+  int fileDescriptor;
+
+  int buffer[BUFFER_SIZE];
+  int index;
+};
+
+#endif // PIRDEVICE_H
diff --git a/pirdocumentationform.cpp b/pirdocumentationform.cpp
new file mode 100644 (file)
index 0000000..99ebe98
--- /dev/null
@@ -0,0 +1,17 @@
+#include "pirdocumentationform.h"
+#include "ui_pirdocumentationform.h"
+
+PIRDocumentationForm::PIRDocumentationForm(QWidget *parent) :
+  QWidget(parent),
+  ui(new Ui::PIRDocumentationForm)
+{
+  ui->setupUi(this);
+
+  setAttribute(Qt::WA_Maemo5StackedWindow);
+  setWindowFlags(windowFlags() | Qt::Window);
+}
+
+PIRDocumentationForm::~PIRDocumentationForm()
+{
+  delete ui;
+}
diff --git a/pirdocumentationform.h b/pirdocumentationform.h
new file mode 100644 (file)
index 0000000..c112f53
--- /dev/null
@@ -0,0 +1,22 @@
+#ifndef PIRDOCUMENTATIONFORM_H
+#define PIRDOCUMENTATIONFORM_H
+
+#include <QWidget>
+
+namespace Ui {
+class PIRDocumentationForm;
+}
+
+class PIRDocumentationForm : public QWidget
+{
+  Q_OBJECT
+  
+public:
+  explicit PIRDocumentationForm(QWidget *parent = 0);
+  ~PIRDocumentationForm();
+  
+private:
+  Ui::PIRDocumentationForm *ui;
+};
+
+#endif // PIRDOCUMENTATIONFORM_H
diff --git a/pirdocumentationform.ui b/pirdocumentationform.ui
new file mode 100644 (file)
index 0000000..ef46942
--- /dev/null
@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>PIRDocumentationForm</class>
+ <widget class="QWidget" name="PIRDocumentationForm">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>800</width>
+    <height>445</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>Pierogi Documentation</string>
+  </property>
+  <layout class="QGridLayout" name="gridLayout_2">
+   <property name="margin">
+    <number>0</number>
+   </property>
+   <item row="0" column="0">
+    <widget class="QScrollArea" name="documentationScrollArea">
+     <property name="widgetResizable">
+      <bool>true</bool>
+     </property>
+     <widget class="QWidget" name="documentationScrollAreaWidgetContents">
+      <property name="geometry">
+       <rect>
+        <x>0</x>
+        <y>0</y>
+        <width>798</width>
+        <height>443</height>
+       </rect>
+      </property>
+      <layout class="QGridLayout" name="gridLayout">
+       <property name="sizeConstraint">
+        <enum>QLayout::SetDefaultConstraint</enum>
+       </property>
+       <property name="margin">
+        <number>0</number>
+       </property>
+       <item row="0" column="0">
+        <widget class="QTextBrowser" name="documentationTextBrowser">
+         <property name="source">
+          <url>
+           <string>qrc:/doc/documentation.html</string>
+          </url>
+         </property>
+         <property name="openExternalLinks">
+          <bool>true</bool>
+         </property>
+        </widget>
+       </item>
+      </layout>
+     </widget>
+    </widget>
+   </item>
+  </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/pirexception.cpp b/pirexception.cpp
new file mode 100644 (file)
index 0000000..a0802eb
--- /dev/null
@@ -0,0 +1,18 @@
+#include "pirexception.h"
+
+#include <QtGui/QMessageBox>
+
+/*
+PirException::PirException()
+{
+}
+*/
+
+
+void PIRException::display()
+{
+  QMessageBox errBox;
+  errBox.setText(errStr.c_str());
+  errBox.setIcon(QMessageBox::Warning);
+  errBox.exec();
+}
diff --git a/pirexception.h b/pirexception.h
new file mode 100644 (file)
index 0000000..51f258d
--- /dev/null
@@ -0,0 +1,28 @@
+#ifndef PIREXCEPTION_H
+#define PIREXCEPTION_H
+
+#include <string>
+
+class PIRException
+{
+public:
+  PIRException(
+    std::string s)
+  : errStr(s)
+  {}
+
+  std::string getError();
+
+  void display();
+
+private:
+  std::string errStr;
+};
+
+
+inline std::string PIRException::getError()
+{
+  return errStr;
+}
+
+#endif // PIREXCEPTION_H
diff --git a/pirkeynames.h b/pirkeynames.h
new file mode 100644 (file)
index 0000000..ba806e1
--- /dev/null
@@ -0,0 +1,99 @@
+#ifndef PIRKEYNAMES_H
+#define PIRKEYNAMES_H
+
+// I will need to eventually have a set of "universal" buttons, something that
+// should be able to match a decent subset of the buttons on all the remotes
+// out there.  The following list should give me a decent start...
+enum PIRKeyName{
+  // The "Unmapped" key is a placeholder for commands with no key mapping:
+  Unmapped_Key,
+  // Number keys:
+  Zero_Key,
+  One_Key,
+  Two_Key,
+  Three_Key,
+  Four_Key,
+  Five_Key,
+  Six_Key,
+  Seven_Key,
+  Eight_Key,
+  Nine_Key,
+  // Other keypad commands:
+  Enter_Key,
+  Clear_Key,
+  PlusOneHundred_Key,
+  Dash_Key,
+  DoubleDigit_Key,
+  // Power control:
+  Power_Key,
+  // Volume control:
+  VolumeUp_Key,
+  VolumeDown_Key,
+  Mute_Key,
+  // Channel control:
+  ChannelUp_Key,
+  ChannelDown_Key,
+  PrevChannel_Key,
+  Input_Key,
+  // Recorded media control:
+  Play_Key,
+  Pause_Key,
+  Stop_Key,
+  Record_Key,
+  FastForward_Key,
+  Rewind_Key,
+  Next_Key,
+  Previous_Key,
+  StepForward_Key,
+  StepBack_Key,
+  Advance_Key,
+  Replay_Key,
+  Eject_Key,
+  // Menu control:
+  Menu_Key,
+  Up_Key,
+  Down_Key,
+  Left_Key,
+  Right_Key,
+  Select_Key,
+  Exit_Key,
+  // Color buttons:
+  Red_Key,
+  Green_Key,
+  Yellow_Key,
+  Blue_Key,
+  // Picture-in-picture stuff:
+  PIP_Key,
+  PIPSwap_Key,
+  PIPMove_Key,
+  PIPSource_Key,
+  PIPChannelUp_Key,
+  PIPChannelDown_Key,
+  // DVD / Blue-ray / etc. keys:
+  DiscTitle_Key,
+  DiscMenu_Key,
+  DiscSelect_Key,
+  // VHS / Beta / etc. keys:
+  VHSSpeed_Key,
+  TrackingPlus_Key,
+  TrackingMinus_Key,
+  AutoTracking_Key,
+  // Other keys:
+  Captions_Key,
+  Info_Key,
+  Guide_Key,
+  Sleep_Key,
+  PictureMode_Key, // "PMODE"
+  SoundMode_Key,
+  Clock_Key,
+  Timer_Key,
+  Reset_Key,
+  Program_Key,
+  Surround_Key,
+  AspectRatio_Key,
+  Language_Key,
+  Favorites_Key,
+  Scan_Key
+};
+
+#endif // PIRKEYNAMES_H
diff --git a/pirkeysetmanager.cpp b/pirkeysetmanager.cpp
new file mode 100644 (file)
index 0000000..2129699
--- /dev/null
@@ -0,0 +1,240 @@
+#include "pirkeysetmanager.h"
+#include "pirkeysetmetadata.h"
+#include "keysets/apple.h"
+#include "keysets/ei.h"
+#include "keysets/goldstar.h"
+#include "keysets/hauppauge.h"
+#include "keysets/lg.h"
+#include "keysets/nokia.h"
+#include "keysets/panasonic.h"
+#include "keysets/samsung.h"
+#include "keysets/sanyo.h"
+#include "keysets/sharp.h"
+#include "keysets/sony.h"
+#include "keysets/toshiba.h"
+#include "keysets/zenith.h"
+//#include "protocol.h"
+#include "pirmakenames.h"
+
+#include "pirexception.h"
+
+#include <QObject>
+//#include <QMetaType>
+
+// I'll be handling the threading of the keyset commands in this object:
+#include <QMutex>
+
+// This file defines some global stuff!  First, threading globals:
+
+// The stopRepeatingFlag boolean is the method used to tell running commands
+// in the worker thread to stop:
+bool stopRepeatingFlag;
+QMutex stopRepeatingMutex;
+
+// Next, a global for helping out with Make names:
+
+PIRMakeMgr makeManager;
+
+// Now, on to the actual method definitions:
+
+PIRKeysetManager::PIRKeysetManager(
+  QObject *guiObject)
+  : counter(0)
+{
+  // Create the keysets.  This needs to be worked on!
+  populateKeyset(new AppleWhiteRemote(guiObject, counter++));
+  populateKeyset(new EiKeyset(guiObject, counter++));
+  populateKeyset(new GoldStarTV1(guiObject, counter++));
+  populateKeyset(new GoldStarTV2(guiObject, counter++));
+  populateKeyset(new GoldStarVCR1(guiObject, counter++));
+  populateKeyset(new GoldStarVCR1a(guiObject, counter++));
+  populateKeyset(new GoldStarVCR1b(guiObject, counter++));
+  populateKeyset(new GoldStarVCR1c(guiObject, counter++));
+  populateKeyset(new GoldStarVCR1d(guiObject, counter++));
+  populateKeyset(new GoldStarCD1(guiObject, counter++));
+  populateKeyset(new HauppaugeGeneric(guiObject, counter++));
+  populateKeyset(new HauppaugeTV1(guiObject, counter++));
+  populateKeyset(new LGTV1(guiObject, counter++));
+  populateKeyset(new LGTV1a(guiObject, counter++));
+  populateKeyset(new LGTV1b(guiObject, counter++));
+  populateKeyset(new LGTV1c(guiObject, counter++));
+  populateKeyset(new LGTV2(guiObject, counter++));
+  populateKeyset(new LGTV2a(guiObject, counter++));
+  populateKeyset(new LGTV2b(guiObject, counter++));
+  populateKeyset(new LGDisc1(guiObject, counter++));
+  populateKeyset(new LGDisc2(guiObject, counter++));
+  populateKeyset(new LGDisc2a(guiObject, counter++));
+  populateKeyset(new LGVCR1(guiObject, counter++));
+  populateKeyset(new LGVCR1a(guiObject, counter++));
+  populateKeyset(new LGVCR1b(guiObject, counter++));
+  populateKeyset(new NokiaGenericVCR(guiObject, counter++));
+  populateKeyset(new PanasonicAmp(guiObject, counter++));
+  populateKeyset(new PanasonicCarAudio(guiObject, counter++));
+  populateKeyset(new PanasonicSat1(guiObject, counter++));
+  populateKeyset(new PanasonicSat1a(guiObject, counter++));
+  populateKeyset(new PanasonicTV1(guiObject, counter++));
+  populateKeyset(new PanasonicTV1a(guiObject, counter++));
+  populateKeyset(new PanasonicTV1b(guiObject, counter++));
+  populateKeyset(new PanasonicVCR1(guiObject, counter++));
+  populateKeyset(new PanasonicVCR1a(guiObject, counter++));
+  populateKeyset(new PanasonicVCR1b(guiObject, counter++));
+  populateKeyset(new PanasonicVCR1c(guiObject, counter++));
+  populateKeyset(new PanasonicDVD1(guiObject, counter++));
+  populateKeyset(new PanasonicDVD1a(guiObject, counter++));
+  populateKeyset(new PanasonicAudio(guiObject, counter++));
+  populateKeyset(new SamsungTV1(guiObject, counter++));
+  populateKeyset(new SamsungTV1a(guiObject, counter++));
+  populateKeyset(new SamsungTV1b(guiObject, counter++));
+  populateKeyset(new SamsungTV1c(guiObject, counter++));
+  populateKeyset(new SamsungTV1d(guiObject, counter++));
+  populateKeyset(new SamsungTV1e(guiObject, counter++));
+  populateKeyset(new SamsungTV1f(guiObject, counter++));
+  populateKeyset(new SamsungTV2(guiObject, counter++));
+  populateKeyset(new SamsungTV2a(guiObject, counter++));
+  populateKeyset(new SamsungVCR1(guiObject, counter++));
+  populateKeyset(new SamsungVCR1a(guiObject, counter++));
+  populateKeyset(new SamsungVCR1b(guiObject, counter++));
+  populateKeyset(new SamsungVCR1c(guiObject, counter++));
+  populateKeyset(new SamsungVCR1d(guiObject, counter++));
+  populateKeyset(new SamsungVCR1e(guiObject, counter++));
+  populateKeyset(new SamsungDVD1(guiObject, counter++));
+  populateKeyset(new SamsungDVD1a(guiObject, counter++));
+  populateKeyset(new SamsungDVD1b(guiObject, counter++));
+  populateKeyset(new SamsungDVD2(guiObject, counter++));
+  populateKeyset(new SamsungAC1(guiObject, counter++));
+  populateKeyset(new SanyoTV1(guiObject, counter++));
+  populateKeyset(new SanyoTV2(guiObject, counter++));
+  populateKeyset(new SanyoVCR1(guiObject, counter++));
+  populateKeyset(new SharpTV1(guiObject, counter++));
+  populateKeyset(new SharpTV1a(guiObject, counter++));
+  populateKeyset(new SharpTV1b(guiObject, counter++));
+  populateKeyset(new SharpTV1c(guiObject, counter++));
+  populateKeyset(new SharpTV1d(guiObject, counter++));
+  populateKeyset(new SharpTV1e(guiObject, counter++));
+  populateKeyset(new SharpVCR1(guiObject, counter++));
+  populateKeyset(new SharpReceiver1(guiObject, counter++));
+  populateKeyset(new SonyTV1(guiObject, counter++));
+  populateKeyset(new SonyTV1a(guiObject, counter++));
+  populateKeyset(new SonyTV1b(guiObject, counter++));
+  populateKeyset(new SonyTV1d(guiObject, counter++));
+  populateKeyset(new SonyAmp1(guiObject, counter++));
+  populateKeyset(new SonyAmp2(guiObject, counter++));
+  populateKeyset(new SonyCD1(guiObject, counter++));
+  populateKeyset(new SonyCD2(guiObject, counter++));
+  populateKeyset(new SonyCD3(guiObject, counter++));
+  populateKeyset(new SonyDAT1(guiObject, counter++));
+  populateKeyset(new SonyDVD1(guiObject, counter++));
+  populateKeyset(new SonyDVD1a(guiObject, counter++));
+  populateKeyset(new SonyDVD1b(guiObject, counter++));
+  populateKeyset(new SonyDVD1c(guiObject, counter++));
+  populateKeyset(new SonyVCR1(guiObject, counter++));
+  populateKeyset(new SonyVCR1a(guiObject, counter++));
+  populateKeyset(new SonyReceiver1(guiObject, counter++));
+  populateKeyset(new ToshibaTV1(guiObject, counter++));
+  populateKeyset(new ToshibaTV1a(guiObject, counter++));
+  populateKeyset(new ToshibaTV1b(guiObject, counter++));
+  populateKeyset(new ToshibaTV1c(guiObject, counter++));
+  populateKeyset(new ToshibaTV1d(guiObject, counter++));
+  populateKeyset(new ToshibaTV1e(guiObject, counter++));
+  populateKeyset(new ToshibaVCR1(guiObject, counter++));
+  populateKeyset(new ToshibaVCR1a(guiObject, counter++));
+  populateKeyset(new ToshibaDisc1(guiObject, counter++));
+  populateKeyset(new ToshibaDisc1a(guiObject, counter++));
+  populateKeyset(new ToshibaDisc1b(guiObject, counter++));
+  populateKeyset(new ToshibaDisc1c(guiObject, counter++));
+  populateKeyset(new ToshibaDisc1d(guiObject, counter++));
+  populateKeyset(new ZenithC32V37(guiObject, counter++));
+
+  // Start the thread running:
+  commandThread.start();
+}
+
+
+PIRKeysetManager::~PIRKeysetManager()
+{
+  // Tell the keysets to stop doing any work:
+  stopRepeating();
+
+  // Tell the thread that we want it to stop:
+  commandThread.exit();
+
+  // Wait for the thread to stop:
+  commandThread.wait();
+
+  // Delete all the keysets:
+  PIRKeysetCollection::iterator i = keysetsInfo.begin();
+  while (i != keysetsInfo.end())
+  {
+    if ((*i).second) delete (*i).second;
+    ++i;
+  }
+}
+
+
+void PIRKeysetManager::stopRepeating()
+{
+  QMutexLocker locker(&stopRepeatingMutex);
+  stopRepeatingFlag = true;
+}
+
+
+bool PIRKeysetManager::hasKey(
+  int keysetID,
+  PIRKeyName name)
+{
+  PIRKeysetMetaData *meta = keysetsInfo[keysetID];
+
+  if (!meta) return false;
+
+  return meta->hasKey(name);
+}
+
+
+PIRMakeName PIRKeysetManager::getMake(
+  int keysetID)
+{
+  PIRKeysetMetaData *meta = keysetsInfo[keysetID];
+
+  if (!meta) return Any_Make; // Work on this!
+
+  return meta->getMake();
+}
+
+
+QString PIRKeysetManager::getDisplayName(
+  int keysetID)
+{
+  PIRKeysetMetaData *meta = keysetsInfo[keysetID];
+
+  if (!meta) return QString("Database Error");
+
+  return QString(meta->getKeysetName());
+}
+
+
+void PIRKeysetManager::populateKeyset(
+  PIRKeysetMetaData *keyset)
+{
+  keysetsInfo[keyset->getID()] = keyset;
+
+  keyset->moveProtocolToThread(commandThread);
+}
+
+
+void PIRKeysetManager::populateGuiWidget(
+  SelectionWindow *widget)
+{
+  PIRKeysetCollection::const_iterator i = keysetsInfo.begin();
+
+  PIRMakeName make;
+
+  while (i != keysetsInfo.end())
+  {
+    make = i->second->getMake();
+    QString tempString = makeManager.getMakeString(make);
+    tempString.append(" ");
+    tempString.append(i->second->getKeysetName());
+    widget->addNameToList(tempString, i->first, make);
+    ++i;
+  }
+}
diff --git a/pirkeysetmanager.h b/pirkeysetmanager.h
new file mode 100644 (file)
index 0000000..964ab6c
--- /dev/null
@@ -0,0 +1,53 @@
+#ifndef PIRKEYSETMANAGER_H
+#define PIRKEYSETMANAGER_H
+
+#include "pirkeysetmetadata.h"
+//#include "protocol.h"
+#include "pirkeynames.h"
+#include "selectionwindow.h"
+
+//#include <QtCore/QCoreApplication>
+#include <QThread>
+//#include <QStringList>
+
+#include <map>
+
+typedef std::map<int, PIRKeysetMetaData *> PIRKeysetCollection;
+
+class PIRKeysetManager
+{
+public:
+  PIRKeysetManager(
+    QObject *guiObject);
+
+  ~PIRKeysetManager();
+
+  void populateGuiWidget(
+    SelectionWindow *widget);
+
+  void stopRepeating();
+
+  bool hasKey(
+    int keysetID,
+    PIRKeyName name);
+
+  PIRMakeName getMake(
+    int keysetID);
+
+  QString getDisplayName(
+    int keysetID);
+
+private:
+  // This needs to be improved:
+  void populateKeyset(
+    PIRKeysetMetaData *keyset);
+
+  PIRKeysetCollection keysetsInfo;
+
+  // The counter will be used to generate unique ids for each keyset:
+  unsigned int counter;
+
+  QThread commandThread;
+};
+
+#endif // PIRKEYSETMANAGER_H
diff --git a/pirkeysetmetadata.cpp b/pirkeysetmetadata.cpp
new file mode 100644 (file)
index 0000000..9fb627f
--- /dev/null
@@ -0,0 +1,73 @@
+#include "pirkeysetmetadata.h"
+
+PIRKeysetMetaData::PIRKeysetMetaData(
+  const char *r,
+  PIRMakeName m,
+  unsigned int i)
+  : keysetName(r),
+    make(m),
+    id(i)
+{
+}
+
+bool PIRKeysetMetaData::hasKey(
+  PIRKeyName name)
+{
+  return (keys.find(name) != keys.end());
+}
+
+
+void PIRKeysetMetaData::moveProtocolToThread(
+  QThread &thread)
+{
+  threadableProtocol->moveToThread(&thread);
+}
+
+
+unsigned int PIRKeysetMetaData::getID()
+{
+  return id;
+}
+
+
+void PIRKeysetMetaData::addControlledDevice(
+  PIRMakeName make,
+  const char *model,
+  DeviceType type)
+{
+  controlledDevices.push_back(DeviceInfo(make, model, type));
+}
+
+
+void PIRKeysetMetaData::addKey(
+  const char *name,
+  PIRKeyName key,
+  unsigned long data,
+  unsigned int bits)
+{
+  // Don't have a system for the unmapped keys yet!
+  if (key != Unmapped_Key)
+  {
+    keys[key] = name;
+  }
+
+  threadableProtocol->addKey(key, data, bits);
+}
+
+
+PIRMakeName PIRKeysetMetaData::getMake()
+{
+  return make;
+}
+
+const char *PIRKeysetMetaData::getKeysetName()
+{
+  return keysetName;
+}
+
+
+void PIRKeysetMetaData::setKeysetName(
+  const char *n)
+{
+  keysetName = n;
+}
diff --git a/pirkeysetmetadata.h b/pirkeysetmetadata.h
new file mode 100644 (file)
index 0000000..f5611e3
--- /dev/null
@@ -0,0 +1,92 @@
+#ifndef PIRKEYSETMETADATA_H
+#define PIRKEYSETMETADATA_H
+
+//#include <set>
+#include <map>
+#include <list>
+//#include <string>
+
+#include "pirkeynames.h"
+#include "pirmakenames.h"
+
+#include "pirprotocol.h"
+
+typedef std::map<PIRKeyName, const char *> KeyCollection;
+
+enum DeviceType
+{
+  TV_Device,
+  VCR_Device,
+  DVD_Device,
+  Audio_Device,
+  Computer_Device
+};
+
+class DeviceInfo
+{
+public:
+  DeviceInfo(
+    PIRMakeName ma,
+    const char *mo,
+    DeviceType t)
+  : make(ma),
+    model(mo),
+    type(t)
+  {}
+
+  PIRMakeName make;
+  const char *model;
+  DeviceType type;
+};
+
+typedef std::list<DeviceInfo> DeviceCollection;
+
+class PIRKeysetMetaData
+{
+public:
+  PIRKeysetMetaData(
+    const char *keysetName,
+    PIRMakeName make,
+    unsigned int index);
+
+  bool hasKey(
+    PIRKeyName name);
+
+  unsigned int getID();
+
+  PIRMakeName getMake();
+  const char *getKeysetName();
+
+  void moveProtocolToThread(
+    QThread &thread);
+
+protected:
+  void addControlledDevice(
+    PIRMakeName make,
+    const char *model,
+    DeviceType type);
+
+  void addKey(
+    const char *name,
+    PIRKeyName key,
+    unsigned long data,
+    unsigned int bits);
+
+  KeyCollection keys;
+
+  DeviceCollection controlledDevices;
+
+  PIRProtocol *threadableProtocol;
+
+  void setKeysetName(
+    const char *name);
+
+private:
+  const char *keysetName;
+  PIRMakeName make;
+
+  unsigned int id;
+};
+
+
+#endif // PIRKEYSETMETADATA_H
diff --git a/pirkeysetwidgetitem.cpp b/pirkeysetwidgetitem.cpp
new file mode 100644 (file)
index 0000000..f2d1293
--- /dev/null
@@ -0,0 +1,23 @@
+#include "pirkeysetwidgetitem.h"
+
+PIRKeysetWidgetItem::PIRKeysetWidgetItem(
+  QString name,
+  unsigned int i,
+  PIRMakeName m)
+  : QListWidgetItem(name),
+    id(i),
+    make(m)
+{
+}
+
+
+unsigned int PIRKeysetWidgetItem::getID()
+{
+  return id;
+}
+
+
+PIRMakeName PIRKeysetWidgetItem::getMake()
+{
+  return make;
+}
diff --git a/pirkeysetwidgetitem.h b/pirkeysetwidgetitem.h
new file mode 100644 (file)
index 0000000..1b9ec5a
--- /dev/null
@@ -0,0 +1,25 @@
+#ifndef PIRKEYSETWIDGETITEM_H
+#define PIRKEYSETWIDGETITEM_H
+
+#include <QListWidgetItem>
+
+#include "pirmakenames.h"
+
+class PIRKeysetWidgetItem: public QListWidgetItem
+{
+public:
+  PIRKeysetWidgetItem(
+    QString name,
+    unsigned int id,
+    PIRMakeName make);
+
+  unsigned int getID();
+
+  PIRMakeName getMake();
+
+private:
+  unsigned int id;
+  PIRMakeName make;
+};
+
+#endif // PIRKEYSETWIDGETITEM_H
diff --git a/pirmakenames.cpp b/pirmakenames.cpp
new file mode 100644 (file)
index 0000000..8a02b3c
--- /dev/null
@@ -0,0 +1,37 @@
+#include "pirmakenames.h"
+
+PIRMakeMgr::PIRMakeMgr()
+{
+  makes[Any_Make] = "Any";
+  makes[Apple_Make] = "Apple";
+  makes[Ei_Make] = "Ei";
+  makes[GoldStar_Make] = "GoldStar";
+  makes[Hauppauge_Make] = "Hauppauge";
+  makes[LG_Make] = "LG";
+  makes[Nokia_Make] = "Nokia";
+  makes[Panasonic_Make] = "Panasonic";
+  makes[Samsung_Make] = "Samsung";
+  makes[Sanyo_Make] = "Sanyo";
+  makes[Sharp_Make] = "Sharp";
+  makes[Sony_Make] = "Sony";
+  makes[Toshiba_Make] = "Toshiba";
+  makes[Zenith_Make] = "Zenith";
+}
+
+const char *PIRMakeMgr::getMakeString(
+  PIRMakeName n)
+{
+  return makes[n];
+}
+
+
+void PIRMakeMgr::populateComboBox(
+  QComboBox *cb)
+{
+  MakeCollection::const_iterator i = makes.begin();
+  while (i != makes.end())
+  {
+    cb->insertItem(i->first, QString(i->second));
+    ++i;
+  }
+}
diff --git a/pirmakenames.h b/pirmakenames.h
new file mode 100644 (file)
index 0000000..efbe3c1
--- /dev/null
@@ -0,0 +1,45 @@
+#ifndef PIRMAKENAMES_H
+#define PIRMAKENAMES_H
+
+#include <QComboBox>
+#include <map>
+
+// The list of brands currently known by Pierogi:
+enum PIRMakeName{
+  Any_Make,
+  Apple_Make,
+  Ei_Make,
+  GoldStar_Make,
+  Hauppauge_Make,
+  LG_Make,
+  Nokia_Make,
+  Panasonic_Make,
+  Samsung_Make,
+  Sanyo_Make,
+  Sharp_Make,
+  Sony_Make,
+  Toshiba_Make,
+  Zenith_Make
+};
+
+
+// An object of convenience:
+
+typedef std::map<PIRMakeName, const char *> MakeCollection;
+
+class PIRMakeMgr
+{
+public:
+  PIRMakeMgr();
+
+  const char *getMakeString(
+    PIRMakeName n);
+
+  void populateComboBox(
+    QComboBox *cb);
+
+private:
+  MakeCollection makes;
+};
+
+#endif // PIRMAKENAMES_H
diff --git a/pirprotocol.cpp b/pirprotocol.cpp
new file mode 100644 (file)
index 0000000..f3b8ff1
--- /dev/null
@@ -0,0 +1,189 @@
+#include "pirprotocol.h"
+
+#include <QMutex>
+#include <QMetaType>
+
+#include <time.h>
+#include <sstream>
+#include <errno.h>
+#include "pirexception.h"
+
+// A flag for communicating with the main thread:
+extern bool stopRepeatingFlag;
+extern QMutex stopRepeatingMutex;
+
+// From what I understand (mostly from reading LIRC config files), NEC
+// protocol based remotes mostly use a frequency of 38000 units and a
+// duty cycle of 50%.  They'll be set to these defaults here, and overridden
+// as needed by child classes.
+
+PIRProtocol::PIRProtocol(
+  QObject *guiObject,
+  unsigned int index,
+  unsigned int gSpace,
+  bool iclflag)
+  : carrierFrequency(38000),
+    dutyCycle(50),
+    isConstantLength(iclflag),
+    gap(gSpace),
+    minimumRepetitions(0),
+    id(index)
+{
+  qRegisterMetaType<PIRKeyName>("PIRKeyName");
+
+  QObject::connect(
+    guiObject,
+    SIGNAL(buttonPressed(unsigned int, PIRKeyName)),
+    this,
+    SLOT(startSendingCommand(unsigned int, PIRKeyName)),
+    Qt::QueuedConnection);
+
+  QObject::connect(
+    this,
+    SIGNAL(commandFailed(const char *)),
+    guiObject,
+    SLOT(receivedExternalWarning(const char *)),
+    Qt::QueuedConnection);
+}
+
+
+void PIRProtocol::addKey(
+  PIRKeyName key,
+  unsigned long command,
+  unsigned int bits)
+{
+  appendToBitSeq(keycodes[key], command, bits);
+}
+
+
+/*
+void PIRProtocol::setIndex(
+  unsigned int i)
+{
+  id = i;
+}
+*/
+
+
+void PIRProtocol::setCarrierFrequency(
+  unsigned int freq)
+{
+  carrierFrequency = freq;
+}
+
+
+void PIRProtocol::setDutyCycle(
+  unsigned int dc)
+{
+  dutyCycle = dc;
+}
+
+
+void PIRProtocol::setMinimumRepetitions(
+  unsigned int minrep)
+{
+  minimumRepetitions = minrep;
+}
+
+
+bool PIRProtocol::isCommandSupported(
+  PIRKeyName command)
+{
+  return (keycodes.find(command) != keycodes.end());
+}
+
+
+void PIRProtocol::appendToBitSeq(
+  CommandSequence &sequence,
+  unsigned int bits,
+  int significantBits)
+{
+  if (significantBits == 0)
+  {
+    // This is bad, but just return silently for now...
+    return;
+  }
+
+  // For each bit in the char, append a 1 or a 0 into the sequence.
+  // Starting with the largest bit, move forward one bit at a time:
+  unsigned int currentBit = 1 << (significantBits - 1);
+
+  do
+  {
+    if (bits & currentBit)
+    {
+      sequence.push_back(1);
+    }
+    else
+    {
+      sequence.push_back(0);
+    }
+
+    currentBit = currentBit >> 1;
+  }
+  while (currentBit > 0);
+}
+
+
+void PIRProtocol::clearRepeatFlag()
+{
+  QMutexLocker locker(&stopRepeatingMutex);
+  stopRepeatingFlag = false;
+}
+
+
+bool PIRProtocol::checkRepeatFlag()
+{
+  QMutexLocker locker(&stopRepeatingMutex);
+  return stopRepeatingFlag;
+}
+
+
+// Note that the following routine blindly sleeps for the amount of time
+// specified by the LIRC config file.  The extra overhead of processing
+// each command will mean that repeated commands will overshoot the config
+// time by some amount.  We could improve accuracy by waiting a little less
+// than the specified time, if we could get a good handle on how long the
+// overhead is delaying the command...
+#define PIEROGI_OVERHEAD_HACK 13260
+
+void PIRProtocol::sleepUntilRepeat(
+  int commandDuration)
+{
+  int microseconds;
+
+  // If the LIRC config file specifies the flag "CONST_LENGTH", that means
+  // the "gap" value is the exact amount of time to wait between kicking off
+  // each command.  If not, then the "gap" needs to be added on to the total
+  // time of the previous command to see how long to sleep.
+
+  if (isConstantLength)
+  {
+    microseconds = (gap - commandDuration) - PIEROGI_OVERHEAD_HACK;
+  }
+  else
+  {
+    microseconds = gap - PIEROGI_OVERHEAD_HACK;
+  }
+
+  // Don't even bother sleeping if there's only a few microseconds:
+  if (microseconds < 1000)
+  {
+    return;
+  }
+
+  timespec sleeptime;
+  sleeptime.tv_sec = 0;
+  sleeptime.tv_nsec = microseconds * 1000;
+
+  timespec remainingtime;
+
+  if (nanosleep(&sleeptime, &remainingtime) == -1)
+  {
+    std::stringstream ss;
+    ss << "Problem while sleeping.\n";
+    ss << "Trying to sleep for: " << microseconds << "\n";
+    ss << "Nanosleep returned error: " << strerror(errno) << "\n";
+    throw PIRException(ss.str());
+  }
+}
diff --git a/pirprotocol.h b/pirprotocol.h
new file mode 100644 (file)
index 0000000..b2a0cf6
--- /dev/null
@@ -0,0 +1,103 @@
+#ifndef PIRPROTOCOL_H
+#define PIRPROTOCOL_H
+
+// The generic remote controller.
+
+#include <QObject>
+//#include <QMutex>
+#include "pirkeynames.h"
+//#include "pirdevice.h"
+
+#include <map>
+#include <deque>
+
+// We'll define a maximum number of repetitions, regardless of how long the
+// user presses the button.  (This is just in case we miss the point at which
+// he stops pressing it...)  500 should be plenty.
+#define MAX_REPEAT_COUNT 500
+
+typedef std::deque<bool> CommandSequence;
+
+// I'll go ahead and use associative arrays to build up lists of keycodes.
+typedef std::map<int, CommandSequence> KeycodeCollection;
+
+
+// Right now, the only reason for this object to inherit from QObject is
+// so it can participate in Qt-style threading.  Note that it has no
+// event loop, and no access to the GUI, so don't go trying to communicate
+// with the user here...
+class PIRProtocol: public QObject
+{
+  Q_OBJECT
+
+public:
+  PIRProtocol(
+    QObject *guiObject,
+    unsigned int index,
+    unsigned int gSpace,
+    bool iclflag);
+
+  void addKey(
+    PIRKeyName key,
+    unsigned long data,
+    unsigned int bits);
+
+//  void setIndex(
+//    unsigned int index);
+
+  void setCarrierFrequency(
+    unsigned int freq);
+
+  void setDutyCycle(
+    unsigned int dc);
+
+  void setMinimumRepetitions(
+    unsigned int minrep);
+
+public slots:
+  virtual void startSendingCommand(
+    unsigned int threadableID,
+    PIRKeyName command) = 0;
+
+signals:
+  void commandFailed(
+    const char *errString);
+
+protected:
+  bool isCommandSupported(
+    PIRKeyName command);
+
+  void clearRepeatFlag();
+  bool checkRepeatFlag();
+
+  unsigned int carrierFrequency;
+  unsigned int dutyCycle;
+
+  // "appendToBitSeq" really doesn't belong in this class...
+  void appendToBitSeq(
+    CommandSequence &sequence,
+    unsigned int bits,
+    int significantBits);
+
+  KeycodeCollection keycodes;
+
+  // A sleep function for all protocols:
+  void sleepUntilRepeat(
+    int commandDuration);
+
+  // The "gap" parameter from LIRC.  If the commands are "variable-length",
+  // this indicates the amount of time between the last pulse of one
+  // command and the first pulse of the next.  If "constant-length", it is
+  // the time between the _first_ pulse of one command and the first pulse
+  // of the next.
+
+  bool isConstantLength;
+  int gap;
+
+  // Some remotes require a minimum number of repetitions:
+  int minimumRepetitions;
+
+  unsigned int id;
+};
+
+#endif // PIRPROTOCOL_H
diff --git a/rc5protocol.cpp b/rc5protocol.cpp
new file mode 100644 (file)
index 0000000..bf53439
--- /dev/null
@@ -0,0 +1,226 @@
+#include "rc5protocol.h"
+
+#include "pirexception.h"
+
+RC5Protocol::RC5Protocol(
+  QObject *guiObject,
+  unsigned int index,
+  unsigned int bPulse,
+  unsigned int bSpace,
+  unsigned int lPulse,
+  unsigned int gSpace,
+  bool iclflag)
+  : PIRProtocol(guiObject, index, gSpace, iclflag),
+    biphasePulse(bPulse),
+    biphaseSpace(bSpace),
+    leadPulse(lPulse),
+    buffer(0),
+    keypressCount(0)
+{
+}
+
+
+void RC5Protocol::setHeaderPair(
+  unsigned int pulse,
+  unsigned int space)
+{
+  headerPulse = pulse;
+  headerSpace = space;
+  hasHeaderPair = true;
+}
+
+
+void RC5Protocol::setPreData(
+  unsigned long data,
+  unsigned int bits)
+{
+  appendToBitSeq(preData, data, bits);
+}
+
+
+void RC5Protocol::setToggleBit(
+  unsigned int bit)
+{
+  toggleBit = bit;
+}
+
+
+void RC5Protocol::startSendingCommand(
+  unsigned int threadableID,
+  PIRKeyName command)
+{
+  // Dumping entire method inside of try/catch, to deal with cross-thread
+  // exception handling:
+  try
+  {
+    clearRepeatFlag();
+
+    if (threadableID != id) return;
+
+    KeycodeCollection::const_iterator i = keycodes.find(command);
+
+    // Sanity check, make sure command exists first:
+    if (i == keycodes.end())
+    {
+      std::string s = "Tried to send a non-existent command.\n";
+      throw PIRException(s);
+    }
+
+    // Construct the object that communicates with the device driver:
+    PIRDevice device(carrierFrequency, dutyCycle);
+
+    int repeatCount = 0;
+    while (repeatCount < MAX_REPEAT_COUNT)
+    {
+      int commandDuration = 0;
+
+      // Now, throw together an RC5 protocol command string:
+      buffer = 0;
+      bufferContainsPulse = false;
+      bufferContainsSpace = false;
+  
+      // Start off the first pulse with the lead, if any:
+      if (leadPulse)
+      {
+        buffer = leadPulse;
+        bufferContainsPulse = true;
+      }
+
+      // Encode the bits:
+      commandDuration += pushBits((*i).second, device);
+
+      // Clear out the buffer, if necessary:
+      if (buffer)
+      {
+        device.addSingle(buffer);
+        commandDuration += buffer;
+        buffer = 0;
+        bufferContainsSpace = false;
+        bufferContainsPulse = false;
+      }
+
+      // Now, tell the device to send the whole command:
+      device.sendCommandToDevice();
+
+      // Sleep for an amount of time.  (Need to make this interruptable!)
+      sleepUntilRepeat(commandDuration);
+
+      // Have we satisfied the minimum number of repetitions?
+      if (repeatCount >= minimumRepetitions)
+      {
+        // Have we been told to stop yet?
+        if (checkRepeatFlag())
+        {
+          // Ok, then we can quit now:
+          ++keypressCount;
+          return;
+        }
+      }
+
+      ++repeatCount;
+    }
+  }
+  catch (PIRException e)
+  {
+    emit commandFailed(e.getError().c_str());
+  }
+
+  ++keypressCount;
+}
+
+
+int RC5Protocol::pushBits(
+  const CommandSequence &bits,
+  PIRDevice &device)
+{
+  int bitsDuration = 0;
+
+  // Rather than encoding a 0 or 1 through the timing of a pulse, RC5 encodes
+  // a bit by swapping the order of pulses and spaces.  (This is called
+  // "biphase".)
+
+  CommandSequence::const_iterator i = bits.begin();
+  int bitCount = 1;
+  bool bitValue;
+
+  while (i != bits.end())
+  {
+    bitValue = *i;
+
+    if (bitCount == toggleBit)  // are we on a toggled bit?
+    {
+      if (keypressCount % 2)  // is it time to toggle?
+      {
+        bitValue = !bitValue;  // then flip the bit
+      }
+    }
+
+    if (bitValue)
+    {
+      // We've got a "1".  First add a space, then a pulse.
+      if (bufferContainsSpace)
+      {
+        // Merge our space with the previous space, and send them to
+        // the device.
+        device.addSingle(buffer + biphaseSpace);
+        bitsDuration += (buffer + biphaseSpace);
+        buffer = 0;
+        bufferContainsSpace = false;
+      }
+      else
+      {
+        if (bufferContainsPulse)
+        {
+          // Flush the buffer:
+          device.addSingle(buffer);
+          bitsDuration += buffer;
+          buffer = 0;
+          bufferContainsPulse = false;
+        }
+        // Add a space:
+        device.addSingle(biphaseSpace);
+        bitsDuration += biphaseSpace;
+      }
+
+      // Put a pulse into the buffer to wait.
+      buffer = biphasePulse;
+      bufferContainsPulse = true;
+    }
+    else
+    {
+      // We've got a "0".  First add a pulse, then a space.
+      if (bufferContainsPulse)
+      {
+        // Merge our pulse with the previous one, and send them to the device:
+        device.addSingle(buffer + biphasePulse);
+        bitsDuration += (buffer + biphasePulse);
+        buffer = 0;
+        bufferContainsPulse = false;
+      }
+      else
+      {
+        if (bufferContainsSpace)
+        {
+          // Flush out the buffer:
+          device.addSingle(buffer);
+          bitsDuration += buffer;
+          buffer = 0;
+          bufferContainsSpace = false;
+        }
+
+        // Add a pulse:
+        device.addSingle(biphasePulse);
+        bitsDuration += biphasePulse;
+      }
+
+      // Put a space into the buffer to wait:
+      buffer = biphaseSpace;
+      bufferContainsSpace = true;
+    }
+
+    ++i;
+    ++bitCount;
+  }
+
+  return bitsDuration;
+}
diff --git a/rc5protocol.h b/rc5protocol.h
new file mode 100644 (file)
index 0000000..9413a61
--- /dev/null
@@ -0,0 +1,75 @@
+#ifndef RC5PROTOCOL_H
+#define RC5PROTOCOL_H
+
+#include "pirprotocol.h"
+#include "pirdevice.h"
+
+//
+// The RC5 protocol is apparently quite a bit older than the NEC protocol, but
+// not as widespread.  Still, it continues to be in use, as I've seen
+// by my Elgato "Eye TV" remote control.
+//
+
+class RC5Protocol: public PIRProtocol
+{
+public:
+  RC5Protocol(
+    QObject *guiObject,
+    unsigned int index,
+    unsigned int bPulse,
+    unsigned int bSpace,
+    unsigned int lPulse,
+    unsigned int gSpace,
+    bool iclflag);
+
+  void setHeaderPair(
+    unsigned int pulse,
+    unsigned int space);
+
+  void setPreData(
+    unsigned long data,
+    unsigned int bits);
+
+  void setToggleBit(
+    unsigned int bit);
+
+public slots:
+  void startSendingCommand(
+    unsigned int threadableID,
+    PIRKeyName command);
+
+protected:
+  unsigned int biphasePulse;
+  unsigned int biphaseSpace;
+
+  unsigned int leadPulse;
+
+  unsigned int headerPulse;
+  unsigned int headerSpace;
+  bool hasHeaderPair;
+
+  CommandSequence preData;
+//  CommandSequence postData;
+
+//  int trail;
+
+  // The original RC-5 specification marks a single bit as a "toggle bit",
+  // which should be inverted on each separate keypress.  This was originally
+  // the third bit, but apparently some remotes invert a different bit.
+  // If set to 0, then no bits are inverted.
+  int toggleBit;
+
+private:
+  int pushBits(
+    const CommandSequence &bits,
+    PIRDevice &device);
+
+  unsigned int buffer;
+  int keypressCount;
+
+  // Only one of the following can be true, but both can be false:
+  bool bufferContainsSpace;
+  bool bufferContainsPulse;
+};
+
+#endif // RC5PROTOCOL_H
diff --git a/selectionwindow.cpp b/selectionwindow.cpp
new file mode 100644 (file)
index 0000000..374ef11
--- /dev/null
@@ -0,0 +1,99 @@
+#include "selectionwindow.h"
+#include "pirkeysetwidgetitem.h"
+
+#include <QString>
+
+#include "pirexception.h"
+
+extern PIRMakeMgr makeManager;
+
+SelectionWindow::SelectionWindow(
+  QWidget *parent)
+  : QWidget(parent)
+{
+  // This widget will be the window holding everything else.
+  setAttribute(Qt::WA_Maemo5StackedWindow);
+  setWindowFlags(windowFlags() | Qt::Window);
+  setFixedSize(800, 445);
+
+  // First things first, need a QList of some sort to display the names:
+  nameListWidget = new QListWidget();
+
+  // Now, some filters:
+//  deviceTypeLabel = new QLabel("Filter by Device Type:");
+//  deviceTypeComboBox = new QComboBox();
+//  deviceTypeComboBox->insertItem(0, QString("Any"));
+  makeLabel = new QLabel("Make:");
+//  makeLabel->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);
+  makeComboBox = new QComboBox();
+  makeComboBox->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum);
+  makeManager.populateComboBox(makeComboBox);
+//  makeComboBox->insertItem(0, QString("Any"));
+
+  layout = new QGridLayout;
+//  layout->addWidget(deviceTypeLabel, 0, 0);
+//  layout->addWidget(deviceTypeComboBox, 1, 0);
+  layout->addWidget(makeLabel, 0, 0);
+  layout->addWidget(makeComboBox, 0, 1);
+  layout->addWidget(nameListWidget, 1, 0, 1, 2);
+
+  setLayout(layout);
+
+  connect(
+    nameListWidget,
+    SIGNAL(itemActivated(QListWidgetItem *)),
+    parent,
+    SLOT(keysetSelectionChanged(QListWidgetItem *)),
+    Qt::QueuedConnection);
+
+  connect(
+    makeComboBox,
+    SIGNAL(currentIndexChanged(int)),
+    this,
+    SLOT(filterListByMake(int)),
+    Qt::QueuedConnection);
+}
+
+
+SelectionWindow::~SelectionWindow()
+{
+//  if (deviceTypeLabel) delete deviceTypeLabel;
+//  if (deviceTypeComboBox) delete deviceTypeComboBox;
+  if (makeLabel) delete makeLabel;
+  if (makeComboBox) delete makeComboBox;
+  if (layout) delete layout;
+  if (nameListWidget) delete nameListWidget;
+}
+
+
+void SelectionWindow::addNameToList(
+  QString name,
+  unsigned int index,
+  PIRMakeName make)
+{
+  nameListWidget->addItem(new PIRKeysetWidgetItem(name, index, make));
+}
+
+
+void SelectionWindow::filterListByMake(
+  int make)
+{
+  int index = 0;
+  int count = nameListWidget->count();
+  PIRKeysetWidgetItem *item;
+  while (index < count)
+  {
+    item = dynamic_cast<PIRKeysetWidgetItem *>(nameListWidget->item(index));
+    if ((make == Any_Make) || (item->getMake() == make))
+    {
+      item->setHidden(false);
+    }
+    else
+    {
+      item->setHidden(true);
+    }
+
+    ++index;
+  }
+}
+
diff --git a/selectionwindow.h b/selectionwindow.h
new file mode 100644 (file)
index 0000000..1bc41bd
--- /dev/null
@@ -0,0 +1,41 @@
+#ifndef SELECTIONWINDOW_H
+#define SELECTIONWINDOW_H
+
+#include "pirmakenames.h"
+
+#include <QWidget>
+#include <QListWidget>
+#include <QLabel>
+#include <QComboBox>
+#include <QGridLayout>
+#include <QString>
+
+
+class SelectionWindow : public QWidget
+{
+  Q_OBJECT
+  
+public:
+  explicit SelectionWindow(
+    QWidget *parent = 0);
+
+  ~SelectionWindow();
+
+  void addNameToList(
+    QString name,
+    unsigned int index,
+    PIRMakeName make);
+
+private slots:
+  void filterListByMake(
+    int make);
+
+private:
+  QListWidget *nameListWidget;
+  QLabel *makeLabel;
+  QComboBox *makeComboBox;
+  QGridLayout *layout;
+};
+
+
+#endif // SELECTIONWINDOW_H