def gotRecordEvent(self, service, event): recs = self.session.nav.getRecordings() nrecs = len(recs) if nrecs > 0: # set rec symbol evfd.getInstance().vfd_set_icon(0x1E, 1) else: evfd.getInstance().vfd_set_icon(0x1E, 0)
def __init__(self, session): Screen.__init__(self, session) list = [] # list.append(("Titel", "nothing", "entryID", "weight")) list.append((_("Global Settings"), "MCS_GlobalSettings", "menu_globalsettings", "50")) list.append((_("Global Settings"), "MCS_GlobalSettings", "menu_globalsettings", "50")) list.append((_("Skin Selector"), "MCS_SkinSelector", "menu_skinselector", "50")) list.append((_("Screen Adjustment"), "MCS_ScreenAdjustment", "menu_screenadjustment", "50")) list.append(("Exit", "MCS_Exit", "menu_exit", "50")) self["menu"] = List(list) self["left"] = Pixmap() self["middle"] = Pixmap() self["right"] = Pixmap() self["text"] = Label(_("Global Settings")) self["actions"] = ActionMap( ["OkCancelActions", "DirectionActions"], { "cancel": self.Exit, "ok": self.okbuttonClick, "right": self.next, "down": self.next, "up": self.prev, "left": self.prev, }, -1, ) if config.plugins.mc_global.vfd.value == "on": evfd.getInstance().vfd_write_string(_("Global Settings"))
def showMp3(self): if config.plugins.VFD.icons.value == 'all' : print "[showMp3]" if self.mp3Available: evfd.getInstance().vfd_set_icon(0x15,1) else: evfd.getInstance().vfd_set_icon(0x15,0)
def Settings(self): evfd.getInstance().vfd_write_string("SETTINGS") system("stfbcontrol a 255") self.ThumbTimer.stop() self.session.open(AudioPlayerSettings) config.plugins.EVOMC_ap.save() config.plugins.EVOMC_all.save()
def KeyOk(self): system("stfbcontrol a 255") system("echo 3 -> /dev/ttyAS1") self.filelist.refresh() if self.isVisible == False: self.visibility() return # self.ThumbTimer.stop() self.DimmerTimer.stop() if self.filelist.canDescent(): self.filelist.descent() else: evfd.getInstance().vfd_write_string("PLAY") if self.filelist.getServiceRef().type == 4098: ServiceRef = self.filelist.getServiceRef() extension = ServiceRef.getPath()[ServiceRef.getPath().rfind(".") + 1 :] if self.playlistparsers.has_key(extension): playlist = self.playlistparsers[extension]() list = playlist.open(ServiceRef.getPath()) for x in list: self.playlist.addFile(x.ref) self.playlist.updateList() else: self.playlist.addFile(self.filelist.getServiceRef()) self.playlist.updateList() currref = self.playlist.getServiceRefList()[self.playlist.getCurrentIndex()] print "currref !!!!!!!!!!!!!!!!!!!!!!!!!", currref self.session.open(MoviePlayer, currref)
def __eventInfoChanged(self): self.RecordingLed() if not BOX == 'gb800se' and not BOX == 'gb800solo' and not BOX == 'gb800seplus': return if config.plugins.VFD_Giga.showClock.value == 'Off' or config.plugins.VFD_Giga.showClock.value == 'True_All': return service = self.session.nav.getCurrentService() info = service and service.info() if info is None: chnr = "----" else: chnr = self.getchannelnr() info = None service = None if chnr == "----": if BOX == 'gb800seplus': vfd_write(chnr) else: evfd.getInstance().vfd_write_string(chnr) else: Channelnr = "%04d" % (int(chnr)) if BOX == 'gb800seplus': vfd_write(Channelnr) else: evfd.getInstance().vfd_write_string(Channelnr)
def __init__(self, session): Screen.__init__(self, session) self["key_blue"] = Button(_("Settings")) self["actions"] = ActionMap(["OkCancelActions", "DirectionActions", "ColorActions", "MovieSelectionActions", "MenuActions", "MoviePlayerActions", "ChannelSelectBaseActions"], { "cancel": self.Exit, "blue": self.WeatherSetup }, -1) self["CatTemp"] = Label("Temperatur:") self["CatPrecip"] = Label("Regenw.:") self["CatUVIndex"] = Label("UV-Index:") self["CatWind"] = Label("Windstaerke:") self["CatHumidity"] = Label("Luftfeuchtigkeit:") self["TodayPicture"] = Pixmap() self["TmrwPicture"] = Pixmap() self["TdatPicture"] = Pixmap() self["CurrentCity"] = Label("Updating Weather Info ...") self["TodayTemp"] = Label("") self["TodayPrecip"] = Label("") self["TodayWind"] = Label("") self["TodayUVIndex"] = Label("") self["TodayHumidity"] = Label("") self["TmrwTemp"] = Label("") self["TmrwPrecip"] = Label("") self["TmrwWind"] = Label("") self["TmrwUVIndex"] = Label("") self["TmrwHumidity"] = Label("") self["TdatTemp"] = Label("") self["TdatPrecip"] = Label("") self["TdatWind"] = Label("") self["TdatUVIndex"] = Label("") self["TdatHumidity"] = Label("") evfd.getInstance().vfd_write_string("NP-WEATHERINFO") self.onFirstExecBegin.append(self.GetWeatherInfo)
def writeChannelNumber(self): #print "[writeChannelNumber]" servicenumber = "0000" servicename = "" self.service = self.session.nav.getCurrentlyPlayingServiceReference() if not self.service is None: service = self.service.toCompareString() servicename = ServiceReference.ServiceReference(service).getServiceName().replace('\xc2\x87', '').replace('\xc2\x86', '').ljust(16) subservice = self.service.toString().split("::") if subservice[0].count(':') == 9: servicename = subservice[1].replace('\xc2\x87', '').replace('\xc3\x9f', 'ss').replace('\xc2\x86', '').ljust(16) else: servicename=servicename servicename=servicename.strip() if servicename in self.chlist: for idx in range(1, len(self.chlist)): if servicename == self.chlist[idx-1]: servicenumber = str(idx) break else: servicenumber = '----' #print "[VFD] channelname: " + servicename if len(servicenumber) == 1: servicenumber = '000' + servicenumber elif len(servicenumber) == 2: servicenumber = '00' + servicenumber elif len(servicenumber) == 3: servicenumber = '0' + servicenumber if self.LastVFDtext != servicenumber: evfd.getInstance().vfd_write_string(servicenumber) self.LastVFDtext = servicenumber
def createSetup(self): self.editListEntry = None self.list = [] self.list.append(getConfigListEntry(_("Enable led"), config.plugins.VFD_Giga.setLed)) if config.plugins.VFD_Giga.setLed.value: self.list.append(getConfigListEntry(_("Led state RUN"), config.plugins.VFD_Giga.ledRUN)) self.list.append(getConfigListEntry(_("Led state Standby"), config.plugins.VFD_Giga.ledSBY)) if not BOX == "gbquad" or BOX == "gb800ueplus" or BOX == "gb800seplus" or BOX == "gbquadplus": self.list.append(getConfigListEntry(_("Led state Deep Standby"), config.plugins.VFD_Giga.ledDSBY)) self.list.append(getConfigListEntry(_("Led state Record"), config.plugins.VFD_Giga.ledREC)) self.list.append(getConfigListEntry(_("Blink Record Led"), config.plugins.VFD_Giga.recLedBlink)) if BOX == "gbquad" or BOX == "gb800ueplus" or BOX == "gb800seplus" or BOX == "gbquadplus": setLed(config.plugins.VFD_Giga.ledRUN.getValue()) else: evfd.getInstance().vfd_led(str(config.plugins.VFD_Giga.ledRUN.value)) else: if BOX == "gbquad" or BOX == "gb800ueplus" or BOX == "gb800seplus" or BOX == "gbquadplus": setLed("0") else: evfd.getInstance().vfd_led("0") if BOX == 'gb800se' or BOX == 'gb800solo' or BOX == "gb800seplus": self.list.append(getConfigListEntry(_("Show on VFD"), config.plugins.VFD_Giga.showClock)) self.list.append(getConfigListEntry(_("Show clock in Deep Standby"), config.plugins.VFD_Giga.showClockDeepStandby)) if config.plugins.VFD_Giga.showClock.value != "Off" or config.plugins.VFD_Giga.showClockDeepStandby.value == "True": self.list.append(getConfigListEntry(_("Time mode"), config.plugins.VFD_Giga.timeMode)) self["config"].list = self.list self["config"].l.setList(self.list)
def keyOK(self): system("stfbcontrol a 255") config.plugins.EVOMC_ap.save() config.plugins.EVOMC_all.save() config.plugins.EVOMC_saver.save() evfd.getInstance().vfd_write_string("EVO-AUDIOPLAYER") self.close()
def showDolby(self): if config.plugins.VFD.icons.value == 'all' : print "[showDolby]" if self.dolbyAvailable: evfd.getInstance().vfd_set_icon(0x17,1) else: evfd.getInstance().vfd_set_icon(0x17,0)
def __evSeekableStatusChanged(self): if config.plugins.VFD.icons.value == 'all' : print "[__evSeekableStatusChanged]" if self.getSeekState(): evfd.getInstance().vfd_set_icon(0x1A,1) else: evfd.getInstance().vfd_set_icon(0x1A,0)
def vrime(self): self.RecordingLed() if not getBoxType() == 'gb800se' and not getBoxType() == 'gb800solo': self.zaPrik.start(self.updatetime, 1) return if (config.plugins.VFD_Giga.showClock.value == 'True' or config.plugins.VFD_Giga.showClock.value == 'False' or config.plugins.VFD_Giga.showClock.value == 'True_Switch') and not Screens.Standby.inStandby: if config.plugins.VFD_Giga.showClock.value == 'True_Switch': if time() >= self.begin: self.endkeypress = False if self.endkeypress: self.__eventInfoChanged() else: self.prikaz() else: self.__eventInfoChanged() if config.plugins.VFD_Giga.showClock.value == 'Off': evfd.getInstance().vfd_write_string(" ") self.zaPrik.start(self.updatetime, 1) return else: self.zaPrik.start(1000, 1) if Screens.Standby.inStandby or config.plugins.VFD_Giga.showClock.value == 'True_All': self.prikaz()
def __eventInfoChanged(self): self.RecordingLed() if not getBoxType() == 'gb800se' and not getBoxType() == 'gb800solo': return if config.plugins.VFD_Giga.showClock.value == 'Off' or config.plugins.VFD_Giga.showClock.value == 'True_All': return service = self.session.nav.getCurrentService() info = service and service.info() if info is None: chnr = "---" else: chnr = self.getchannelnr() info = None service = None ########## Center Channel number ################# t = len(chnr) if t == 1: CentChnr = " 0" + chnr + " " + '\n' elif t == 2: CentChnr = " " + chnr + " " + '\n' elif t == 3: CentChnr = "0" + chnr + '\n' else: CentChnr = chnr + '\n' ################################################# evfd.getInstance().vfd_write_string(CentChnr)
def LanIcon(self): if Screens.Standby.inStandby: evfd.getInstance().vfd_symbol_network(0) else: if config.plugins.ini_vfd.lan_icon.value: self.getLinkState("eth0") else: evfd.getInstance().vfd_symbol_network(0)
def newConfig(self): if self["config"].getCurrent()[0] == 'Enable led': self.ledenable = config.plugins.VFD_Giga.setLed.value self.createSetup() if self["config"].getCurrent()[0][:3] == 'Led': evfd.getInstance().vfd_led(str(config.plugins.VFD_Giga.ledRUN.value)) if self["config"].getCurrent()[0] == 'Show clock': self.createSetup()
def WriteStrig(self): if self.stringistime: self.stringistime = False string = self.servicename else: self.stringistime = True string = self.time evfd.getInstance().vfd_write_string(string)
def timerEvent(self): if config.plugins.vfdicon.displayshow.value == "clock" or DisplayType: tm = localtime() if DisplayType: self.displayHddUsed() if config.plugins.vfdicon.displayshow.value == "clock": servicename = strftime("%H%M", tm) evfd.getInstance().vfd_write_string(servicename[0:4]) self.timer.startLongTimer(60-tm.tm_sec)
def __evSeekableStatusChanged(self): service = self.session.nav.getCurrentService() if service: seek = service.seek() if seek: evfd.getInstance().vfd_set_icon(43, True) print "[VFD Display] Set Timeshift icon" else: evfd.getInstance().vfd_set_icon(43, False) print "[VFD Display] Disable Timeshift icon"
def WriteName(self): service = self.session.nav.getCurrentlyPlayingServiceOrGroup() if service: if service.getPath(): servicename = "PLAY" else: servicename = str(service.getChannelNum()) else: servicename = " " evfd.getInstance().vfd_write_string(servicename)
def LinkStatedataAvail(self,data): for item in data.splitlines(): if "Link detected:" in item: if "yes" in item: evfd.getInstance().vfd_symbol_network(1) else: evfd.getInstance().vfd_symbol_network(0) break else: print "unknown"
def __evVideoSizeChanged(self): print "[__evVideoSizeChanged]" service = self.session.nav.getCurrentService() if service is not None: info = service.info() height = info and info.getInfo(iServiceInformation.sVideoHeight) or -1 if height > 576: # set HD symbol evfd.getInstance().vfd_set_icon(0x11, 1) else: evfd.getInstance().vfd_set_icon(0x11, 0)
def newConfig(self): print self["config"].getCurrent()[0] if self["config"].getCurrent()[0] == _('Enable led'): self.createSetup() elif self["config"].getCurrent()[0][:3].upper() == 'LED': evfd.getInstance().vfd_led(config.plugins.VFD_Giga.ledRUN.value) elif self["config"].getCurrent()[0] == _('Show on VFD'): self.createSetup() elif self["config"].getCurrent()[0] == _('Show clock in Deep Standby'): self.createSetup()
def showCrypted(self): print "[showCrypted]" service = self.session.nav.getCurrentService() if service is not None: info = service.info() crypted = info and info.getInfo(iServiceInformation.sIsCrypted) or -1 if crypted == 1: # set crypt symbol evfd.getInstance().vfd_set_icon(0x13, 1) else: evfd.getInstance().vfd_set_icon(0x13, 0)
def __init__(self, session): Screen.__init__(self, session) HelpableScreen.__init__(self) # Show Background MVI #system("/usr/bin/showiframe /usr/lib/enigma2/python/Plugins/Extensions/EVOMediaCenter/icons/background.mvi &") self["key_red"] = Button("Favorites") self["key_green"] = Button("Slide Show") self["key_yellow"] = Button("Thumb View") self["key_blue"] = Button(_("Settings")) self["currentfolder"] = Label("") self["currentfavname"] = Label("") self.curfavfolder = -1 self["actions"] = HelpableActionMap(self, "EVOMC_PictureViewerActions", { "ok": (self.KeyOk, "Show Picture"), # "cancel": (self.Exit, "Exit Picture Viewer"), "left": (self.leftUp, "List Top"), "right": (self.rightDown, "List Bottom"), "up": (self.up, "List up"), "down": (self.down, "List down"), "menu": (self.KeyMenu, "File / Folder Options"), "info": (self.StartExif, "Show File Info"), "nextBouquet": (self.NextFavFolder, "Next Favorite Folder"), "prevBouquet": (self.PrevFavFolder, "Previous Favorite Folder"), "red": (self.FavoriteFolders, "Favorite Folders"), "green": (self.startslideshow, "Start Slideshow"), "yellow": (self.StartThumb, "Thumb View"), "blue": (self.Settings, "Settings"), }, -2) self["OkCancelActions"] = HelpableActionMap(self, "OkCancelActions", { "cancel": (self.Exit, "Exit Picture Viewer"), }, -2) self.aspect = getAspect() currDir = config.plugins.EVOMC_pp.lastDir.value if not pathExists(currDir): currDir = "/" self["currentfolder"].setText(str(currDir)) self.filelist = FileList(currDir, matchingPattern = "(?i)^.*\.(jpeg|jpg|jpe|png|bmp)") self["filelist"] = self.filelist self["thumbnail"] = Pixmap() evfd.getInstance().vfd_write_string("EVO-PICVIEWER") self.ThumbTimer = eTimer() self.ThumbTimer.callback.append(self.showThumb) self.ThumbTimer.start(500, True) self.picload = ePicLoad()
def vrime(self): self.RecordingLed() if config.plugins.VFD_Giga.showClock.value == 'Off': evfd.getInstance().vfd_write_string(" ") self.zaPrik.start(10000, 1) return else: self.zaPrik.start(1000, 1) if Screens.Standby.inStandby or config.plugins.VFD_Giga.showClock.value == 'True_All': self.prikaz()
def __evVideoSizeChanged(self): service = self.session.nav.getCurrentService() if service: info = service.info() height = info.getInfo(iServiceInformation.sVideoHeight) if height > 576: #set HD symbol evfd.getInstance().vfd_set_icon(14, True) print "[VFD Display] Set HD icon" else: evfd.getInstance().vfd_set_icon(14, False) print "[VFD Display] Disable HD icon"
def gotRecordEvent(self, service, event): if event in (iRecordableService.evEnd, iRecordableService.evStart, None): recs = len(self.session.nav.getRecordings()) if recs > 0: self.record = True evfd.getInstance().vfd_set_icon(7, True) print "[VFD Display] Set Rec icon" else: evfd.getInstance().vfd_set_icon(7, False) print "[VFD Display] Disable Rec icon" self.RecordEnd()
def controliniVFD(): global iniVFD global gReason global mySession if gReason == 0 and mySession != None and iniVFD == None: print "[VFD-INI] Starting !!" iniVFD = ini_vfd(mySession) elif gReason == 1 and iniVFD != None: print "[VFD-INI] Stopping !!" evfd.getInstance().vfd_symbol_network(0) iniVFD = None
def __init__(self, session): print "VFD_Giga initializing" self.session = session self.service = None self.onClose = [ ] self.Console = Console() evfd.getInstance().vfd_led(str(config.plugins.VFD_Giga.ledRUN.value)) global ChannelnumberInstance if ChannelnumberInstance is None: ChannelnumberInstance = Channelnumber(session)
def runScreenTest(): config.misc.startCounter.value += 1 profile("readPluginList") plugins.readPluginList(resolveFilename(SCOPE_PLUGINS)) profile("Init:Session") nav = Navigation( config.misc.isNextRecordTimerAfterEventActionAuto.getValue()) session = Session(desktop=enigma.getDesktop(0), summary_desktop=enigma.getDesktop(1), navigation=nav) CiHandler.setSession(session) screensToRun = [ p.__call__ for p in plugins.getPlugins(PluginDescriptor.WHERE_WIZARD) ] profile("wizards") screensToRun += wizardManager.getWizards() screensToRun.append((100, InfoBar.InfoBar)) screensToRun.sort() enigma.ePythonConfigQuery.setQueryFunc(configfile.getResolvedKey) # eDVBCIInterfaces.getInstance().setDescrambleRules(0 # Slot Number # ,( ["1:0:1:24:4:85:C00000:0:0:0:"], #service_list # ["PREMIERE"], #provider_list, # [] #caid_list # )); def runNextScreen(session, screensToRun, *result): if result: enigma.quitMainloop(*result) return screen = screensToRun[0][1] args = screensToRun[0][2:] if screensToRun: session.openWithCallback( boundFunction(runNextScreen, session, screensToRun[1:]), screen, *args) else: session.open(screen, *args) config.misc.epgcache_filename.addNotifier(setEPGCachePath) runNextScreen(session, screensToRun) profile("Init:VolumeControl") vol = VolumeControl(session) profile("Init:PowerKey") power = PowerKey(session) # we need session.scart to access it from within menu.xml session.scart = AutoScartControl(session) profile("Init:Trashcan") import Tools.Trashcan Tools.Trashcan.init(session) profile("RunReactor") profile_final() if getBoxType() == 'gb800se' or getBoxType() == 'gb800solo' or getBoxType( ) == 'gb800seplus': from enigma import evfd, eConsoleAppContainer try: cmd = 'vfdctl " openmips starting e2"' container = eConsoleAppContainer() container.execute(cmd) except: evfd.getInstance().vfd_write_string("-E2-") evfd.getInstance().vfd_led(str(1)) runReactor() config.misc.startCounter.save() profile("wakeup") try: from Plugins.SystemPlugins.VFDControl.plugin import SetTime SetTime() except: print "Failed SetTime from VFDControl !!" from time import time, strftime, localtime from Tools.StbHardware import setFPWakeuptime, getFPWakeuptime, setRTCtime #get currentTime nowTime = time() wakeupList = [ x for x in ((session.nav.RecordTimer.getNextRecordingTime(), 0, session.nav.RecordTimer.isNextRecordAfterEventActionAuto()), (session.nav.RecordTimer.getNextZapTime(), 1), (plugins.getNextWakeupTime(), 2)) if x[0] != -1 ] wakeupList.sort() recordTimerWakeupAuto = False if wakeupList: from time import strftime, altzone, timezone startTime = wakeupList[0] if (startTime[0] - nowTime) < 270: # no time to switch box back on wptime = nowTime + 30 # so switch back on in 30 seconds else: wptime = startTime[0] - 120 if not config.misc.useTransponderTime.value: print "dvb time sync disabled... so set RTC now to current linux time!", strftime( "%Y/%m/%d %H:%M", localtime(nowTime)) setRTCtime(nowTime) print "set wakeup time to", strftime("%Y/%m/%d %H:%M", localtime(wptime)) setFPWakeuptime(wptime) recordTimerWakeupAuto = startTime[1] == 0 and startTime[2] print 'recordTimerWakeupAuto', recordTimerWakeupAuto config.misc.isNextRecordTimerAfterEventActionAuto.value = recordTimerWakeupAuto config.misc.isNextRecordTimerAfterEventActionAuto.save() profile("stopService") session.nav.stopService() profile("nav shutdown") session.nav.shutdown() profile("configfile.save") configfile.save() from Screens import InfoBarGenerics InfoBarGenerics.saveResumePoints() return 0
def writeName(self): if config.plugins.vfdicon.displayshow.value != "date" and config.plugins.vfdicon.displayshow.value != "day_date": servicename = " " if config.plugins.vfdicon.displayshow.value != "nothing": service = self.session.nav.getCurrentlyPlayingServiceOrGroup() if service: path = service.getPath() if path: self.play = True servicename = "PLAY" currPlay = self.session.nav.getCurrentService() if currPlay != None and self.mp3Available: # show the MP3 tag servicename = currPlay.info().getInfoString( iServiceInformation.sTagTitle ) + " - " + currPlay.info().getInfoString( iServiceInformation.sTagArtist) Console().ePopen("fp_control -i 4 1 -i 3 0" ) #AUDIO icon on, DVB, VIDEO off else: # show the file name self.service = self.session.nav.getCurrentlyPlayingServiceReference( ) if not self.service is None: service = self.service.toCompareString() servicename = ServiceReference( service).getServiceName().replace( '\xc2\x87', '').replace('\xc2\x86', '').ljust(16) Console().ePopen( "fp_control -i 3 1 -i 4 0" ) #VIDEO icon on, DVB, AUDIO off Console().ePopen("fp_control -i 19 1") #play else: if config.plugins.vfdicon.displayshow.value == "channel number": #show the channel number servicename = str(service.getChannelNum()) if len(servicename) == 1: servicename = '000' + servicename elif len(servicename) == 2: servicename = '00' + servicename elif len(servicename) == 3: servicename = '0' + servicename elif config.plugins.vfdicon.displayshow.value == "channel namenumber": #show the channel number & name servicename = str(service.getChannelNum() ) + ' ' + ServiceReference( service).getServiceName() else: servicename = ServiceReference( service).getServiceName( ) #show the channel name Console().ePopen("fp_control -i 19 0") #play self.play = False #evaluate radio or tv if config.plugins.vfdicon.showicons.value == "all": if config.servicelist.lastmode.value == 'tv': Console().ePopen( "fp_control -i 3 1 -i 4 0" ) #DVB, VIDEO icon on, AUDIO off else: Console().ePopen( "fp_control -i 4 1 -i 3 0" ) #DVB, AUDIO icon on, VIDEO off if config.plugins.vfdicon.uppercase.value == True: servicename = servicename.upper() servicename = servicename.replace(' ', ' ') evfd.getInstance().vfd_write_string(servicename[0:63])
def writeName(self): displayshow = config.plugins.vfdicon.displayshow.value if displayshow != "time" and displayshow != "date" and displayshow != "day_date": servicename = " " if displayshow != "nothing": service = self.session.nav.getCurrentlyPlayingServiceOrGroup() if service: path = service.getPath() if path: self.play = True servicename = "PLAY" currPlay = self.session.nav.getCurrentService() if currPlay != None and self.mp3Available: # show the MP3 tag servicename = currPlay.info().getInfoString( iServiceInformation.sTagTitle ) + " - " + currPlay.info().getInfoString( iServiceInformation.sTagArtist) if DisplayType == 8: Console().ePopen("fp_control -i 28 1 -i 27 0" ) #Radio icon on, TV off else: # show the file name self.service = self.session.nav.getCurrentlyPlayingServiceReference( ) if not self.service is None: service = self.service.toCompareString() servicename = ServiceReference( service).getServiceName().replace( '\xc2\x87', '').replace('\xc2\x86', '').ljust(16) if DisplayType == 8: Console().ePopen("fp_control -i 27 1 -i 28 0" ) #TV icon on, Radio off if DisplayType == 8: Console().ePopen("fp_control -i 3 1") #play if config.plugins.vfdicon.hddicons.value == "no": self.displayHddUsedOff( ) #switch off signal strength else: if displayshow == "channel_number" or displayshow == "channel_namenumber": servicename = str(service.getChannelNum()) if len(servicename) == 1: servicename = '000' + servicename elif len(servicename) == 2: servicename = '00' + servicename elif len(servicename) == 3: servicename = '0' + servicename if displayshow == "channel_namenumber": servicename = servicename + ' ' + ServiceReference( service).getServiceName() if displayshow == "channel": servicename = ServiceReference( service).getServiceName() if DisplayType == 8: Console().ePopen("fp_control -i 3 0") #play self.play = False #evaluate radio or tv if config.plugins.vfdicon.showicons.value == "all": if config.servicelist.lastmode.value == 'tv': Console().ePopen( "fp_control -i 27 1 -i 28 0" ) #TV icon on, Radio off else: Console().ePopen( "fp_control -i 28 1 -i 27 0" ) #Radio icon on, TV off if config.plugins.vfdicon.uppercase.value is not None: servicename = servicename.upper() evfd.getInstance().vfd_write_string(servicename[0:63])
def __init__(self, session): self.session = session self.onClose = [] print('[ADBVFD] Start') self.tuned = False self.play = False self.record = False self.timeshift = False self.standby = False self.usb = 0 self.dolbyAvailable = False self.mp3Available = False # self.DTSAvailable = False self.display = 'led' try: self.adb_model = open("/proc/stb/info/adb_variant").read().strip() except: pass print('[ADBVFD] ADB variant:', self.adb_model) if self.adb_model == 'bsla' or self.adb_model == 'bzzb': self.display = 'vfd' self.timer = eTimer() self.timer.callback.append(self.timerEvent) self.timer.start(60000, False) # start one minute timer if self.display == 'vfd': Console().ePopen("fp_control -i 22 0") b = str(config.plugins.vfdicon.ledbright.value) Console().ePopen("fp_control -led " + b) global DisplayType print('[ADBVFD] Hardware displaytype:', DisplayType) print('[ADBVFD] VFD displaytype :', DisplayTypevfd) if DisplayType == 18: self.__event_tracker = ServiceEventTracker(screen = self, eventmap = { iPlayableService.evUpdatedInfo: self.UpdatedInfo, iPlayableService.evUpdatedEventInfo: self.__evUpdatedEventInfo, iPlayableService.evVideoSizeChanged: self.__evVideoSizeChanged, iPlayableService.evSeekableStatusChanged: self.__evSeekableStatusChanged, iPlayableService.evTunedIn: self.__evTunedIn, iPlayableService.evTuneFailed: self.__evTuneFailed, iPlayableService.evStart: self.__evStart }) config.misc.standbyCounter.addNotifier(self.onEnterStandby, initial_call = False) session.nav.record_event.append(self.gotRecordEvent) if self.display == 'vfd': try: from Plugins.SystemPlugins.Hotplug.plugin import hotplugNotifier hotplugNotifier.append(self.hotplugCB) except: pass else: self.__event_tracker = ServiceEventTracker(screen = self, eventmap = { iPlayableService.evStart: self.writeName, }) print('[ADBVFD] Set text scrolling option') if config.plugins.vfdicon.textscroll.value is not None: evfd.getInstance().vfd_set_SCROLL(int(config.plugins.vfdicon.textscroll.value)) else: evfd.getInstance().vfd_set_SCROLL(1) evfd.getInstance().vfd_set_CENTER(False) if self.display == 'vfd': print("[ADBVFD] Set text centering option") if config.plugins.vfdicon.textcenter.value == "1": evfd.getInstance().vfd_set_CENTER(True) print('[ADBVFD] End initialisation')
def runScreenTest(): config.misc.startCounter.value += 1 profile("readPluginList") plugins.readPluginList(resolveFilename(SCOPE_PLUGINS)) profile("Init:Session") nav = Navigation( config.misc.isNextRecordTimerAfterEventActionAuto.getValue(), config.misc.isNextPowerTimerAfterEventActionAuto.getValue()) session = Session(desktop=enigma.getDesktop(0), summary_desktop=enigma.getDesktop(1), navigation=nav) CiHandler.setSession(session) screensToRun = [ p.__call__ for p in plugins.getPlugins(PluginDescriptor.WHERE_WIZARD) ] profile("wizards") screensToRun += wizardManager.getWizards() screensToRun.append((100, InfoBar.InfoBar)) screensToRun.sort() enigma.ePythonConfigQuery.setQueryFunc(configfile.getResolvedKey) def runNextScreen(session, screensToRun, *result): if result: enigma.quitMainloop(*result) return screen = screensToRun[0][1] args = screensToRun[0][2:] if screensToRun: session.openWithCallback( boundFunction(runNextScreen, session, screensToRun[1:]), screen, *args) else: session.open(screen, *args) runNextScreen(session, screensToRun) profile("Init:VolumeControl") vol = VolumeControl(session) profile("Init:PowerKey") power = PowerKey(session) try: file = open("/proc/stb/info/boxtype", "r") model = file.readline().strip() file.close() except: model = "unknown" if enigma.getBoxType() == 'odinm9' or enigma.getBoxType( ) == 'ventonhdx' or enigma.getBoxType() == 'ebox5000' or enigma.getBoxType( ) == 'ixussone' or enigma.getBoxType( ) == 'ixusszero' or model == 'ini-1000ru' or model == 'ini-1000sv': profile("VFDSYMBOLS") import Components.VfdSymbols Components.VfdSymbols.SymbolsCheck(session) # we need session.scart to access it from within menu.xml session.scart = AutoScartControl(session) profile("Init:Trashcan") import Tools.Trashcan Tools.Trashcan.init(session) profile("Init:AutoVideoMode") import Screens.VideoMode Screens.VideoMode.autostart(session) profile("RunReactor") profile_final() if enigma.getBoxType() == 'gb800se' or enigma.getBoxType( ) == 'gb800solo' or enigma.getBoxType() == 'gb800seplus': from enigma import evfd, eConsoleAppContainer try: cmd = 'vfdctl " openatv starting e2"' container = eConsoleAppContainer() container.execute(cmd) except: evfd.getInstance().vfd_write_string("-E2-") evfd.getInstance().vfd_led(str(1)) if enigma.getBoxType() == 'odinm7' or enigma.getBoxType( ) == 'odinm6' or enigma.getBoxType() == 'xp1000s': f = open("/dev/dbox/oled0", "w") f.write('-E2-') f.close() print "lastshutdown=%s (True = last shutdown was OK)" % config.usage.shutdownOK.getValue( ) print "NOK shutdown action=%s" % config.usage.shutdownNOK_action.getValue() print "bootup action=%s" % config.usage.boot_action.getValue() if not config.usage.shutdownOK.getValue( ) and not config.usage.shutdownNOK_action.getValue( ) == 'normal' or not config.usage.boot_action.getValue() == 'normal': print "last shutdown = %s" % config.usage.shutdownOK.getValue() import Screens.PowerLost Screens.PowerLost.PowerLost(session) config.usage.shutdownOK.setValue(False) config.usage.shutdownOK.save() configfile.save() runReactor() print "normal shutdown" config.misc.startCounter.save() config.usage.shutdownOK.setValue(True) config.usage.shutdownOK.save() profile("wakeup") from time import time, strftime, localtime from Tools.StbHardware import setFPWakeuptime, getFPWakeuptime, setRTCtime #get currentTime nowTime = time() if not config.misc.SyncTimeUsing.getValue() == "0" or enigma.getBoxType( ).startswith('gb') or enigma.getBoxType().startswith('ini'): print "dvb time sync disabled... so set RTC now to current linux time!", strftime( "%Y/%m/%d %H:%M", localtime(nowTime)) setRTCtime(nowTime) wakeupList = [ x for x in ( (session.nav.RecordTimer.getNextRecordingTime(), 0, session.nav.RecordTimer.isNextRecordAfterEventActionAuto()), (session.nav.RecordTimer.getNextZapTime(), 1), (plugins.getNextWakeupTime(), 2), (session.nav.PowerTimer.getNextPowerManagerTime(), 3, session.nav.PowerTimer.isNextPowerManagerAfterEventActionAuto())) if x[0] != -1 ] wakeupList.sort() recordTimerWakeupAuto = False if wakeupList and wakeupList[0][1] != 3: from time import strftime startTime = wakeupList[0] if (startTime[0] - nowTime) < 270: # no time to switch box back on wptime = nowTime + 30 # so switch back on in 30 seconds else: if enigma.getBoxType().startswith("gb"): wptime = startTime[ 0] - 120 # Gigaboxes already starts 2 min. before wakeup time else: wptime = startTime[0] - 240 # if not config.misc.SyncTimeUsing.getValue() == "0" or enigma.getBoxType().startswith('gb'): # print "dvb time sync disabled... so set RTC now to current linux time!", strftime("%Y/%m/%d %H:%M", localtime(nowTime)) # setRTCtime(nowTime) print "set wakeup time to", strftime("%Y/%m/%d %H:%M", localtime(wptime)) setFPWakeuptime(wptime) recordTimerWakeupAuto = startTime[1] == 0 and startTime[2] print 'recordTimerWakeupAuto', recordTimerWakeupAuto config.misc.isNextRecordTimerAfterEventActionAuto.value = recordTimerWakeupAuto config.misc.isNextRecordTimerAfterEventActionAuto.save() PowerTimerWakeupAuto = False if wakeupList and wakeupList[0][1] == 3: from time import strftime startTime = wakeupList[0] if (startTime[0] - nowTime) < 60: # no time to switch box back on wptime = nowTime + 30 # so switch back on in 30 seconds else: if config.workaround.deeprecord.getValue(): wptime = startTime[ 0] - 240 # Gigaboxes already starts 2 min. before wakeup time else: wptime = startTime[0] # if not config.misc.SyncTimeUsing.getValue() == "0" or enigma.getBoxType().startswith('gb'): # print "dvb time sync disabled... so set RTC now to current linux time!", strftime("%Y/%m/%d %H:%M", localtime(nowTime)) # setRTCtime(nowTime) print "set wakeup time to", strftime("%Y/%m/%d %H:%M", localtime(wptime + 60)) setFPWakeuptime(wptime) PowerTimerWakeupAuto = startTime[1] == 3 and startTime[2] print 'PowerTimerWakeupAuto', PowerTimerWakeupAuto config.misc.isNextPowerTimerAfterEventActionAuto.value = PowerTimerWakeupAuto config.misc.isNextPowerTimerAfterEventActionAuto.save() profile("stopService") session.nav.stopService() profile("nav shutdown") session.nav.shutdown() profile("configfile.save") configfile.save() from Screens import InfoBarGenerics InfoBarGenerics.saveResumePoints() return 0
def timerEvent(self): if config.vfdicon.displayshow.value == "clock": tm=localtime() servicename = strftime("%H%M",tm) evfd.getInstance().vfd_write_string(servicename[0:17]) self.startTimer()
def __evSeekableStatusChanged(self): print "[__evSeekableStatusChanged]" if self.getSeekState(): evfd.getInstance().vfd_set_icon(0x1A,1) else: evfd.getInstance().vfd_set_icon(0x1A,0)
def showMp3(self): print "[showMp3]" if self.mp3Available: evfd.getInstance().vfd_set_icon(0x15,1) else: evfd.getInstance().vfd_set_icon(0x15,0)
def showDolby(self): print "[showDolby]" if self.dolbyAvailable: evfd.getInstance().vfd_set_icon(0x17,1) else: evfd.getInstance().vfd_set_icon(0x17,0)
def showInfo(self): print "[showInfo]" evfd.getInstance().vfd_write_string(self.tr_servicename) self.old_show = self.tr_servicename
def __evTuneFailed(self): print "[VFD Display] Tune Failed disable icons" evfd.getInstance().vfd_set_icon(44, False) evfd.getInstance().vfd_set_icon(14, False) evfd.getInstance().vfd_set_icon(43, False) evfd.getInstance().vfd_set_icon(29, True) evfd.getInstance().vfd_set_icon(25, False) evfd.getInstance().vfd_set_icon(26, False) evfd.getInstance().vfd_set_icon(42, False) evfd.getInstance().vfd_set_icon(37, False) evfd.getInstance().vfd_set_icon(45, False)
def __init__(self, session): self.session = session self.onClose = [] print '[VFD-Icons] Start' self.tuned = False self.play = False self.record = False self.timeshift = False self.standby = False self.usb = 0 self.dolbyAvailable = False self.mp3Available = False # self.DTSAvailable = False self.timer = eTimer() self.timer.callback.append(self.timerEvent) self.timer.start(60000, False) # start one minute timer Console().ePopen("fp_control -i 23 0") b = str(config.plugins.vfdicon.ledbright.value) c = str(config.plugins.vfdicon.crossbright.value) Console().ePopen("fp_control -l 0 0 -l 1 " + b + " -l 4 " + c + " -l 5 " + c + " -l 6 " + c + " -l 7 " + c) global DisplayType print '[VFD-Icons] Hardware displaytype:', DisplayType print '[VFD-Icons] VFD displaytype :', DisplayTypevfd if DisplayType == 5: self.__event_tracker = ServiceEventTracker( screen=self, eventmap={ iPlayableService.evUpdatedInfo: self.UpdatedInfo, iPlayableService.evUpdatedEventInfo: self.__evUpdatedEventInfo, iPlayableService.evVideoSizeChanged: self.__evVideoSizeChanged, iPlayableService.evSeekableStatusChanged: self.__evSeekableStatusChanged, iPlayableService.evTunedIn: self.__evTunedIn, iPlayableService.evTuneFailed: self.__evTuneFailed, iPlayableService.evStart: self.__evStart }) config.misc.standbyCounter.addNotifier(self.onEnterStandby, initial_call=False) session.nav.record_event.append(self.gotRecordEvent) try: from Plugins.SystemPlugins.Hotplug.plugin import hotplugNotifier hotplugNotifier.append(self.hotplugCB) except: pass else: self.__event_tracker = ServiceEventTracker( screen=self, eventmap={ iPlayableService.evStart: self.writeName, }) print '[VFD-Icons] Set text scrolling option' if config.plugins.vfdicon.textscroll.value is not None: evfd.getInstance().vfd_set_SCROLL( int(config.plugins.vfdicon.textscroll.value)) else: evfd.getInstance().vfd_set_SCROLL(1) print "[VFD-Icons] Set text centering option" if config.plugins.vfdicon.textcenter.value == "1": evfd.getInstance().vfd_set_CENTER(True) else: evfd.getInstance().vfd_set_CENTER(False) print '[VFD-Icons] End initialisation'
def markDone(self): self.hw.saveMode(self.port, self.mode, self.rate) config.misc.videowizardenabled.value = 0 config.misc.videowizardenabled.save() configfile.save() evfd.getInstance().vfd_write_string(" ")
def Exit(self): os.system("stfbcontrol a 255") evfd.getInstance().vfd_write_string("EVOMediaCenter") self.close()
def standbyCounterChanged(configElement): if HardwareInfo().get_device_name() == 'spark7162': Console().ePopen('/bin/fp_control -i 46 0' ) #akcja przez evfd generuje GS przy wychodzeniu evfd.getInstance().vfd_write_string(" ") print "standbyCounterChanged"
def opencfg(session, **kwargs): session.open(ConfigVFDDisplay) evfd.getInstance().vfd_write_string("VFD SETUP")
def __init__(self, session, retvalue=1, timeout=-1, default_yes=False): self.retval = retvalue recordings = session.nav.getRecordings() jobs = len(job_manager.getPendingJobs()) self.connected = False reason = "" next_rec_time = -1 if boxtype == 'gb800se' or boxtype == 'gb800solo' or boxtype == 'gb800ue': self.forled = readled() if self.forled[0] == 'True': self.ledenable = 1 evfd.getInstance().vfd_led(str(self.forled[2])) else: self.ledenable = 0 evfd.getInstance().vfd_led(str(0)) if not recordings: next_rec_time = session.nav.RecordTimer.getNextRecordingTime() if recordings or (next_rec_time > 0 and (next_rec_time - time()) < 360): reason = _( "Recording(s) are in progress or coming up in few seconds!" ) + '\n' if boxtype == 'gb800se' or boxtype == 'gb800solo' or boxtype == 'gb800ue': if self.ledenable == 1: evfd.getInstance().vfd_led(str(self.forled[3])) if jobs: if jobs == 1: job = job_manager.getPendingJobs()[0] reason += "%s: %s (%d%%)\n" % (job.getStatustext(), job.name, int(100 * job.progress / float(job.end))) else: reason += (_("%d jobs are running in the background!") % jobs) + '\n' if reason: text = { 1: _("Really shutdown now?"), 2: _("Really reboot now?"), 3: _("Really restart now?"), 4: _("Really upgrade the frontprocessor and reboot now?"), 42: _("Really upgrade your settop box and reboot now?") }.get(retvalue) if text: MessageBox.__init__(self, session, reason + text, type=MessageBox.TYPE_YESNO, timeout=timeout, default=default_yes) self.skinName = "MessageBox" session.nav.record_event.append(self.getRecordEvent) self.connected = True self.onShow.append(self.__onShow) self.onHide.append(self.__onHide) return self.skin = """<screen position="0,0" size="0,0"/>""" Screen.__init__(self, session) self.close(True)
def initVFD(): print "[VFD-INI] initVFD" evfd.getInstance().vfd_symbol_network(0) evfd.getInstance().vfd_symbol_circle(0)
from ServiceReference import ServiceReference from Components.ServiceList import ServiceList from enigma import iPlayableService, iServiceInformation, iRecordableService, eTimer, evfd, eDVBVolumecontrol, iFrontendInformation from time import localtime, strftime, sleep from Components.ServiceEventTracker import ServiceEventTracker from Components.Console import Console from os import statvfs from Components.ActionMap import ActionMap from Components.config import * from Components.ConfigList import ConfigList, ConfigListScreen from Components.Sources.StaticText import StaticText from Screens.Screen import Screen import os try: DisplayType = evfd.getInstance().getVfdType() if DisplayType != 8: DisplayType = None except: DisplayType = None DisplayTypevfd = DisplayType if DisplayTypevfd is None: DisplayType = 8 config.plugins.vfdicon = ConfigSubsection() config.plugins.vfdicon.displayshow = ConfigSelection( default="channel", choices=[("nothing", _("blank")), ("channel number", _("channel number")), ("channel", _("channel name")), ("channel namenumber", _("channel number and name")),
def runScreenTest(): config.misc.startCounter.value += 1 profile("readPluginList") plugins.readPluginList(resolveFilename(SCOPE_PLUGINS)) profile("Init:Session") nav = Navigation(config.misc.isNextRecordTimerAfterEventActionAuto.value, config.misc.isNextPowerTimerAfterEventActionAuto.value) session = Session(desktop=enigma.getDesktop(0), summary_desktop=enigma.getDesktop(1), navigation=nav) CiHandler.setSession(session) profile("wizards") screensToRun = [] RestoreSettings = None if os.path.exists("/media/hdd/images/config/settings" ) and config.misc.firstrun.value: if autorestoreLoop(): RestoreSettings = True from Plugins.SystemPlugins.SoftwareManager.BackupRestore import RestoreScreen session.open(RestoreScreen, runRestore=True) else: screensToRun = [ p.__call__ for p in plugins.getPlugins(PluginDescriptor.WHERE_WIZARD) ] screensToRun += wizardManager.getWizards() else: if os.path.exists("/media/hdd/images/config/autorestore"): os.system('rm -f /media/hdd/images/config/autorestore') screensToRun = [ p.__call__ for p in plugins.getPlugins(PluginDescriptor.WHERE_WIZARD) ] screensToRun += wizardManager.getWizards() screensToRun.append((100, InfoBar.InfoBar)) screensToRun.sort() print screensToRun enigma.ePythonConfigQuery.setQueryFunc(configfile.getResolvedKey) def runNextScreen(session, screensToRun, *result): if result: print "[mytest.py] quitMainloop #3" enigma.quitMainloop(*result) return screen = screensToRun[0][1] args = screensToRun[0][2:] if screensToRun: session.openWithCallback( boundFunction(runNextScreen, session, screensToRun[1:]), screen, *args) else: session.open(screen, *args) if not RestoreSettings: runNextScreen(session, screensToRun) profile("Init:VolumeControl") vol = VolumeControl(session) profile("Init:PowerKey") power = PowerKey(session) if boxtype in ('mixosf5', 'mixosf7', 'mixoslumi', 'gi9196m', 'maram9', 'ixussone', 'ixussone', 'uniboxhd1', 'uniboxhd2', 'uniboxhd3', 'sezam5000hd', 'mbtwin', 'sezam1000hd', 'mbmini', 'atemio5x00', 'beyonwizt3'): profile("VFDSYMBOLS") import Components.VfdSymbols Components.VfdSymbols.SymbolsCheck(session) # we need session.scart to access it from within menu.xml session.scart = AutoScartControl(session) profile("Init:Trashcan") import Tools.Trashcan Tools.Trashcan.init(session) profile("Init:AutoVideoMode") import Screens.VideoMode Screens.VideoMode.autostart(session) profile("RunReactor") profile_final() if boxtype in ('gb800se', 'gb800solo', 'gb800seplus'): from enigma import evfd, eConsoleAppContainer try: cmd = 'vfdctl " openatv starting e2"' container = eConsoleAppContainer() container.execute(cmd) except: evfd.getInstance().vfd_write_string("-E2-") evfd.getInstance().vfd_led(str(1)) if boxtype in ('sf8', 'classm', 'axodin', 'axodinc', 'starsatlx', 'genius', 'evo'): f = open("/dev/dbox/oled0", "w") f.write('-E2-') f.close() print "lastshutdown=%s (True = last shutdown was OK)" % config.usage.shutdownOK.value print "NOK shutdown action=%s" % config.usage.shutdownNOK_action.value print "bootup action=%s" % config.usage.boot_action.value if not config.usage.shutdownOK.value and not config.usage.shutdownNOK_action.value == 'normal' or not config.usage.boot_action.value == 'normal': print "last shutdown = %s" % config.usage.shutdownOK.value import Screens.PowerLost Screens.PowerLost.PowerLost(session) config.usage.shutdownOK.setValue(False) config.usage.shutdownOK.save() if not RestoreSettings: configfile.save() runReactor() print "[mytest.py] normal shutdown" config.misc.startCounter.save() config.usage.shutdownOK.setValue(True) config.usage.shutdownOK.save() profile("wakeup") #get currentTime nowTime = time() if not config.misc.SyncTimeUsing.value == "0" or boxtype.startswith( 'gb') or getBrandOEM().startswith('ini'): print "dvb time sync disabled... so set RTC now to current linux time!", strftime( "%Y/%m/%d %H:%M", localtime(nowTime)) setRTCtime(nowTime) wakeupList = [ x for x in ( (session.nav.RecordTimer.getNextRecordingTime(), 0, session.nav.RecordTimer.isNextRecordAfterEventActionAuto()), (session.nav.RecordTimer.getNextZapTime(), 1), (plugins.getNextWakeupTime(), 2), (session.nav.PowerTimer.getNextPowerManagerTime(), 3, session.nav.PowerTimer.isNextPowerManagerAfterEventActionAuto())) if x[0] != -1 ] wakeupList.sort() recordTimerWakeupAuto = False if wakeupList and wakeupList[0][1] != 3: startTime = wakeupList[0] if (startTime[0] - nowTime) < 270: # no time to switch box back on wptime = nowTime + 30 # so switch back on in 30 seconds else: if boxtype.startswith("gb"): wptime = startTime[ 0] - 120 # Gigaboxes already starts 2 min. before wakeup time else: wptime = startTime[0] - 240 # if not config.misc.SyncTimeUsing.value == "0" or boxtype.startswith('gb'): # print "dvb time sync disabled... so set RTC now to current linux time!", strftime("%Y/%m/%d %H:%M", localtime(nowTime)) # setRTCtime(nowTime) print "set wakeup time to", strftime("%Y/%m/%d %H:%M", localtime(wptime)) setFPWakeuptime(wptime) recordTimerWakeupAuto = startTime[1] == 0 and startTime[2] print 'recordTimerWakeupAuto', recordTimerWakeupAuto config.misc.isNextRecordTimerAfterEventActionAuto.value = recordTimerWakeupAuto config.misc.isNextRecordTimerAfterEventActionAuto.save() PowerTimerWakeupAuto = False if wakeupList and wakeupList[0][1] == 3: startTime = wakeupList[0] if (startTime[0] - nowTime) < 60: # no time to switch box back on wptime = nowTime + 30 # so switch back on in 30 seconds else: if config.workaround.deeprecord.value: wptime = startTime[ 0] - 240 # Gigaboxes already starts 2 min. before wakeup time else: wptime = startTime[0] # if not config.misc.SyncTimeUsing.value == "0" or getBrandOEM() == 'gigablue': # print "dvb time sync disabled... so set RTC now to current linux time!", strftime("%Y/%m/%d %H:%M", localtime(nowTime)) # setRTCtime(nowTime) print "set wakeup time to", strftime("%Y/%m/%d %H:%M", localtime(wptime + 60)) setFPWakeuptime(wptime) PowerTimerWakeupAuto = startTime[1] == 3 and startTime[2] print 'PowerTimerWakeupAuto', PowerTimerWakeupAuto config.misc.isNextPowerTimerAfterEventActionAuto.value = PowerTimerWakeupAuto config.misc.isNextPowerTimerAfterEventActionAuto.save() profile("stopService") session.nav.stopService() profile("nav shutdown") session.nav.shutdown() profile("configfile.save") configfile.save() from Screens import InfoBarGenerics InfoBarGenerics.saveResumePoints() return 0
def __init__(self, session): self.session = session self.onClose = [] print('[spark7162VFD] Start') self.tuned = False self.play = False self.record = False self.timeshift = False self.disc = 0 self.standby = False self.isMuted = False self.usb = 0 self.mp3Available = False self.dolbyAvailable = False self.DTSAvailable = False self.timer = eTimer() self.timer.callback.append(self.timerEvent) self.timer.start(60000, False) # start one minute timer Console().ePopen("fp_control -i 46 0") global DisplayType print('[spark7162VFD] Hardware displaytype:', DisplayType) print('[spark7162VFD] VFD displaytype :', DisplayTypevfd) if DisplayType == 8: self.__event_tracker = ServiceEventTracker( screen=self, eventmap={ iPlayableService.evUpdatedInfo: self.UpdatedInfo, iPlayableService.evUpdatedEventInfo: self.__evUpdatedEventInfo, iPlayableService.evVideoSizeChanged: self.__evVideoSizeChanged, iPlayableService.evSeekableStatusChanged: self.__evSeekableStatusChanged, iPlayableService.evTunedIn: self.__evTunedIn, iPlayableService.evTuneFailed: self.__evTuneFailed, iPlayableService.evStart: self.__evStart }) config.misc.standbyCounter.addNotifier(self.onEnterStandby, initial_call=False) session.nav.record_event.append(self.gotRecordEvent) try: from Plugins.SystemPlugins.Hotplug.plugin import hotplugNotifier hotplugNotifier.append(self.hotplugCB) except: pass self.dir = None self.mount = None self.firstmount = -1 global hddUsed hddUsed = -1 self.SetMount() if self.mount: self.firstmount = self.mount if self.standby == False: self.displayHddUsed() else: self.__event_tracker = ServiceEventTracker( screen=self, eventmap={ iPlayableService.evStart: self.writeName, }) print('[spark7162VFD] Set text scrolling option') if config.plugins.vfdicon.textscroll.value is not None: evfd.getInstance().vfd_set_SCROLL( int(config.plugins.vfdicon.textscroll.value)) else: evfd.getInstance().vfd_set_SCROLL(1) print("[spark7162VFD] Set text centering option") if config.plugins.vfdicon.textcenter.value == "1": evfd.getInstance().vfd_set_CENTER(True) else: evfd.getInstance().vfd_set_CENTER(False) print('[spark7162VFD] End initialisation')
def displayHddUsed(self): isMuted = eDVBVolumecontrol.getInstance().isMuted() if self.isMuted != isMuted: self.isMuted = isMuted evfd.getInstance().vfd_set_icon(8, isMuted) print "[VFD Display] Mute icon", isMuted self.SetMount() if self.mount: used = self.CheckSize() print "[VFD Display] HDD used", self.mount, used if self.hddUsed != used: self.hddUsed = used evfd.getInstance().vfd_set_icon(30, True) if used >= 1: evfd.getInstance().vfd_set_icon(24, True) else: evfd.getInstance().vfd_set_icon(24, False) if used >= 2: evfd.getInstance().vfd_set_icon(23, True) else: evfd.getInstance().vfd_set_icon(23, False) if used >= 3: evfd.getInstance().vfd_set_icon(21, True) else: evfd.getInstance().vfd_set_icon(21, False) if used >= 4: evfd.getInstance().vfd_set_icon(20, True) else: evfd.getInstance().vfd_set_icon(20, False) if used >= 5: evfd.getInstance().vfd_set_icon(19, True) else: evfd.getInstance().vfd_set_icon(19, False) if used >= 6: evfd.getInstance().vfd_set_icon(18, True) else: evfd.getInstance().vfd_set_icon(18, False) if used >= 7: evfd.getInstance().vfd_set_icon(17, True) else: evfd.getInstance().vfd_set_icon(17, False) if used >= 8: evfd.getInstance().vfd_set_icon(16, True) else: evfd.getInstance().vfd_set_icon(16, False) if used == 9: evfd.getInstance().vfd_set_icon(22, True) print "[VFD Display] HDD used icon", used
def showIcons(self): service = self.session.nav.getCurrentService() if service: info = service.info() crypted = info.getInfo(iServiceInformation.sIsCrypted) if crypted == 1: evfd.getInstance().vfd_set_icon(11, True) print "[VFD Display] Set crypt icon" else: evfd.getInstance().vfd_set_icon(11, False) print "[VFD Display] Disable crypt icon" audio = service.audioTracks() if audio: try: n = audio.getNumberOfTracks() for x in range(n): i = audio.getTrackInfo(x) description = i.getDescription() if "MP3" in description: evfd.getInstance().vfd_set_icon(25, True) print "[VFD Display] Set MP3 icon" else: evfd.getInstance().vfd_set_icon(25, False) print "[VFD Display] Disable MP3 icon" if "AC3" in description: evfd.getInstance().vfd_set_icon(26, True) print "[VFD Display] Set AC3 icon" else: evfd.getInstance().vfd_set_icon(26, False) print "[VFD Display] Disable AC3 icon" if "DTS" in description: evfd.getInstance().vfd_set_icon(10, True) print "[VFD Display] Set DTS icon" else: evfd.getInstance().vfd_set_icon(10, False) print "[VFD Display] Disable DTS icon" except: evfd.getInstance().vfd_set_icon(26, False) evfd.getInstance().vfd_set_icon(25, False) evfd.getInstance().vfd_set_icon(10, False) print "[VFD Display] Disable audio icons on error"
def Playlists(self): evfd.getInstance().vfd_write_string("PLAYLIST") self.ThumbTimer.stop() self.session.open(MessageBox,"Coming soon ... :)", MessageBox.TYPE_INFO)
def keyOK(self): config.plugins.EVOMC_vp.save() config.plugins.EVOMC_all.save() evfd.getInstance().vfd_write_string("EVO-VIDEOPLAYER") self.close()
def __init__(self, session): Screen.__init__(self, session) HelpableScreen.__init__(self) InfoBarNotifications.__init__(self) InfoBarBase.__init__(self) InfoBarSeek.__init__(self, actionmap="MediaPlayerSeekActions") self.isVisible = True self.oldService = self.session.nav.getCurrentlyPlayingServiceReference( ) self.session.nav.stopService() self.playlistparsers = {} self.addPlaylistParser(PlaylistIOM3U, "m3u") self.playlist = MyPlayList() self["fileinfo"] = Label() self["key_red"] = Button(_("Delete")) self["key_green"] = Button(_("")) self["key_yellow"] = Button("Favorites") self["key_blue"] = Button(_("Settings")) self["currentfolder"] = Label("") self["currentfavname"] = Label("") self.currList = "filelist" self.curfavfolder = -1 self["actions"] = HelpableActionMap( self, "EVOMC_VideoPlayerActions", { "ok": (self.KeyOk, "Play selected file"), "left": (self.leftUp, "List Top"), "right": (self.rightDown, "List Bottom"), "up": (self.up, "List up"), "down": (self.down, "List down"), "menu": (self.KeyMenu, "File / Folder Options"), "video": (self.visibility, "Show / Hide Player"), "nextBouquet": (self.NextFavFolder, "Next Favorite Folder"), "prevBouquet": (self.PrevFavFolder, "Previous Favorite Folder"), "stop": (self.StopPlayback, "Stop Playback"), "red": (self.deleteFile, "Delete File"), "yellow": (self.FavoriteFolders, "Favorite Folders"), # "green": (self.showPreview, "Preview"), "blue": (self.KeySettings, "Settings"), }, -2) self["InfobarShowHideActions"] = HelpableActionMap( self, "InfobarShowHideActions", { "toggleShow": (self.showFileInfo, "Show File Info"), }, -2) self["OkCancelActions"] = HelpableActionMap(self, "OkCancelActions", { "cancel": (self.Exit, "Exit Video Player"), }, -2) self.aspect = getAspect() currDir = config.plugins.EVOMC_vp.lastDir.value if not pathExists(currDir): currDir = "/" self["currentfolder"].setText(str(currDir)) if pathExists("/usr/lib/enigma2/python/Plugins/Extensions/DVDPlayer" ) is True: self.filelist = FileList( currDir, useServiceRef=True, showDirectories=True, showFiles=True, matchingPattern= "(?i)^.*\.(mp4|ts|trp|wmv|mpg|vob|avi|mkv|dat|flac|m2ts|trp|flv)" ) else: self.filelist = FileList( currDir, useServiceRef=True, showDirectories=True, showFiles=True, matchingPattern= "(?i)^.*\.(mp4|ts|trp|wmv|mpg|vob|avi|mkv|dat|flac|m2ts|trp|flv)" ) self["filelist"] = self.filelist self["thumbnail"] = Pixmap() evfd.getInstance().vfd_write_string("EVO-VIDEOPLAYER") # self.filelist.refresh() # self.ThumbTimer = eTimer() # self.ThumbTimer.callback.append(self.showThumb) # self.ThumbTimer.start(config.plugins.EVOMC_vp.preview_delay.getValue() * 1000, True) # self.filelistTimer = eTimer() # self.filelistTimer.callback.append(self.filelist.refresh()) # self.filelistTimer.start(60, True) self.DimmerTimer = eTimer() self.DimmerTimer.callback.append(self.showDimmer) self.DimmerTimer.start( config.plugins.EVOMC_all.dimmer_delay.getValue() * 1000, True) self.__event_tracker = ServiceEventTracker( screen=self, eventmap={ iPlayableService.evUser + 11: self.__evDecodeError, iPlayableService.evUser + 12: self.__evPluginError })
def __evTunedIn(self): print "[VFD Display] Set Tuned icon" evfd.getInstance().vfd_set_icon(44, True) evfd.getInstance().vfd_set_icon(29, False)
def __init__(self, session): Screen.__init__(self, session) HelpableScreen.__init__(self) self.bScreen = self.session.instantiateDialog(Blackscreen) self.bScreen.show() self.myaudioScreenSaverconfig = int(config.plugins.EVOMC_saver.myaudioScreenSaver.value) self.myaudioScreenSaverTimer = eTimer() self.myaudioScreenSaverTimer.timeout.get().append(self.myaudioScreenSaverTimer_Timeout) self.ResetmyaudioScreenSaverTimer() self.start_timer = eTimer() self.moveTimer = eTimer() self.start_timer.timeout.get().append(self.onLayoutFinished) self.isVisible = True self.oldService = self.session.nav.getCurrentlyPlayingServiceReference() self.skindir = "/usr/lib/enigma2/python/Plugins/Extensions/EVOMediaCenter/skins/basic" self.coverArtFileName = "" self["PositionGauge"] = ServicePositionGauge(self.session.nav) self["key_red"] = Button(_("Delete")) self["key_green"] = Button(_("Play All")) self["key_yellow"] = Button(_("Favorites")) self["key_blue"] = Button(_("Settings")) self["fileinfo"] = Label() self["coverArt"] = MediaPixmap() self["currentfolder"] = Label() self["currentfavname"] = Label() self.playlist = MyPlayList() self.currList = "filelist" self.curfavfolder = -1 self["play"] = Pixmap() self["stop"] = Pixmap() self["curplayingtitle"] = Label() self.currPlaying = 0 self.PlaySingle = 0 self.PlaySingleRUN = 0 self.PlayAll = 0 self.__event_tracker = ServiceEventTracker(screen=self, eventmap= { iPlayableService.evEOF: self.doEOF, iPlayableService.evStopped: self.StopPlayback, iPlayableService.evUser+11: self.__evDecodeError, iPlayableService.evUser+12: self.__evPluginError, iPlayableService.evUser+13: self["coverArt"].embeddedCoverArt }) self["actions"] = HelpableActionMap(self, "EVOMC_AudioPlayerActions", { "ok": (self.KeyPlaySingle, "Play selected file"), "left": (self.leftUp, "List Top"), "right": (self.rightDown, "List Bottom"), "up": (self.up, "List up"), "down": (self.down, "List down"), "menu": (self.KeyMenu, "File / Folder Options"), "video": (self.visibility, "Show / Hide Player"), "nextBouquet": (self.NextFavFolder, "Next Favorite Folder"), "prevBouquet": (self.PrevFavFolder, "Previous Favorite Folder"), "red": (self.deleteFile, "Delete File"), "green": (self.KeyPlayAll, "Play All"), "yellow": (self.FavoriteFolders, "Favorite Folders"), "blue": (self.Settings, "Settings"), }, -2) self["OkCancelActions"] = HelpableActionMap(self, "OkCancelActions", { "cancel": (self.Exit, "Exit Audio Player"), }, -2) self["InfobarShowHideActions"] = HelpableActionMap(self, "InfobarShowHideActions", { "toggleShow": (self.showFileInfo, "Show File Info"), }, -2) self["MediaPlayerActions"] = HelpableActionMap(self, "MediaPlayerActions", { "stop": (self.StopPlayback, "Stop Playback"), }, -2) self.aspect = getAspect() currDir = config.plugins.EVOMC_ap.lastDir.value if not pathExists(currDir): currDir = "/" self["currentfolder"].setText(str(currDir)) self.filelist = FileList(currDir, useServiceRef = True, showDirectories = True, showFiles = True, matchingPattern = "(?i)^.*\.(mp3|ogg|wma|wav|wave|flac|m4a)") self["filelist"] = self.filelist self["thumbnail"] = Pixmap() evfd.getInstance().vfd_write_string("EVO-AUDIOPLAYER") self.ThumbTimer = eTimer() self.ThumbTimer.callback.append(self.showThumb) self.ThumbTimer.start(config.plugins.EVOMC_ap.preview_delay.getValue() * 1000, True) self.DimmerTimer = eTimer() self.DimmerTimer.callback.append(self.showDimmer) self.DimmerTimer.start(config.plugins.EVOMC_all.dimmer_delay.getValue() * 1000, True) self.BlinkingPlayIconTimer = eTimer() self.BlinkingPlayIconTimer.callback.append(self.BlinkingPlayIcon) self.blinking=False self.FileInfoTimer = eTimer() self.FileInfoTimer.callback.append(self.updateFileInfo) self.myaudioScreenSaverconfig = int(config.plugins.EVOMC_saver.myaudioScreenSaver.value) self.ResetmyaudioScreenSaverTimer()