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