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
13 self.avswitch.setInput("ENCODER")
14 #restart last played service
15 if self.prev_running_service:
16 self.session.nav.playService(self.prev_running_service)
19 #set brightness of lcd
20 config.lcd.bright.apply()
25 if (eDVBVolumecontrol.getInstance().isMuted()):
27 print "mute already active"
30 eDVBVolumecontrol.getInstance().volumeToggleMute()
33 if self.wasMuted == 0:
34 eDVBVolumecontrol.getInstance().volumeToggleMute()
36 def __init__(self, session):
37 Screen.__init__(self, session)
38 self.avswitch = AVSwitch()
42 self["actions"] = ActionMap( [ "StandbyActions" ],
49 #get currently playing service reference
50 self.prev_running_service = self.session.nav.getCurrentlyPlayingServiceReference()
51 #stop actual played dvb-service
52 self.session.nav.stopService()
53 #set input to vcr scart
54 self.avswitch.setInput("SCART")
55 #set lcd brightness to standby value
56 config.lcd.standby.apply()
57 self.onShow.append(self.__onShow)
58 self.onHide.append(self.__onHide)
60 def createSummary(self):
71 class StandbySummary(Screen):
73 <screen position="0,0" size="132,64">
74 <widget source="global.CurrentTime" render="Label" position="0,0" size="132,64" font="Regular;40" halign="center">
75 <convert type="ClockToText" />
77 <widget source="session.RecordState" render="FixedLabel" text=" " position="0,0" size="132,64" zPosition="1" >
78 <convert type="ConfigEntryTest">config.usage.blinking_display_clock_during_recording,True,CheckSourceBoolean</convert>
79 <convert type="ConditionalShowHide">Blink</convert>
83 def __init__(self, session, parent):
84 Screen.__init__(self, session)
86 from enigma import quitMainloop, iRecordableService
87 from Screens.MessageBox import MessageBox
90 inTryQuitMainloop = False
92 class TryQuitMainloop(MessageBox):
93 def __init__(self, session, retvalue=1, timeout=-1):
95 recordings = len(session.nav.getRecordings())
96 self.connected = False
99 next_rec_time = session.nav.RecordTimer.getNextRecordingTime()
100 if recordings or (next_rec_time > 0 and (next_rec_time - time()) < 360):
102 MessageBox.__init__(self, session, _("Recording(s) are in progress or coming up in few seconds... really shutdown now?"), type = MessageBox.TYPE_YESNO, timeout = timeout)
104 MessageBox.__init__(self, session, _("Recording(s) are in progress or coming up in few seconds... really reboot now?"), type = MessageBox.TYPE_YESNO, timeout = timeout)
108 MessageBox.__init__(self, session, _("Recording(s) are in progress or coming up in few seconds... really restart now?"), type = MessageBox.TYPE_YESNO, timeout = timeout)
109 self.skinName = "MessageBox"
110 session.nav.record_event.append(self.getRecordEvent)
111 self.connected = True
112 self.onShow.append(self.__onShow)
113 self.onHide.append(self.__onHide)
115 self.skin = """<screen position="0,0" size="0,0"/>"""
116 Screen.__init__(self, session)
119 def getRecordEvent(self, recservice, event):
120 if event == iRecordableService.evEnd:
121 recordings = self.session.nav.getRecordings()
122 if not len(recordings): # no more recordings exist
123 rec_time = self.session.nav.RecordTimer.getNextRecordingTime()
124 if rec_time > 0 and (rec_time - time()) < 360:
125 self.initTimeout(360) # wait for next starting timer
128 self.close(True) # immediate shutdown
129 elif event == iRecordableService.evStart:
132 def close(self, value):
134 self.conntected=False
135 self.session.nav.record_event.remove(self.getRecordEvent)
137 quitMainloop(self.retval)
139 MessageBox.close(self, True)
142 global inTryQuitMainloop
143 inTryQuitMainloop = True
146 global inTryQuitMainloop
147 inTryQuitMainloop = False