From 7176298055beaf1a9ad8f9fd1099f93df3461265 Mon Sep 17 00:00:00 2001 From: John Pietrzak Date: Thu, 8 Mar 2012 23:22:01 -0500 Subject: [PATCH] Interim Update I'm somewhat in the middle of a number of infrastructure changes. But, I've reached a fairly stable point, so I thought I'd checkpoint the current system. This update includes a new Preferences window, which doesn't yet have much to choose from. Pierogi can also now remember the panel choices. In keyset news, all 6 DirecTV keysets are now available. Also, a first pass has been made at keysets for BenQ, Octagon, and Xcruiser. --- forms/piraltmainform.cpp | 100 ++++++++ forms/piraltmainform.h | 59 +++++ forms/piraltmainform.ui | 383 ++++++++++++++++++++++++++++++ keysets/benq.cpp | 67 ++++++ keysets/benq.h | 18 ++ keysets/denon.cpp | 6 +- keysets/directv.cpp | 121 +++++++++- keysets/directv.h | 57 +++++ keysets/jvc.cpp | 1 + keysets/lg.cpp | 6 +- keysets/octagon.cpp | 177 ++++++++++++++ keysets/octagon.h | 38 +++ keysets/panasonic.cpp | 4 +- keysets/philips.cpp | 31 +-- keysets/samsung.cpp | 1 + keysets/xcruiser.cpp | 67 ++++++ keysets/xcruiser.h | 18 ++ mainwindow.cpp | 35 ++- mainwindow.h | 10 + mainwindow.ui | 6 + pierogi.pro | 18 +- pierogi.pro.user | 12 +- pirkeysetmanager.cpp | 16 ++ pirmakenames.cpp | 3 + pirmakenames.h | 3 + pirpanelmanager.cpp | 339 ++++++++++++++++++++++---- pirpanelmanager.h | 36 ++- pirpanelnames.h | 4 +- pirpanelselectionform.cpp | 67 +++++- pirpanelselectionform.h | 4 + pirpreferencesform.cpp | 64 +++++ pirpreferencesform.h | 29 +++ pirpreferencesform.ui | 50 ++++ protocols/directvprotocol.cpp | 23 +- protocols/directvprotocol.h | 20 +- qtc_packaging/debian_fremantle/changelog | 8 + qtc_packaging/debian_fremantle/control | 4 +- 37 files changed, 1778 insertions(+), 127 deletions(-) create mode 100644 forms/piraltmainform.cpp create mode 100644 forms/piraltmainform.h create mode 100644 forms/piraltmainform.ui create mode 100644 keysets/benq.cpp create mode 100644 keysets/benq.h create mode 100644 keysets/octagon.cpp create mode 100644 keysets/octagon.h create mode 100644 keysets/xcruiser.cpp create mode 100644 keysets/xcruiser.h create mode 100644 pirpreferencesform.cpp create mode 100644 pirpreferencesform.h create mode 100644 pirpreferencesform.ui diff --git a/forms/piraltmainform.cpp b/forms/piraltmainform.cpp new file mode 100644 index 0000000..9bf566b --- /dev/null +++ b/forms/piraltmainform.cpp @@ -0,0 +1,100 @@ +#include "piraltmainform.h" +#include "ui_piraltmainform.h" + +#include "mainwindow.h" +#include "pirkeysetmanager.h" + +// Ugly global: +extern PIRMakeMgr makeManager; + + +PIRAltMainForm::PIRAltMainForm( + MainWindow *mw) + : QWidget(0), + ui(new Ui::PIRAltMainForm), + mainWindow(mw) +{ + ui->setupUi(this); +} + +PIRAltMainForm::~PIRAltMainForm() +{ + delete ui; +} + + +void PIRAltMainForm::enableButtons( + const PIRKeysetManager *keyset, + unsigned int id) +{ + emit powerEnabled(keyset->hasKey(id, Power_Key)); + emit volumeUpEnabled(keyset->hasKey(id, VolumeUp_Key)); + emit volumeDownEnabled(keyset->hasKey(id, VolumeDown_Key)); + emit channelUpEnabled(keyset->hasKey(id, ChannelUp_Key)); + emit channelDownEnabled(keyset->hasKey(id, ChannelDown_Key)); + emit muteEnabled(keyset->hasKey(id, Mute_Key)); + + emit keysetMakeChanged(makeManager.getMakeString(keyset->getMake(id))); + emit keysetNameChanged(keyset->getDisplayName(id)); +} + + +void PIRAltMainForm::on_volumeUpButton_pressed() +{ + mainWindow->startRepeating(VolumeUp_Key); +} + +void PIRAltMainForm::on_volumeUpButton_released() +{ + mainWindow->stopRepeating(); +} + +void PIRAltMainForm::on_volumeDownButton_pressed() +{ + mainWindow->startRepeating(VolumeDown_Key); +} + +void PIRAltMainForm::on_volumeDownButton_released() +{ + mainWindow->stopRepeating(); +} + +void PIRAltMainForm::on_muteButton_pressed() +{ + mainWindow->startRepeating(Mute_Key); +} + +void PIRAltMainForm::on_muteButton_released() +{ + mainWindow->stopRepeating(); +} + +void PIRAltMainForm::on_powerButton_pressed() +{ + mainWindow->startRepeating(Power_Key); +} + +void PIRAltMainForm::on_powerButton_released() +{ + mainWindow->stopRepeating(); +} + +void PIRAltMainForm::on_channelUpButton_pressed() +{ + mainWindow->startRepeating(ChannelUp_Key); +} + +void PIRAltMainForm::on_channelUpButton_released() +{ + mainWindow->stopRepeating(); +} + +void PIRAltMainForm::on_channelDownButton_pressed() +{ + mainWindow->startRepeating(ChannelDown_Key); +} + +void PIRAltMainForm::on_channelDownButton_released() +{ + mainWindow->stopRepeating(); +} diff --git a/forms/piraltmainform.h b/forms/piraltmainform.h new file mode 100644 index 0000000..cfd7a48 --- /dev/null +++ b/forms/piraltmainform.h @@ -0,0 +1,59 @@ +#ifndef PIRALTMAINFORM_H +#define PIRALTMAINFORM_H + +#include + +class MainWindow; +class PIRKeysetManager; + +namespace Ui { +class PIRAltMainForm; +} + +class PIRAltMainForm : public QWidget +{ + Q_OBJECT + +public: +// explicit PIRAltMainForm(QWidget *parent = 0); + PIRAltMainForm( + MainWindow *mw); + + ~PIRAltMainForm(); + + void enableButtons( + const PIRKeysetManager *keyset, + unsigned int id); + +signals: + void powerEnabled(bool); + void volumeUpEnabled(bool); + void volumeDownEnabled(bool); + void channelUpEnabled(bool); + void channelDownEnabled(bool); + void muteEnabled(bool); + + void keysetMakeChanged(QString); + void keysetNameChanged(QString); + +private slots: + void on_volumeUpButton_pressed(); + void on_volumeUpButton_released(); + void on_volumeDownButton_pressed(); + void on_volumeDownButton_released(); + void on_muteButton_pressed(); + void on_muteButton_released(); + void on_powerButton_pressed(); + void on_powerButton_released(); + void on_channelUpButton_pressed(); + void on_channelUpButton_released(); + void on_channelDownButton_pressed(); + void on_channelDownButton_released(); + +private: + Ui::PIRAltMainForm *ui; + + MainWindow *mainWindow; +}; + +#endif // PIRALTMAINFORM_H diff --git a/forms/piraltmainform.ui b/forms/piraltmainform.ui new file mode 100644 index 0000000..13b2c9b --- /dev/null +++ b/forms/piraltmainform.ui @@ -0,0 +1,383 @@ + + + PIRAltMainForm + + + + 0 + 0 + 800 + 480 + + + + Form + + + + 0 + + + + + + 0 + 0 + + + + Qt::LeftToRight + + + Volume Up + + + + :/icons/sound_high_icon&48.png:/icons/sound_high_icon&48.png + + + + 48 + 48 + + + + + + + + -1 + + + 0 + + + + + + 0 + 0 + + + + Qt::LeftToRight + + + Power + + + + :/icons/on-off_icon&48.png:/icons/on-off_icon&48.png + + + + 48 + 48 + + + + + + + + Qt::Vertical + + + QSizePolicy::Minimum + + + + 20 + 20 + + + + + + + + + 0 + 0 + + + + Keyset Make + + + Qt::AlignCenter + + + + + + + + 0 + 0 + + + + Keyset Name + + + Qt::AlignCenter + + + + + + + Qt::Vertical + + + QSizePolicy::Minimum + + + + 20 + 20 + + + + + + + + + 0 + 0 + + + + Mute + + + + :/icons/sound_mute_icon&48.png:/icons/sound_mute_icon&48.png + + + + 48 + 48 + + + + + + + + + + + 0 + 0 + + + + Channel Up + + + + :/icons/br_up_icon&48.png:/icons/br_up_icon&48.png + + + + 48 + 48 + + + + + + + + + 0 + 0 + + + + Volume Down + + + + :/icons/sound_low_icon&48.png:/icons/sound_low_icon&48.png + + + + 48 + 48 + + + + + + + + + 0 + 0 + + + + Channel Down + + + + :/icons/br_down_icon&48.png:/icons/br_down_icon&48.png + + + + 48 + 48 + + + + + + + + + + + + PIRAltMainForm + volumeUpEnabled(bool) + volumeUpButton + setEnabled(bool) + + + 399 + 239 + + + 137 + 125 + + + + + PIRAltMainForm + volumeDownEnabled(bool) + volumeDownButton + setEnabled(bool) + + + 399 + 239 + + + 137 + 358 + + + + + PIRAltMainForm + channelUpEnabled(bool) + channelUpButton + setEnabled(bool) + + + 399 + 239 + + + 661 + 125 + + + + + PIRAltMainForm + channelDownEnabled(bool) + channelDownButton + setEnabled(bool) + + + 399 + 239 + + + 661 + 358 + + + + + PIRAltMainForm + muteEnabled(bool) + muteButton + setEnabled(bool) + + + 399 + 239 + + + 399 + 381 + + + + + PIRAltMainForm + powerEnabled(bool) + powerButton + setEnabled(bool) + + + 399 + 239 + + + 399 + 98 + + + + + PIRAltMainForm + keysetMakeChanged(QString) + makeLabel + setText(QString) + + + 399 + 239 + + + 399 + 224 + + + + + PIRAltMainForm + keysetNameChanged(QString) + nameLabel + setText(QString) + + + 399 + 239 + + + 399 + 250 + + + + + + volumeUpEnabled(bool) + volumeDownEnabled(bool) + muteEnabled(bool) + powerEnabled(bool) + channelUpEnabled(bool) + channelDownEnabled(bool) + keysetMakeChanged(QString) + keysetNameChanged(QString) + + diff --git a/keysets/benq.cpp b/keysets/benq.cpp new file mode 100644 index 0000000..a616987 --- /dev/null +++ b/keysets/benq.cpp @@ -0,0 +1,67 @@ +#include "benq.h" +#include "protocols/necprotocol.h" + + +BenQTV1::BenQTV1( + unsigned int index) + : PIRKeysetMetaData( + "TV Keyset 1", + BenQ_Make, + index) +{ +} + + +void BenQTV1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // Keyset already populated. + return; + } + + threadableProtocol = new NECProtocol(guiObject, index, false, true); + + setPreData(0x60, 8); + + addKey("power", Power_Key, 0x00, 8); + addKey("input", Input_Key, 0x45, 8); + addKey("backlight", Unmapped_Key, 0x54, 8); + addKey("information", Info_Key, 0x52, 8); + addKey("sleeptimer", Sleep_Key, 0x58, 8); + addKey("sound", SoundMode_Key, 0x59, 8); + addKey("usersituation", Unmapped_Key, 0x55, 8); + addKey("audiomode", Audio_Key, 0x53, 8); + addKey("teletext_display", TeletextAndTV_Key, 0x4F, 8); + addKey("tt_index", TeletextIndex_Key, 0x4C, 8); + addKey("tt_info", Unmapped_Key, 0x4E, 8); + addKey("tt_subpage", TeletextReveal_Key, 0x4D, 8); + addKey("teletext", Teletext_Key, 0x12, 8); + addKey("PIP", PIP_Key, 0x10, 8); + addKey("up", Up_Key, 0x44, 8); + addKey("down", Down_Key, 0x1D, 8); + addKey("left", Left_Key, 0x1C, 8); + addKey("right", Right_Key, 0x48, 8); + addKey("OK", Select_Key, 0x51, 8); + addKey("freeze", Pause_Key, 0x11, 8); + addKey("aspectratio", AspectRatio_Key, 0x13, 8); + addKey("vol+", VolumeUp_Key, 0x19, 8); + addKey("vol-", VolumeDown_Key, 0x15, 8); + addKey("chan+", ChannelUp_Key, 0x5C, 8); + addKey("chan-", ChannelDown_Key, 0x14, 8); + addKey("menu", Menu_Key, 0x43, 8); + addKey("mute", Mute_Key, 0x42, 8); + addKey("zap", Unmapped_Key, 0x0F, 8); + addKey("dualdigit", DoubleDigit_Key, 0x0D, 8); + addKey("1", One_Key, 0x04, 8); + addKey("2", Two_Key, 0x05, 8); + addKey("3", Three_Key, 0x5F, 8); + addKey("4", Four_Key, 0x07, 8); + addKey("5", Five_Key, 0x08, 8); + addKey("6", Six_Key, 0x09, 8); + addKey("7", Seven_Key, 0x0A, 8); + addKey("8", Eight_Key, 0x0B, 8); + addKey("9", Nine_Key, 0x0C, 8); + addKey("0", Zero_Key, 0x03, 8); +} diff --git a/keysets/benq.h b/keysets/benq.h new file mode 100644 index 0000000..4a51731 --- /dev/null +++ b/keysets/benq.h @@ -0,0 +1,18 @@ +#ifndef BENQ_H +#define BENQ_H + +#include "pirkeysetmetadata.h" + +class QObject; + +class BenQTV1: public PIRKeysetMetaData +{ +public: + BenQTV1( + unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); +}; + +#endif // BENQ_H diff --git a/keysets/denon.cpp b/keysets/denon.cpp index 006ee96..759caef 100644 --- a/keysets/denon.cpp +++ b/keysets/denon.cpp @@ -160,7 +160,7 @@ DenonDVD3::DenonDVD3( Denon_Make, index) { - addControlledDevice(Denon_Make, "dvd-1000", DVD_Device); + addControlledDevice(Denon_Make, "DVD-1000", DVD_Device); } @@ -225,7 +225,7 @@ DenonReceiver1::DenonReceiver1( Denon_Make, index) { - addControlledDevice(Denon_Make, "avr-1708", Audio_Device); + addControlledDevice(Denon_Make, "AVR-1708", Audio_Device); } @@ -340,7 +340,7 @@ DenonReceiver1b::DenonReceiver1b( { setKeysetName("Receiver Keyset 1b"); - addControlledDevice(Denon_Make, "avr-3300", Audio_Device); + addControlledDevice(Denon_Make, "AVR-3300", Audio_Device); } diff --git a/keysets/directv.cpp b/keysets/directv.cpp index 5cf0a92..261719b 100644 --- a/keysets/directv.cpp +++ b/keysets/directv.cpp @@ -1,5 +1,4 @@ #include "directv.h" -#include "protocols/directvprotocol.h" // Note: volume keys are tricky! @@ -22,7 +21,20 @@ void DirectvReceiver1::populateProtocol( return; } - threadableProtocol = new DirectvProtocol(guiObject, index, LowFreq, true); + dtvPopulateProtocol(guiObject, LongGap_Directv, LowFreq_Directv); +} + + +void DirectvReceiver1::dtvPopulateProtocol( + QObject *guiObject, + DirectvGapSize gap, + DirectvFreq freq) +{ + DirectvProtocol *dp = new DirectvProtocol(guiObject, index); + + threadableProtocol = dp; + + dp->setProtocolParms(gap, freq); setPreData(0xC, 4); @@ -95,3 +107,108 @@ void DirectvReceiver1::populateProtocol( addKey("On", PowerOn_Key, 0x80, 8); addKey("Off", PowerOff_Key, 0x81, 8); } + + +DirectvReceiver1a::DirectvReceiver1a( + unsigned int index) + : DirectvReceiver1(index) +{ + setKeysetName("Sat Keyset 1a"); +} + + +void DirectvReceiver1a::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // Keyset already populated. + return; + } + + dtvPopulateProtocol(guiObject, ShortGap_Directv, LowFreq_Directv); +} + + +DirectvReceiver1b::DirectvReceiver1b( + unsigned int index) + : DirectvReceiver1(index) +{ + setKeysetName("Sat Keyset 1b"); +} + + +void DirectvReceiver1b::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // Keyset already populated. + return; + } + + dtvPopulateProtocol(guiObject, ShortGap_Directv, MediumFreq_Directv); +} + + +DirectvReceiver1c::DirectvReceiver1c( + unsigned int index) + : DirectvReceiver1(index) +{ + setKeysetName("Sat Keyset 1c"); +} + + +void DirectvReceiver1c::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // Keyset already populated. + return; + } + + dtvPopulateProtocol(guiObject, LongGap_Directv, MediumFreq_Directv); +} + + +DirectvReceiver1d::DirectvReceiver1d( + unsigned int index) + : DirectvReceiver1(index) +{ + setKeysetName("Sat Keyset 1d"); +} + + +void DirectvReceiver1d::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // Keyset already populated. + return; + } + + dtvPopulateProtocol(guiObject, ShortGap_Directv, HighFreq_Directv); +} + + +DirectvReceiver1e::DirectvReceiver1e( + unsigned int index) + : DirectvReceiver1(index) +{ + setKeysetName("Sat Keyset 1e"); +} + + +void DirectvReceiver1e::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // Keyset already populated. + return; + } + + dtvPopulateProtocol(guiObject, LongGap_Directv, HighFreq_Directv); +} diff --git a/keysets/directv.h b/keysets/directv.h index e06c92c..351191c 100644 --- a/keysets/directv.h +++ b/keysets/directv.h @@ -2,6 +2,7 @@ #define DIRECTV_H #include "pirkeysetmetadata.h" +#include "protocols/directvprotocol.h" class QObject; @@ -13,6 +14,62 @@ public: virtual void populateProtocol( QObject *guiObject); + +protected: + void dtvPopulateProtocol( + QObject *guiObject, + DirectvGapSize gap, + DirectvFreq freq); +}; + +class DirectvReceiver1a: public DirectvReceiver1 +{ +public: + DirectvReceiver1a( + unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); +}; + +class DirectvReceiver1b: public DirectvReceiver1 +{ +public: + DirectvReceiver1b( + unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); +}; + +class DirectvReceiver1c: public DirectvReceiver1 +{ +public: + DirectvReceiver1c( + unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); +}; + +class DirectvReceiver1d: public DirectvReceiver1 +{ +public: + DirectvReceiver1d( + unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); +}; + +class DirectvReceiver1e: public DirectvReceiver1 +{ +public: + DirectvReceiver1e( + unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); }; #endif // DIRECTV_H diff --git a/keysets/jvc.cpp b/keysets/jvc.cpp index 47c047e..4c125a4 100644 --- a/keysets/jvc.cpp +++ b/keysets/jvc.cpp @@ -916,6 +916,7 @@ JVCDVD1::JVCDVD1( JVC_Make, index) { + addControlledDevice(JVC_Make, "JVC XV-N5SL", DVD_Device); } diff --git a/keysets/lg.cpp b/keysets/lg.cpp index a69daf1..9a419a1 100644 --- a/keysets/lg.cpp +++ b/keysets/lg.cpp @@ -199,9 +199,9 @@ LGTV1c::LGTV1c( { setKeysetName("TV Keyset 1c"); - addControlledDevice(LG_Make, "55lw9500", TV_Device); - addControlledDevice(LG_Make, "60px950", TV_Device); - addControlledDevice(LG_Make, "60pg60", TV_Device); + addControlledDevice(LG_Make, "55LW9500", TV_Device); + addControlledDevice(LG_Make, "60PX950", TV_Device); + addControlledDevice(LG_Make, "60PG60", TV_Device); } diff --git a/keysets/octagon.cpp b/keysets/octagon.cpp new file mode 100644 index 0000000..8c318fd --- /dev/null +++ b/keysets/octagon.cpp @@ -0,0 +1,177 @@ +#include "octagon.h" +#include "protocols/necprotocol.h" + + +OctagonSat1::OctagonSat1( + unsigned int index) + : PIRKeysetMetaData( + "Sat Keyset 1", + Octagon_Make, + index) +{ +} + + +void OctagonSat1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // Keyset already populated. + return; + } + + threadableProtocol = new NECProtocol(guiObject, index, true, true); + + setPreData(0xF902, 16); + + addKey("up arrow", Up_Key, 0x00, 8); + addKey("down arrow", Down_Key, 0x01, 8); + addKey("right arrow", Right_Key, 0x02, 8); + addKey("left arrow", Left_Key, 0x03, 8); + addKey("menu", Menu_Key, 0x04, 8); + addKey("info", Info_Key, 0x06, 8); // "display" + addKey("pause", Pause_Key, 0x07, 8); + addKey("guide", Guide_Key, 0x08, 8); + addKey("last (prev ch)", PrevChannel_Key, 0x09, 8); + addKey("power", Power_Key, 0x0A, 8); + addKey("subtitle", Captions_Key, 0x0B, 8); + addKey("mute", Mute_Key, 0x0C, 8); + addKey("teletext", Teletext_Key, 0x0D, 8); + addKey("v format", Unmapped_Key, 0x0E, 8); + addKey("resolution", Unmapped_Key, 0x0F, 8); + addKey("0", Zero_Key, 0x10, 8); + addKey("1", One_Key, 0x11, 8); + addKey("2", Two_Key, 0x12, 8); + addKey("3", Three_Key, 0x13, 8); + addKey("4", Four_Key, 0x14, 8); + addKey("5", Five_Key, 0x15, 8); + addKey("6", Six_Key, 0x16, 8); + addKey("7", Seven_Key, 0x17, 8); + addKey("8", Eight_Key, 0x18, 8); + addKey("9", Nine_Key, 0x19, 8); + addKey("tv/radio", Input_Key, 0x1A, 8); + addKey("exit", Exit_Key, 0x1C, 8); + addKey("sleep", Sleep_Key, 0x1E, 8); + addKey("select", Select_Key, 0x1F, 8); + addKey("playlist", Unmapped_Key, 0x40, 8); + addKey("fav", Favorites_Key, 0x41, 8); + addKey("pg dn", PageDown_Key, 0x43, 8); + addKey("pg up", PageUp_Key, 0x44, 8); + addKey("blue", Blue_Key, 0x48, 8); + addKey("yellow", Yellow_Key, 0x49, 8); + addKey("green", Green_Key, 0x4A, 8); + addKey("red", Red_Key, 0x4B, 8); + addKey("next", Next_Key, 0x4C, 8); + addKey("vol up", VolumeUp_Key, 0x4E, 8); + addKey("vol down", VolumeDown_Key, 0x4F, 8); + addKey("prev", Previous_Key, 0x50, 8); + addKey("pip", PIP_Key, 0x51, 8); + addKey("pip swap", PIPSwap_Key, 0x52, 8); + addKey("pip list", Unmapped_Key, 0x53, 8); + addKey("stop", Stop_Key, 0x54, 8); + addKey("play", Play_Key, 0x55, 8); + addKey("record", Record_Key, 0x56, 8); + addKey("rewind", Rewind_Key, 0x58, 8); + addKey("fast fwd", FastForward_Key, 0x5C, 8); + addKey("channel up", ChannelUp_Key, 0x5E, 8); + addKey("channel down", ChannelDown_Key, 0x5F, 8); +} + + +OctagonSat1a::OctagonSat1a( + unsigned int index) + : OctagonSat1(index) +{ + setKeysetName("Sat Keyset 1a"); +} + + +void OctagonSat1a::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // Keyset already populated. + return; + } + + OctagonSat1::populateProtocol(guiObject); + + addKey("channel up", ChannelUp_Key, 0x00, 8); + addKey("channel down", ChannelDown_Key, 0x01, 8); +} + + +OctagonSat2::OctagonSat2( + unsigned int index) + : PIRKeysetMetaData( + "Sat Keyset 2", + Octagon_Make, + index) +{ +} + + +void OctagonSat2::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // Keyset already populated. + return; + } + + threadableProtocol = new NECProtocol(guiObject, index, true, true); + + setPreData(0x7004, 16); + + addKey("yellow", Yellow_Key, 0x00, 8); + addKey("uhf", Unmapped_Key, 0x01, 8); + addKey("favourite", Favorites_Key, 0x02, 8); + addKey("rewind", Rewind_Key, 0x03, 8); + addKey("fast fwd", FastForward_Key, 0x04, 8); + addKey("X+", Unmapped_Key, 0x08, 8); + addKey("red", Red_Key, 0x09, 8); + addKey("blue", Blue_Key, 0x0C, 8); + addKey("green", Green_Key, 0x0D, 8); + addKey("record", Record_Key, 0x10, 8); + addKey("play", Play_Key, 0x11, 8); + addKey("stop", Stop_Key, 0x12, 8); + addKey("pause", Pause_Key, 0x13, 8); + addKey("display", Info_Key, 0x14, 8); + addKey("tv/radio", Unmapped_Key, 0x15, 8); + addKey("last (prev ch)", PrevChannel_Key, 0x16, 8); + addKey("freeze", Unmapped_Key, 0x17, 8); + addKey("channel up", ChannelUp_Key, 0x18, 8); + addKey("up arrow", Up_Key, 0x18, 8); + addKey("program guide", Guide_Key, 0x1A, 8); + addKey("0", Zero_Key, 0x1B, 8); + addKey("menu", Menu_Key, 0x1C, 8); + addKey("sat", SatInput_Key, 0x1D, 8); + addKey("motor", Unmapped_Key, 0x1E, 8); + addKey("opt+", Unmapped_Key, 0x1F, 8); + addKey("finetune", Unmapped_Key, 0x20, 8); + addKey("sleep", Sleep_Key, 0x21, 8); + addKey("colour", Unmapped_Key, 0x22, 8); + addKey("save", Unmapped_Key, 0x23, 8); + addKey("left arrow", Left_Key, 0x41, 8); + addKey("HD", Unmapped_Key, 0x42, 8); + addKey("select", Select_Key, 0x45, 8); + addKey("channel down", ChannelDown_Key, 0x46, 8); + addKey("down arrow", Down_Key, 0x46, 8); + addKey("right arrow", Right_Key, 0x49, 8); + addKey("exit", Exit_Key, 0x4A, 8); + addKey("7", Seven_Key, 0x54, 8); + addKey("4", Four_Key, 0x55, 8); + addKey("1", One_Key, 0x56, 8); + addKey("tv/sat", Input_Key, 0x57, 8); + addKey("8", Eight_Key, 0x58, 8); + addKey("5", Five_Key, 0x59, 8); + addKey("2", Two_Key, 0x5A, 8); + addKey("av+", Unmapped_Key, 0x5B, 8); + addKey("9", Nine_Key, 0x5C, 8); + addKey("6", Six_Key, 0x5D, 8); + addKey("3", Three_Key, 0x5E, 8); + addKey("power", Power_Key, 0x5F, 8); +} diff --git a/keysets/octagon.h b/keysets/octagon.h new file mode 100644 index 0000000..98010d1 --- /dev/null +++ b/keysets/octagon.h @@ -0,0 +1,38 @@ +#ifndef OCTAGON_H +#define OCTAGON_H + +#include "pirkeysetmetadata.h" + +class QObject; + +class OctagonSat1: public PIRKeysetMetaData +{ +public: + OctagonSat1( + unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); +}; + +class OctagonSat1a: public OctagonSat1 +{ +public: + OctagonSat1a( + unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); +}; + +class OctagonSat2: public PIRKeysetMetaData +{ +public: + OctagonSat2( + unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); +}; + +#endif // OCTAGON_H diff --git a/keysets/panasonic.cpp b/keysets/panasonic.cpp index 47f9de6..1b8ea71 100644 --- a/keysets/panasonic.cpp +++ b/keysets/panasonic.cpp @@ -847,11 +847,11 @@ void PanasonicAC1::populateProtocol( setPreData(0x6681, 16); addKey("Operation", Power_Key, 0x81, 8); + addKey("Economy", EnergySave_Key, 0x82, 8); addKey("Air Swing", Oscillate_Key, 0x83, 8); addKey("Temp Up", TempUp_Key, 0x85, 8); addKey("Temp Down", TempDown_Key, 0x8A, 8); - addKey("Economy", EnergySave_Key, 0x8D, 8); - addKey("Timer", Timer_Key, 0x90, 8); addKey("Fan Speed", FanFaster_Key, 0x99, 8); addKey("Mode", Mode_Key, 0x9B, 8); + addKey("Timer", Timer_Key, 0x9F, 8); } diff --git a/keysets/philips.cpp b/keysets/philips.cpp index dc0f851..f8da887 100644 --- a/keysets/philips.cpp +++ b/keysets/philips.cpp @@ -697,7 +697,7 @@ PhilipsDVD1d::PhilipsDVD1d( { setKeysetName("DVD Keyset 1d"); - addControlledDevice(Philips_Make, "DVD 963sa", DVD_Device); + addControlledDevice(Philips_Make, "DVD 963SA", DVD_Device); } @@ -1348,13 +1348,24 @@ void PhilipsSat3::populateProtocol( threadableProtocol = new RC5Protocol(guiObject, index); - addKey("INFO", Info_Key, 0x128F, 13); // "pilot" + addKey("SOUNDOFF", Mute_Key, 0x0286, 13); // "mute" addKey("EPG", Guide_Key, 0x028F, 13); // "prog" addKey("UP", Up_Key, 0x0290, 13); addKey("DOWN", Down_Key, 0x0291, 13); + addKey("SERV", Unmapped_Key, 0x0292, 13); + addKey("BACK", Unmapped_Key, 0x0293, 13); // "av" addKey("LEFT", Left_Key, 0x0295, 13); addKey("RIGHT", Right_Key, 0x0296, 13); addKey("OK", Select_Key, 0x0297, 13); + addKey("FRONT", Unmapped_Key, 0x02A1, 13); // "twoje" + addKey("MENU", Menu_Key, 0x02AA, 13); // "perso" + addKey("A", Unmapped_Key, 0x02AB, 13); + addKey("B", Unmapped_Key, 0x02AC, 13); + addKey("C", Unmapped_Key, 0x02AD, 13); + addKey("D", Unmapped_Key, 0x02AE, 13); + addKey("E", Unmapped_Key, 0x02AF, 13); + + addKey("0", Zero_Key, 0x1280, 13); addKey("1", One_Key, 0x1281, 13); addKey("2", Two_Key, 0x1282, 13); addKey("3", Three_Key, 0x1283, 13); @@ -1364,20 +1375,10 @@ void PhilipsSat3::populateProtocol( addKey("7", Seven_Key, 0x1287, 13); addKey("8", Eight_Key, 0x1288, 13); addKey("9", Nine_Key, 0x1289, 13); - addKey("0", Zero_Key, 0x1280, 13); - addKey("FRONT", Unmapped_Key, 0x02A1, 13); // "twoje" - addKey("BACK", Unmapped_Key, 0x0293, 13); // "av" - addKey("SERV", Unmapped_Key, 0x0292, 13); - addKey("+", Unmapped_Key, 0x12AF, 13); - addKey("MENU", Menu_Key, 0x02AA, 13); // "perso" - addKey("A", Unmapped_Key, 0x02AB, 13); - addKey("B", Unmapped_Key, 0x02AC, 13); - addKey("C", Unmapped_Key, 0x02AD, 13); - addKey("D", Unmapped_Key, 0x02AE, 13); - addKey("E", Unmapped_Key, 0x02AF, 13); - addKey("SOUNDOFF", Mute_Key, 0x0286, 13); // "mute" - addKey("TV/SAT", Input_Key, 0x12A8, 13); addKey("STANDBY", Power_Key, 0x128C, 13); + addKey("INFO", Info_Key, 0x128F, 13); // "pilot" + addKey("TV/SAT", Input_Key, 0x12A8, 13); + addKey("+", Unmapped_Key, 0x12AF, 13); } diff --git a/keysets/samsung.cpp b/keysets/samsung.cpp index 50a1621..7cbfd67 100644 --- a/keysets/samsung.cpp +++ b/keysets/samsung.cpp @@ -14,6 +14,7 @@ SamsungTV1::SamsungTV1( addControlledDevice(Samsung_Make, "SyncMaster 225MW", TV_Device); addControlledDevice(Samsung_Make, "LN32C530F1FXZA", TV_Device); addControlledDevice(Samsung_Make, "UE46B6000VPXZG", TV_Device); // ? + addControlledDevice(Samsung_Make, "LE22B470C9M", TV_Device); } diff --git a/keysets/xcruiser.cpp b/keysets/xcruiser.cpp new file mode 100644 index 0000000..4114bdb --- /dev/null +++ b/keysets/xcruiser.cpp @@ -0,0 +1,67 @@ +#include "xcruiser.h" +#include "protocols/necprotocol.h" + + +XcruiserSat1::XcruiserSat1( + unsigned int index) + : PIRKeysetMetaData( + "Sat Keyset 1", + Xcruiser_Make, + index) +{ +} + + +void XcruiserSat1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // Keyset already populated. + return; + } + + threadableProtocol = new NECProtocol(guiObject, index, false, true); + + setPreData(0x08, 8); + + addKey("0", Zero_Key, 0x00, 8); + addKey("1", One_Key, 0x01, 8); + addKey("2", Two_Key, 0x02, 8); + addKey("3", Three_Key, 0x03, 8); + addKey("4", Four_Key, 0x04, 8); + addKey("5", Five_Key, 0x05, 8); + addKey("6", Six_Key, 0x06, 8); + addKey("7", Seven_Key, 0x07, 8); + addKey("8", Eight_Key, 0x08, 8); + addKey("9", Nine_Key, 0x09, 8); + addKey("PowerToggle", Power_Key, 0x0A, 8); + addKey("Mute", Mute_Key, 0x0B, 8); + addKey("TvRadio", Input_Key, 0x0C, 8); + addKey("ChannelPrev", PrevChannel_Key, 0x0D, 8); + addKey("Menu", Menu_Key, 0x0E, 8); + addKey("Advance", Advance_Key, 0x0F, 8); + addKey("Info", Info_Key, 0x10, 8); + addKey("ChannelUp", ChannelUp_Key, 0x11, 8); + addKey("DirectionUp", Up_Key, 0x11, 8); + addKey("ChannelDown", ChannelDown_Key, 0x12, 8); + addKey("DirectionDown", Down_Key, 0x12, 8); + addKey("VolumeDown", VolumeDown_Key, 0x13, 8); + addKey("DirectionLeft", Left_Key, 0x13, 8); + addKey("VolumeUp", VolumeUp_Key, 0x14, 8); + addKey("DirectionRight", Right_Key, 0x14, 8); + addKey("Select/Ok", Select_Key, 0x15, 8); + addKey("Exit", Exit_Key, 0x16, 8); + addKey("Replay", Replay_Key, 0x17, 8); + addKey("Guide", Guide_Key, 0x18, 8); + addKey("Pause", Pause_Key, 0x19, 8); + addKey("LRAudio", Surround_Key, 0x1A, 8); + addKey("AltAudio", Audio_Key, 0x1B, 8); + addKey("Text", Teletext_Key, 0x1C, 8); + addKey("Favourite", Favorites_Key, 0x20, 8); + addKey("Rewind", Rewind_Key, 0x22, 8); + addKey("Play", Play_Key, 0x23, 8); + addKey("FastForward", FastForward_Key, 0x24, 8); + addKey("Stop", Stop_Key, 0x26, 8); + addKey("Record", Record_Key, 0x27, 8); +} diff --git a/keysets/xcruiser.h b/keysets/xcruiser.h new file mode 100644 index 0000000..b1d15dc --- /dev/null +++ b/keysets/xcruiser.h @@ -0,0 +1,18 @@ +#ifndef XCRUISER_H +#define XCRUISER_H + +#include "pirkeysetmetadata.h" + +class QObject; + +class XcruiserSat1: public PIRKeysetMetaData +{ +public: + XcruiserSat1( + unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); +}; + +#endif // XCRUISER_H diff --git a/mainwindow.cpp b/mainwindow.cpp index afad5e4..ade853a 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -12,6 +12,7 @@ #include "pirselectkeysetform.h" #include "pirselectdeviceform.h" #include "pirpanelselectionform.h" +#include "pirpreferencesform.h" #include "pirdocumentationform.h" #include "piraboutform.h" #include "pirkeysetmanager.h" @@ -40,6 +41,7 @@ MainWindow::MainWindow(QWidget *parent) selectKeysetForm(0), selectDeviceForm(0), panelSelectionForm(0), + preferencesForm(0), documentationForm(0), aboutForm(0), currentKeyset(0) @@ -63,13 +65,15 @@ MainWindow::MainWindow(QWidget *parent) // Set up the panel selection window: panelSelectionForm = new PIRPanelSelectionForm(this); + myPanels->setupPanels(panelSelectionForm); -// myPanels->setupPanels(panelSelectionForm); + // Set up the preferences window: + preferencesForm = new PIRPreferencesForm(this); // Remember any favorites the user has already set: populateFavorites(); - // Retrieve the user's most recent keyset (if any): + // Retrieve the user's preferences: QSettings settings("pietrzak.org", "Pierogi"); if (settings.contains("currentKeysetName")) { @@ -77,7 +81,6 @@ MainWindow::MainWindow(QWidget *parent) settings.value("currentKeysetMake").toString(), settings.value("currentKeysetName").toString(), currentKeyset); -// currentKeyset = settings.value("currentKeyset").toInt(); } enableButtons(); @@ -236,6 +239,18 @@ void MainWindow::enableButtons() } +void MainWindow::useMainPanel() +{ + myPanels->useMainPanel(); +} + + +void MainWindow::useAltMainPanel() +{ + myPanels->useAltMainPanel(); +} + + void MainWindow::receivedExternalWarning( const char *warning) { @@ -263,6 +278,11 @@ void MainWindow::on_actionArrange_Button_Panels_triggered() panelSelectionForm->show(); } +void MainWindow::on_actionPreferences_triggered() +{ + preferencesForm->show(); +} + void MainWindow::on_actionAbout_triggered() { if (!aboutForm) @@ -485,6 +505,13 @@ void MainWindow::selectNextFavKeyset() } +void MainWindow::selectPanel( + int index) +{ + ui->selectPanelComboBox->setCurrentIndex(index); +} + + void MainWindow::managePanel( PIRPanelName name, int state) @@ -498,8 +525,8 @@ void MainWindow::insertPanel( QWidget *panel, const QString &displayName) { - ui->stackedButtonsWidget->insertWidget(index, panel); ui->selectPanelComboBox->insertItem(index, displayName); + ui->stackedButtonsWidget->insertWidget(index, panel); } diff --git a/mainwindow.h b/mainwindow.h index 9385686..9cd342c 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -12,6 +12,7 @@ class QListWidgetItem; class PIRSelectKeysetForm; class PIRSelectDeviceForm; class PIRPanelSelectionForm; +class PIRPreferencesForm; class PIRDocumentationForm; class PIRAboutForm; class PIRKeysetManager; @@ -45,6 +46,9 @@ public: void stopRepeating(); + void selectPanel( + int index); + void managePanel( PIRPanelName name, int state); @@ -67,6 +71,10 @@ public: void enableButtons(); + // Preferences actions: + void useMainPanel(); + void useAltMainPanel(); + signals: void buttonPressed( unsigned int keysetID, @@ -88,6 +96,7 @@ private slots: void on_actionSelectKeyset_triggered(); void on_actionSelect_Device_By_Name_triggered(); void on_actionArrange_Button_Panels_triggered(); + void on_actionPreferences_triggered(); void on_actionAbout_triggered(); void on_actionDocumentation_triggered(); @@ -107,6 +116,7 @@ private: PIRSelectKeysetForm *selectKeysetForm; PIRSelectDeviceForm *selectDeviceForm; PIRPanelSelectionForm *panelSelectionForm; + PIRPreferencesForm *preferencesForm; PIRDocumentationForm *documentationForm; PIRAboutForm *aboutForm; diff --git a/mainwindow.ui b/mainwindow.ui index 08af423..52c12c6 100644 --- a/mainwindow.ui +++ b/mainwindow.ui @@ -99,6 +99,7 @@ + @@ -129,6 +130,11 @@ Manage Panels + + + Preferences + + diff --git a/pierogi.pro b/pierogi.pro index 50926c7..2bb1547 100644 --- a/pierogi.pro +++ b/pierogi.pro @@ -168,7 +168,12 @@ SOURCES += main.cpp mainwindow.cpp \ keysets/magnum.cpp \ keysets/telenet.cpp \ keysets/thomson.cpp \ - keysets/genius.cpp + keysets/genius.cpp \ + forms/piraltmainform.cpp \ + pirpreferencesform.cpp \ + keysets/xcruiser.cpp \ + keysets/benq.cpp \ + keysets/octagon.cpp HEADERS += mainwindow.h \ pirkeynames.h \ pirmakenames.h \ @@ -312,7 +317,12 @@ HEADERS += mainwindow.h \ keysets/magnum.h \ keysets/telenet.h \ keysets/thomson.h \ - keysets/genius.h + keysets/genius.h \ + forms/piraltmainform.h \ + pirpreferencesform.h \ + keysets/xcruiser.h \ + keysets/benq.h \ + keysets/octagon.h FORMS += mainwindow.ui \ pirdocumentationform.ui \ piraboutform.ui \ @@ -331,7 +341,9 @@ FORMS += mainwindow.ui \ forms/pirmediaform.ui \ forms/pirfavoritesform.ui \ pirpanelselectionform.ui \ - forms/pirrecordform.ui + forms/pirrecordform.ui \ + forms/piraltmainform.ui \ + pirpreferencesform.ui # Please do not modify the following two lines. Required for deployment. include(deployment.pri) diff --git a/pierogi.pro.user b/pierogi.pro.user index 441290e..e44ed2f 100644 --- a/pierogi.pro.user +++ b/pierogi.pro.user @@ -1,6 +1,6 @@ - + ProjectExplorer.Project.ActiveTarget @@ -79,7 +79,7 @@ dpkg-buildpackage -sa -S -uc -us /Users/john/QtSDK/Maemo/4.6.2/bin/mad false - /Users/john/Develop/n900/pierogi-1.1.1 + /Users/john/Develop/n900/pierogi-1.1.2 Custom Process Step ProjectExplorer.ProcessStep @@ -185,6 +185,7 @@ /Users/john/Develop/n900/pierogi-build-maemo-Qt_for_Fremantle_PR1_3_Devices__Qt_SDK__Release/pierogi_0_1_4_armel.deb /Users/john/Develop/n900/pierogi-build-maemo-Qt_for_Fremantle_PR1_3_Devices__Qt_SDK__Release/pierogi_1_0_0_armel.deb /Users/john/Develop/n900/pierogi-build-maemo-Qt_for_Fremantle_PR1_3_Devices__Qt_SDK__Release/pierogi_0_5_1_armel.deb + /Users/john/Develop/n900/pierogi-build-maemo-Qt_for_Fremantle_PR1_3_Devices__Qt_SDK__Release/pierogi_1_1_3_armel.deb /Users/john/Develop/n900/pierogi-build-maemo-Qt_for_Fremantle_PR1_3_Devices__Qt_SDK__Release/pierogi_0_6_1_armel.deb /Users/john/Develop/n900/pierogi-build-maemo-Qt_for_Fremantle_PR1_3_Devices__Qt_SDK__Release/pierogi_0_5_3_armel.deb /Users/john/Develop/n900/pierogi-build-maemo-Qt_for_Fremantle_PR1_3_Devices__Qt_SDK__Release/pierogi_0_6_7_armel.deb @@ -197,6 +198,7 @@ /Users/john/Develop/n900/pierogi-build-maemo-Qt_for_Fremantle_PR1_3_Devices__Qt_SDK__Release/pierogi_0_1_3_armel.deb /Users/john/Develop/n900/pierogi-build-maemo-Qt_for_Fremantle_PR1_3_Devices__Qt_SDK__Release/pierogi_0_1_5_armel.deb /Users/john/Develop/n900/pierogi-build-maemo-Qt_for_Fremantle_PR1_3_Devices__Qt_SDK__Release/pierogi_0_5_0_armel.deb + /Users/john/Develop/n900/pierogi-build-maemo-Qt_for_Fremantle_PR1_3_Devices__Qt_SDK__Release/pierogi_1_1_2_armel.deb /Users/john/Develop/n900/pierogi-build-maemo-Qt_for_Fremantle_PR1_3_Devices__Qt_SDK__Release/pierogi_0_0_1_armel.deb /Users/john/Develop/n900/pierogi-build-maemo-Qt_for_Fremantle_PR1_3_Devices__Qt_SDK__Release/pierogi_0_6_0_armel.deb /Users/john/Develop/n900/pierogi-build-maemo-Qt_for_Fremantle_PR1_3_Devices__Qt_SDK__Release/pierogi_0_5_2_armel.deb @@ -228,6 +230,8 @@ 192.168.0.15 192.168.0.15 192.168.0.15 + 192.168.0.15 + 192.168.0.15 localhost 192.168.0.15 192.168.0.15 @@ -273,11 +277,14 @@ + + 2012-01-19T22:18:07 2012-02-29T10:48:05 2012-02-06T17:22:16 + 2012-03-08T15:45:17 2012-02-12T23:10:44 2012-02-09T18:12:21 2012-02-19T10:29:22 @@ -290,6 +297,7 @@ 2012-01-17T13:21:05 2012-01-23T09:47:37 2012-02-03T10:04:34 + 2012-03-04T19:56:48 2012-01-01T15:35:35 2012-02-11T18:03:15 2012-02-08T20:29:28 diff --git a/pirkeysetmanager.cpp b/pirkeysetmanager.cpp index f7f541a..6178890 100644 --- a/pirkeysetmanager.cpp +++ b/pirkeysetmanager.cpp @@ -11,6 +11,7 @@ #include "keysets/apple.h" #include "keysets/arcam.h" #include "keysets/beko.h" +#include "keysets/benq.h" #include "keysets/bose.h" #include "keysets/bush.h" #include "keysets/cambridge.h" @@ -56,6 +57,7 @@ #include "keysets/motorola.h" #include "keysets/nad.h" #include "keysets/nokia.h" +#include "keysets/octagon.h" #include "keysets/onida.h" #include "keysets/panasonic.h" #include "keysets/philco.h" @@ -88,6 +90,7 @@ #include "keysets/vizio.h" #include "keysets/wd.h" #include "keysets/westinghouse.h" +#include "keysets/xcruiser.h" #include "keysets/yamaha.h" #include "keysets/zenith.h" @@ -140,6 +143,8 @@ PIRKeysetManager::PIRKeysetManager() setupKeyset(new BekoTV1(counter++)); + setupKeyset(new BenQTV1(counter++)); + setupKeyset(new BoseRadio1(counter++)); setupKeyset(new BoseRadio2(counter++)); setupKeyset(new BoseRadio3(counter++)); @@ -196,6 +201,11 @@ PIRKeysetManager::PIRKeysetManager() setupKeyset(new DigitalStreamReceiver(counter++)); setupKeyset(new DirectvReceiver1(counter++)); + setupKeyset(new DirectvReceiver1a(counter++)); + setupKeyset(new DirectvReceiver1b(counter++)); + setupKeyset(new DirectvReceiver1c(counter++)); + setupKeyset(new DirectvReceiver1d(counter++)); + setupKeyset(new DirectvReceiver1e(counter++)); setupKeyset(new DishReceiver1(counter++)); setupKeyset(new DishReceiver1a(counter++)); @@ -397,6 +407,10 @@ PIRKeysetManager::PIRKeysetManager() setupKeyset(new NokiaGenericVCR(counter++)); + setupKeyset(new OctagonSat1(counter++)); + setupKeyset(new OctagonSat1a(counter++)); + setupKeyset(new OctagonSat2(counter++)); + setupKeyset(new OnidaTV1(counter++)); setupKeyset(new OnidaDVD1(counter++)); @@ -635,6 +649,8 @@ PIRKeysetManager::PIRKeysetManager() setupKeyset(new WestinghouseTV1(counter++)); setupKeyset(new WestinghouseTV2(counter++)); + setupKeyset(new XcruiserSat1(counter++)); + setupKeyset(new YamahaDVD1(counter++)); setupKeyset(new YamahaDVD1a(counter++)); setupKeyset(new YamahaAudio1(counter++)); diff --git a/pirmakenames.cpp b/pirmakenames.cpp index 580fab0..77f1e52 100644 --- a/pirmakenames.cpp +++ b/pirmakenames.cpp @@ -12,6 +12,7 @@ PIRMakeMgr::PIRMakeMgr() makes[Apple_Make] = "Apple"; makes[Arcam_Make] = "Arcam"; makes[Beko_Make] = "Beko"; + makes[BenQ_Make] = "BenQ"; makes[Bose_Make] = "Bose"; makes[Bush_Make] = "Bush"; makes[Cambridge_Make] = "Cambridge Audio"; @@ -57,6 +58,7 @@ PIRMakeMgr::PIRMakeMgr() makes[Motorola_Make] = "Motorola"; makes[NAD_Make] = "NAD"; makes[Nokia_Make] = "Nokia"; + makes[Octagon_Make] = "Octagon"; makes[Onida_Make] = "Onida"; makes[Panasonic_Make] = "Panasonic"; makes[Philco_Make] = "Philco"; @@ -89,6 +91,7 @@ PIRMakeMgr::PIRMakeMgr() makes[Vizio_Make] = "Vizio"; makes[WD_Make] = "Western Digital"; makes[Westinghouse_Make] = "Westinghouse"; + makes[Xcruiser_Make] = "Xcruiser"; makes[Yamaha_Make] = "Yamaha"; makes[Zenith_Make] = "Zenith"; } diff --git a/pirmakenames.h b/pirmakenames.h index 9da5fb2..9dee3d3 100644 --- a/pirmakenames.h +++ b/pirmakenames.h @@ -13,6 +13,7 @@ enum PIRMakeName{ Apple_Make, Arcam_Make, Beko_Make, + BenQ_Make, Bose_Make, Bush_Make, Cambridge_Make, @@ -58,6 +59,7 @@ enum PIRMakeName{ Motorola_Make, NAD_Make, Nokia_Make, + Octagon_Make, Onida_Make, Panasonic_Make, Philco_Make, @@ -90,6 +92,7 @@ enum PIRMakeName{ Vizio_Make, WD_Make, Westinghouse_Make, + Xcruiser_Make, Yamaha_Make, Zenith_Make }; diff --git a/pirpanelmanager.cpp b/pirpanelmanager.cpp index 23eca10..7b340bc 100644 --- a/pirpanelmanager.cpp +++ b/pirpanelmanager.cpp @@ -1,6 +1,9 @@ #include "pirpanelmanager.h" +#include "pirpanelselectionform.h" + #include "forms/pirmainform.h" +#include "forms/piraltmainform.h" #include "forms/pirutilityform.h" #include "forms/pirkeypadform.h" #include "forms/pirmenuform.h" @@ -15,8 +18,15 @@ #include "mainwindow.h" +#include + +// Debugging: +//#include +#include + PIRPanelManager::PIRPanelManager(MainWindow *mw) : mainForm(0), + altMainForm(0), utilityForm(0), keypadForm(0), menuForm(0), @@ -28,20 +38,59 @@ PIRPanelManager::PIRPanelManager(MainWindow *mw) adjustForm(0), acForm(0), favoritesForm(0), + altMainPanelFlag(false), mainWindow(mw) { - panelList.push_back(PIRPanelPair(Main_Panel, false)); - panelList.push_back(PIRPanelPair(Utility_Panel, false)); - panelList.push_back(PIRPanelPair(Keypad_Panel, false)); - panelList.push_back(PIRPanelPair(Menu_Panel, false)); - panelList.push_back(PIRPanelPair(Media_Panel, false)); - panelList.push_back(PIRPanelPair(Media2_Panel, false)); - panelList.push_back(PIRPanelPair(Record_Panel, false)); - panelList.push_back(PIRPanelPair(TV_Panel, false)); - panelList.push_back(PIRPanelPair(Input_Panel, false)); - panelList.push_back(PIRPanelPair(Adjust_Panel, false)); - panelList.push_back(PIRPanelPair(AC_Panel, false)); - panelList.push_back(PIRPanelPair(Favorites_Panel, false)); + // Set up the panel names: + shortPanelNames[Main_Panel] = "Main"; + longPanelNames[Main_Panel] = + "Main Panel - power, volume, and channel controls"; + shortPanelNames[Utility_Panel] = "Utility"; + longPanelNames[Utility_Panel] = + "Utility Panel - commonly used controls"; + shortPanelNames[Keypad_Panel] = "Keypad"; + longPanelNames[Keypad_Panel] = + "Keypad Panel - numeric value entry"; + shortPanelNames[Menu_Panel] = "Menu"; + longPanelNames[Menu_Panel] = + "Menu Panel - enter, exit, and navigate menus"; + shortPanelNames[Media_Panel] = "Media"; + longPanelNames[Media_Panel] = + "Media Panel - control over recorded data"; + shortPanelNames[Media2_Panel] = "Media2"; + longPanelNames[Media2_Panel] = + "Media2 Panel - additonal media controls"; + shortPanelNames[Record_Panel] = "Record"; + longPanelNames[Record_Panel] = + "Program/Record Panel - control over memory and storage"; + shortPanelNames[TV_Panel] = "TV"; + longPanelNames[TV_Panel] = + "TV Panel - teletext and picture-in-picture"; + shortPanelNames[Input_Panel] = "Input"; + longPanelNames[Input_Panel] = + "Input Panel - manage data sources"; + shortPanelNames[Adjust_Panel] = "Adjust"; + longPanelNames[Adjust_Panel] = + "Adjust Panel - modify audio and video"; + shortPanelNames[AC_Panel] = "AC"; + longPanelNames[AC_Panel] = + "A/C Panel - air conditioner controls"; + shortPanelNames[Favorites_Panel] = "Favorites"; + longPanelNames[Favorites_Panel] = + "Favorites Panel - memorized keysets"; + + activePanels[Main_Panel] = false; + activePanels[Utility_Panel]= false; + activePanels[Keypad_Panel]= false; + activePanels[Menu_Panel]= false; + activePanels[Media_Panel]= false; + activePanels[Media2_Panel]= false; + activePanels[Record_Panel]= false; + activePanels[TV_Panel]= false; + activePanels[Input_Panel]= false; + activePanels[Adjust_Panel]= false; + activePanels[AC_Panel]= false; + activePanels[Favorites_Panel]= false; } @@ -55,19 +104,124 @@ PIRPanelManager::~PIRPanelManager() } -/* void PIRPanelManager::setupPanels( PIRPanelSelectionForm *psf) { + QSettings settings("pietrzak.org", "Pierogi"); + + settings.beginGroup("Panels"); + + // Do the panel settings exist? (We'll check for "Main_Panel".) + if (!settings.contains(shortPanelNames[Main_Panel])) + { + // A default set of panels: + psf->setCheckBox(Main_Panel, true); + psf->setCheckBox(Utility_Panel, true); + psf->setCheckBox(Keypad_Panel, true); + psf->setCheckBox(Menu_Panel, true); + psf->setCheckBox(Media_Panel, true); + psf->setCheckBox(Favorites_Panel, true); + } + else + { + psf->setCheckBox( + Main_Panel, + settings.value(shortPanelNames[Main_Panel]).toBool()); + + if (settings.contains(shortPanelNames[Utility_Panel])) + { + psf->setCheckBox( + Utility_Panel, + settings.value(shortPanelNames[Utility_Panel]).toBool()); + } + + if (settings.contains(shortPanelNames[Keypad_Panel])) + { + psf->setCheckBox( + Keypad_Panel, + settings.value(shortPanelNames[Keypad_Panel]).toBool()); + } + + if (settings.contains(shortPanelNames[Menu_Panel])) + { + psf->setCheckBox( + Menu_Panel, + settings.value(shortPanelNames[Menu_Panel]).toBool()); + } + + if (settings.contains(shortPanelNames[Media_Panel])) + { + psf->setCheckBox( + Media_Panel, + settings.value(shortPanelNames[Media_Panel]).toBool()); + } + + if (settings.contains(shortPanelNames[Media2_Panel])) + { + psf->setCheckBox( + Media2_Panel, + settings.value(shortPanelNames[Media2_Panel]).toBool()); + } + + if (settings.contains(shortPanelNames[Record_Panel])) + { + psf->setCheckBox( + Record_Panel, + settings.value(shortPanelNames[Record_Panel]).toBool()); + } + + if (settings.contains(shortPanelNames[TV_Panel])) + { + psf->setCheckBox( + TV_Panel, + settings.value(shortPanelNames[TV_Panel]).toBool()); + } + + if (settings.contains(shortPanelNames[Input_Panel])) + { + psf->setCheckBox( + Input_Panel, + settings.value(shortPanelNames[Input_Panel]).toBool()); + } + + if (settings.contains(shortPanelNames[Adjust_Panel])) + { + psf->setCheckBox( + Adjust_Panel, + settings.value(shortPanelNames[Adjust_Panel]).toBool()); + } + + if (settings.contains(shortPanelNames[AC_Panel])) + { + psf->setCheckBox( + AC_Panel, + settings.value(shortPanelNames[AC_Panel]).toBool()); + } + + if (settings.contains(shortPanelNames[Favorites_Panel])) + { + psf->setCheckBox( + Favorites_Panel, + settings.value(shortPanelNames[Favorites_Panel]).toBool()); + } + } + + settings.endGroup(); } -*/ void PIRPanelManager::enableButtons( const PIRKeysetManager *keyset, unsigned int id) { - if (mainForm) mainForm->enableButtons(keyset, id); + if (altMainPanelFlag) + { + if (altMainForm) altMainForm->enableButtons(keyset, id); + } + else + { + if (mainForm) mainForm->enableButtons(keyset, id); + } if (utilityForm) utilityForm->enableButtons(keyset, id); if (keypadForm) keypadForm->enableButtons(keyset, id); if (menuForm) menuForm->enableButtons(keyset, id); @@ -85,38 +239,102 @@ void PIRPanelManager::managePanel( PIRPanelName name, int state) { - int index = 0; + int currentPanel = 0; + int displayCount = 0; - PIRPanelList::iterator i = panelList.begin(); - while (i != panelList.end()) +// PIRPanelList::iterator i = panelList.begin(); + while (currentPanel < Last_Panel_Marker) { - if (i->name == name) + if (currentPanel == name) { break; } - else if (i->displayed) + else if (activePanels[PIRPanelName(currentPanel)]) { - ++index; + ++displayCount; } - ++i; + + ++currentPanel; } - if (i == panelList.end()) + if (currentPanel == Last_Panel_Marker) { // should throw an error message here!!! return; } - if (state == Qt::Unchecked && i->displayed) + QSettings settings("pietrzak.org", "Pierogi"); + + settings.beginGroup("Panels"); + + if (state == Qt::Unchecked && activePanels[PIRPanelName(currentPanel)]) { - hidePanel(name, index); - i->displayed = false; + hidePanel(name, displayCount); + activePanels[PIRPanelName(currentPanel)] = false; + settings.setValue(shortPanelNames[PIRPanelName(currentPanel)], false); } - else if (state == Qt::Checked && !i->displayed) + else if (state == Qt::Checked && !activePanels[PIRPanelName(currentPanel)]) { - showPanel(name, index); - i->displayed = true; + showPanel(name, displayCount); + activePanels[PIRPanelName(currentPanel)] = true; + settings.setValue(shortPanelNames[PIRPanelName(currentPanel)], true); } + + settings.endGroup(); +} + + +void PIRPanelManager::useMainPanel() +{ + if (!altMainPanelFlag) + { + // Already set correctly, nothing to do: + return; + } + + altMainPanelFlag = false; + + // Is the main panel currently active? + if (activePanels[Main_Panel]) + { + mainWindow->removePanel(0, altMainForm); + if (!mainForm) + { + mainForm = new PIRMainForm(mainWindow); + } + + mainWindow->insertPanel(0, mainForm, longPanelNames[Main_Panel]); + mainWindow->selectPanel(0); + } + + mainWindow->enableButtons(); +} + + +void PIRPanelManager::useAltMainPanel() +{ + if (altMainPanelFlag) + { + // Already set correctly, nothing to do: + return; + } + + altMainPanelFlag = true; + + // Is the main panel currently active? + if (activePanels[Main_Panel]) + { + mainWindow->removePanel(0, mainForm); + if (!altMainForm) + { + altMainForm = new PIRAltMainForm(mainWindow); + } + + mainWindow->insertPanel(0, altMainForm, longPanelNames[Main_Panel]); + mainWindow->selectPanel(0); + } + + mainWindow->enableButtons(); } @@ -127,7 +345,14 @@ void PIRPanelManager::hidePanel( switch (name) { case Main_Panel: - if (mainForm) mainWindow->removePanel(index, mainForm); + if (altMainPanelFlag) + { + if (altMainForm) mainWindow->removePanel(index, altMainForm); + } + else + { + if (mainForm) mainWindow->removePanel(index, mainForm); + } break; case Utility_Panel: @@ -188,16 +413,32 @@ void PIRPanelManager::showPanel( switch (name) { case Main_Panel: - if (!mainForm) + if (altMainPanelFlag) { - mainForm = new PIRMainForm(mainWindow); - mainWindow->enableButtons(); + if (!altMainForm) + { + altMainForm = new PIRAltMainForm(mainWindow); + mainWindow->enableButtons(); + } + + mainWindow->insertPanel( + index, + altMainForm, + longPanelNames[Main_Panel]); + } + else + { + if (!mainForm) + { + mainForm = new PIRMainForm(mainWindow); + mainWindow->enableButtons(); + } + + mainWindow->insertPanel( + index, + mainForm, + longPanelNames[Main_Panel]); } - - mainWindow->insertPanel( - index, - mainForm, - QString("Main Panel - power, volume, and channel controls")); break; @@ -211,7 +452,7 @@ void PIRPanelManager::showPanel( mainWindow->insertPanel( index, utilityForm, - QString("Utility Panel - commonly used controls")); + longPanelNames[Utility_Panel]); break; @@ -225,7 +466,7 @@ void PIRPanelManager::showPanel( mainWindow->insertPanel( index, keypadForm, - QString("Keypad Panel - numeric value entry")); + longPanelNames[Keypad_Panel]); break; @@ -239,7 +480,7 @@ void PIRPanelManager::showPanel( mainWindow->insertPanel( index, menuForm, - QString("Menu Panel - enter, exit, and navigate menus")); + longPanelNames[Menu_Panel]); break; @@ -253,7 +494,7 @@ void PIRPanelManager::showPanel( mainWindow->insertPanel( index, mediaForm, - QString("Media Panel - control over recorded data")); + longPanelNames[Media_Panel]); break; @@ -267,7 +508,7 @@ void PIRPanelManager::showPanel( mainWindow->insertPanel( index, media2Form, - QString("Media2 Panel - additonal media controls")); + longPanelNames[Media2_Panel]); break; @@ -281,7 +522,7 @@ void PIRPanelManager::showPanel( mainWindow->insertPanel( index, recordForm, - QString("Program/Record Panel - control over memory and storage")); + longPanelNames[Record_Panel]); break; @@ -295,7 +536,7 @@ void PIRPanelManager::showPanel( mainWindow->insertPanel( index, tvForm, - QString("TV Panel - teletext and picture-in-picture")); + longPanelNames[TV_Panel]); break; @@ -309,7 +550,7 @@ void PIRPanelManager::showPanel( mainWindow->insertPanel( index, inputForm, - QString("Input Panel - manage data sources")); + longPanelNames[Input_Panel]); break; @@ -323,7 +564,7 @@ void PIRPanelManager::showPanel( mainWindow->insertPanel( index, adjustForm, - QString("Adjust Panel - modify audio and video")); + longPanelNames[Adjust_Panel]); break; @@ -337,7 +578,7 @@ void PIRPanelManager::showPanel( mainWindow->insertPanel( index, acForm, - QString("A/C Panel - air conditioner controls")); + longPanelNames[AC_Panel]); break; @@ -351,7 +592,7 @@ void PIRPanelManager::showPanel( mainWindow->insertPanel( index, favoritesForm, - QString("Favorites Panel - memorized keysets")); + longPanelNames[Favorites_Panel]); break; diff --git a/pirpanelmanager.h b/pirpanelmanager.h index 631f310..910117e 100644 --- a/pirpanelmanager.h +++ b/pirpanelmanager.h @@ -4,6 +4,7 @@ #include "pirpanelnames.h" class PIRMainForm; +class PIRAltMainForm; class PIRUtilityForm; class PIRKeypadForm; class PIRMenuForm; @@ -22,23 +23,11 @@ class PIRKeysetManager; class QListWidget; class MainWindow; -#include - -class PIRPanelPair -{ -public: - PIRPanelPair( - PIRPanelName n, - bool d) - : name(n), - displayed(d) - {} - - PIRPanelName name; - bool displayed; -}; - -typedef std::list PIRPanelList; +#include +#include +typedef std::map PIRPanelDisplayNameCollection; +typedef std::map PIRActivePanelCollection; +typedef std::map PIRReversePanelIndex; class PIRPanelManager { @@ -48,10 +37,8 @@ public: ~PIRPanelManager(); -/* void setupPanels( PIRPanelSelectionForm *psf); -*/ void enableButtons( const PIRKeysetManager *keyset, @@ -61,6 +48,9 @@ public: PIRPanelName name, int state); + void useMainPanel(); + void useAltMainPanel(); + void selectPrevFavKeyset(); void selectNextFavKeyset(); @@ -80,6 +70,7 @@ private: int index); PIRMainForm *mainForm; + PIRAltMainForm *altMainForm; PIRUtilityForm *utilityForm; PIRKeypadForm *keypadForm; PIRMenuForm *menuForm; @@ -92,7 +83,12 @@ private: PIRAirConditionerForm *acForm; PIRFavoritesForm *favoritesForm; - PIRPanelList panelList; + PIRPanelDisplayNameCollection shortPanelNames; + PIRPanelDisplayNameCollection longPanelNames; + PIRActivePanelCollection activePanels; +// PIRReversePanelIndex reverseIndex; + + bool altMainPanelFlag; MainWindow *mainWindow; }; diff --git a/pirpanelnames.h b/pirpanelnames.h index ea65a0b..9f38c62 100644 --- a/pirpanelnames.h +++ b/pirpanelnames.h @@ -14,7 +14,9 @@ enum PIRPanelName Input_Panel, Adjust_Panel, AC_Panel, - Favorites_Panel + Favorites_Panel, + Last_Panel_Marker // Used when traversing this enumeration. }; + #endif // PIRPANELNAMES_H diff --git a/pirpanelselectionform.cpp b/pirpanelselectionform.cpp index 9fa23b1..6a6db1d 100644 --- a/pirpanelselectionform.cpp +++ b/pirpanelselectionform.cpp @@ -13,14 +13,6 @@ PIRPanelSelectionForm::PIRPanelSelectionForm(QWidget *parent) : setAttribute(Qt::WA_Maemo5StackedWindow); setWindowFlags(windowFlags() | Qt::Window); - - // Start by setting up a few initial panels: - ui->mainCheckBox->setChecked(true); - ui->utilityCheckBox->setChecked(true); - ui->keypadCheckBox->setChecked(true); - ui->menuCheckBox->setChecked(true); - ui->mediaCheckBox->setChecked(true); - ui->favoritesCheckBox->setChecked(true); } PIRPanelSelectionForm::~PIRPanelSelectionForm() @@ -28,6 +20,65 @@ PIRPanelSelectionForm::~PIRPanelSelectionForm() delete ui; } +void PIRPanelSelectionForm::setCheckBox( + PIRPanelName name, + bool setting) +{ + switch (name) + { + case Main_Panel: + ui->mainCheckBox->setChecked(setting); + break; + + case Utility_Panel: + ui->utilityCheckBox->setChecked(setting); + break; + + case Keypad_Panel: + ui->keypadCheckBox->setChecked(setting); + break; + + case Menu_Panel: + ui->menuCheckBox->setChecked(setting); + break; + + case Media_Panel: + ui->mediaCheckBox->setChecked(setting); + break; + + case Media2_Panel: + ui->media2CheckBox->setChecked(setting); + break; + + case Record_Panel: + ui->recordCheckBox->setChecked(setting); + break; + + case TV_Panel: + ui->tvCheckBox->setChecked(setting); + break; + + case Input_Panel: + ui->inputCheckBox->setChecked(setting); + break; + + case Adjust_Panel: + ui->adjustCheckBox->setChecked(setting); + break; + + case AC_Panel: + ui->acCheckBox->setChecked(setting); + break; + + case Favorites_Panel: + ui->favoritesCheckBox->setChecked(setting); + break; + + default: + break; + } +} + void PIRPanelSelectionForm::on_mainCheckBox_stateChanged(int arg1) { mainWindow->managePanel(Main_Panel, arg1); diff --git a/pirpanelselectionform.h b/pirpanelselectionform.h index e8dd33b..81c37a3 100644 --- a/pirpanelselectionform.h +++ b/pirpanelselectionform.h @@ -18,6 +18,10 @@ public: explicit PIRPanelSelectionForm(QWidget *parent = 0); // PIRPanelSelectionForm(MainWindow *mw); ~PIRPanelSelectionForm(); + + void setCheckBox( + PIRPanelName name, + bool setting); private slots: void on_mainCheckBox_stateChanged(int arg1); diff --git a/pirpreferencesform.cpp b/pirpreferencesform.cpp new file mode 100644 index 0000000..a1b6197 --- /dev/null +++ b/pirpreferencesform.cpp @@ -0,0 +1,64 @@ +#include "pirpreferencesform.h" +#include "ui_pirpreferencesform.h" + +#include "mainwindow.h" + +#include + +PIRPreferencesForm::PIRPreferencesForm( + QWidget *parent) + : QWidget(parent), + ui(new Ui::PIRPreferencesForm) +{ + ui->setupUi(this); + + mainWindow = dynamic_cast(parent); + + setAttribute(Qt::WA_Maemo5StackedWindow); + setWindowFlags(windowFlags() | Qt::Window); + + QSettings settings("pietrzak.org", "Pierogi"); + + settings.beginGroup("Preferences"); + + if (settings.contains("useAltMain")) + { + if (settings.value("useAltMain").toBool()) + { + ui->altMainCheckBox->setChecked(true); + mainWindow->useAltMainPanel(); + } + } + + settings.endGroup(); +} + + +PIRPreferencesForm::~PIRPreferencesForm() +{ + delete ui; +} + + +void PIRPreferencesForm::on_altMainCheckBox_stateChanged( + int arg1) +{ + QSettings settings("pietrzak.org", "Pierogi"); + + settings.beginGroup("Preferences"); + + if (arg1 == Qt::Checked) + { + settings.setValue("useAltMain", true); + + mainWindow->useAltMainPanel(); + } + else + { + settings.setValue("useAltMain", false); + + mainWindow->useMainPanel(); + } + + settings.endGroup(); +} diff --git a/pirpreferencesform.h b/pirpreferencesform.h new file mode 100644 index 0000000..b3089ea --- /dev/null +++ b/pirpreferencesform.h @@ -0,0 +1,29 @@ +#ifndef PIRPREFERENCESFORM_H +#define PIRPREFERENCESFORM_H + +#include + +class MainWindow; + +namespace Ui { +class PIRPreferencesForm; +} + +class PIRPreferencesForm : public QWidget +{ + Q_OBJECT + +public: + explicit PIRPreferencesForm(QWidget *parent = 0); + ~PIRPreferencesForm(); + +private slots: + void on_altMainCheckBox_stateChanged(int arg1); + +private: + Ui::PIRPreferencesForm *ui; + + MainWindow *mainWindow; +}; + +#endif // PIRPREFERENCESFORM_H diff --git a/pirpreferencesform.ui b/pirpreferencesform.ui new file mode 100644 index 0000000..b2bf590 --- /dev/null +++ b/pirpreferencesform.ui @@ -0,0 +1,50 @@ + + + PIRPreferencesForm + + + + 0 + 0 + 800 + 480 + + + + Pierogi Preferences + + + + 8 + + + + + true + + + + + 0 + 0 + 782 + 462 + + + + + + + Reverse orientation of volume and control buttons + + + + + + + + + + + + diff --git a/protocols/directvprotocol.cpp b/protocols/directvprotocol.cpp index ee66e88..f14496f 100644 --- a/protocols/directvprotocol.cpp +++ b/protocols/directvprotocol.cpp @@ -25,27 +25,36 @@ extern QMutex commandIFMutex; DirectvProtocol::DirectvProtocol( QObject *guiObject, - unsigned int index, - DirectvFreq freq, - bool longGapFlag) + unsigned int index) : PIRProtocol(guiObject, index, 9000, false) { - if (longGapFlag) +} + + +void DirectvProtocol::setProtocolParms( + DirectvGapSize gap, + DirectvFreq freq) +{ + if (gap == ShortGap_Directv) + { + setGapSize(9000, false); + } + else { setGapSize(30000, false); } switch (freq) { - case LowFreq: + case LowFreq_Directv: setCarrierFrequency(38000); break; - case MediumFreq: + case MediumFreq_Directv: setCarrierFrequency(40000); break; - case HighFreq: default: + case HighFreq_Directv: default: setCarrierFrequency(57000); break; } diff --git a/protocols/directvprotocol.h b/protocols/directvprotocol.h index e0de258..e04a234 100644 --- a/protocols/directvprotocol.h +++ b/protocols/directvprotocol.h @@ -5,11 +5,17 @@ class PIRRX51Hardware; +enum DirectvGapSize +{ + ShortGap_Directv, + LongGap_Directv +}; + enum DirectvFreq { - LowFreq, - MediumFreq, - HighFreq + LowFreq_Directv, + MediumFreq_Directv, + HighFreq_Directv }; class DirectvProtocol: public PIRProtocol @@ -17,9 +23,11 @@ class DirectvProtocol: public PIRProtocol public: DirectvProtocol( QObject *guiObject, - unsigned int index, - DirectvFreq freq, - bool longGapFlag); + unsigned int index); + + void setProtocolParms( + DirectvGapSize gap, + DirectvFreq freq); private: void startSendingCommand( diff --git a/qtc_packaging/debian_fremantle/changelog b/qtc_packaging/debian_fremantle/changelog index 3207063..c48bb9a 100644 --- a/qtc_packaging/debian_fremantle/changelog +++ b/qtc_packaging/debian_fremantle/changelog @@ -1,3 +1,11 @@ +pierogi (1.1.3) unstable; urgency=low + * Started work on an actual preferences window! + * Pierogi now remembers your panel selections from your previous session. + * All six permutations of the Directv protocol now supported. + * First pass at keysets for BenQ, Octagon, Xcruiser + + -- John Pietrzak Thu, 08 Mar 2012 11:07:08 -0500 + pierogi (1.1.2) unstable; urgency=low * First pass at keysets for Dream Multimedia, Genius, Magnum, Telenet, and Thomson. diff --git a/qtc_packaging/debian_fremantle/control b/qtc_packaging/debian_fremantle/control index 395b0e0..f0f3492 100644 --- a/qtc_packaging/debian_fremantle/control +++ b/qtc_packaging/debian_fremantle/control @@ -11,8 +11,8 @@ Architecture: armel Depends: ${shlibs:Depends}, ${misc:Depends} Description: Universal Infrared (IR) Remote Control for N900 Pierogi is a Universal Infrared Remote Control app for the Nokia N900. It is independent from the LIRC server, and stores all configuration info internally. -XB-Maemo-Upgrade-Description: Keyset Update - This update contains a first pass at keysets for Dream Multimedia, Genius, Magnum, Telenet, and Thomson. These keysets all need some testing... +XB-Maemo-Upgrade-Description: Interim Update + I'm continuing to mess around with the Pierogi infrastructure. Not much to show yet, though. A very early Preferences window now exists, but so far only adds the option to swap the channel and volume controls on the main panel. In other news, Pierogi should now remember your panel choices (crossing my fingers). Also, all 6 DirecTV keysets are now available, and a first pass has been made at keysets for BenQ, Octagon, and Xcruiser. XSBC-Bugtracker: https://garage.maemo.org/tracker/?func=add&group_id=2286&atid=7641 XB-Maemo-Display-Name: Pierogi XB-Maemo-Icon-26: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEwAACxMBAJqcGAAAEChJREFUaIHtmFmsXudVhp/1TXv/+x/OOZ4TO66dZmBo0jZJoxBQW8ookAq0mIhJQhUXcAGIAhICRClDb4q4YBRDGSoBFS2ikQoUSkpNIEkbnJQ0cVL7xLUd2/GZfKZ/2MP3fYuLE6LUDQEFQi/oe7e/X7/2++71an1rvfAlfAn/vyH/2Q+Hbzp89M47rvm1aw/0XvPs5ea+M5/b+OiJB5/88FX/1Vee4kvjagEC6Dt/+ns++Ya7Xn2ndWX2zkvKLV070Xp72Vy6PG4vLa0/8pcffuytlxcvr3wxSL8Q7qpnBXjzW+64M/QC1hiTUq0xWbHWihjf3TBvwqtene46e377/Z9swztWz59/9ovA+3nYqw9uv/uWH/y27/iat3rv1AcnkARjCSHgQ2FdqNT5Hgf27bpxfsF+/yTms2vPXjkJGL4Ilvo8AXfc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