a133bce119f5e88b2fb2cac8f92c071d7f559417
[openblackhole/openblackhole-enigma2.git] / lib / python / Components / Renderer / VideoSize.py
1 from Components.VariableText import VariableText
2 from enigma import eLabel, iServiceInformation
3 from Renderer import Renderer
4
5 #
6 # borrowed from vali, addapter for openpli
7 #
8 class VideoSize(Renderer, VariableText):
9         def __init__(self):
10                 Renderer.__init__(self)
11                 VariableText.__init__(self)
12
13         GUI_WIDGET = eLabel
14
15         def changed(self, what):
16                 service = self.source.service
17                 info = service and service.info()
18                 if info is None:
19                         self.text = ""
20                         return
21                 xresol = info.getInfo(iServiceInformation.sVideoWidth)
22                 yresol = info.getInfo(iServiceInformation.sVideoHeight)
23                 if (xresol>0):
24                         self.text = str(xresol)+'x'+str(yresol)
25                 else:
26                         self.text = ''
27