Ticket #2074: dvb-default-input.patch

File dvb-default-input.patch, 4.6 KB (added by yeasah@…, 19 years ago)
  • libs/libmythtv/videosource.h

     
    333333    TunerCardInput    *input;
    334334};
    335335
    336 class TunerCardInput;
     336class DVBInput;
    337337class DVBCardName;
    338338class DVBCardType;
    339339class DVBTuningDelay;
     
    343343public:
    344344    DVBConfigurationGroup(CaptureCard& a_parent);
    345345
     346    virtual void load();
     347    virtual void save();
     348   
    346349public slots:
    347350    void probeCard(const QString& cardNumber);
    348 
     351    void DiSEqCPanel();
     352   
    349353private:
    350354    CaptureCard        &parent;
    351355
    352     TunerCardInput     *defaultinput;
     356    DVBInput           *defaultinput;
    353357    DVBCardName        *cardname;
    354358    DVBCardType        *cardtype;
    355359    SignalTimeout      *signal_timeout;
    356360    ChannelTimeout     *channel_timeout;
    357361    TransButtonSetting *buttonAnalog;
    358362    DVBTuningDelay     *tuning_delay;
     363    DiSEqCDevTree       tree;
    359364};
    360365
    361366class CaptureCardGroup: public VerticalConfigurationGroup,
     
    381386    static void fillSelections(SelectSetting* setting);
    382387    static void fillSelections(SelectSetting* setting, bool no_children);
    383388
    384     virtual void save();
    385    
     389    void reload(void);
     390
    386391public slots:
    387     void DiSEqCPanel();
    388392    void analogPanel();
    389393    void recorderOptionsPanel();
    390394
    391395private:
    392     void reload(void);
    393396
    394397    class ID: virtual public IntegerSetting,
    395398              public AutoIncrementStorage {
     
    419422private:
    420423    ID       *id;
    421424    ParentID *parentid;
    422     DiSEqCDevTree tree;
    423425};
    424426
    425427class CardInput;
  • libs/libmythtv/videosource.cpp

     
    721721   };
    722722};
    723723
     724class DVBInput: public ComboBoxSetting, public CCSetting
     725{
     726  public:
     727    DVBInput(const CaptureCard& parent)
     728      : CCSetting(parent, "defaultinput")
     729    {
     730        setLabel(QObject::tr("Default Input"));
     731        fillSelections(false);
     732    }
     733
     734    void fillSelections(bool diseqc)
     735    {
     736        clearSelections();
     737        if(diseqc)
     738            addSelection("DVBInput #1");
     739        else
     740            addSelection("DVBInput");
     741    }
     742};
     743
    724744class DVBCardNum: public SpinBoxSetting, public CCSetting
    725745{
    726746  public:
     
    13131333    }
    13141334}
    13151335
    1316 void CaptureCard::save()
    1317 {
    1318     ConfigurationWizard::save();
    1319 #ifdef USING_DVB
    1320     tree.Store(getCardID());
    1321     DiSEqCDev trees;
    1322     trees.InvalidateTrees();
    1323 #endif
    1324 }
    1325 
    13261336void CaptureCard::loadByID(int cardid)
    13271337{
    1328 #ifdef USING_DVB
    1329     tree.Load(cardid);
    1330 #endif
    13311338    id->setValue(cardid);
    13321339    load();
    13331340}
     
    23162323    advcfg->addChild(buttonRecOpt);
    23172324    addChild(advcfg);
    23182325
    2319     TunerCardInput *defaultinput = new TunerCardInput(parent, "0", "DVB");
     2326    defaultinput = new DVBInput(parent);
    23202327    addChild(defaultinput);
    23212328    defaultinput->setVisible(false);
    23222329
     
    23262333
    23272334    connect(cardnum,      SIGNAL(valueChanged(const QString&)),
    23282335            this,         SLOT(  probeCard   (const QString&)));
    2329     connect(cardnum,      SIGNAL(valueChanged  (const QString&)),
    2330             defaultinput, SLOT(  fillSelections(const QString&)));
    23312336    connect(buttonDiSEqC, SIGNAL(pressed()),
    2332             &parent,      SLOT(  DiSEqCPanel()));
     2337            this,         SLOT(  DiSEqCPanel()));
    23332338    connect(buttonAnalog, SIGNAL(pressed()),
    23342339            &parent,      SLOT(  analogPanel()));
    23352340    connect(buttonRecOpt, SIGNAL(pressed()),
     
    23382343    cardnum->setValue(0);
    23392344}
    23402345
     2346void DVBConfigurationGroup::DiSEqCPanel()
     2347{
     2348#ifdef USING_DVB
     2349    parent.reload(); // ensure card id is valid
     2350
     2351    DTVDeviceTreeWizard diseqcWiz(tree);
     2352    diseqcWiz.exec();
     2353    defaultinput->fillSelections(tree.Root() != NULL);
     2354#endif // USING_DVB
     2355}
     2356
     2357void DVBConfigurationGroup::load()
     2358{
     2359    VerticalConfigurationGroup::load();
     2360#ifdef USING_DVB
     2361    tree.Load(parent.getCardID());
     2362    defaultinput->fillSelections(tree.Root() != NULL);
     2363#endif
     2364}
     2365
     2366void DVBConfigurationGroup::save()
     2367{
     2368    VerticalConfigurationGroup::save();
     2369#ifdef USING_DVB
     2370    tree.Store(parent.getCardID());
     2371    DiSEqCDev trees;
     2372    trees.InvalidateTrees();
     2373#endif
     2374}
     2375
    23412376void CaptureCard::reload(void)
    23422377{
    23432378    if (getCardID() == 0)
     
    23772412    acw.exec();
    23782413}
    23792414
    2380 void CaptureCard::DiSEqCPanel()
    2381 {
    2382 #ifdef USING_DVB
    2383     reload();
    2384 
    2385     DTVDeviceTreeWizard diseqcWiz(tree);
    2386     diseqcWiz.exec();
    2387     load();
    2388 #endif // USING_DVB
    2389 }
    2390 
    23912415RecorderOptions::RecorderOptions(CaptureCard& parent)
    23922416{
    23932417    VerticalConfigurationGroup* rec = new VerticalConfigurationGroup(false);