Ticket #4328: channelChange.15174.patch

File channelChange.15174.patch, 4.5 KB (added by George Nassas <gnassas@…>, 16 years ago)

updated to apply after a recent MingGW change

  • libs/libmythtv/channelbase.h

     
    144144    virtual bool SwitchToInput(int newcapchannel, bool setstarting) = 0;
    145145
    146146    virtual int GetCardID(void) const;
    147     virtual bool ChangeExternalChannel(const QString &newchan);
     147    virtual bool ChangeExternalChannel(const QString &channum);
     148    virtual bool RotateAntenna(const QString &channum,
     149                               const QString &channum,
     150                               const QString &callsign);
    148151    static void StoreInputChannels(const InputMap&);
    149152    static void StoreDefaultInput(uint cardid, const QString &input);
    150153
  • libs/libmythtv/hdhrchannel.cpp

     
    309309    bool isFrequency = ok && (frequency > 10000000);
    310310
    311311    // Tune to proper frequency
    312     if ((*it)->externalChanger.isEmpty())
     312    if (isFrequency)
    313313    {
    314         if (isFrequency)
     314        // Allow an antenna rotor to spin around
     315        if (!(*it)->externalChanger.isEmpty())
    315316        {
    316             if (!Tune(frequency, inputName, modulation, si_std))
     317            int chanid = ChannelUtil::GetChanID((*it)->sourceid, channum);
     318            QString callsign = ChannelUtil::GetCallsign(chanid);
     319            if (!RotateAntenna(freqid, channum, callsign))
    317320                return false;
    318321        }
    319         else
    320         {
    321             VERBOSE(VB_IMPORTANT, LOC_ERR +
    322                     "dtv_multiplex data is required for tuning");
    323322
     323        if (!Tune(frequency, inputName, modulation, si_std))
    324324            return false;
    325         }
    326325    }
    327     else if (!ChangeExternalChannel(freqid))
     326    else
     327    {
     328        VERBOSE(VB_IMPORTANT, LOC_ERR +
     329                "dtv_multiplex data is required for tuning");
     330
    328331        return false;
     332    }
    329333
    330334    // Set the current channum to the new channel's channum
    331335    curchannelname = QDeepCopy<QString>(channum);
  • libs/libmythtv/channelbase.cpp

     
    223223    return GetChannels(inputid);
    224224}
    225225
    226 bool ChannelBase::ChangeExternalChannel(const QString &channum)
     226bool ChannelBase::ChangeExternalChannel(const QString &freqId)
    227227{
     228    QString empty;
     229    RotateAntenna(freqId, empty, empty);
     230}
     231
     232bool ChannelBase::RotateAntenna(const QString &freqId,
     233                                const QString &channum,
     234                                const QString &callsign)
     235{
    228236#ifdef USING_MINGW
    229237    VERBOSE(VB_IMPORTANT, LOC_WARN +
    230238            QString("ChangeExternalChannel is not implemented in MinGW."));
     
    236244    if (changer.isEmpty())
    237245        return false;
    238246
    239     QString command = QString("%1 %2").arg(changer).arg(channum);
     247    QString command = QString("%1 %2 %3 %4").arg(changer).arg(freqId).arg(channum).arg(callsign);
    240248
    241249    VERBOSE(VB_CHANNEL, QString("External channel change: %1").arg(command));
    242250    pid_t child = fork();
  • libs/libmythtv/videosource.cpp

     
    16441644    };
    16451645};
    16461646
     1647class ExternalRotateCommand :
     1648    public LineEditSetting, public CardInputDBStorage
     1649{
     1650  public:
     1651    ExternalRotateCommand(const CardInput &parent) :
     1652        LineEditSetting(this),
     1653        CardInputDBStorage(this, parent, "externalcommand")
     1654    {
     1655        setLabel(QObject::tr("Antenna rotate command"));
     1656        setValue("");
     1657        setHelpText(QObject::tr("If specified, this command will be run "
     1658                    "before a channel change so that an antenna can be "
     1659                    "rotated into position. Three arguments are passed: "
     1660                    "frequency, MPEG program number and channel callsign."));
     1661    };
     1662};
     1663
    16471664class PresetTuner : public LineEditSetting, public CardInputDBStorage
    16481665{
    16491666  public:
     
    17791796        ConfigurationGroup *chgroup =
    17801797            new VerticalConfigurationGroup(false, false, true, true);
    17811798        chgroup->addChild(new QuickTune(*this));
     1799        chgroup->addChild(new ExternalRotateCommand(*this));
    17821800        chgroup->addChild(new FreeToAir(*this));
    17831801        group->addChild(chgroup);
    17841802    }