+ def addMarker(self, name):
+ current = self.servicelist.getCurrent()
+ mutableList = self.getMutableList()
+ cnt = 0
+ while mutableList:
+ str = '1:64:%d:0:0:0:0:0:0:0::%s'%(cnt, name)
+ ref = eServiceReference(str)
+ if current and current.valid():
+ if not mutableList.addService(ref, current):
+ self.servicelist.addService(ref, True)
+ mutableList.flushChanges()
+ break
+ elif not mutableList.addService(ref):
+ self.servicelist.addService(ref, True)
+ mutableList.flushChanges()
+ break
+ cnt+=1
+
+ def addAlternativeServices(self):
+ cur_service = ServiceReference(self.getCurrentSelection())
+ root = self.getRoot()
+ cur_root = root and ServiceReference(root)
+ mutableBouquet = cur_root.list().startEdit()
+ if mutableBouquet:
+ name = cur_service.getServiceName()
+ print "NAME", name
+ if self.mode == MODE_TV:
+ str = '1:134:1:0:0:0:0:0:0:0:FROM BOUQUET \"alternatives.%s.tv\" ORDER BY bouquet'%(self.buildBouquetID(name))
+ else:
+ str = '1:134:2:0:0:0:0:0:0:0:FROM BOUQUET \"alternatives.%s.radio\" ORDER BY bouquet'%(self.buildBouquetID(name))
+ new_ref = ServiceReference(str)
+ if not mutableBouquet.addService(new_ref.ref, cur_service.ref):
+ mutableBouquet.removeService(cur_service.ref)
+ mutableBouquet.flushChanges()
+ eDVBDB.getInstance().reloadBouquets()
+ mutableAlternatives = new_ref.list().startEdit()
+ if mutableAlternatives:
+ mutableAlternatives.setListName(name)
+ if mutableAlternatives.addService(cur_service.ref):
+ print "add", cur_service.toString(), "to new alternatives failed"
+ mutableAlternatives.flushChanges()
+ self.servicelist.addService(new_ref.ref, True)
+ self.servicelist.removeCurrent()
+ self.servicelist.moveUp()
+ else:
+ print "get mutable list for new created alternatives failed"
+ else:
+ print "add", str, "to", cur_root.getServiceName(), "failed"
+ else:
+ print "bouquetlist is not editable"
+
+ def addBouquet(self, bName, services):