Ticket #4071: recording_led-v14391.2.patch

File recording_led-v14391.2.patch, 5.4 KB (added by Mark Buechler <Mark.Buechler@…>, 13 years ago)

Patch with missing header diffs.

  • libs/libmythtv/remoteutil.cpp

    diff -rup mythtv-vid.old/libs/libmythtv/remoteutil.cpp mythtv-vid/libs/libmythtv/remoteutil.cpp
    old new void RemoteFillProginfo(ProgramInfo *pgi 
    337337        pginfo->FromStringList(strlist, 0);
    338338}
    339339
    340 int RemoteIsRecording(void)
     340QStringList RemoteRecordings(void)
    341341{
    342342    QStringList strlist = "QUERY_ISRECORDING";
     343    QStringList empty;
     344
     345    empty << "0" << "0";
    343346
    344347    if (!gContext->SendReceiveStringList(strlist, false, false))
    345         return -1;
     348        return empty;
    346349
    347     return strlist[0].toInt();
     350    return strlist;
    348351}
    349352
    350353int RemoteGetRecordingMask(void)
  • libs/libmythtv/remoteutil.h

    diff -rup mythtv-vid.old/libs/libmythtv/remoteutil.h mythtv-vid/libs/libmythtv/remoteutil.h
    old new  
    33
    44#include <vector>
    55#include <qstring.h>
     6#include <qstringlist.h>
    67using namespace std;
    78
    89#include "mythexp.h"
    MPUBLIC void RemoteGeneratePreviewPixmap 
    5657MPUBLIC QString RemoteGetPreviewLastModified(ProgramInfo *pginfo);
    5758MPUBLIC void RemoteFillProginfo(ProgramInfo *pginfo,
    5859                                const QString &playbackhostname);
    59 MPUBLIC int RemoteIsRecording(void);
     60MPUBLIC QStringList RemoteRecordings(void);
    6061MPUBLIC int RemoteGetRecordingMask(void);
    6162MPUBLIC int RemoteGetFreeRecorderCount(void);
    6263
  • libs/libmythtv/xbox.cpp

    diff -rup mythtv-vid.old/libs/libmythtv/xbox.cpp mythtv-vid/libs/libmythtv/xbox.cpp
    old new void XBox::GetSettings(void) 
    2222    RecordingLED = gContext->GetSetting("XboxLEDRecording","rrrr");
    2323    DefaultLED = gContext->GetSetting("XboxLEDDefault","gggg");
    2424    BlinkBIN = gContext->GetSetting("XboxBlinkBIN");
     25    LEDNonLiveTV = gContext->GetSetting("XboxLEDNonLiveTV","0");
    2526
    2627    if (!BlinkBIN)
    2728        return;
    void XBox::GetSettings(void) 
    3637
    3738void XBox::CheckRec(void)
    3839{
    39     bool recording = RemoteIsRecording();
     40    QStringList recording = RemoteRecordings();
    4041
    41     QString color = (recording) ? RecordingLED : DefaultLED;
     42    int all = recording[0].toInt();
     43    int livetv = recording[1].toInt();
     44    int numrec = all;
     45
     46    if (LEDNonLiveTV.toInt())
     47        numrec -= livetv;
     48
     49    QString color = (numrec) ? RecordingLED : DefaultLED;
    4250
    4351    if (color != PhaseCache)
    4452    {
  • libs/libmythtv/xbox.h

    diff -rup mythtv-vid.old/libs/libmythtv/xbox.h mythtv-vid/libs/libmythtv/xbox.h
    old new  
    33
    44#include <qobject.h>
    55#include <qtimer.h>
     6#include <qstringlist.h>
    67
    78#include "mythexp.h"
    89
    class MPUBLIC XBox : public QObject 
    2627    QString DefaultLED;
    2728    QString PhaseCache;
    2829    QString BlinkBIN;
     30    QString LEDNonLiveTV;
    2931};
    3032
    3133#endif
  • programs/mythbackend/mainserver.cpp

    diff -rup mythtv-vid.old/programs/mythbackend/mainserver.cpp mythtv-vid/programs/mythbackend/mainserver.cpp
    old new void MainServer::HandleIsRecording(QStri 
    35113511
    35123512    MythSocket *pbssock = pbs->getSocket();
    35133513    int RecordingsInProgress = 0;
     3514    int LiveTVRecordingsInProgress = 0;
     3515    ProgramInfo *info;
     3516    QStringList retlist;
     3517
    35143518    QMap<int, EncoderLink *>::Iterator iter = encoderList->begin();
    35153519    for (; iter != encoderList->end(); ++iter)
    35163520    {
    35173521        EncoderLink *elink = iter.data();
    3518         if (elink->IsBusyRecording())
    3519             RecordingsInProgress++;
     3522        if (elink->IsBusyRecording()) {
     3523            info = elink->GetRecording();
     3524
     3525            if (info->recgroup == "LiveTV")
     3526                LiveTVRecordingsInProgress++;
     3527            else
     3528                RecordingsInProgress++;
     3529
     3530            delete info;
     3531        }
    35203532    }
    35213533
    3522     QStringList retlist = QString::number(RecordingsInProgress);
     3534    retlist << QString::number(RecordingsInProgress);
     3535    retlist << QString::number(LiveTVRecordingsInProgress);
    35233536
    35243537    SendResponse(pbssock, retlist);
    35253538}
  • programs/mythfrontend/globalsettings.cpp

    diff -rup mythtv-vid.old/programs/mythfrontend/globalsettings.cpp mythtv-vid/programs/mythfrontend/globalsettings.cpp
    old new static HostComboBox *XboxLEDRecording() 
    32313231    return gc;
    32323232}
    32333233
     3234static HostCheckBox *XboxLEDNonLiveTV()
     3235{
     3236    HostCheckBox *gc = new HostCheckBox("XboxLEDNonLiveTV");
     3237    gc->setLabel(QObject::tr("Ignore LiveTV Recordings"));
     3238    gc->setHelpText(QObject::tr("Recording monitoring will "
     3239                    "ignore LiveTV recordings."));
     3240    gc->setValue(false);
     3241    return gc;
     3242}
     3243
    32343244static HostSpinBox *XboxCheckRec()
    32353245{
    32363246    HostSpinBox *gs = new HostSpinBox("XboxCheckRec", 1, 600, 2);
    XboxSettings::XboxSettings() 
    46364646    xboxset->addChild(XboxBlinkBIN());
    46374647    xboxset->addChild(XboxLEDDefault());
    46384648    xboxset->addChild(XboxLEDRecording());
     4649    xboxset->addChild(XboxLEDNonLiveTV());
    46394650    xboxset->addChild(XboxCheckRec());
    46404651    addChild(xboxset);
    46414652}