Ticket #683: satellite.diff

File satellite.diff, 3.3 KB (added by Giuliano A. Montecarlo, 18 years ago)

Patch for ScanSatellite?

  • libs/libmythtv/scanwizardhelpers.h

     
    538538    };
    539539};
    540540
     541class ScanSatellite: public ComboBoxSetting, public TransientStorage
     542{
     543  public:
     544    ScanSatellite()
     545    {
     546        addSelection(QObject::tr("custom"),"custom",true);
     547        addSelection("Astra 19.2E", "astra192");
     548        addSelection("Astra 28.2E", "astra282");
     549        addSelection("Hotbird 13.0E", "hotbird");
     550        setLabel(QObject::tr("Satellite"));
     551        setHelpText(QObject::tr(
     552                                "Default Satellites"));
     553    }
     554   
     555    QString frequency() {
     556        if(getValue() == "astra192") return "12551500";
     557        if(getValue() == "astra282") return "10773000";
     558        if(getValue() == "hotbird")  return "12539000";
     559    }
     560
     561    QString symbolrate() {
     562        if(getValue() == "astra192" || getValue() == "astra282")
     563            return "22000000";
     564        if(getValue() == "hotbird") return "27500000";
     565    }
     566 
     567    QString inversion() {
     568      return "auto";
     569    }
     570   
     571    QString fec() {
     572        return "auto";
     573    }
     574
     575    QString polarity() {
     576      if(getValue() == "astra192") return "v";
     577      if(getValue() == "astra282" || getValue() == "hotbird") return "h";
     578    }
     579};
     580
    541581class OFDMPane : public HorizontalConfigurationGroup
    542582{
    543583  public:
     
    594634        VerticalConfigurationGroup *right =
    595635            new VerticalConfigurationGroup(false,true);
    596636        left->addChild(pfrequency  = new ScanFrequency());
    597         left->addChild(ppolarity   = new ScanPolarity());
     637        left->addChild(psatellite  = new ScanSatellite()); 
    598638        left->addChild(psymbolrate = new ScanSymbolRate());
    599639        right->addChild(pfec       = new ScanFec());
     640        right->addChild(ppolarity  = new ScanPolarity());
    600641        right->addChild(pinversion = new ScanInversion());
    601642        addChild(left);
    602643        addChild(right);     
    603644    }
    604645
    605     QString frequency()  { return pfrequency->getValue(); }
    606     QString symbolrate() { return psymbolrate->getValue(); }
    607     QString inversion()  { return pinversion->getValue(); }
    608     QString fec()        { return pfec->getValue(); }
    609     QString polarity()   { return ppolarity->getValue(); }
     646    QString frequency()  {
     647        if(psatellite->getValue() != "custom") return pfrequency->getValue();
     648        return psatellite->frequency();
     649    }
     650    QString symbolrate() {
     651        if(psatellite->getValue() != "custom") return psymbolrate->getValue();
     652        return psatellite->symbolrate();
     653    }
     654    QString inversion()  {
     655        if(psatellite->getValue() != "custom") return pinversion->getValue();
     656        return psatellite->inversion();
     657    }
     658    QString fec()        {
     659        if(psatellite->getValue() != "custom") return pfec->getValue();
     660        return psatellite->fec();
     661    }
     662    QString polarity()   {
     663        if(psatellite->getValue() != "custom") return ppolarity->getValue();
     664        return psatellite->polarity();
     665    }
    610666
    611667  protected:
    612668    ScanFrequency  *pfrequency;
     
    614670    ScanInversion  *pinversion;
    615671    ScanFec        *pfec;
    616672    ScanPolarity   *ppolarity;
     673    ScanSatellite  *psatellite;
    617674};
    618675
    619676class QAMPane : public HorizontalConfigurationGroup