def fillList(self, arg=None): streams = [] conflist = [] selectedidx = 0 self["key_red"].setBoolean(False) self["key_green"].setBoolean(False) self["key_yellow"].setBoolean(False) self["key_blue"].setBoolean(False) service = self.session.nav.getCurrentService() self.audioTracks = audio = service and service.audioTracks() n = audio and audio.getNumberOfTracks() or 0 subtitlelist = self.getSubtitleList() if self.settings.menupage.value == PAGE_AUDIO: self.setTitle(_("Select audio track")) service = self.session.nav.getCurrentService() self.audioTracks = audio = service and service.audioTracks() n = audio and audio.getNumberOfTracks() or 0 if BoxInfo.getItem("CanDownmixAC3"): if BoxInfo.getItem("model") in ('dm900', 'dm920', 'dm7080', 'dm800'): choice_list = [ ("downmix", _("Downmix")), ("passthrough", _("Passthrough")), ("multichannel", _("convert to multi-channel PCM")), ("hdmi_best", _("use best / controlled by HDMI")) ] self.settings.downmix_ac3 = ConfigSelection( choices=choice_list, default=config.av.downmix_ac3.value) else: self.settings.downmix_ac3 = ConfigOnOff( default=config.av.downmix_ac3.value) self.settings.downmix_ac3.addNotifier(self.changeAC3Downmix, initial_call=False) conflist.append( getConfigListEntry(_("AC3 downmix"), self.settings.downmix_ac3, None)) if BoxInfo.getItem("CanDownmixDTS"): self.settings.downmix_dts = ConfigOnOff( default=config.av.downmix_dts.value) self.settings.downmix_dts.addNotifier(self.changeDTSDownmix, initial_call=False) conflist.append( getConfigListEntry(_("DTS downmix"), self.settings.downmix_dts, None)) if BoxInfo.getItem("CanDownmixAAC"): if BoxInfo.getItem("model") in ('dm900', 'dm920', 'dm7080', 'dm800'): choice_list = [ ("downmix", _("Downmix")), ("passthrough", _("Passthrough")), ("multichannel", _("convert to multi-channel PCM")), ("hdmi_best", _("use best / controlled by HDMI")) ] self.settings.downmix_aac = ConfigSelection( choices=choice_list, default=config.av.downmix_aac.value) elif BoxInfo.getItem("model") in ('gbquad4k', 'gbue4k', 'gbx34k'): 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")) ] self.settings.downmix_aac = ConfigSelection( choices=choice_list, default=config.av.downmix_aac.value) else: self.settings.downmix_aac = ConfigOnOff( default=config.av.downmix_aac.value) self.settings.downmix_aac.addNotifier(self.changeAACDownmix, initial_call=False) conflist.append( getConfigListEntry(_("AAC downmix"), self.settings.downmix_aac, None)) if BoxInfo.getItem("CanDownmixAACPlus"): 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"))] self.settings.downmix_aacplus = ConfigSelection( choices=choice_list, default=config.av.downmix_aacplus.value) self.settings.downmix_aacplus.addNotifier( self.changeAACDownmixPlus, initial_call=False) conflist.append( getConfigListEntry(_("AAC Plus downmix"), self.settings.downmix_aacplus, None)) if BoxInfo.getItem("CanAACTranscode"): choice_list = BoxInfo.getItem("CanAACTranscode") self.settings.transcodeaac = ConfigSelection( choices=choice_list, default=config.av.transcodeaac.value) self.settings.transcodeaac.addNotifier(self.setAACTranscode, initial_call=False) conflist.append( getConfigListEntry(_("AAC transcoding"), self.settings.transcodeaac, None)) if BoxInfo.getItem("CanAC3plusTranscode"): if BoxInfo.getItem("model") in ('dm900', 'dm920', 'dm7080', 'dm800'): 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")) ] self.settings.transcodeac3plus = ConfigSelection( choices=choice_list, default=config.av.transcodeac3plus.value) elif BoxInfo.getItem("model") in ('gbquad4k', 'gbue4k', 'gbx34k'): choice_list = [("downmix", _("Downmix")), ("passthrough", _("Passthrough")), ("force_ac3", _("convert to AC3")), ("multichannel", _("convert to multi-channel PCM")), ("force_dts", _("convert to DTS"))] self.settings.transcodeac3plus = ConfigSelection( choices=choice_list, default=config.av.transcodeac3plus.value) else: choice_list = [("use_hdmi_caps", _("controlled by HDMI")), ("force_ac3", _("convert to AC3"))] self.settings.transcodeac3plus = ConfigSelection( choices=choice_list, default=config.av.transcodeac3plus.value) self.settings.transcodeac3plus.addNotifier( self.setAC3plusTranscode, initial_call=False) conflist.append( getConfigListEntry(_("AC3plus transcoding"), self.settings.transcodeac3plus, None)) if BoxInfo.getItem("CanPcmMultichannel"): if BoxInfo.getItem("model") in ('dm900', 'dm920', 'dm7080', 'dm800'): choice_list = [ ("downmix", _("Downmix")), ("passthrough", _("Passthrough")), ("multichannel", _("convert to multi-channel PCM")), ("hdmi_best", _("use best / controlled by HDMI")) ] self.settings.pcm_multichannel = ConfigSelection( choices=choice_list, default=config.av.pcm_multichannel.value) else: self.settings.pcm_multichannel = ConfigOnOff( default=config.av.pcm_multichannel.value) self.settings.pcm_multichannel.addNotifier( self.changePCMMultichannel, initial_call=False) conflist.append( getConfigListEntry(_("PCM Multichannel"), self.settings.pcm_multichannel, None)) if BoxInfo.getItem("CanDTSHD"): if BoxInfo.getItem("model") in ("dm7080", "dm820"): choice_list = [("use_hdmi_caps", _("controlled by HDMI")), ("force_dts", _("convert to DTS"))] 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")) ] self.settings.dtshd = ConfigSelection( choices=choice_list, default=config.av.dtshd.value) self.settings.dtshd.addNotifier(self.setDTSHD, initial_call=False) conflist.append( getConfigListEntry(_("DTS HD downmix"), self.settings.dtshd, None)) if BoxInfo.getItem("CanWMAPRO"): choice_list = [ ("downmix", _("Downmix")), ("passthrough", _("Passthrough")), ("multichannel", _("convert to multi-channel PCM")), ("hdmi_best", _("use best / controlled by HDMI")) ] self.settings.wmapro = ConfigSelection( choices=choice_list, default=config.av.wmapro.value) self.settings.wmapro.addNotifier(self.setWMAPro, initial_call=False) conflist.append( getConfigListEntry(_("WMA Pro downmix"), self.settings.wmapro, None)) if BoxInfo.getItem("CanBTAudio"): choice_list = [("off", _("Off")), ("on", _("On"))] self.settings.btaudio = ConfigSelection( choices=choice_list, default=config.av.btaudio.value) self.settings.btaudio.addNotifier(self.changeBTAudio, initial_call=False) conflist.append( getConfigListEntry(_("Enable BT Audio"), self.settings.btaudio, None)) if n > 0: self.audioChannel = service.audioChannel() if self.audioChannel: choicelist = [("0", _("left")), ("1", _("stereo")), ("2", _("right"))] self.settings.channelmode = ConfigSelection( choices=choicelist, default=str(self.audioChannel.getCurrentChannel())) self.settings.channelmode.addNotifier(self.changeMode, initial_call=False) conflist.append( getConfigListEntry(_("Audio Channel"), self.settings.channelmode, None)) selectedAudio = self.audioTracks.getCurrentTrack() for x in list(range(n)): number = str(x + 1) i = audio.getTrackInfo(x) languages = i.getLanguage().split('/') description = i.getDescription() or "" selected = "" language = "" if selectedAudio == x: selected = "X" selectedidx = x cnt = 0 for lang in languages: if cnt: language += ' / ' if lang in LanguageCodes: language += _(LanguageCodes[lang][0]) else: language += lang cnt += 1 streams.append( (x, "", number, description, language, selected)) else: conflist.append(('', )) if BoxInfo.getItem("Can3DSurround"): choice_list = [("none", _("Off")), ("hdmi", _("HDMI")), ("spdif", _("SPDIF")), ("dac", _("DAC"))] self.settings.surround_3d = ConfigSelection( choices=choice_list, default=config.av.surround_3d.value) self.settings.surround_3d.addNotifier(self.change3DSurround, initial_call=False) conflist.append( getConfigListEntry(_("3D Surround"), self.settings.surround_3d, None)) if BoxInfo.getItem( "Can3DSpeaker") and config.av.surround_3d.value != "none": choice_list = [("center", _("center")), ("wide", _("wide")), ("extrawide", _("extra wide"))] self.settings.surround_3d_speaker = ConfigSelection( choices=choice_list, default=config.av.surround_3d_speaker.value) self.settings.surround_3d_speaker.addNotifier( self.change3DSurroundSpeaker, initial_call=False) conflist.append( getConfigListEntry(_("3D Surround Speaker Position"), self.settings.surround_3d_speaker, None)) if BoxInfo.getItem("CanAutoVolume"): choice_list = [("none", _("Off")), ("hdmi", _("HDMI")), ("spdif", _("SPDIF")), ("dac", _("DAC"))] self.settings.autovolume = ConfigSelection( choices=choice_list, default=config.av.autovolume.value) self.settings.autovolume.addNotifier(self.changeAutoVolume, initial_call=False) conflist.append( getConfigListEntry(_("Auto Volume Level"), self.settings.autovolume, None)) from Components.PluginComponent import plugins from Plugins.Plugin import PluginDescriptor if hasattr(self.infobar, "runPlugin"): class PluginCaller: def __init__(self, fnc, *args): self.fnc = fnc self.args = args def __call__(self, *args, **kwargs): self.fnc(*self.args) Plugins = [(p.name, PluginCaller(self.infobar.runPlugin, p)) for p in plugins.getPlugins( where=PluginDescriptor.WHERE_AUDIOMENU)] if len(Plugins): for x in Plugins: if x[0] != 'AudioEffect': # always make AudioEffect Blue button. conflist.append( getConfigListEntry(x[0], ConfigNothing(), x[1])) elif self.settings.menupage.value == PAGE_SUBTITLES: self.setTitle(_("Subtitle selection")) idx = 0 if (subtitlelist is not None): for x in subtitlelist: number = str(x[1]) description = "?" language = "" selected = "" if self.selectedSubtitle and x[: 4] == self.selectedSubtitle[: 4]: selected = "X" selectedidx = idx try: if x[4] != "und": if x[4] in LanguageCodes: language = _(LanguageCodes[x[4]][0]) else: language = x[4] except: language = "" if x[0] == 0: description = "DVB" number = "%x" % (x[1]) elif x[0] == 1: description = "teletext" number = "%x%02x" % (x[3] and x[3] or 8, x[2]) elif x[0] == 2: types = ("unknown", "embedded", "SSA file", "ASS file", "SRT file", "VOB file", "PGS file") try: description = types[x[2]] except: description = _("unknown") + ": %s" % x[2] number = str(int(number) + 1) streams.append( (x, "", number, description, language, selected)) idx += 1 if self.infobar.selected_subtitle and self.infobar.selected_subtitle != ( 0, 0, 0, 0) and not ".DVDPlayer'>" in repr(self.infobar): conflist.append( getConfigListEntry(_("Subtitle Quickmenu"), ConfigNothing(), None)) if len(conflist) > 0 and conflist[0][0]: self["key_red"].setBoolean(True) if len(conflist) > 1 and conflist[1][0]: self["key_green"].setBoolean(True) if len(conflist) > 2 and conflist[2][0]: self["key_yellow"].setBoolean(True) if len(conflist) > 3 and conflist[3][0]: self["key_blue"].setBoolean(True) self["config"].list = conflist self["config"].l.setList(conflist) self["streams"].list = streams self["streams"].setIndex(selectedidx)
config.autoshutdown.media_file = ConfigText(default="") config.autoshutdown.disable_at_ts = ConfigYesNo(default=False) config.autoshutdown.disable_net_device = ConfigYesNo(default=False) config.autoshutdown.disable_hdd = ConfigYesNo(default=False) config.autoshutdown.net_device = ConfigIP(default=[0, 0, 0, 0]) config.autoshutdown.exclude_time_in = ConfigYesNo(default=False) config.autoshutdown.exclude_time_in_begin = ConfigClock( default=calculateTime(20, 0)) config.autoshutdown.exclude_time_in_end = ConfigClock( default=calculateTime(0, 0)) config.autoshutdown.exclude_time_off = ConfigYesNo(default=False) config.autoshutdown.exclude_time_off_begin = ConfigClock( default=calculateTime(20, 0)) config.autoshutdown.exclude_time_off_end = ConfigClock( default=calculateTime(0, 0)) config.autoshutdown.fake_entry = NoSave(ConfigNothing()) def checkIP(ip_address): ip_address = "%s.%s.%s.%s" % (ip_address[0], ip_address[1], ip_address[2], ip_address[3]) ping_ret = os.system("ping -q -w1 -c1 " + ip_address) if ping_ret == 0: return True else: return False def checkHardDisk(): if harddiskmanager.HDDCount(): for hdd in harddiskmanager.HDDList():
def getInitConfig(self): global cur_skin self.is_atile = False if cur_skin == 'AtileHD': self.is_atile = True self.title = _("%s - Setup") % cur_skin self.skin_base_dir = "/usr/share/enigma2/%s/" % cur_skin if self.is_atile: self.default_font_file = "font_atile_Roboto.xml" self.default_color_file = "colors_atile_Grey_transparent.xml" else: self.default_sb_file = "sb_Original.xml" self.default_color_file = "colors_Original.xml" self.default_frame_file = "frame_Original.xml" self.default_center_file = "center_Original.xml" self.default_lines_file = "lines_Original.xml" self.default_sbar_file = "sbar_Original.xml" self.default_infobar_file = "infobar_Original.xml" self.default_wget_file = "wget_Original.xml" self.default_sib_file = "sib_Original.xml" self.default_ch_se_file = "ch_se_Original.xml" self.default_ev_file = "ev_Original.xml" self.default_emcsel_file = "emcsel_Original.xml" self.default_movsel_file = "movsel_Original.xml" self.default_volume_file = "volume_Original.xml" self.color_file = "skin_user_colors.xml" self.sb_file = "skin_user_sb.xml" self.frame_file = "skin_user_frame.xml" self.center_file = "skin_user_center.xml" self.lines_file = "skin_user_lines.xml" self.sbar_file = "skin_user_sbar.xml" self.infobar_file = "skin_user_infobar.xml" self.wget_file = "skin_user_wget.xml" self.sib_file = "skin_user_sib.xml" self.ch_se_file = "skin_user_ch_se.xml" self.ev_file = "skin_user_ev.xml" self.emcsel_file = "skin_user_emcsel.xml" self.movsel_file = "skin_user_movsel.xml" self.volume_file = "skin_user_volume.xml" # color current, choices = self.getSettings(self.default_color_file, self.color_file) self.myAtileHD_color = NoSave(ConfigSelection(default=current, choices=choices)) # sb current, choices = self.getSettings(self.default_sb_file, self.sb_file) self.myAtileHD_sb = NoSave(ConfigSelection(default=current, choices=choices)) # frame current, choices = self.getSettings(self.default_frame_file, self.frame_file) self.myAtileHD_frame = NoSave(ConfigSelection(default=current, choices=choices)) # center current, choices = self.getSettings(self.default_center_file, self.center_file) self.myAtileHD_center = NoSave(ConfigSelection(default=current, choices=choices)) # lines current, choices = self.getSettings(self.default_lines_file, self.lines_file) self.myAtileHD_lines = NoSave(ConfigSelection(default=current, choices=choices)) # sbar current, choices = self.getSettings(self.default_sbar_file, self.sbar_file) self.myAtileHD_sbar = NoSave(ConfigSelection(default=current, choices=choices)) # infobar current, choices = self.getSettings(self.default_infobar_file, self.infobar_file) self.myAtileHD_infobar = NoSave(ConfigSelection(default=current, choices=choices)) # wget current, choices = self.getSettings(self.default_wget_file, self.wget_file) self.myAtileHD_wget = NoSave(ConfigSelection(default=current, choices=choices)) # sib current, choices = self.getSettings(self.default_sib_file, self.sib_file) self.myAtileHD_sib = NoSave(ConfigSelection(default=current, choices=choices)) # ch_se current, choices = self.getSettings(self.default_ch_se_file, self.ch_se_file) self.myAtileHD_ch_se = NoSave(ConfigSelection(default=current, choices=choices)) # ev current, choices = self.getSettings(self.default_ev_file, self.ev_file) self.myAtileHD_ev = NoSave(ConfigSelection(default=current, choices=choices)) # emcsel current, choices = self.getSettings(self.default_emcsel_file, self.emcsel_file) self.myAtileHD_emcsel = NoSave(ConfigSelection(default=current, choices=choices)) # movsel current, choices = self.getSettings(self.default_movsel_file, self.movsel_file) self.myAtileHD_movsel = NoSave(ConfigSelection(default=current, choices=choices)) # volume current, choices = self.getSettings(self.default_volume_file, self.volume_file) self.myAtileHD_volume = NoSave(ConfigSelection(default=current, choices=choices)) # myatile myatile_active = self.getmyAtileState() self.myAtileHD_active = NoSave(ConfigYesNo(default=myatile_active)) self.myAtileHD_fake_entry = NoSave(ConfigNothing())
def createSetup(self, initial=False): self.reloadLists = None self.list = [] if config.ParentalControl.servicepin[ 0].value or config.ParentalControl.servicepinactive.value or config.ParentalControl.setuppinactive.value or not initial: if config.ParentalControl.servicepin[0].value: pin_entry_text = _("Change PIN") + _( ": 0000 - default (disabled)") else: pin_entry_text = _("Set PIN") self.changePin = getConfigListEntry(pin_entry_text, NoSave(ConfigNothing())) self.list.append(self.changePin) self.list.append( getConfigListEntry(_("Protect services"), config.ParentalControl.servicepinactive)) if config.ParentalControl.servicepinactive.value: self.list.append( getConfigListEntry(_("Remember service PIN"), config.ParentalControl.storeservicepin)) if config.ParentalControl.storeservicepin.value != "never": self.list.append( getConfigListEntry( _("Hide parentel locked services"), config.ParentalControl.hideBlacklist)) self.list.append( getConfigListEntry(_("Protect on epg age"), config.ParentalControl.age)) self.reloadLists = getConfigListEntry(_("Reload blacklists"), NoSave(ConfigNothing())) self.list.append(self.reloadLists) self.list.append( getConfigListEntry(_("Protect Screens"), config.ParentalControl.setuppinactive)) if config.ParentalControl.setuppinactive.value: self.list.append( getConfigListEntry( _("Protect main menu"), config.ParentalControl.config_sections.main_menu)) self.list.append( getConfigListEntry( _("Protect timer menu"), config.ParentalControl.config_sections.timer_menu)) self.list.append( getConfigListEntry( _("Protect plugin browser"), config.ParentalControl.config_sections.plugin_browser)) self.list.append( getConfigListEntry( _("Protect configuration"), config.ParentalControl.config_sections.configuration)) self.list.append( getConfigListEntry( _("Protect standby menu"), config.ParentalControl.config_sections.standby_menu)) self.list.append( getConfigListEntry( _("Protect software update screen"), config. ParentalControl.config_sections.software_update)) self.list.append( getConfigListEntry( _("Protect manufacturer reset screen"), config. ParentalControl.config_sections.manufacturer_reset)) self.list.append( getConfigListEntry( _("Protect movie list"), config.ParentalControl.config_sections.movie_list)) self.list.append( getConfigListEntry( _("Protect context menus"), config.ParentalControl.config_sections.context_menus)) if config.usage.menu_sort_mode.value == "user": self.list.append( getConfigListEntry( _("Protect menu sort"), config.ParentalControl.config_sections.menu_sort)) else: self.changePin = getConfigListEntry( _("Enable parental protection"), NoSave(ConfigNothing())) self.list.append(self.changePin) self["config"].list = self.list self["config"].setList(self.list)
t = gettext.gettext(txt) return t def removeBad(val): if six.PY3: return val.replace('\x86', '').replace('\x87', '') else: return val.replace('\xc2\x86', '').replace('\xc2\x87', '') localeInit() language.addCallback(localeInit) config.plugins.autotimer = ConfigSubsection() config.plugins.autotimer.nothing = ConfigNothing() config.plugins.autotimer.autopoll = ConfigYesNo(default=True) config.plugins.autotimer.delay = ConfigNumber(default=3) config.plugins.autotimer.editdelay = ConfigNumber(default=3) config.plugins.autotimer.interval = ConfigNumber(default=12) config.plugins.autotimer.timeout = ConfigNumber(default=5) config.plugins.autotimer.popup_timeout = ConfigNumber(default=5) config.plugins.autotimer.check_eit_and_remove = ConfigYesNo(default=False) config.plugins.autotimer.always_write_config = ConfigYesNo(default=True) config.plugins.autotimer.refresh = ConfigSelection(choices=[ ("none", _("None")), ("auto", _("Only AutoTimers created during this session")), ("all", _("All non-repeating timers")) ], default="none") config.plugins.autotimer.remove_double_and_conflicts_timers = ConfigSelection(
from enigma import eSize, ePoint, eRect, gFont, eWindow, eLabel, ePixmap, eWindowStyleManager, addFont, gRGB, eWindowStyleSkinned, getDesktop from Components.config import ConfigSubsection, ConfigText, config, ConfigYesNo, ConfigSelection, ConfigNothing from Components.Converter.Converter import Converter from Components.Sources.Source import Source, ObsoleteSource from Tools.Directories import resolveFilename, SCOPE_SKIN, SCOPE_SKIN_IMAGE, SCOPE_FONTS, SCOPE_ACTIVE_SKIN, SCOPE_ACTIVE_LCDSKIN, SCOPE_CURRENT_SKIN, SCOPE_CONFIG, fileExists from Tools.Import import my_import from Tools.LoadPixmap import LoadPixmap from Components.RcModel import rc_model from boxbranding import getBoxType config.vfd = ConfigSubsection() config.vfd.show = ConfigSelection([("skin_text.xml", _("Channel Name")), ("skin_text_clock.xml", _("Clock"))], "skin_text.xml") if not os.path.exists("/usr/share/enigma2/skin_text.xml"): config.vfd.show = ConfigNothing() colorNames = {} # Predefined fonts, typically used in built-in screens and for components like # the movie list and so. fonts = { "Body": ("Regular", 18, 22, 16), "ChoiceList": ("Regular", 20, 24, 18), } parameters = {} def dump(x, i=0): print " " * i + str(x) try:
def InitLcd(): if SystemInfo["HasNoDisplay"]: detected = False elif getBoxType() in ('gbtrio4k', ): detected = True else: detected = eDBoxLCD.getInstance().detected() ilcd = LCD() SystemInfo["Display"] = detected config.lcd = ConfigSubsection() if fileExists("/proc/stb/lcd/mode"): f = open("/proc/stb/lcd/mode", "r") can_lcdmodechecking = f.read().strip().split(" ") print("[LCD] LCDMiniTV", can_lcdmodechecking) f.close() else: can_lcdmodechecking = False if SystemInfo["PowerLED"]: def setPowerLEDstate(configElement): print("[LCD] PowerLED = %s" % SystemInfo["PowerLED"]) f = open("/proc/stb/power/powerled", "w") f.write(configElement.value) f.close() config.lcd.powerled = ConfigSelection(default="on", choices=[("off", _("Off")), ("on", _("On"))]) config.lcd.powerled.addNotifier(setPowerLEDstate) if SystemInfo["PowerLED2"]: def setPowerLEDstate2(configElement): print("[LCD] PowerLED2 = %s" % SystemInfo["PowerLED2"]) f = open("/proc/stb/power/powerled2", "w") f.write(configElement.value) f.close() config.lcd.powerled2 = ConfigSelection(default="on", choices=[("off", _("Off")), ("on", _("On"))]) config.lcd.powerled2.addNotifier(setPowerLEDstate2) if SystemInfo["StandbyLED"]: def setPowerLEDstanbystate(configElement): print("[LCD] StandbyLED = %s configElement = %s" % (SystemInfo["StandbyLED"], configElement.value)) f = open("/proc/stb/power/standbyled", "w") f.write(configElement.value) f.close() config.lcd.standbyLED = ConfigSelection(default="on", choices=[("off", _("Off")), ("on", _("On"))]) config.lcd.standbyLED.addNotifier(setPowerLEDstanbystate) if SystemInfo["SuspendLED"]: def setPowerLEDdeepstanbystate(configElement): print("[LCD] SuspendLED = %s configElement = %s" % (SystemInfo["SuspendLED"], configElement.value)) f = open("/proc/stb/power/suspendled", "w") f.write(configElement.value) f.close() config.lcd.suspendLED = ConfigSelection(default="on", choices=[("off", _("Off")), ("on", _("On"))]) config.lcd.suspendLED.addNotifier(setPowerLEDdeepstanbystate) if SystemInfo["LedPowerColor"]: def setLedPowerColor(configElement): f = open("/proc/stb/fp/ledpowercolor", "w") f.write(configElement.value) f.close() config.lcd.ledpowercolor = ConfigSelection(default="1", choices=[("0", _("off")), ("1", _("blue")), ("2", _("red")), ("3", _("violet")) ]) config.lcd.ledpowercolor.addNotifier(setLedPowerColor) if SystemInfo["LedStandbyColor"]: def setLedStandbyColor(configElement): f = open("/proc/stb/fp/ledstandbycolor", "w") f.write(configElement.value) f.close() config.lcd.ledstandbycolor = ConfigSelection(default="3", choices=[("0", _("off")), ("1", _("blue")), ("2", _("red")), ("3", _("violet"))]) config.lcd.ledstandbycolor.addNotifier(setLedStandbyColor) if SystemInfo["LedSuspendColor"]: def setLedSuspendColor(configElement): f = open("/proc/stb/fp/ledsuspendledcolor", "w") f.write(configElement.value) f.close() config.lcd.ledsuspendcolor = ConfigSelection(default="2", choices=[("0", _("off")), ("1", _("blue")), ("2", _("red")), ("3", _("violet"))]) config.lcd.ledsuspendcolor.addNotifier(setLedSuspendColor) if SystemInfo["Power24x7On"]: def setPower24x7On(configElement): f = open("/proc/stb/fp/power4x7on", "w") f.write(configElement.value) f.close() config.lcd.power24x7on = ConfigSelection(default="on", choices=[("off", _("Off")), ("on", _("On"))]) config.lcd.power24x7on.addNotifier(setPower24x7On) if SystemInfo["Power24x7Standby"]: def setPower24x7Standby(configElement): f = open("/proc/stb/fp/power4x7standby", "w") f.write(configElement.value) f.close() config.lcd.power24x7standby = ConfigSelection(default="off", choices=[ ("off", _("Off")), ("on", _("On")) ]) config.lcd.power24x7standby.addNotifier(setPower24x7Standby) if SystemInfo["Power24x7Suspend"]: def setPower24x7Suspend(configElement): f = open("/proc/stb/fp/power4x7suspend", "w") f.write(configElement.value) f.close() config.lcd.power24x7suspend = ConfigSelection(default="off", choices=[ ("off", _("Off")), ("on", _("On")) ]) config.lcd.power24x7suspend.addNotifier(setPower24x7Suspend) if SystemInfo["LEDButtons"]: def setLEDnormalstate(configElement): ilcd.setLEDNormalState(configElement.value) def setLEDdeepstandby(configElement): ilcd.setLEDDeepStandbyState(configElement.value) def setLEDblinkingtime(configElement): ilcd.setLEDBlinkingTime(configElement.value) config.lcd.ledblinkingtime = ConfigSlider(default=5, increment=1, limits=(0, 15)) config.lcd.ledblinkingtime.addNotifier(setLEDblinkingtime) config.lcd.ledbrightnessdeepstandby = ConfigSlider(default=1, increment=1, limits=(0, 15)) config.lcd.ledbrightnessdeepstandby.addNotifier(setLEDnormalstate) config.lcd.ledbrightnessdeepstandby.addNotifier(setLEDdeepstandby) config.lcd.ledbrightnessdeepstandby.apply = lambda: setLEDdeepstandby( config.lcd.ledbrightnessdeepstandby) config.lcd.ledbrightnessstandby = ConfigSlider(default=1, increment=1, limits=(0, 15)) config.lcd.ledbrightnessstandby.addNotifier(setLEDnormalstate) config.lcd.ledbrightnessstandby.apply = lambda: setLEDnormalstate( config.lcd.ledbrightnessstandby) config.lcd.ledbrightness = ConfigSlider(default=3, increment=1, limits=(0, 15)) config.lcd.ledbrightness.addNotifier(setLEDnormalstate) config.lcd.ledbrightness.apply = lambda: setLEDnormalstate( config.lcd.ledbrightness) if SystemInfo["Display"]: config.lcd.scroll_speed = ConfigSelection(default="300", choices=[("500", _("slow")), ("300", _("normal")), ("100", _("fast"))]) config.lcd.scroll_delay = ConfigSelection( default="10000", choices=[("10000", "10 " + _("seconds")), ("20000", "20 " + _("seconds")), ("30000", "30 " + _("seconds")), ("60000", "1 " + _("minute")), ("300000", "5 " + _("minutes")), ("noscrolling", _("off"))]) def setLCDbright(configElement): ilcd.setBright(configElement.value) def setLCDstandbybright(configElement): ilcd.setStandbyBright(configElement.value) def setLCDdimbright(configElement): ilcd.setDimBright(configElement.value) def setLCDdimdelay(configElement): ilcd.setDimDelay(configElement.value) def setLCDcontrast(configElement): ilcd.setContrast(configElement.value) def setLCDinverted(configElement): ilcd.setInverted(configElement.value) def setLCDflipped(configElement): ilcd.setFlipped(configElement.value) def setLCDmode(configElement): ilcd.setMode(configElement.value) def setLCDpower(configElement): ilcd.setPower(configElement.value) def setLCDminitvmode(configElement): ilcd.setLCDMiniTVMode(configElement.value) def setLCDminitvpipmode(configElement): ilcd.setLCDMiniTVPIPMode(configElement.value) def setLCDminitvfps(configElement): ilcd.setLCDMiniTVFPS(configElement.value) standby_default = 0 if not ilcd.isOled(): config.lcd.contrast = ConfigSlider(default=5, limits=(0, 20)) config.lcd.contrast.addNotifier(setLCDcontrast) else: config.lcd.contrast = ConfigNothing() standby_default = 1 config.lcd.standby = ConfigSlider(default=standby_default, limits=(0, 10)) config.lcd.standby.addNotifier(setLCDbright) config.lcd.standby.apply = lambda: setLCDbright(config.lcd.standby) config.lcd.bright = ConfigSlider(default=5, limits=(0, 10)) config.lcd.bright.addNotifier(setLCDbright) config.lcd.bright.apply = lambda: setLCDbright(config.lcd.bright) config.lcd.dimbright = ConfigSlider(default=standby_default, limits=(0, 10)) config.lcd.dimbright.addNotifier(setLCDdimbright) config.lcd.dimbright.apply = lambda: setLCDdimbright(config.lcd. dimbright) config.lcd.dimdelay = ConfigSelection(default="0", choices=[ ("5", "5 " + _("seconds")), ("10", "10 " + _("seconds")), ("15", "15 " + _("seconds")), ("20", "20 " + _("seconds")), ("30", "30 " + _("seconds")), ("60", "1 " + _("minute")), ("120", "2 " + _("minutes")), ("300", "5 " + _("minutes")), ("0", _("off")) ]) config.lcd.dimdelay.addNotifier(setLCDdimdelay) config.lcd.invert = ConfigYesNo(default=False) config.lcd.invert.addNotifier(setLCDinverted) def PiconPackChanged(configElement): configElement.save() config.lcd.picon_pack = ConfigYesNo(default=False) config.lcd.picon_pack.addNotifier(PiconPackChanged) config.lcd.flip = ConfigYesNo(default=False) config.lcd.flip.addNotifier(setLCDflipped) if SystemInfo["LcdPowerOn"]: config.lcd.power = ConfigSelection([("0", _("Off")), ("1", _("On"))], "1") config.lcd.power.addNotifier(setLCDpower) else: config.lcd.power = ConfigNothing() if SystemInfo["LcdLiveTV"]: def lcdLiveTvChanged(configElement): setLCDLiveTv(configElement.value) configElement.save() config.lcd.showTv = ConfigYesNo(default=False) config.lcd.showTv.addNotifier(lcdLiveTvChanged) if "live_enable" in SystemInfo["LcdLiveTV"]: config.misc.standbyCounter.addNotifier( standbyCounterChangedLCDLiveTV, initial_call=False) if SystemInfo["LCDMiniTV"] and getBoxType() not in ('gbquad4k', 'gbue4k'): config.lcd.minitvmode = ConfigSelection( [("0", _("normal")), ("1", _("MiniTV")), ("2", _("OSD")), ("3", _("MiniTV with OSD"))], "0") config.lcd.minitvmode.addNotifier(setLCDminitvmode) config.lcd.minitvpipmode = ConfigSelection( [("0", _("off")), ("5", _("PIP")), ("7", _("PIP with OSD"))], "0") config.lcd.minitvpipmode.addNotifier(setLCDminitvpipmode) config.lcd.minitvfps = ConfigSlider(default=30, limits=(0, 30)) config.lcd.minitvfps.addNotifier(setLCDminitvfps) elif can_lcdmodechecking and getBoxType() in ('gbquad4k', 'gbue4k'): # (0:normal, 1:video0, 2:fb, 3:vide0+fb, 4:video1, 5:vide0+video1, 6:video1+fb, 7:video0+video1+fb) config.lcd.minitvmode = ConfigSelection( default="0", choices=[("0", _("normal")), ("1", _("MiniTV") + _(" - video0")), ("3", _("MiniTV with OSD") + _(" - video0")), ("2", _("OSD")), ("4", _("MiniTV") + _(" - video1")), ("6", _("MiniTV with OSD") + _(" - video1")), ("5", _("MiniTV") + _(" - video0+video1")), ("7", _("MiniTV with OSD") + _(" - video0+video1"))]) config.lcd.minitvmode.addNotifier(setLCDminitvmode) config.lcd.minitvpipmode = ConfigSelection(default="0", choices=[ ("0", _("off")), ("4", _("PIP")), ("6", _("PIP with OSD")) ]) config.lcd.minitvpipmode.addNotifier(setLCDminitvpipmode) config.lcd.minitvfps = ConfigSlider(default=30, limits=(0, 30)) config.lcd.minitvfps.addNotifier(setLCDminitvfps) else: config.lcd.minitvmode = ConfigNothing() config.lcd.minitvpipmode = ConfigNothing() config.lcd.minitvfps = ConfigNothing() if SystemInfo["VFD_scroll_repeats"] and getDisplayType() not in ( '7segment'): def scroll_repeats(el): open(SystemInfo["VFD_scroll_repeats"], "w").write(el.value) choicelist = [("0", _("None")), ("1", _("1X")), ("2", _("2X")), ("3", _("3X")), ("4", _("4X")), ("500", _("Continues"))] config.usage.vfd_scroll_repeats = ConfigSelection( default="3", choices=choicelist) config.usage.vfd_scroll_repeats.addNotifier( scroll_repeats, immediate_feedback=False) if SystemInfo["VFD_scroll_delay"] and getDisplayType() not in ( '7segment'): def scroll_delay(el): open(SystemInfo["VFD_scroll_delay"], "w").write(str(el.value)) config.usage.vfd_scroll_delay = ConfigSlider(default=150, increment=10, limits=(0, 500)) config.usage.vfd_scroll_delay.addNotifier(scroll_delay, immediate_feedback=False) if SystemInfo["VFD_initial_scroll_delay"] and getDisplayType() not in ( '7segment'): def initial_scroll_delay(el): open(SystemInfo["VFD_initial_scroll_delay"], "w").write(el.value) choicelist = [("10000", "10 " + _("seconds")), ("20000", "20 " + _("seconds")), ("30000", "30 " + _("seconds")), ("0", _("no delay"))] config.usage.vfd_initial_scroll_delay = ConfigSelection( default="1000", choices=choicelist) config.usage.vfd_initial_scroll_delay.addNotifier( initial_scroll_delay, immediate_feedback=False) if SystemInfo["VFD_final_scroll_delay"] and getDisplayType() not in ( '7segment'): def final_scroll_delay(el): open(SystemInfo["VFD_final_scroll_delay"], "w").write(el.value) choicelist = [("10000", "10 " + _("seconds")), ("20000", "20 " + _("seconds")), ("30000", "30 " + _("seconds")), ("0", _("no delay"))] config.usage.vfd_final_scroll_delay = ConfigSelection( default="1000", choices=choicelist) config.usage.vfd_final_scroll_delay.addNotifier( final_scroll_delay, immediate_feedback=False) if fileExists("/proc/stb/lcd/show_symbols"): config.lcd.mode = ConfigSelection([("0", _("no")), ("1", _("yes"))], "1") config.lcd.mode.addNotifier(setLCDmode) else: config.lcd.mode = ConfigNothing() else: def doNothing(): pass config.lcd.contrast = ConfigNothing() config.lcd.bright = ConfigNothing() config.lcd.standby = ConfigNothing() config.lcd.bright.apply = lambda: doNothing() config.lcd.standby.apply = lambda: doNothing() config.lcd.mode = ConfigNothing() config.lcd.power = ConfigNothing() config.lcd.ledbrightness = ConfigNothing() config.lcd.ledbrightness.apply = lambda: doNothing() config.lcd.ledbrightnessstandby = ConfigNothing() config.lcd.ledbrightnessstandby.apply = lambda: doNothing() config.lcd.ledbrightnessdeepstandby = ConfigNothing() config.lcd.ledbrightnessdeepstandby.apply = lambda: doNothing() config.lcd.ledblinkingtime = ConfigNothing() config.lcd.picon_pack = ConfigNothing() config.misc.standbyCounter.addNotifier(standbyCounterChanged, initial_call=False)
def createConfig(self, *args): config.pep = ConfigSubsection() config.pep.configsteps = NoSave( ConfigSelection(choices=[1, 5, 10, 25], default=1)) if os_path.exists("/proc/stb/vmpeg/0/pep_contrast"): def setContrast(config): myval = int(config.value * 256) try: print "--> setting contrast to: %0.8X" % myval open("/proc/stb/vmpeg/0/pep_contrast", "w").write("%0.8X" % myval) except IOError: print "couldn't write pep_contrast." if not VideoEnhancement.firstRun: self.setConfiguredValues() config.pep.contrast = ConfigSlider(default=128, limits=(0, 256)) config.pep.contrast.addNotifier(setContrast) else: config.pep.contrast = NoSave(ConfigNothing()) if os_path.exists("/proc/stb/vmpeg/0/pep_saturation"): def setSaturation(config): myval = int(config.value * 256) try: print "--> setting saturation to: %0.8X" % myval open("/proc/stb/vmpeg/0/pep_saturation", "w").write("%0.8X" % myval) except IOError: print "couldn't write pep_saturaion." if not VideoEnhancement.firstRun: self.setConfiguredValues() config.pep.saturation = ConfigSlider(default=128, limits=(0, 256)) config.pep.saturation.addNotifier(setSaturation) else: config.pep.saturation = NoSave(ConfigNothing()) if os_path.exists("/proc/stb/vmpeg/0/pep_hue"): def setHue(config): myval = int(config.value * 256) try: print "--> setting hue to: %0.8X" % myval open("/proc/stb/vmpeg/0/pep_hue", "w").write("%0.8X" % myval) except IOError: print "couldn't write pep_hue." if not VideoEnhancement.firstRun: self.setConfiguredValues() config.pep.hue = ConfigSlider(default=128, limits=(0, 256)) config.pep.hue.addNotifier(setHue) else: config.pep.hue = NoSave(ConfigNothing()) if os_path.exists("/proc/stb/vmpeg/0/pep_brightness"): def setBrightness(config): myval = int(config.value * 256) try: print "--> setting brightness to: %0.8X" % myval open("/proc/stb/vmpeg/0/pep_brightness", "w").write("%0.8X" % myval) except IOError: print "couldn't write pep_brightness." if not VideoEnhancement.firstRun: self.setConfiguredValues() config.pep.brightness = ConfigSlider(default=128, limits=(0, 256)) config.pep.brightness.addNotifier(setBrightness) else: config.pep.brightness = NoSave(ConfigNothing()) if os_path.exists("/proc/stb/vmpeg/0/pep_block_noise_reduction"): def setBlock_noise_reduction(config): myval = int(config.value) try: print "--> setting block_noise_reduction to: %0.8X" % myval open("/proc/stb/vmpeg/0/pep_block_noise_reduction", "w").write("%0.8X" % myval) except IOError: print "couldn't write pep_block_noise_reduction." if not VideoEnhancement.firstRun: self.setConfiguredValues() config.pep.block_noise_reduction = ConfigSlider(default=0, limits=(0, 5)) config.pep.block_noise_reduction.addNotifier( setBlock_noise_reduction) else: config.pep.block_noise_reduction = NoSave(ConfigNothing()) if os_path.exists("/proc/stb/vmpeg/0/pep_mosquito_noise_reduction"): def setMosquito_noise_reduction(config): myval = int(config.value) try: print "--> setting mosquito_noise_reduction to: %0.8X" % myval open("/proc/stb/vmpeg/0/pep_mosquito_noise_reduction", "w").write("%0.8X" % myval) except IOError: print "couldn't write pep_mosquito_noise_reduction." if not VideoEnhancement.firstRun: self.setConfiguredValues() config.pep.mosquito_noise_reduction = ConfigSlider(default=0, limits=(0, 5)) config.pep.mosquito_noise_reduction.addNotifier( setMosquito_noise_reduction) else: config.pep.mosquito_noise_reduction = NoSave(ConfigNothing()) if os_path.exists("/proc/stb/vmpeg/0/pep_digital_contour_removal"): def setDigital_contour_removal(config): myval = int(config.value) try: print "--> setting digital_contour_removal to: %0.8X" % myval open("/proc/stb/vmpeg/0/pep_digital_contour_removal", "w").write("%0.8X" % myval) except IOError: print "couldn't write pep_digital_contour_removal." if not VideoEnhancement.firstRun: self.setConfiguredValues() config.pep.digital_contour_removal = ConfigSlider(default=0, limits=(0, 5)) config.pep.digital_contour_removal.addNotifier( setDigital_contour_removal) else: config.pep.digital_contour_removal = NoSave(ConfigNothing()) if os_path.exists("/proc/stb/vmpeg/0/pep_split"): def setSplitMode(config): try: print "--> setting splitmode to:", str(config.value) open("/proc/stb/vmpeg/0/pep_split", "w").write(str(config.value)) except IOError: print "couldn't write pep_split." if not VideoEnhancement.firstRun: self.setConfiguredValues() config.pep.split = ConfigSelection(choices={ "off": _("Off"), "left": _("Left"), "right": _("Right") }, default="off") config.pep.split.addNotifier(setSplitMode) else: config.pep.split = NoSave(ConfigNothing()) if os_path.exists("/proc/stb/vmpeg/0/pep_sharpness"): def setSharpness(config): myval = int(config.value * 256) try: print "--> setting sharpness to: %0.8X" % myval open("/proc/stb/vmpeg/0/pep_sharpness", "w").write("%0.8X" % myval) except IOError: print "couldn't write pep_sharpness." if not VideoEnhancement.firstRun: self.setConfiguredValues() if getBoxType() == 'gbquad' or getBoxType() == 'gbquadplus': config.pep.sharpness = ConfigSlider(default=256, limits=(0, 256)) else: config.pep.sharpness = ConfigSlider(default=0, limits=(0, 256)) config.pep.sharpness.addNotifier(setSharpness) else: config.pep.sharpness = NoSave(ConfigNothing()) if os_path.exists("/proc/stb/vmpeg/0/pep_auto_flesh"): def setAutoflesh(config): myval = int(config.value) try: print "--> setting auto_flesh to: %0.8X" % myval open("/proc/stb/vmpeg/0/pep_auto_flesh", "w").write("%0.8X" % myval) except IOError: print "couldn't write pep_auto_flesh." if not VideoEnhancement.firstRun: self.setConfiguredValues() config.pep.auto_flesh = ConfigSlider(default=0, limits=(0, 4)) config.pep.auto_flesh.addNotifier(setAutoflesh) else: config.pep.auto_flesh = NoSave(ConfigNothing()) if os_path.exists("/proc/stb/vmpeg/0/pep_green_boost"): def setGreenboost(config): myval = int(config.value) try: print "--> setting green_boost to: %0.8X" % myval open("/proc/stb/vmpeg/0/pep_green_boost", "w").write("%0.8X" % myval) except IOError: print "couldn't write pep_green_boost." if not VideoEnhancement.firstRun: self.setConfiguredValues() config.pep.green_boost = ConfigSlider(default=0, limits=(0, 4)) config.pep.green_boost.addNotifier(setGreenboost) else: config.pep.green_boost = NoSave(ConfigNothing()) if os_path.exists("/proc/stb/vmpeg/0/pep_blue_boost"): def setBlueboost(config): myval = int(config.value) try: print "--> setting blue_boost to: %0.8X" % myval open("/proc/stb/vmpeg/0/pep_blue_boost", "w").write("%0.8X" % myval) except IOError: print "couldn't write pep_blue_boost." if not VideoEnhancement.firstRun: self.setConfiguredValues() config.pep.blue_boost = ConfigSlider(default=0, limits=(0, 4)) config.pep.blue_boost.addNotifier(setBlueboost) else: config.pep.blue_boost = NoSave(ConfigNothing()) if os_path.exists("/proc/stb/vmpeg/0/pep_dynamic_contrast"): def setDynamic_contrast(config): myval = int(config.value) try: print "--> setting dynamic_contrast to: %0.8X" % myval open("/proc/stb/vmpeg/0/pep_dynamic_contrast", "w").write("%0.8X" % myval) except IOError: print "couldn't write pep_dynamic_contrast." if not VideoEnhancement.firstRun: self.setConfiguredValues() if getBoxType() == 'gbquad' or getBoxType() == 'gbquadplus': config.pep.dynamic_contrast = ConfigSlider(default=3, limits=(0, 256)) else: config.pep.dynamic_contrast = ConfigSlider(default=0, limits=(0, 256)) config.pep.dynamic_contrast.addNotifier(setDynamic_contrast) else: config.pep.dynamic_contrast = NoSave(ConfigNothing()) try: x = config.av.scaler_sharpness.value except KeyError: if os_path.exists("/proc/stb/vmpeg/0/pep_scaler_sharpness"): 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) except IOError: print "couldn't write pep_scaler_sharpness." if not VideoEnhancement.firstRun: self.setConfiguredValues() if getBoxType() == 'gbquad' or getBoxType() == 'gbquadplus': config.av.scaler_sharpness = ConfigSlider(default=13, 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 VideoEnhancement.firstRun: self.setConfiguredValues() VideoEnhancement.firstRun = False
def createConfigList(self): self.set_color = getConfigListEntry(_("Style:"), self.myAtileHD_color) self.set_sb = getConfigListEntry(_("ColorSelectedBackground:"), self.myAtileHD_sb) self.set_frame = getConfigListEntry(_("Frame:"), self.myAtileHD_frame) self.set_center = getConfigListEntry(_("Center:"), self.myAtileHD_center) self.set_lines = getConfigListEntry(_("Lines:"), self.myAtileHD_lines) self.set_sbar = getConfigListEntry(_("Scrollbar:"), self.myAtileHD_sbar) self.set_infobar = getConfigListEntry(_("Infobar:"), self.myAtileHD_infobar) self.set_wget = getConfigListEntry(_("Clock_Widget:"), self.myAtileHD_wget) self.set_sib = getConfigListEntry(_("Secondinfobar:"), self.myAtileHD_sib) self.set_ch_se = getConfigListEntry(_("Channelselection:"), self.myAtileHD_ch_se) self.set_ev = getConfigListEntry(_("Eventview:"), self.myAtileHD_ev) self.set_emcsel = getConfigListEntry(_("EMC_Selection:"), self.myAtileHD_emcsel) self.set_movsel = getConfigListEntry(_("Movie_Selection:"), self.myAtileHD_movsel) self.set_volume = getConfigListEntry(_("Volume:"), self.myAtileHD_volume) self.set_myatile = getConfigListEntry( _("Enable %s pro:") % cur_skin, self.myAtileHD_active) self.set_new_skin = getConfigListEntry(_("Change skin"), ConfigNothing()) self.find_woeid = getConfigListEntry(_("Search weather location ID"), ConfigNothing()) self.list = [] self.list.append(self.set_myatile) if self.myAtileHD_active.value: if len(self.myAtileHD_color.choices) > 1: self.list.append(self.set_color) if len(self.myAtileHD_sb.choices) > 1: self.list.append(self.set_sb) if len(self.myAtileHD_frame.choices) > 1: self.list.append(self.set_frame) if len(self.myAtileHD_center.choices) > 1: self.list.append(self.set_center) if len(self.myAtileHD_lines.choices) > 1: self.list.append(self.set_lines) if len(self.myAtileHD_sbar.choices) > 1: self.list.append(self.set_sbar) if len(self.myAtileHD_infobar.choices) > 1: self.list.append(self.set_infobar) if len(self.myAtileHD_wget.choices) > 1: self.list.append(self.set_wget) if len(self.myAtileHD_sib.choices) > 1: self.list.append(self.set_sib) if len(self.myAtileHD_ch_se.choices) > 1: self.list.append(self.set_ch_se) if len(self.myAtileHD_ev.choices) > 1: self.list.append(self.set_ev) if len(self.myAtileHD_emcsel.choices) > 1: self.list.append(self.set_emcsel) if len(self.myAtileHD_movsel.choices) > 1: self.list.append(self.set_movsel) if len(self.myAtileHD_volume.choices) > 1: self.list.append(self.set_volume) self.list.append(self.set_new_skin) self["config"].list = self.list self["config"].l.setList(self.list) if self.myAtileHD_active.value: self["key_yellow"].setText("%s pro" % cur_skin) else: self["key_yellow"].setText("")
def createSetup(self): self.changePin = None self.reloadLists = None self.list = [] self.list.append( getConfigListEntry(_('Protect services'), config.ParentalControl.servicepinactive)) if config.ParentalControl.servicepinactive.value: self.changePin = getConfigListEntry(_('Change PIN'), NoSave(ConfigNothing())) self.list.append(self.changePin) self.list.append( getConfigListEntry(_('Remember service PIN'), config.ParentalControl.storeservicepin)) if config.ParentalControl.storeservicepin.value != 'never': self.list.append( getConfigListEntry(_('Hide parentel locked services'), config.ParentalControl.hideBlacklist)) self.list.append( getConfigListEntry(_('Protect on epg age'), config.ParentalControl.age)) self.reloadLists = getConfigListEntry(_('Reload blacklists'), NoSave(ConfigNothing())) self.list.append(self.reloadLists) self.list.append( getConfigListEntry(_('Protect Screens'), config.ParentalControl.setuppinactive)) if config.ParentalControl.setuppinactive.value: if not self.changePin: self.changePin = getConfigListEntry(_('Change PIN'), NoSave(ConfigNothing())) self.list.append(self.changePin) self.list.append( getConfigListEntry( _('Protect main menu'), config.ParentalControl.config_sections.main_menu)) if not config.ParentalControl.config_sections.main_menu.value: self.list.append( getConfigListEntry( _('Protect timer menu'), config.ParentalControl.config_sections.timer_menu)) self.list.append( getConfigListEntry( _('Protect plugin browser'), config.ParentalControl.config_sections.plugin_browser)) self.list.append( getConfigListEntry( _('Protect configuration'), config.ParentalControl.config_sections.configuration)) self.list.append( getConfigListEntry( _('Protect standby menu'), config.ParentalControl.config_sections.standby_menu)) self.list.append( getConfigListEntry( _('Protect movie list'), config.ParentalControl.config_sections.movie_list)) self.list.append( getConfigListEntry( _('Protect context menus'), config.ParentalControl.config_sections.context_menus)) self.list.append( getConfigListEntry( _('Protect Quickmenu'), config.ParentalControl.config_sections.quickmenu)) self.list.append( getConfigListEntry( _('Protect InfoPanel'), config.ParentalControl.config_sections.infopanel)) self['config'].list = self.list self['config'].setList(self.list) return
import os from Components.Language import language from Components.config import config, ConfigSubsection, ConfigSelection, \ ConfigDirectory, ConfigYesNo, ConfigNothing, getConfigListEntry, \ NoSave from Tools.Directories import SCOPE_PLUGINS, resolveFilename from Plugins.Extensions.archivCZSK import log, UpdateInfo, _ from Plugins.Extensions.archivCZSK.engine.player.info import videoPlayerInfo from Plugins.Extensions.archivCZSK.engine.tools import stb LANGUAGE_SETTINGS_ID = language.getLanguage()[:2] MENU_SEPARATOR = getConfigListEntry( "----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------", NoSave(ConfigNothing())) ############ STB Info ############### (MANUFACTURER, MODEL, ARCH, VERSION) = stb.getBoxtype() ######### Plugin Paths ############## ENIGMA_PLUGIN_PATH = os.path.join(resolveFilename(SCOPE_PLUGINS), 'Extensions') PLUGIN_PATH = os.path.join(ENIGMA_PLUGIN_PATH, 'archivCZSK') IMAGE_PATH = os.path.join(PLUGIN_PATH, 'gui/icon') SKIN_PATH = os.path.join(PLUGIN_PATH, 'gui/skins') REPOSITORY_PATH = os.path.join(PLUGIN_PATH, 'resources/repositories/addons') CUSTOM_FONTS_PATH = os.path.join(SKIN_PATH, 'font.json') CUSTOM_COLORS_PATH = os.path.join(SKIN_PATH, 'color.json') CUSTOM_SIZES_PATH = os.path.join(SKIN_PATH, 'sizes.json')
def createSetup(self): self.editListEntry = None self.changePin = None self.changeSetupPin = None self.list = [] self.list.append( getConfigListEntry(_("Enable parental control"), config.ParentalControl.configured)) self.editBouquetListEntry = -1 self.reloadLists = -1 if config.ParentalControl.configured.value: #self.list.append(getConfigListEntry(_("Configuration mode"), config.ParentalControl.mode)) self.list.append( getConfigListEntry(_("Protect setup"), config.ParentalControl.setuppinactive)) if config.ParentalControl.setuppinactive.value: self.list.append( getConfigListEntry( _("Protect main menu"), config.ParentalControl.config_sections.main_menu)) self.list.append( getConfigListEntry( _("Protect configuration"), config.ParentalControl.config_sections.configuration)) self.list.append( getConfigListEntry( _("Protect timer menu"), config.ParentalControl.config_sections.timer_menu)) self.list.append( getConfigListEntry( _("Protect movie list"), config.ParentalControl.config_sections.movie_list)) self.list.append( getConfigListEntry( _("Protect plugin browser"), config.ParentalControl.config_sections.plugin_browser)) self.list.append( getConfigListEntry( _("Protect standby menu"), config.ParentalControl.config_sections.standby_menu)) self.list.append( getConfigListEntry( _("Protect Quickmenu"), config.ParentalControl.config_sections.quickmenu)) self.list.append( getConfigListEntry( _("Protect InfoPanel"), config.ParentalControl.config_sections.infopanel)) self.changeSetupPin = getConfigListEntry( _("Change setup PIN"), NoSave(ConfigNothing())) self.list.append(self.changeSetupPin) self.list.append( getConfigListEntry(_("Protect services"), config.ParentalControl.servicepinactive)) if config.ParentalControl.servicepinactive.value: self.list.append( getConfigListEntry(_("Parental control type"), config.ParentalControl.type)) if config.ParentalControl.mode.value == "complex": self.changePin = getConfigListEntry( _("Change service PINs"), NoSave(ConfigNothing())) self.list.append(self.changePin) elif config.ParentalControl.mode.value == "simple": self.changePin = getConfigListEntry( _("Change service PIN"), NoSave(ConfigNothing())) self.list.append(self.changePin) #Added Option to remember the service pin self.list.append( getConfigListEntry(_("Remember service PIN"), config.ParentalControl.storeservicepin)) self.editListEntry = getConfigListEntry( _("Edit services list"), NoSave(ConfigNothing())) self.list.append(self.editListEntry) #New funtion: Possibility to add Bouquets to whitelist / blacklist self.editBouquetListEntry = getConfigListEntry( _("Edit bouquets list"), NoSave(ConfigNothing())) self.list.append(self.editBouquetListEntry) #New option to reload service lists (for example if bouquets have changed) self.reloadLists = getConfigListEntry( _("Reload black-/white lists"), NoSave(ConfigNothing())) self.list.append(self.reloadLists) self["config"].list = self.list self["config"].setList(self.list)
def createSetup(self): self.list = [ getConfigListEntry(_("Enable Autoresolution"), config.plugins.autoresolution.enable) ] if config.plugins.autoresolution.enable.value: if usable: self.list.append( getConfigListEntry(_("Mode"), config.plugins.autoresolution.mode)) if config.plugins.autoresolution.mode.value == "manual": for mode, label in resolutions: self.list.append( getConfigListEntry( label, videoresolution_dictionary[mode])) if "720p" in config.av.videorate: self.list.append( getConfigListEntry( _("Refresh Rate") + " 720p", config.av.videorate["720p"])) if "1080i" in config.av.videorate: self.list.append( getConfigListEntry( _("Refresh Rate") + " 1080i", config.av.videorate["1080i"])) if "1080p" in config.av.videorate: self.list.append( getConfigListEntry( _("Refresh Rate") + " 1080p", config.av.videorate["1080p"])) if "2160p" in config.av.videorate: self.list.append( getConfigListEntry( _("Refresh Rate") + " 2160p", config.av.videorate["2160p"])) self.list.extend( (getConfigListEntry( _("Show info screen"), config.plugins.autoresolution.showinfo), getConfigListEntry( _("Delay x seconds after service started"), config.plugins.autoresolution.delay_switch_mode), getConfigListEntry( _("Running in testmode"), config.plugins.autoresolution.testmode), getConfigListEntry( _("Deinterlacer mode for interlaced content"), config.plugins.autoresolution.deinterlacer), getConfigListEntry( _("Deinterlacer mode for progressive content"), config.plugins.autoresolution. deinterlacer_progressive))) else: self.list.append( getConfigListEntry( _("Lock timeout"), config.plugins.autoresolution.lock_timeout)) self.list.append( getConfigListEntry( _("Ask before changing videomode"), config.plugins.autoresolution.ask_apply_mode)) if config.plugins.autoresolution.ask_apply_mode.value: self.list.append( getConfigListEntry( _("Message timeout"), config.plugins.autoresolution.ask_timeout)) self.list.append( getConfigListEntry( _("Use 60HZ instead 30HZ"), config.plugins.autoresolution.auto_30_60)) self.list.append( getConfigListEntry( _("Alternative resolution when native not supported" ), config.plugins.autoresolution. auto_24_30_alternative)) else: self.list.append( getConfigListEntry( _("Autoresolution is not working in Scart/DVI-PC Mode" ), ConfigNothing())) elif config.av.videoport.value not in ('DVI-PC', 'Scart'): self.list.append( getConfigListEntry( _("Show 'Manual resolution' in extensions menu"), config.plugins.autoresolution.manual_resolution_ext_menu)) if config.plugins.autoresolution.manual_resolution_ext_menu.value: self.list.append( getConfigListEntry( _("Return back without confirmation after 10 sec."), config.plugins.autoresolution.ask_apply_mode)) self["config"].list = self.list self["config"].setList(self.list)
def InitLcd(): detected = eDBoxLCD.getInstance().detected() SystemInfo["Display"] = detected config.lcd = ConfigSubsection() if detected: ilcd = LCD() config.lcd.scroll_speed = ConfigSelection(default="300", choices=[ ("500", _("slow")), ("300", _("normal")), ("100", _("fast"))]) config.lcd.scroll_delay = ConfigSelection(default="10000", choices=[ ("10000", "10 " + _("seconds")), ("20000", "20 " + _("seconds")), ("30000", "30 " + _("seconds")), ("60000", "1 " + _("minute")), ("300000", "5 " + _("minutes")), ("noscrolling", _("off"))]) def setLCDbright(configElement): ilcd.setBright(configElement.value) def setLCDstandbybright(configElement): ilcd.setStandbyBright(configElement.value) def setLCDdimbright(configElement): ilcd.setDimBright(configElement.value) def setLCDdimdelay(configElement): ilcd.setDimDelay(configElement.value) def setLCDcontrast(configElement): ilcd.setContrast(configElement.value) def setLCDinverted(configElement): ilcd.setInverted(configElement.value) def setLCDflipped(configElement): ilcd.setFlipped(configElement.value) def setLCDmode(configElement): ilcd.setMode(configElement.value) def setLCDpower(configElement): ilcd.setPower(configElement.value) def setfblcddisplay(configElement): ilcd.setfblcddisplay(configElement.value) def setLCDshowoutputresolution(configElement): ilcd.setShowoutputresolution(configElement.value) def setLEDnormalstate(configElement): ilcd.setLEDNormalState(configElement.value) def setLEDdeepstandby(configElement): ilcd.setLEDDeepStandbyState(configElement.value) def setLEDblinkingtime(configElement): ilcd.setLEDBlinkingTime(configElement.value) def setPowerLEDstate(configElement): if fileExists("/proc/stb/power/powerled"): print("[Lcd] Write to /proc/stb/power/powerled") open("/proc/stb/power/powerled", "w").write(configElement.value) def setPowerLEDstate2(configElement): if fileExists("/proc/stb/power/powerled2"): print("[Lcd] Write to /proc/stb/power/powerled2") open("/proc/stb/power/powerled2", "w").write(configElement.value) def setPowerLEDstanbystate(configElement): if fileExists("/proc/stb/power/standbyled"): print("[Lcd] Write to /proc/stb/power/standbyled") open("/proc/stb/power/standbyled", "w").write(configElement.value) def setPowerLEDdeepstanbystate(configElement): if fileExists("/proc/stb/power/suspendled"): print("[Lcd] Write to /proc/stb/power/suspendled") open("/proc/stb/power/suspendled", "w").write(configElement.value) def setLedPowerColor(configElement): if fileExists("/proc/stb/fp/ledpowercolor"): print("[Lcd] Write to /proc/stb/fp/ledpowercolor") open("/proc/stb/fp/ledpowercolor", "w").write(configElement.value) def setLedStandbyColor(configElement): if fileExists("/proc/stb/fp/ledstandbycolor"): print("[Lcd] Write to /proc/stb/fp/ledstandbycolor") open("/proc/stb/fp/ledstandbycolor", "w").write(configElement.value) def setLedSuspendColor(configElement): if fileExists("/proc/stb/fp/ledsuspendledcolor"): print("[Lcd] Write to /proc/stb/fp/ledsuspendledcolor") open("/proc/stb/fp/ledsuspendledcolor", "w").write(configElement.value) config.usage.lcd_powerled = ConfigSelection(default="on", choices=[("off", _("Off")), ("on", _("On"))]) config.usage.lcd_powerled.addNotifier(setPowerLEDstate) config.usage.lcd_powerled2 = ConfigSelection(default="on", choices=[("off", _("Off")), ("on", _("On"))]) config.usage.lcd_powerled2.addNotifier(setPowerLEDstate2) config.usage.lcd_standbypowerled = ConfigSelection(default="on", choices=[("off", _("Off")), ("on", _("On"))]) config.usage.lcd_standbypowerled.addNotifier(setPowerLEDstanbystate) config.usage.lcd_deepstandbypowerled = ConfigSelection(default="on", choices=[("off", _("Off")), ("on", _("On"))]) config.usage.lcd_deepstandbypowerled.addNotifier(setPowerLEDdeepstanbystate) config.lcd.ledpowercolor = ConfigSelection(default="1", choices=[("0", _("off")), ("1", _("blue")), ("2", _("red")), ("3", _("violet"))]) config.lcd.ledpowercolor.addNotifier(setLedPowerColor) config.lcd.ledstandbycolor = ConfigSelection(default="3", choices=[("0", _("off")), ("1", _("blue")), ("2", _("red")), ("3", _("violet"))]) config.lcd.ledstandbycolor.addNotifier(setLedStandbyColor) config.lcd.ledsuspendcolor = ConfigSelection(default="2", choices=[("0", _("off")), ("1", _("blue")), ("2", _("red")), ("3", _("violet"))]) config.lcd.ledsuspendcolor.addNotifier(setLedSuspendColor) standby_default = 1 if not ilcd.isOled(): config.lcd.contrast = ConfigSlider(default=5, limits=(0, 20)) config.lcd.contrast.addNotifier(setLCDcontrast) else: config.lcd.contrast = ConfigNothing() config.lcd.standby = ConfigSlider(default=standby_default, limits=(0, 10)) config.lcd.dimbright = ConfigSlider(default=standby_default, limits=(0, 10)) config.lcd.bright = ConfigSlider(default="5", limits=(0, 10)) config.lcd.dimbright.addNotifier(setLCDdimbright) config.lcd.dimbright.apply = lambda: setLCDdimbright(config.lcd.dimbright) config.lcd.dimdelay = ConfigSelection(default="0", choices=[ ("5", "5 " + _("seconds")), ("10", "10 " + _("seconds")), ("15", "15 " + _("seconds")), ("20", "20 " + _("seconds")), ("30", "30 " + _("seconds")), ("60", "1 " + _("minute")), ("120", "2 " + _("minutes")), ("300", "5 " + _("minutes")), ("0", _("off"))]) config.lcd.dimdelay.addNotifier(setLCDdimdelay) config.lcd.standby.addNotifier(setLCDstandbybright) config.lcd.standby.apply = lambda: setLCDstandbybright(config.lcd.standby) config.lcd.bright.addNotifier(setLCDbright) config.lcd.bright.apply = lambda: setLCDbright(config.lcd.bright) config.lcd.bright.callNotifiersOnSaveAndCancel = True config.lcd.invert = ConfigYesNo(default=False) config.lcd.invert.addNotifier(setLCDinverted) config.lcd.flip = ConfigYesNo(default=False) config.lcd.flip.addNotifier(setLCDflipped) if SystemInfo["VFD_scroll_repeats"]: def scroll_repeats(el): print("[Lcd] Write to /proc/stb/lcd/scroll_repeats") open(SystemInfo["VFD_scroll_repeats"], "w").write(el.value) choicelist = [("0", _("None")), ("1", _("1X")), ("2", _("2X")), ("3", _("3X")), ("4", _("4X")), ("500", _("Continues"))] config.usage.vfd_scroll_repeats = ConfigSelection(default="3", choices=choicelist) config.usage.vfd_scroll_repeats.addNotifier(scroll_repeats, immediate_feedback=False) else: config.usage.vfd_scroll_repeats = ConfigNothing() if SystemInfo["VFD_scroll_delay"]: def scroll_delay(el): print("[Lcd] Write to /proc/stb/lcd/scroll_delay") open(SystemInfo["VFD_scroll_delay"], "w").write(str(el.value)) config.usage.vfd_scroll_delay = ConfigSlider(default=150, increment=10, limits=(0, 500)) config.usage.vfd_scroll_delay.addNotifier(scroll_delay, immediate_feedback=False) config.lcd.hdd = ConfigSelection([("0", _("No")), ("1", _("Yes"))], "1") else: config.lcd.hdd = ConfigNothing() config.usage.vfd_scroll_delay = ConfigNothing() if SystemInfo["VFD_initial_scroll_delay"]: def initial_scroll_delay(el): print("[Lcd] Write to /proc/stb/lcd/initial_scroll_delay") open(SystemInfo["VFD_initial_scroll_delay"], "w").write(el.value) choicelist = [ ("3000", "3 " + _("seconds")), ("5000", "5 " + _("seconds")), ("10000", "10 " + _("seconds")), ("20000", "20 " + _("seconds")), ("30000", "30 " + _("seconds")), ("0", _("no delay"))] config.usage.vfd_initial_scroll_delay = ConfigSelection(default="10000", choices=choicelist) config.usage.vfd_initial_scroll_delay.addNotifier(initial_scroll_delay, immediate_feedback=False) else: config.usage.vfd_initial_scroll_delay = ConfigNothing() if SystemInfo["VFD_final_scroll_delay"]: def final_scroll_delay(el): print("[Lcd] Write to /proc/stb/lcd/final_scroll_delay") open(SystemInfo["VFD_final_scroll_delay"], "w").write(el.value) choicelist = [ ("3000", "3 " + _("seconds")), ("5000", "5 " + _("seconds")), ("10000", "10 " + _("seconds")), ("20000", "20 " + _("seconds")), ("30000", "30 " + _("seconds")), ("0", _("no delay"))] config.usage.vfd_final_scroll_delay = ConfigSelection(default="10000", choices=choicelist) config.usage.vfd_final_scroll_delay.addNotifier(final_scroll_delay, immediate_feedback=False) else: config.usage.vfd_final_scroll_delay = ConfigNothing() if fileExists("/proc/stb/lcd/show_symbols"): config.lcd.mode = ConfigSelection([("0", _("No")), ("1", _("Yes"))], "1") config.lcd.mode.addNotifier(setLCDmode) else: config.lcd.mode = ConfigNothing() if fileExists("/proc/stb/power/vfd") or fileExists("/proc/stb/lcd/vfd"): config.lcd.power = ConfigSelection([("0", _("No")), ("1", _("Yes"))], "1") config.lcd.power.addNotifier(setLCDpower) else: config.lcd.power = ConfigNothing() if fileExists("/proc/stb/fb/sd_detach"): config.lcd.fblcddisplay = ConfigSelection([("1", _("No")), ("0", _("Yes"))], "1") config.lcd.fblcddisplay.addNotifier(setfblcddisplay) else: config.lcd.fblcddisplay = ConfigNothing() if fileExists("/proc/stb/lcd/show_outputresolution"): config.lcd.showoutputresolution = ConfigSelection([("0", _("No")), ("1", _("Yes"))], "1") config.lcd.showoutputresolution.addNotifier(setLCDshowoutputresolution) else: config.lcd.showoutputresolution = ConfigNothing() def doNothing(): pass config.lcd.ledbrightness = ConfigNothing() config.lcd.ledbrightness.apply = lambda: doNothing() config.lcd.ledbrightnessstandby = ConfigNothing() config.lcd.ledbrightnessstandby.apply = lambda: doNothing() config.lcd.ledbrightnessdeepstandby = ConfigNothing() config.lcd.ledbrightnessdeepstandby.apply = lambda: doNothing() config.lcd.ledblinkingtime = ConfigNothing() else: def doNothing(): pass config.lcd.contrast = ConfigNothing() config.lcd.bright = ConfigNothing() config.lcd.standby = ConfigNothing() config.lcd.bright.apply = lambda: doNothing() config.lcd.standby.apply = lambda: doNothing() config.lcd.power = ConfigNothing() config.lcd.fblcddisplay = ConfigNothing() config.lcd.mode = ConfigNothing() config.lcd.hdd = ConfigNothing() config.lcd.scroll_speed = ConfigSelection(default="300", choices=[ ("500", _("slow")), ("300", _("normal")), ("100", _("fast"))]) config.lcd.scroll_delay = ConfigSelection(default="10000", choices=[ ("10000", "10 " + _("seconds")), ("20000", "20 " + _("seconds")), ("30000", "30 " + _("seconds")), ("60000", "1 " + _("minute")), ("300000", "5 " + _("minutes")), ("noscrolling", _("off"))]) config.lcd.showoutputresolution = ConfigNothing() config.lcd.ledbrightness = ConfigNothing() config.lcd.ledbrightness.apply = lambda: doNothing() config.lcd.ledbrightnessstandby = ConfigNothing() config.lcd.ledbrightnessstandby.apply = lambda: doNothing() config.lcd.ledbrightnessdeepstandby = ConfigNothing() config.lcd.ledbrightnessdeepstandby.apply = lambda: doNothing() config.lcd.ledblinkingtime = ConfigNothing() config.misc.standbyCounter.addNotifier(standbyCounterChanged, initial_call=False)
def createConfig(self, *args): config.pep = ConfigSubsection() config.pep.configsteps = NoSave(ConfigSelection(choices=[1, 5, 10, 25], default = 1)) if os.path.exists("/proc/stb/video/plane/psi_contrast"): def setContrast(config): myval = int(config.value) try: print("[VideoEnhancement] setting contrast to: %s" % myval) open("/proc/stb/video/plane/psi_contrast", "w").write("%s" % myval) except IOError: print("[VideoEnhancement] couldn't write psi_contrast.") if not VideoEnhancement.firstRun: self.setConfiguredValues() config.pep.contrast = ConfigSlider(default=128, limits=(0,255)) config.pep.contrast.addNotifier(setContrast) else: config.pep.contrast = NoSave(ConfigNothing()) if os.path.exists("/proc/stb/video/plane/psi_saturation"): def setSaturation(config): myval = int(config.value) try: print("[VideoEnhancement] setting saturation to: %s" % myval) open("/proc/stb/video/plane/psi_saturation", "w").write("%s" % myval) except IOError: print("[VideoEnhancement] couldn't write psi_saturation.") if not VideoEnhancement.firstRun: self.setConfiguredValues() config.pep.saturation = ConfigSlider(default=128, limits=(0,255)) config.pep.saturation.addNotifier(setSaturation) else: config.pep.saturation = NoSave(ConfigNothing()) if os.path.exists("/proc/stb/video/plane/psi_tint"): def setHue(config): myval = int(config.value) try: print("[VideoEnhancement] setting hue to: %s" % myval) open("/proc/stb/video/plane/psi_tint", "w").write("%s" % myval) except IOError: print("[VideoEnhancement] couldn't write psi_tint.") if not VideoEnhancement.firstRun: self.setConfiguredValues() config.pep.hue = ConfigSlider(default=128, limits=(0,255)) config.pep.hue.addNotifier(setHue) else: config.pep.hue = NoSave(ConfigNothing()) if os.path.exists("/proc/stb/video/plane/psi_brightness"): def setBrightness(config): myval = int(config.value) try: print("[VideoEnhancement] setting brightness to: %s" % myval) open("/proc/stb/video/plane/psi_brightness", "w").write("%s" % myval) except IOError: print("[VideoEnhancement] couldn't write psi_brightness.") if not VideoEnhancement.firstRun: self.setConfiguredValues() config.pep.brightness = ConfigSlider(default=128, limits=(0,255)) config.pep.brightness.addNotifier(setBrightness) else: config.pep.brightness = NoSave(ConfigNothing()) if os.path.exists("/proc/stb/vmpeg/0/pep_block_noise_reduction"): def setBlock_noise_reduction(config): myval = int(config.value) try: print("[VideoEnhancement] setting block_noise_reduction to: %0.8X" % myval) open("/proc/stb/vmpeg/0/pep_block_noise_reduction", "w").write("%0.8X" % myval) except IOError: print("[VideoEnhancement] couldn't write pep_block_noise_reduction.") if not VideoEnhancement.firstRun: self.setConfiguredValues() config.pep.block_noise_reduction = ConfigSlider(default=0, limits=(0,5)) config.pep.block_noise_reduction.addNotifier(setBlock_noise_reduction) else: config.pep.block_noise_reduction = NoSave(ConfigNothing()) if os.path.exists("/proc/stb/vmpeg/0/pep_mosquito_noise_reduction"): def setMosquito_noise_reduction(config): myval = int(config.value) try: print("[VideoEnhancement] setting mosquito_noise_reduction to: %0.8X" % myval) open("/proc/stb/vmpeg/0/pep_mosquito_noise_reduction", "w").write("%0.8X" % myval) except IOError: print("[VideoEnhancement] couldn't write pep_mosquito_noise_reduction.") if not VideoEnhancement.firstRun: self.setConfiguredValues() config.pep.mosquito_noise_reduction = ConfigSlider(default=0, limits=(0,5)) config.pep.mosquito_noise_reduction.addNotifier(setMosquito_noise_reduction) else: config.pep.mosquito_noise_reduction = NoSave(ConfigNothing()) if os.path.exists("/proc/stb/vmpeg/0/pep_digital_contour_removal"): def setDigital_contour_removal(config): myval = int(config.value) try: print("[VideoEnhancement] setting digital_contour_removal to: %0.8X" % myval) open("/proc/stb/vmpeg/0/pep_digital_contour_removal", "w").write("%0.8X" % myval) except IOError: print("[VideoEnhancement] couldn't write pep_digital_contour_removal.") if not VideoEnhancement.firstRun: self.setConfiguredValues() config.pep.digital_contour_removal = ConfigSlider(default=0, limits=(0,5)) config.pep.digital_contour_removal.addNotifier(setDigital_contour_removal) else: config.pep.digital_contour_removal = NoSave(ConfigNothing()) if os.path.exists("/proc/stb/vmpeg/0/pep_split"): def setSplitMode(config): try: print("[VideoEnhancement] setting splitmode to:",str(config.value)) open("/proc/stb/vmpeg/0/pep_split", "w").write(str(config.value)) except IOError: print("[VideoEnhancement] couldn't write pep_split.") if not VideoEnhancement.firstRun: self.setConfiguredValues() config.pep.split = ConfigSelection(choices={ "off": _("Off"), "left": _("Left"), "right": _("Right")}, default = "off") config.pep.split.addNotifier(setSplitMode) else: config.pep.split = NoSave(ConfigNothing()) if SystemInfo["ScalerSharpness"]: def setSharpness(config): myval = int(config.value * 256) try: print("[VideoEnhancement] setting sharpness to: %0.8X" % myval) open("/proc/stb/vmpeg/0/pep_sharpness", "w").write("%0.8X" % myval) except IOError: print("[VideoEnhancement] couldn't write pep_sharpness.") if not VideoEnhancement.firstRun: self.setConfiguredValues() config.pep.sharpness = ConfigSlider(default=0, limits=(0,255)) config.pep.sharpness.addNotifier(setSharpness) else: config.pep.sharpness = NoSave(ConfigNothing()) if os.path.exists("/proc/stb/vmpeg/0/pep_auto_flesh"): def setAutoflesh(config): myval = int(config.value) try: print("[VideoEnhancement] setting auto_flesh to: %0.8X" % myval) open("/proc/stb/vmpeg/0/pep_auto_flesh", "w").write("%0.8X" % myval) except IOError: print("[VideoEnhancement] couldn't write pep_auto_flesh.") if not VideoEnhancement.firstRun: self.setConfiguredValues() config.pep.auto_flesh = ConfigSlider(default=0, limits=(0,4)) config.pep.auto_flesh.addNotifier(setAutoflesh) else: config.pep.auto_flesh = NoSave(ConfigNothing()) if os.path.exists("/proc/stb/vmpeg/0/pep_green_boost"): def setGreenboost(config): myval = int(config.value) try: print("[VideoEnhancement] setting green_boost to: %0.8X" % myval) open("/proc/stb/vmpeg/0/pep_green_boost", "w").write("%0.8X" % myval) except IOError: print("[VideoEnhancement] couldn't write pep_green_boost.") if not VideoEnhancement.firstRun: self.setConfiguredValues() config.pep.green_boost = ConfigSlider(default=0, limits=(0,4)) config.pep.green_boost.addNotifier(setGreenboost) else: config.pep.green_boost = NoSave(ConfigNothing()) if os.path.exists("/proc/stb/vmpeg/0/pep_blue_boost"): def setBlueboost(config): myval = int(config.value) try: print("[VideoEnhancement] setting blue_boost to: %0.8X" % myval) open("/proc/stb/vmpeg/0/pep_blue_boost", "w").write("%0.8X" % myval) except IOError: print("[VideoEnhancement] couldn't write pep_blue_boost.") if not VideoEnhancement.firstRun: self.setConfiguredValues() config.pep.blue_boost = ConfigSlider(default=0, limits=(0,4)) config.pep.blue_boost.addNotifier(setBlueboost) else: config.pep.blue_boost = NoSave(ConfigNothing()) if os.path.exists("/proc/stb/vmpeg/0/pep_dynamic_contrast"): def setDynamic_contrast(config): myval = int(config.value) try: print("[VideoEnhancement] setting dynamic_contrast to: %0.8X" % myval) open("/proc/stb/vmpeg/0/pep_dynamic_contrast", "w").write("%0.8X" % myval) except IOError: print("[VideoEnhancement] couldn't write pep_dynamic_contrast.") if not VideoEnhancement.firstRun: self.setConfiguredValues() config.pep.dynamic_contrast = ConfigSlider(default=0, limits=(0,255)) config.pep.dynamic_contrast.addNotifier(setDynamic_contrast) else: config.pep.dynamic_contrast = NoSave(ConfigNothing()) try: x = config.av.scaler_sharpness.value except KeyError: if SystemInfo["ScalerSharpness"]: def setScaler_sharpness(config): myval = int(config.value) try: print("[VideoEnhancement] setting scaler_sharpness to: %0.8X" % myval) open("/proc/stb/vmpeg/0/pep_scaler_sharpness", "w").write("%0.8X" % myval) except IOError: print("[VideoEnhancement] couldn't write pep_scaler_sharpness.") if not VideoEnhancement.firstRun: self.setConfiguredValues() 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 os.path.exists("/proc/stb/vmpeg/0/pep_scaler_vertical_dejagging"): def setScaler_vertical_dejagging(configElement): myval = configElement.value and "enable" or "disable" try: print("[VideoEnhancement] setting scaler_vertical_dejagging to: %s" % myval) open("/proc/stb/vmpeg/0/pep_scaler_vertical_dejagging", "w").write(myval) except IOError: print("[VideoEnhancement] couldn't write pep_scaler_vertical_dejagging.") if not VideoEnhancement.firstRun: self.setConfiguredValues() config.pep.scaler_vertical_dejagging = ConfigBoolean(default=False, descriptions = {False: _("Disabled"), True: _("Enabled")} ) config.pep.scaler_vertical_dejagging.addNotifier(setScaler_vertical_dejagging) else: config.pep.scaler_vertical_dejagging = NoSave(ConfigNothing()) if os.path.exists("/proc/stb/vmpeg/0/smooth"): def setSmooth(configElement): myval = configElement.value and "enable" or "disable" try: print("[VideoEnhancement] setting smooth to: %s" % myval) open("/proc/stb/vmpeg/0/smooth", "w").write(myval) except IOError: print("[VideoEnhancement] couldn't write smooth.") if not VideoEnhancement.firstRun: self.setConfiguredValues() config.pep.smooth = ConfigBoolean(default=False, descriptions = {False: _("Disabled"), True: _("Enabled")} ) config.pep.smooth.addNotifier(setSmooth) else: config.pep.smooth = NoSave(ConfigNothing()) if VideoEnhancement.firstRun: self.setConfiguredValues() VideoEnhancement.firstRun = False
def fillList(self, arg=None): from Tools.ISO639 import LanguageCodes from Components.UsageConfig import originalAudioTracks, visuallyImpairedCommentary streams = [] conflist = [] selectedidx = 0 self["key_blue"].setBoolean(False) subtitlelist = self.getSubtitleList() if self.settings.menupage.getValue() == PAGE_AUDIO: self.setTitle(_("Select audio track")) service = self.session.nav.getCurrentService() self.audioTracks = audio = service and service.audioTracks() n = audio and audio.getNumberOfTracks() or 0 if SystemInfo["CanDownmixAC3"]: if SystemInfo["DreamBoxAudio"]: choice_list = [ ("downmix", _("Downmix")), ("passthrough", _("Passthrough")), ("multichannel", _("convert to multi-channel PCM")), ("hdmi_best", _("use best / controlled by HDMI")) ] self.settings.downmix_ac3 = ConfigSelection( choices=choice_list, default=config.av.downmix_ac3.value) else: self.settings.downmix_ac3 = ConfigOnOff( default=config.av.downmix_ac3.value) self.settings.downmix_ac3.addNotifier(self.changeAC3Downmix, initial_call=False) conflist.append( getConfigListEntry(_("AC3 downmix"), self.settings.downmix_ac3, None)) self["key_red"].setBoolean(True) else: conflist.append( getConfigListEntry(_("No AC3"), ConfigNothing())) self["key_red"].setBoolean(True) if n > 0: self.audioChannel = service.audioChannel() if self.audioChannel: choicelist = [("0", _("left")), ("1", _("stereo")), ("2", _("right"))] self.settings.channelmode = ConfigSelection( choices=choicelist, default=str(self.audioChannel.getCurrentChannel())) self.settings.channelmode.addNotifier(self.changeMode, initial_call=False) conflist.append( getConfigListEntry(_("AudioChannel"), self.settings.channelmode)) self["key_green"].setBoolean(True) else: conflist.append( getConfigListEntry(_("No AudioChannel"), ConfigNothing())) self["key_green"].setBoolean(True) selectedAudio = self.audioTracks.getCurrentTrack() for x in range(n): number = str(x + 1) i = audio.getTrackInfo(x) languages = i.getLanguage().split('/') description = i.getDescription() or "" selected = "" language = "" if selectedAudio == x: selected = "X" selectedidx = x cnt = 0 for lang in languages: if cnt: language += ' / ' if lang in LanguageCodes: language += _(LanguageCodes[lang][0]) elif lang in originalAudioTracks: language += "%s (%s)" % (_("Original audio"), lang) elif lang in visuallyImpairedCommentary: language += "%s (%s)" % ( _("Visually impaired commentary"), lang) else: language += lang cnt += 1 streams.append( (x, "", number, description, language, selected)) else: streams = [] conflist.append( getConfigListEntry(_("No AudioChannel"), ConfigNothing())) self["key_green"].setBoolean(True) if subtitlelist: self["key_yellow"].setBoolean(True) conflist.append( getConfigListEntry(_("To subtitle selection"), self.settings.menupage)) else: self["key_yellow"].setBoolean(True) conflist.append( getConfigListEntry(_("No subtitle"), ConfigNothing())) from Components.PluginComponent import plugins from Plugins.Plugin import PluginDescriptor if hasattr(self.infobar, "runPlugin"): class PluginCaller: def __init__(self, fnc, *args): self.fnc = fnc self.args = args def __call__(self, *args, **kwargs): self.fnc(*self.args) self.Plugins = [(p.name, PluginCaller(self.infobar.runPlugin, p)) for p in plugins.getPlugins( where=PluginDescriptor.WHERE_AUDIOMENU)] if self.Plugins: self["key_blue"].setBoolean(True) if len(self.Plugins) > 1: conflist.append( getConfigListEntry(_("Audio plugins"), ConfigNothing())) self.plugincallfunc = [(x[0], x[1]) for x in self.Plugins] else: conflist.append( getConfigListEntry(self.Plugins[0][0], ConfigNothing())) self.plugincallfunc = self.Plugins[0][1] if SystemInfo["CanDownmixAAC"]: if SystemInfo["DreamBoxAudio"]: choice_list = [ ("downmix", _("Downmix")), ("passthrough", _("Passthrough")), ("multichannel", _("convert to multi-channel PCM")), ("hdmi_best", _("use best / controlled by HDMI")) ] self.settings.downmix_aac = ConfigSelection( choices=choice_list, default=config.av.downmix_aac.value) else: self.settings.downmix_aac = ConfigOnOff( default=config.av.downmix_aac.value) self.settings.downmix_aac.addNotifier(self.changeAACDownmix, initial_call=False) conflist.append( getConfigListEntry(_("AAC downmix"), self.settings.downmix_aac, None)) else: conflist.append( getConfigListEntry(_("No AAC"), ConfigNothing())) if SystemInfo["CanAC3plusTranscode"]: 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")) ] else: choice_list = [("use_hdmi_caps", _("controlled by HDMI")), ("force_ac3", _("convert to AC3"))] self.settings.transcodeac3plus = ConfigSelection( choices=choice_list, default=config.av.transcodeac3plus.value) self.settings.transcodeac3plus.addNotifier( self.setAC3plusTranscode, initial_call=False) conflist.append( getConfigListEntry(_("AC3plus transcoding"), self.settings.transcodeac3plus, None)) else: conflist.append( getConfigListEntry(_("No AC3 Plus"), ConfigNothing())) if SystemInfo["CanDTSHD"]: if getBoxType() in ("dm7080", "dm820"): choice_list = [("use_hdmi_caps", _("controlled by HDMI")), ("force_dts", _("convert to DTS"))] 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")) ] self.settings.dtshd = ConfigSelection( choices=choice_list, default=config.av.dtshd.value) self.settings.dtshd.addNotifier(self.setDTSHD, initial_call=False) conflist.append( getConfigListEntry(_("DTS HD downmix"), self.settings.dtshd, None)) else: conflist.append( getConfigListEntry(_("No DTS HD"), ConfigNothing())) if SystemInfo["CanWMAPRO"]: choice_list = [ ("downmix", _("Downmix")), ("passthrough", _("Passthrough")), ("multichannel", _("convert to multi-channel PCM")), ("hdmi_best", _("use best / controlled by HDMI")) ] self.settings.wmapro = ConfigSelection( choices=choice_list, default=config.av.wmapro.value) self.settings.wmapro.addNotifier(self.setWMAPro, initial_call=False) conflist.append( getConfigListEntry(_("WMA Pro downmix"), self.settings.wmapro, None)) else: conflist.append( getConfigListEntry(_("No WMA Pro"), ConfigNothing())) elif self.settings.menupage.getValue() == PAGE_SUBTITLES: self.setTitle(_("Subtitle selection")) conflist.append(('', )) conflist.append(('', )) self["key_red"].setBoolean(False) self["key_green"].setBoolean(False) idx = 0 for x in subtitlelist: number = str(x[1]) description = "?" language = "" selected = "" if config.subtitles.show.value and self.selectedSubtitle and x[: 4] == self.selectedSubtitle[: 4]: selected = "X" selectedidx = idx try: if x[4] != "und": if x[4] in LanguageCodes: language = _(LanguageCodes[x[4]][0]) else: language = x[4] except: language = "" if x[0] == 0: description = "DVB" number = "%x" % (x[1]) elif x[0] == 1: description = "teletext" number = "%x%02x" % (x[3] and x[3] or 8, x[2]) elif x[0] == 2: types = (_("unknown"), _("embedded"), _("SSA file"), _("ASS file"), _("SRT file"), _("VOB file"), _("PGS file")) try: description = types[x[2]] except: description = _("unknown") + ": %s" % x[2] number = str(int(number) + 1) streams.append( (x, "", number, description, language, selected)) idx += 1 conflist.append( getConfigListEntry(_("To audio selection"), self.settings.menupage)) if self.infobar.selected_subtitle and self.infobar.selected_subtitle != ( 0, 0, 0, 0) and not ".DVDPlayer'>" in ` self.infobar `: self["key_blue"].setBoolean(True) conflist.append( getConfigListEntry(_("Subtitle Quickmenu"), ConfigNothing())) self["config"].list = conflist self["config"].l.setList(conflist) self["streams"].list = streams self["streams"].setIndex(selectedidx)
def getInitConfig(self): global cur_skin self.is_atile = False if cur_skin == 'AtileHD': self.is_atile = True self.title = _("SteampunkHD Setup") self.skin_base_dir = "/usr/share/enigma2/%s/" % cur_skin self.default_font_file = "font_atile_Roboto.xml" self.default_color_file = "colors_Original.xml" self.default_sb_file = "sb_Original.xml" self.default_listbox_file = "listbox_Original.xml" self.default_background_file = "background_Original.xml" self.default_progr_infobar_file = "progr_infobar_Original.xml" self.default_infobar_file = "infobar_Original.xml" self.default_clock_file = "clock_Original.xml" self.default_ch_se_file = "ch_se_Original.xml" self.default_ch_se_color_file = "ch_se_color_Original.xml" self.color_file = "skin_user_colors.xml" self.sb_file = "skin_user_sb.xml" self.listbox_file = "skin_user_listbox.xml" self.background_file = "skin_user_background.xml" self.progr_infobar_file = "skin_user_progr_infobar.xml" self.infobar_file = "skin_user_infobar.xml" self.clock_file = "skin_user_clock.xml" self.ch_se_file = "skin_user_ch_se.xml" self.ch_se_color_file = "skin_user_ch_se_color.xml" # color current, choices = self.getSettings(self.default_color_file, self.color_file) self.myAtileHD_color = NoSave( ConfigSelection(default=current, choices=choices)) # sb current, choices = self.getSettings(self.default_sb_file, self.sb_file) self.myAtileHD_sb = NoSave( ConfigSelection(default=current, choices=choices)) # listbox current, choices = self.getSettings(self.default_listbox_file, self.listbox_file) self.myAtileHD_listbox = NoSave( ConfigSelection(default=current, choices=choices)) # background current, choices = self.getSettings(self.default_background_file, self.background_file) self.myAtileHD_background = NoSave( ConfigSelection(default=current, choices=choices)) # progr_infobar current, choices = self.getSettings(self.default_progr_infobar_file, self.progr_infobar_file) self.myAtileHD_progr_infobar = NoSave( ConfigSelection(default=current, choices=choices)) # infobar current, choices = self.getSettings(self.default_infobar_file, self.infobar_file) self.myAtileHD_infobar = NoSave( ConfigSelection(default=current, choices=choices)) # clock current, choices = self.getSettings(self.default_clock_file, self.clock_file) self.myAtileHD_clock = NoSave( ConfigSelection(default=current, choices=choices)) # ch_se current, choices = self.getSettings(self.default_ch_se_file, self.ch_se_file) self.myAtileHD_ch_se = NoSave( ConfigSelection(default=current, choices=choices)) # ch_se_color current, choices = self.getSettings(self.default_ch_se_color_file, self.ch_se_color_file) self.myAtileHD_ch_se_color = NoSave( ConfigSelection(default=current, choices=choices)) # myatile myatile_active = self.getmyAtileState() self.myAtileHD_active = NoSave(ConfigYesNo(default=myatile_active)) self.myAtileHD_fake_entry = NoSave(ConfigNothing())
def __init__(self, session, name, path, descr): Screen.__init__(self, session) self.skinName = ["AdvancedCutInput", "Setup"] self["key_green"] = StaticText(_("OK")) self["key_red"] = StaticText(_("Cancel")) if self.baseName(path) == self.baseName(name): title = "" else: title = name dir = self.dirName(path) file = self.baseName(path) + " cut" self.input_replace = ConfigSelection(choices=[("no", _("No")), ("yes", _("Yes"))], default="no") self.input_file = ConfigText(default=file, fixed_size=False, visible_width=45) self.input_title = ConfigText(default=title, fixed_size=False, visible_width=45) self.input_descr = ConfigText(default=descr, fixed_size=False, visible_width=45) tmp = config.movielist.videodirs.value if not dir in tmp: tmp.append(dir) self.input_dir = ConfigSelection(choices=tmp, default=dir) self.input_manual = ConfigSelection(choices=[ ("no", _("Cutlist")), ("yes", _("Manual specification")) ], default="no") self.input_space = ConfigNothing() self.input_manualcuts = ConfigText(default="", fixed_size=False) self.input_manualcuts.setUseableChars(" 0123456789:.") self["actions"] = ActionMap( ["SetupActions"], { "ok": self.keySelectOrGo, "save": self.keyGo, "cancel": self.keyCancel, }, -2) self.list = [] ConfigListScreen.__init__(self, self.list) self.entry_replace = getConfigListEntry(_("Replace original:"), self.input_replace) self.entry_file = getConfigListEntry(_("New filename:"), self.input_file) self.entry_title = getConfigListEntry(_("New title:"), self.input_title) self.entry_descr = getConfigListEntry(_("New description:"), self.input_descr) self.entry_dir = getConfigListEntry(_("New location:"), self.input_dir) self.entry_manual = getConfigListEntry(_("Cut source:"), self.input_manual) self.entry_space = getConfigListEntry( _("Cuts (an IN OUT IN OUT ... sequence of hour:min:sec)"), self.input_space) self.entry_manualcuts = getConfigListEntry(":", self.input_manualcuts) self.createSetup(self["config"]) self.onLayoutFinish.append(self.layoutFinished)
def InitLcd(): if model in ("force4", "viperslim", "lunix4k", "vipert2c", "evoslimse", "evoslimt2c", "evoslim", "ultrabox", "i55", "dm520", "hd11", "sf98", "et7000mini", "xpeedc", "beyonwizt2", "gb800se", "gb800solo", "gb800seplus", "gbultrase", "gbipbox", "tmsingle", "tmnano2super", "iqonios300hd", "iqonios300hdv2", "optimussos1plus", "optimussos1", "vusolo", "et4x00", "et5x00", "et6x00", "gbx1", "gbx2", "gbx3", "gbx34k", "gbx3h", "novaip"): detected = False else: detected = eDBoxLCD.getInstance().detected() SystemInfo["Display"] = detected config.lcd = ConfigSubsection() if fileExists("/proc/stb/lcd/mode"): can_lcdmodechecking = open("/proc/stb/lcd/mode", "r").read() else: can_lcdmodechecking = False SystemInfo["LCDMiniTV"] = can_lcdmodechecking if detected: ilcd = LCD() if can_lcdmodechecking: def setLCDModeMinitTV(configElement): try: print('[Lcd] setLCDModeMinitTV', configElement.value) open("/proc/stb/lcd/mode", "w").write(configElement.value) except: pass def setMiniTVFPS(configElement): try: print('[Lcd] setMiniTVFPS', configElement.value) open("/proc/stb/lcd/fps", "w").write(configElement.value) except: pass def setLCDModePiP(configElement): pass def setLCDScreenshot(configElement): ilcd.setScreenShot(configElement.value) config.lcd.modepip = ConfigSelection(choices={ "0": _("off"), "5": _("PIP"), "7": _("PIP with OSD")}, default="0") config.lcd.modepip.addNotifier(setLCDModePiP) config.lcd.screenshot = ConfigYesNo(default=False) config.lcd.screenshot.addNotifier(setLCDScreenshot) config.lcd.modeminitv = ConfigSelection(choices={ "0": _("normal"), "1": _("MiniTV"), "2": _("OSD"), "3": _("MiniTV with OSD")}, default="0") config.lcd.fpsminitv = ConfigSlider(default=30, limits=(0, 30)) config.lcd.modeminitv.addNotifier(setLCDModeMinitTV) config.lcd.fpsminitv.addNotifier(setMiniTVFPS) else: config.lcd.modeminitv = ConfigNothing() config.lcd.screenshot = ConfigNothing() config.lcd.fpsminitv = ConfigNothing() config.lcd.scroll_speed = ConfigSelection(default="300", choices=[ ("500", _("slow")), ("300", _("normal")), ("100", _("fast"))]) config.lcd.scroll_delay = ConfigSelection(default="10000", choices=[ ("10000", "10 " + _("seconds")), ("20000", "20 " + _("seconds")), ("30000", "30 " + _("seconds")), ("60000", "1 " + _("minute")), ("300000", "5 " + _("minutes")), ("noscrolling", _("off"))]) def setLCDbright(configElement): ilcd.setBright(configElement.value) def setLCDstandbybright(configElement): ilcd.setStandbyBright(configElement.value) def setLCDdimbright(configElement): ilcd.setDimBright(configElement.value) def setLCDdimdelay(configElement): ilcd.setDimDelay(configElement.value) def setLCDcontrast(configElement): ilcd.setContrast(configElement.value) def setLCDinverted(configElement): ilcd.setInverted(configElement.value) def setLCDflipped(configElement): ilcd.setFlipped(configElement.value) def setLCDmode(configElement): ilcd.setMode(configElement.value) def setLCDpower(configElement): ilcd.setPower(configElement.value) def setfblcddisplay(configElement): ilcd.setfblcddisplay(configElement.value) def setLCDshowoutputresolution(configElement): ilcd.setShowoutputresolution(configElement.value) def setLCDminitvmode(configElement): ilcd.setLCDMiniTVMode(configElement.value) def setLCDminitvpipmode(configElement): ilcd.setLCDMiniTVPIPMode(configElement.value) def setLCDminitvfps(configElement): ilcd.setLCDMiniTVFPS(configElement.value) def setLEDnormalstate(configElement): ilcd.setLEDNormalState(configElement.value) def setLEDdeepstandby(configElement): ilcd.setLEDDeepStandbyState(configElement.value) def setLEDblinkingtime(configElement): ilcd.setLEDBlinkingTime(configElement.value) def setPowerLEDstate(configElement): if fileExists("/proc/stb/power/powerled"): open("/proc/stb/power/powerled", "w").write(configElement.value) def setPowerLEDstate2(configElement): if fileExists("/proc/stb/power/powerled2"): open("/proc/stb/power/powerled2", "w").write(configElement.value) def setPowerLEDstanbystate(configElement): if fileExists("/proc/stb/power/standbyled"): open("/proc/stb/power/standbyled", "w").write(configElement.value) def setPowerLEDdeepstanbystate(configElement): if fileExists("/proc/stb/power/suspendled"): open("/proc/stb/power/suspendled", "w").write(configElement.value) def setLedPowerColor(configElement): if fileExists("/proc/stb/fp/ledpowercolor"): open("/proc/stb/fp/ledpowercolor", "w").write(configElement.value) def setLedStandbyColor(configElement): if fileExists("/proc/stb/fp/ledstandbycolor"): open("/proc/stb/fp/ledstandbycolor", "w").write(configElement.value) def setLedSuspendColor(configElement): if fileExists("/proc/stb/fp/ledsuspendledcolor"): open("/proc/stb/fp/ledsuspendledcolor", "w").write(configElement.value) def setPower4x7On(configElement): if fileExists("/proc/stb/fp/power4x7on"): open("/proc/stb/fp/power4x7on", "w").write(configElement.value) def setPower4x7Standby(configElement): if fileExists("/proc/stb/fp/power4x7standby"): open("/proc/stb/fp/power4x7standby", "w").write(configElement.value) def setPower4x7Suspend(configElement): if fileExists("/proc/stb/fp/power4x7suspend"): open("/proc/stb/fp/power4x7suspend", "w").write(configElement.value) def setXcoreVFD(configElement): if fileExists("/sys/module/brcmstb_osmega/parameters/pt6302_cgram"): open("/sys/module/brcmstb_osmega/parameters/pt6302_cgram", "w").write(configElement.value) if fileExists("/sys/module/brcmstb_spycat4k/parameters/pt6302_cgram"): open("/sys/module/brcmstb_spycat4k/parameters/pt6302_cgram", "w").write(configElement.value) if fileExists("/sys/module/brcmstb_spycat4kmini/parameters/pt6302_cgram"): open("/sys/module/brcmstb_spycat4kmini/parameters/pt6302_cgram", "w").write(configElement.value) if fileExists("/sys/module/brcmstb_spycat4kcombo/parameters/pt6302_cgram"): open("/sys/module/brcmstb_spycat4kcombo/parameters/pt6302_cgram", "w").write(configElement.value) config.usage.vfd_xcorevfd = ConfigSelection(default="0", choices=[("0", _("12 character")), ("1", _("8 character"))]) config.usage.vfd_xcorevfd.addNotifier(setXcoreVFD) config.usage.lcd_powerled = ConfigSelection(default="on", choices=[("off", _("Off")), ("on", _("On"))]) config.usage.lcd_powerled.addNotifier(setPowerLEDstate) config.usage.lcd_powerled2 = ConfigSelection(default="on", choices=[("off", _("Off")), ("on", _("On"))]) config.usage.lcd_powerled2.addNotifier(setPowerLEDstate2) config.usage.lcd_standbypowerled = ConfigSelection(default="on", choices=[("off", _("Off")), ("on", _("On"))]) config.usage.lcd_standbypowerled.addNotifier(setPowerLEDstanbystate) config.usage.lcd_deepstandbypowerled = ConfigSelection(default="on", choices=[("off", _("Off")), ("on", _("On"))]) config.usage.lcd_deepstandbypowerled.addNotifier(setPowerLEDdeepstanbystate) config.lcd.ledpowercolor = ConfigSelection(default="1", choices=[("0", _("off")), ("1", _("blue")), ("2", _("red")), ("3", _("violet"))]) config.lcd.ledpowercolor.addNotifier(setLedPowerColor) config.lcd.ledstandbycolor = ConfigSelection(default="3", choices=[("0", _("off")), ("1", _("blue")), ("2", _("red")), ("3", _("violet"))]) config.lcd.ledstandbycolor.addNotifier(setLedStandbyColor) config.lcd.ledsuspendcolor = ConfigSelection(default="2", choices=[("0", _("off")), ("1", _("blue")), ("2", _("red")), ("3", _("violet"))]) config.lcd.ledsuspendcolor.addNotifier(setLedSuspendColor) config.lcd.power4x7on = ConfigSelection(default="on", choices=[("off", _("Off")), ("on", _("On"))]) config.lcd.power4x7on.addNotifier(setPower4x7On) config.lcd.power4x7standby = ConfigSelection(default="on", choices=[("off", _("Off")), ("on", _("On"))]) config.lcd.power4x7standby.addNotifier(setPower4x7Standby) config.lcd.power4x7suspend = ConfigSelection(default="on", choices=[("off", _("Off")), ("on", _("On"))]) config.lcd.power4x7suspend.addNotifier(setPower4x7Suspend) if platform in ("dm4kgen", "8100s"): standby_default = 4 elif model in ("spycat4kmini", "osmega"): standby_default = 10 else: standby_default = 1 if not ilcd.isOled(): config.lcd.contrast = ConfigSlider(default=5, limits=(0, 20)) config.lcd.contrast.addNotifier(setLCDcontrast) else: config.lcd.contrast = ConfigNothing() if model in ("h3", "ebox5000", "ebox5100", "sh1", "spycat", "novacombo", "novatwin"): config.lcd.standby = ConfigSlider(default=standby_default, limits=(0, 4)) config.lcd.dimbright = ConfigSlider(default=standby_default, limits=(0, 4)) config.lcd.bright = ConfigSlider(default=4, limits=(0, 4)) elif model in ("spycat4kmini", "osmega"): config.lcd.standby = ConfigSlider(default=standby_default, limits=(0, 10)) config.lcd.dimbright = ConfigSlider(default=standby_default, limits=(0, 10)) config.lcd.bright = ConfigSlider(default=10, limits=(0, 10)) else: config.lcd.standby = ConfigSlider(default=standby_default, limits=(0, 10)) config.lcd.dimbright = ConfigSlider(default=standby_default, limits=(0, 10)) config.lcd.bright = ConfigSlider(default=SystemInfo["DefaultDisplayBrightness"], limits=(0, 10)) config.lcd.dimbright.addNotifier(setLCDdimbright) config.lcd.dimbright.apply = lambda: setLCDdimbright(config.lcd.dimbright) config.lcd.dimdelay = ConfigSelection(default="0", choices=[ ("5", "5 " + _("seconds")), ("10", "10 " + _("seconds")), ("15", "15 " + _("seconds")), ("20", "20 " + _("seconds")), ("30", "30 " + _("seconds")), ("60", "1 " + _("minute")), ("120", "2 " + _("minutes")), ("300", "5 " + _("minutes")), ("0", _("off"))]) config.lcd.dimdelay.addNotifier(setLCDdimdelay) config.lcd.standby.addNotifier(setLCDstandbybright) config.lcd.standby.apply = lambda: setLCDstandbybright(config.lcd.standby) config.lcd.bright.addNotifier(setLCDbright) config.lcd.bright.apply = lambda: setLCDbright(config.lcd.bright) config.lcd.bright.callNotifiersOnSaveAndCancel = True config.lcd.invert = ConfigYesNo(default=False) config.lcd.invert.addNotifier(setLCDinverted) def PiconPackChanged(configElement): configElement.save() config.lcd.picon_pack = ConfigYesNo(default=False) config.lcd.picon_pack.addNotifier(PiconPackChanged) config.lcd.flip = ConfigYesNo(default=False) config.lcd.flip.addNotifier(setLCDflipped) if SystemInfo["LcdLiveTV"]: def lcdLiveTvChanged(configElement): if "live_enable" in SystemInfo["LcdLiveTV"]: open(SystemInfo["LcdLiveTV"], "w").write(configElement.value and "enable" or "disable") else: open(SystemInfo["LcdLiveTV"], "w").write(configElement.value and "0" or "1") try: InfoBarInstance = InfoBar.instance InfoBarInstance and InfoBarInstance.session.open(dummyScreen) except: pass config.lcd.showTv = ConfigYesNo(default=False) config.lcd.showTv.addNotifier(lcdLiveTvChanged) if SystemInfo["LCDMiniTV"] and platform not in ("gb7356", "gb7252", "gb72604"): config.lcd.minitvmode = ConfigSelection([("0", _("normal")), ("1", _("MiniTV")), ("2", _("OSD")), ("3", _("MiniTV with OSD"))], "0") config.lcd.minitvmode.addNotifier(setLCDminitvmode) config.lcd.minitvpipmode = ConfigSelection([("0", _("off")), ("5", _("PIP")), ("7", _("PIP with OSD"))], "0") config.lcd.minitvpipmode.addNotifier(setLCDminitvpipmode) config.lcd.minitvfps = ConfigSlider(default=30, limits=(0, 30)) config.lcd.minitvfps.addNotifier(setLCDminitvfps) if SystemInfo["VFD_scroll_repeats"] and SystemInfo["VFDRepeats"]: def scroll_repeats(el): open(SystemInfo["VFD_scroll_repeats"], "w").write(el.value) choicelist = [("0", _("None")), ("1", _("1X")), ("2", _("2X")), ("3", _("3X")), ("4", _("4X")), ("500", _("Continues"))] config.usage.vfd_scroll_repeats = ConfigSelection(default="3", choices=choicelist) config.usage.vfd_scroll_repeats.addNotifier(scroll_repeats, immediate_feedback=False) else: config.usage.vfd_scroll_repeats = ConfigNothing() if SystemInfo["VFD_scroll_delay"] and SystemInfo["VFDRepeats"]: def scroll_delay(el): # add workaround for Boxes who need hex code if SystemInfo["VFDDelay"]: open(SystemInfo["VFD_scroll_delay"], "w").write(hex(int(el.value))) else: open(SystemInfo["VFD_scroll_delay"], "w").write(str(el.value)) config.usage.vfd_scroll_delay = ConfigSlider(default=150, increment=10, limits=(0, 500)) config.usage.vfd_scroll_delay.addNotifier(scroll_delay, immediate_feedback=False) config.lcd.hdd = ConfigSelection([("0", _("No")), ("1", _("Yes"))], "1") else: config.lcd.hdd = ConfigNothing() config.usage.vfd_scroll_delay = ConfigNothing() if SystemInfo["VFD_initial_scroll_delay"] and SystemInfo["VFDRepeats"]: def initial_scroll_delay(el): if SystemInfo["VFDDelay"]: # add workaround for Boxes who need hex code open(SystemInfo["VFD_initial_scroll_delay"], "w").write(hex(int(el.value))) else: open(SystemInfo["VFD_initial_scroll_delay"], "w").write(el.value) choicelist = [ ("3000", "3 " + _("seconds")), ("5000", "5 " + _("seconds")), ("10000", "10 " + _("seconds")), ("20000", "20 " + _("seconds")), ("30000", "30 " + _("seconds")), ("0", _("no delay"))] config.usage.vfd_initial_scroll_delay = ConfigSelection(default="10000", choices=choicelist) config.usage.vfd_initial_scroll_delay.addNotifier(initial_scroll_delay, immediate_feedback=False) else: config.usage.vfd_initial_scroll_delay = ConfigNothing() if SystemInfo["VFD_final_scroll_delay"] and SystemInfo["VFDRepeats"]: def final_scroll_delay(el): if SystemInfo["VFDDelay"]: # add workaround for Boxes who need hex code open(SystemInfo["VFD_final_scroll_delay"], "w").write(hex(int(el.value))) else: open(SystemInfo["VFD_final_scroll_delay"], "w").write(el.value) choicelist = [ ("3000", "3 " + _("seconds")), ("5000", "5 " + _("seconds")), ("10000", "10 " + _("seconds")), ("20000", "20 " + _("seconds")), ("30000", "30 " + _("seconds")), ("0", _("no delay"))] config.usage.vfd_final_scroll_delay = ConfigSelection(default="10000", choices=choicelist) config.usage.vfd_final_scroll_delay.addNotifier(final_scroll_delay, immediate_feedback=False) else: config.usage.vfd_final_scroll_delay = ConfigNothing() if fileExists("/proc/stb/lcd/show_symbols"): config.lcd.mode = ConfigSelection([("0", _("No")), ("1", _("Yes"))], "1") config.lcd.mode.addNotifier(setLCDmode) else: config.lcd.mode = ConfigNothing() if fileExists("/proc/stb/power/vfd") or fileExists("/proc/stb/lcd/vfd"): config.lcd.power = ConfigSelection([("0", _("No")), ("1", _("Yes"))], "1") config.lcd.power.addNotifier(setLCDpower) else: config.lcd.power = ConfigNothing() if fileExists("/proc/stb/fb/sd_detach"): config.lcd.fblcddisplay = ConfigSelection([("1", _("No")), ("0", _("Yes"))], "1") config.lcd.fblcddisplay.addNotifier(setfblcddisplay) else: config.lcd.fblcddisplay = ConfigNothing() if fileExists("/proc/stb/lcd/show_outputresolution"): config.lcd.showoutputresolution = ConfigSelection([("0", _("No")), ("1", _("Yes"))], "1") config.lcd.showoutputresolution.addNotifier(setLCDshowoutputresolution) else: config.lcd.showoutputresolution = ConfigNothing() if model == "vuultimo": config.lcd.ledblinkingtime = ConfigSlider(default=5, increment=1, limits=(0, 15)) config.lcd.ledblinkingtime.addNotifier(setLEDblinkingtime) config.lcd.ledbrightnessdeepstandby = ConfigSlider(default=1, increment=1, limits=(0, 15)) config.lcd.ledbrightnessdeepstandby.addNotifier(setLEDnormalstate) config.lcd.ledbrightnessdeepstandby.addNotifier(setLEDdeepstandby) config.lcd.ledbrightnessdeepstandby.apply = lambda: setLEDdeepstandby(config.lcd.ledbrightnessdeepstandby) config.lcd.ledbrightnessstandby = ConfigSlider(default=1, increment=1, limits=(0, 15)) config.lcd.ledbrightnessstandby.addNotifier(setLEDnormalstate) config.lcd.ledbrightnessstandby.apply = lambda: setLEDnormalstate(config.lcd.ledbrightnessstandby) config.lcd.ledbrightness = ConfigSlider(default=3, increment=1, limits=(0, 15)) config.lcd.ledbrightness.addNotifier(setLEDnormalstate) config.lcd.ledbrightness.apply = lambda: setLEDnormalstate(config.lcd.ledbrightness) config.lcd.ledbrightness.callNotifiersOnSaveAndCancel = True else: def doNothing(): pass config.lcd.ledbrightness = ConfigNothing() config.lcd.ledbrightness.apply = lambda: doNothing() config.lcd.ledbrightnessstandby = ConfigNothing() config.lcd.ledbrightnessstandby.apply = lambda: doNothing() config.lcd.ledbrightnessdeepstandby = ConfigNothing() config.lcd.ledbrightnessdeepstandby.apply = lambda: doNothing() config.lcd.ledblinkingtime = ConfigNothing() else: def doNothing(): pass config.lcd.contrast = ConfigNothing() config.lcd.bright = ConfigNothing() config.lcd.standby = ConfigNothing() config.lcd.bright.apply = lambda: doNothing() config.lcd.standby.apply = lambda: doNothing() config.lcd.power = ConfigNothing() config.lcd.fblcddisplay = ConfigNothing() config.lcd.mode = ConfigNothing() config.lcd.hdd = ConfigNothing() config.lcd.scroll_speed = ConfigSelection(default="300", choices=[ ("500", _("slow")), ("300", _("normal")), ("100", _("fast"))]) config.lcd.scroll_delay = ConfigSelection(default="10000", choices=[ ("10000", "10 " + _("seconds")), ("20000", "20 " + _("seconds")), ("30000", "30 " + _("seconds")), ("60000", "1 " + _("minute")), ("300000", "5 " + _("minutes")), ("noscrolling", _("off"))]) config.lcd.showoutputresolution = ConfigNothing() config.lcd.ledbrightness = ConfigNothing() config.lcd.ledbrightness.apply = lambda: doNothing() config.lcd.ledbrightnessstandby = ConfigNothing() config.lcd.ledbrightnessstandby.apply = lambda: doNothing() config.lcd.ledbrightnessdeepstandby = ConfigNothing() config.lcd.ledbrightnessdeepstandby.apply = lambda: doNothing() config.lcd.ledblinkingtime = ConfigNothing() config.lcd.picon_pack = ConfigNothing() config.misc.standbyCounter.addNotifier(standbyCounterChanged, initial_call=False)
def createConfig(self, *args): config.pep = ConfigSubsection() config.pep.configsteps = NoSave(ConfigSelection(choices=[1, 5, 10, 25], default = 1)) if os_path.exists("/proc/stb/vmpeg/0/pep_contrast"): def setContrast(config): myval = int(config.value * 256) try: print "--> setting contrast to: %0.8X" % myval f = open("/proc/stb/vmpeg/0/pep_contrast", "w") f.write("%0.8X\n" % myval) f.close() except IOError: print "couldn't write pep_contrast." if not VideoEnhancement.firstRun: self.setConfiguredValues() config.pep.contrast = ConfigSlider(default=128, limits=(0,256)) config.pep.contrast.addNotifier(setContrast) else: config.pep.contrast = NoSave(ConfigNothing()) if os_path.exists("/proc/stb/vmpeg/0/pep_saturation"): def setSaturation(config): myval = int(config.value * 256) try: print "--> setting saturation to: %0.8X" % myval f = open("/proc/stb/vmpeg/0/pep_saturation", "w") f.write("%0.8X\n" % myval) f.close() except IOError: print "couldn't write pep_saturaion." if not VideoEnhancement.firstRun: self.setConfiguredValues() config.pep.saturation = ConfigSlider(default=128, limits=(0,256)) config.pep.saturation.addNotifier(setSaturation) else: config.pep.saturation = NoSave(ConfigNothing()) if os_path.exists("/proc/stb/vmpeg/0/pep_hue"): def setHue(config): myval = int(config.value * 256) try: print "--> setting hue to: %0.8X" % myval f = open("/proc/stb/vmpeg/0/pep_hue", "w") f.write("%0.8X\n" % myval) f.close() except IOError: print "couldn't write pep_hue." if not VideoEnhancement.firstRun: self.setConfiguredValues() config.pep.hue = ConfigSlider(default=128, limits=(0,256)) config.pep.hue.addNotifier(setHue) else: config.pep.hue = NoSave(ConfigNothing()) if os_path.exists("/proc/stb/vmpeg/0/pep_brightness"): def setBrightness(config): myval = int(config.value * 256) try: print "--> setting brightness to: %0.8X" % myval f = open("/proc/stb/vmpeg/0/pep_brightness", "w") f.write("%0.8X\n" % myval) f.close() except IOError: print "couldn't write pep_brightness." if not VideoEnhancement.firstRun: self.setConfiguredValues() config.pep.brightness = ConfigSlider(default=128, limits=(0,256)) config.pep.brightness.addNotifier(setBrightness) else: config.pep.brightness = NoSave(ConfigNothing()) if os_path.exists("/proc/stb/vmpeg/0/pep_block_noise_reduction"): def setBlock_noise_reduction(config): myval = int(config.value) try: print "--> setting block_noise_reduction to: %0.8X" % myval f = open("/proc/stb/vmpeg/0/pep_block_noise_reduction", "w") f.write("%0.8X\n" % myval) f.close() except IOError: print "couldn't write pep_block_noise_reduction." if not VideoEnhancement.firstRun: self.setConfiguredValues() config.pep.block_noise_reduction = ConfigSlider(default=0, limits=(0,5)) config.pep.block_noise_reduction.addNotifier(setBlock_noise_reduction) else: config.pep.block_noise_reduction = NoSave(ConfigNothing()) if os_path.exists("/proc/stb/vmpeg/0/pep_mosquito_noise_reduction"): def setMosquito_noise_reduction(config): myval = int(config.value) try: print "--> setting mosquito_noise_reduction to: %0.8X" % myval f = open("/proc/stb/vmpeg/0/pep_mosquito_noise_reduction", "w") f.write("%0.8X\n" % myval) f.close() except IOError: print "couldn't write pep_mosquito_noise_reduction." if not VideoEnhancement.firstRun: self.setConfiguredValues() config.pep.mosquito_noise_reduction = ConfigSlider(default=0, limits=(0,5)) config.pep.mosquito_noise_reduction.addNotifier(setMosquito_noise_reduction) else: config.pep.mosquito_noise_reduction = NoSave(ConfigNothing()) if os_path.exists("/proc/stb/vmpeg/0/pep_digital_contour_removal"): def setDigital_contour_removal(config): myval = int(config.value) try: print "--> setting digital_contour_removal to: %0.8X" % myval f = open("/proc/stb/vmpeg/0/pep_digital_contour_removal", "w") f.write("%0.8X\n" % myval) f.close() except IOError: print "couldn't write pep_digital_contour_removal." if not VideoEnhancement.firstRun: self.setConfiguredValues() config.pep.digital_contour_removal = ConfigSlider(default=0, limits=(0,5)) config.pep.digital_contour_removal.addNotifier(setDigital_contour_removal) else: config.pep.digital_contour_removal = NoSave(ConfigNothing()) if os_path.exists("/proc/stb/vmpeg/0/pep_split"): def setSplitMode(config): try: print "--> setting splitmode to:",str(config.value) f = open("/proc/stb/vmpeg/0/pep_split", "w") f.write(str(config.value)) f.close() except IOError: print "couldn't write pep_split." if not VideoEnhancement.firstRun: self.setConfiguredValues() config.pep.split = ConfigSelection(choices={ "off": _("Off"), "left": _("Left"), "right": _("Right")}, default = "off") config.pep.split.addNotifier(setSplitMode) else: config.pep.split = NoSave(ConfigNothing()) if os_path.exists("/proc/stb/vmpeg/0/pep_sharpness"): def setSharpness(config): myval = int(config.value * 256) try: print "--> setting sharpness to: %0.8X" % myval f = open("/proc/stb/vmpeg/0/pep_sharpness", "w") f.write("%0.8X\n" % myval) f.close() except IOError: print "couldn't write pep_sharpness." if not VideoEnhancement.firstRun: self.setConfiguredValues() if getBoxType() in ('gbquad', 'gbquadplus'): config.pep.sharpness = ConfigSlider(default=256, limits=(0,256)) else: config.pep.sharpness = ConfigSlider(default=0, limits=(0,256)) config.pep.sharpness.addNotifier(setSharpness) else: config.pep.sharpness = NoSave(ConfigNothing()) if os_path.exists("/proc/stb/vmpeg/0/pep_auto_flesh"): def setAutoflesh(config): myval = int(config.value) try: print "--> setting auto_flesh to: %0.8X" % myval f = open("/proc/stb/vmpeg/0/pep_auto_flesh", "w") f.write("%0.8X\n" % myval) f.close() except IOError: print "couldn't write pep_auto_flesh." if not VideoEnhancement.firstRun: self.setConfiguredValues() config.pep.auto_flesh = ConfigSlider(default=0, limits=(0,4)) config.pep.auto_flesh.addNotifier(setAutoflesh) else: config.pep.auto_flesh = NoSave(ConfigNothing()) if os_path.exists("/proc/stb/vmpeg/0/pep_green_boost"): def setGreenboost(config): myval = int(config.value) try: print "--> setting green_boost to: %0.8X" % myval f = open("/proc/stb/vmpeg/0/pep_green_boost", "w") f.write("%0.8X\n" % myval) f.close() except IOError: print "couldn't write pep_green_boost." if not VideoEnhancement.firstRun: self.setConfiguredValues() config.pep.green_boost = ConfigSlider(default=0, limits=(0,4)) config.pep.green_boost.addNotifier(setGreenboost) else: config.pep.green_boost = NoSave(ConfigNothing()) if os_path.exists("/proc/stb/vmpeg/0/pep_blue_boost"): def setBlueboost(config): myval = int(config.value) try: print "--> setting blue_boost to: %0.8X" % myval f = open("/proc/stb/vmpeg/0/pep_blue_boost", "w") f.write("%0.8X\n" % myval) f.close() except IOError: print "couldn't write pep_blue_boost." if not VideoEnhancement.firstRun: self.setConfiguredValues() config.pep.blue_boost = ConfigSlider(default=0, limits=(0,4)) config.pep.blue_boost.addNotifier(setBlueboost) else: config.pep.blue_boost = NoSave(ConfigNothing()) if os_path.exists("/proc/stb/vmpeg/0/pep_dynamic_contrast"): def setDynamic_contrast(config): myval = int(config.value) try: print "--> setting dynamic_contrast to: %0.8X" % myval f = open("/proc/stb/vmpeg/0/pep_dynamic_contrast", "w") f.write("%0.8X\n" % myval) f.close() except IOError: print "couldn't write pep_dynamic_contrast." if not VideoEnhancement.firstRun: self.setConfiguredValues() if getBoxType() in ('gbquad', 'gbquadplus'): config.pep.dynamic_contrast = ConfigSlider(default=3, limits=(0,256)) else: config.pep.dynamic_contrast = ConfigSlider(default=0, limits=(0,256)) config.pep.dynamic_contrast.addNotifier(setDynamic_contrast) else: config.pep.dynamic_contrast = NoSave(ConfigNothing()) try: x = config.av.scaler_sharpness.value except KeyError: if os_path.exists("/proc/stb/vmpeg/0/pep_scaler_sharpness"): def setScaler_sharpness(config): myval = int(config.value) try: print "--> setting scaler_sharpness to: %0.8X" % myval f = open("/proc/stb/vmpeg/0/pep_scaler_sharpness", "w") f.write("%0.8X\n" % myval) f.close() except IOError: print "couldn't write pep_scaler_sharpness." if not VideoEnhancement.firstRun: self.setConfiguredValues() 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 os_path.exists("/proc/stb/video/hdmi_colorspace") and os_path.exists("/proc/stb/video/hdmi_colorspace_choices"): def setColour_space(config): myval = config.value try: print "--> setting color_soace to:", myval f = open("/proc/stb/video/hdmi_colorspace", "w") f.write(myval) f.close() except IOError: print "couldn't write color_soace." if not VideoEnhancement.firstRun: self.setConfiguredValues() file = open("/proc/stb/video/hdmi_colorspace_choices", "r") modes = file.readline().split() file.close() config.pep.color_space = ConfigSelection(modes, modes[0]) config.pep.color_space.addNotifier(setColour_space) else: config.pep.color_space = NoSave(ConfigNothing()) if os_path.exists("/proc/stb/vmpeg/0/pep_scaler_vertical_dejagging"): def setScaler_vertical_dejagging(configElement): myval = configElement.value and "enable" or "disable" try: print "--> setting scaler_vertical_dejagging to: %s" % myval open("/proc/stb/vmpeg/0/pep_scaler_vertical_dejagging", "w").write(myval) except IOError: print "couldn't write pep_scaler_vertical_dejagging." if not VideoEnhancement.firstRun: self.setConfiguredValues() config.pep.scaler_vertical_dejagging = ConfigBoolean(default=False, descriptions = {False: _("Disabled"), True: _("Enabled")} ) config.pep.scaler_vertical_dejagging.addNotifier(setScaler_vertical_dejagging) else: config.pep.scaler_vertical_dejagging = NoSave(ConfigNothing()) if os_path.exists("/proc/stb/vmpeg/0/smooth"): def setSmooth(configElement): myval = configElement.value and "enable" or "disable" try: print "--> setting smooth to: %s" % myval open("/proc/stb/vmpeg/0/smooth", "w").write(myval) except IOError: print "couldn't write smooth." if not VideoEnhancement.firstRun: self.setConfiguredValues() config.pep.smooth = ConfigBoolean(default=False, descriptions = {False: _("Disabled"), True: _("Enabled")} ) config.pep.smooth.addNotifier(setSmooth) else: config.pep.smooth = NoSave(ConfigNothing()) if VideoEnhancement.firstRun: self.setConfiguredValues() VideoEnhancement.firstRun = False
def fillList(self, preselected_idx=None): streams = [] conflist = [] playing_idx = None if self.settings.menupage.getValue() == PAGE_AUDIO: self.setTitle(_("Select audio track")) service = self.session.nav.getCurrentService() self.audioTracks = audio = service and service.audioTracks() n = audio and audio.getNumberOfTracks() or 0 if SystemInfo["CanDownmixAC3"]: self.settings.downmix = ConfigOnOff( default=config.av.downmix_ac3.value) self.settings.downmix.addNotifier(self.changeAC3Downmix, initial_call=False) conflist.append( getConfigListEntry(_("AC3 downmix"), self.settings.downmix)) self["key_red"].setBoolean(True) if n > 0: self.audioChannel = service.audioChannel() if self.audioChannel: choicelist = [("0", _("left")), ("1", _("stereo")), ("2", _("right"))] self.settings.channelmode = ConfigSelection( choices=choicelist, default=str(self.audioChannel.getCurrentChannel())) self.settings.channelmode.addNotifier(self.changeMode, initial_call=False) conflist.append( getConfigListEntry(_("Channel"), self.settings.channelmode)) self["key_green"].setBoolean(True) else: conflist.append(('', )) self["key_green"].setBoolean(False) playing_idx = self.audioTracks.getCurrentTrack() for idx in range(n): s_number = str(idx + 1) trackinfo = audio.getTrackInfo(idx) languages = trackinfo.getLanguage().split('/') s_codec = AUDIO_FORMATS[trackinfo.getType()][1] s_description = trackinfo.getDescription() or "" s_language = "" selected = idx == playing_idx if selected: playing_idx = idx cnt = 0 for lang in languages: if cnt: s_language += ' / ' if lang in LanguageCodes: s_language += _(LanguageCodes[lang][0]) elif lang == "und": _("<unknown>") else: s_language += lang cnt += 1 streams.append( (SelectionTrackinfoEntry(idx, trackinfo), s_number, s_language, s_codec, s_description, selected and selectionpng or None)) else: streams = [] conflist.append(('', )) self["key_green"].setBoolean(False) elif self.settings.menupage.getValue() == PAGE_SUBTITLES: self.setTitle(_("Subtitle selection")) conflist.append(('', )) conflist.append(('', )) self["key_red"].setBoolean(False) self["key_green"].setBoolean(False) if self.infobar.subtitles_enabled: playing_idx = self.infobar.selected_subtitle else: playing_idx = None subs = self.infobar.getCurrentServiceSubtitle() n = subs and subs.getNumberOfSubtitleTracks() or 0 for idx in range(n): trackinfo = subs.getSubtitleTrackInfo(idx) s_number = str(idx + 1) s_codec = "?" s_language = _("<unknown>") flags = [] selected = idx == playing_idx if selected: playing_idx = idx lang = trackinfo.getLanguage() if lang != "und": if lang in LanguageCodes: s_language = _(LanguageCodes[lang][0]) else: s_language = lang if trackinfo.getType() == iSt.GST: s_codec = GST_SUB_FORMATS[trackinfo.getGstSubtype()][1] else: s_codec = SUB_FORMATS[trackinfo.getType()][1] if trackinfo.getType() in [iSt.GST, iSt.DVD, iSt.TXT]: if trackinfo.isDefault(): flags.append(_("Default")) if trackinfo.isForced(): flags.append(_("Forced")) if trackinfo.getType( ) == iSt.DVD or trackinfo.getGstSubtype() in [ iGSt.stPGS, iGSt.stVOB ]: if trackinfo.getFilter( ) & iSubtitleFilterType_ENUMS.SUB_FILTER_SHOW_FORCED_ONLY: flags.append(_("forced only")) if trackinfo.getFilter( ) & iSubtitleFilterType_ENUMS.SUB_FILTER_SHOW_ALL: flags.append(_("show all")) if trackinfo.isSaved(): flags.append(_("Saved")) s_flags = (", ").join(flags) if s_codec == "TTX": s_codec += " %x%x" % (trackinfo.getMagazineNumber(), trackinfo.getPageNumber()) stream = (SelectionTrackinfoEntry(idx, trackinfo), s_number, s_language, s_codec, s_flags, selected and selectionpng or None) streams.append(stream) conflist.append(getConfigListEntry(_("Menu"), self.settings.menupage)) if hasattr(self.infobar, "runPlugin"): class PluginCaller: def __init__(self, fnc, *args): self.fnc = fnc self.args = args def __call__(self, *args, **kwargs): self.fnc(*self.args) audioPlugins = [(p.name, PluginCaller(self.infobar.runPlugin, p)) for p in plugins.getPlugins( where=PluginDescriptor.WHERE_AUDIOMENU)] if len(audioPlugins) > 0: self["key_blue"].setBoolean(True) text, fnc = audioPlugins[0] conflist.append(getConfigListEntry(text, ConfigNothing())) self.plugincallerdict[text] = fnc if len(audioPlugins) > 1: self["key_menu"].setBoolean(True) if len(audioPlugins) == 2: text, fnc = audioPlugins[1] self.plugincallerdict[text] = fnc conflist.append(getConfigListEntry(text, ConfigNothing())) else: self._extendedAudioPlugins = audioPlugins[1:] text, fnc = _( "More ..."), self.showExtendedAudioPluginChoice audioPlugins.append([text, fnc]) conflist.append(getConfigListEntry(text, ConfigNothing())) self.plugincallerdict[text] = fnc for text, fnc in audioPlugins[1:]: self.plugincallerdict[text] = fnc self["config"].list = conflist self["config"].l.setList(conflist) self["streams"].list = streams if isinstance(preselected_idx, int): self["streams"].setIndex(preselected_idx) elif isinstance(playing_idx, int): self["streams"].setIndex(playing_idx) self.setToggleSubsFilterKey()
def InitLcd(): if getBoxType() in ('gbx34k', 'force4', 'alien5', 'viperslim', 'lunix', 'lunix4k', 'purehdse', 'vipert2c', 'evoslimse', 'evoslimt2c', 'valalinux', 'tmtwin4k', 'tmnanom3', 'mbmicrov2', 'revo4k', 'force3uhd', 'force2nano', 'evoslim', 'wetekplay', 'wetekplay2', 'wetekhub', 'ultrabox', 'novaip', 'dm520', 'dm525', 'purehd', 'mutant11', 'xpeedlxpro', 'zgemmai55', 'sf98', 'et7x00mini', 'xpeedlxcs2', 'xpeedlxcc', 'e4hd', 'e4hdhybrid', 'mbmicro', 'beyonwizt2', 'amikomini', 'dynaspark', 'amiko8900', 'sognorevolution', 'arguspingulux', 'arguspinguluxmini', 'arguspinguluxplus', 'sparkreloaded', 'sabsolo', 'sparklx', 'gis8120', 'gb800se', 'gb800solo', 'gb800seplus', 'gbultrase', 'gbipbox', 'tmsingle', 'tmnano2super', 'iqonios300hd', 'iqonios300hdv2', 'optimussos1plus', 'optimussos1', 'vusolo', 'et4x00', 'et5x00', 'et6x00', 'et7000', 'et7100', 'mixosf7', 'mixoslumi', 'gbx1', 'gbx2', 'gbx3', 'gbx3h'): detected = False else: detected = eDBoxLCD.getInstance().detected() SystemInfo["Display"] = detected config.lcd = ConfigSubsection(); if fileExists("/proc/stb/lcd/mode"): f = open("/proc/stb/lcd/mode", "r") can_lcdmodechecking = f.read() f.close() else: can_lcdmodechecking = False SystemInfo["LCDMiniTV"] = can_lcdmodechecking if detected: ilcd = LCD() if can_lcdmodechecking: def setLCDModeMinitTV(configElement): try: print('setLCDModeMinitTV', configElement.value) f = open("/proc/stb/lcd/mode", "w") f.write(configElement.value) f.close() except: pass def setMiniTVFPS(configElement): try: print('setMiniTVFPS', configElement.value) f = open("/proc/stb/lcd/fps", "w") f.write("%d \n" % configElement.value) f.close() except: pass def setLCDModePiP(configElement): pass def setLCDScreenshot(configElement): ilcd.setScreenShot(configElement.value) config.lcd.modepip = ConfigSelection(choices={ "0": _("off"), "5": _("PIP"), "7": _("PIP with OSD")}, default = "0") config.lcd.modepip.addNotifier(setLCDModePiP) config.lcd.screenshot = ConfigYesNo(default=False) config.lcd.screenshot.addNotifier(setLCDScreenshot) config.lcd.modeminitv = ConfigSelection(choices={ "0": _("normal"), "1": _("MiniTV"), "2": _("OSD"), "3": _("MiniTV with OSD")}, default = "0") config.lcd.fpsminitv = ConfigSlider(default=30, limits=(0, 30)) config.lcd.modeminitv.addNotifier(setLCDModeMinitTV) config.lcd.fpsminitv.addNotifier(setMiniTVFPS) else: config.lcd.modeminitv = ConfigNothing() config.lcd.screenshot = ConfigNothing() config.lcd.fpsminitv = ConfigNothing() config.lcd.scroll_speed = ConfigSelection(default = "300", choices = [ ("500", _("slow")), ("300", _("normal")), ("100", _("fast"))]) config.lcd.scroll_delay = ConfigSelection(default = "10000", choices = [ ("10000", "10 " + _("seconds")), ("20000", "20 " + _("seconds")), ("30000", "30 " + _("seconds")), ("60000", "1 " + _("minute")), ("300000", "5 " + _("minutes")), ("noscrolling", _("off"))]) def setLCDbright(configElement): ilcd.setBright(configElement.value); def setLCDstandbybright(configElement): ilcd.setStandbyBright(configElement.value); def setLCDdimbright(configElement): ilcd.setDimBright(configElement.value); def setLCDdimdelay(configElement): ilcd.setDimDelay(configElement.value); def setLCDcontrast(configElement): ilcd.setContrast(configElement.value); def setLCDinverted(configElement): ilcd.setInverted(configElement.value); def setLCDflipped(configElement): ilcd.setFlipped(configElement.value); def setLCDmode(configElement): ilcd.setMode(configElement.value); def setLCDpower(configElement): ilcd.setPower(configElement.value); def setfblcddisplay(configElement): ilcd.setfblcddisplay(configElement.value); def setLCDshowoutputresolution(configElement): ilcd.setShowoutputresolution(configElement.value); def setLCDminitvmode(configElement): ilcd.setLCDMiniTVMode(configElement.value) def setLCDminitvpipmode(configElement): ilcd.setLCDMiniTVPIPMode(configElement.value) def setLCDminitvfps(configElement): ilcd.setLCDMiniTVFPS(configElement.value) def setLEDnormalstate(configElement): ilcd.setLEDNormalState(configElement.value); def setLEDdeepstandby(configElement): ilcd.setLEDDeepStandbyState(configElement.value); def setLEDblinkingtime(configElement): ilcd.setLEDBlinkingTime(configElement.value); def setPowerLEDstate(configElement): if fileExists("/proc/stb/power/powerled"): f = open("/proc/stb/power/powerled", "w") f.write(configElement.value) f.close() def setPowerLEDstate2(configElement): if fileExists("/proc/stb/power/powerled2"): f = open("/proc/stb/power/powerled2", "w") f.write(configElement.value) f.close() def setPowerLEDstanbystate(configElement): if fileExists("/proc/stb/power/standbyled"): f = open("/proc/stb/power/standbyled", "w") f.write(configElement.value) f.close() def setPowerLEDdeepstanbystate(configElement): if fileExists("/proc/stb/power/suspendled"): f = open("/proc/stb/power/suspendled", "w") f.write(configElement.value) f.close() def setLedPowerColor(configElement): if fileExists("/proc/stb/fp/ledpowercolor"): f = open("/proc/stb/fp/ledpowercolor", "w") f.write(configElement.value) f.close() def setLedStandbyColor(configElement): if fileExists("/proc/stb/fp/ledstandbycolor"): f = open("/proc/stb/fp/ledstandbycolor", "w") f.write(configElement.value) f.close() def setLedSuspendColor(configElement): if fileExists("/proc/stb/fp/ledsuspendledcolor"): f = open("/proc/stb/fp/ledsuspendledcolor", "w") f.write(configElement.value) f.close() def setPower4x7On(configElement): if fileExists("/proc/stb/fp/power4x7on"): f = open("/proc/stb/fp/power4x7on", "w") f.write(configElement.value) f.close() def setPower4x7Standby(configElement): if fileExists("/proc/stb/fp/power4x7standby"): f = open("/proc/stb/fp/power4x7standby", "w") f.write(configElement.value) f.close() def setPower4x7Suspend(configElement): if fileExists("/proc/stb/fp/power4x7suspend"): f = open("/proc/stb/fp/power4x7suspend", "w") f.write(configElement.value) f.close() def setXcoreVFD(configElement): if fileExists("/sys/module/brcmstb_osmega/parameters/pt6302_cgram"): f = open("/sys/module/brcmstb_osmega/parameters/pt6302_cgram", "w") f.write(configElement.value) f.close() if fileExists("/sys/module/brcmstb_spycat4k/parameters/pt6302_cgram"): f = open("/sys/module/brcmstb_spycat4k/parameters/pt6302_cgram", "w") f.write(configElement.value) f.close() if fileExists("/sys/module/brcmstb_spycat4kmini/parameters/pt6302_cgram"): f = open("/sys/module/brcmstb_spycat4kmini/parameters/pt6302_cgram", "w") f.write(configElement.value) f.close() if fileExists("/sys/module/brcmstb_spycat4kcombo/parameters/pt6302_cgram"): f = open("/sys/module/brcmstb_spycat4kcombo/parameters/pt6302_cgram", "w") f.write(configElement.value) f.close() config.usage.vfd_xcorevfd = ConfigSelection(default = "0", choices = [("0", _("12 character")), ("1", _("8 character"))]) config.usage.vfd_xcorevfd.addNotifier(setXcoreVFD) config.usage.lcd_powerled = ConfigSelection(default = "on", choices = [("off", _("Off")), ("on", _("On"))]) config.usage.lcd_powerled.addNotifier(setPowerLEDstate) config.usage.lcd_powerled2 = ConfigSelection(default = "on", choices = [("off", _("Off")), ("on", _("On"))]) config.usage.lcd_powerled2.addNotifier(setPowerLEDstate2) config.usage.lcd_standbypowerled = ConfigSelection(default = "on", choices = [("off", _("Off")), ("on", _("On"))]) config.usage.lcd_standbypowerled.addNotifier(setPowerLEDstanbystate) config.usage.lcd_deepstandbypowerled = ConfigSelection(default = "on", choices = [("off", _("Off")), ("on", _("On"))]) config.usage.lcd_deepstandbypowerled.addNotifier(setPowerLEDdeepstanbystate) config.usage.lcd_ledpowercolor = ConfigSelection(default = "1", choices = [("0", _("off")), ("1", _("blue")), ("2", _("red")), ("3", _("violet"))]) config.usage.lcd_ledpowercolor.addNotifier(setLedPowerColor) config.usage.lcd_ledstandbycolor = ConfigSelection(default = "3", choices = [("0", _("off")), ("1", _("blue")), ("2", _("red")), ("3", _("violet"))]) config.usage.lcd_ledstandbycolor.addNotifier(setLedStandbyColor) config.usage.lcd_ledsuspendcolor = ConfigSelection(default = "2", choices = [("0", _("off")), ("1", _("blue")), ("2", _("red")), ("3", _("violet"))]) config.usage.lcd_ledsuspendcolor.addNotifier(setLedSuspendColor) config.usage.lcd_power4x7on = ConfigSelection(default = "on", choices = [("off", _("Off")), ("on", _("On"))]) config.usage.lcd_power4x7on.addNotifier(setPower4x7On) config.usage.lcd_power4x7standby = ConfigSelection(default = "on", choices = [("off", _("Off")), ("on", _("On"))]) config.usage.lcd_power4x7standby.addNotifier(setPower4x7Standby) config.usage.lcd_power4x7suspend = ConfigSelection(default = "on", choices = [("off", _("Off")), ("on", _("On"))]) config.usage.lcd_power4x7suspend.addNotifier(setPower4x7Suspend) if getBoxType() in ('dm900', 'dm920', 'e4hdultra', 'protek4k'): standby_default = 4 elif getBoxType() in ('spycat4kmini', 'osmega'): standby_default = 10 else: standby_default = 1 if not ilcd.isOled(): config.lcd.contrast = ConfigSlider(default=5, limits=(0, 20)) config.lcd.contrast.addNotifier(setLCDcontrast); else: config.lcd.contrast = ConfigNothing() if getBoxType() in ('novatwin', 'novacombo', 'mixosf5', 'mixosf5mini', 'gi9196m', 'gi9196lite', 'zgemmas2s', 'zgemmash1', 'zgemmash2', 'zgemmass', 'zgemmahs', 'zgemmah2s', 'zgemmah2h', 'spycat'): config.lcd.standby = ConfigSlider(default=standby_default, limits=(0, 4)) config.lcd.dimbright = ConfigSlider(default=standby_default, limits=(0, 4)) config.lcd.bright = ConfigSlider(default=4, limits=(0, 4)) elif getBoxType() in ('spycat4kmini', 'osmega'): config.lcd.standby = ConfigSlider(default=standby_default, limits=(0, 10)) config.lcd.dimbright = ConfigSlider(default=standby_default, limits=(0, 10)) config.lcd.bright = ConfigSlider(default=10, limits=(0, 10)) else: config.lcd.standby = ConfigSlider(default=standby_default, limits=(0, 10)) config.lcd.dimbright = ConfigSlider(default=standby_default, limits=(0, 10)) config.lcd.bright = ConfigSlider(default=SystemInfo["DefaultDisplayBrightness"], limits=(0, 10)) config.lcd.dimbright.addNotifier(setLCDdimbright); config.lcd.dimbright.apply = lambda : setLCDdimbright(config.lcd.dimbright) config.lcd.dimdelay = ConfigSelection(default = "0", choices = [ ("5", "5 " + _("seconds")), ("10", "10 " + _("seconds")), ("15", "15 " + _("seconds")), ("20", "20 " + _("seconds")), ("30", "30 " + _("seconds")), ("60", "1 " + _("minute")), ("120", "2 " + _("minutes")), ("300", "5 " + _("minutes")), ("0", _("off"))]) config.lcd.dimdelay.addNotifier(setLCDdimdelay); config.lcd.standby.addNotifier(setLCDstandbybright); config.lcd.standby.apply = lambda : setLCDstandbybright(config.lcd.standby) config.lcd.bright.addNotifier(setLCDbright); config.lcd.bright.apply = lambda : setLCDbright(config.lcd.bright) config.lcd.bright.callNotifiersOnSaveAndCancel = True config.lcd.invert = ConfigYesNo(default=False) config.lcd.invert.addNotifier(setLCDinverted); config.lcd.flip = ConfigYesNo(default=False) config.lcd.flip.addNotifier(setLCDflipped) if SystemInfo["LcdLiveTV"]: def lcdLiveTvChanged(configElement): open(SystemInfo["LcdLiveTV"], "w").write(configElement.value and "0" or "1") from Screens.InfoBar import InfoBar InfoBarInstance = InfoBar.instance InfoBarInstance and InfoBarInstance.session.open(dummyScreen) config.lcd.showTv = ConfigYesNo(default = False) config.lcd.showTv.addNotifier(lcdLiveTvChanged) if SystemInfo["LCDMiniTV"] and config.misc.boxtype.value not in ( 'gbquad', 'gbquadplus', 'gbquad4k', 'gbue4k'): config.lcd.minitvmode = ConfigSelection([("0", _("normal")), ("1", _("MiniTV")), ("2", _("OSD")), ("3", _("MiniTV with OSD"))], "0") config.lcd.minitvmode.addNotifier(setLCDminitvmode) config.lcd.minitvpipmode = ConfigSelection([("0", _("off")), ("5", _("PIP")), ("7", _("PIP with OSD"))], "0") config.lcd.minitvpipmode.addNotifier(setLCDminitvpipmode) config.lcd.minitvfps = ConfigSlider(default=30, limits=(0, 30)) config.lcd.minitvfps.addNotifier(setLCDminitvfps) if SystemInfo["VFD_scroll_repeats"] and getBoxType() not in ('ixussone', 'ixusszero') and getDisplayType() not in ('7segment',): def scroll_repeats(el): open(SystemInfo["VFD_scroll_repeats"], "w").write(el.value) choicelist = [("0", _("None")), ("1", _("1X")), ("2", _("2X")), ("3", _("3X")), ("4", _("4X")), ("500", _("Continues"))] config.usage.vfd_scroll_repeats = ConfigSelection(default = "3", choices = choicelist) config.usage.vfd_scroll_repeats.addNotifier(scroll_repeats, immediate_feedback = False) else: config.usage.vfd_scroll_repeats = ConfigNothing() if SystemInfo["VFD_scroll_delay"] and getBoxType() not in ('ixussone', 'ixusszero') and getDisplayType() not in ('7segment',): def scroll_delay(el): # add workaround for Boxes who need hex code if getBoxType() in ('sf4008', 'beyonwizu4'): open(SystemInfo["VFD_scroll_delay"], "w").write(hex(int(el.value))) else: open(SystemInfo["VFD_scroll_delay"], "w").write(str(el.value)) config.usage.vfd_scroll_delay = ConfigSlider(default = 150, increment = 10, limits = (0, 500)) config.usage.vfd_scroll_delay.addNotifier(scroll_delay, immediate_feedback = False) config.lcd.hdd = ConfigSelection([("0", _("No")), ("1", _("Yes"))], "1") else: config.lcd.hdd = ConfigNothing() config.usage.vfd_scroll_delay = ConfigNothing() if SystemInfo["VFD_initial_scroll_delay"] and getBoxType() not in ('ixussone', 'ixusszero') and getDisplayType() not in ('7segment',): def initial_scroll_delay(el): if getBoxType() in ('sf4008', 'beyonwizu4'): # add workaround for Boxes who need hex code open(SystemInfo["VFD_initial_scroll_delay"], "w").write(hex(int(el.value))) else: open(SystemInfo["VFD_initial_scroll_delay"], "w").write(el.value) choicelist = [ ("3000", "3 " + _("seconds")), ("5000", "5 " + _("seconds")), ("10000", "10 " + _("seconds")), ("20000", "20 " + _("seconds")), ("30000", "30 " + _("seconds")), ("0", _("no delay"))] config.usage.vfd_initial_scroll_delay = ConfigSelection(default = "10000", choices = choicelist) config.usage.vfd_initial_scroll_delay.addNotifier(initial_scroll_delay, immediate_feedback = False) else: config.usage.vfd_initial_scroll_delay = ConfigNothing() if SystemInfo["VFD_final_scroll_delay"] and getBoxType() not in ('ixussone', 'ixusszero') and getDisplayType() not in ('7segment',): def final_scroll_delay(el): if getBoxType() in ('sf4008', 'beyonwizu4'): # add workaround for Boxes who need hex code open(SystemInfo["VFD_final_scroll_delay"], "w").write(hex(int(el.value))) else: open(SystemInfo["VFD_final_scroll_delay"], "w").write(el.value) choicelist = [ ("3000", "3 " + _("seconds")), ("5000", "5 " + _("seconds")), ("10000", "10 " + _("seconds")), ("20000", "20 " + _("seconds")), ("30000", "30 " + _("seconds")), ("0", _("no delay"))] config.usage.vfd_final_scroll_delay = ConfigSelection(default = "10000", choices = choicelist) config.usage.vfd_final_scroll_delay.addNotifier(final_scroll_delay, immediate_feedback = False) else: config.usage.vfd_final_scroll_delay = ConfigNothing() if fileExists("/proc/stb/lcd/show_symbols"): config.lcd.mode = ConfigSelection([("0", _("No")), ("1", _("Yes"))], "1") config.lcd.mode.addNotifier(setLCDmode); else: config.lcd.mode = ConfigNothing() if fileExists("/proc/stb/power/vfd") or fileExists("/proc/stb/lcd/vfd"): config.lcd.power = ConfigSelection([("0", _("No")), ("1", _("Yes"))], "1") config.lcd.power.addNotifier(setLCDpower); else: config.lcd.power = ConfigNothing() if fileExists("/proc/stb/fb/sd_detach"): config.lcd.fblcddisplay = ConfigSelection([("1", _("No")), ("0", _("Yes"))], "1") config.lcd.fblcddisplay.addNotifier(setfblcddisplay); else: config.lcd.fblcddisplay = ConfigNothing() if fileExists("/proc/stb/lcd/show_outputresolution"): config.lcd.showoutputresolution = ConfigSelection([("0", _("No")), ("1", _("Yes"))], "1") config.lcd.showoutputresolution.addNotifier(setLCDshowoutputresolution); else: config.lcd.showoutputresolution = ConfigNothing() if getBoxType() == 'vuultimo': config.lcd.ledblinkingtime = ConfigSlider(default = 5, increment = 1, limits = (0, 15)) config.lcd.ledblinkingtime.addNotifier(setLEDblinkingtime); config.lcd.ledbrightnessdeepstandby = ConfigSlider(default = 1, increment = 1, limits = (0, 15)) config.lcd.ledbrightnessdeepstandby.addNotifier(setLEDnormalstate); config.lcd.ledbrightnessdeepstandby.addNotifier(setLEDdeepstandby); config.lcd.ledbrightnessdeepstandby.apply = lambda : setLEDdeepstandby(config.lcd.ledbrightnessdeepstandby) config.lcd.ledbrightnessstandby = ConfigSlider(default = 1, increment = 1, limits = (0, 15)) config.lcd.ledbrightnessstandby.addNotifier(setLEDnormalstate); config.lcd.ledbrightnessstandby.apply = lambda : setLEDnormalstate(config.lcd.ledbrightnessstandby) config.lcd.ledbrightness = ConfigSlider(default = 3, increment = 1, limits = (0, 15)) config.lcd.ledbrightness.addNotifier(setLEDnormalstate); config.lcd.ledbrightness.apply = lambda : setLEDnormalstate(config.lcd.ledbrightness) config.lcd.ledbrightness.callNotifiersOnSaveAndCancel = True else: def doNothing(): pass config.lcd.ledbrightness = ConfigNothing() config.lcd.ledbrightness.apply = lambda : doNothing() config.lcd.ledbrightnessstandby = ConfigNothing() config.lcd.ledbrightnessstandby.apply = lambda : doNothing() config.lcd.ledbrightnessdeepstandby = ConfigNothing() config.lcd.ledbrightnessdeepstandby.apply = lambda : doNothing() config.lcd.ledblinkingtime = ConfigNothing() else: def doNothing(): pass config.lcd.contrast = ConfigNothing() config.lcd.bright = ConfigNothing() config.lcd.standby = ConfigNothing() config.lcd.bright.apply = lambda : doNothing() config.lcd.standby.apply = lambda : doNothing() config.lcd.power = ConfigNothing() config.lcd.fblcddisplay = ConfigNothing() config.lcd.mode = ConfigNothing() config.lcd.hdd = ConfigNothing() config.lcd.scroll_speed = ConfigSelection(default = "300", choices = [ ("500", _("slow")), ("300", _("normal")), ("100", _("fast"))]) config.lcd.scroll_delay = ConfigSelection(default = "10000", choices = [ ("10000", "10 " + _("seconds")), ("20000", "20 " + _("seconds")), ("30000", "30 " + _("seconds")), ("60000", "1 " + _("minute")), ("300000", "5 " + _("minutes")), ("noscrolling", _("off"))]) config.lcd.showoutputresolution = ConfigNothing() config.lcd.ledbrightness = ConfigNothing() config.lcd.ledbrightness.apply = lambda : doNothing() config.lcd.ledbrightnessstandby = ConfigNothing() config.lcd.ledbrightnessstandby.apply = lambda : doNothing() config.lcd.ledbrightnessdeepstandby = ConfigNothing() config.lcd.ledbrightnessdeepstandby.apply = lambda : doNothing() config.lcd.ledblinkingtime = ConfigNothing() config.misc.standbyCounter.addNotifier(standbyCounterChanged, initial_call = False)
base_InfoBarNumberZap__init__ = None TimeshiftEnabled = False config.plugins.NumberZapExt = ConfigSubsection() config.plugins.NumberZapExt.enable = ConfigYesNo(default=False) config.plugins.NumberZapExt.first_delay = ConfigInteger( 1000, limits=(0, 9999)) # "time to wait first keypress (milliseconds) config.plugins.NumberZapExt.kdelay = ConfigInteger( 3000, limits=(0, 9999)) # "time to wait next keypress (milliseconds)" config.plugins.NumberZapExt.digits = ConfigInteger(4, limits=(2, 6)) # "alternative service counter in bouquets" try: config.plugins.NumberZapExt.acount = config.usage.alternative_number_mode except: config.plugins.NumberZapExt.acount = ConfigYesNo(default=False) config.plugins.NumberZapExt.acount_help = ConfigNothing() config.plugins.NumberZapExt.picons = ConfigYesNo( default=False) # "enable picons" config.plugins.NumberZapExt.picondir = ConfigDirectory( ) # "picons directory path" config.plugins.NumberZapExt.hotkey = ConfigYesNo( default=False) # "enable number hotkeys" config.plugins.NumberZapExt.hotkeys = ConfigText('{}') config.plugins.NumberZapExt.bouquets_enable = ConfigYesNo( default=False) # "enable number hotkeys bouquets" config.plugins.NumberZapExt.hotkeys_bouquets = ConfigText('[]') config.plugins.NumberZapExt.bouquets_priority = ConfigYesNo(default=False) config.plugins.NumberZapExt.bouquets_help = ConfigNothing() config.plugins.NumberZapExt.hotkeys_priority = ConfigYesNo(default=False) config.plugins.NumberZapExt.hotkeys_confirmation = ConfigYesNo(default=True) config.plugins.NumberZapExt.timeshift_behavior = ConfigSelection(
def createConfigList(self): self.set_color = getConfigListEntry(_("Style:"), self.myAtileHD_color) self.set_sb = getConfigListEntry(_("ColorSelectedBackground:"), self.myAtileHD_sb) self.set_frame = getConfigListEntry(_("Frame:"), self.myAtileHD_frame) self.set_center = getConfigListEntry(_("Center:"), self.myAtileHD_center) self.set_lines = getConfigListEntry(_("Lines:"), self.myAtileHD_lines) self.set_sbar = getConfigListEntry(_("Scrollbar:"), self.myAtileHD_sbar) self.set_infobar = getConfigListEntry(_("Infobar:"), self.myAtileHD_infobar) self.set_wget = getConfigListEntry(_("Clock_Widget:"), self.myAtileHD_wget) self.set_sib = getConfigListEntry(_("Secondinfobar:"), self.myAtileHD_sib) self.set_ch_se = getConfigListEntry(_("Channelselection:"), self.myAtileHD_ch_se) self.set_ev = getConfigListEntry(_("Eventview:"), self.myAtileHD_ev) self.set_emcsel = getConfigListEntry(_("EMC_Selection:"), self.myAtileHD_emcsel) self.set_movsel = getConfigListEntry(_("Movie_Selection:"), self.myAtileHD_movsel) self.set_volume = getConfigListEntry(_("Volume:"), self.myAtileHD_volume) self.set_myatile = getConfigListEntry(_("Enable %s pro:") % cur_skin, self.myAtileHD_active) self.set_new_skin = getConfigListEntry(_("Change skin"), ConfigNothing()) self.find_woeid = getConfigListEntry(_("Search weather location ID"), ConfigNothing()) self.list = [] self.list.append(self.set_myatile) if len(self.myAtileHD_color.choices) > 1: self.list.append(self.set_color) if len(self.myAtileHD_sb.choices) > 1: self.list.append(self.set_sb) if len(self.myAtileHD_frame.choices) > 1: self.list.append(self.set_frame) if len(self.myAtileHD_center.choices) > 1: self.list.append(self.set_center) if len(self.myAtileHD_lines.choices) > 1: self.list.append(self.set_lines) if len(self.myAtileHD_sbar.choices) > 1: self.list.append(self.set_sbar) if len(self.myAtileHD_infobar.choices) > 1: self.list.append(self.set_infobar) if len(self.myAtileHD_wget.choices) > 1: self.list.append(self.set_wget) if len(self.myAtileHD_sib.choices) > 1: self.list.append(self.set_sib) if len(self.myAtileHD_ch_se.choices) > 1: self.list.append(self.set_ch_se) if len(self.myAtileHD_ev.choices) > 1: self.list.append(self.set_ev) if len(self.myAtileHD_emcsel.choices) > 1: self.list.append(self.set_emcsel) if len(self.myAtileHD_movsel.choices) > 1: self.list.append(self.set_movsel) if len(self.myAtileHD_volume.choices) > 1: self.list.append(self.set_volume) self.list.append(self.set_new_skin) #if not config.skin.primary_skin.value == "iFlatFHD/skin.xml": # self.list.append(getConfigListEntry(_("---Weather---"), self.myAtileHD_fake_entry)) # self.list.append(getConfigListEntry(_("Refresh interval in minutes:"), config.plugins.AtileHD.refreshInterval)) # self.list.append(getConfigListEntry(_("Temperature unit:"), config.plugins.AtileHD.tempUnit)) # self.list.append(self.find_woeid) # self.list.append(getConfigListEntry(_("Location # (http://weather.yahoo.com/):"), config.plugins.AtileHD.woeid)) self["config"].list = self.list self["config"].l.setList(self.list) if self.myAtileHD_active.value: self["key_yellow"].setText("%s pro" % cur_skin) else: self["key_yellow"].setText("")
def fillList(self, arg=None): from Tools.ISO639 import LanguageCodes streams = [] conflist = [] selectedidx = 0 self["key_blue"].setBoolean(False) subtitlelist = self.getSubtitleList() if self.settings.menupage.getValue() == PAGE_AUDIO: self.setTitle(_("Select audio track")) service = self.session.nav.getCurrentService() self.audioTracks = audio = service and service.audioTracks() n = audio and audio.getNumberOfTracks() or 0 if SystemInfo["CanDownmixAC3"]: self.settings.downmix = ConfigOnOff(default=config.av.downmix_ac3.value) self.settings.downmix.addNotifier(self.changeAC3Downmix, initial_call = False) conflist.append(getConfigListEntry(_("Multi channel downmix"), self.settings.downmix)) self["key_red"].setBoolean(True) if n > 0: self.audioChannel = service.audioChannel() if self.audioChannel: choicelist = [("0",_("left")), ("1",_("stereo")), ("2", _("right"))] self.settings.channelmode = ConfigSelection(choices = choicelist, default = str(self.audioChannel.getCurrentChannel())) self.settings.channelmode.addNotifier(self.changeMode, initial_call = False) conflist.append(getConfigListEntry(_("Channel"), self.settings.channelmode)) self["key_green"].setBoolean(True) else: conflist.append(('',)) self["key_green"].setBoolean(False) selectedAudio = self.audioTracks.getCurrentTrack() for x in range(n): number = str(x + 1) i = audio.getTrackInfo(x) languages = i.getLanguage().split('/') description = i.getDescription() or "" selected = "" language = "" if selectedAudio == x: selected = "X" selectedidx = x cnt = 0 for lang in languages: if cnt: language += ' / ' if lang in LanguageCodes: language += _(LanguageCodes[lang][0]) elif lang == "und": "" else: language += lang cnt += 1 streams.append((x, "", number, description, language, selected)) else: streams = [] conflist.append(('',)) self["key_green"].setBoolean(False) if subtitlelist: self["key_yellow"].setBoolean(True) conflist.append(getConfigListEntry(_("To subtitle selection"), self.settings.menupage)) else: self["key_yellow"].setBoolean(False) conflist.append(('',)) from Components.PluginComponent import plugins from Plugins.Plugin import PluginDescriptor if hasattr(self.infobar, "runPlugin"): class PluginCaller: def __init__(self, fnc, *args): self.fnc = fnc self.args = args def __call__(self, *args, **kwargs): self.fnc(*self.args) self.Plugins = [ (p.name, PluginCaller(self.infobar.runPlugin, p)) for p in plugins.getPlugins(where = PluginDescriptor.WHERE_AUDIOMENU) ] if self.Plugins: self["key_blue"].setBoolean(True) if len(self.Plugins) > 1: conflist.append(getConfigListEntry(_("Audio plugins"), ConfigNothing())) self.plugincallfunc = [(x[0], x[1]) for x in self.Plugins] else: conflist.append(getConfigListEntry(self.Plugins[0][0], ConfigNothing())) self.plugincallfunc = self.Plugins[0][1] elif self.settings.menupage.getValue() == PAGE_SUBTITLES: self.setTitle(_("Subtitle selection")) conflist.append(('',)) conflist.append(('',)) self["key_red"].setBoolean(False) self["key_green"].setBoolean(False) idx = 0 for x in subtitlelist: number = str(x[1]) description = "?" language = "" selected = "" if self.selectedSubtitle and x[:4] == self.selectedSubtitle[:4]: selected = "X" selectedidx = idx try: if x[4] != "und": if x[4] in LanguageCodes: language = _(LanguageCodes[x[4]][0]) else: language = x[4] except: language = "" if x[0] == 0: description = "DVB" number = "%x" % (x[1]) elif x[0] == 1: description = "teletext" number = "%x%02x" %(x[3] and x[3] or 8, x[2]) elif x[0] == 2: types = (_("unknown"), _("embedded"), _("SSA file"), _("ASS file"), _("SRT file"), _("VOB file"), _("PGS file")) try: description = types[x[2]] except: description = _("unknown") + ": %s" % x[2] number = str(int(number) + 1) streams.append((x, "", number, description, language, selected)) idx += 1 conflist.append(getConfigListEntry(_("To audio selection"), self.settings.menupage)) if self.infobar.selected_subtitle and self.infobar.selected_subtitle != (0,0,0,0) and not ".DVDPlayer'>" in `self.infobar`: self["key_blue"].setBoolean(True) conflist.append(getConfigListEntry(_("Subtitle Quickmenu"), ConfigNothing())) self["config"].list = conflist self["config"].l.setList(conflist) self["streams"].list = streams self["streams"].setIndex(selectedidx)
def fillList(self, arg=None): streams = [] conflist = [] selectedidx = 0 if self.settings.menupage.getValue() == PAGE_AUDIO: self.setTitle(_("Select audio track")) service = self.session.nav.getCurrentService() self.audioTracks = audio = service and service.audioTracks() n = audio and audio.getNumberOfTracks() or 0 if SystemInfo["CanDownmixAC3"]: self.settings.downmix = ConfigOnOff(default=config.av.downmix_ac3.value) self.settings.downmix.addNotifier(self.changeAC3Downmix, initial_call = False) conflist.append(getConfigListEntry(_("Dolby Digital / DTS downmix"), self.settings.downmix)) self["key_red"].setBoolean(True) if n > 0: self.audioChannel = service.audioChannel() if self.audioChannel: choicelist = [("0",_("left")), ("1",_("stereo")), ("2", _("right"))] self.settings.channelmode = ConfigSelection(choices = choicelist, default = str(self.audioChannel.getCurrentChannel())) self.settings.channelmode.addNotifier(self.changeMode, initial_call = False) conflist.append(getConfigListEntry(_("Channel"), self.settings.channelmode)) self["key_green"].setBoolean(True) else: conflist.append(('',)) self["key_green"].setBoolean(False) selectedAudio = self.audioTracks.getCurrentTrack() for x in range(n): number = str(x + 1) i = audio.getTrackInfo(x) languages = i.getLanguage().split('/') description = i.getDescription() or _("<unknown>") selected = "" language = "" if selectedAudio == x: selected = _("Running") selectedidx = x cnt = 0 for lang in languages: if cnt: language += ' / ' if LanguageCodes.has_key(lang): language += LanguageCodes[lang][0] elif lang == "und": _("<unknown>") else: language += lang cnt += 1 streams.append((x, "", number, description, language, selected)) else: streams = [] conflist.append(('',)) self["key_green"].setBoolean(False) elif self.settings.menupage.getValue() == PAGE_SUBTITLES: self.setTitle(_("Subtitle selection")) conflist.append(('',)) conflist.append(('',)) self["key_red"].setBoolean(False) self["key_green"].setBoolean(False) if self.subtitlesEnabled(): sel = self.infobar.selected_subtitle else: sel = None idx = 0 subtitlelist = self.getSubtitleList() if len(subtitlelist): for x in subtitlelist: number = str(x[1]) description = "?" language = _("<unknown>") selected = "" if sel and x == sel: selected = _("Running") selectedidx = idx if x[4] != "und": if LanguageCodes.has_key(x[4]): language = LanguageCodes[x[4]][0] else: language = x[4] if x[0] == 0: description = "DVB" number = "%x" % (x[1]) elif x[0] == 1: description = "TTX" number = "%x%02x" % (x[3],x[2]) elif x[0] == 2: types = (_("<unknown>"), "UTF-8 text", "SSA", "AAS", ".SRT file", "VOB", "PGS (unsupported)") description = types[x[2]] streams.append((x, "", number, description, language, selected)) idx += 1 else: streams = [] conflist.append(getConfigListEntry(_("Menu"), self.settings.menupage)) from Components.PluginComponent import plugins from Plugins.Plugin import PluginDescriptor if hasattr(self.infobar, "runPlugin"): class PluginCaller: def __init__(self, fnc, *args): self.fnc = fnc self.args = args def __call__(self, *args, **kwargs): self.fnc(*self.args) Plugins = [ (p.name, PluginCaller(self.infobar.runPlugin, p)) for p in plugins.getPlugins(where = PluginDescriptor.WHERE_AUDIOMENU) ] if len(Plugins): self["key_blue"].setBoolean(True) conflist.append(getConfigListEntry(Plugins[0][0], ConfigNothing())) self.plugincallfunc = Plugins[0][1] if len(Plugins) > 1: print "plugin(s) installed but not displayed in the dialog box:", Plugins[1:] self["config"].list = conflist self["config"].l.setList(conflist) self["streams"].list = streams self["streams"].setIndex(selectedidx)
def InitLcd(): detected = eDBoxLCD.getInstance() and eDBoxLCD.getInstance().detected() config.lcd = ConfigSubsection(); if detected: def setLCDbright(configElement): ilcd.setBright(configElement.value); def setLCDcontrast(configElement): ilcd.setContrast(configElement.value); def setLCDinverted(configElement): ilcd.setInverted(configElement.value); def setLCDflipped(configElement): ilcd.setFlipped(configElement.value); standby_default = 0 ilcd = LCD() if not ilcd.isOled(): config.lcd.contrast = ConfigSlider(default=5, limits=(0, 20)) config.lcd.contrast.addNotifier(setLCDcontrast); else: config.lcd.contrast = ConfigNothing() standby_default = 1 config.lcd.standby = ConfigSlider(default=standby_default, limits=(0, 10)) config.lcd.standby.addNotifier(setLCDbright); config.lcd.standby.apply = lambda : setLCDbright(config.lcd.standby) config.lcd.bright = ConfigSlider(default=5, limits=(0, 10)) config.lcd.bright.addNotifier(setLCDbright); config.lcd.bright.apply = lambda : setLCDbright(config.lcd.bright) config.lcd.bright.callNotifiersOnSaveAndCancel = True config.lcd.invert = ConfigYesNo(default=False) config.lcd.invert.addNotifier(setLCDinverted); config.lcd.flip = ConfigYesNo(default=False) config.lcd.flip.addNotifier(setLCDflipped); if SystemInfo["LedPowerColor"]: def setLedPowerColor(configElement): open(SystemInfo["LedPowerColor"], "w").write(configElement.value) config.lcd.ledpowercolor = ConfigSelection(default = "1", choices = [("0", _("off")), ("1", _("blue")), ("2", _("red")), ("3", _("violet"))]) config.lcd.ledpowercolor.addNotifier(setLedPowerColor) if SystemInfo["LedStandbyColor"]: def setLedStandbyColor(configElement): open(SystemInfo["LedStandbyColor"], "w").write(configElement.value) config.lcd.ledstandbycolor = ConfigSelection(default = "3", choices = [("0", _("off")), ("1", _("blue")), ("2", _("red")), ("3", _("violet"))]) config.lcd.ledstandbycolor.addNotifier(setLedStandbyColor) if SystemInfo["LedSuspendColor"]: def setLedSuspendColor(configElement): open(SystemInfo["LedSuspendColor"], "w").write(configElement.value) config.lcd.ledsuspendcolor = ConfigSelection(default = "2", choices = [("0", _("off")), ("1", _("blue")), ("2", _("red")), ("3", _("violet"))]) config.lcd.ledsuspendcolor.addNotifier(setLedSuspendColor) if SystemInfo["Power4x7On"]: def setPower4x7On(configElement): open(SystemInfo["Power4x7On"], "w").write(configElement.value) config.lcd.power4x7on = ConfigSelection(default = "on", choices = [("off", _("Off")), ("on", _("On"))]) config.lcd.power4x7on.addNotifier(setPower4x7On) if SystemInfo["Power4x7Standby"]: def setPower4x7Standby(configElement): open(SystemInfo["Power4x7Standby"], "w").write(configElement.value) config.lcd.power4x7standby = ConfigSelection(default = "on", choices = [("off", _("Off")), ("on", _("On"))]) config.lcd.power4x7standby.addNotifier(setPower4x7Standby) if SystemInfo["Power4x7Suspend"]: def setPower4x7Suspend(configElement): open(SystemInfo["Power4x7Suspend"], "w").write(configElement.value) config.lcd.power4x7suspend = ConfigSelection(default = "off", choices = [("off", _("Off")), ("on", _("On"))]) config.lcd.power4x7suspend.addNotifier(setPower4x7Suspend) if SystemInfo["LcdLiveTV"]: def lcdLiveTvChanged(configElement): setLCDLiveTv(configElement.value) configElement.save() config.lcd.showTv = ConfigYesNo(default = False) config.lcd.showTv.addNotifier(lcdLiveTvChanged) if "live_enable" in SystemInfo["LcdLiveTV"]: config.misc.standbyCounter.addNotifier(standbyCounterChangedLCDLiveTV, initial_call = False) else: def doNothing(): pass config.lcd.contrast = ConfigNothing() config.lcd.bright = ConfigNothing() config.lcd.standby = ConfigNothing() config.lcd.bright.apply = lambda : doNothing() config.lcd.standby.apply = lambda : doNothing() config.misc.standbyCounter.addNotifier(standbyCounterChanged, initial_call = False)
def getInitConfig(self): global cur_skin self.is_atile = False if cur_skin == 'AtileHD': self.is_atile = True self.title = _("AXBlueFHD Setup") self.skin_base_dir = "/usr/share/enigma2/%s/" % cur_skin self.default_font_file = "font_atile_Roboto.xml" self.default_color_file = "colors_Original.xml" self.default_epg_file = "epg_Original.xml" self.default_clock_file = "clock_Original.xml" self.default_infobar_file = "infobar_Original.xml" self.default_progr_epg_file = "progr_epg_Original.xml" self.default_sib_file = "sib_Original.xml" self.default_ch_se_file = "ch_se_Original.xml" self.default_progr_sib_file = "progr_sib_Original.xml" self.default_emcsel_file = "emcsel_Original.xml" self.default_progr_infobar_file = "progr_infobar_Original.xml" self.default_progr_chse_file = "progr_chse_Original.xml" self.color_file = "skin_user_colors.xml" self.epg_file = "skin_user_epg.xml" self.clock_file = "skin_user_clock.xml" self.infobar_file = "skin_user_infobar.xml" self.progr_epg_file = "skin_user_progr_epg.xml" self.sib_file = "skin_user_sib.xml" self.ch_se_file = "skin_user_ch_se.xml" self.progr_sib_file = "skin_user_progr_sib.xml" self.emcsel_file = "skin_user_emcsel.xml" self.progr_infobar_file = "skin_user_progr_infobar.xml" self.progr_chse_file = "skin_user_progr_chse.xml" # color current, choices = self.getSettings(self.default_color_file, self.color_file) self.myAtileHD_color = NoSave( ConfigSelection(default=current, choices=choices)) # epg current, choices = self.getSettings(self.default_epg_file, self.epg_file) self.myAtileHD_epg = NoSave( ConfigSelection(default=current, choices=choices)) # clock current, choices = self.getSettings(self.default_clock_file, self.clock_file) self.myAtileHD_clock = NoSave( ConfigSelection(default=current, choices=choices)) # infobar current, choices = self.getSettings(self.default_infobar_file, self.infobar_file) self.myAtileHD_infobar = NoSave( ConfigSelection(default=current, choices=choices)) # progr_epg current, choices = self.getSettings(self.default_progr_epg_file, self.progr_epg_file) self.myAtileHD_progr_epg = NoSave( ConfigSelection(default=current, choices=choices)) # sib current, choices = self.getSettings(self.default_sib_file, self.sib_file) self.myAtileHD_sib = NoSave( ConfigSelection(default=current, choices=choices)) # ch_se current, choices = self.getSettings(self.default_ch_se_file, self.ch_se_file) self.myAtileHD_ch_se = NoSave( ConfigSelection(default=current, choices=choices)) # progr_sib current, choices = self.getSettings(self.default_progr_sib_file, self.progr_sib_file) self.myAtileHD_progr_sib = NoSave( ConfigSelection(default=current, choices=choices)) # emcsel current, choices = self.getSettings(self.default_emcsel_file, self.emcsel_file) self.myAtileHD_emcsel = NoSave( ConfigSelection(default=current, choices=choices)) # progr_infobar current, choices = self.getSettings(self.default_progr_infobar_file, self.progr_infobar_file) self.myAtileHD_progr_infobar = NoSave( ConfigSelection(default=current, choices=choices)) # progr_chse current, choices = self.getSettings(self.default_progr_chse_file, self.progr_chse_file) self.myAtileHD_progr_chse = NoSave( ConfigSelection(default=current, choices=choices)) # myatile myatile_active = self.getmyAtileState() self.myAtileHD_active = NoSave(ConfigYesNo(default=myatile_active)) self.myAtileHD_fake_entry = NoSave(ConfigNothing())
def fillList(self, arg=None): streams = [] conflist = [] selectedidx = 0 self["key_red"].setBoolean(False) self["key_green"].setBoolean(False) self["key_yellow"].setBoolean(False) self["key_blue"].setBoolean(False) service = self.session.nav.getCurrentService() self.audioTracks = audio = service and service.audioTracks() n = audio and audio.getNumberOfTracks() or 0 subtitlelist = self.getSubtitleList() if self.settings.menupage.value == PAGE_AUDIO: self.setTitle(_("Select audio track")) service = self.session.nav.getCurrentService() self.audioTracks = audio = service and service.audioTracks() n = audio and audio.getNumberOfTracks() or 0 if SystemInfo["CanDownmixAC3"]: self.settings.downmix_ac3 = ConfigOnOff( default=config.av.downmix_ac3.value) self.settings.downmix_ac3.addNotifier(self.changeAC3Downmix, initial_call=False) conflist.append( getConfigListEntry(_("Digital downmix"), self.settings.downmix_ac3, None)) if SystemInfo["CanDownmixAAC"]: self.settings.downmix_aac = ConfigOnOff( default=config.av.downmix_aac.value) self.settings.downmix_aac.addNotifier(self.changeAACDownmix, initial_call=False) conflist.append( getConfigListEntry(_("AAC downmix"), self.settings.downmix_aac, None)) if SystemInfo["CanAACTranscode"]: choice_list = [("off", _("off")), ("ac3", _("AC3")), ("dts", _("DTS"))] self.settings.transcodeaac = ConfigSelection( choices=choice_list, default="off") self.settings.transcodeaac.addNotifier(self.setAACTranscode, initial_call=False) conflist.append( getConfigListEntry(_("AAC transcoding"), self.settings.transcodeaac, None)) if SystemInfo["CanPcmMultichannel"]: self.settings.pcm_multichannel = ConfigOnOff( default=config.av.pcm_multichannel.value) self.settings.pcm_multichannel.addNotifier( self.changePCMMultichannel, initial_call=False) conflist.append( getConfigListEntry(_("PCM Multichannel"), self.settings.pcm_multichannel, None)) if n > 0: self.audioChannel = service.audioChannel() if self.audioChannel: choicelist = [("0", _("left")), ("1", _("stereo")), ("2", _("right"))] self.settings.channelmode = ConfigSelection( choices=choicelist, default=str(self.audioChannel.getCurrentChannel())) self.settings.channelmode.addNotifier(self.changeMode, initial_call=False) conflist.append( getConfigListEntry(_("Channel"), self.settings.channelmode, None)) selectedAudio = self.audioTracks.getCurrentTrack() for x in range(n): number = str(x + 1) i = audio.getTrackInfo(x) languages = i.getLanguage().split('/') description = i.getDescription() or "" selected = "" language = "" if selectedAudio == x: selected = "X" selectedidx = x cnt = 0 for lang in languages: if cnt: language += ' / ' if LanguageCodes.has_key(lang): language += _(LanguageCodes[lang][0]) else: language += lang cnt += 1 streams.append( (x, "", number, description, language, selected)) else: conflist.append(('', )) if SystemInfo["Can3DSurround"]: choice_list = [("none", _("off")), ("hdmi", _("HDMI")), ("spdif", _("SPDIF")), ("dac", _("DAC"))] self.settings.surround_3d = ConfigSelection( choices=choice_list, default=config.av.surround_3d.value) self.settings.surround_3d.addNotifier(self.change3DSurround, initial_call=False) conflist.append( getConfigListEntry(_("3D Surround"), self.settings.surround_3d, None)) if SystemInfo[ "Can3DSpeaker"] and config.av.surround_3d.value != "none": choice_list = [("center", _("center")), ("wide", _("wide")), ("extrawide", _("extra wide"))] self.settings.surround_3d_speaker = ConfigSelection( choices=choice_list, default=config.av.surround_3d_speaker.value) self.settings.surround_3d_speaker.addNotifier( self.change3DSurroundSpeaker, initial_call=False) conflist.append( getConfigListEntry(_("3D Surround Speaker Position"), self.settings.surround_3d_speaker, None)) if SystemInfo["CanAutoVolume"]: choice_list = [("none", _("off")), ("hdmi", _("HDMI")), ("spdif", _("SPDIF")), ("dac", _("DAC"))] self.settings.autovolume = ConfigSelection( choices=choice_list, default=config.av.autovolume.value) self.settings.autovolume.addNotifier(self.changeAutoVolume, initial_call=False) conflist.append( getConfigListEntry(_("Auto Volume Level"), self.settings.autovolume, None)) if SystemInfo["Canedidchecking"]: choice_list = [("00000001", _("on")), ("00000000", _("off"))] self.settings.bypass_edid_checking = ConfigSelection( choices=choice_list, default=config.av.bypass_edid_checking.value) self.settings.bypass_edid_checking.addNotifier( self.changeEDIDChecking, initial_call=False) conflist.append( getConfigListEntry(_("Bypass HDMI EDID Check"), self.settings.bypass_edid_checking, None)) from Components.PluginComponent import plugins from Plugins.Plugin import PluginDescriptor if hasattr(self.infobar, "runPlugin"): class PluginCaller: def __init__(self, fnc, *args): self.fnc = fnc self.args = args def __call__(self, *args, **kwargs): self.fnc(*self.args) Plugins = [(p.name, PluginCaller(self.infobar.runPlugin, p)) for p in plugins.getPlugins( where=PluginDescriptor.WHERE_AUDIOMENU)] if len(Plugins): for x in Plugins: if x[0] != 'AudioEffect': # always make AudioEffect Blue button. conflist.append( getConfigListEntry(x[0], ConfigNothing(), x[1])) elif self.settings.menupage.value == PAGE_SUBTITLES: self.setTitle(_("Subtitle selection")) idx = 0 for x in subtitlelist: number = str(x[1]) description = "?" language = "" selected = "" if self.selectedSubtitle and x[:4] == self.selectedSubtitle[:4]: selected = "X" selectedidx = idx try: if x[4] != "und": if LanguageCodes.has_key(x[4]): language = _(LanguageCodes[x[4]][0]) else: language = x[4] except: language = "" if x[0] == 0: description = "DVB" number = "%x" % (x[1]) elif x[0] == 1: description = "teletext" number = "%x%02x" % (x[3] and x[3] or 8, x[2]) elif x[0] == 2: types = ("unknown", "embedded", "SSA file", "ASS file", "SRT file", "VOB file", "PGS file") try: description = types[x[2]] except: description = _("unknown") + ": %s" % x[2] number = str(int(number) + 1) streams.append( (x, "", number, description, language, selected)) idx += 1 if self.infobar.selected_subtitle and self.infobar.selected_subtitle != ( 0, 0, 0, 0) and not ".DVDPlayer'>" in ` self.infobar `: conflist.append( getConfigListEntry(_("Subtitle Quickmenu"), ConfigNothing(), None)) if len(conflist) > 0 and conflist[0][0]: self["key_red"].setBoolean(True) if len(conflist) > 1 and conflist[1][0]: self["key_green"].setBoolean(True) if len(conflist) > 2 and conflist[2][0]: self["key_yellow"].setBoolean(True) if len(conflist) > 3 and conflist[3][0]: self["key_blue"].setBoolean(True) self["config"].list = conflist self["config"].l.setList(conflist) self["streams"].list = streams self["streams"].setIndex(selectedidx)
def createSetup(self): self.list = [ getConfigListEntry(_("Enable Autoresolution"), config.plugins.autoresolution.enable) ] if config.plugins.autoresolution.enable.value: if usable: for mode, label in resolutions: self.list.append(getConfigListEntry(label, videoresolution_dictionary[mode])) self.list.extend(( getConfigListEntry(_("Refresh Rate")+" 720p", config.av.videorate["720p"]), getConfigListEntry(_("Refresh Rate")+" 1080i", config.av.videorate["1080i"]), getConfigListEntry(_("Show info screen"), config.plugins.autoresolution.showinfo), getConfigListEntry(_("Delay x seconds after service started"), config.plugins.autoresolution.delay_switch_mode), getConfigListEntry(_("Running in testmode"), config.plugins.autoresolution.testmode), getConfigListEntry(_("Deinterlacer mode for interlaced content"), config.plugins.autoresolution.deinterlacer), getConfigListEntry(_("Deinterlacer mode for progressive content"), config.plugins.autoresolution.deinterlacer_progressive) )) else: self.list.append(getConfigListEntry(_("Autoresolution is not working in Scart/DVI-PC Mode"), ConfigNothing())) self["config"].list = self.list self["config"].setList(self.list)
def __init__(self, item, sub_page): SitemapWidget.__init__(self, item, sub_page) ConfigNothing.__init__(self)