Ticket #5888: osd_input_timeout_trunk@18947.diff

File osd_input_timeout_trunk@18947.diff, 3.6 KB (added by Markus Schulz <msc@…>, 12 years ago)
  • libs/libmythtv/tv_play.h

     
    467467    bool    arrowAccel;
    468468    int     osd_general_timeout;
    469469    int     osd_prog_info_timeout;
     470    int     osd_input_timeout;
    470471
    471472    enum commSkipMode autoCommercialSkip;
    472473    bool    tryUnflaggedSkip;
     
    579580    /// Lock used so that input QStrings can be used across threads, and so
    580581    /// that queuedChanNumExpr can be used safely in Qt 3.2 and earlier.
    581582    mutable QMutex  queuedInputLock;
     583    /// Timer for entering channel numbers
     584    MythTimer enterChanTimer;
    582585
    583586    int       unmuteTimeout; ///< For temp. audio muting during channel changes
    584587    MythTimer unmuteTimer;   ///< For temp. audio muting during channel changes
  • libs/libmythtv/tv_play.cpp

     
    539539      jumptime(0), smartChannelChange(false),
    540540      MuteIndividualChannels(false), arrowAccel(false),
    541541      osd_general_timeout(2), osd_prog_info_timeout(3),
     542      osd_input_timeout(0),
    542543      autoCommercialSkip(CommSkipOff), tryUnflaggedSkip(false),
    543544      smartForward(false), stickykeys(0),
    544545      ff_rew_repos(1.0f), ff_rew_reverse(false),
     
    661662    persistentbrowsemode = gContext->GetNumSetting("PersistentBrowseMode", 0);
    662663    osd_general_timeout  = gContext->GetNumSetting("OSDGeneralTimeout", 2);
    663664    osd_prog_info_timeout= gContext->GetNumSetting("OSDProgramInfoTimeout", 3);
     665    osd_input_timeout    = gContext->GetNumSetting("OSDInputTimeout", 0);
    664666    autoCommercialSkip   = (enum commSkipMode)gContext->GetNumSetting(
    665667                            "AutoCommercialSkip", CommSkipOff);
    666668    tryUnflaggedSkip     = gContext->GetNumSetting("TryUnflaggedSkip", 0);
     
    24222424            nvp->SetMuted(false);
    24232425    }
    24242426
     2427    if (enterChanTimer.isRunning() &&
     2428       (enterChanTimer.elapsed() >= osd_input_timeout))
     2429    {
     2430        enterChanTimer.stop();
     2431        CommitQueuedInput();
     2432    }
    24252433
    24262434    if (prevChanTimer.isRunning() &&
    24272435        (prevChanTimer.elapsed() >= kPrevChanTimeout))
     
    48794887        (smartChannelChange || browsemode))
    48804888    {
    48814889        commitSmart = ProcessSmartChannel(inputStr);
     4890        if (osd_input_timeout > 0)
     4891            enterChanTimer.start();
    48824892    }
    48834893
    48844894    // Handle OSD...
  • programs/mythfrontend/globalsettings.cpp

     
    15971597    return gs;
    15981598}
    15991599
     1600static HostSpinBox *OSDInputTimeout()
     1601{
     1602    HostSpinBox *gs = new HostSpinBox("OSDInputTimeout", 0, 5000, 100);
     1603    gs->setLabel(QObject::tr("Maximum timeout between entering to digits for channel selection until input was commited."));
     1604    gs->setValue(0);
     1605    gs->setHelpText(QObject::tr("How many milliseconds the input parser waits for an additional"
     1606                " digit before committing channel number. If 0 the input will be committed after OSD fade-out (old behaviour)"));
     1607    return gs;
     1608}
     1609
    16001610static HostSpinBox *ThemeCacheSize()
    16011611{
    16021612    HostSpinBox *gs = new HostSpinBox("ThemeCacheSize", 1, 1000, 1, true);
     
    47954805    osd->addChild(OSDThemeFontSizeType());
    47964806    osd->addChild(EnableMHEG());
    47974807    osd->addChild(PersistentBrowseMode());
     4808    osd->addChild(OSDInputTimeout());
    47984809    addChild(osd);
    47994810
    48004811    VerticalConfigurationGroup *udp = new VerticalConfigurationGroup(false);