From 741e390184f91b94c413745f43820d59c7362530 Mon Sep 17 00:00:00 2001 From: John Pietrzak Date: Wed, 24 Oct 2012 19:55:07 -0400 Subject: [PATCH] Advanced Settings Panel This update adds an "advanced settings" panel, allowing the user to modify the carrier frequency and duty cycle settings. This may allow improved range for certain devices, such as Sony TVs. The Input panel has been tweaked to add four more input buttons; also, it has been returned to the TV Panels collection. And, a first pass made at keysets for Medi@link, Multichoice, and NEC, and new keysets added to ADB, LG, Mitsubishi, and Pioneer. --- dialogs/pirtabschoicedialog.cpp | 3 + doc/about.html | 2 +- forms/piradvancedform.cpp | 41 +++ forms/piradvancedform.h | 37 +++ forms/piradvancedform.ui | 101 ++++++ forms/pirinputform.cpp | 44 +++ forms/pirinputform.h | 12 + forms/pirinputform.ui | 147 ++++++++- keysets/adb.cpp | 62 ++++ keysets/adb.h | 11 + keysets/lg.cpp | 205 ++++++++++++- keysets/lg.h | 30 ++ keysets/medialink.cpp | 78 +++++ keysets/medialink.h | 18 ++ keysets/mitsubishi.cpp | 52 ++++ keysets/mitsubishi.h | 10 + keysets/multichoice.cpp | 158 ++++++++++ keysets/multichoice.h | 28 ++ keysets/nec.cpp | 490 ++++++++++++++++++++++++++++++ keysets/nec.h | 78 +++++ keysets/pioneer.cpp | 57 ++++ keysets/pioneer.h | 10 + keysets/sanyo.cpp | 4 +- macros/pirmacromanager.cpp | 54 ++++ macros/pirmacromanager.h | 3 + main.cpp | 8 + mainwindow.cpp | 116 +++++++ mainwindow.h | 24 +- pierogi.pro | 17 +- pierogi.pro.user | 8 +- pirkeynames.cpp | 3 + pirkeynames.h | 3 + pirkeysetmanager.cpp | 80 +++++ pirkeysetmanager.h | 14 + pirkeysetmetadata.cpp | 46 +++ pirkeysetmetadata.h | 10 + pirmakenames.cpp | 3 + pirmakenames.h | 3 + pirpanelmanager.cpp | 70 ++++- pirpanelmanager.h | 11 +- pirpanelnames.h | 2 + pirpreferencesform.cpp | 3 +- pirrx51hardware.cpp | 4 +- pirtabwidget.cpp | 151 +++++++++ pirtabwidget.h | 25 ++ protocols/pirprotocol.cpp | 40 ++- protocols/pirprotocol.h | 16 +- qtc_packaging/debian_fremantle/changelog | 9 +- qtc_packaging/debian_fremantle/control | 4 +- 49 files changed, 2346 insertions(+), 59 deletions(-) create mode 100644 forms/piradvancedform.cpp create mode 100644 forms/piradvancedform.h create mode 100644 forms/piradvancedform.ui create mode 100644 keysets/medialink.cpp create mode 100644 keysets/medialink.h create mode 100644 keysets/multichoice.cpp create mode 100644 keysets/multichoice.h create mode 100644 keysets/nec.cpp create mode 100644 keysets/nec.h create mode 100644 pirtabwidget.cpp create mode 100644 pirtabwidget.h diff --git a/dialogs/pirtabschoicedialog.cpp b/dialogs/pirtabschoicedialog.cpp index a383999..904dad3 100644 --- a/dialogs/pirtabschoicedialog.cpp +++ b/dialogs/pirtabschoicedialog.cpp @@ -41,6 +41,9 @@ PIRTabsChoiceDialog::PIRTabsChoiceDialog( ui->tabsChoiceListWidget->addItem( new PIRTabsWidgetItem("Keyset Search Panels", PowerSearch_Tabs)); + + ui->tabsChoiceListWidget->addItem( + new PIRTabsWidgetItem("Advanced Settings", Advanced_Tabs)); } diff --git a/doc/about.html b/doc/about.html index d534987..2f05534 100644 --- a/doc/about.html +++ b/doc/about.html @@ -9,7 +9,7 @@ Pierogi UIRC

A Universal Infrared Remote Control

-Version 1.1 - For a Few Pierogies More +Version 1.1.15 - For a Few Pierogies More

