def createConfig(self): afterevent = { AFTEREVENT.NONE: "nothing", AFTEREVENT.WAKEUP: "wakeup", AFTEREVENT.WAKEUPTOSTANDBY: "wakeuptostandby", AFTEREVENT.STANDBY: "standby", AFTEREVENT.DEEPSTANDBY: "deepstandby" }[self.timer.afterEvent] timertype = { TIMERTYPE.NONE: "nothing", TIMERTYPE.WAKEUP: "wakeup", TIMERTYPE.WAKEUPTOSTANDBY: "wakeuptostandby", TIMERTYPE.AUTOSTANDBY: "autostandby", TIMERTYPE.AUTODEEPSTANDBY: "autodeepstandby", TIMERTYPE.STANDBY: "standby", TIMERTYPE.DEEPSTANDBY: "deepstandby", TIMERTYPE.REBOOT: "reboot", TIMERTYPE.RESTART: "restart" }[self.timer.timerType] weekday_table = ("mon", "tue", "wed", "thu", "fri", "sat", "sun") time_table = [(1, "1"), (3, "3"), (5, "5"), (10, "10"), (15, "15"), (30, "30"), (45, "45"), (60, "60"), (75, "75"), (90, "90"), (105, "105"), (120, "120"), (135, "135"), (150, "150"), (165, "165"), (180, "180"), (195, "195"), (210, "210"), (225, "225"), (240, "240"), (255, "255"), (270, "270"), (285, "285"), (300, "300")] traffic_table = [(10, "10"), (50, "50"), (100, "100"), (500, "500"), (1000, "1000")] # calculate default values day = [] weekday = 0 for x in (0, 1, 2, 3, 4, 5, 6): day.append(0) if self.timer.repeated: # repeated type = "repeated" if self.timer.repeated == 31: # Mon-Fri repeated = "weekdays" elif self.timer.repeated == 127: # daily repeated = "daily" else: flags = self.timer.repeated repeated = "user" count = 0 for x in (0, 1, 2, 3, 4, 5, 6): if flags == 1: # weekly print "Set to weekday " + str(x) weekday = x if flags & 1 == 1: # set user defined flags day[x] = 1 count += 1 else: day[x] = 0 flags >>= 1 if count == 1: repeated = "weekly" else: # once type = "once" repeated = None weekday = int(strftime("%u", localtime(self.timer.begin))) - 1 day[weekday] = 1 if SystemInfo["DeepstandbySupport"]: shutdownString = _("go to deep standby") else: shutdownString = _("shut down") self.timerentry_timertype = ConfigSelection(choices=[ ("nothing", _("do nothing")), ("wakeup", _("wakeup")), ("wakeuptostandby", _("wakeup to standby")), ("autostandby", _("auto standby")), ("autodeepstandby", _("auto deepstandby")), ("standby", _("go to standby")), ("deepstandby", shutdownString), ("reboot", _("reboot system")), ("restart", _("restart GUI")) ], default=timertype) self.timerentry_afterevent = ConfigSelection(choices=[ ("nothing", _("do nothing")), ("wakeup", _("wakeup")), ("wakeuptostandby", _("wakeup to standby")), ("standby", _("go to standby")), ("deepstandby", shutdownString) ], default=afterevent) self.timerentry_type = ConfigSelection(choices=[("once", _("once")), ("repeated", _("repeated"))], default=type) self.timerentry_repeated = ConfigSelection( default=repeated, choices=[("daily", _("daily")), ("weekly", _("weekly")), ("weekdays", _("Mon-Fri")), ("user", _("user defined"))]) self.timerrntry_autosleepdelay = ConfigSelection( choices=time_table, default=self.timer.autosleepdelay) self.timerentry_autosleeprepeat = ConfigSelection( choices=[("once", _("once")), ("repeated", _("repeated"))], default=self.timer.autosleeprepeat) self.timerrntry_autosleepinstandbyonly = ConfigSelection( choices=[("yes", _("only in Standby")), ("no", _("Standard (always)")), ("noquery", _("without Query"))], default=self.timer.autosleepinstandbyonly) self.timerrntry_autosleepwindow = ConfigSelection( choices=[("yes", _("Yes")), ("no", _("No"))], default=self.timer.autosleepwindow) self.timerrntry_autosleepbegin = ConfigClock( default=self.timer.autosleepbegin) self.timerrntry_autosleepend = ConfigClock( default=self.timer.autosleepend) self.timerentry_date = ConfigDateTime( default=self.timer.begin, formatstring=config.usage.date.full.value, increment=86400) self.timerentry_starttime = ConfigClock(default=self.timer.begin) self.timerentry_endtime = ConfigClock(default=self.timer.end) self.timerentry_showendtime = ConfigSelection( default=(((self.timer.end - self.timer.begin) / 60) > 4), choices=[(True, _("yes")), (False, _("no"))]) self.timerentry_repeatedbegindate = ConfigDateTime( default=self.timer.repeatedbegindate, formatstring=config.usage.date.full.value, increment=86400) self.timerentry_weekday = ConfigSelection( default=weekday_table[weekday], choices=[("mon", _("Monday")), ("tue", _("Tuesday")), ("wed", _("Wednesday")), ("thu", _("Thursday")), ("fri", _("Friday")), ("sat", _("Saturday")), ("sun", _("Sunday"))]) self.timerentry_day = ConfigSubList() for x in (0, 1, 2, 3, 4, 5, 6): self.timerentry_day.append(ConfigYesNo(default=day[x])) self.timerrntry_showExtended = ConfigSelection( default=(self.timer.nettraffic == "yes" or self.timer.netip == "yes"), choices=[(True, _("yes")), (False, _("no"))]) self.timerrntry_nettraffic = ConfigSelection( choices=[("yes", _("Yes")), ("no", _("No"))], default=self.timer.nettraffic) self.timerrntry_trafficlimit = ConfigSelection( choices=traffic_table, default=self.timer.trafficlimit) self.timerrntry_netip = ConfigSelection(choices=[("yes", _("Yes")), ("no", _("No"))], default=self.timer.netip) self.timerrntry_ipadress = self.timer.ipadress.split(',') self.ipcount = ConfigSelectionNumber(default=len( self.timerrntry_ipadress), stepwidth=1, min=1, max=5) self.ipadressEntry = ConfigSubList() for x in (0, 1, 2, 3, 4, 5): try: self.ipadressEntry.append( ConfigIP(default=[ int(n) for n in self.timerrntry_ipadress[x].split('.') ] or [0, 0, 0, 0])) except: self.ipadressEntry.append(ConfigIP(default=[0, 0, 0, 0]))
def InitOsd(): SystemInfo["CanChange3DOsd"] = (access('/proc/stb/fb/3dmode', R_OK) or access('/proc/stb/fb/primary/3d', R_OK)) and True or False config.osd.dst_left = ConfigSelectionNumber(default=0, stepwidth=1, min=0, max=720, wraparound=False) config.osd.dst_width = ConfigSelectionNumber(default=720, stepwidth=1, min=0, max=720, wraparound=False) config.osd.dst_top = ConfigSelectionNumber(default=0, stepwidth=1, min=0, max=576, wraparound=False) config.osd.dst_height = ConfigSelectionNumber(default=576, stepwidth=1, min=0, max=576, wraparound=False) config.osd.alpha = ConfigSelectionNumber(default=255, stepwidth=1, min=0, max=255, wraparound=False) config.av.osd_alpha = NoSave(ConfigNumber(default=255)) config.osd.threeDmode = ConfigSelection( [("off", _("Off")), ("auto", _("Auto")), ("sidebyside", _("Side by Side")), ("topandbottom", _("Top and Bottom"))], "auto") config.osd.threeDznorm = ConfigSlider(default=50, increment=1, limits=(0, 100)) config.osd.show3dextensions = ConfigYesNo(default=False) def set3DMode(configElement): if SystemInfo["CanChange3DOsd"] and getBoxType() not in ('spycat'): print('[UserInterfacePositioner] Setting 3D mode:', configElement.value) file3d = fileCheck('/proc/stb/fb/3dmode') or fileCheck( '/proc/stb/fb/primary/3d') f = open(file3d, "w") f.write(configElement.value) f.close() config.osd.threeDmode.addNotifier(set3DMode) def set3DZnorm(configElement): if SystemInfo["CanChange3DOsd"] and getBoxType() not in ('spycat'): print('[UserInterfacePositioner] Setting 3D depth:', configElement.value) f = open("/proc/stb/fb/znorm", "w") f.write('%d' % int(configElement.value)) f.close() config.osd.threeDznorm.addNotifier(set3DZnorm)
from enigma import setAnimation_current, setAnimation_speed # default = slide to left g_default = { "current": 0, "speed": 20, } g_max_speed = 30 g_animation_paused = False g_orig_show = None g_orig_doClose = None config.misc.window_animation_default = ConfigNumber( default=g_default["current"]) config.misc.window_animation_speed = ConfigSelectionNumber( 1, g_max_speed, 1, default=g_default["speed"]) class AnimationSetupConfig(ConfigListScreen, Screen): skin = """ <screen position="center,center" size="600,140" title="Animation Settings"> <widget name="config" position="0,0" size="600,100" scrollbarMode="showOnDemand" /> <ePixmap pixmap="skin_default/buttons/red.png" position="0,100" size="140,40" alphatest="on" /> <ePixmap pixmap="skin_default/buttons/green.png" position="140,100" size="140,40" alphatest="on" /> <ePixmap pixmap="skin_default/buttons/yellow.png" position="280,100" size="140,40" alphatest="on" /> <widget source="key_red" render="Label" position="0,100" zPosition="1" size="140,40" font="Regular;20" halign="center" valign="center" foregroundColor="#ffffff" backgroundColor="#9f1313" transparent="1" /> <widget source="key_green" render="Label" position="140,100" zPosition="1" size="140,40" font="Regular;20" halign="center" valign="center" foregroundColor="#ffffff" backgroundColor="#1f771f" transparent="1" /> <widget source="key_yellow" render="Label" position="280,100" zPosition="1" size="140,40" font="Regular;20" halign="center" valign="center" foregroundColor="#ffffff" backgroundColor="#a08500" transparent="1" /> </screen>
from Components.config import config, ConfigSubsection, ConfigYesNo, ConfigSelection, ConfigSelectionNumber from enigma import eEPGCache # Plugin internal from Plugins.Extensions.InfoBarTunerState.__init__ import _ from Plugins.Extensions.InfoBarTunerState.PluginBase import PluginBase from Plugins.Extensions.InfoBarTunerState.Helper import getTunerByPlayableService, getNumber, getChannel from Plugins.Extensions.InfoBarTunerState.Logger import log # Config options event_choices = [("start", _("Start record")), ("end", _("End record")), ("startend", _("Start / End record"))] config.infobartunerstate.plugin_records = ConfigSubsection() config.infobartunerstate.plugin_records.enabled = ConfigYesNo(default=True) config.infobartunerstate.plugin_records.number_finished_records = ConfigSelectionNumber( 0, 10, 1, default=3) config.infobartunerstate.plugin_records.finished_hours = ConfigSelectionNumber( 0, 1000, 1, default=0) config.infobartunerstate.plugin_records.show_events = ConfigSelection( default="startend", choices=event_choices) def getTimerID(timer): return 'record %x %s %x' % (id(timer), timer.name, int(timer.eit or 0)) def getTimer(id): from NavigationInstance import instance if instance is not None: for timer in (instance.RecordTimer.timer_list + instance.RecordTimer.processed_timers):
("800000", "800 Kbits"), ("900000", "900 Kbits"), ("1000000", "1 Mbits")]) config.plugins.transcodingsetup.bitrate = choice choice = ConfigSelection(default="50000", choices=[("-1", "Auto"), ("23976", "23.976 fps"), ("24000", "24 fps"), ("25000", "25 fps"), ("29970", "29.970 fps"), ("30000", "30 fps"), ("50000", "50 fps"), ("59940", "59.940 fps"), ("60000", "60 fps")]) config.plugins.transcodingsetup.framerate = choice else: choice = ConfigSelectionNumber(min=100000, max=10000000, stepwidth=100000, default=400000, wraparound=True) config.plugins.transcodingsetup.bitrate = choice choice = ConfigSelection(default="50000", choices=[("23976", "23.976 fps"), ("24000", "24 fps"), ("25000", "25 fps"), ("29970", "29.970 fps"), ("30000", "30 fps"), ("50000", "50 fps"), ("59940", "59.940 fps"), ("60000", "60 fps")]) config.plugins.transcodingsetup.framerate = choice choice = ConfigSelection(default="854x480", choices=[("854x480", _("480p")), ("768x576", _("576p")), ("1280x720", _("720p")),
default="partial", choices=[("partial", _("partial match")), ("partialdes", _("partial description")), ("exact", _("exact match")), ("start", _("title starts with"))]) config.plugins.epgsearch.search_case = ConfigSelection( default="insensitive", choices=[("insensitive", _("case-insensitive search")), ("sensitive", _("case-sensitive search"))]) allowShowOrbital = True config.plugins.epgsearch.showorbital = ConfigYesNo(default=allowShowOrbital) config.plugins.epgsearch.history = ConfigSet(choices=[]) # XXX: configtext is more flexible but we cannot use this for a (not yet created) gui config config.plugins.epgsearch.encoding = ConfigSelection( choices=['UTF-8', 'ISO8859-15'], default='UTF-8') config.plugins.epgsearch.history_length = ConfigSelectionNumber(0, 50, 1, default=10) config.plugins.epgsearch.add_search_to_epg = ConfigYesNo(default=True) orbposDisabled = 3600 def getNamespaces(namespaces): lamedbServices = eServiceReference("1:7:1:0:0:0:0:0:0:0:" + " || ".join( map(lambda x: '(satellitePosition == %d)' % (x >> 16), namespaces))) hasNamespaces = set() if not namespaces: return hasNamespaces serviceHandler = eServiceCenter.getInstance() servicelist = serviceHandler.list(lamedbServices) if servicelist is not None:
def InitAVSwitch(): config.av = ConfigSubsection() if getBoxType() == "vuduo" or getBoxBrand() == "ixuss": config.av.yuvenabled = ConfigBoolean(default=False) else: config.av.yuvenabled = ConfigBoolean(default=True) colorformat_choices = {"cvbs": _("CVBS")} # when YUV, Scart or S-Video is not support by HW, don't let the user select it if SystemInfo["HasYPbPr"]: colorformat_choices["yuv"] = _("YPbPr") if SystemInfo["HasScart"]: colorformat_choices["rgb"] = _("RGB") if SystemInfo["HasSVideo"]: colorformat_choices["svideo"] = _("S-Video") config.av.colorformat = ConfigSelection(choices=colorformat_choices, default="cvbs") config.av.aspectratio = ConfigSelection(choices={ "4_3_letterbox": _("4:3 Letterbox"), "4_3_panscan": _("4:3 PanScan"), "16_9": _("16:9"), "16_9_always": _("16:9 always"), "16_10_letterbox": _("16:10 Letterbox"), "16_10_panscan": _("16:10 PanScan"), "16_9_letterbox": _("16:9 Letterbox") }, default="16_9") config.av.aspect = ConfigSelection(choices={ "4_3": _("4:3"), "16_9": _("16:9"), "16_10": _("16:10"), "auto": _("Automatic") }, default="auto") policy2_choices = { # TRANSLATORS: (aspect ratio policy: black bars on top/bottom) in doubt, keep english term. "letterbox": _("Letterbox"), # TRANSLATORS: (aspect ratio policy: cropped content on left/right) in doubt, keep english term "panscan": _("Pan&scan"), # TRANSLATORS: (aspect ratio policy: scale as close to fullscreen as possible) "scale": _("Just scale") } try: if "full" in open("/proc/stb/video/policy2_choices").read(): # TRANSLATORS: (aspect ratio policy: display as fullscreen, even if the content aspect ratio does not match the screen ratio) policy2_choices.update({"full": _("Full screen")}) except: pass try: if "auto" in open("/proc/stb/video/policy2_choices").read(): # TRANSLATORS: (aspect ratio policy: automatically select the best aspect ratio mode) policy2_choices.update({"auto": _("Auto")}) except: pass config.av.policy_169 = ConfigSelection(choices=policy2_choices, default="scale") policy_choices = { # TRANSLATORS: (aspect ratio policy: black bars on left/right) in doubt, keep english term. "pillarbox": _("Pillarbox"), # TRANSLATORS: (aspect ratio policy: cropped content on left/right) in doubt, keep english term "panscan": _("Pan&scan"), # TRANSLATORS: (aspect ratio policy: scale as close to fullscreen as possible) "scale": _("Just scale") } try: if "nonlinear" in open("/proc/stb/video/policy_choices").read(): # TRANSLATORS: (aspect ratio policy: display as fullscreen, with stretching the left/right) policy_choices.update({"nonlinear": _("Nonlinear")}) except: pass try: if "full" in open("/proc/stb/video/policy_choices").read(): # TRANSLATORS: (aspect ratio policy: display as fullscreen, even if the content aspect ratio does not match the screen ratio) policy_choices.update({"full": _("Full screen")}) except: pass try: if "auto" in open("/proc/stb/video/policy_choices").read(): # TRANSLATORS: (aspect ratio policy: automatically select the best aspect ratio mode) policy_choices.update({"auto": _("Auto")}) except: pass config.av.policy_43 = ConfigSelection(choices=policy_choices, default="scale") config.av.tvsystem = ConfigSelection(choices={ "pal": _("PAL"), "ntsc": _("NTSC"), "multinorm": _("multinorm") }, default="pal") config.av.wss = ConfigEnableDisable(default=True) config.av.generalAC3delay = ConfigSelectionNumber(-1000, 1000, 5, default=0) config.av.generalPCMdelay = ConfigSelectionNumber(-1000, 1000, 5, default=0) config.av.vcrswitch = ConfigEnableDisable(default=False) iAVSwitch = AVSwitch() def setColorFormat(configElement): if getBoxType() == "et6x00": map = {"cvbs": 3, "rgb": 3, "svideo": 2, "yuv": 3} elif SystemInfo["GigaBlueQuad"] or getBoxType().startswith('et'): map = {"cvbs": 0, "rgb": 3, "svideo": 2, "yuv": 3} else: map = {"cvbs": 0, "rgb": 1, "svideo": 2, "yuv": 3} iAVSwitch.setColorFormat(map[configElement.value]) def setAspectRatio(configElement): map = { "4_3_letterbox": 0, "4_3_panscan": 1, "16_9": 2, "16_9_always": 3, "16_10_letterbox": 4, "16_10_panscan": 5, "16_9_letterbox": 6 } iAVSwitch.setAspectRatio(map[configElement.value]) def setSystem(configElement): map = {"pal": 0, "ntsc": 1, "multinorm": 2} iAVSwitch.setSystem(map[configElement.value]) def setWSS(configElement): iAVSwitch.setAspectWSS() # this will call the "setup-val" initial config.av.colorformat.addNotifier(setColorFormat) config.av.aspectratio.addNotifier(setAspectRatio) config.av.tvsystem.addNotifier(setSystem) config.av.wss.addNotifier(setWSS) iAVSwitch.setInput("ENCODER") # init on startup if SystemInfo["GigaBlueQuad"] or getBoxType() in ( "et5x00", "et6x00", "ixussone", "ixusszero", "axodin", "axodinc", "starsatlx", "galaxym6", "geniuse3hd", "evoe3hd", "axase3", "axase3c", "optimussos1", "optimussos2", "gb800seplus", "gb800ueplus", "gbultrase", "gbultraue", "gbultraueh", "twinboxlcd"): detected = False else: detected = eAVSwitch.getInstance().haveScartSwitch() SystemInfo["ScartSwitch"] = detected if SystemInfo["CanDownmixAC3"]: def setAC3Downmix(configElement): if SystemInfo["DreamBoxAudio"]: open("/proc/stb/audio/ac3", "w").write(configElement.value) else: open("/proc/stb/audio/ac3", "w").write(configElement.value and "downmix" or "passthrough") if SystemInfo["DreamBoxAudio"]: choice_list = [("downmix", _("Downmix")), ("passthrough", _("Passthrough")), ("multichannel", _("convert to multi-channel PCM")), ("hdmi_best", _("use best / controlled by HDMI"))] config.av.downmix_ac3 = ConfigSelection(choices=choice_list, default="downmix") else: config.av.downmix_ac3 = ConfigYesNo(default=True) config.av.downmix_ac3.addNotifier(setAC3Downmix) if SystemInfo["CanAC3plusTranscode"]: def setAC3plusTranscode(configElement): open("/proc/stb/audio/ac3plus", "w").write(configElement.value) if SystemInfo["DreamBoxAudio"]: choice_list = [("use_hdmi_caps", _("controlled by HDMI")), ("force_ac3", _("convert to AC3")), ("multichannel", _("convert to multi-channel PCM")), ("hdmi_best", _("use best / controlled by HDMI")), ("force_ddp", _("force AC3plus"))] config.av.transcodeac3plus = ConfigSelection(choices=choice_list, default="force_ac3") elif SystemInfo["GigaBlueAudio"]: choice_list = [("downmix", _("Downmix")), ("passthrough", _("Passthrough")), ("force_ac3", _("convert to AC3")), ("multichannel", _("convert to multi-channel PCM")), ("force_dts", _("convert to DTS"))] config.av.transcodeac3plus = ConfigSelection(choices=choice_list, default="force_ac3") else: choice_list = [("use_hdmi_caps", _("controlled by HDMI")), ("force_ac3", _("convert to AC3"))] config.av.transcodeac3plus = ConfigSelection(choices=choice_list, default="force_ac3") config.av.transcodeac3plus.addNotifier(setAC3plusTranscode) if SystemInfo["CanDownmixDTS"]: def setDTSDownmix(configElement): open("/proc/stb/audio/dts", "w").write(configElement.value and "downmix" or "passthrough") config.av.downmix_dts = ConfigYesNo(default=True) config.av.downmix_dts.addNotifier(setDTSDownmix) if SystemInfo["CanDTSHD"]: def setDTSHD(configElement): open("/proc/stb/audio/dtshd", "w").write(configElement.value) if SystemInfo["DreamBoxDTSAudio"]: choice_list = [("use_hdmi_caps", _("controlled by HDMI")), ("force_dts", _("convert to DTS"))] config.av.dtshd = ConfigSelection(choices=choice_list, default="use_hdmi_caps") else: choice_list = [("downmix", _("Downmix")), ("force_dts", _("convert to DTS")), ("use_hdmi_caps", _("controlled by HDMI")), ("multichannel", _("convert to multi-channel PCM")), ("hdmi_best", _("use best / controlled by HDMI"))] config.av.dtshd = ConfigSelection(choices=choice_list, default="downmix") config.av.dtshd.addNotifier(setDTSHD) if SystemInfo["CanWMAPRO"]: def setWMAPRO(configElement): open("/proc/stb/audio/wmapro", "w").write(configElement.value) choice_list = [("downmix", _("Downmix")), ("passthrough", _("Passthrough")), ("multichannel", _("convert to multi-channel PCM")), ("hdmi_best", _("use best / controlled by HDMI"))] config.av.wmapro = ConfigSelection(choices=choice_list, default="downmix") config.av.wmapro.addNotifier(setWMAPRO) if SystemInfo["CanDownmixAAC"]: def setAACDownmix(configElement): if SystemInfo["DreamBoxAudio"] or SystemInfo["GigaBlueAudio"]: open("/proc/stb/audio/aac", "w").write(configElement.value) else: open("/proc/stb/audio/aac", "w").write(configElement.value and "downmix" or "passthrough") if SystemInfo["DreamBoxAudio"]: choice_list = [("downmix", _("Downmix")), ("passthrough", _("Passthrough")), ("multichannel", _("convert to multi-channel PCM")), ("hdmi_best", _("use best / controlled by HDMI"))] config.av.downmix_aac = ConfigSelection(choices=choice_list, default="downmix") elif SystemInfo["GigaBlueAudio"]: choice_list = [("downmix", _("Downmix")), ("passthrough", _("Passthrough")), ("multichannel", _("convert to multi-channel PCM")), ("force_ac3", _("convert to AC3")), ("force_dts", _("convert to DTS")), ("use_hdmi_cacenter", _("use_hdmi_cacenter")), ("wide", _("wide")), ("extrawide", _("extrawide"))] config.av.downmix_aac = ConfigSelection(choices=choice_list, default="downmix") else: config.av.downmix_aac = ConfigYesNo(default=True) config.av.downmix_aac.addNotifier(setAACDownmix) if SystemInfo["CanDownmixAACPlus"]: def setAACDownmixPlus(configElement): open("/proc/stb/audio/aacplus", "w").write(configElement.value) choice_list = [("downmix", _("Downmix")), ("passthrough", _("Passthrough")), ("multichannel", _("convert to multi-channel PCM")), ("force_ac3", _("convert to AC3")), ("force_dts", _("convert to DTS")), ("use_hdmi_cacenter", _("use_hdmi_cacenter")), ("wide", _("wide")), ("extrawide", _("extrawide"))] config.av.downmix_aacplus = ConfigSelection(choices=choice_list, default="downmix") config.av.downmix_aacplus.addNotifier(setAACDownmixPlus) if SystemInfo["CanAACTranscode"]: def setAACTranscode(configElement): open("/proc/stb/audio/aac_transcode", "w").write(configElement.value) choice_list = [("off", _("off")), ("ac3", _("AC3")), ("dts", _("DTS"))] config.av.transcodeaac = ConfigSelection(choices=choice_list, default="off") config.av.transcodeaac.addNotifier(setAACTranscode) else: config.av.transcodeaac = ConfigNothing() if SystemInfo["CanBTAudio"]: def setBTAudio(configElement): open("/proc/stb/audio/btaudio", "w").write(configElement.value) choice_list = [("off", _("off")), ("on", _("on"))] config.av.btaudio = ConfigSelection(choices=choice_list, default="off") config.av.btaudio.addNotifier(setBTAudio) else: config.av.btaudio = ConfigNothing() if SystemInfo["CanBTAudioDelay"]: def setBTAudioDelay(configElement): open("/proc/stb/audio/btaudio", "w").write(format(configElement.value * 90)) config.av.btaudiodelay = ConfigSelectionNumber(-1000, 1000, 5, default=0) config.av.btaudiodelay.addNotifier(setBTAudioDelay) else: config.av.btaudiodelay = ConfigNothing() if SystemInfo["CanChangeOsdAlpha"]: def setAlpha(config): open("/proc/stb/video/alpha", "w").write(str(config.value)) config.av.osd_alpha = ConfigSlider(default=255, limits=(0, 255)) config.av.osd_alpha.addNotifier(setAlpha) if SystemInfo["ScalerSharpness"]: def setScaler_sharpness(config): myval = int(config.value) try: print("--> setting scaler_sharpness to: %0.8X" % myval) open("/proc/stb/vmpeg/0/pep_scaler_sharpness", "w").write("%0.8X" % myval) open("/proc/stb/vmpeg/0/pep_apply", "w").write("1") except IOError: print("[AVSwitch] couldn't write pep_scaler_sharpness") if SystemInfo["GigaBlueQuad"]: config.av.scaler_sharpness = ConfigSlider(default=5, limits=(0, 26)) else: config.av.scaler_sharpness = ConfigSlider(default=13, limits=(0, 26)) config.av.scaler_sharpness.addNotifier(setScaler_sharpness) else: config.av.scaler_sharpness = NoSave(ConfigNothing()) if SystemInfo["HasMultichannelPCM"]: def setMultichannelPCM(configElement): open(SystemInfo["HasMultichannelPCM"], "w").write(configElement.value and "enable" or "disable") config.av.multichannel_pcm = ConfigYesNo(default=False) config.av.multichannel_pcm.addNotifier(setMultichannelPCM) if SystemInfo["HasAutoVolume"]: def setAutoVolume(configElement): open(SystemInfo["HasAutoVolume"], "w").write(configElement.value) config.av.autovolume = ConfigSelection(default="none", choices=[("none", _("off")), ("hdmi", _("HDMI")), ("spdif", _("SPDIF")), ("dac", _("DAC"))]) config.av.autovolume.addNotifier(setAutoVolume) if SystemInfo["HasAutoVolumeLevel"]: def setAutoVolumeLevel(configElement): open(SystemInfo["HasAutoVolumeLevel"], "w").write(configElement.value and "enabled" or "disabled") config.av.autovolumelevel = ConfigYesNo(default=False) config.av.autovolumelevel.addNotifier(setAutoVolumeLevel) if SystemInfo["Has3DSurround"]: def set3DSurround(configElement): open(SystemInfo["Has3DSurround"], "w").write(configElement.value) config.av.surround_3d = ConfigSelection(default="none", choices=[("none", _("off")), ("hdmi", _("HDMI")), ("spdif", _("SPDIF")), ("dac", _("DAC"))]) config.av.surround_3d.addNotifier(set3DSurround) if SystemInfo["Has3DSpeaker"]: def set3DSpeaker(configElement): open(SystemInfo["Has3DSpeaker"], "w").write(configElement.value) config.av.speaker_3d = ConfigSelection(default="center", choices=[("center", _("center")), ("wide", _("wide")), ("extrawide", _("extra wide"))]) config.av.speaker_3d.addNotifier(set3DSpeaker) if SystemInfo["Has3DSurroundSpeaker"]: def set3DSurroundSpeaker(configElement): open(SystemInfo["Has3DSurroundSpeaker"], "w").write(configElement.value) config.av.surround_3d_speaker = ConfigSelection( default="disabled", choices=[("disabled", _("off")), ("center", _("center")), ("wide", _("wide")), ("extrawide", _("extra wide"))]) config.av.surround_3d_speaker.addNotifier(set3DSurroundSpeaker) if SystemInfo["Has3DSurroundSoftLimiter"]: def set3DSurroundSoftLimiter(configElement): open(SystemInfo["Has3DSurroundSoftLimiter"], "w").write(configElement.value and "enabled" or "disabled") config.av.surround_softlimiter_3d = ConfigYesNo(default=False) config.av.surround_softlimiter_3d.addNotifier(set3DSurroundSoftLimiter) if SystemInfo["HDMIAudioSource"]: def setHDMIAudioSource(configElement): open(SystemInfo["HDMIAudioSource"], "w").write(configElement.value) config.av.hdmi_audio_source = ConfigSelection(default="pcm", choices=[ ("pcm", _("PCM")), ("spdif", _("SPDIF")) ]) config.av.hdmi_audio_source.addNotifier(setHDMIAudioSource) def setVolumeStepsize(configElement): eDVBVolumecontrol.getInstance().setVolumeSteps(int( configElement.value)) config.av.volume_stepsize = ConfigSelectionNumber(1, 10, 1, default=5) config.av.volume_stepsize.addNotifier(setVolumeStepsize)
config.plugins.epgbackup.show_backuprestore_in_extmenu = ConfigYesNo( default=False) config.plugins.epgbackup.backup_enabled = ConfigYesNo(default=True) config.plugins.epgbackup.make_backup_after_unsuccess_restore = ConfigYesNo( default=True) config.plugins.epgbackup.callAfterEPGRefresh = ConfigYesNo(default=True) config.plugins.epgbackup.backupSaveInterval = ConfigSelection(choices=[ ("-1", _("backup timer disabled")), ("30", _("30 minutes")), ("60", _("1 hour")), ("300", _("6 hours")), ("1200", _("1 day")), ], default="-1") config.plugins.epgbackup.show_messages_background = ConfigYesNo(default=True) config.plugins.epgbackup.filesize_valid = ConfigSelectionNumber( min=1, max=20, stepwidth=1, default=3, wraparound=True) config.plugins.epgbackup.timespan_valid = ConfigNumber(default=7) config.plugins.epgbackup.showadvancedoptions = NoSave( ConfigYesNo(default=False)) config.plugins.epgbackup.epgwrite_wait = ConfigNumber(default=3) config.plugins.epgbackup.showin_usr_scripts = ConfigYesNo(default=True) config.plugins.epgbackup.backup_strategy = ConfigSelection(choices=[ ("youngest_before_biggest", _("Youngest before Biggest"), _("The youngest file from the saved backup-files will be restored.\nIf it is older than the current existing EPG-file and the EPG-file isn't valid then the biggest backup-file will be restored." )), ("biggest_before_youngest", _("Biggest before Youngest"), _("The biggest file from the saved backup-files will be restored.\nIf it is smaller than the current existing EPG-file and the EPG-file isn't valid then the youngest backup-file will be restored." )), ("youngest", _("Only younger"), _("The backup-file will only be restored if it is younger than the current existing EPG-file." )),
default="-1", choices=TAB_CHOICES) config.plugins.merlinEpgCenter.replaceShowEventView = ConfigSelection( default="-1", choices=TAB_CHOICES) config.plugins.merlinEpgCenter.epgPaths = ConfigSelection( default=eEnv.resolve('${datadir}/enigma2/picon_50x30/'), choices=[ (eEnv.resolve('${datadir}/enigma2/picon_50x30/'), eEnv.resolve('${datadir}/enigma2/picon_50x30')), ('/media/cf/picon_50x30/', '/media/cf/picon_50x30'), ('/media/usb/picon_50x30/', '/media/usb/picon_50x30'), ]) config.plugins.merlinEpgCenter.showColoredEpgTimes = ConfigYesNo(True) config.plugins.merlinEpgCenter.searchString = NoSave(ConfigText(default="")) config.plugins.merlinEpgCenter.searchHistory = ConfigSet(choices=[]) config.plugins.merlinEpgCenter.showInputHelp = ConfigYesNo(True) config.plugins.merlinEpgCenter.listItemHeight = ConfigSelectionNumber( min=0, max=20, stepwidth=2, default=0, wraparound=True) config.plugins.merlinEpgCenter.listStyle = ConfigSelection( default=STYLE_SINGLE_LINE, choices=[ (STYLE_SINGLE_LINE, _("single line style")), (STYLE_SHORT_DESCRIPTION, _("with short description")), ]) config.plugins.merlinEpgCenter.skin = ConfigText(default="") config.plugins.merlinEpgCenter.skinSelection = NoSave( ConfigSelection(choices=[])) config.plugins.merlinEpgCenter.limitSearchToBouquetServices = ConfigYesNo( False) config.plugins.merlinEpgCenter.exitOnTvRadioSwitch = ConfigYesNo(False) config.plugins.merlinEpgCenter.numNextEvents = ConfigSelectionNumber( min=0, max=3, stepwidth=1, default=1, wraparound=True) config.plugins.merlinEpgCenter.showDuration = ConfigYesNo(True)
def InitRecordingConfig(): config.recording = ConfigSubsection() # actually this is "recordings always have priority". "Yes" does mean: don't ask. The RecordTimer will ask when value is 0. config.recording.asktozap = ConfigYesNo(default=True) config.recording.margin_before = ConfigSelectionNumber(min=0, max=120, stepwidth=1, default=3, wraparound=True) config.recording.margin_after = ConfigSelectionNumber(min=0, max=120, stepwidth=1, default=5, wraparound=True) config.recording.ascii_filenames = ConfigYesNo(default=False) config.recording.keep_timers = ConfigSelectionNumber(min=1, max=120, stepwidth=1, default=7, wraparound=True) config.recording.filename_composition = ConfigSelection( default="standard", choices=[("standard", _("standard")), ("veryveryshort", _("Very very short filenames - Warning")), ("veryshort", _("Very short filenames")), ("shortwithtime", _("Short filenames with time")), ("short", _("Short filenames")), ("long", _("Long filenames"))]) config.recording.always_ecm = ConfigYesNo(default=False) config.recording.never_decrypt = ConfigYesNo(default=False) config.recording.offline_decode_delay = ConfigInteger(default=1000, limits=(1, 10000)) config.recording.ecm_data = ConfigSelection(choices=[ ("normal", _("normal")), ("descrambled+ecm", _("descramble and record ecm")), ("scrambled+ecm", _("don't descramble, record ecm")) ], default="normal") config.recording.default_timertype = ConfigSelection(choices=[ ("zap", _("zap")), ("record", _("record")), ("zap+record", _("zap and record")) ], default="record") if BoxInfo.getItem("DeepstandbySupport"): shutdownString = _("go to deep standby") else: shutdownString = _("shut down") config.recording.default_afterevent = ConfigSelection(choices=[ ("0", _("do nothing")), ("1", _("go to standby")), ("2", shutdownString), ("3", _("auto")) ], default="3") config.recording.include_ait = ConfigYesNo(default=False) config.recording.show_rec_symbol_for_rec_types = ConfigSelection( choices=[("any", _("any recordings")), ("real", _("real recordings")), ("real_streaming", _("real recordings or streaming")), ("real_pseudo", _("real or pseudo recordings"))], default="real_streaming") config.recording.warn_box_restart_rec_types = ConfigSelection( choices=[("any", _("any recordings")), ("real", _("real recordings")), ("real_streaming", _("real recordings or streaming")), ("real_pseudo", _("real or pseudo recordings"))], default="real_streaming") config.recording.ask_to_abort_pseudo_rec = ConfigSelection( choices=[("ask", _("ask user")), ("abort_no_msg", _("just abort, no message")), ("abort_msg", _("just abort, show message")), ("never_abort", _("never abort"))], default="abort_msg") config.recording.ask_to_abort_streaming = ConfigSelection( choices=[("ask", _("ask user")), ("abort_no_msg", _("just abort, no message")), ("abort_msg", _("just abort, show message")), ("never_abort", _("never abort"))], default="abort_msg") config.recording.ask_to_abort_pip = ConfigSelection(choices=[ ("ask", _("ask user")), ("abort_no_msg", _("just abort, no message")), ("abort_msg", _("just abort, show message")), ("never_abort", _("never abort")) ], default="abort_msg") config.recording.prepare_time = ConfigSelectionNumber(min=20, max=120, stepwidth=10, default=20, wraparound=True)
# Globals gPushService = None # Config options config.pushservice = ConfigSubsection() config.pushservice.about = ConfigNothing() config.pushservice.enable = ConfigOnOff(default=True) config.pushservice.boxname = ConfigText(default="Enigma2", fixed_size=False) config.pushservice.xmlpath = ConfigText(default="/etc/enigma2/pushservice.xml", fixed_size=False) config.pushservice.time = ConfigClock(default=0) config.pushservice.period = ConfigSelectionNumber(0, 1000, 1, default=24) config.pushservice.runonboot = ConfigOnOff(default=True) config.pushservice.bootdelay = ConfigSelectionNumber(5, 1000, 5, default=10) config.pushservice.push_errors = ConfigOnOff(default=False) ####################################################### # Plugin configuration def setup(session, **kwargs): try: ### For testing only import ConfigScreen reload(ConfigScreen) ### session.open(ConfigScreen.ConfigScreen)