Ticket #541: videosource.patch

File videosource.patch, 5.7 KB (added by John Pullan <john.pullan@…>, 18 years ago)

First pass at a "stop EIT scanning" patch

  • videosource.h

     
    209209    QString grabber;
    210210};
    211211
     212class OnAirGuide_config: public LabelSetting {
     213public:
     214    OnAirGuide_config();
     215
     216    virtual void load() {};
     217    virtual void save() {};
     218};
     219
    212220class XMLTVConfig: public VerticalConfigurationGroup,
    213221                   public TriggeredConfigurationGroup {
    214222public:
  • videosource.cpp

     
    904904    pdlg.Close();
    905905}
    906906
     907OnAirGuide_config::OnAirGuide_config()
     908{
     909}
     910
    907911XMLTVConfig::XMLTVConfig(const VideoSource& parent)
    908912{
    909913    setUseLabel(false);
     
    921925    addTarget("technovera", new DataDirect_config(parent, DD_LXM));
    922926    grabber->addSelection("LxM (United States)", "technovera");
    923927
     928    addTarget("onairguide", new OnAirGuide_config());
     929    grabber->addSelection("Transmitted Over Air Guide (EIT)", "onairguide");
     930
    924931    addTarget("tv_grab_de_tvtoday", new XMLTV_generic_config(parent, "tv_grab_de_tvtoday"));
    925932    grabber->addSelection("Germany (tvtoday)", "tv_grab_de_tvtoday");
    926933
  • channelsettings.cpp

     
    167167    };
    168168};
    169169
    170 class OnAirGuide: public CheckBoxSetting, public CSetting {
    171 public:
    172     OnAirGuide(const ChannelID& id):
    173         CheckBoxSetting(), CSetting(id, "useonairguide") {
    174         setLabel(QObject::tr("Use on air guide"));
    175         setHelpText(QObject::tr("If set the guide information will be taken "
    176                     "from the On Air Channel guide."));
    177     };
    178 };
    179 
    180170/*****************************************************************************
    181171        Channel Options - Video 4 Linux
    182172 *****************************************************************************/
     
    274264    addChild(new VideoFilters(id));
    275265    addChild(new OutputFilters(id));
    276266
    277 #ifdef USING_DVB_EIT
    278     HorizontalConfigurationGroup *bottomhoz = new HorizontalConfigurationGroup(false,true);
    279     bottomhoz->addChild(onairguide = new OnAirGuide(id));
    280     bottomhoz->addChild(xmltvID = new XmltvID(id));
    281     addChild(bottomhoz);
    282 
    283     connect(onairguide,SIGNAL(valueChanged(bool)),this,SLOT(onAirGuideChanged(bool)));
     267    addChild(xmltvID = new XmltvID(id));
    284268    connect(source,SIGNAL(valueChanged(const QString&)),this,SLOT(sourceChanged(const QString&)));
    285 #else
    286     addChild(new XmltvID(id));
    287 #endif
    288269};
    289270
    290271void ChannelOptionsCommon::load()
     
    292273    VerticalConfigurationGroup::load();
    293274}
    294275
    295 void ChannelOptionsCommon::onAirGuideChanged(bool fValue)
    296 {
    297     (void)fValue;
    298 #ifdef USING_DVB
    299     xmltvID->setEnabled(!fValue);
    300 #endif
    301 }
    302 
    303276void ChannelOptionsCommon::sourceChanged(const QString& str)
    304277{
    305278    (void)str;
    306279#ifdef USING_DVB
    307280
    308281    bool fDVB =false;
     282    bool fOnAirGuide = false;
    309283
    310284    MSqlQuery query(MSqlQuery::InitCon());
    311285
     
    323297    {
    324298        query.next();
    325299        if (query.value(0).toInt())
    326            fDVB = true;
     300        {
     301            fDVB = true;
     302            query.prepare("SELECT xmltvgrabber FROM videosource WHERE "
     303                          "videosource.sourceid = :SOURCEID ");
     304            query.bindValue(":SOURCEID", str);
     305            if (query.exec() && query.isActive() && query.size() > 0)
     306            {
     307                query.next();
     308                if (query.value(0).toString() == "onairguide")
     309                   fOnAirGuide = true;
     310            }
     311        }
    327312    }
    328313    if (fDVB)
    329     {
    330        onairguide->setEnabled(true);
    331        xmltvID->setEnabled(!onairguide->boolValue());
    332     }
     314       xmltvID->setEnabled(!fOnAirGuide);
    333315    else
    334     {
    335        onairguide->setEnabled(false);
    336316       xmltvID->setEnabled(true);
    337     }
    338317#endif
    339318}
    340319
  • eithelper.cpp

     
    145145    // linkage to chanid is different than DVB
    146146    if (event.ATSC)
    147147    {
    148         query.prepare(QString("SELECT chanid, useonairguide FROM channel "
     148        query.prepare(QString("SELECT chanid, xmltvgrabber "
     149                              "FROM channel, videosource "
    149150                              "WHERE atscsrcid = %1 AND mplexid = %2")
    150151                      .arg(event.ServiceID)
    151152                      .arg(mplexid));
     
    153154    else
    154155    {
    155156        /* DVB Link to chanid */
    156         query.prepare(QString("SELECT chanid, useonairguide "
    157                               "FROM channel, dtv_multiplex "
     157        query.prepare(QString("SELECT chanid, xmltvgrabber "
     158                              "FROM channel, videosource, dtv_multiplex "
    158159                              "WHERE serviceid = %1 AND "
    159160                              "      networkid = %2 AND "
    160161                              "      channel.mplexid = dtv_multiplex.mplexid")
     
    173174        return -1;
    174175    }
    175176
    176     // Check to see if we are interseted in this channel
     177    // Check to see if we are interested in this channel
    177178    query.next();
    178     bool useOnAirGuide = query.value(1).toBool();
     179    bool useOnAirGuide = query.value(1).toString() == "onairguide";
    179180    return (useOnAirGuide) ? query.value(0).toInt() : -1;
    180181}
    181182
  • channelsettings.h

     
    108108    ChannelOptionsCommon(const ChannelID& id);
    109109    void load();
    110110public slots:
    111     void onAirGuideChanged(bool);
    112111    void sourceChanged(const QString&);
    113112
    114113protected: