Ticket #182: lcdkeys.diff

File lcdkeys.diff, 4.5 KB (added by anonymous, 19 years ago)
  • libs/libmythtv/siscan.h

     
    3131typedef void* NIT;
    3232#endif // USING_DVB
    3333
    34 #define USE_OWN_SIPARSER
     34//#define USE_OWN_SIPARSER
    3535#define DVB_QUICKSCAN
    3636
    3737#define SISCAN(args...) \
  • libs/libmythtv/siscan.cpp

     
    158158void *SIScan::SpawnSectionReader(void *param)
    159159{
    160160    DVBSIParser *siparser = (DVBSIParser*) param;
     161#ifdef USING_DVB
    161162    siparser->StartSectionReader();
     163#endif
    162164    return NULL;
    163165}
    164166
  • libs/libmyth/lcddevice.cpp

     
    416416{
    417417    int key = 0;
    418418
    419     char mykey = key_pressed.ascii()[0];
    420     switch (mykey)
    421     {
    422         case LCD_KEY_UP: key = Qt::Key_Up; break;
    423         case LCD_KEY_DOWN: key = Qt::Key_Down; break;
    424         case LCD_KEY_LEFT: key = Qt::Key_Left; break;
    425         case LCD_KEY_RIGHT: key = Qt::Key_Right; break;
    426         case LCD_KEY_YES: key = Qt::Key_Space; break;
    427         case LCD_KEY_NO: key = Qt::Key_Escape; break;
    428         default: break;
    429     }
     419    QChar mykey = key_pressed.at(0);
     420    if (mykey == lcd_keystring.at(0))
     421        key = Qt::Key_Up;
     422    else if (mykey == lcd_keystring.at(1))
     423        key = Qt::Key_Down;
     424    else if (mykey == lcd_keystring.at(2))
     425        key = Qt::Key_Left;
     426    else if (mykey == lcd_keystring.at(3))
     427        key = Qt::Key_Right;
     428    else if (mykey == lcd_keystring.at(4))
     429        key = Qt::Key_Space;
     430    else if (mykey == lcd_keystring.at(5))
     431        key = Qt::Key_Escape;
    430432
    431433    QApplication::postEvent(gContext->GetMainWindow(),
    432434                            new ExternalKeycodeEvent(key));
     
    453455    lcd_heartbeaton=(gContext->GetSetting("LCDHeartBeatOn", "1")=="1");
    454456    aString = gContext->GetSetting("LCDPopupTime", "5");
    455457    lcd_popuptime = aString.toInt() * 1000;
     458    lcd_keystring = gContext->GetSetting("LCDKeyString", "ABCDEF");
    456459
    457460    connected = TRUE;
    458461
     
    460463    // indicating that "hello" was succesful
    461464
    462465    sendToServer("client_set name Myth");
    463     sendToServer("client_add_key ABCDEF");   
     466    aString = "client_add_key " + lcd_keystring;
     467    sendToServer(aString);
    464468 
    465469    // Create all the screens and widgets (when we change activity in the myth
    466470    // program, we just swap the priorities of the screens to show only the
  • libs/libmyth/lcddevice.h

     
    1111
    1212using namespace std;
    1313
    14 #define LCD_KEY_UP    'A'
    15 #define LCD_KEY_LEFT  'B'
    16 #define LCD_KEY_DOWN  'C'
    17 #define LCD_KEY_RIGHT 'D'
    18 #define LCD_KEY_YES   'E'
    19 #define LCD_KEY_NO    'F'
    20 
    2114enum CHECKED_STATE {CHECKED = 0, UNCHECKED, NOTCHECKABLE };
    2215
    2316class LCDMenuItem
     
    308301    bool lcd_heartbeaton;
    309302    int  lcd_popuptime;   
    310303    QString lcd_showmusic_items;
    311 
     304    QString lcd_keystring;
     305   
    312306    int (*GetLEDMask)(void);
    313307};
    314308
  • programs/mythfrontend/globalsettings.cpp

     
    25532553    return gc;
    25542554}
    25552555
     2556static HostLineEdit *LCDKeyString()
     2557{
     2558    HostLineEdit *ge = new HostLineEdit("LCDKeyString");
     2559    ge->setLabel(QObject::tr("LCD Key order"));
     2560    ge->setValue("ABCDEF");
     2561    ge->setHelpText(QObject::tr("Enter the 6 Keypad Return Codes for your "
     2562            "LCD keypad in the order in which you want the functions "
     2563            "up/down/left/right/yes/no to operate. "
     2564            "(See lcdproc/server/drivers/hd44780.c/keyMapMatrix[] "
     2565            "or the matrix for your display)"));
     2566    return ge;
     2567}
     2568
    25562569static HostCheckBox *LCDEnable()
    25572570{
    25582571    HostCheckBox *gc = new HostCheckBox("LCDEnable");
     
    25902603         setRight->addChild(LCDShowGeneric());
    25912604         setRight->addChild(LCDBacklightOn());
    25922605         setRight->addChild(LCDHeartBeatOn());
     2606         setRight->addChild(LCDKeyString());
    25932607         setHoriz->addChild(setLeft);
    25942608         setHoriz->addChild(setRight);
    25952609         settings->addChild(setHoriz);