show "Current Transponder" entry in ChannelSelection -> Satellites
authorAndreas Monzner <andreas.monzner@multimedia-labs.de>
Sun, 16 Sep 2007 09:45:09 +0000 (09:45 +0000)
committerAndreas Monzner <andreas.monzner@multimedia-labs.de>
Sun, 16 Sep 2007 09:45:09 +0000 (09:45 +0000)
 CVS: ----------------------------------------------------------------------

lib/dvb/db.cpp
lib/python/Screens/ChannelSelection.py

index bb29bcc..f3d4482 100644 (file)
@@ -1377,9 +1377,18 @@ RESULT parseExpression(ePtr<eDVBChannelQuery> &res, std::list<std::string>::cons
        }
        
        res->m_string = val;
-       res->m_int = atoi(val.c_str());
-//     res->m_channelid = eDVBChannelID(val);
-       
+
+       if (res->m_type == eDVBChannelQuery::tChannelID)
+       {
+               int ns, tsid, onid;
+               if (sscanf(val.c_str(), "%08x%04x%04x", &ns, &tsid, &onid) == 3)
+                       res->m_channelid = eDVBChannelID(eDVBNamespace(ns), eTransportStreamID(tsid), eOriginalNetworkID(onid));
+               else
+                       eDebug("couldn't parse channelid !! format should be hex NNNNNNNNTTTTOOOO (namespace, tsid, onid)");
+       }
+       else
+               res->m_int = atoi(val.c_str());
+
        return 0;
 }
 
index 3f3c4de..62949ed 100644 (file)
@@ -890,6 +890,17 @@ class ChannelSelectionBase(Screen):
                                                                        service_name = ("%d.%d" + h) % (orbpos / 10, orbpos % 10)
                                                        service.setName("%s - %s" % (service_name, service_type))
                                                        self.servicelist.addService(service)
+                                               cur_ref = self.session.nav.getCurrentlyPlayingServiceReference()
+                                               if cur_ref:
+                                                       pos = self.service_types.rfind(':')
+                                                       refstr = '%s (channelID == %08x%04x%04x) && %s ORDER BY name' %(self.service_types[:pos+1],
+                                                               cur_ref.getUnsignedData(4), # NAMESPACE
+                                                               cur_ref.getUnsignedData(2), # TSID
+                                                               cur_ref.getUnsignedData(3), # ONID
+                                                               self.service_types[pos+1:])
+                                                       ref = eServiceReference(refstr)
+                                                       ref.setName(_("Current Transponder"))
+                                                       self.servicelist.addService(ref)
                                                self.servicelist.finishFill()
                                                if prev is not None:
                                                        self.setCurrentSelection(prev)