move polarization and orbital_position to eDVBFrontend::getTransponderData
authorghost <andreas.monzner@multimedia-labs.de>
Fri, 13 Feb 2009 12:02:57 +0000 (13:02 +0100)
committerghost <andreas.monzner@multimedia-labs.de>
Fri, 13 Feb 2009 12:02:57 +0000 (13:02 +0100)
lib/dvb/frontend.cpp
lib/dvb/frontend.h
lib/service/servicedvb.cpp

index e0291ec..5df1793 100644 (file)
@@ -961,14 +961,15 @@ void PutToDict(ePyObject &dict, const char*key, const char *value)
                eDebug("could not create PyObject for %s", key);
 }
 
                eDebug("could not create PyObject for %s", key);
 }
 
-void fillDictWithSatelliteData(ePyObject dict, const FRONTENDPARAMETERS &parm, eDVBFrontend *fe)
+void fillDictWithSatelliteData(ePyObject dict, const FRONTENDPARAMETERS &parm, long freq_offset, int orb_pos, int polarization)
 {
 {
-       long freq_offset=0;
        long tmp=0;
        long tmp=0;
-       fe->getData(eDVBFrontend::FREQ_OFFSET, freq_offset);
        int frequency = parm_frequency + freq_offset;
        PutToDict(dict, "frequency", frequency);
        PutToDict(dict, "symbol_rate", parm_u_qpsk_symbol_rate);
        int frequency = parm_frequency + freq_offset;
        PutToDict(dict, "frequency", frequency);
        PutToDict(dict, "symbol_rate", parm_u_qpsk_symbol_rate);
+       PutToDict(dict, "orbital_position", orb_pos);
+       PutToDict(dict, "polarization", polarization);
+
        switch(parm_u_qpsk_fec_inner)
        {
        case FEC_1_2: tmp = eDVBFrontendParametersSatellite::FEC_1_2; break;
        switch(parm_u_qpsk_fec_inner)
        {
        case FEC_1_2: tmp = eDVBFrontendParametersSatellite::FEC_1_2; break;
@@ -1224,7 +1225,7 @@ void eDVBFrontend::getTransponderData(ePyObject dest, bool original)
                                        switch(m_type)
                                        {
                                                case feSatellite:
                                        switch(m_type)
                                        {
                                                case feSatellite:
-                                                       fillDictWithSatelliteData(dest, original?parm:front, this);
+                                                       fillDictWithSatelliteData(dest, original?parm:front, m_data[FREQ_OFFSET], m_cur_orbpos, m_cur_pol);
                                                        break;
                                                case feCable:
                                                        fillDictWithCableData(dest, original?parm:front);
                                                        break;
                                                case feCable:
                                                        fillDictWithCableData(dest, original?parm:front);
@@ -1750,6 +1751,8 @@ RESULT eDVBFrontend::prepare_sat(const eDVBFrontendParametersSatellite &feparm,
                        feparm.fec,
                        feparm.orbital_position);
 #endif
                        feparm.fec,
                        feparm.orbital_position);
 #endif
+               m_cur_pol = feparm.polarisation;
+               m_cur_orbpos = feparm.orbital_position;
                parm_u_qpsk_symbol_rate = feparm.symbol_rate;
                switch (feparm.inversion)
                {
                parm_u_qpsk_symbol_rate = feparm.symbol_rate;
                switch (feparm.inversion)
                {
index 8133488..b6e3b6a 100644 (file)
@@ -84,6 +84,8 @@ private:
        char m_sec_filename[128];
 #endif
        FRONTENDPARAMETERS parm;
        char m_sec_filename[128];
 #endif
        FRONTENDPARAMETERS parm;
+       int m_cur_orbpos; // only valid when this is a DVB-S tuner
+       int m_cur_pol; // only valid when this is a DVB-S tuner
        int m_state;
        ePtr<iDVBSatelliteEquipmentControl> m_sec;
        ePtr<eSocketNotifier> m_sn;
        int m_state;
        ePtr<iDVBSatelliteEquipmentControl> m_sec;
        ePtr<eSocketNotifier> m_sn;
index 0f01b83..2cc9b79 100644 (file)
@@ -1855,20 +1855,7 @@ PyObject *eDVBServiceBase::getTransponderData(bool original)
                {
                        ePtr<iDVBFrontend> fe;
                        if(!channel->getFrontend(fe))
                {
                        ePtr<iDVBFrontend> fe;
                        if(!channel->getFrontend(fe))
-                       {
                                fe->getTransponderData(ret, original);
                                fe->getTransponderData(ret, original);
-                               ePtr<iDVBFrontendParameters> feparm;
-                               channel->getCurrentFrontendParameters(feparm);
-                               if (feparm)
-                               {
-                                       eDVBFrontendParametersSatellite osat;
-                                       if (!feparm->getDVBS(osat))
-                                       {
-                                               PutToDict(ret, "orbital_position", osat.orbital_position);
-                                               PutToDict(ret, "polarization", osat.polarisation);
-                                       }
-                               }
-                       }
                }
        }
        else
                }
        }
        else