[InternetRadio] initial commit of InternetRadio plugin (with music-visualization...
[enigma2-plugins.git] / internetradio / src / InternetRadioInformationScreen.py
1 #
2 # InternetRadio E2
3 #
4 # Coded by Dr.Best (c) 2012
5 # Support: www.dreambox-tools.info
6 # E-Mail: dr.best@dreambox-tools.info
7 #
8 # This plugin is open source but it is NOT free software.
9 #
10 # This plugin may only be distributed to and executed on hardware which
11 # is licensed by Dream Multimedia GmbH.
12 # In other words:
13 # It's NOT allowed to distribute any parts of this plugin or its source code in ANY way
14 # to hardware which is NOT licensed by Dream Multimedia GmbH.
15 # It's NOT allowed to execute this plugin and its source code or even parts of it in ANY way
16 # on hardware which is NOT licensed by Dream Multimedia GmbH.
17 #
18 # If you want to use or modify the code or parts of it,
19 # you have to keep MY license and inform me about the modifications by mail.
20 #
21
22 from Screens.Screen import Screen
23 from Components.ActionMap import ActionMap
24 from Components.Label import Label
25 from Components.ScrollLabel import ScrollLabel
26 from Components.Sources.StaticText import StaticText
27 from enigma import getDesktop
28
29 class InternetRadioInformationScreen(Screen):
30
31         sz_w = getDesktop(0).size().width()
32         if sz_w == 1280:
33                 skin = """
34                         <screen name="InternetRadioInformationScreen" position="0,0" size="1280,720" flags="wfNoBorder" backgroundColor="#00000000" title="Streaming Information">
35
36                                 <ePixmap position="50,30" zPosition="4" size="140,40" pixmap="skin_default/buttons/red.png" transparent="1" alphatest="on" />
37                                 <ePixmap position="200,30" zPosition="4" size="140,40" pixmap="skin_default/buttons/green.png" transparent="1" alphatest="on" />
38                                 <ePixmap position="350,30" zPosition="4" size="140,40" pixmap="skin_default/buttons/yellow.png" transparent="1" alphatest="on" />
39                                 <ePixmap position="500,30" zPosition="4" size="140,40" pixmap="skin_default/buttons/blue.png" transparent="1" alphatest="on" />
40                                 <widget render="Label" source="key_red" position="50,30" size="140,40" zPosition="5" valign="center" halign="center" backgroundColor="red" font="Regular;21" transparent="1" foregroundColor="white" shadowColor="black" shadowOffset="-1,-1" />
41                                 <widget render="Label" source="headertext" position="50,77" zPosition="1" size="1180,26" font="Regular;22" transparent="1"  foregroundColor="#fcc000" backgroundColor="#00000000"/>
42                                 <widget name="text" position="50,120" size="1180,550" font="Regular;20" transparent="1"  backgroundColor="#00000000" />
43                         </screen>"""
44         elif sz_w == 1024:
45                 skin = """
46                         <screen name="InternetRadioInformationScreen" position="0,0" size="1024,576" flags="wfNoBorder" backgroundColor="#00000000" title="Streaming Information">
47                                 <ePixmap position="50,30" zPosition="4" size="140,40" pixmap="skin_default/buttons/red.png" transparent="1" alphatest="on" />
48                                 <ePixmap position="200,30" zPosition="4" size="140,40" pixmap="skin_default/buttons/green.png" transparent="1" alphatest="on" />
49                                 <ePixmap position="350,30" zPosition="4" size="140,40" pixmap="skin_default/buttons/yellow.png" transparent="1" alphatest="on" />
50                                 <ePixmap position="500,30" zPosition="4" size="140,40" pixmap="skin_default/buttons/blue.png" transparent="1" alphatest="on" />
51                                 <widget render="Label" source="key_red" position="50,30" size="140,40" zPosition="5" valign="center" halign="center" backgroundColor="red" font="Regular;21" transparent="1" foregroundColor="white" shadowColor="black" shadowOffset="-1,-1" />
52                                 <widget render="Label" source="headertext" position="50,77" zPosition="1" size="620,26" font="Regular;22" transparent="1"  foregroundColor="#fcc000" backgroundColor="#00000000"/>
53                                 <widget name="text" position="50,120" size="620,406" font="Regular;20" transparent="1"  foregroundColor="#fcc000" backgroundColor="#00000000" />
54                         </screen>"""
55         else:
56                 skin = """
57                         <screen name="InternetRadioInformationScreen" position="0,0" size="720,576" flags="wfNoBorder" backgroundColor="#00000000" title="Streaming Information">
58                                 <ePixmap position="50,30" zPosition="4" size="140,40" pixmap="skin_default/buttons/red.png" transparent="1" alphatest="on" />
59                                 <ePixmap position="210,30" zPosition="4" size="140,40" pixmap="skin_default/buttons/green.png" transparent="1" alphatest="on" />
60                                 <ePixmap position="370,30" zPosition="4" size="140,40" pixmap="skin_default/buttons/yellow.png" transparent="1" alphatest="on" />
61                                 <ePixmap position="530,30" zPosition="4" size="140,40" pixmap="skin_default/buttons/blue.png" transparent="1" alphatest="on" />
62                                 <widget render="Label" source="key_red" position="50,30" size="140,40" zPosition="5" valign="center" halign="center" backgroundColor="red" font="Regular;21" transparent="1" foregroundColor="white" shadowColor="black" shadowOffset="-1,-1" />
63                                 <widget render="Label" source="headertext" position="50,77" zPosition="1" size="620,26" font="Regular;22" transparent="1"  foregroundColor="#fcc000" backgroundColor="#00000000"/>
64                                 <widget name="text" position="50,120" size="620,406" font="Regular;20" transparent="1"  backgroundColor="#00000000" />
65                         </screen>"""
66
67         def __init__(self, session, meta):
68                 Screen.__init__(self, session)
69                 self["key_red"] = StaticText(_("Close"))
70                 self["headertext"] = StaticText(_("Streaming Information"))
71                 self["text"] =  ScrollLabel(meta)
72                 self["actions"] = ActionMap(["WizardActions", "DirectionActions", "ColorActions", "EPGSelectActions", "InfobarActions"],
73                 {
74                         "ok": self.close,
75                         "back": self.close,
76                         "red": self.close,
77                         "upUp": self.pageUp,
78                         "downUp": self.pageDown,
79                 }, -1)
80
81         def pageUp(self):
82                 self["text"].pageUp()
83
84         def pageDown(self):
85                 self["text"].pageDown()