1 from Source import Source
2 from Components.Element import cached
3 from enigma import iRecordableService
5 class RecordState(Source):
6 def __init__(self, session):
8 self.records_running = 0
10 session.nav.record_event.append(self.gotRecordEvent)
11 self.gotRecordEvent(None, None) # get initial state
13 def gotRecordEvent(self, service, event):
14 prev_records = self.records_running
15 if event in (iRecordableService.evEnd, iRecordableService.evStart, None):
16 recs = self.session.nav.getRecordings()
17 self.records_running = len(recs)
18 if self.records_running != prev_records:
19 self.changed((self.CHANGED_ALL,))
22 session.nav.record_event.remove(self.gotRecordEvent)
27 return self.records_running and True or False
28 boolean = property(getBoolean)
32 return self.records_running
33 value = property(getValue)