Ticket #2074: dvb-default-input.patch
File dvb-default-input.patch, 4.6 KB (added by , 19 years ago) |
---|
-
libs/libmythtv/videosource.h
333 333 TunerCardInput *input; 334 334 }; 335 335 336 class TunerCardInput;336 class DVBInput; 337 337 class DVBCardName; 338 338 class DVBCardType; 339 339 class DVBTuningDelay; … … 343 343 public: 344 344 DVBConfigurationGroup(CaptureCard& a_parent); 345 345 346 virtual void load(); 347 virtual void save(); 348 346 349 public slots: 347 350 void probeCard(const QString& cardNumber); 348 351 void DiSEqCPanel(); 352 349 353 private: 350 354 CaptureCard &parent; 351 355 352 TunerCardInput*defaultinput;356 DVBInput *defaultinput; 353 357 DVBCardName *cardname; 354 358 DVBCardType *cardtype; 355 359 SignalTimeout *signal_timeout; 356 360 ChannelTimeout *channel_timeout; 357 361 TransButtonSetting *buttonAnalog; 358 362 DVBTuningDelay *tuning_delay; 363 DiSEqCDevTree tree; 359 364 }; 360 365 361 366 class CaptureCardGroup: public VerticalConfigurationGroup, … … 381 386 static void fillSelections(SelectSetting* setting); 382 387 static void fillSelections(SelectSetting* setting, bool no_children); 383 388 384 v irtual void save();385 389 void reload(void); 390 386 391 public slots: 387 void DiSEqCPanel();388 392 void analogPanel(); 389 393 void recorderOptionsPanel(); 390 394 391 395 private: 392 void reload(void);393 396 394 397 class ID: virtual public IntegerSetting, 395 398 public AutoIncrementStorage { … … 419 422 private: 420 423 ID *id; 421 424 ParentID *parentid; 422 DiSEqCDevTree tree;423 425 }; 424 426 425 427 class CardInput; -
libs/libmythtv/videosource.cpp
721 721 }; 722 722 }; 723 723 724 class 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 724 744 class DVBCardNum: public SpinBoxSetting, public CCSetting 725 745 { 726 746 public: … … 1313 1333 } 1314 1334 } 1315 1335 1316 void CaptureCard::save()1317 {1318 ConfigurationWizard::save();1319 #ifdef USING_DVB1320 tree.Store(getCardID());1321 DiSEqCDev trees;1322 trees.InvalidateTrees();1323 #endif1324 }1325 1326 1336 void CaptureCard::loadByID(int cardid) 1327 1337 { 1328 #ifdef USING_DVB1329 tree.Load(cardid);1330 #endif1331 1338 id->setValue(cardid); 1332 1339 load(); 1333 1340 } … … 2316 2323 advcfg->addChild(buttonRecOpt); 2317 2324 addChild(advcfg); 2318 2325 2319 TunerCardInput *defaultinput = new TunerCardInput(parent, "0", "DVB");2326 defaultinput = new DVBInput(parent); 2320 2327 addChild(defaultinput); 2321 2328 defaultinput->setVisible(false); 2322 2329 … … 2326 2333 2327 2334 connect(cardnum, SIGNAL(valueChanged(const QString&)), 2328 2335 this, SLOT( probeCard (const QString&))); 2329 connect(cardnum, SIGNAL(valueChanged (const QString&)),2330 defaultinput, SLOT( fillSelections(const QString&)));2331 2336 connect(buttonDiSEqC, SIGNAL(pressed()), 2332 &parent,SLOT( DiSEqCPanel()));2337 this, SLOT( DiSEqCPanel())); 2333 2338 connect(buttonAnalog, SIGNAL(pressed()), 2334 2339 &parent, SLOT( analogPanel())); 2335 2340 connect(buttonRecOpt, SIGNAL(pressed()), … … 2338 2343 cardnum->setValue(0); 2339 2344 } 2340 2345 2346 void 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 2357 void 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 2366 void 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 2341 2376 void CaptureCard::reload(void) 2342 2377 { 2343 2378 if (getCardID() == 0) … … 2377 2412 acw.exec(); 2378 2413 } 2379 2414 2380 void CaptureCard::DiSEqCPanel()2381 {2382 #ifdef USING_DVB2383 reload();2384 2385 DTVDeviceTreeWizard diseqcWiz(tree);2386 diseqcWiz.exec();2387 load();2388 #endif // USING_DVB2389 }2390 2391 2415 RecorderOptions::RecorderOptions(CaptureCard& parent) 2392 2416 { 2393 2417 VerticalConfigurationGroup* rec = new VerticalConfigurationGroup(false);