+extern void PutToDict(ePyObject &dict, const char*key, long value); // defined in dvb/frontend.cpp
+extern void PutSatelliteDataToDict(ePyObject &dict, eDVBFrontendParametersSatellite &feparm); // defined in dvb/frontend.cpp
+extern void PutTerrestrialDataToDict(ePyObject &dict, eDVBFrontendParametersTerrestrial &feparm); // defined in dvb/frontend.cpp
+extern void PutCableDataToDict(ePyObject &dict, eDVBFrontendParametersCable &feparm); // defined in dvb/frontend.cpp
+
+PyObject *eStaticServiceDVBInformation::getInfoObject(const eServiceReference &r, int what)
+{
+ if (r.type == eServiceReference::idDVB)
+ {
+ const eServiceReferenceDVB &ref = (const eServiceReferenceDVB&)r;
+ switch(what)
+ {
+ case iServiceInformation::sTransponderData:
+ {
+ ePtr<eDVBResourceManager> res;
+ if (!eDVBResourceManager::getInstance(res))
+ {
+ ePtr<iDVBChannelList> db;
+ if (!res->getChannelList(db))
+ {
+ eDVBChannelID chid;
+ ref.getChannelID(chid);
+ ePtr<iDVBFrontendParameters> feparm;
+ if (!db->getChannelFrontendData(chid, feparm))
+ {
+ int system;
+ if (!feparm->getSystem(system))
+ {
+ ePyObject dict = PyDict_New();
+ switch(system)
+ {
+ case iDVBFrontend::feSatellite:
+ {
+ eDVBFrontendParametersSatellite s;
+ feparm->getDVBS(s);
+ PutSatelliteDataToDict(dict, s);
+ break;
+ }
+ case iDVBFrontend::feTerrestrial:
+ {
+ eDVBFrontendParametersTerrestrial t;
+ feparm->getDVBT(t);
+ PutTerrestrialDataToDict(dict, t);
+ break;
+ }
+ case iDVBFrontend::feCable:
+ {
+ eDVBFrontendParametersCable c;
+ feparm->getDVBC(c);
+ PutCableDataToDict(dict, c);
+ break;
+ }
+ default:
+ eDebug("unknown frontend type %d", system);
+ Py_DECREF(dict);
+ break;
+ }
+ return dict;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ Py_RETURN_NONE;
+}
+