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
17 #set brightness of lcd
18 config.lcd.bright.apply()
23 if (eDVBVolumecontrol.getInstance().isMuted()):
25 print "mute already active"
28 eDVBVolumecontrol.getInstance().volumeToggleMute()
31 if self.wasMuted == 0:
32 eDVBVolumecontrol.getInstance().volumeToggleMute()
34 def __init__(self, session):
35 Screen.__init__(self, session)
36 self.avswitch = AVSwitch()
40 self["actions"] = ActionMap( [ "StandbyActions" ],
47 #get currently playing service reference
48 self.prev_running_service = self.session.nav.getCurrentlyPlayingServiceReference()
49 #stop actual played dvb-service
50 self.session.nav.stopService()
51 #set input to vcr scart
52 self.avswitch.setInput("SCART")
53 #set lcd brightness to standby value
54 config.lcd.standby.apply()
55 self.onShow.append(self.__onShow)
56 self.onHide.append(self.__onHide)
57 self.onClose.append(self.__onClose)
60 if self.prev_running_service:
61 self.session.nav.playService(self.prev_running_service)
63 def createSummary(self):
74 class StandbySummary(Screen):
76 <screen position="0,0" size="132,64">
77 <widget source="global.CurrentTime" render="Label" position="0,0" size="132,64" font="Regular;40" halign="center">
78 <convert type="ClockToText" />
80 <widget source="session.RecordState" render="FixedLabel" text=" " position="0,0" size="132,64" zPosition="1" >
81 <convert type="ConfigEntryTest">config.usage.blinking_display_clock_during_recording,True,CheckSourceBoolean</convert>
82 <convert type="ConditionalShowHide">Blink</convert>
86 def __init__(self, session, parent):
87 Screen.__init__(self, session)
89 from enigma import quitMainloop, iRecordableService
90 from Screens.MessageBox import MessageBox
93 inTryQuitMainloop = False
95 class TryQuitMainloop(MessageBox):
96 def __init__(self, session, retvalue=1, timeout=-1, default_yes = True):
98 recordings = len(session.nav.getRecordings())
99 self.connected = False
102 next_rec_time = session.nav.RecordTimer.getNextRecordingTime()
103 if recordings or (next_rec_time > 0 and (next_rec_time - time()) < 360):
105 MessageBox.__init__(self, session, _("Recording(s) are in progress or coming up in few seconds... really shutdown now?"), type = MessageBox.TYPE_YESNO, timeout = timeout, default = default_yes)
107 MessageBox.__init__(self, session, _("Recording(s) are in progress or coming up in few seconds... really reboot now?"), type = MessageBox.TYPE_YESNO, timeout = timeout, default = default_yes)
111 MessageBox.__init__(self, session, _("Recording(s) are in progress or coming up in few seconds... really restart now?"), type = MessageBox.TYPE_YESNO, timeout = timeout, default = default_yes)
112 self.skinName = "MessageBox"
113 session.nav.record_event.append(self.getRecordEvent)
114 self.connected = True
115 self.onShow.append(self.__onShow)
116 self.onHide.append(self.__onHide)
118 self.skin = """<screen position="0,0" size="0,0"/>"""
119 Screen.__init__(self, session)
122 def getRecordEvent(self, recservice, event):
123 if event == iRecordableService.evEnd:
124 recordings = self.session.nav.getRecordings()
125 if not len(recordings): # no more recordings exist
126 rec_time = self.session.nav.RecordTimer.getNextRecordingTime()
127 if rec_time > 0 and (rec_time - time()) < 360:
128 self.initTimeout(360) # wait for next starting timer
131 self.close(True) # immediate shutdown
132 elif event == iRecordableService.evStart:
135 def close(self, value):
137 self.conntected=False
138 self.session.nav.record_event.remove(self.getRecordEvent)
140 quitMainloop(self.retval)
142 MessageBox.close(self, True)
145 global inTryQuitMainloop
146 inTryQuitMainloop = True
149 global inTryQuitMainloop
150 inTryQuitMainloop = False