eWindow: title change will now invalidate decoration.
[enigma2.git] / lib / python / Screens / Standby.py
1 from Screen import Screen
2 from Components.ActionMap import ActionMap
3 from Components.config import config
4 from enigma import *
5
6 class Standby(Screen):
7         def Power(self):
8                 print "leave standby"
9                 #set input to encoder
10                 eAVSwitch.getInstance().setInput(0)
11                 #start last played service
12                 #self.infobar.servicelist.zap()
13                 self.session.nav.playService(eServiceReference(config.tv.lastservice.value))
14                 
15                 #unmute adc
16                 self.leaveMute()
17                 #set brightness of lcd
18                 eDBoxLCD.getInstance().setLCDBrightness(config.lcd.bright.value * 20)
19                 #kill me
20                 self.close()
21
22         def setMute(self):
23                 if (eDVBVolumecontrol.getInstance().isMuted()):
24                         self.wasMuted = 1
25                         print "mute already active"
26                 else:   
27                         self.wasMuted = 0
28                         eDVBVolumecontrol.getInstance().volumeToggleMute()
29
30         def leaveMute(self):
31                 if self.wasMuted == 0:
32                         eDVBVolumecontrol.getInstance().volumeToggleMute()
33
34         def __init__(self, session, infobar):
35                 Screen.__init__(self, session)
36                 self.infobar = infobar
37                 print "enter standby"
38
39                 self["actions"] = ActionMap( [ "StandbyActions" ],
40                 {
41                         "power": self.Power
42                 })
43
44                 #mute adc
45                 self.setMute()
46                 #stop actual played dvb-service
47                 self.session.nav.stopService()
48                 #set input to vcr scart
49                 eAVSwitch.getInstance().setInput(1)
50                 #set lcd brightness to standby value
51                 eDBoxLCD.getInstance().setLCDBrightness(config.lcd.standby.value * 20)
52                 #clear lcd (servicename)
53                 setLCD("                             ")