[mythtv] Begun to write code - Need help

Giuliano Montecarlo gggiuly at googlemail.com
Thu Nov 17 18:08:40 EST 2005


Hi,
I've started today to try writing something for MythTV, so I begun to
write support for various satellites in DVB-S (actual only thous which
are provided by linuxtv.org-apps, but later I could implent more). So
what I actual did is this:
--SNIP--
Index: libs/libmythtv/scanwizardhelpers.h
===================================================================
--- libs/libmythtv/scanwizardhelpers.h  (revision 7901)
+++ libs/libmythtv/scanwizardhelpers.h  (working copy)
@@ -538,6 +538,35 @@
     };
 };

+class ScanSatellite: public ComboBoxSetting, public TransientStorage
+{
+  public:
+    ScanSatellite()
+    {
+        addSelection(QObject::tr("Custom"), "custom", true);
+        addSelection("AsiaSat 3S_C 103.5E");
+        addSelection("Astra 19.2E");
+        addSelection("Astra 23.2E");
+        addSelection("Hispasat 30.0W");
+        addSelection("Hotbird 13.0E");
+        addSelection("Otpus C1 156.0E");
+        addSelection("PAS 43.0W");
+        addSelection("Sirius 5.0E");
+        addSelection("Telecom2 8.0W");
+        addSelection("Telestar12 15.0W");
+        addSelection("Thor 1.0W");
+        addSelection("Turksat 42.0E");
+        setLabel(QObject::tr("Satellite"));
+        setHelpText(QObject::tr(
+                        "A list of satellites"));
+    }
+
+  public slots:
+    void setCustom(const QString &Unused) {
+      setValue(0);
+    }
+};
+
 class OFDMPane : public HorizontalConfigurationGroup
 {
   public:
@@ -559,6 +588,7 @@
         right->addChild(phierarchy      = new ScanHierarchy());
         addChild(left);
         addChild(right);
+        psatellite->setValue(2);
     }

     QString frequency()      { return pfrequency->getValue(); }
@@ -593,13 +623,30 @@
             new VerticalConfigurationGroup(false,true);
         VerticalConfigurationGroup *right =
             new VerticalConfigurationGroup(false,true);
+        left->addChild(psatellite  = new ScanSatellite());
         left->addChild(pfrequency  = new ScanFrequency());
-        left->addChild(ppolarity   = new ScanPolarity());
         left->addChild(psymbolrate = new ScanSymbolRate());
         right->addChild(pfec       = new ScanFec());
+        right->addChild(ppolarity  = new ScanPolarity());
         right->addChild(pinversion = new ScanInversion());
         addChild(left);
         addChild(right);
+
+/*  DOES NOT WORK
+        connect(pfrequency, SIGNAL(valueChanged(const QString&)),
+            psatellite, SLOT(setCustom(const QString&)));
+        connect(psymbolrate, SIGNAL(valueChanged(const QString&)),
+            psatellite, SLOT(setCustom(const QString&)));
+        connect(pfec, SIGNAL(valueChanged(const QString&)),
+            psatellite, SLOT(setCustom(const QString&)));
+        connect(ppolarity, SIGNAL(valueChanged(const QString&)),
+            psatellite, SLOT(setCustom(const QString&)));
+        connect(pinversion, SIGNAL(valueChanged(const QString&)),
+            psatellite, SLOT(setCustom(const QString&)));
+        connect(psatellite, SIGNAL(selectionAdded(const QString&, QString)),
+               pfrequency, SLOT(setValue(const QString&)));
+*/
+
     }

     QString frequency()  { return pfrequency->getValue(); }
@@ -614,6 +661,7 @@
     ScanInversion  *pinversion;
     ScanFec        *pfec;
     ScanPolarity   *ppolarity;
+    ScanSatellite  *psatellite;
 };

 class QAMPane : public HorizontalConfigurationGroup
--SNAP--

Now I want to connect pinversion, pfec, ppolarity, psymbolrate and
pfrequency with psatellite, so whenever one of them is changed,
psatellite switched to "Custom".
If somebody helps me out here, I could do the rest my own, while it's
not that hard as those slots/signals.

Regards,
GAM


More information about the mythtv-dev mailing list