diff --git a/forms/piradvancedform.cpp b/forms/piradvancedform.cpp new file mode 100644 index 0000000..c6e0f65 --- /dev/null +++ b/forms/piradvancedform.cpp @@ -0,0 +1,41 @@ +#include "piradvancedform.h" +#include "ui_piradvancedform.h" + +#include "pirkeysetmanager.h" + +PIRAdvancedForm::PIRAdvancedForm() + : QWidget(0), + ui(new Ui::PIRAdvancedForm) +{ + ui->setupUi(this); +} + +PIRAdvancedForm::~PIRAdvancedForm() +{ + delete ui; +} + + +void PIRAdvancedForm::setupForm( + PIRKeysetManager *pkm, + unsigned int id) +{ + keysetManager = pkm; + keysetID = id; + + ui->carrierFrequencySpinBox->setValue(pkm->getCarrierFrequency(id)); + ui->dutyCycleSpinBox->setValue(pkm->getDutyCycle(id)); +} + + +void PIRAdvancedForm::on_carrierFrequencySpinBox_valueChanged(int arg1) +{ + if (arg1 < 30000) arg1 = 30000; + if (arg1 > 60000) arg1 = 60000; + keysetManager->setCarrierFrequency((unsigned int) arg1, keysetID); +} + +void PIRAdvancedForm::on_dutyCycleSpinBox_valueChanged(int arg1) +{ + keysetManager->setDutyCycle((unsigned int) arg1, keysetID); +} diff --git a/forms/piradvancedform.h b/forms/piradvancedform.h new file mode 100644 index 0000000..15c800d --- /dev/null +++ b/forms/piradvancedform.h @@ -0,0 +1,37 @@ +#ifndef PIRADVANCEDFORM_H +#define PIRADVANCEDFORM_H + +#include + +class PIRKeysetManager; + +namespace Ui { +class PIRAdvancedForm; +} + +class PIRAdvancedForm : public QWidget +{ + Q_OBJECT + +public: + PIRAdvancedForm(); + + ~PIRAdvancedForm(); + + void setupForm( + PIRKeysetManager *pkm, + unsigned int id); + +private slots: + void on_carrierFrequencySpinBox_valueChanged(int arg1); + + void on_dutyCycleSpinBox_valueChanged(int arg1); + +private: + Ui::PIRAdvancedForm *ui; + + PIRKeysetManager *keysetManager; + unsigned int keysetID; +}; + +#endif // PIRADVANCEDFORM_H diff --git a/forms/piradvancedform.ui b/forms/piradvancedform.ui new file mode 100644 index 0000000..a994638 --- /dev/null +++ b/forms/piradvancedform.ui @@ -0,0 +1,101 @@ + + + PIRAdvancedForm + + + + 0 + 0 + 800 + 480 + + + + Form + + + + + + Advanced Settings + + + Qt::AlignCenter + + + + + + + + + + 0 + 0 + + + + Carrier Frequency + + + + + + + 30000 + + + 60000 + + + 100 + + + 38000 + + + + + + + + + + + + 0 + 0 + + + + Duty Cycle + + + + + + + 5 + + + 95 + + + 5 + + + 50 + + + + + + + + + + + carrierFrequencyChanged(int) + dutyCycleChanged(int) + + diff --git a/forms/pirinputform.cpp b/forms/pirinputform.cpp index acaf555..1ee73d1 100644 --- a/forms/pirinputform.cpp +++ b/forms/pirinputform.cpp @@ -34,6 +34,10 @@ void PIRInputForm::enableButtons( emit cableInputEnabled(keyset->hasKey(id, CableInput_Key)); emit satelliteInputEnabled(keyset->hasKey(id, SatInput_Key)); emit auxInputEnabled(keyset->hasKey(id, AuxInput_Key)); + emit compositeInputEnabled(keyset->hasKey(id, CompositeInput_Key)); + emit componentInputEnabled(keyset->hasKey(id, ComponentInput_Key)); + emit scartInputEnabled(keyset->hasKey(id, ScartInput_Key)); + emit hddInputEnabled(keyset->hasKey(id, HDDInput_Key)); } @@ -156,3 +160,43 @@ void PIRInputForm::on_auxInputButton_released() { mainWindow->stopRepeating(); } + +void PIRInputForm::on_compositeInputButton_pressed() +{ + mainWindow->startRepeating(CompositeInput_Key); +} + +void PIRInputForm::on_compositeInputButton_released() +{ + mainWindow->stopRepeating(); +} + +void PIRInputForm::on_scartInputButton_pressed() +{ + mainWindow->startRepeating(ScartInput_Key); +} + +void PIRInputForm::on_scartInputButton_released() +{ + mainWindow->stopRepeating(); +} + +void PIRInputForm::on_componentInputButton_pressed() +{ + mainWindow->startRepeating(ComponentInput_Key); +} + +void PIRInputForm::on_componentInputButton_released() +{ + mainWindow->stopRepeating(); +} + +void PIRInputForm::on_hddInputButton_pressed() +{ + mainWindow->startRepeating(HDDInput_Key); +} + +void PIRInputForm::on_hddInputButton_released() +{ + mainWindow->stopRepeating(); +} diff --git a/forms/pirinputform.h b/forms/pirinputform.h index e87e95d..285f053 100644 --- a/forms/pirinputform.h +++ b/forms/pirinputform.h @@ -35,6 +35,10 @@ signals: void cableInputEnabled(bool); void satelliteInputEnabled(bool); void auxInputEnabled(bool); + void compositeInputEnabled(bool); + void scartInputEnabled(bool); + void componentInputEnabled(bool); + void hddInputEnabled(bool); private slots: void on_cdInputButton_pressed(); @@ -61,6 +65,14 @@ private slots: void on_satelliteInputButton_released(); void on_auxInputButton_pressed(); void on_auxInputButton_released(); + void on_compositeInputButton_pressed(); + void on_compositeInputButton_released(); + void on_scartInputButton_pressed(); + void on_scartInputButton_released(); + void on_componentInputButton_pressed(); + void on_componentInputButton_released(); + void on_hddInputButton_pressed(); + void on_hddInputButton_released(); private: Ui::PIRInputForm *ui; diff --git a/forms/pirinputform.ui b/forms/pirinputform.ui index 1b493d4..9539c05 100644 --- a/forms/pirinputform.ui +++ b/forms/pirinputform.ui @@ -14,9 +14,6 @@ Form - - 0 - @@ -70,7 +67,7 @@ - + 0 @@ -78,12 +75,12 @@ - PC + Composite - + 0 @@ -91,12 +88,12 @@ - HDMI + SCART - + 0 @@ -104,12 +101,12 @@ - DVD + Component - + 0 @@ -117,12 +114,12 @@ - VCR + HDMI - + 0 @@ -130,11 +127,24 @@ - Antenna + DVD + + + + 0 + 0 + + + + VCR + + + + @@ -147,7 +157,7 @@ - + @@ -160,7 +170,46 @@ - + + + + + 0 + 0 + + + + HDD + + + + + + + + 0 + 0 + + + + Antenna + + + + + + + + 0 + 0 + + + + PC + + + + @@ -369,6 +418,70 @@ + + PIRInputForm + compositeInputEnabled(bool) + compositeInputButton + setEnabled(bool) + + + 399 + 239 + + + 103 + 182 + + + + + PIRInputForm + componentInputEnabled(bool) + componentInputButton + setEnabled(bool) + + + 399 + 239 + + + 498 + 182 + + + + + PIRInputForm + scartInputEnabled(bool) + scartInputButton + setEnabled(bool) + + + 399 + 239 + + + 301 + 182 + + + + + PIRInputForm + hddInputEnabled(bool) + hddInputButton + setEnabled(bool) + + + 399 + 239 + + + 103 + 417 + + + cdInputEnabled(bool) @@ -383,5 +496,9 @@ cableInputEnabled(bool) satelliteInputEnabled(bool) auxInputEnabled(bool) + compositeInputEnabled(bool) + scartInputEnabled(bool) + componentInputEnabled(bool) + hddInputEnabled(bool) diff --git a/keysets/adb.cpp b/keysets/adb.cpp index d3cb689..47a7d6e 100644 --- a/keysets/adb.cpp +++ b/keysets/adb.cpp @@ -299,3 +299,65 @@ void ADBSTB5::populateProtocol( addKey("Yellow", Yellow_Key, 0x22, 8); addKey("Blue", Blue_Key, 0x23, 8); } + + +ADBSTB6::ADBSTB6( + unsigned int index) + : PIRKeysetMetaData( + "TV Receiver Keyset 6", + ADB_Make, + index) +{ +} + + +void ADBSTB6::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // Keyset already populated. + return; + } + + threadableProtocol = new NECProtocol(guiObject, index, true, true); + + setPreData(0x3C84, 16); + + addKey("5", Five_Key, 0x20, 8); + addKey("power", Power_Key, 0x21, 8); + addKey("9", Nine_Key, 0x22, 8); + addKey("yes", Select_Key, 0x23, 8); + addKey("down", Down_Key, 0x24, 8); + addKey("mute", Mute_Key, 0x25, 8); + addKey("vol+", VolumeUp_Key, 0x26, 8); + addKey("vol-", VolumeDown_Key, 0x27, 8); + addKey("4", Four_Key, 0x28, 8); + addKey("2", Two_Key, 0x29, 8); + addKey("8", Eight_Key, 0x2A, 8); + addKey("up", Up_Key, 0x2B, 8); + addKey("? (question)", Unmapped_Key, 0x2C, 8); + addKey("green", Green_Key, 0x2D, 8); + addKey("guide", Guide_Key, 0x2E, 8); + addKey("10", Zero_Key, 0x2F, 8); + addKey("1", One_Key, 0x30, 8); + addKey("exit", Exit_Key, 0x31, 8); + addKey("7", Seven_Key, 0x32, 8); + addKey("0", Zero_Key, 0x33, 8); + addKey("left", Left_Key, 0x34, 8); + addKey("channel+", ChannelUp_Key, 0x35, 8); + addKey("mosaic", PIP_Key, 0x36, 8); + addKey("channel-", ChannelDown_Key, 0x37, 8); + addKey("6", Six_Key, 0x38, 8); + addKey("3", Three_Key, 0x39, 8); + addKey("return", Enter_Key, 0x3A, 8); + addKey("right", Right_Key, 0x3B, 8); + addKey("+ (plus)", Unmapped_Key, 0x3C, 8); + addKey("yellow", Yellow_Key, 0x3D, 8); + addKey("orange", Red_Key, 0x3E, 8); + addKey("blue", Blue_Key, 0x3F, 8); + addKey("info", Info_Key, 0x40, 8); + addKey("A", Unmapped_Key, 0x41, 8); + addKey("B", Unmapped_Key, 0x42, 8); + addKey("envelope", Unmapped_Key, 0x43, 8); +} diff --git a/keysets/adb.h b/keysets/adb.h index af56089..647025e 100644 --- a/keysets/adb.h +++ b/keysets/adb.h @@ -59,4 +59,15 @@ public: QObject *guiObject); }; + +class ADBSTB6: public PIRKeysetMetaData +{ +public: + ADBSTB6( + unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); +}; + #endif // ADB_H diff --git a/keysets/lg.cpp b/keysets/lg.cpp index 31a93bc..84dda8b 100644 --- a/keysets/lg.cpp +++ b/keysets/lg.cpp @@ -354,6 +354,206 @@ void LGTV2b::populateProtocol( } +LGHT1::LGHT1( + unsigned int index) + : PIRKeysetMetaData( + "Home Theater Keyset 1", + LG_Make, + index) +{ +} + + +void LGHT1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // Keyset already populated. + return; + } + + threadableProtocol = new NECXProtocol(guiObject, index, true); + + setPreData(0x2222, 16); + + addKey("play", Play_Key, 0x04, 8); + addKey("stop", Stop_Key, 0x05, 8); + addKey("skip/next track", Next_Key, 0x06, 8); + addKey("skip/prev track", Previous_Key, 0x07, 8); + addKey("vol down", VolumeDown_Key, 0x16, 8); + addKey("vol up", VolumeUp_Key, 0x17, 8); + addKey("power", Power_Key, 0x1E, 8); + addKey("mute", Mute_Key, 0x1F, 8); + addKey("sound effect", Unmapped_Key, 0x2F, 8); + addKey("1", One_Key, 0x41, 8); + addKey("2", Two_Key, 0x42, 8); + addKey("3", Three_Key, 0x43, 8); + addKey("4", Four_Key, 0x44, 8); + addKey("5", Five_Key, 0x45, 8); + addKey("6", Six_Key, 0x46, 8); + addKey("7", Seven_Key, 0x47, 8); + addKey("8", Eight_Key, 0x48, 8); + addKey("9", Nine_Key, 0x49, 8); + addKey("0", Zero_Key, 0x4B, 8); + addKey("repeat", Repeat_Key, 0x4E, 8); + addKey("pause", Pause_Key, 0x4F, 8); + addKey("scan forward", FastForward_Key, 0x52, 8); + addKey("scan back", Rewind_Key, 0x53, 8); + addKey("speaker level", Unmapped_Key, 0x66, 8); + addKey("R", Red_Key, 0x6C, 8); + addKey("G", Green_Key, 0x6D, 8); + addKey("Y", Yellow_Key, 0x6E, 8); + addKey("B", Blue_Key, 0x6F, 8); + addKey("record", Record_Key, 0x83, 8); + addKey("radio&input", Input_Key, 0x8A, 8); + addKey("open/close", Eject_Key, 0x9A, 8); + addKey("back", Exit_Key, 0xA2, 8); + addKey("info/display", Info_Key, 0xA3, 8); + addKey("disc menu", DiscMenu_Key, 0xA4, 8); + addKey("home", Menu_Key, 0xA5, 8); + addKey("down arrow", Down_Key, 0xA6, 8); + addKey("up arrow", Up_Key, 0xA7, 8); + addKey("left arrow", Left_Key, 0xA8, 8); + addKey("right arrow", Right_Key, 0xA9, 8); + addKey("enter", Select_Key, 0xAA, 8); + addKey("title/pop-up", DiscTitle_Key, 0xAF, 8); + addKey("clear", Unmapped_Key, 0xB0, 8); + addKey("search", Unmapped_Key, 0xB3, 8); + addKey("marker", Unmapped_Key, 0xB4, 8); + addKey("optical", Unmapped_Key, 0xB6, 8); + addKey("sleep", Sleep_Key, 0xC2, 8); +} + + +LGHT2::LGHT2( + unsigned int index) + : PIRKeysetMetaData( + "Home Theater / BD Keyset 2", + LG_Make, + index) +{ +} + + +void LGHT2::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // Keyset already populated. + return; + } + + threadableProtocol = new NECXProtocol(guiObject, index, true); + + setPreData(0xC2C2, 16); + + addKey("power", Power_Key, 0x30, 8); + addKey("play", Play_Key, 0x31, 8); + addKey("rewind", Rewind_Key, 0x32, 8); + addKey("fast fwd", FastForward_Key, 0x33, 8); + addKey("channel up", ChannelUp_Key, 0x34, 8); + addKey("next track", Next_Key, 0x34, 8); + addKey("channel down", ChannelDown_Key, 0x35, 8); + addKey("prev track", Previous_Key, 0x35, 8); + addKey("eject", Eject_Key, 0x36, 8); + addKey("Slow Fwd 1/16x", SlowPlus_Key, 0x37, 8); + addKey("pause", Pause_Key, 0x38, 8); + addKey("stop", Stop_Key, 0x39, 8); + addKey("display", Info_Key, 0x3A, 8); + addKey("1", One_Key, 0x3B, 8); + addKey("2", Two_Key, 0x3C, 8); + addKey("3", Three_Key, 0x3D, 8); + addKey("4", Four_Key, 0x3E, 8); + addKey("5", Five_Key, 0x3F, 8); + addKey("6", Six_Key, 0x40, 8); + addKey("7", Seven_Key, 0x41, 8); + addKey("8", Eight_Key, 0x42, 8); + addKey("9", Nine_Key, 0x43, 8); + addKey("0", Zero_Key, 0x44, 8); + addKey("exit", Exit_Key, 0x45, 8); // "return" + addKey("blue", Blue_Key, 0x46, 8); + addKey("clear", Clear_Key, 0x46, 8); + addKey("up arrow", Up_Key, 0x47, 8); + addKey("down arrow", Down_Key, 0x48, 8); + addKey("green", Green_Key, 0x4A, 8); + addKey("title", DiscTitle_Key, 0x4A, 8); + addKey("DVD MENU", DiscMenu_Key, 0x4B, 8); // "list" + addKey("ANGLE", Angle_Key, 0x4C, 8); + addKey("audio", Audio_Key, 0x4F, 8); + addKey("subtitle", Captions_Key, 0x50, 8); + addKey("RANDOM", Random_Key, 0x51, 8); + addKey("red", Red_Key, 0x53, 8); + addKey("repeat", Repeat_Key, 0x53, 8); + addKey("teletxt", Teletext_Key, 0x54, 8); + addKey("A-B", RepeatAB_Key, 0x55, 8); + addKey("menu", Menu_Key, 0x56, 8); + addKey("PROGRAM", Unmapped_Key, 0x57, 8); + addKey("select", Select_Key, 0x58, 8); + addKey("left arrow", Left_Key, 0x59, 8); + addKey("right arrow", Right_Key, 0x5A, 8); + addKey("*", Unmapped_Key, 0x5E, 8); + addKey("Slow Rev 1/16x", SlowMinus_Key, 0x60, 8); + addKey("yellow", Yellow_Key, 0x61, 8); // "MARKER" + addKey("search", Unmapped_Key, 0x62, 8); + addKey("ZOOM", Zoom_Key, 0x64, 8); + addKey("home", Unmapped_Key, 0x67, 8); + addKey("favourite", Favorites_Key, 0x74, 8); + addKey("Power ON", PowerOn_Key, 0x75, 8); + addKey("Power OFF", PowerOff_Key, 0x76, 8); + addKey("ProgramUp", Unmapped_Key, 0x77, 8); + addKey("ProgramDown", Unmapped_Key, 0x78, 8); + addKey("Lock", Unmapped_Key, 0x79, 8); + addKey("inputnext", Input_Key, 0xB0, 8); + addKey("record", Record_Key, 0xB6, 8); + addKey("timer rec", RecordTimed_Key, 0xB7, 8); + addKey("TimeShift", Unmapped_Key, 0xB9, 8); + addKey("TV/DVD", Unmapped_Key, 0xBE, 8); + addKey("inputdvd", DVDInput_Key, 0xF1, 8); + addKey("inputhdd", HDDInput_Key, 0xF2, 8); + addKey("ProgramList", Unmapped_Key, 0xF4, 8); +} + + +LGHT2a::LGHT2a( + unsigned int index) + : LGHT2(index) +{ + setKeysetName("Home Theater / BD Keyset 2a"); +} + + +void LGHT2a::populateProtocol( + QObject *guiObject) +{ + LGHT2::populateProtocol(guiObject); + + addKey("A (Red)", Red_Key, 0x7C, 8); + addKey("B (Green)", Green_Key, 0x7D, 8); + addKey("C (Blue)", Blue_Key, 0x7E, 8); + addKey("D (Yellow)", Yellow_Key, 0x7F, 8); + addKey("Rew 100x", Unmapped_Key, 0x91, 8); + addKey("Rew 16x", Unmapped_Key, 0x92, 8); + addKey("Rew 4x", Unmapped_Key, 0x95, 8); + addKey("Rew 2x", Unmapped_Key, 0x96, 8); + addKey("Fwd 2x", Unmapped_Key, 0x99, 8); + addKey("Fwd 4x", Unmapped_Key, 0x9B, 8); + addKey("Fwd 16x", Unmapped_Key, 0x9D, 8); + addKey("Fwd 100x", Unmapped_Key, 0x9F, 8); + addKey("Z: Mp1", Unmapped_Key, 0xDE, 8); + addKey("Z: Factory Reset !!!", Unmapped_Key, 0xDF, 8); + addKey("Z: CPRM DATA READ/SAVE", Unmapped_Key, 0xE0, 8); + addKey("Z: TECHNICAL MENU", Unmapped_Key, 0xE1, 8); + addKey("Z: INTERLACE/PROG SCAN", Unmapped_Key, 0xE2, 8); + addKey("Z: service menu", Unmapped_Key, 0xE5, 8); + addKey("Resolution", AspectRatio_Key, 0xF5, 8); + addKey("Subtitle on-off", Unmapped_Key, 0xF7, 8); + addKey("Pic Mode", PictureMode_Key, 0xF9, 8); + addKey("Music ID - ID", Unmapped_Key, 0xFA, 8); +} + + LGDisc1::LGDisc1( unsigned int index) : PIRKeysetMetaData( @@ -380,9 +580,10 @@ void LGDisc1::populateProtocol( addKey("cd-dvd", Unmapped_Key, 0x03, 8); addKey("play", Play_Key, 0x04, 8); addKey("stop", Stop_Key, 0x05, 8); - addKey("<<<", Unmapped_Key, 0x06, 8); - addKey(">>>", Unmapped_Key, 0x07, 8); + addKey("<<<", Next_Key, 0x06, 8); + addKey(">>>", Previous_Key, 0x07, 8); addKey("aux", AuxInput_Key, 0x09, 8); + addKey("aux", Input_Key, 0x09, 8); addKey("minus", Unmapped_Key, 0x12, 8); // "pr_preset_down" addKey("plus", Unmapped_Key, 0x13, 8); // "pr_preset_up" addKey("volume-", VolumeDown_Key, 0x16, 8); diff --git a/keysets/lg.h b/keysets/lg.h index 5fd1096..497d4a4 100644 --- a/keysets/lg.h +++ b/keysets/lg.h @@ -75,6 +75,36 @@ public: QObject *guiObject); }; +class LGHT1: public PIRKeysetMetaData +{ +public: + LGHT1( + unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); +}; + +class LGHT2: public PIRKeysetMetaData +{ +public: + LGHT2( + unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); +}; + +class LGHT2a: public LGHT2 +{ +public: + LGHT2a( + unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); +}; + class LGDisc1: public PIRKeysetMetaData { public: diff --git a/keysets/medialink.cpp b/keysets/medialink.cpp new file mode 100644 index 0000000..4db4ed0 --- /dev/null +++ b/keysets/medialink.cpp @@ -0,0 +1,78 @@ +#include "medialink.h" +#include "protocols/necprotocol.h" + +MedialinkSTB1::MedialinkSTB1( + unsigned int index) + : PIRKeysetMetaData( + "HD Receiver Keyset 1", + Medialink_Make, + index) +{ +} + + +void MedialinkSTB1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // Keyset already populated. + return; + } + + threadableProtocol = new NECProtocol(guiObject, index, true, true); + + setPreData(0x00BE, 16); + + addKey("CH+", ChannelUp_Key, 0x00, 8); + addKey("CH-", ChannelDown_Key, 0x01, 8); + addKey("Skip-", Previous_Key, 0x04, 8); + addKey("Page+", PageUp_Key, 0x07, 8); + addKey("PVR", HDDInput_Key, 0x08, 8); + addKey("Favourite", Favorites_Key, 0x09, 8); + addKey("Power", Power_Key, 0x0A, 8); + addKey("Green", Green_Key, 0x0D, 8); + addKey("Yellow", Yellow_Key, 0x0E, 8); + addKey("Blue", Blue_Key, 0x0F, 8); + addKey("num_0", Zero_Key, 0x10, 8); + addKey("num_1", One_Key, 0x11, 8); + addKey("num_2", Two_Key, 0x12, 8); + addKey("num_3", Three_Key, 0x13, 8); + addKey("num_4", Four_Key, 0x14, 8); + addKey("num_5", Five_Key, 0x15, 8); + addKey("num_6", Six_Key, 0x16, 8); + addKey("num_7", Seven_Key, 0x17, 8); + addKey("num_8", Eight_Key, 0x18, 8); + addKey("num_9", Nine_Key, 0x19, 8); + addKey("Menu", Menu_Key, 0x1A, 8); + addKey("Sleep", Sleep_Key, 0x1B, 8); + addKey("exit", Exit_Key, 0x1C, 8); + addKey("Info", Info_Key, 0x1D, 8); + addKey("Last_ch", PrevChannel_Key, 0x1E, 8); + addKey("Select", Select_Key, 0x1F, 8); + addKey("V-Format", Unmapped_Key, 0x40, 8); + addKey("PVR Right key", Unmapped_Key, 0x42, 8); + addKey("Guide", Guide_Key, 0x43, 8); + addKey("Time", Unmapped_Key, 0x44, 8); + addKey("rewind", Rewind_Key, 0x45, 8); + addKey("Pause", Pause_Key, 0x46, 8); + addKey("Subtitle", Captions_Key, 0x47, 8); + addKey("ffwd", FastForward_Key, 0x48, 8); + addKey("Audio", Audio_Key, 0x49, 8); + addKey("Stop", Stop_Key, 0x4A, 8); + addKey("Play", Play_Key, 0x4B, 8); + addKey("Option", Unmapped_Key, 0x4C, 8); + addKey("Red", Red_Key, 0x4D, 8); + addKey("up_arrow", Up_Key, 0x4E, 8); + addKey("down_arrow", Down_Key, 0x4F, 8); + addKey("Teletext", Unmapped_Key, 0x51, 8); + addKey("Page-", PageDown_Key, 0x52, 8); + addKey("left_arrow", Left_Key, 0x53, 8); + addKey("right_arrow", Right_Key, 0x54, 8); + addKey("TV/Radio", Input_Key, 0x55, 8); + addKey("TV/Radio", TunerInput_Key, 0x55, 8); + addKey("Record", Record_Key, 0x56, 8); + addKey("PVR Left Key", Unmapped_Key, 0x57, 8); + addKey("PVR Middle", Unmapped_Key, 0x58, 8); + addKey("Skip+", Next_Key, 0x5E, 8); +} diff --git a/keysets/medialink.h b/keysets/medialink.h new file mode 100644 index 0000000..22638f2 --- /dev/null +++ b/keysets/medialink.h @@ -0,0 +1,18 @@ +#ifndef MEDIALINK_H +#define MEDIALINK_H + +#include "pirkeysetmetadata.h" + +class QObject; + +class MedialinkSTB1: public PIRKeysetMetaData +{ +public: + MedialinkSTB1( + unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); +}; + +#endif // MEDIALINK_H diff --git a/keysets/mitsubishi.cpp b/keysets/mitsubishi.cpp index ae94c7d..75893ed 100644 --- a/keysets/mitsubishi.cpp +++ b/keysets/mitsubishi.cpp @@ -1,5 +1,6 @@ #include "mitsubishi.h" #include "protocols/lircprotocol.h" +#include "protocols/protonprotocol.h" MitsubishiTV1::MitsubishiTV1( unsigned int index) @@ -244,3 +245,54 @@ void MitsubishiVCR1a::populateProtocol( addKey("JOG+", Unmapped_Key, 0x50, 8); addKey("JOG-", Unmapped_Key, 0x48, 8); } + + +MitsubishiProjector1::MitsubishiProjector1( + unsigned int index) + : PIRKeysetMetaData( + "Projector Keyset 1", + Mitsubishi_Make, + index) +{ +} + + +void MitsubishiProjector1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // Keyset already populated. + return; + } + + threadableProtocol = new ProtonProtocol(guiObject, index); + + setPreData(0xF0, 8); + + addKey("PowerOn", PowerOn_Key, 0x41, 8); + addKey("PowerOff", PowerOff_Key, 0x42, 8); + addKey("HDMI", HDMIInput_Key, 0x70, 8); + addKey("Component", ComponentInput_Key, 0x64, 8); + addKey("Video", CompositeInput_Key, 0x65, 8); + addKey("Computer", PCInput_Key, 0x60, 8); + addKey("S-Video", SVideoInput_Key, 0x66, 8); + addKey("Up", Up_Key, 0x82, 8); + addKey("Right", Right_Key, 0x81, 8); + addKey("Enter", Enter_Key, 0x87, 8); + addKey("Left", Left_Key, 0x80, 8); + addKey("Down", Down_Key, 0x83, 8); + addKey("Menu", Menu_Key, 0x86, 8); + addKey("Aspect", AspectRatio_Key, 0xE2, 8); + addKey("M1", Unmapped_Key, 0xE4, 8); + addKey("M2", Unmapped_Key, 0xE5, 8); + addKey("M3", Unmapped_Key, 0xE6, 8); + addKey("Contrast", ContrastUp_Key, 0xD0, 8); + addKey("Brightness", BrightnessUp_Key, 0xD1, 8); + addKey("ColorTemp", ColorUp_Key, 0xD4, 8); + addKey("Gamma", Unmapped_Key, 0xD5, 8); + addKey("Sharpness", Unmapped_Key, 0xD6, 8); + addKey("AutoPosition", Unmapped_Key, 0xA2, 8); + addKey("Blank", Unmapped_Key, 0xA6, 8); + addKey("Keystone", Keystone_Key, 0x43, 8); +} diff --git a/keysets/mitsubishi.h b/keysets/mitsubishi.h index 24a91ee..302c818 100644 --- a/keysets/mitsubishi.h +++ b/keysets/mitsubishi.h @@ -45,4 +45,14 @@ public: QObject *guiObject); }; +class MitsubishiProjector1: public PIRKeysetMetaData +{ +public: + MitsubishiProjector1( + unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); +}; + #endif // MITSUBISHI_H diff --git a/keysets/multichoice.cpp b/keysets/multichoice.cpp new file mode 100644 index 0000000..1511b25 --- /dev/null +++ b/keysets/multichoice.cpp @@ -0,0 +1,158 @@ +#include "multichoice.h" +#include "protocols/rc5protocol.h" +#include "protocols/xmpprotocol.h" + +MultichoiceSTB1::MultichoiceSTB1( + unsigned int index) + : PIRKeysetMetaData( + "TV Decoder Keyset 1", + Multichoice_Make, + index) +{ +} + + +void MultichoiceSTB1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // Keyset already populated. + return; + } + + threadableProtocol = new RC5Protocol(guiObject, index); + + addKey("0", Zero_Key, 0x1600, 13); + addKey("1", One_Key, 0x1601, 13); + addKey("2", Two_Key, 0x1602, 13); + addKey("3", Three_Key, 0x1603, 13); + addKey("4", Four_Key, 0x1604, 13); + addKey("5", Five_Key, 0x1605, 13); + addKey("6", Six_Key, 0x1606, 13); + addKey("7", Seven_Key, 0x1607, 13); + addKey("8", Eight_Key, 0x1608, 13); + addKey("9", Nine_Key, 0x1609, 13); + addKey("power", Power_Key, 0x160C, 13); + addKey("Mute", Mute_Key, 0x160D, 13); + + addKey("volup", VolumeUp_Key, 0x1610, 13); + addKey("voldown", VolumeDown_Key, 0x1611, 13); + addKey("up", Up_Key, 0x1612, 13); + addKey("down", Down_Key, 0x1613, 13); + + addKey("menu", Menu_Key, 0x161C, 13); + addKey("left", Left_Key, 0x161D, 13); + addKey("right", Right_Key, 0x161E, 13); + + addKey("progup", ChannelUp_Key, 0x1620, 13); + addKey("progdn", ChannelDown_Key, 0x1621, 13); + addKey("ok", Select_Key, 0x1622, 13); +// addKey("teletext", Unmapped_Key, 0x1624, 13); + addKey("Subtitle", Captions_Key, 0x1624, 13); + addKey("radio", TunerInput_Key, 0x1625, 13); + addKey("FFWD", FastForward_Key, 0x1625, 13); + addKey("yellow", Yellow_Key, 0x162A, 13); + addKey("Record", Record_Key, 0x162A, 13); + addKey("green", Green_Key, 0x162B, 13); + addKey("Stop", Stop_Key, 0x162B, 13); + addKey("red", Red_Key, 0x162C, 13); + addKey("SP/LP", VHSSpeed_Key, 0x162C, 13); + addKey("information", Info_Key, 0x162D, 13); + addKey("Stop", Stop_Key, 0x162D, 13); + addKey("blue", Blue_Key, 0x162E, 13); + addKey("Play", Play_Key, 0x162E, 13); + addKey("tv", Input_Key, 0x162F, 13); + + addKey("exit", Exit_Key, 0x1631, 13); + addKey("Last/Prev Ch", PrevChannel_Key, 0x1631, 13); + addKey("tvguide", Guide_Key, 0x1635, 13); +} + + +MultichoiceSTB2::MultichoiceSTB2( + unsigned int index) + : PIRKeysetMetaData( + "TV Decoder Keyset 2", + Multichoice_Make, + index) +{ +} + + +void MultichoiceSTB2::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // Keyset already populated. + return; + } + + threadableProtocol = new XMPProtocol( + guiObject, index, 0x1, 0x1, 0x44, 0x47, false); + + addXMPKey("0", Zero_Key, 0x00, 0x00); + addXMPKey("1", One_Key, 0x01, 0x00); + addXMPKey("2", Two_Key, 0x02, 0x00); + addXMPKey("3", Three_Key, 0x03, 0x00); + addXMPKey("4", Four_Key, 0x04, 0x00); + addXMPKey("5", Five_Key, 0x05, 0x00); + addXMPKey("6", Six_Key, 0x06, 0x00); + addXMPKey("7", Seven_Key, 0x07, 0x00); + addXMPKey("8", Eight_Key, 0x08, 0x00); + addXMPKey("9", Nine_Key, 0x09, 0x00); + addXMPKey("Mute", Mute_Key, 0x0C, 0x00); + addXMPKey("Power", Power_Key, 0x0F, 0x00); + addXMPKey("Menu", Menu_Key, 0x25, 0x00); + addXMPKey("TV Guide", Guide_Key, 0x27, 0x00); + addXMPKey("Stop", Stop_Key, 0x30, 0x00); + addXMPKey("Rewind", Rewind_Key, 0x31, 0x00); + addXMPKey("Play/Pause", Play_Key, 0x32, 0x00); + addXMPKey("Play/Pause", Pause_Key, 0x32, 0x00); + addXMPKey("Fast Forward", FastForward_Key, 0x33, 0x00); + addXMPKey("Record", Record_Key, 0x34, 0x00); + addXMPKey("Fastext Red", Red_Key, 0x40, 0x00); + addXMPKey("Fastext Blue", Blue_Key, 0x41, 0x00); + addXMPKey("Fastext White", Unmapped_Key, 0x42, 0x00); + addXMPKey("Fastext Yellow", Yellow_Key, 0x43, 0x00); + addXMPKey("Fastext Green", Green_Key, 0x44, 0x00); + addXMPKey("TV", Unmapped_Key, 0x50, 0x00); + addXMPKey("Alt", Unmapped_Key, 0x51, 0x00); + addXMPKey("Language", Audio_Key, 0x52, 0x00); + addXMPKey("Help", Unmapped_Key, 0x53, 0x00); + addXMPKey(" TV (Audio)", Unmapped_Key, 0x58, 0x00); + addXMPKey(" Alt (Subtitle)", Captions_Key, 0x59, 0x00); + addXMPKey(" TV Guide (iTV)", Unmapped_Key, 0x5A, 0x00); + addXMPKey(" Language (PG)", Unmapped_Key, 0x5B, 0x00); + addXMPKey(" Mute", Unmapped_Key, 0x5C, 0x00); + addXMPKey(" Info", Unmapped_Key, 0x5D, 0x00); + addXMPKey(" Exit (Input)", Input_Key, 0x5E, 0x00); + addXMPKey(" Up", Unmapped_Key, 0x5F, 0x00); + addXMPKey(" Left", Unmapped_Key, 0x60, 0x00); + addXMPKey(" OK", Unmapped_Key, 0x61, 0x00); + addXMPKey(" Right", Unmapped_Key, 0x62, 0x00); + addXMPKey(" Down", Unmapped_Key, 0x63, 0x00); + addXMPKey(" Stop", Unmapped_Key, 0x64, 0x00); + addXMPKey(" Record", Unmapped_Key, 0x65, 0x00); + addXMPKey(" Program Down", Unmapped_Key, 0x66, 0x00); + addXMPKey(" Program Up", Unmapped_Key, 0x67, 0x00); + addXMPKey(" Menu", Unmapped_Key, 0x6F, 0x00); + addXMPKey(" Help", Unmapped_Key, 0x70, 0x00); + addXMPKey(" Red", Unmapped_Key, 0x71, 0x00); + addXMPKey(" Blue", Unmapped_Key, 0x72, 0x00); + addXMPKey(" White", Unmapped_Key, 0x73, 0x00); + addXMPKey(" Yellow", Unmapped_Key, 0x74, 0x00); + addXMPKey(" Green", Unmapped_Key, 0x75, 0x00); + addXMPKey("Volume Up", VolumeUp_Key, 0x83, 0x00); + addXMPKey("Volume Down", VolumeDown_Key, 0x84, 0x00); + addXMPKey("Program Down", ChannelDown_Key, 0x85, 0x00); + addXMPKey("Program Up", ChannelUp_Key, 0x86, 0x00); + addXMPKey("Down", Down_Key, 0x87, 0x00); + addXMPKey("Right", Right_Key, 0x88, 0x00); + addXMPKey("OK", Select_Key, 0x8B, 0x00); + addXMPKey("Left", Left_Key, 0x8C, 0x00); + addXMPKey("Up", Up_Key, 0x8D, 0x00); + addXMPKey("Exit", Exit_Key, 0x8E, 0x00); + addXMPKey("Info", Info_Key, 0x8F, 0x00); +} diff --git a/keysets/multichoice.h b/keysets/multichoice.h new file mode 100644 index 0000000..bb42058 --- /dev/null +++ b/keysets/multichoice.h @@ -0,0 +1,28 @@ +#ifndef MULTICHOICE_H +#define MULTICHOICE_H + +#include "pirkeysetmetadata.h" + +class QObject; + +class MultichoiceSTB1: public PIRKeysetMetaData +{ +public: + MultichoiceSTB1( + unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); +}; + +class MultichoiceSTB2: public PIRKeysetMetaData +{ +public: + MultichoiceSTB2( + unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); +}; + +#endif // MULTICHOICE_H diff --git a/keysets/nec.cpp b/keysets/nec.cpp new file mode 100644 index 0000000..62612e0 --- /dev/null +++ b/keysets/nec.cpp @@ -0,0 +1,490 @@ +#include "nec.h" +#include "protocols/necprotocol.h" +#include "protocols/necxprotocol.h" + +NECTV1::NECTV1( + unsigned int index) + : PIRKeysetMetaData( + "TV Keyset 1", + NEC_Make, + index) +{ +} + + +void NECTV1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // Keyset already populated. + return; + } + + threadableProtocol = new NECProtocol(guiObject, index, false, true); + + setPreData(0x18, 8); + + addKey("prog_+", ChannelUp_Key, 0x00, 8); + addKey("prog_-", ChannelDown_Key, 0x01, 8); + addKey("TV_+_VOL", VolumeUp_Key, 0x02, 8); + addKey("TV_-_VOL", VolumeDown_Key, 0x03, 8); + addKey("-A-", Unmapped_Key, 0x04, 8); + addKey("-B-", Unmapped_Key, 0x05, 8); + addKey("-C-", Unmapped_Key, 0x06, 8); + addKey("-D-", Unmapped_Key, 0x07, 8); + addKey("power", Power_Key, 0x08, 8); + addKey("TV_MUTE", Mute_Key, 0x09, 8); + addKey("TV_TV/VIDEO", Input_Key, 0x0A, 8); + addKey("Mode", PictureMode_Key, 0x0B, 8); + addKey("Hue_+", ColorUp_Key, 0x0C, 8); + addKey("Hue_-", ColorDown_Key, 0x0D, 8); + addKey("Norm", Unmapped_Key, 0x0E, 8); +// addKey("TV_CH_CALL", Unmapped_Key, 0x0F, 8); + addKey("Ok", Select_Key, 0x0F, 8); + + addKey("1", One_Key, 0x10, 8); + addKey("2", Two_Key, 0x11, 8); + addKey("3", Three_Key, 0x12, 8); + addKey("4", Four_Key, 0x13, 8); + addKey("5", Five_Key, 0x14, 8); + addKey("6", Six_Key, 0x15, 8); + addKey("7", Seven_Key, 0x16, 8); + addKey("8", Eight_Key, 0x17, 8); + addKey("9", Nine_Key, 0x18, 8); + addKey("-/--", DoubleDigit_Key, 0x19, 8); + addKey("0", Zero_Key, 0x1A, 8); + addKey("shift_-A-", Unmapped_Key, 0x1C, 8); + addKey("TV_OFF_TIMER", Sleep_Key, 0x1E, 8); + addKey("TV_ON_TIMER", Timer_Key, 0x1F, 8); + + addKey("Bass_+", BassUp_Key, 0x42, 8); + addKey("Bass_-", BassDown_Key, 0x43, 8); + addKey("Treble_+", TrebleUp_Key, 0x44, 8); + addKey("Treble_-", TrebleDown_Key, 0x45, 8); + addKey("contr_+", ContrastUp_Key, 0x46, 8); + addKey("contr_-", ContrastDown_Key, 0x47, 8); + addKey("Mode_+", Unmapped_Key, 0x48, 8); + addKey("Mode_-", Unmapped_Key, 0x49, 8); + addKey("Bright_+", BrightnessUp_Key, 0x4A, 8); + addKey("Bright_-", BrightnessDown_Key, 0x4B, 8); + + addKey("shift_Menu", Unmapped_Key, 0x5B, 8); + addKey("shift_|>", Unmapped_Key, 0x5D, 8); + addKey("menu", Menu_Key, 0x5E, 8); + addKey("|>", Unmapped_Key, 0x5F, 8); + + addKey("shift_Mode", Unmapped_Key, 0xC3, 8); +} + + +NECVCR1::NECVCR1( + unsigned int index) + : PIRKeysetMetaData( + "VCR Keyset 1", + NEC_Make, + index) +{ +} + + +void NECVCR1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // Keyset already populated. + return; + } + + threadableProtocol = new NECProtocol(guiObject, index, false, true); + + setPreData(0x19, 8); + + addKey("CHANNEL_UP", ChannelUp_Key, 0x00, 8); + addKey("CHANNEL_UP", Up_Key, 0x00, 8); + addKey("CHANNEL_DOWN", ChannelDown_Key, 0x01, 8); + addKey("CHANNEL_DOWN", Down_Key, 0x01, 8); + addKey("StillAdv", StepForward_Key, 0x03, 8); + addKey("SLOW", Slow_Key, 0x03, 8); + addKey("STOP", Stop_Key, 0x04, 8); + addKey("PLAY", Play_Key, 0x05, 8); + addKey("Rec", Record_Key, 0x06, 8); + addKey("OPERATE", Power_Key, 0x08, 8); + addKey("RESET", Reset_Key, 0x09, 8); + addKey("TV/VCR", Input_Key, 0x0A, 8); + addKey("COUNT._MEM.", Unmapped_Key, 0x0B, 8); + addKey("FFWD", FastForward_Key, 0x0C, 8); + addKey("REWIND", Rewind_Key, 0x0D, 8); + addKey("PAUSE", Pause_Key, 0x0E, 8); + addKey("Eject", Eject_Key, 0x0F, 8); + + addKey("1", One_Key, 0x10, 8); + addKey("2", Two_Key, 0x11, 8); + addKey("3", Three_Key, 0x12, 8); + addKey("4", Four_Key, 0x13, 8); + addKey("5", Five_Key, 0x14, 8); + addKey("6", Six_Key, 0x15, 8); + addKey("7", Seven_Key, 0x16, 8); + addKey("8", Eight_Key, 0x17, 8); + addKey("9", Nine_Key, 0x18, 8); + addKey("0", Zero_Key, 0x1A, 8); + addKey("+_SET/+_SHIFT", Right_Key, 0x1E, 8); + + addKey("TIMER_MODE", Unmapped_Key, 0x82, 8); + addKey("TIMER_REC", RecordTimed_Key, 0x83, 8); + addKey("ON_SCREEN", Menu_Key, 0x84, 8); + addKey("-_SET/-_SHIFT", Left_Key, 0x88, 8); + addKey("TIMER/COUNTER", Unmapped_Key, 0x8A, 8); + + addKey("DIGITAL_MEM.", Unmapped_Key, 0x90, 8); + addKey("VPS", Unmapped_Key, 0x9A, 8); + addKey("STROBE", Unmapped_Key, 0x9A, 8); + addKey("DIGITAL_NR", NoiseReduction_Key, 0x9C, 8); +} + + +NECVCR2::NECVCR2( + unsigned int index) + : PIRKeysetMetaData( + "VCR Keyset 2", + NEC_Make, + index) +{ +} + + +void NECVCR2::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // Keyset already populated. + return; + } + + threadableProtocol = new NECProtocol(guiObject, index, false, true); + + setPreData(0x6E, 8); + + addKey("PLAY", Play_Key, 0x08, 8); + addKey("STOP", Stop_Key, 0x01, 8); + addKey("||_P/STILL", Pause_Key, 0x0B, 8); + addKey(">>_FF", FastForward_Key, 0x03, 8); + addKey("<<_REW", Rewind_Key, 0x02, 8); + addKey("O_REC/QSR", Record_Key, 0x09, 8); + addKey("OPERATE", Power_Key, 0x14, 8); + addKey("0_PGM_RK", Zero_Key, 0x04, 8); + addKey("1_CHARACTER", One_Key, 0x05, 8); + addKey("2_CHARACTER", Two_Key, 0x06, 8); + addKey("3_CHARACTER", Three_Key, 0x07, 8); + addKey("4_CURSOR", Four_Key, 0x0C, 8); + addKey("5_CURSOR", Five_Key, 0x0D, 8); + addKey("6_CURSOR", Six_Key, 0x0E, 8); + addKey("7_SIZE", Seven_Key, 0x0F, 8); + addKey("8_SIZE", Eight_Key, 0x1C, 8); + addKey("9_SIZE", Nine_Key, 0x1D, 8); + addKey("+_PGM_RK", Unmapped_Key, 0x18, 8); + addKey("-_PGM_RK", Unmapped_Key, 0x19, 8); + addKey("EJECT", Eject_Key, 0x00, 8); + addKey("CHILD_LOCK", Unmapped_Key, 0x3F, 8); + addKey("DISPLAY", Info_Key, 0x1E, 8); + addKey("CLEAR", Clear_Key, 0x1F, 8); + addKey("MENU", Menu_Key, 0x16, 8); + addKey("A.TRK", AutoTracking_Key, 0x5F, 8); + addKey("TU/SC/AV", Unmapped_Key, 0x56, 8); + addKey("RESET", Reset_Key, 0x4D, 8); + addKey("CL/CT_EM", Unmapped_Key, 0x4C, 8); + addKey("+_MFT/SLOW", Unmapped_Key, 0x1A, 8); + addKey("-_MFT/SLOW", Unmapped_Key, 0x1B, 8); + addKey("||>_F/ADV", StepForward_Key, 0x10, 8); + addKey("SP/LP", VHSSpeed_Key, 0x48, 8); + addKey("TV/VCR", Input_Key, 0x15, 8); + addKey("A.DUB", Unmapped_Key, 0xC2, 8); + addKey("VISS", IndexSearch_Key, 0x41, 8); + addKey("MARK", IndexMark_Key, 0x50, 8); + addKey("ERASE", IndexErase_Key, 0x42, 8); + addKey("G-CODE", Unmapped_Key, 0x47, 8); +} + + +NECVCR3::NECVCR3( + unsigned int index) + : PIRKeysetMetaData( + "VCR Keyset 3", + NEC_Make, + index) +{ +} + + +void NECVCR3::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // Keyset already populated. + return; + } + + threadableProtocol = new NECProtocol(guiObject, index, false, true); + + setPreData(0x31, 8); + + addKey("CHANNEL_UP", ChannelUp_Key, 0x01, 8); + addKey("CHANNEL_DOWN", ChannelDown_Key, 0x02, 8); + addKey("Audio", Audio_Key, 0x03, 8); + addKey("1", One_Key, 0x04, 8); + addKey("2", Two_Key, 0x05, 8); + addKey("3", Three_Key, 0x06, 8); + addKey("4", Four_Key, 0x07, 8); + addKey("VTR_V", Unmapped_Key, 0x08, 8); + addKey("5", Five_Key, 0x0C, 8); + addKey("6", Six_Key, 0x0D, 8); + addKey("7", Seven_Key, 0x0E, 8); + addKey("8", Eight_Key, 0x0F, 8); + + addKey("STOP", Stop_Key, 0x10, 8); + addKey("PAUSE/STILL", Pause_Key, 0x11, 8); + addKey("<<_REW", Rewind_Key, 0x12, 8); + addKey("FF_>>", FastForward_Key, 0x13, 8); + addKey("PLAY", Play_Key, 0x14, 8); + addKey("RECORD", Record_Key, 0x15, 8); + addKey("INDEX", IndexSearch_Key, 0x19, 8); + addKey("SLOW", Slow_Key, 0x1A, 8); + addKey("9", Nine_Key, 0x1C, 8); + addKey("0/AV", Zero_Key, 0x1D, 8); + addKey("0/AV", Input_Key, 0x1D, 8); + addKey("SC", Unmapped_Key, 0x1E, 8); + addKey("ATR", AutoTracking_Key, 0x1F, 8); + + addKey("MEMORY", Unmapped_Key, 0x43, 8); + addKey("RESET", Reset_Key, 0x44, 8); + addKey("REMAIN", Unmapped_Key, 0x45, 8); + addKey("CHECK", Unmapped_Key, 0x46, 8); + addKey("PLUS", Right_Key, 0x47, 8); + addKey("MINUS", Left_Key, 0x48, 8); + addKey("CL", Unmapped_Key, 0x4A, 8); + addKey("OK", Select_Key, 0x4B, 8); + + addKey("KEY", Unmapped_Key, 0x50, 8); // "LOCK" + addKey("TV_MONITOR", Unmapped_Key, 0x51, 8); + addKey("MARK", IndexMark_Key, 0x54, 8); + addKey("ERASE", IndexErase_Key, 0x55, 8); + addKey("OPERATE", Power_Key, 0x5B, 8); + addKey("SP/LP", VHSSpeed_Key, 0x5E, 8); +} + + +NECDVD1::NECDVD1( + unsigned int index) + : PIRKeysetMetaData( + "DVD Keyset 1", + NEC_Make, + index) +{ +} + + +void NECDVD1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // Keyset already populated. + return; + } + + threadableProtocol = new NECXProtocol(guiObject, index, true); + + setPreData(0x2D2D, 16); + + addKey("Power", Power_Key, 0x30, 8); + addKey("Eject", Eject_Key, 0x36, 8); + addKey("Menu", Menu_Key, 0x4B, 8); + addKey("Title", DiscTitle_Key, 0x45, 8); + addKey("Setup", Menu_Key, 0x56, 8); + addKey("Return", Exit_Key, 0x45, 8); + addKey("Left", Left_Key, 0x59, 8); + addKey("Up", Up_Key, 0x47, 8); + addKey("Right", Right_Key, 0x5A, 8); + addKey("Down", Down_Key, 0x48, 8); + addKey("Select", Select_Key, 0x58, 8); + addKey("Display", Info_Key, 0x3A, 8); + addKey("Zoom", Zoom_Key, 0x64, 8); + addKey("Freeze_Back", StepBack_Key, 0x60, 8); + addKey("Freeze", StepForward_Key, 0x37, 8); + addKey("Pause", Pause_Key, 0x38, 8); + addKey("Rewind", Rewind_Key, 0x35, 8); + addKey("Play", Play_Key, 0x31, 8); + addKey("Fast_Forward", FastForward_Key, 0x34, 8); + addKey("Stop", Stop_Key, 0x39, 8); + addKey("1", One_Key, 0x3B, 8); + addKey("2", Two_Key, 0x3C, 8); + addKey("3", Three_Key, 0x3D, 8); + addKey("4", Four_Key, 0x3E, 8); + addKey("5", Five_Key, 0x3F, 8); + addKey("6", Six_Key, 0x40, 8); + addKey("7", Seven_Key, 0x41, 8); + addKey("8", Eight_Key, 0x42, 8); + addKey("9", Nine_Key, 0x43, 8); + addKey("0", Zero_Key, 0x44, 8); + addKey("Program", Program_Key, 0x57, 8); + addKey("Clear", Clear_Key, 0x46, 8); + addKey("Audio", Audio_Key, 0x4F, 8); + addKey("Subtitle", Captions_Key, 0x50, 8); + addKey("Angle", Angle_Key, 0x4C, 8); + addKey("Random", Random_Key, 0x51, 8); + addKey("Marker", IndexMark_Key, 0x61, 8); + addKey("Search", IndexSearch_Key, 0x62, 8); + addKey("Repeat", Repeat_Key, 0x53, 8); + addKey("A-B", RepeatAB_Key, 0x55, 8); +} + + +NECProjector1::NECProjector1( + unsigned int index) + : PIRKeysetMetaData( + "Projector Keyset 1", + NEC_Make, + index) +{ +} + + +void NECProjector1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // Keyset already populated. + return; + } + + threadableProtocol = new NECProtocol(guiObject, index, false, true); + + setPreData(0x18, 8); + + addKey("R", Unmapped_Key, 0x00, 8); + addKey("G", Unmapped_Key, 0x01, 8); + addKey("B", Unmapped_Key, 0x02, 8); + addKey("OPERATE", Power_Key, 0x06, 8); + addKey("DISPLAY", Unmapped_Key, 0x07, 8); + addKey("POWER_ON", PowerOn_Key, 0x08, 8); + addKey("POWER_ON", Power_Key, 0x08, 8); + addKey("END", Unmapped_Key, 0x09, 8); + addKey("POINT", Unmapped_Key, 0x0A, 8); + addKey("TEST", Unmapped_Key, 0x0B, 8); + addKey("KELVIN", Unmapped_Key, 0x0D, 8); + addKey("COARSE/FINE", Unmapped_Key, 0x0F, 8); + + addKey("STORE", Unmapped_Key, 0x12, 8); + addKey("HELP", Unmapped_Key, 0x13, 8); + addKey("POWER_OFF", PowerOff_Key, 0x14, 8); + addKey("STATIC", Unmapped_Key, 0x15, 8); + addKey("ENTER", Select_Key, 0x17, 8); + addKey("1", One_Key, 0x18, 8); + addKey("2", Two_Key, 0x19, 8); + addKey("3", Three_Key, 0x1A, 8); + addKey("4", Four_Key, 0x1B, 8); + addKey("5", Five_Key, 0x1C, 8); + addKey("6", Six_Key, 0x1D, 8); + addKey("7", Seven_Key, 0x1E, 8); + addKey("8", Eight_Key, 0x1F, 8); + + addKey("9", Nine_Key, 0x40, 8); + addKey("10", Zero_Key, 0x41, 8); + addKey("ADJUST", Unmapped_Key, 0x42, 8); + addKey("NORMAL", Unmapped_Key, 0x43, 8); + addKey("SOUND_FUNC", SoundMode_Key, 0x44, 8); + addKey("SOUND_MUTE", Mute_Key, 0x45, 8); + addKey("PIC_FUNC", PictureMode_Key, 0x46, 8); + addKey("PIC_MUTE", PictureMute_Key, 0x47, 8); + addKey("POSITION", Unmapped_Key, 0x4B, 8); + addKey("INPUT_LIST", Unmapped_Key, 0x4D, 8); + addKey("FOCUS", Focus_Key, 0x4E, 8); + addKey("INFO", Info_Key, 0x4F, 8); + + addKey("TILT", Unmapped_Key, 0x50, 8); + addKey("BOW", Unmapped_Key, 0x52, 8); + addKey("AMPLIT", Unmapped_Key, 0x54, 8); + addKey("LINEAR", Unmapped_Key, 0x56, 8); + addKey("KEYSTN", Keystone_Key, 0x58, 8); + addKey("PINCUS", Unmapped_Key, 0x5A, 8); + addKey("NORMAL", Unmapped_Key, 0x5B, 8); + addKey("UP", Up_Key, 0x5C, 8); + addKey("DOWN", Down_Key, 0x5D, 8); + addKey("RIGHT", Right_Key, 0x5E, 8); + addKey("LEFT", Left_Key, 0x5F, 8); +} + + +NECProjector2::NECProjector2( + unsigned int index) + : PIRKeysetMetaData( + "Projector Keyset 2", + NEC_Make, + index) +{ +} + + +void NECProjector2::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // Keyset already populated. + return; + } + + threadableProtocol = new NECProtocol(guiObject, index, true, true); + + setPreData(0xE918, 16); + + addKey("VIDEO", CompositeInput_Key, 0x03, 8); + addKey("RGB", ComponentInput_Key, 0x04, 8); // "computer_1" + addKey("RGB_2", Component2Input_Key, 0x05, 8); // "computer_2" + addKey("auto_adj", Unmapped_Key, 0x06, 8); + addKey("SELECT_PICTURE", Unmapped_Key, 0x07, 8); + addKey("POWER_ON", PowerOn_Key, 0x08, 8); + addKey("ZOOM+", Unmapped_Key, 0x09, 8); + addKey("ZOOM-", Unmapped_Key, 0x0A, 8); + addKey("FOCUS+", Unmapped_Key, 0x0B, 8); + addKey("FOCUS-", Unmapped_Key, 0x0C, 8); + addKey("picture", PictureMode_Key, 0x0D, 8); + + addKey("aspect", AspectRatio_Key, 0x10, 8); + addKey("MUTE_OFF", Unmapped_Key, 0x11, 8); + addKey("POWER_OFF", PowerOff_Key, 0x14, 8); + addKey("Lamp_Mode", Unmapped_Key, 0x16, 8); + addKey("enter", Select_Key, 0x17, 8); + + addKey("exit", Exit_Key, 0x25, 8); + addKey("page_up", PageUp_Key, 0x2A, 8); + addKey("page_down", PageDown_Key, 0x2B, 8); + addKey("l_click", Unmapped_Key, 0x2C, 8); + addKey("r_click", Unmapped_Key, 0x2D, 8); + + addKey("MENU", Menu_Key, 0x46, 8); + addKey("PIC-MUTE", PictureMute_Key, 0x47, 8); + addKey("VOLUME+", VolumeUp_Key, 0x48, 8); + addKey("VOLUME-", VolumeDown_Key, 0x49, 8); + addKey("FREEZE", Pause_Key, 0x4C, 8); + addKey("help", Unmapped_Key, 0x4E, 8); + + addKey("DISPLAY_+", Unmapped_Key, 0x5C, 8); + addKey("DISPLAY_-", Unmapped_Key, 0x5D, 8); + + addKey("2X/4X", Unmapped_Key, 0x87, 8); + addKey("MAGNIFY_REDUCE+", Unmapped_Key, 0x89, 8); + addKey("MAGNIFY_REDUCE-", Unmapped_Key, 0x8A, 8); +// addKey("FREEZE", Pause_Key, 0x91, 8); + + addKey("up", Up_Key, 0xB8, 8); + addKey("down", Down_Key, 0xBC, 8); + addKey("left", Left_Key, 0xBE, 8); + addKey("right", Right_Key, 0xBA, 8); + + addKey("S-VIDEO", SVideoInput_Key, 0xC6, 8); +} diff --git a/keysets/nec.h b/keysets/nec.h new file mode 100644 index 0000000..b6f5799 --- /dev/null +++ b/keysets/nec.h @@ -0,0 +1,78 @@ +#ifndef NEC_H +#define NEC_H + +#include "pirkeysetmetadata.h" + +class QObject; + +class NECTV1: public PIRKeysetMetaData +{ +public: + NECTV1( + unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); +}; + +class NECVCR1: public PIRKeysetMetaData +{ +public: + NECVCR1( + unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); +}; + +class NECVCR2: public PIRKeysetMetaData +{ +public: + NECVCR2( + unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); +}; + +class NECVCR3: public PIRKeysetMetaData +{ +public: + NECVCR3( + unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); +}; + +class NECDVD1: public PIRKeysetMetaData +{ +public: + NECDVD1( + unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); +}; + +class NECProjector1: public PIRKeysetMetaData +{ +public: + NECProjector1( + unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); +}; + +class NECProjector2: public PIRKeysetMetaData +{ +public: + NECProjector2( + unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); +}; + +#endif // NEC_H diff --git a/keysets/pioneer.cpp b/keysets/pioneer.cpp index e444b62..d11aba8 100644 --- a/keysets/pioneer.cpp +++ b/keysets/pioneer.cpp @@ -937,3 +937,60 @@ void PioneerDVD1::populateProtocol( addPioneerKey("DOWN", Down_Key, 0xA3, 0x99, 0xAF, 0xF3); addPioneerKey("RETURN", Exit_Key, 0xA3, 0x99, 0xAF, 0xF4); } + + +PioneerCarStereo1::PioneerCarStereo1( + unsigned int index) + : PIRKeysetMetaData( + "Car Stereo Keyset 1", + Pioneer_Make, + index) +{ +} + + +void PioneerCarStereo1::populateProtocol( + QObject *guiObject) +{ + if (threadableProtocol) + { + // Keyset already populated. + return; + } + + threadableProtocol = new PioneerProtocol(guiObject, index); + + addNECKey("VOL+", VolumeUp_Key, 0xAD, 0x0A); + addNECKey("VOL-", VolumeDown_Key, 0xAD, 0x0B); + addNECKey("ATT", Mute_Key, 0xAD, 0x0C); + addNECKey("Audio", SoundMode_Key, 0xAD, 0x0D); + addNECKey("Band/Escape", FM_Key, 0xAD, 0x12); + addNECKey("Band/Escape", Exit_Key, 0xAD, 0x12); + addNECKey("Source", Input_Key, 0xAD, 0x1A); + addNECKey("Radio", TunerInput_Key, 0xAD, 0x1C); + addNECKey("CD/iPod", CDInput_Key, 0xAD, 0x1E); + addNECKey("Arrow Up", Up_Key, 0xAD, 0x40); + addNECKey("Arrow Down", Down_Key, 0xAD, 0x41); + addNECKey("Arrow Left", Left_Key, 0xAD, 0x42); + addNECKey("Arrow Right", Right_Key, 0xAD, 0x43); + addNECKey("Pause", Pause_Key, 0xAD, 0x58); + + addPioneerKey("Entertainment", Unmapped_Key, 0xAD, 0x19, 0xAF, 0x2B); + addPioneerKey("List/Enter", Menu_Key, 0xAD, 0x19, 0xAF, 0x2C); + addPioneerKey("List/Enter", Select_Key, 0xAD, 0x19, 0xAF, 0x2C); + addPioneerKey("Function", Unmapped_Key, 0xAD, 0x19, 0xAF, 0x67); + addPioneerKey("PGM", Unmapped_Key, 0xAD, 0x19, 0xAF, 0x68); + addPioneerKey("Disp (Scroll)", Info_Key, 0xAD, 0x19, 0xAF, 0x6D); + addPioneerKey("Clear", Clear_Key, 0xAD, 0x19, 0xAF, 0xE0); + addPioneerKey("Direct", Unmapped_Key, 0xAD, 0x19, 0xAF, 0xE1); + addPioneerKey("0", Zero_Key, 0xAD, 0x19, 0xAF, 0xF0); + addPioneerKey("1", One_Key, 0xAD, 0x19, 0xAF, 0xF1); + addPioneerKey("2", Two_Key, 0xAD, 0x19, 0xAF, 0xF2); + addPioneerKey("3", Three_Key, 0xAD, 0x19, 0xAF, 0xF3); + addPioneerKey("4", Four_Key, 0xAD, 0x19, 0xAF, 0xF4); + addPioneerKey("5", Five_Key, 0xAD, 0x19, 0xAF, 0xF5); + addPioneerKey("6", Six_Key, 0xAD, 0x19, 0xAF, 0xF6); + addPioneerKey("7", Seven_Key, 0xAD, 0x19, 0xAF, 0xF7); + addPioneerKey("8", Eight_Key, 0xAD, 0x19, 0xAF, 0xF8); + addPioneerKey("9", Nine_Key, 0xAD, 0x19, 0xAF, 0xF9); +} diff --git a/keysets/pioneer.h b/keysets/pioneer.h index 656f112..c7a795f 100644 --- a/keysets/pioneer.h +++ b/keysets/pioneer.h @@ -125,4 +125,14 @@ public: QObject *guiObject); }; +class PioneerCarStereo1: public PIRKeysetMetaData +{ +public: + PioneerCarStereo1( + unsigned int index); + + virtual void populateProtocol( + QObject *guiObject); +}; + #endif // PIONEER_H diff --git a/keysets/sanyo.cpp b/keysets/sanyo.cpp index 5af60c6..2e241e1 100644 --- a/keysets/sanyo.cpp +++ b/keysets/sanyo.cpp @@ -188,15 +188,17 @@ void SanyoTV1::populateProtocol( addKey("Sleep", Sleep_Key, 0x0D, 8); addKey("Volume Up", VolumeUp_Key, 0x0E, 8); addKey("Volume Down", VolumeDown_Key, 0x0F, 8); - addKey("Closed Captions", Captions_Key, 0x11, 8); +// addKey("Closed Captions", Captions_Key, 0x11, 8); addKey("Power", Power_Key, 0x12, 8); addKey("video_mode", Input_Key, 0x13, 8); // "input" addKey("Surround Toggle", Surround_Key, 0x14, 8); addKey("Enter", Enter_Key, 0x15, 8); // odd + addKey("DASH", Dash_Key, 0x15, 8); addKey("Menu", Menu_Key, 0x17, 8); // "setup" addKey("Mute", Mute_Key, 0x18, 8); addKey("Recall", PrevChannel_Key, 0x19, 8); addKey("audio", Audio_Key, 0x1A, 8); + addKey("CC", Captions_Key, 0x1B, 8); // ? addKey("reset", Reset_Key, 0x1C, 8); addKey("right arrow", Right_Key, 0x1E, 8); addKey("left arrow", Left_Key, 0x1F, 8); diff --git a/macros/pirmacromanager.cpp b/macros/pirmacromanager.cpp index 3c8db07..ff34b20 100644 --- a/macros/pirmacromanager.cpp +++ b/macros/pirmacromanager.cpp @@ -71,6 +71,10 @@ void PIRMacroManager::handleKeypress( { keyboardController->executeKey(key); } + else + { + executeStandardKey(key); + } } @@ -240,3 +244,53 @@ void PIRMacroManager::setBtnFocus( buttonsController = multitapPack; } } + + +void PIRMacroManager::executeStandardKey( + char key) +{ + switch (key) + { + case 'Q': + mainWindow->switchToTab(0); + break; + + case 'W': + mainWindow->switchToTab(1); + break; + + case 'E': + mainWindow->switchToTab(2); + break; + + case 'R': + mainWindow->switchToTab(3); + break; + + case 'T': + mainWindow->switchToTab(4); + break; + + case 'Y': + mainWindow->switchToTab(5); + break; + + case 'U': + mainWindow->switchToTab(6); + break; + + case 'I': + mainWindow->switchToTab(7); + break; + + case 'O': + mainWindow->switchToTab(8); + break; + + case 'P': + mainWindow->switchToTab(9); + + default: + break; + } +} diff --git a/macros/pirmacromanager.h b/macros/pirmacromanager.h index 20c585c..c3c424a 100644 --- a/macros/pirmacromanager.h +++ b/macros/pirmacromanager.h @@ -46,6 +46,9 @@ public: private: void retrieveSettings(); + void executeStandardKey( + char key); + PIRMacroPack *userPack; PIRReverseMultitap *multitapPack; diff --git a/main.cpp b/main.cpp index 8833525..99a9e86 100644 --- a/main.cpp +++ b/main.cpp @@ -1,3 +1,11 @@ +// main.cpp +// +// For the Pierogi IR remote control app. +// +// Copyright (C) 2012 by John Pietrzak (john@pietrzak.org) +// +// Licensed under the GNU GPL version 2.0 or later. + #include "mainwindow.h" #include "pirapplication.h" #include diff --git a/mainwindow.cpp b/mainwindow.cpp index f57cde7..bd556f3 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -1,3 +1,11 @@ +// mainwindow.cpp +// +// For the Pierogi IR remote control app. +// +// Copyright (C) 2012 by John Pietrzak (john@pietrzak.org) +// +// Licensed under the GNU GPL version 2.0 or later. + #include "mainwindow.h" #include "ui_mainwindow.h" @@ -11,6 +19,8 @@ #include #include +//#include "pirtabwidget.h" + #include "pirkeysetmetadata.h" #include "pirkeysetwidgetitem.h" @@ -58,6 +68,9 @@ MainWindow::MainWindow(QWidget *parent) myMacros(0), currentKeyset(1) // Zero is not a valid keyset any more { + // Create the tab widget: +// myTabWidget = new PIRTabWidget(ui->centralWidget, this); + ui->setupUi(this); // Make this a Maemo 5 stacked widget: @@ -561,6 +574,7 @@ void MainWindow::insertCornerButtons() Qt::QueuedConnection); ui->mainTabWidget->setCornerWidget(button, Qt::TopRightCorner); +// myTabWidget->setCornerWidget(button, Qt::TopRightCorner); button = new QPushButton(QIcon(":/icons/align_just_icon&32.png"), ""); @@ -575,24 +589,28 @@ void MainWindow::insertCornerButtons() Qt::QueuedConnection); ui->mainTabWidget->setCornerWidget(button, Qt::TopLeftCorner); +// myTabWidget->setCornerWidget(button, Qt::TopLeftCorner); } void MainWindow::disableUpdates() { ui->mainTabWidget->setUpdatesEnabled(false); +// myTabWidget->setUpdatesEnabled(false); } void MainWindow::enableUpdates() { ui->mainTabWidget->setUpdatesEnabled(true); +// myTabWidget->setUpdatesEnabled(true); } void MainWindow::clearTabs() { ui->mainTabWidget->clear(); +// myTabWidget->clear(); } @@ -601,6 +619,7 @@ void MainWindow::addTab( QString label) { ui->mainTabWidget->addTab(page, label); +// myTabWidget->addTab(page, label); } void MainWindow::setupTabs( @@ -653,6 +672,34 @@ PIRMacroPack *MainWindow::getMultitapPack() } +void MainWindow::handleKeypress( + char key) +{ + myMacros->handleKeypress(key); +} + + +/* +void MainWindow::handleKeyRelease( + char key) +{ +} +*/ + + +void MainWindow::gotoPreviousTabs() +{ + myPanels->gotoPreviousTabs(); +} + + +void MainWindow::gotoNextTabs() +{ + myPanels->gotoNextTabs(); +} + + +/* void MainWindow::keyPressEvent( QKeyEvent *event) { @@ -739,11 +786,60 @@ void MainWindow::keyPressEvent( case Qt::Key_Space: myMacros->handleKeypress(' '); break; + + case Qt::Key_Up: + myPanels->gotoPreviousTabs(); + break; + case Qt::Key_Down: + myPanels->gotoNextTabs(); + break; + + + case Qt::Key_Left: + startRepeating(VolumeDown_Key); + break; + case Qt::Key_Right: + startRepeating(VolumeUp_Key); + break; + + case Qt::Key_Backspace: + startRepeating(Power_Key); + break; + case Qt::Key_Return: + startRepeating(Mute_Key); + break; + default: QMainWindow::keyPressEvent(event); break; } } +*/ + + +/* +void MainWindow::keyReleaseEvent( + QKeyEvent *event) +{ + switch(event->key()) + { + + case Qt::Key_Up: + case Qt::Key_Down: + case Qt::Key_Left: + case Qt::Key_Right: + + case Qt::Key_Backspace: + case Qt::Key_Return: + stopRepeating(); + break; + + default: + QMainWindow::keyReleaseEvent(event); + break; + } +} +*/ bool MainWindow::hasMacroButton( @@ -791,3 +887,23 @@ void MainWindow::setMacroBtnFocus( { myMacros->setBtnFocus(index); } + + +void MainWindow::switchToTab( + int tabNumber) +{ + int count = ui->mainTabWidget->count(); + + if (tabNumber < 0) + { + ui->mainTabWidget->setCurrentIndex(0); + } + else if (tabNumber >= count) + { + ui->mainTabWidget->setCurrentIndex(count-1); + } + else + { + ui->mainTabWidget->setCurrentIndex(tabNumber); + } +} diff --git a/mainwindow.h b/mainwindow.h index e173610..c42c5ec 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -12,6 +12,8 @@ class QListWidgetItem; class QDialog; class QKeyEvent; +//class PIRTabWidget; + class PIRSelectKeysetForm; class PIRSelectDeviceForm; class PIRPreferencesForm; @@ -132,6 +134,19 @@ public: void setMacroBtnFocus( int index); + void switchToTab( + int tabNumber); + + void handleKeypress( + char key); + +// void handleKeyRelease( +// char Key); + + void gotoPreviousTabs(); + + void gotoNextTabs(); + signals: void buttonPressed( unsigned int keysetID, @@ -160,13 +175,18 @@ private slots: void finalCleanup(); private: - void keyPressEvent( - QKeyEvent *event); +// void keyPressEvent( +// QKeyEvent *event); + +// void keyReleaseEvent( +// QKeyEvent *event); void populateFavorites(); Ui::MainWindow *ui; +// PIRTabWidget *myTabWidget; + PIRSelectKeysetForm *selectKeysetForm; PIRSelectDeviceForm *selectDeviceForm; PIRPreferencesForm *preferencesForm; diff --git a/pierogi.pro b/pierogi.pro index 3888c19..054e66a 100644 --- a/pierogi.pro +++ b/pierogi.pro @@ -236,7 +236,12 @@ SOURCES += main.cpp mainwindow.cpp \ keysets/wiwa.cpp \ keysets/changhong.cpp \ keysets/frontech.cpp \ - keysets/sinotec.cpp + keysets/sinotec.cpp \ + pirtabwidget.cpp \ + keysets/medialink.cpp \ + keysets/nec.cpp \ + keysets/multichoice.cpp \ + forms/piradvancedform.cpp HEADERS += mainwindow.h \ pirkeynames.h \ pirmakenames.h \ @@ -447,7 +452,12 @@ HEADERS += mainwindow.h \ keysets/wiwa.h \ keysets/changhong.h \ keysets/frontech.h \ - keysets/sinotec.h + keysets/sinotec.h \ + pirtabwidget.h \ + keysets/medialink.h \ + keysets/nec.h \ + keysets/multichoice.h \ + forms/piradvancedform.h FORMS += mainwindow.ui \ pirdocumentationform.ui \ piraboutform.ui \ @@ -484,7 +494,8 @@ FORMS += mainwindow.ui \ dialogs/pireditmacrodialog.ui \ dialogs/pirdeletemacrodialog.ui \ forms/piruserform.ui \ - dialogs/pireditcommanddialog.ui + dialogs/pireditcommanddialog.ui \ + forms/piradvancedform.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 40a15b6..125338d 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.13 + /Users/john/Develop/n900/pierogi-1.1.14 Custom Process Step ProjectExplorer.ProcessStep @@ -214,6 +214,7 @@ /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_0_1_armel.deb /Users/john/Develop/n900/pierogi-build-maemo-Qt_for_Fremantle_PR1_3_Devices__Qt_SDK__Release/pierogi_0_6_2_armel.deb + /Users/john/Develop/n900/pierogi-build-maemo-Qt_for_Fremantle_PR1_3_Devices__Qt_SDK__Release/pierogi_1_1_14_armel.deb /Users/john/Develop/n900/pierogi-build-maemo-Qt_for_Fremantle_PR1_3_Devices__Qt_SDK__Release/pierogi_1_1_12_armel.deb /Users/john/Develop/n900/pierogi-build-maemo-Qt_for_Fremantle_PR1_3_Devices__Qt_SDK__Release/pierogi_1_1_8_armel.deb /Users/john/Develop/n900/pierogi-build-maemo-Qt_for_Fremantle_PR1_3_Devices__Qt_SDK__Release/pierogi_0_0_1_armel.deb @@ -259,6 +260,7 @@ 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 @@ -309,6 +311,7 @@ + 2012-01-19T22:18:07 @@ -343,6 +346,7 @@ 2012-02-11T18:03:15 2012-01-14T13:11:32 2012-02-13T22:02:56 + 2012-10-24T19:31:32 2012-09-16T17:12:09 2012-09-07T17:19:10 2012-01-01T15:35:35 diff --git a/pirkeynames.cpp b/pirkeynames.cpp index d673c38..52793f3 100644 --- a/pirkeynames.cpp +++ b/pirkeynames.cpp @@ -132,6 +132,9 @@ PIRKeynameMgr::PIRKeynameMgr() keynameStrings[ContrastDown_Key] = "Contrast Down"; keynameStrings[BalanceRight_Key] = "Balance Right"; keynameStrings[BalanceLeft_Key] = "Balance Left"; + keynameStrings[Keystone_Key] = "Keystone"; + keynameStrings[PictureMute_Key] = "Picture Mute"; + keynameStrings[Focus_Key] = "Focus"; keynameStrings[Input_Key] = "Input"; keynameStrings[CDInput_Key] = "CD Input"; keynameStrings[PhonoInput_Key] = "Phono Input"; diff --git a/pirkeynames.h b/pirkeynames.h index ffdff53..9a4ee0f 100644 --- a/pirkeynames.h +++ b/pirkeynames.h @@ -160,6 +160,9 @@ enum PIRKeyName{ ContrastDown_Key, BalanceRight_Key, BalanceLeft_Key, + Keystone_Key, + PictureMute_Key, + Focus_Key, // Input Controls: Input_Key, diff --git a/pirkeysetmanager.cpp b/pirkeysetmanager.cpp index b3ba761..5d358e5 100644 --- a/pirkeysetmanager.cpp +++ b/pirkeysetmanager.cpp @@ -76,10 +76,13 @@ #include "keysets/magnavox.h" #include "keysets/magnum.h" #include "keysets/mce.h" +#include "keysets/medialink.h" #include "keysets/medion.h" #include "keysets/mitsubishi.h" #include "keysets/motorola.h" +#include "keysets/multichoice.h" #include "keysets/nad.h" +#include "keysets/nec.h" #include "keysets/nikon.h" #include "keysets/nokia.h" #include "keysets/octagon.h" @@ -161,6 +164,7 @@ PIRKeysetManager::PIRKeysetManager() setupKeyset(new ADBSTB3(++counter)); setupKeyset(new ADBSTB4(++counter)); setupKeyset(new ADBSTB5(++counter)); + setupKeyset(new ADBSTB6(++counter)); setupKeyset(new AdmiralTV1(++counter)); setupKeyset(new AdmiralTV2(++counter)); @@ -463,6 +467,9 @@ PIRKeysetManager::PIRKeysetManager() setupKeyset(new LGTV2(++counter)); setupKeyset(new LGTV2a(++counter)); setupKeyset(new LGTV2b(++counter)); + setupKeyset(new LGHT1(++counter)); + setupKeyset(new LGHT2(++counter)); + setupKeyset(new LGHT2a(++counter)); setupKeyset(new LGDisc1(++counter)); setupKeyset(new LGDisc2(++counter)); setupKeyset(new LGDisc2a(++counter)); @@ -499,6 +506,8 @@ PIRKeysetManager::PIRKeysetManager() setupKeyset(new MCERemote1f(++counter)); setupKeyset(new MCERemote1g(++counter)); + setupKeyset(new MedialinkSTB1(++counter)); + setupKeyset(new MedionSTB1(++counter)); setupKeyset(new MedionDVD1(++counter)); setupKeyset(new MedionDVD2(++counter)); @@ -508,6 +517,7 @@ PIRKeysetManager::PIRKeysetManager() setupKeyset(new MitsubishiTV1a(++counter)); setupKeyset(new MitsubishiVCR1(++counter)); setupKeyset(new MitsubishiVCR1a(++counter)); + setupKeyset(new MitsubishiProjector1(++counter)); setupKeyset(new Motorola4DTV(++counter)); setupKeyset(new MotorolaSTB1(++counter)); @@ -515,6 +525,9 @@ PIRKeysetManager::PIRKeysetManager() setupKeyset(new MotorolaSTB1b(++counter)); setupKeyset(new MotorolaSkyDigital(++counter)); + setupKeyset(new MultichoiceSTB1(++counter)); + setupKeyset(new MultichoiceSTB2(++counter)); + setupKeyset(new NADAudio1(++counter)); setupKeyset(new NADTuner1(++counter)); setupKeyset(new NADDVD1(++counter)); @@ -522,6 +535,14 @@ PIRKeysetManager::PIRKeysetManager() setupKeyset(new NADCD2(++counter)); setupKeyset(new NADTape1(++counter)); + setupKeyset(new NECTV1(++counter)); + setupKeyset(new NECVCR1(++counter)); + setupKeyset(new NECVCR2(++counter)); + setupKeyset(new NECVCR3(++counter)); + setupKeyset(new NECDVD1(++counter)); + setupKeyset(new NECProjector1(++counter)); + setupKeyset(new NECProjector2(++counter)); + setupKeyset(new NikonDSLR1(++counter)); setupKeyset(new NokiaGenericVCR(++counter)); @@ -623,6 +644,7 @@ PIRKeysetManager::PIRKeysetManager() setupKeyset(new PioneerCD1(++counter)); setupKeyset(new PioneerLaserDisc1(++counter)); setupKeyset(new PioneerDVD1(++counter)); + setupKeyset(new PioneerCarStereo1(++counter)); setupKeyset(new ProviewDVD1(++counter)); @@ -982,6 +1004,64 @@ void PIRKeysetManager::populateKeyset( } +unsigned int PIRKeysetManager::getCarrierFrequency( + unsigned int keysetID) +{ + PIRKeysetCollection::iterator i = keysetsInfo.find(keysetID); + + if (i == keysetsInfo.end()) + { + return 0; + } + + return i->second->getCarrierFrequency(); +} + + +void PIRKeysetManager::setCarrierFrequency( + unsigned int carrierFrequency, + unsigned int keysetID) +{ + PIRKeysetCollection::iterator i = keysetsInfo.find(keysetID); + + if (i == keysetsInfo.end()) + { + return; + } + + i->second->setCarrierFrequency(carrierFrequency); +} + + +unsigned int PIRKeysetManager::getDutyCycle( + unsigned int keysetID) +{ + PIRKeysetCollection::iterator i = keysetsInfo.find(keysetID); + + if (i == keysetsInfo.end()) + { + return 0; + } + + return i->second->getDutyCycle(); +} + + +void PIRKeysetManager::setDutyCycle( + unsigned int dutyCycle, + unsigned int keysetID) +{ + PIRKeysetCollection::iterator i = keysetsInfo.find(keysetID); + + if (i == keysetsInfo.end()) + { + return; + } + + i->second->setDutyCycle(dutyCycle); +} + + bool PIRKeysetManager::clearKeyset( unsigned int keysetID) { diff --git a/pirkeysetmanager.h b/pirkeysetmanager.h index d9272a4..f8d0f49 100644 --- a/pirkeysetmanager.h +++ b/pirkeysetmanager.h @@ -72,6 +72,20 @@ public: PIRFavoritesDialog *favoritesDialog, PIRSelectKeysetForm *keysetForm); + unsigned int getCarrierFrequency( + unsigned int keysetID); + + void setCarrierFrequency( + unsigned int carrierFrequency, + unsigned int keysetID); + + unsigned int getDutyCycle( + unsigned int keysetID); + + void setDutyCycle( + unsigned int dutyCycle, + unsigned int keysetID); + private: void setupKeyset( PIRKeysetMetaData *keyset); diff --git a/pirkeysetmetadata.cpp b/pirkeysetmetadata.cpp index e80822c..ce7cf00 100644 --- a/pirkeysetmetadata.cpp +++ b/pirkeysetmetadata.cpp @@ -91,6 +91,52 @@ const char *PIRKeysetMetaData::getKeysetName() const } +unsigned int PIRKeysetMetaData::getCarrierFrequency() const +{ + if (!threadableProtocol) + { + return 0; + } + + return threadableProtocol->getCarrierFrequency(); +} + + +void PIRKeysetMetaData::setCarrierFrequency( + unsigned int carrierFrequency) +{ + if (!threadableProtocol) + { + return; + } + + threadableProtocol->setCarrierFrequency(carrierFrequency); +} + + +unsigned int PIRKeysetMetaData::getDutyCycle() const +{ + if (!threadableProtocol) + { + return 0; + } + + return threadableProtocol->getDutyCycle(); +} + + +void PIRKeysetMetaData::setDutyCycle( + unsigned int dutyCycle) +{ + if (!threadableProtocol) + { + return; + } + + threadableProtocol->setDutyCycle(dutyCycle); +} + + void PIRKeysetMetaData::addControlledDevice( PIRMakeName make, const char *model, diff --git a/pirkeysetmetadata.h b/pirkeysetmetadata.h index 80c4ed1..09569f5 100644 --- a/pirkeysetmetadata.h +++ b/pirkeysetmetadata.h @@ -38,6 +38,16 @@ public: const char *getKeysetName() const; + unsigned int getCarrierFrequency() const; + + void setCarrierFrequency( + unsigned int carrierFrequency); + + unsigned int getDutyCycle() const; + + void setDutyCycle( + unsigned int dutyCycle); + virtual void populateProtocol( QObject *guiObject) = 0; diff --git a/pirmakenames.cpp b/pirmakenames.cpp index 5ecdd19..f41e86f 100644 --- a/pirmakenames.cpp +++ b/pirmakenames.cpp @@ -73,11 +73,14 @@ PIRMakeMgr::PIRMakeMgr() makes[Logitech_Make] = "Logitech"; makes[Magnavox_Make] = "Magnavox"; makes[Magnum_Make] = "Magnum"; + makes[Medialink_Make] = "Medi@link"; makes[Medion_Make] = "Medion"; makes[Microsoft_Make] = "Microsoft"; makes[Mitsubishi_Make] = "Mitsubishi"; makes[Motorola_Make] = "Motorola"; + makes[Multichoice_Make] = "Multichoice"; makes[NAD_Make] = "NAD"; + makes[NEC_Make] = "NEC"; makes[Nikon_Make] = "Nikon"; makes[Nokia_Make] = "Nokia"; makes[Octagon_Make] = "Octagon"; diff --git a/pirmakenames.h b/pirmakenames.h index 7071548..90c9ee2 100644 --- a/pirmakenames.h +++ b/pirmakenames.h @@ -74,11 +74,14 @@ enum PIRMakeName{ Logitech_Make, Magnavox_Make, Magnum_Make, + Medialink_Make, Medion_Make, Microsoft_Make, Mitsubishi_Make, Motorola_Make, + Multichoice_Make, NAD_Make, + NEC_Make, Nikon_Make, Nokia_Make, Octagon_Make, diff --git a/pirpanelmanager.cpp b/pirpanelmanager.cpp index 2e485c7..c3dcaa5 100644 --- a/pirpanelmanager.cpp +++ b/pirpanelmanager.cpp @@ -18,6 +18,7 @@ #include "forms/piruserform.h" #include "forms/pirmacroform.h" #include "forms/pirpowersearchform.h" +#include "forms/piradvancedform.h" #include "mainwindow.h" @@ -49,6 +50,7 @@ PIRPanelManager::PIRPanelManager( userForm(0), macroForm(0), powerSearchForm(0), + advancedForm(0), altMainPanelFlag(false), currentTabsName(Universal_Tabs), mainWindow(mw) @@ -120,6 +122,9 @@ PIRPanelManager::PIRPanelManager( shortPanelNames[PowerSearch_Panel] = "Keyset Search"; longPanelNames[PowerSearch_Panel] = "Keyset Search Panel - execute power button in each keyset"; + shortPanelNames[Advanced_Panel] = "Advanced Settings"; + longPanelNames[Advanced_Panel] = + "Advanced Settings - allows adjustment of protocol settings"; mainForm = new PIRMainForm(mainWindow); panels[Main_Panel] = mainForm; @@ -175,6 +180,9 @@ PIRPanelManager::PIRPanelManager( powerSearchForm = new PIRPowerSearchForm(mainWindow); panels[PowerSearch_Panel] = powerSearchForm; + advancedForm = new PIRAdvancedForm(); + panels[Advanced_Panel] = advancedForm; + // Set up the panel collections: PIRPanelNameList pset; @@ -195,7 +203,7 @@ PIRPanelManager::PIRPanelManager( pset.push_back(Keypad_Panel); pset.push_back(Menu_Panel); pset.push_back(TV_Panel); - pset.push_back(Adjust_Panel); + pset.push_back(Input_Panel); tabLists[TV_Tabs] = pset; // The video media collection: @@ -205,6 +213,7 @@ PIRPanelManager::PIRPanelManager( pset.push_back(Media_Panel); pset.push_back(Media2_Panel); pset.push_back(Input_Panel); + pset.push_back(Adjust_Panel); tabLists[VideoMedia_Tabs] = pset; // Audio panel collection: @@ -245,6 +254,11 @@ PIRPanelManager::PIRPanelManager( pset.clear(); pset.push_back(PowerSearch_Panel); tabLists[PowerSearch_Tabs] = pset; + + // The Advanced Settings collection: + pset.clear(); + pset.push_back(Advanced_Panel); + tabLists[Advanced_Tabs] = pset; } @@ -287,7 +301,7 @@ void PIRPanelManager::updateTabSet() void PIRPanelManager::enableButtons( - const PIRKeysetManager *keyset, + PIRKeysetManager *keyset, unsigned int id) { mainForm->enableButtons(keyset, id); @@ -297,7 +311,7 @@ void PIRPanelManager::enableButtons( void PIRPanelManager::enableButtons( - const PIRKeysetManager *keyset, + PIRKeysetManager *keyset, unsigned int currentID, unsigned int defaultID) { @@ -308,7 +322,7 @@ void PIRPanelManager::enableButtons( void PIRPanelManager::commonEnableButtons( - const PIRKeysetManager *keyset, + PIRKeysetManager *keyset, unsigned int id) { utilityForm->enableButtons(keyset, id); @@ -327,6 +341,9 @@ void PIRPanelManager::commonEnableButtons( // Also, set the label in the power search form: powerSearchForm->setKeysetName(mainWindow->getCurrentFullName()); + + // Set up the advanced parameters: + advancedForm->setupForm(keyset, id); } @@ -421,6 +438,51 @@ void PIRPanelManager::setupTabs( } +void PIRPanelManager::gotoPreviousTabs() +{ + PIRTabsCollection::const_iterator i = tabLists.find(currentTabsName); + + if (i == tabLists.end()) + { + // Couldn't find currentTabsName! Throw an error here? + return; + } + + if (i == tabLists.begin()) + { + // Already at first collection, nothing to do: + return; + } + + --i; + currentTabsName = i->first; + updateTabSet(); +} + + +void PIRPanelManager::gotoNextTabs() +{ + PIRTabsCollection::const_iterator i = tabLists.find(currentTabsName); + + if (i == tabLists.end()) + { + // Couldn't find currentTabsName! Throw an error? + return; + } + + ++i; + + if (i == tabLists.end()) + { + // We're already at the last collection, nothing to do: + return; + } + + currentTabsName = i->first; + updateTabSet(); +} + + QComboBox *PIRPanelManager::getKeysetComboBox() { return macroForm->getKeysetComboBox(); diff --git a/pirpanelmanager.h b/pirpanelmanager.h index 5f221d4..d0f0222 100644 --- a/pirpanelmanager.h +++ b/pirpanelmanager.h @@ -21,6 +21,7 @@ class PIRRoombaForm; class PIRUserForm; class PIRMacroForm; class PIRPowerSearchForm; +class PIRAdvancedForm; class PIRKeysetWidgetItem; class PIRKeysetManager; @@ -51,11 +52,11 @@ public: void updateTabSet(); void enableButtons( - const PIRKeysetManager *keyset, + PIRKeysetManager *keyset, unsigned int id); void enableButtons( - const PIRKeysetManager *keyset, + PIRKeysetManager *keyset, unsigned int currentID, unsigned int defaultID); @@ -75,9 +76,12 @@ public: QComboBox *getKeysetComboBox(); + void gotoPreviousTabs(); + void gotoNextTabs(); + private: void commonEnableButtons( - const PIRKeysetManager *keyset, + PIRKeysetManager *keyset, unsigned int id); PIRMainForm *mainForm; @@ -98,6 +102,7 @@ private: PIRUserForm *userForm; PIRMacroForm *macroForm; PIRPowerSearchForm *powerSearchForm; + PIRAdvancedForm *advancedForm; PIRPanelDisplayNameCollection shortPanelNames; PIRPanelDisplayNameCollection longPanelNames; diff --git a/pirpanelnames.h b/pirpanelnames.h index 3f8102f..3998887 100644 --- a/pirpanelnames.h +++ b/pirpanelnames.h @@ -21,6 +21,7 @@ enum PIRPanelName User_Panel, Macro_Panel, PowerSearch_Panel, + Advanced_Panel, Last_Panel_Marker // Used when traversing this enumeration. }; @@ -39,6 +40,7 @@ enum PIRTabBarName Roomba_Tabs, Macro_Tabs, PowerSearch_Tabs, + Advanced_Tabs, Last_Tabs_Marker }; diff --git a/pirpreferencesform.cpp b/pirpreferencesform.cpp index ff55152..29d1d96 100644 --- a/pirpreferencesform.cpp +++ b/pirpreferencesform.cpp @@ -217,6 +217,7 @@ void PIRPreferencesForm::setupMacroComboBox( QComboBox *cb) { // Crappy hardcoded list. Need to replace this... - cb->addItem("User Defined Macros"); + cb->addItem("Standard Controls"); + cb->addItem("User Defined Keyboard Macros"); cb->addItem("Reverse Multitap Keboard Macros"); } diff --git a/pirrx51hardware.cpp b/pirrx51hardware.cpp index bfd9bc0..d8f3f17 100644 --- a/pirrx51hardware.cpp +++ b/pirrx51hardware.cpp @@ -160,7 +160,7 @@ void PIRRX51Hardware::setCarrierFrequency( // if (!frequency) frequency = DEFAULT_FREQUENCY; #ifdef DEBUGGING - std::cout << "Setting frequency to " << frequency << "\n"; + std::cout << "Setting frequency to " << frequency << std::endl; #endif // DEBUGGING if (ioctl(fileDescriptor, _IOW('i', 0x13, __u32), &frequency) == -1) { @@ -178,7 +178,7 @@ void PIRRX51Hardware::setDutyCycle( // if (dutyCycle > 100) dutyCycle = DEFAULT_DUTY_CYCLE; #ifdef DEBUGGING - std::cout << "Setting duty cycle to " << dutyCycle << "\n"; + std::cout << "Setting duty cycle to " << dutyCycle << std::endl; #endif // DEBUGGING if (ioctl(fileDescriptor, _IOW('i', 0x15, __u32), &dutyCycle) == -1) { diff --git a/pirtabwidget.cpp b/pirtabwidget.cpp new file mode 100644 index 0000000..266e4ae --- /dev/null +++ b/pirtabwidget.cpp @@ -0,0 +1,151 @@ +#include "pirtabwidget.h" + +#include +#include + +#include "mainwindow.h" + +PIRTabWidget::PIRTabWidget( + QWidget *parent, + MainWindow *mw) + : QTabWidget(parent), + mainWindow(mw) +{ + setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); +} + + +void PIRTabWidget::keyPressEvent( + QKeyEvent *event) +{ + switch(event->key()) + { + case Qt::Key_A: + mainWindow->handleKeypress('A'); + break; + case Qt::Key_B: + mainWindow->handleKeypress('B'); + break; + case Qt::Key_C: + mainWindow->handleKeypress('C'); + break; + case Qt::Key_D: + mainWindow->handleKeypress('D'); + break; + case Qt::Key_E: + mainWindow->handleKeypress('E'); + break; + case Qt::Key_F: + mainWindow->handleKeypress('F'); + break; + case Qt::Key_G: + mainWindow->handleKeypress('G'); + break; + case Qt::Key_H: + mainWindow->handleKeypress('H'); + break; + case Qt::Key_I: + mainWindow->handleKeypress('I'); + break; + case Qt::Key_J: + mainWindow->handleKeypress('J'); + break; + case Qt::Key_K: + mainWindow->handleKeypress('K'); + break; + case Qt::Key_L: + mainWindow->handleKeypress('L'); + break; + case Qt::Key_M: + mainWindow->handleKeypress('M'); + break; + case Qt::Key_N: + mainWindow->handleKeypress('N'); + break; + case Qt::Key_O: + mainWindow->handleKeypress('O'); + break; + case Qt::Key_P: + mainWindow->handleKeypress('P'); + break; + case Qt::Key_Q: + mainWindow->handleKeypress('Q'); + break; + case Qt::Key_R: + mainWindow->handleKeypress('R'); + break; + case Qt::Key_S: + mainWindow->handleKeypress('S'); + break; + case Qt::Key_T: + mainWindow->handleKeypress('T'); + break; + case Qt::Key_U: + mainWindow->handleKeypress('U'); + break; + case Qt::Key_V: + mainWindow->handleKeypress('V'); + break; + case Qt::Key_W: + mainWindow->handleKeypress('W'); + break; + case Qt::Key_X: + mainWindow->handleKeypress('X'); + break; + case Qt::Key_Y: + mainWindow->handleKeypress('Y'); + break; + case Qt::Key_Z: + mainWindow->handleKeypress('Z'); + break; + case Qt::Key_Space: + mainWindow->handleKeypress(' '); + break; + + case Qt::Key_Up: + mainWindow->gotoPreviousTabs(); + break; + case Qt::Key_Down: + mainWindow->gotoNextTabs(); + break; + case Qt::Key_Left: + mainWindow->startRepeating(VolumeDown_Key); + break; + case Qt::Key_Right: + mainWindow->startRepeating(VolumeUp_Key); + break; + case Qt::Key_Backspace: + mainWindow->startRepeating(Power_Key); + break; + case Qt::Key_Return: + mainWindow->startRepeating(Mute_Key); + break; + + default: + QTabWidget::keyPressEvent(event); + break; + } +} + + +void PIRTabWidget::keyReleaseEvent( + QKeyEvent *event) +{ + switch(event->key()) + { + case Qt::Key_Up: + case Qt::Key_Down: + break; + + case Qt::Key_Left: + case Qt::Key_Right: + case Qt::Key_Backspace: + case Qt::Key_Return: + mainWindow->stopRepeating(); + break; + + default: + QTabWidget::keyReleaseEvent(event); + break; + } +} diff --git a/pirtabwidget.h b/pirtabwidget.h new file mode 100644 index 0000000..496d8bc --- /dev/null +++ b/pirtabwidget.h @@ -0,0 +1,25 @@ +// In order to take control of the keyboard when using a tabbed widget, I need +// to subclass QTabWidget and redefine the keyPressEvent() method. + +#include + +class QKeyEvent; +class MainWindow; + +class PIRTabWidget: public QTabWidget +{ +public: + PIRTabWidget( + QWidget *parent, + MainWindow *mw); + +protected: + virtual void keyPressEvent( + QKeyEvent *event); + + virtual void keyReleaseEvent( + QKeyEvent *event); + +private: + MainWindow *mainWindow; +}; diff --git a/protocols/pirprotocol.cpp b/protocols/pirprotocol.cpp index 2203b4d..06f1ce2 100644 --- a/protocols/pirprotocol.cpp +++ b/protocols/pirprotocol.cpp @@ -51,6 +51,32 @@ PIRProtocol::PIRProtocol( } +unsigned int PIRProtocol::getCarrierFrequency() const +{ + return carrierFrequency; +} + + +void PIRProtocol::setCarrierFrequency( + unsigned int cf) +{ + carrierFrequency = cf; +} + + +unsigned int PIRProtocol::getDutyCycle() const +{ + return dutyCycle; +} + + +void PIRProtocol::setDutyCycle( + unsigned int dc) +{ + dutyCycle = dc; +} + + void PIRProtocol::addKey( PIRKeyName key, unsigned long command, @@ -338,20 +364,6 @@ void PIRProtocol::addXMPKey( } -void PIRProtocol::setCarrierFrequency( - unsigned int freq) -{ - carrierFrequency = freq; -} - - -void PIRProtocol::setDutyCycle( - unsigned int dc) -{ - dutyCycle = dc; -} - - void PIRProtocol::setMinimumRepetitions( unsigned int minrep) { diff --git a/protocols/pirprotocol.h b/protocols/pirprotocol.h index fc77f8c..d59952b 100644 --- a/protocols/pirprotocol.h +++ b/protocols/pirprotocol.h @@ -49,6 +49,16 @@ public: unsigned int gSpace, bool iclflag); + unsigned int getCarrierFrequency() const; + + void setCarrierFrequency( + unsigned int cf); + + unsigned int getDutyCycle() const; + + void setDutyCycle( + unsigned int dc); + void addKey( PIRKeyName key, unsigned long data, @@ -111,12 +121,6 @@ public: unsigned int firstCommand, unsigned int secondCommand); - void setCarrierFrequency( - unsigned int freq); - - void setDutyCycle( - unsigned int dc); - void setMinimumRepetitions( unsigned int minrep); diff --git a/qtc_packaging/debian_fremantle/changelog b/qtc_packaging/debian_fremantle/changelog index 8b50812..2625304 100644 --- a/qtc_packaging/debian_fremantle/changelog +++ b/qtc_packaging/debian_fremantle/changelog @@ -1,6 +1,13 @@ +pierogi (1.1.15) unstable; urgency=low + * Added a new "Advanced Settings" panel, allowing control over carrier frequency and duty cycle values. + * Added a few more buttons to "input" panel, and put the "input" panel back on into the TV collection. The "adjust" panel was moved down into the Video Media collection. (I'm still trying to tweak these collections...) + * Made a first pass at keysets for Medi@link, Multichoice, and NEC, and added new keysets to ADB, LG, Mitsubishi, and Pioneer. + + -- John Pietrzak Wed, 24 Oct 2012 19:39:30 -0400 + pierogi (1.1.14) unstable; urgency=low * Fixed a bug that allowed keysets to be deleted while a command was still running (causing all sorts of havoc). This might improve macro behavior. - * Made a first pass at keysets for Changhong, Frontech, Sinotec, and Supra, added a new Thomson keyset, and made a few fixes to ADB (I-Can). + * Made a first pass at keysets for Changhong, Frontech, and Sinotec, added a new Thomson keyset, and made a few fixes to ADB (I-Can). -- John Pietrzak Wed, 19 Sep 2012 16:13:03 -0400 diff --git a/qtc_packaging/debian_fremantle/control b/qtc_packaging/debian_fremantle/control index 58dc10a..f76466a 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: A bugfix update - This update fixes a situation where keysets were being deleted while a command was still running. Also, a first pass at keysets for Changhong, Frontech, Sinotec, and Supra; a new Thomson keyset; and a few fixes to ADB (I-Can) keysets. +XB-Maemo-Upgrade-Description: Catching Up + This update adds in a month's worth of keysets (for ADB, LG, Medialink, Mitsubishi, Multichoice, NEC, and Pioneer), and adds a new "Advanced Settings" panel where you can modify the carrier frequency and duty cycle values. XSBC-Bugtracker: https://garage.maemo.org/tracker/?func=add&group_id=2286&atid=7641 XB-Maemo-Display-Name: Pierogi XB-Maemo-Icon-26: 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 -- 1.7.9.5