generate 'changed'-events with event argument
[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
5 class CurrentService(PerServiceBase, Source):
6         def __init__(self, navcore):
7                 Source.__init__(self)
8                 PerServiceBase.__init__(self, navcore, 
9                         { 
10                                 iPlayableService.evStart: self.serviceEvent,
11                                 iPlayableService.evEnd: self.serviceEvent,
12                                 # FIXME: we should check 'interesting_events'
13                                 # which is not always provided.
14                                 iPlayableService.evUpdatedInfo: self.serviceEvent,
15                                 iPlayableService.evUpdatedEventInfo: self.serviceEvent,
16                                 iPlayableService.evCuesheetChanged: self.serviceEvent
17                         }, with_event=True)
18                 self.navcore = navcore
19
20         def serviceEvent(self, event):
21                 self.changed(event)
22
23         def getCurrentService(self):
24                 return self.navcore.getCurrentService()
25
26         service = property(getCurrentService)