def InitRFmod(): detected = eRFmod.getInstance().detected() BoxInfo.setItem("RfModulator", detected) config.rfmod = ConfigSubsection() if detected: config.rfmod.enable = ConfigOnOff(default=False) config.rfmod.test = ConfigOnOff(default=False) config.rfmod.sound = ConfigOnOff(default=True) config.rfmod.soundcarrier = ConfigSelection(choices=[ ("4500", "4.5 MHz"), ("5500", "5.5 MHz"), ("6000", "6.0 MHz"), ("6500", "6.5 MHz") ], default="5500") config.rfmod.channel = ConfigSelection( default="36", choices=[ "%d" % x for x in list(range(RFMOD_CHANNEL_MIN, RFMOD_CHANNEL_MAX)) ]) config.rfmod.finetune = ConfigSlider(default=5, limits=(1, 10)) iRFmod = RFmod() def setFunction(configElement): iRFmod.setFunction(configElement.value) def setTestmode(configElement): iRFmod.setTestmode(configElement.value) def setSoundFunction(configElement): iRFmod.setSoundFunction(configElement.value) def setSoundCarrier(configElement): iRFmod.setSoundCarrier(configElement.index) def setChannel(configElement): iRFmod.setChannel(int(configElement.value)) def setFinetune(configElement): iRFmod.setFinetune(configElement.value - 5) # this will call the "setup-val" initial config.rfmod.enable.addNotifier(setFunction) config.rfmod.test.addNotifier(setTestmode) config.rfmod.sound.addNotifier(setSoundFunction) config.rfmod.soundcarrier.addNotifier(setSoundCarrier) config.rfmod.channel.addNotifier(setChannel) config.rfmod.finetune.addNotifier(setFinetune) else: config.rfmod.enable = ConfigNothing() config.rfmod.test = ConfigNothing() config.rfmod.sound = ConfigNothing() config.rfmod.soundcarrier = ConfigNothing() config.rfmod.channel = ConfigNothing() config.rfmod.finetune = ConfigNothing()
def init(): if LogConfig._initialized: return else: from Components.config import config, ConfigSubsection, ConfigOnOff, ConfigSelection config.log = ConfigSubsection() config.log.level = ConfigSelection( choices={ str(LOG_LEVEL_DEBUG) : "DEBUG", str(LOG_LEVEL_INFO) : "INFO", str(LOG_LEVEL_WARNING) : "WARNING", str(LOG_LEVEL_ERROR) : "ERROR", }, default=str(LOG_LEVEL_INFO)) config.log.verbose = ConfigOnOff(default=False) config.log.colored = ConfigOnOff(default=True) LogConfig._initialized = True
def getTechnologyConfig(self): l = [] techs = self._nm.getTechnologies() self._tech_conn = [] for tech in techs: cfg = ConfigOnOff(default=tech.powered()) cfg.tech = tech cfg.addNotifier(self._setTechPowered, initial_call=False) self._tech_conn.append(tech.poweredChanged.connect(self._techPoweredChanged)) self._tech_conn.append(tech.scanFinished.connect(boundFunction(self._scanFinished, tech))) title = "%s (%s)" %(tech.name(), tech.type()) l.append(getConfigListEntry(title, cfg)) Log.w(l) return l
def createConfig(self, *args): config.inputDevices = ConfigSubsection() config.inputDevices.settings = ConfigSubsection() config.inputDevices.settings.firstDevice = ConfigBoolean(default=True) config.inputDevices.settings.logBattery = ConfigBoolean(default=False) config.inputDevices.settings.listboxFeedback = ConfigOnOff( default=True) colors = [ ("0xFF0000", _("red")), ("0xFF3333", _("rose")), ("0xFF5500", _("orange")), ("0xDD9900", _("yellow")), ("0x99DD00", _("lime")), ("0x00FF00", _("green")), ("0x00FF99", _("aqua")), ("0x00BBFF", _("olympic blue")), ("0x0000FF", _("blue")), ("0x6666FF", _("azure")), ("0x9900FF", _("purple")), ("0xFF0066", _("pink")), ] config.inputDevices.settings.connectedColor = ConfigSelection( colors, default="0xFF0066") config.inputDevices.settings.connectedColor.addNotifier( self._onConnectedRcuColorChanged, initial_call=False) for device in sorted(six.iterkeys(iInputDevices.Devices)): self.currentDevice = device #print "[InitInputDevices] -> creating config entry for device: %s -> %s " % (self.currentDevice, iInputDevices.Devices[device]["name"]) self.setupConfigEntries(self.currentDevice) self.currentDevice = ""
def createConfigElement(self): if self.object_type == EIB_SWITCH and self.img in ("light", "outlet", "fan", "pump"): self.config_element = ConfigOnOff() elif self.object_type == EIB_SWITCH and self.img == "blinds": self.config_element = ConfigUpDown() elif self.object_type == EIB_SWITCH: self.config_element = ConfigBoolean() elif self.object_type == EIB_MULTISWITCH: choiceslist = [] for choice in self.custom_values: choiceslist.append(choice) self.config_element = ConfigSelection(choices=choiceslist) elif self.object_type == EIB_DIMMER: self.config_element = ConfigSelectionNumber(0, 255, 1) #self.config_element = ConfigSlider(increment = 10, limits=(0,255)) elif self.object_type == EIB_THERMO: self.config_element = ConfigFloat(default=[0, 0], limits=[(-31, +31), (0, 99)]) elif self.object_type == EIB_GOTO: self.config_element = ConfigGoto() elif self.object_type == EIB_TEXT: self.config_element = ConfigEIBText() else: print "[createConfigElement] couldn't create config_element for", self.getInfo( )
def InitSetupDevices(): def languageNotifier(configElement): language.activateLanguage(configElement.value) config.osd = ConfigSubsection() config.osd.language = ConfigText(default="en_GB") config.osd.language.addNotifier(languageNotifier) def keyboardNotifier(configElement): keyboard.activateKeyboardMap(configElement.index) config.keyboard = ConfigSubsection() config.keyboard.keymap = ConfigSelection( default=keyboard.getDefaultKeyboardMap(), choices=keyboard.getKeyboardMaplist()) config.keyboard.keymap.addNotifier(keyboardNotifier) config.parental = ConfigSubsection() config.parental.lock = ConfigOnOff(default=False) config.parental.setuplock = ConfigOnOff(default=False) config.expert = ConfigSubsection() config.expert.satpos = ConfigOnOff(default=True) config.expert.fastzap = ConfigOnOff(default=True) config.expert.skipconfirm = ConfigOnOff(default=False) config.expert.hideerrors = ConfigOnOff(default=False) config.expert.autoinfo = ConfigOnOff(default=True)
def InitSetupDevices(): def keyboardNotifier(configElement): keyboard.activateKeyboardMap(configElement.index) config.keyboard = ConfigSubsection() config.keyboard.keymap = ConfigSelection( default=keyboard.getDefaultKeyboardMap(), choices=keyboard.getKeyboardMaplist()) config.keyboard.keymap.addNotifier(keyboardNotifier) def languageNotifier(configElement): language.activateLanguage(configElement.value) config.osd = ConfigSubsection() if getMachineBrand() == 'Atto.TV': defaultLanguage = "pt_BR" elif getMachineBrand() == 'Zgemma': defaultLanguage = "en_US" elif getMachineBrand() == 'Beyonwiz': defaultLanguage = "en_GB" else: defaultLanguage = "de_DE" config.osd.language = ConfigText(default=defaultLanguage) config.osd.language.addNotifier(languageNotifier) config.parental = ConfigSubsection() config.parental.lock = ConfigOnOff(default=False) config.parental.setuplock = ConfigOnOff(default=False) config.expert = ConfigSubsection() config.expert.satpos = ConfigOnOff(default=True) config.expert.fastzap = ConfigOnOff(default=True) config.expert.skipconfirm = ConfigOnOff(default=False) config.expert.hideerrors = ConfigOnOff(default=False) config.expert.autoinfo = ConfigOnOff(default=True)
def new(self): l = config.plugins.simpleRSS.feed s = ConfigSubsection() s.uri = ConfigText(default="http://", fixed_size = False) s.autoupdate = ConfigOnOff(default=True) id = len(l) l.append(s) self.session.openWithCallback(self.conditionalNew, RSSFeedEdit, id)
def __init__(self, session): Screen.__init__(self, session) self.mode4ds_title = _("LAN Setting") self["status"] = StaticText() self.enableConfigEntry = None self.enableEntry = None self.connectEntry = None self.list = [] self.onChangedEntry = [] self.mode_4dssetup = ConfigOnOff( default=os.path.exists("/etc/.4dsmode")) ConfigListScreen.__init__(self, self.list, session=session, on_change=self.changedEntry) config.lists = ConfigSubsection() self["description"] = StaticText() self["Statustext"] = StaticText() self["statuspic"] = MultiPixmap() self["statuspic"].hide() if os.path.exists("/etc/.4dsmode"): self["key_red"] = StaticText(_("Cancel")) self["key_green"] = StaticText(_("Save")) self["key_yellow"] = StaticText(_("Download Key")) self["actions"] = NumberActionMap( ["SetupActions", "MenuActions", "ColorActions"], { "cancel": self.keyCancel, "save": self.apply, "menu": self.closeRecursive, "ok": self.openSelected, "yellow": self.downloadKey, }, -2) else: self["key_red"] = StaticText(_("Cancel")) self["key_green"] = StaticText(_("Save")) self["actions"] = NumberActionMap( ["SetupActions", "MenuActions"], { "cancel": self.keyCancel, "save": self.apply, "menu": self.closeRecursive, "ok": self.openSelected, }, -2) if not self.SelectionChanged in self["config"].onSelectionChanged: self["config"].onSelectionChanged.append(self.SelectionChanged) config.lists = ConfigSubsection() self.createSetup() self.onLayoutFinish.append(self.layoutFinished)
def __init__(self, session, params=None): debug("[EmailConfigAccount] __init__") self._session = session Screen.__init__(self, session) self.list = [] ConfigListScreen.__init__(self, self.list, session=session) self["buttonred"] = Label(_("cancel")) self["buttongreen"] = Label(_("ok")) self["setupActions"] = ActionMap( ["SetupActions"], { "green": self.save, "red": self.cancel, "save": self.save, "cancel": self.cancel, "ok": self.save, }, -2) if params: (self._name, self._server, self._port, self._user, self._password, self._interval, self._maxmail, self._listall) = params else: (self._name, self._server, self._port, self._user, self._password, self._interval, self._maxmail, self._listall) = ("", "", "993", "", "", "60", "50", False) self._cName = ConfigText(self._name, fixed_size=False) self._cServer = ConfigText(self._server, fixed_size=False) self._cPort = ConfigSelection(choices=[("143", "143"), ("993", "993 (SSL)")], default=self._port) self._cUser = ConfigText(self._user, fixed_size=False) self._cPassword = ConfigPassword(self._password, fixed_size=False) self._cInterval = ConfigText(self._interval, fixed_size=False) self._cInterval.setUseableChars('0123456789,') self._cMaxmail = ConfigText(self._maxmail, fixed_size=False) self._cMaxmail.setUseableChars('0123456789,') self._cListall = ConfigOnOff(self._listall) self.list = [ getConfigListEntry(_("account name"), self._cName), getConfigListEntry(_("IMAP Server"), self._cServer), getConfigListEntry(_("IMAP Port"), self._cPort), getConfigListEntry(_("user name"), self._cUser), getConfigListEntry(_("password"), self._cPassword), getConfigListEntry(_("mail check interval (minutes)"), self._cInterval), getConfigListEntry(_("maximum mail size to fetch"), self._cMaxmail), getConfigListEntry(_("list all mailboxes"), self._cListall) ] self["config"].list = self.list self["config"].l.setList(self.list)
def addFeed(address, auto = False): l = config.plugins.simpleRSS.feed # Create new Item s = ConfigSubsection() s.uri = ConfigText(default="http://", fixed_size = False) s.autoupdate = ConfigOnOff(default=True) # Set values s.uri.value = address s.autoupdate.value = auto # Save l.append(s) l.save()
def createConfig(self): self.sharetypelist = [] self.sharetypelist.append(("nfs", _("NFS share"))) self.sharetypelist.append(("cifs", _("CIFS share"))) mounttype = self.mountinfo['mounttype'] active = self.mountinfo['active'] ip = self.convertIP(self.mountinfo['ip']) sharename = self.mountinfo['sharename'] sharedir = self.mountinfo['sharedir'] options = self.mountinfo['options'] username = self.mountinfo['username'] password = self.mountinfo['password'] hdd_replacement = self.mountinfo['hdd_replacement'] if mounttype == "nfs": defaultOptions = iAutoMount.DEFAULT_OPTIONS_NFS['options'] else: defaultOptions = iAutoMount.DEFAULT_OPTIONS_CIFS['options'] self._cfgActive = NoSave(ConfigOnOff(default=active)) self._cfgIp = NoSave(ConfigIP(default=ip)) self._cfgSharename = NoSave( ConfigText(default=sharename, visible_width=50, fixed_size=False)) self._cfgSharedir = NoSave( ConfigText(default=sharedir, visible_width=50, fixed_size=False)) self._cfgOptions = NoSave( ConfigText(default=defaultOptions, visible_width=50, fixed_size=False)) if options is not False: self._cfgOptions.value = options self._cfgUsername = NoSave( ConfigText(default=username, visible_width=50, fixed_size=False)) self._cfgPassword = NoSave( ConfigPassword(default=password, visible_width=50, fixed_size=False)) self._cfgMounttype = NoSave( ConfigSelection(self.sharetypelist, default=mounttype)) self._cfgHddReplacement = NoSave(ConfigYesNo(default=hdd_replacement))
def setupConfig(self): #Streamserver base config self.config = Config() self.config.streamserver = ConfigSubsection() self.config.streamserver.source = ConfigSelection(StreamServerControl.INPUT_MODES, default=str(eStreamServer.INPUT_MODE_LIVE)) self.config.streamserver.audioBitrate = ConfigInteger(96, StreamServerControl.AUDIO_BITRATE_LIMITS) self.config.streamserver.videoBitrate = ConfigInteger(1500, StreamServerControl.VIDEO_BITRATE_LIMITS) self.config.streamserver.autoBitrate = ConfigOnOff(default=False) self.config.streamserver.resolution = ConfigSelection(list(StreamServerControl.RESOLUTIONS.keys()), default=StreamServerControl.RES_KEY_PAL) self.config.streamserver.framerate = ConfigSelection(StreamServerControl.FRAME_RATES, default=StreamServerControl.FRAME_RATE_23_976) # extended encoder settings self.config.streamserver.gopLength = ConfigInteger(default=eStreamServer.GOP_LENGTH_AUTO, limits=[eStreamServer.GOP_LENGTH_MIN, eStreamServer.GOP_LENGTH_MAX]) self.config.streamserver.gopOnSceneChange = ConfigOnOff(default=False) self.config.streamserver.openGop = ConfigOnOff(default=False) self.config.streamserver.bFrames = ConfigInteger(default=eStreamServer.BFRAMES_DEFAULT, limits=[eStreamServer.BFRAMES_MIN, eStreamServer.BFRAMES_MAX]) self.config.streamserver.pFrames = ConfigInteger(default=eStreamServer.PFRAMES_DEFAULT, limits=[eStreamServer.PFRAMES_MIN, eStreamServer.PFRAMES_MAX]) self.config.streamserver.slices = ConfigInteger(default=eStreamServer.SLICES_DEFAULT, limits=[eStreamServer.SLICES_MIN, eStreamServer.SLICES_MAX]) self.config.streamserver.level = ConfigSelection(StreamServerControl.LEVELS, default=str(eStreamServer.LEVEL_DEFAULT)) self.config.streamserver.profile = ConfigSelection(StreamServerControl.PROFILES, default=str(eStreamServer.PROFILE_DEFAULT)) #servers self.config.streamserver.rtsp = ConfigSubsection() self.config.streamserver.rtsp.enabled = ConfigOnOff(default=False) self.config.streamserver.rtsp.port = ConfigInteger(554, StreamServerControl.PORT_LIMITS) self.config.streamserver.rtsp.path = ConfigText(default="stream", fixed_size=False) self.config.streamserver.rtsp.user = ConfigText(default="", fixed_size=False) self.config.streamserver.rtsp.password = ConfigPassword(default="") self.config.streamserver.hls = ConfigSubsection() self.config.streamserver.hls.enabled = ConfigOnOff(default=False) self.config.streamserver.hls.path = ConfigText(default="stream", fixed_size=False) self.config.streamserver.hls.user = ConfigText(default="", fixed_size=False) self.config.streamserver.hls.password = ConfigPassword(default="") self.config.streamserver.hls.port = ConfigInteger(8080, StreamServerControl.PORT_LIMITS) self.config.streamserver.lastservice = ConfigText(default=config.tv.lastservice.value) self.config.streamserver.mediator = ConfigSubsection() self.config.streamserver.mediator.enabled = ConfigOnOff(default=False) self.config.streamserver.mediator.boxid = ConfigText() self.config.streamserver.mediator.boxkey = ConfigText() self.config.streamserver.mediator.streaminggroups = ConfigSubsection() self.config.streamserver.mediator.streaminggroups.member_alias = ConfigText(default="dreambox", fixed_size=False) self.config.streamserver.mediator.streaminggroups.stream_alias = ConfigText(default="", fixed_size=False) self.config.streamserver.mediator.streaminggroups.hide_empty = ConfigYesNo(default=False) self.config.streamserver.client = ConfigSubsection() self.config.streamserver.client.boxid = ConfigText(default="", fixed_size=False) self.config.streamserver.client.boxkey = ConfigText(default="", fixed_size=False) self.loadConfig()
from Screens.MinuteInput import MinuteInput from Screens.Screen import Screen from .e2_utils import getFps, fps_float, BaseMenuScreen, isFullHD, getDesktopSize from enigma import eTimer, getDesktop from .parsers.baseparser import ParseError from .process import LoadError, DecodeError, ParserNotFoundError from skin import parseColor from .subtitles import SubsChooser, initSubsSettings, SubsScreen, \ SubsLoader, PARSERS, ALL_LANGUAGES_ENCODINGS, ENCODINGS, \ warningMessage config.plugins.subsSupport = ConfigSubsection() config.plugins.subsSupport.dvb = ConfigSubsection() config.plugins.subsSupport.dvb.autoSync = ConfigOnOff(default=True) class SubsSetupDVBPlayer(BaseMenuScreen): def __init__(self, session, dvbSettings): BaseMenuScreen.__init__(self, session, _("DVB player settings")) self.dvbSettings = dvbSettings def buildMenu(self): self['config'].setList([getConfigListEntry(_("Auto sync to current event"), self.dvbSettings.autoSync)]) class SubsSupportDVB(object): def __init__(self, session): self.session = session self.subsSettings = initSubsSettings()
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': 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 ".DVDPlayer'>" not 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) return
from Components.config import config, ConfigOnOff, ConfigSelectionNumber, ConfigSubsection config.plugins.screensaver = ConfigSubsection() config.plugins.screensaver.enabled = ConfigOnOff(default=True) config.plugins.screensaver.delay = ConfigSelectionNumber(30, 120, 30, default=30, wraparound=True) config.plugins.screensaver.photo = ConfigSubsection() config.plugins.screensaver.photo.speed = ConfigSelectionNumber(1, 6, 1, default=3, wraparound=True) config.plugins.screensaver.photo.retention = ConfigSelectionNumber( 30, 120, 30, default=30, wraparound=True)
def __init__(self, default = False): ConfigOnOff.__init__(self, default = default)
def InitSetupDevices(): def initTimezoneSettings(): def getZoneChoices(): zones = [(zone.key, zone.name) for zone in timezones.regionalZones( config.timezone.region.value)] if timezones.defaultRegion != config.timezone.region.value: defaultZone = zones[0][0] else: defaultZone = timezones.defaultZone return zones, defaultZone def timezoneNotifier(configElement): timezones.activateTimezone(configElement.value) def timezoneRegionNotifier(configElement): zones, defaultZone = getZoneChoices() config.timezone.zone.setChoices(default=defaultZone, choices=zones) #region config.timezone = ConfigSubsection() config.timezone.region = ConfigSelection( default=timezones.defaultRegion, choices=timezones.regions) config.timezone.region.save_disabled = True zones, defaultZone = getZoneChoices() config.timezone.zone = ConfigSelection(default=defaultZone, choices=zones) config.timezone.region.addNotifier(timezoneRegionNotifier) config.timezone.zone.addNotifier(timezoneNotifier) config.timezone.version = ConfigInteger(default=0) timezones.checkUpgrade() timezones.onReady.remove(initTimezoneSettings) timezones.onReady.append(initTimezoneSettings) def keyboardNotifier(configElement): keyboard.activateKeyboardMap(configElement.index) config.keyboard = ConfigSubsection() config.keyboard.keymap = ConfigSelection( default=keyboard.getDefaultKeyboardMap(), choices=keyboard.getKeyboardMaplist()) config.keyboard.keymap.addNotifier(keyboardNotifier) def languageNotifier(configElement): language.activateLanguage(configElement.value) config.osd = ConfigSubsection() config.osd.language = ConfigText(default="en_EN") config.osd.language.addNotifier(languageNotifier, immediate_feedback=False, call_on_save_or_cancel=True, initial_call=True) config.parental = ConfigSubsection() config.parental.lock = ConfigOnOff(default=False) config.parental.setuplock = ConfigOnOff(default=False) config.expert = ConfigSubsection() config.expert.satpos = ConfigOnOff(default=True) config.expert.fastzap = ConfigOnOff(default=True) config.expert.skipconfirm = ConfigOnOff(default=False) config.expert.hideerrors = ConfigOnOff(default=False) config.expert.autoinfo = ConfigOnOff(default=True)
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"]: 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) 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(('', )) if SystemInfo["Has3DSurround"]: 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[ "Has3DSpeaker"] 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["HasAutoVolume"]: 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) 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 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 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(('', )) self["key_red"].setBoolean(False) if self.infobar.selected_subtitle: conflist.append( getConfigListEntry(_("Subtitle Quickmenu"), ConfigNothing())) self["key_green"].setBoolean(True) else: conflist.append(('', )) 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(): # FIXME remove getBoxType 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 elif getBoxType() in ('pulse4kmini', ): detected = True else: detected = eDBoxLCD.getInstance().detected() BoxInfo.setItem("Display", detected) config.lcd = ConfigSubsection() if exists("/proc/stb/lcd/mode"): can_lcdmodechecking = fileReadLine("/proc/stb/lcd/mode") else: can_lcdmodechecking = False BoxInfo.setItem("LCDMiniTV", can_lcdmodechecking) if detected: ilcd = LCD() if can_lcdmodechecking: def setLCDModeMinitTV(configElement): print("[Lcd] setLCDModeMinitTV='%s'." % configElement.value) fileWriteLine("/proc/stb/lcd/mode", configElement.value) def setMiniTVFPS(configElement): print("[Lcd] setMiniTVFPS='%s'." % configElement.value) fileWriteLine("/proc/stb/lcd/fps", configElement.value) def setLCDModePiP(configElement): pass # DEBUG: Should this be doing something? 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(choices=[("500", _("slow")), ("300", _("normal")), ("100", _("fast"))], default="300") config.lcd.scroll_delay = ConfigSelection(choices=[ ("10000", "10 %s" % _("seconds")), ("20000", "20 %s" % _("seconds")), ("30000", "30 %s" % _("seconds")), ("60000", "1 %s" % _("minute")), ("300000", "5 %s" % _("minutes")), ("noscrolling", _("Off")) ], default="10000") 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 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 exists("/proc/stb/power/powerled"): fileWriteLine("/proc/stb/power/powerled", "on" if configElement.value else "off") def setPowerLEDstate2(configElement): if exists("/proc/stb/power/powerled2"): fileWriteLine("/proc/stb/power/powerled2", "on" if configElement.value else "off") def setPowerLEDstanbystate(configElement): if exists("/proc/stb/power/standbyled"): fileWriteLine("/proc/stb/power/standbyled", "on" if configElement.value else "off") def setPowerLEDdeepstanbystate(configElement): if exists("/proc/stb/power/suspendled"): fileWriteLine("/proc/stb/power/suspendled", "on" if configElement.value else "off") def setLedPowerColor(configElement): if exists("/proc/stb/fp/ledpowercolor"): fileWriteLine("/proc/stb/fp/ledpowercolor", configElement.value) def setLedStandbyColor(configElement): if exists("/proc/stb/fp/ledstandbycolor"): fileWriteLine("/proc/stb/fp/ledstandbycolor", configElement.value) def setLedSuspendColor(configElement): if exists("/proc/stb/fp/ledsuspendledcolor"): fileWriteLine("/proc/stb/fp/ledsuspendledcolor", configElement.value) def setLedBlinkControlColor(configElement): if exists("/proc/stb/fp/led_blink"): fileWriteLine("/proc/stb/fp/led_blink", configElement.value) def setLedBrightnessControl(configElement): if exists("/proc/stb/fp/led_brightness"): fileWriteLine("/proc/stb/fp/led_brightness", configElement.value) def setLedColorControlColor(configElement): if exists("/proc/stb/fp/led_color"): fileWriteLine("/proc/stb/fp/led_color", configElement.value) def setLedFadeControlColor(configElement): if exists("/proc/stb/fp/led_fade"): fileWriteLine("/proc/stb/fp/led_fade", configElement.value) def setPower4x7On(configElement): if exists("/proc/stb/fp/power4x7on"): fileWriteLine("/proc/stb/fp/power4x7on", "on" if configElement.value else "off") def setPower4x7Standby(configElement): if exists("/proc/stb/fp/power4x7standby"): fileWriteLine("/proc/stb/fp/power4x7standby", "on" if configElement.value else "off") def setPower4x7Suspend(configElement): if exists("/proc/stb/fp/power4x7suspend"): fileWriteLine("/proc/stb/fp/power4x7suspend", "on" if configElement.value else "off") def setXcoreVFD(configElement): if exists("/sys/module/brcmstb_osmega/parameters/pt6302_cgram"): fileWriteLine( "/sys/module/brcmstb_osmega/parameters/pt6302_cgram", configElement.value) if exists("/sys/module/brcmstb_spycat4k/parameters/pt6302_cgram"): fileWriteLine( "/sys/module/brcmstb_spycat4k/parameters/pt6302_cgram", configElement.value) if exists( "/sys/module/brcmstb_spycat4kmini/parameters/pt6302_cgram" ): fileWriteLine( "/sys/module/brcmstb_spycat4kmini/parameters/pt6302_cgram", configElement.value) if exists( "/sys/module/brcmstb_spycat4kcombo/parameters/pt6302_cgram" ): fileWriteLine( "/sys/module/brcmstb_spycat4kcombo/parameters/pt6302_cgram", configElement.value) config.usage.vfd_xcorevfd = ConfigSelection(choices=[ ("0", _("12 character")), ("1", _("8 character")) ], default="0") config.usage.vfd_xcorevfd.addNotifier(setXcoreVFD) config.usage.lcd_powerled = ConfigOnOff(default=True) config.usage.lcd_powerled.addNotifier(setPowerLEDstate) config.usage.lcd_powerled2 = ConfigOnOff(default=True) config.usage.lcd_powerled2.addNotifier(setPowerLEDstate2) config.usage.lcd_standbypowerled = ConfigOnOff(default=True) config.usage.lcd_standbypowerled.addNotifier(setPowerLEDstanbystate) config.usage.lcd_deepstandbypowerled = ConfigOnOff(default=True) config.usage.lcd_deepstandbypowerled.addNotifier( setPowerLEDdeepstanbystate) if getBoxType() in ('dual', ): config.usage.lcd_ledpowercolor = ConfigSelection( default="1", choices=[("0", _("off")), ("1", _("blue"))]) config.usage.lcd_ledpowercolor.addNotifier(setLedPowerColor) config.usage.lcd_ledstandbycolor = ConfigSelection( default="1", choices=[("0", _("off")), ("1", _("blue"))]) config.usage.lcd_ledstandbycolor.addNotifier(setLedStandbyColor) config.usage.lcd_ledsuspendcolor = ConfigSelection( default="1", choices=[("0", _("off")), ("1", _("blue"))]) config.usage.lcd_ledsuspendcolor.addNotifier(setLedSuspendColor) else: 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 = ConfigOnOff(default=True) config.usage.lcd_power4x7on.addNotifier(setPower4x7On) config.usage.lcd_power4x7standby = ConfigOnOff(default=True) config.usage.lcd_power4x7standby.addNotifier(setPower4x7Standby) config.usage.lcd_power4x7suspend = ConfigOnOff(default=True) config.usage.lcd_power4x7suspend.addNotifier(setPower4x7Suspend) if model in ('dm900', 'dm920', 'e4hdultra', 'protek4k'): 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 ('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 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=BoxInfo.getItem("DefaultDisplayBrightness"), limits=(0, 10)) config.lcd.dimbright.addNotifier(setLCDdimbright) config.lcd.dimbright.apply = lambda: setLCDdimbright(config.lcd. dimbright) config.lcd.dimdelay = ConfigSelection(choices=[ ("5", "5 %s" % _("seconds")), ("10", "10 %s" % _("seconds")), ("15", "15 %s" % _("seconds")), ("20", "20 %s" % _("seconds")), ("30", "30 %s" % _("seconds")), ("60", "1 %s" % _("minute")), ("120", "2 %s" % _("minutes")), ("300", "5 %s" % _("minutes")), ("0", _("Off")) ], default="0") 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 BoxInfo.getItem("LcdLiveTV"): def lcdLiveTvChanged(configElement): open(BoxInfo.getItem("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 BoxInfo.getItem("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 BoxInfo.getItem("VFD_scroll_repeats") and model not in ( 'ixussone', 'ixusszero') and getDisplayType() not in ('7segment', ): def scroll_repeats(el): open(BoxInfo.getItem("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 BoxInfo.getItem("VFD_scroll_delay") and model not in ( 'ixussone', 'ixusszero') and getDisplayType() not in ('7segment', ): def scroll_delay(el): # add workaround for Boxes who need hex code if model in ('sf4008', 'beyonwizu4'): open(BoxInfo.getItem("VFD_scroll_delay"), "w").write(hex(int(el.value))) else: open(BoxInfo.getItem("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 = ConfigYesNo(default=True) else: config.lcd.hdd = ConfigNothing() config.usage.vfd_scroll_delay = ConfigNothing() if BoxInfo.getItem("VFD_initial_scroll_delay") and model not in ( 'ixussone', 'ixusszero') and getDisplayType() not in ('7segment', ): def initial_scroll_delay(el): if model in ('sf4008', 'beyonwizu4'): # add workaround for Boxes who need hex code open(BoxInfo.getItem("VFD_initial_scroll_delay"), "w").write(hex(int(el.value))) else: open(BoxInfo.getItem("VFD_initial_scroll_delay"), "w").write(el.value) config.usage.vfd_initial_scroll_delay = ConfigSelection( choices=[("3000", "3 %s" % _("seconds")), ("5000", "5 %s" % _("seconds")), ("10000", "10 %s" % _("seconds")), ("20000", "20 %s" % _("seconds")), ("30000", "30 %s" % _("seconds")), ("0", _("No delay"))], default="10000") config.usage.vfd_initial_scroll_delay.addNotifier( initial_scroll_delay, immediate_feedback=False) else: config.usage.vfd_initial_scroll_delay = ConfigNothing() if BoxInfo.getItem("VFD_final_scroll_delay") and model not in ( 'ixussone', 'ixusszero') and getDisplayType() not in ('7segment', ): def final_scroll_delay(el): if model in ('sf4008', 'beyonwizu4'): # add workaround for Boxes who need hex code open(BoxInfo.getItem("VFD_final_scroll_delay"), "w").write(hex(int(el.value))) else: open(BoxInfo.getItem("VFD_final_scroll_delay"), "w").write(el.value) config.usage.vfd_final_scroll_delay = ConfigSelection( choices=[("3000", "3 %s" % _("seconds")), ("5000", "5 %s" % _("seconds")), ("10000", "10 %s" % _("seconds")), ("20000", "20 %s" % _("seconds")), ("30000", "30 %s" % _("seconds")), ("0", _("No delay"))], default="10000") config.usage.vfd_final_scroll_delay.addNotifier( final_scroll_delay, immediate_feedback=False) else: config.usage.vfd_final_scroll_delay = ConfigNothing() if exists("/proc/stb/lcd/show_symbols"): def setLCDmode(configElement): ilcd.setMode("1" if configElement.value else "0") config.lcd.mode = ConfigYesNo(default=True) config.lcd.mode.addNotifier(setLCDmode) else: config.lcd.mode = ConfigNothing() if exists("/proc/stb/power/vfd") or exists("/proc/stb/lcd/vfd"): def setLCDpower(configElement): ilcd.setPower("1" if configElement.value else "0") config.lcd.power = ConfigYesNo(default=True) config.lcd.power.addNotifier(setLCDpower) else: config.lcd.power = ConfigNothing() if exists("/proc/stb/fb/sd_detach"): def setfblcddisplay(configElement): ilcd.setfblcddisplay("1" if configElement.value else "0") config.lcd.fblcddisplay = ConfigYesNo(default=True) config.lcd.fblcddisplay.addNotifier(setfblcddisplay) else: config.lcd.fblcddisplay = ConfigNothing() if exists("/proc/stb/lcd/show_outputresolution"): def setLCDshowoutputresolution(configElement): ilcd.setShowoutputresolution( "1" if configElement.value else "0") config.lcd.showoutputresolution = ConfigYesNo(default=True) 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(choices=[("500", _("slow")), ("300", _("normal")), ("100", _("fast"))], default="300") config.lcd.scroll_delay = ConfigSelection(choices=[ ("10000", "10 %s" % _("seconds")), ("20000", "20 %s" % _("seconds")), ("30000", "30 %s" % _("seconds")), ("60000", "1 %s" % _("minute")), ("300000", "5 %s" % _("minutes")), ("noscrolling", _("Off")) ], default="10000") 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)
streamServerControl.setEncoderService(service) return True Log.i("nothing done") return False #Streamserver base config config.streamserver = ConfigSubsection() config.streamserver.source = ConfigSelection( StreamServerControl.INPUT_MODES, default=str(StreamServerControl.INPUT_MODE_LIVE)) config.streamserver.audioBitrate = ConfigInteger( 96, StreamServerControl.AUDIO_BITRATE_LIMITS) config.streamserver.videoBitrate = ConfigInteger( 1500, StreamServerControl.VIDEO_BITRATE_LIMITS) config.streamserver.autoBitrate = ConfigOnOff(default=False) config.streamserver.resolution = ConfigSelection( StreamServerControl.RESOLUTIONS.keys(), default=StreamServerControl.RES_KEY_PAL) config.streamserver.framerate = ConfigSelection( StreamServerControl.FRAME_RATES, default=StreamServerControl.FRAME_RATE_25) config.streamserver.rtsp = ConfigSubsection() config.streamserver.rtsp.enabled = ConfigOnOff(default=False) config.streamserver.rtsp.port = ConfigInteger(554, StreamServerControl.PORT_LIMITS) config.streamserver.rtsp.path = ConfigText(default="stream", fixed_size=False) config.streamserver.hls = ConfigSubsection() config.streamserver.hls.enabled = ConfigOnOff(default=False) config.streamserver.hls.port = ConfigInteger(8080, StreamServerControl.PORT_LIMITS) config.streamserver.user = ConfigText(default="", fixed_size=False)
# -*- coding: utf-8 -*- from Components.config import config, ConfigSubsection, ConfigOnOff, ConfigNumber, ConfigSelection, ConfigYesNo, ConfigText, ConfigSelectionNumber from Components.Language import language from Tools.Directories import resolveFilename, SCOPE_PLUGINS, SCOPE_LANGUAGE from os import environ as os_environ import gettext ####################################################### # Initialize Configuration config.plugins.seriesplugin = ConfigSubsection() config.plugins.seriesplugin.enabled = ConfigOnOff(default=False) config.plugins.seriesplugin.epgimport = ConfigYesNo(default=False) config.plugins.seriesplugin.xmltvimport = ConfigYesNo(default=False) config.plugins.seriesplugin.menu_info = ConfigYesNo(default=True) config.plugins.seriesplugin.menu_extensions = ConfigYesNo(default=False) config.plugins.seriesplugin.menu_epg = ConfigYesNo(default=False) config.plugins.seriesplugin.menu_channel = ConfigYesNo(default=True) config.plugins.seriesplugin.menu_movie_info = ConfigYesNo(default=True) config.plugins.seriesplugin.menu_movie_rename = ConfigYesNo(default=True) config.plugins.seriesplugin.identifier_elapsed = ConfigText(default="", fixed_size=False) config.plugins.seriesplugin.identifier_today = ConfigText(default="", fixed_size=False) config.plugins.seriesplugin.identifier_future = ConfigText(default="", fixed_size=False)
config.plugins.Webinterface.http = ConfigSubsection() config.plugins.Webinterface.http.enabled = ConfigYesNo(default=True) config.plugins.Webinterface.http.port = ConfigInteger(default=80, limits=(1, 65535)) config.plugins.Webinterface.http.auth = ConfigYesNo(default=False) config.plugins.Webinterface.https = ConfigSubsection() config.plugins.Webinterface.https.enabled = ConfigYesNo(default=True) config.plugins.Webinterface.https.port = ConfigInteger(default=443, limits=(1, 65535)) config.plugins.Webinterface.https.auth = ConfigYesNo(default=True) config.plugins.Webinterface.streamauth = ConfigYesNo(default=False) config.plugins.Webinterface.anti_hijack = ConfigOnOff(default=False) config.plugins.Webinterface.extended_security = ConfigOnOff(default=False) global running_defered, waiting_shutdown, toplevel running_defered = [] waiting_shutdown = 0 toplevel = None server.VERSION = "Enigma2 WebInterface Server $Revision$".replace( "$Revi", "").replace("sion: ", "").replace("$", "") KEY_FILE = resolveFilename(SCOPE_CONFIG, "key.pem") CERT_FILE = resolveFilename(SCOPE_CONFIG, "cert.pem") #===============================================================================
from enigma import eWindowAnimationManager from Components.config import config, ConfigText, ConfigOnOff from Components.ActionMap import ActionMap from Components.Label import Label from Components.MenuList import MenuList from Screens.MessageBox import MessageBox from Screens.Screen import Screen config.osd.window_animation = ConfigOnOff(default=True) config.osd.window_animation_default = ConfigText(default="simple_fade") config.osd.widget_animation = ConfigOnOff(default=False) config.osd.widget_animation_default = ConfigText(default="simple_fade") class AnimationSetup(Screen): skin = """ <screen name="AnimationSetup" position="center,120" size="820,520" title="Animation Setup"> <ePixmap pixmap="skin_default/buttons/red.png" position="10,5" size="200,40" alphatest="on" /> <ePixmap pixmap="skin_default/buttons/green.png" position="210,5" size="200,40" alphatest="on" /> <ePixmap pixmap="skin_default/buttons/yellow.png" position="410,5" size="200,40" alphatest="on" /> <ePixmap pixmap="skin_default/buttons/blue.png" position="610,5" size="200,40" alphatest="on" /> <widget name="key_red" position="10,5" size="200,40" zPosition="1" font="Regular;20" halign="center" valign="center" backgroundColor="#9f1313" transparent="1" shadowColor="black" shadowOffset="-2,-2" /> <widget name="key_green" position="210,5" size="200,40" zPosition="1" font="Regular;20" halign="center" valign="center" backgroundColor="#1f771f" transparent="1" shadowColor="black" shadowOffset="-2,-2" /> <widget name="key_yellow" position="410,5" size="200,40" zPosition="1" font="Regular;20" halign="center" valign="center" backgroundColor="#a08500" transparent="1" shadowColor="black" shadowOffset="-2,-2" /> <widget name="key_blue" position="610,5" size="200,40" zPosition="1" font="Regular;20" halign="center" valign="center" backgroundColor="#18188b" transparent="1" shadowColor="black" shadowOffset="-2,-2" /> <eLabel position="10,50" size="800,1" backgroundColor="grey" /> <widget name="list" position="10,60" size="800,390" enableWrapAround="1" scrollbarMode="showOnDemand" /> <eLabel position="10,480" size="800,1" backgroundColor="grey" /> <widget name="selected_info" position="10,488" size="800,25" font="Regular;22" halign="center" /> </screen>"""
try: from Plugins.Extensions.DVDPlayer.plugin import DVDPlayer DVDPlayerInstalled = True except: DVDPlayerInstalled = False try: from Plugins.Extensions.MerlinMusicPlayer.plugin import MerlinMusicPlayerScreen, Item MMPlayerInstalled = True except: MMPlayerInstalled = False config.plugins.DreamExplorer = ConfigSubsection() config.plugins.DreamExplorer.startDir = ConfigText(default="/") config.plugins.DreamExplorer.useMediaFilter = ConfigOnOff(default=False) config.plugins.DreamExplorer.CopyDest = ConfigText(default="/") def Plugins(path, **kwargs): global plugin_path plugin_path = path return [ PluginDescriptor(name=_("Dream-Explorer"), description=_("Explore your Dreambox."), where = [PluginDescriptor.WHERE_PLUGINMENU], icon="dreamexplorer.png", fnc=main), PluginDescriptor(name=_("Dream-Explorer"), where = PluginDescriptor.WHERE_EXTENSIONSMENU, fnc=main) ] def main(session, **kwargs): session.open(DreamExplorerII) ######## DREAM-EXPLORER START ####################### class DreamExplorerII(Screen):
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"]: if getBoxType() 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 SystemInfo["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 SystemInfo["CanDownmixAAC"]: if getBoxType() 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 getBoxType() in ('gbquad4k', 'gbue4k'): 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 SystemInfo["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 SystemInfo["CanAACTranscode"]: choice_list = [("off", _("off")), ("ac3", _("AC3")), ("dts", _("DTS"))] 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 SystemInfo["CanAC3plusTranscode"]: if getBoxType() 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 getBoxType() in ('gbquad4k', 'gbue4k'): 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 SystemInfo["CanPcmMultichannel"]: if getBoxType() 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 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)) 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)) if SystemInfo["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 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)) 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 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)
+ _(" (C) 2012 by betonme @ IHAD \n\n") \ + _(" If You like this plugin and want to support it,\n") \ + _(" or if just want to say ''thanks'',\n") \ + _(" feel free to donate via PayPal. \n\n") \ + _(" Thanks a lot ! \n PayPal: ") + DONATE + "\n" \ + _(" Support: ") + SUPPORT # Globals gPushService = None # Config options config.pushservice = ConfigSubsection() config.pushservice.about = ConfigNothing() config.pushservice.enable = ConfigOnOff(default=True) config.pushservice.boxname = ConfigText(default="Enigma2", fixed_size=False) config.pushservice.xmlpath = ConfigText(default="/etc/enigma2/pushservice.xml", fixed_size=False) config.pushservice.time = ConfigClock(default=0) config.pushservice.period = ConfigSelectionNumber(0, 1000, 1, default=24) config.pushservice.runonboot = ConfigOnOff(default=True) config.pushservice.bootdelay = ConfigSelectionNumber(5, 1000, 5, default=10) config.pushservice.push_errors = ConfigOnOff(default=False) ####################################################### # Plugin configuration
def fillList(self, arg=None): 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 LanguageCodes.has_key(lang): 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 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 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)
baseMethods.InfoBarPiP_showPiP = InfoBarPiP.showPiP InfoBarPiP.showPiP = InfoBarPiP_showPiP baseMethods.PictureInPicture__init__ = PictureInPicture.__init__ PictureInPicture.__init__ = PictureInPicture__init__ PictureInPicture.active = PictureInPicture_active PictureInPicture.inactive = PictureInPicture_inactive baseMethods.PictureInPicture_move = PictureInPicture.move PictureInPicture.move = PictureInPicture_move config.plugins.pipzap = ConfigSubsection() config.plugins.pipzap.enable_hotkey = ConfigOnOff(default=True) config.plugins.pipzap.show_in_plugins = ConfigOnOff(default=False) config.plugins.pipzap.show_label = ConfigOnOff(default=True) config.plugins.pipzap.show_help = ConfigOnOff(default=True) def autostart(reason, **kwargs): if reason == 0: overwriteFunctions() def activate(session, *args, **kwargs): infobar = InfoBar.instance if not infobar: session.open(MessageBox, _("Unable to access InfoBar.\npipzap not available."),