Merge branch 'bug_271_ac3pcm_delay_servicemp3' into experimental
[enigma2.git] / lib / python / Components / Sources / TunerInfo.py
1 from Source import Source
2 from enigma import eDVBResourceManager
3
4 class TunerInfo(Source):
5         FE_USE_MASK = 0
6
7         def __init__(self):
8                 Source.__init__(self)
9                 self.tuner_use_mask = 0
10                 res_mgr = eDVBResourceManager.getInstance()
11                 if res_mgr:
12                         res_mgr.frontendUseMaskChanged.get().append(self.tunerUseMaskChanged)
13                 else:
14                         print "no res_mgr!!"
15
16         def tunerUseMaskChanged(self, mask):
17                 self.tuner_use_mask = mask
18                 self.changed((self.CHANGED_SPECIFIC, self.FE_USE_MASK))
19
20         def getTunerUseMask(self):
21                 return self.tuner_use_mask
22
23         def destroy(self):
24                 res_mgr = eDVBResourceManager.getInstance()
25                 if res_mgr:
26                         res_mgr.frontendUseMaskChanged.get().remove(self.tunerUseMaskChanged)
27                 else:
28                         print "no res_mgr!!"
29                 Source.destroy(self)