add possibility to have multiple windowstyles. LCD can have different colors now.
[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 from time import time
6
7 class CurrentService(PerServiceBase, Source):
8         def __init__(self, navcore):
9                 Source.__init__(self)
10                 PerServiceBase.__init__(self, navcore, 
11                         { 
12                                 iPlayableService.evStart: self.serviceEvent,
13                                 iPlayableService.evEnd: self.serviceEvent,
14                                 # FIXME: we should check 'interesting_events'
15                                 # which is not always provided.
16                                 iPlayableService.evUpdatedInfo: self.serviceEvent,
17                                 iPlayableService.evUpdatedEventInfo: self.serviceEvent,
18                                 iPlayableService.evCuesheetChanged: self.serviceEvent
19                         }, with_event=True)
20                 self.navcore = navcore
21
22         def serviceEvent(self, event):
23                 self.changed((self.CHANGED_SPECIFIC, event))
24
25         def getCurrentService(self):
26                 if self.cache is None:
27                         self.cache = self.navcore.getCurrentService()
28                 return self.cache
29
30         service = property(getCurrentService)