}
-PanasonicAudio::PanasonicAudio(
+PanasonicAudio1::PanasonicAudio1(
QObject *guiObject,
unsigned int index)
: PIRKeysetMetaData(
- "Audio System Keyset",
+ "Audio Keyset 1",
Panasonic_Make,
index)
{
addControlledDevice(Panasonic_Make, "RX-DS25", Audio_Device);
+ addControlledDevice(Panasonic_Make, "RX-e300", Audio_Device);
NECProtocol *np = new NECProtocol(
guiObject,
index,
- 516, 358,
- 516, 1220,
- 83895, false);
+ 400, 400,
+ 400, 1200,
+ 76000, false);
threadableProtocol = np;
- np->setHeaderPair(3581, 1655);
- np->setTrailerPulse(524);
+ np->setHeaderPair(4000, 1600);
+ np->setTrailerPulse(400);
np->setPreData(0x40040543, 32);
addKey("+10", DoubleDigit_Key, 0xF9BF, 16);
addKey("10/0", Zero_Key, 0x99DF, 16);
addKey("cancel", Clear_Key, 0xB1F7, 16);
- addKey("program", Program_Key, 0xD197, 16);
+ addKey("program", Program_Key, 0xD197, 16); // "MEMORY"
addKey("tuner-band", Unmapped_Key, 0x1D5B, 16);
- addKey("tuning-", ChannelDown_Key, 0x5711, 16);
- addKey("tuning+", ChannelUp_Key, 0x97D1, 16);
- addKey("fm-mode", Unmapped_Key, 0x2761, 16);
+ addKey("tuning-", Unmapped_Key, 0x5711, 16);
+ addKey("tuning+", Unmapped_Key, 0x97D1, 16);
+ addKey("TUNER_PRESET_TUNE_DOWN", ChannelDown_Key, 0x1751, 16);
+ addKey("TUNER_PRESET_TUNE_UP", ChannelUp_Key, 0xE7A1, 16);
+ addKey("fm-mode", Unmapped_Key, 0x2761, 16); // "st-mono"
addKey("cd", Unmapped_Key, 0x6D2B, 16);
addKey("prev", Previous_Key, 0x2167, 16);
addKey("next", Next_Key, 0xA1E7, 16);
addKey("xbs", Unmapped_Key, 0x6B2D, 16);
addKey("vol-", VolumeDown_Key, 0x8DCB, 16);
addKey("vol+", VolumeUp_Key, 0x0D4B, 16);
+ addKey("sleep", Sleep_Key, 0x3D7B, 16);
+ addKey("display", Info_Key, 0xF1B7, 16);
+ addKey("preset_eq", Unmapped_Key, 0x9BDD, 16);
+ addKey("bp", Unmapped_Key, 0xF7B1, 16); // "TUNER_BP"
+ addKey("tape_record", Record_Key, 0x2563, 16);
+ addKey("counter_reset", Reset_Key, 0xF5B3, 16);
+ addKey("rev_mode", Unmapped_Key, 0x7533, 16); // "TAPE_REV_MODE"
+ addKey("rew", Rewind_Key, 0x4503, 16);
+ addKey("ff", FastForward_Key, 0xC583, 16);
+ addKey("tape_play", Unmapped_Key, 0x6523, 16);
+ addKey("tape_stop", Unmapped_Key, 0x0543, 16);
+ addKey("random", Unmapped_Key, 0x4107, 16);
+ addKey("TAPE_DECK", Unmapped_Key, 0xB5F3, 16);
+ addKey("TAPE_PLAY_REWIND", Unmapped_Key, 0xA5E3, 16);
+ addKey("TAPE_PLAY_FORWARD", Unmapped_Key, 0x6523, 16);
+ addKey("panelclose", Unmapped_Key, 0xAFE9, 16); // "TOP_PANEL_CLOSE"
+ addKey("panelopen", Unmapped_Key, 0x2F69, 16); // "TOP_PANEL_OPEN"
+ addKey("virtualizer", Unmapped_Key, 0x5B1D, 16); // "S.VIRT"
+ addKey("AUTOSCAN", Unmapped_Key, 0x3771, 16);
+ addKey("TRACK<<", Unmapped_Key, 0x8BCD, 16);
+ addKey("TRACK>>", Unmapped_Key, 0x0B4D, 16);
+ addKey("INTRO", Unmapped_Key, 0x6224, 16);
+}
+
+
+PanasonicAudio1a::PanasonicAudio1a(
+ QObject *guiObject,
+ unsigned int index)
+ : PanasonicAudio1(guiObject, index)
+{
+ setKeysetName("Audio Keyset 1a");
+
+ addControlledDevice(Panasonic_Make, "RX-DT55", Audio_Device);
+ addControlledDevice(Panasonic_Make, "RX-DT505", Audio_Device);
+
+ addKey("CD_PAUSE", Pause_Key, 0x6127, 16);
+ addKey("CD_<<", Rewind_Key, 0x2167, 16);
+ addKey("CD_>>", FastForward_Key, 0xA1E7, 16);
+ addKey("TAPE_<<", Unmapped_Key, 0x4503, 16);
+ addKey("TAPE_>>", Unmapped_Key, 0xC583, 16);
+ addKey("eject", Eject_Key, 0x7137, 16);
}
//#define DEBUGGING
+// Some ugly globals used for thread communications:
+
+// A global to show that a command is being processed:
+bool commandInFlight = false;
+QMutex commandIFMutex;
+
+// The stopRepeatingFlag boolean is the method used to tell running commands
+// in the worker thread to stop:
+bool stopRepeatingFlag = false;
+QMutex stopRepeatingMutex;
+
extern PIRMakeMgr makeManager;
void MainWindow::on_powerButton_pressed()
{
- emit buttonPressed(currentKeyset, Power_Key);
+ startRepeating(currentKeyset, Power_Key);
}
void MainWindow::on_powerButton_released()
void MainWindow::on_mainChannelUpButton_pressed()
{
- emit buttonPressed(currentKeyset, ChannelUp_Key);
+ startRepeating(currentKeyset, ChannelUp_Key);
}
void MainWindow::on_mainChannelUpButton_released()
void MainWindow::on_mainChannelDownButton_pressed()
{
- emit buttonPressed(currentKeyset, ChannelDown_Key);
+ startRepeating(currentKeyset, ChannelDown_Key);
}
void MainWindow::on_mainChannelDownButton_released()
void MainWindow::on_mainVolumeUp_pressed()
{
- emit buttonPressed(currentKeyset, VolumeUp_Key);
+ startRepeating(currentKeyset, VolumeUp_Key);
}
void MainWindow::on_mainVolumeUp_released()
void MainWindow::on_mainVolumeDownButton_pressed()
{
- emit buttonPressed(currentKeyset, VolumeDown_Key);
+ startRepeating(currentKeyset, VolumeDown_Key);
}
void MainWindow::on_mainVolumeDownButton_released()
void MainWindow::on_redButton_pressed()
{
- emit buttonPressed(currentKeyset, Red_Key);
+ startRepeating(currentKeyset, Red_Key);
}
void MainWindow::on_redButton_released()
void MainWindow::on_greenButton_pressed()
{
- emit buttonPressed(currentKeyset, Green_Key);
+ startRepeating(currentKeyset, Green_Key);
}
void MainWindow::on_greenButton_released()
void MainWindow::on_yellowButton_pressed()
{
- emit buttonPressed(currentKeyset, Yellow_Key);
+ startRepeating(currentKeyset, Yellow_Key);
}
void MainWindow::on_yellowButton_released()
void MainWindow::on_blueButton_pressed()
{
- emit buttonPressed(currentKeyset, Blue_Key);
+ startRepeating(currentKeyset, Blue_Key);
}
void MainWindow::on_blueButton_released()
void MainWindow::on_aspectRatioButton_pressed()
{
- emit buttonPressed(currentKeyset, AspectRatio_Key);
+ startRepeating(currentKeyset, AspectRatio_Key);
}
void MainWindow::on_aspectRatioButton_released()
void MainWindow::on_surroundButton_pressed()
{
- emit buttonPressed(currentKeyset, Surround_Key);
+ startRepeating(currentKeyset, Surround_Key);
}
void MainWindow::on_surroundButton_released()
void MainWindow::on_languageButton_pressed()
{
- emit buttonPressed(currentKeyset, Language_Key);
+ startRepeating(currentKeyset, Language_Key);
}
void MainWindow::on_languageButton_released()
void MainWindow::on_favoritesButton_pressed()
{
- emit buttonPressed(currentKeyset, Favorites_Key);
+ startRepeating(currentKeyset, Favorites_Key);
}
void MainWindow::on_favoritesButton_released()
void MainWindow::on_captionButton_pressed()
{
- emit buttonPressed(currentKeyset, Captions_Key);
+ startRepeating(currentKeyset, Captions_Key);
}
void MainWindow::on_captionButton_released()
void MainWindow::on_inputButton_pressed()
{
- emit buttonPressed(currentKeyset, Input_Key);
+ startRepeating(currentKeyset, Input_Key);
}
void MainWindow::on_inputButton_released()
void MainWindow::on_sleepButton_pressed()
{
- emit buttonPressed(currentKeyset, Sleep_Key);
+ startRepeating(currentKeyset, Sleep_Key);
}
void MainWindow::on_sleepButton_released()
void MainWindow::on_muteButton_pressed()
{
- emit buttonPressed(currentKeyset, Mute_Key);
+ startRepeating(currentKeyset, Mute_Key);
}
void MainWindow::on_muteButton_released()
void MainWindow::on_oneButton_pressed()
{
- emit buttonPressed(currentKeyset, One_Key);
+ startRepeating(currentKeyset, One_Key);
}
void MainWindow::on_oneButton_released()
void MainWindow::on_twoButton_pressed()
{
- emit buttonPressed(currentKeyset, Two_Key);
+ startRepeating(currentKeyset, Two_Key);
}
void MainWindow::on_twoButton_released()
void MainWindow::on_threeButton_pressed()
{
- emit buttonPressed(currentKeyset, Three_Key);
+ startRepeating(currentKeyset, Three_Key);
}
void MainWindow::on_threeButton_released()
void MainWindow::on_fourButton_pressed()
{
- emit buttonPressed(currentKeyset, Four_Key);
+ startRepeating(currentKeyset, Four_Key);
}
void MainWindow::on_fourButton_released()
void MainWindow::on_fiveButton_pressed()
{
- emit buttonPressed(currentKeyset, Five_Key);
+ startRepeating(currentKeyset, Five_Key);
}
void MainWindow::on_fiveButton_released()
void MainWindow::on_sixButton_pressed()
{
- emit buttonPressed(currentKeyset, Six_Key);
+ startRepeating(currentKeyset, Six_Key);
}
void MainWindow::on_sixButton_released()
void MainWindow::on_sevenButton_pressed()
{
- emit buttonPressed(currentKeyset, Seven_Key);
+ startRepeating(currentKeyset, Seven_Key);
}
void MainWindow::on_sevenButton_released()
void MainWindow::on_eightButton_pressed()
{
- emit buttonPressed(currentKeyset, Eight_Key);
+ startRepeating(currentKeyset, Eight_Key);
}
void MainWindow::on_eightButton_released()
void MainWindow::on_nineButton_pressed()
{
- emit buttonPressed(currentKeyset, Nine_Key);
+ startRepeating(currentKeyset, Nine_Key);
}
void MainWindow::on_nineButton_released()
void MainWindow::on_zeroButton_pressed()
{
- emit buttonPressed(currentKeyset, Zero_Key);
+ startRepeating(currentKeyset, Zero_Key);
}
void MainWindow::on_zeroButton_released()
void MainWindow::on_enterButton_pressed()
{
- emit buttonPressed(currentKeyset, Enter_Key);
+ startRepeating(currentKeyset, Enter_Key);
}
void MainWindow::on_enterButton_released()
void MainWindow::on_clearButton_pressed()
{
- emit buttonPressed(currentKeyset, Clear_Key);
+ startRepeating(currentKeyset, Clear_Key);
}
void MainWindow::on_clearButton_released()
void MainWindow::on_prevChannelButton_pressed()
{
- emit buttonPressed(currentKeyset, PrevChannel_Key);
+ startRepeating(currentKeyset, PrevChannel_Key);
}
void MainWindow::on_prevChannelButton_released()
void MainWindow::on_plusOneHundredButton_pressed()
{
- emit buttonPressed(currentKeyset, PlusOneHundred_Key);
+ startRepeating(currentKeyset, PlusOneHundred_Key);
}
void MainWindow::on_plusOneHundredButton_released()
void MainWindow::on_dashButton_pressed()
{
- emit buttonPressed(currentKeyset, Dash_Key);
+ startRepeating(currentKeyset, Dash_Key);
}
void MainWindow::on_dashButton_released()
void MainWindow::on_doubleDigitButton_pressed()
{
- emit buttonPressed(currentKeyset, DoubleDigit_Key);
+ startRepeating(currentKeyset, DoubleDigit_Key);
}
void MainWindow::on_doubleDigitButton_released()
void MainWindow::on_upButton_pressed()
{
- emit buttonPressed(currentKeyset, Up_Key);
+ startRepeating(currentKeyset, Up_Key);
}
void MainWindow::on_upButton_released()
void MainWindow::on_leftButton_pressed()
{
- emit buttonPressed(currentKeyset, Left_Key);
+ startRepeating(currentKeyset, Left_Key);
}
void MainWindow::on_leftButton_released()
void MainWindow::on_rightButton_pressed()
{
- emit buttonPressed(currentKeyset, Right_Key);
+ startRepeating(currentKeyset, Right_Key);
}
void MainWindow::on_rightButton_released()
void MainWindow::on_downButton_pressed()
{
- emit buttonPressed(currentKeyset, Down_Key);
+ startRepeating(currentKeyset, Down_Key);
}
void MainWindow::on_downButton_released()
void MainWindow::on_selectButton_pressed()
{
- emit buttonPressed(currentKeyset, Select_Key);
+ startRepeating(currentKeyset, Select_Key);
}
void MainWindow::on_selectButton_released()
void MainWindow::on_menuButton_pressed()
{
- emit buttonPressed(currentKeyset, Menu_Key);
+ startRepeating(currentKeyset, Menu_Key);
}
void MainWindow::on_menuButton_released()
void MainWindow::on_exitButton_pressed()
{
- emit buttonPressed(currentKeyset, Exit_Key);
+ startRepeating(currentKeyset, Exit_Key);
}
void MainWindow::on_exitButton_released()
void MainWindow::on_mediaPreviousButton_pressed()
{
- emit buttonPressed(currentKeyset, Previous_Key);
+ startRepeating(currentKeyset, Previous_Key);
}
void MainWindow::on_mediaPreviousButton_released()
void MainWindow::on_mediaNextButton_pressed()
{
- emit buttonPressed(currentKeyset, Next_Key);
+ startRepeating(currentKeyset, Next_Key);
}
void MainWindow::on_mediaNextButton_released()
void MainWindow::on_replayButton_pressed()
{
- emit buttonPressed(currentKeyset, Replay_Key);
+ startRepeating(currentKeyset, Replay_Key);
}
void MainWindow::on_replayButton_released()
void MainWindow::on_advanceButton_pressed()
{
- emit buttonPressed(currentKeyset, Advance_Key);
+ startRepeating(currentKeyset, Advance_Key);
}
void MainWindow::on_advanceButton_released()
void MainWindow::on_stepBackButton_pressed()
{
- emit buttonPressed(currentKeyset, StepBack_Key);
+ startRepeating(currentKeyset, StepBack_Key);
}
void MainWindow::on_stepBackButton_released()
void MainWindow::on_stepForwardButton_pressed()
{
- emit buttonPressed(currentKeyset, StepForward_Key);
+ startRepeating(currentKeyset, StepForward_Key);
}
void MainWindow::on_stepForwardButton_released()
void MainWindow::on_reverseButton_pressed()
{
- emit buttonPressed(currentKeyset, Rewind_Key);
+ startRepeating(currentKeyset, Rewind_Key);
}
void MainWindow::on_reverseButton_released()
void MainWindow::on_fastForwardButton_pressed()
{
- emit buttonPressed(currentKeyset, FastForward_Key);
+ startRepeating(currentKeyset, FastForward_Key);
}
void MainWindow::on_fastForwardButton_released()
void MainWindow::on_playButton_pressed()
{
- emit buttonPressed(currentKeyset, Play_Key);
+ startRepeating(currentKeyset, Play_Key);
}
void MainWindow::on_playButton_released()
void MainWindow::on_pauseButton_pressed()
{
- emit buttonPressed(currentKeyset, Pause_Key);
+ startRepeating(currentKeyset, Pause_Key);
}
void MainWindow::on_pauseButton_released()
void MainWindow::on_stopButton_pressed()
{
- emit buttonPressed(currentKeyset, Stop_Key);
+ startRepeating(currentKeyset, Stop_Key);
}
void MainWindow::on_stopButton_released()
void MainWindow::on_ejectButton_pressed()
{
- emit buttonPressed(currentKeyset, Eject_Key);
+ startRepeating(currentKeyset, Eject_Key);
}
void MainWindow::on_ejectButton_released()
void MainWindow::on_pipOnOffButton_pressed()
{
- emit buttonPressed(currentKeyset, PIP_Key);
+ startRepeating(currentKeyset, PIP_Key);
}
void MainWindow::on_pipOnOffButton_released()
void MainWindow::on_pipSwapButton_pressed()
{
- emit buttonPressed(currentKeyset, PIPSwap_Key);
+ startRepeating(currentKeyset, PIPSwap_Key);
}
void MainWindow::on_pipSwapButton_released()
void MainWindow::on_pipPositionButton_pressed()
{
- emit buttonPressed(currentKeyset, PIPMove_Key);
+ startRepeating(currentKeyset, PIPMove_Key);
}
void MainWindow::on_pipPositionButton_released()
void MainWindow::on_pipSourceButton_pressed()
{
- emit buttonPressed(currentKeyset, PIPSource_Key);
+ startRepeating(currentKeyset, PIPSource_Key);
}
void MainWindow::on_pipSourceButton_released()
void MainWindow::on_scanButton_pressed()
{
- emit buttonPressed(currentKeyset, Scan_Key);
+ startRepeating(currentKeyset, Scan_Key);
}
void MainWindow::on_scanButton_released()
void MainWindow::on_programButton_pressed()
{
- emit buttonPressed(currentKeyset, Program_Key);
+ startRepeating(currentKeyset, Program_Key);
}
void MainWindow::on_programButton_released()
void MainWindow::on_pictureModeButton_pressed()
{
- emit buttonPressed(currentKeyset, PictureMode_Key);
+ startRepeating(currentKeyset, PictureMode_Key);
}
void MainWindow::on_pictureModeButton_released()
void MainWindow::on_soundModeButton_pressed()
{
- emit buttonPressed(currentKeyset, SoundMode_Key);
+ startRepeating(currentKeyset, SoundMode_Key);
}
void MainWindow::on_soundModeButton_released()
void MainWindow::on_discTitleButton_pressed()
{
- emit buttonPressed(currentKeyset, DiscTitle_Key);
+ startRepeating(currentKeyset, DiscTitle_Key);
}
void MainWindow::on_discTitleButton_released()
void MainWindow::on_discMenuButton_pressed()
{
- emit buttonPressed(currentKeyset, DiscMenu_Key);
+ startRepeating(currentKeyset, DiscMenu_Key);
}
void MainWindow::on_discMenuButton_released()
void MainWindow::on_discSelectButton_pressed()
{
- emit buttonPressed(currentKeyset, DiscSelect_Key);
+ startRepeating(currentKeyset, DiscSelect_Key);
}
void MainWindow::on_discSelectButton_released()
void MainWindow::on_trackingPlusButton_pressed()
{
- emit buttonPressed(currentKeyset, TrackingPlus_Key);
+ startRepeating(currentKeyset, TrackingPlus_Key);
}
void MainWindow::on_trackingPlusButton_released()
void MainWindow::on_trackingMinusButton_pressed()
{
- emit buttonPressed(currentKeyset, TrackingMinus_Key);
+ startRepeating(currentKeyset, TrackingMinus_Key);
}
void MainWindow::on_trackingMinusButton_released()
void MainWindow::on_autoTrackingButton_pressed()
{
- emit buttonPressed(currentKeyset, AutoTracking_Key);
+ startRepeating(currentKeyset, AutoTracking_Key);
}
void MainWindow::on_autoTrackingButton_released()
void MainWindow::on_vhsSpeedButton_pressed()
{
- emit buttonPressed(currentKeyset, VHSSpeed_Key);
+ startRepeating(currentKeyset, VHSSpeed_Key);
}
void MainWindow::on_vhsSpeedButton_released()
void MainWindow::on_recordButton_pressed()
{
- emit buttonPressed(currentKeyset, Record_Key);
+ startRepeating(currentKeyset, Record_Key);
}
void MainWindow::on_recordButton_released()
settings.endArray();
}
+
+
+void MainWindow::startRepeating(
+ unsigned int id,
+ PIRKeyName name)
+{
+ QMutexLocker locker(&commandIFMutex);
+ if (!commandInFlight)
+ {
+ commandInFlight = true;
+ emit buttonPressed(id, name);
+ }
+}
+
+
+void MainWindow::stopRepeating()
+{
+ QMutexLocker locker(&stopRepeatingMutex);
+ stopRepeatingFlag = true;
+}