allow disable of service validation
[enigma2.git] / lib / python / Components / Sources / CurrentService.py
1 from Components.PerServiceDisplay import PerServiceBase
2 from enigma import iPlayableService
3 from Source import Source
4 from Components.Element import cached
5
6 from time import time
7
8 class CurrentService(PerServiceBase, Source):
9         def __init__(self, navcore):
10                 Source.__init__(self)
11                 PerServiceBase.__init__(self, navcore, 
12                         { 
13                                 iPlayableService.evStart: self.serviceEvent,
14                                 iPlayableService.evEnd: self.serviceEvent,
15                                 # FIXME: we should check 'interesting_events'
16                                 # which is not always provided.
17                                 iPlayableService.evUpdatedInfo: self.serviceEvent,
18                                 iPlayableService.evUpdatedEventInfo: self.serviceEvent,
19                                 iPlayableService.evCuesheetChanged: self.serviceEvent
20                         }, with_event=True)
21                 self.navcore = navcore
22
23         def serviceEvent(self, event):
24                 self.changed((self.CHANGED_SPECIFIC, event))
25
26         @cached
27         def getCurrentService(self):
28                 return self.navcore.getCurrentService()
29
30         service = property(getCurrentService)