Skip to content

Commit

Permalink
Merge remote-tracking branch 'OpenPLi/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
Taapat committed Mar 26, 2017
2 parents 8cddada + f840951 commit 0d2d90f
Show file tree
Hide file tree
Showing 18 changed files with 328 additions and 71 deletions.
1 change: 1 addition & 0 deletions data/setup.xml
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@
<item level="2" text="Initial scroll delay" description="Delay in miliseconds before start of scrolling text on display." requires="VFD_initial_scroll_delay">config.usage.vfd_initial_scroll_delay</item>
<item level="2" text="Final scroll delay" description="Delay in miliseconds after finish scrolling text on display." requires="VFD_final_scroll_delay">config.usage.vfd_final_scroll_delay</item>
<item level="0" text="Power on display" description="This option allows you to power off the display." requires="PowerOffDisplay">config.usage.powerOffDisplay</item>
<item level="2" text="Show symbols on display" description="This option allows you show all symbols on display." requires="LCDshow_symbols">config.usage.lcd_show_symbols</item>
</setup>
<setup key="satconfig" title="Satellite dish setup">
<item text="Tuner slot" description="Choose which tuner to configure.">config.sat.tunerslot</item>
Expand Down
9 changes: 8 additions & 1 deletion data/skin_default.xml
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,14 @@
</screen>
<!-- Streaming Clients Info screen -->
<screen name="StreamingClientsInfo" position="center,center" size="540,490" title="Streaming clients info">
<widget name="ScrollLabel" font="Regular;20" position="0,00" size="540,490" zPosition="2" halign="left"/>
<widget name="menu" font="Regular;20" position="10,60" size="530,320" zPosition="2" />
<ePixmap pixmap="skin_default/buttons/red.png" position="0,0" size="140,40" alphatest="on"/>
<ePixmap pixmap="skin_default/buttons/green.png" position="135,0" size="140,40" alphatest="on"/>
<ePixmap pixmap="skin_default/buttons/yellow.png" position="270,0" size="140,40" alphatest="on"/>
<ePixmap pixmap="skin_default/buttons/blue.png" position="405,0" size="140,40" alphatest="on"/>
<widget name="key_red" position="0,0" zPosition="1" size="135,40" font="Regular;18" halign="center" valign="center" backgroundColor="#9f1313" transparent="1"/>
<widget name="key_green" position="135,0" zPosition="1" size="135,40" font="Regular;18" halign="center" valign="center" backgroundColor="#1f771f" transparent="1"/>
<widget name="key_yellow" position="270,0" zPosition="1" size="135,40" font="Regular;18" halign="center" valign="center" backgroundColor="#18188b" transparent="1"/>
</screen>
<!-- Audio selection -->
<screen name="AudioSelection" position="center,center" size="485,330" title="Audio">
Expand Down
18 changes: 3 additions & 15 deletions data/startwizard.xml
Original file line number Diff line number Diff line change
Expand Up @@ -219,12 +219,12 @@ self.condition = nimmanager.somethingConnected() and not config.misc.installwiza
self.hideRc()
</code>
<list>
<listentry caption="No" step="softcam" />
<listentry caption="No" step="end" />
<listentry caption="Yes, do an automatic scan now" step="scan" />
<listentry caption="Yes, do a manual scan now" step="manualscan" />
</list>
</step>
<step id="scan" nextstep="softcam">
<step id="scan" nextstep="end">
<condition>
from Components.NimManager import nimmanager
self.condition = nimmanager.somethingConnected() and not config.misc.installwizard.channellistdownloaded.value
Expand All @@ -247,22 +247,10 @@ self.condition = nimmanager.somethingConnected() and not config.misc.installwiza
</condition>
<text value="Do you want to do another manual service scan?" />
<list>
<listentry caption="No" step="softcam" />
<listentry caption="No" step="end" />
<listentry caption="Yes, do another manual scan now" step="manualscan" />
</list>
</step>
<step id="softcam">
<condition>
self.condition = config.misc.installwizard.hasnetwork.value and config.misc.installwizard.ipkgloaded.value
</condition>
<text value="Would you like to install a softcam?" />
<config screen="InstallWizard" module="InstallWizard" args="2" type="ConfigList" />
<code>
self.clearSelectedKeys()
self.selectKey("LEFT")
self.selectKey("RIGHT")
</code>
</step>
<step id="end" laststep="true">
<text value="Thank you for using the wizard. Your receiver is now ready for use.\nPress OK to start using your receiver." />
<code>
Expand Down
36 changes: 36 additions & 0 deletions lib/python/Components/AVSwitch.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,42 @@ def setMultichannelPCM(configElement):
config.av.multichannel_pcm = ConfigYesNo(default = False)
config.av.multichannel_pcm.addNotifier(setMultichannelPCM)

if SystemInfo["HasAutoVolume"]:
def setAutoVolume(configElement):
open(SystemInfo["HasAutoVolume"], "w").write(configElement.value)
config.av.autovolume = ConfigSelection(default = "none", choices = [("none", _("off")), ("hdmi", _("HDMI")), ("spdif", _("SPDIF")), ("dac", _("DAC"))])
config.av.autovolume.addNotifier(setAutoVolume)

if SystemInfo["HasAutoVolumeLevel"]:
def setAutoVolumeLevel(configElement):
open(SystemInfo["HasAutoVolumeLevel"], "w").write(configElement.value and "enabled" or "disabled")
config.av.autovolumelevel = ConfigYesNo(default = False)
config.av.autovolumelevel.addNotifier(setAutoVolumeLevel)

if SystemInfo["Has3DSurround"]:
def set3DSurround(configElement):
open(SystemInfo["Has3DSurround"], "w").write(configElement.value)
config.av.surround_3d = ConfigSelection(default = "none", choices = [("none", _("off")), ("hdmi", _("HDMI")), ("spdif", _("SPDIF")), ("dac", _("DAC"))])
config.av.surround_3d.addNotifier(set3DSurround)

if SystemInfo["Has3DSpeaker"]:
def set3DSpeaker(configElement):
open(SystemInfo["Has3DSpeaker"], "w").write(configElement.value)
config.av.speaker_3d = ConfigSelection(default = "center", choices = [("center", _("center")), ("wide", _("wide")), ("extrawide", _("extra wide"))])
config.av.speaker_3d.addNotifier(set3DSpeaker)

if SystemInfo["Has3DSurroundSpeaker"]:
def set3DSurroundSpeaker(configElement):
open(SystemInfo["Has3DSurroundSpeaker"], "w").write(configElement.value)
config.av.surround_3d_speaker = ConfigSelection(default = "disabled", choices = [("disabled", _("off")), ("center", _("center")), ("wide", _("wide")), ("extrawide", _("extra wide"))])
config.av.surround_3d_speaker.addNotifier(set3DSurroundSpeaker)

if SystemInfo["Has3DSurroundSoftLimiter"]:
def set3DSurroundSoftLimiter(configElement):
open(SystemInfo["Has3DSurroundSoftLimiter"], "w").write(configElement.value and "enabled" or "disabled")
config.av.surround_softlimiter_3d = ConfigYesNo(default = False)
config.av.surround_softlimiter_3d.addNotifier(set3DSurroundSoftLimiter)

def setVolumeStepsize(configElement):
eDVBVolumecontrol.getInstance().setVolumeSteps(int(configElement.value))
config.av.volume_stepsize = ConfigSelectionNumber(1, 10, 1, default = 2)
Expand Down
9 changes: 8 additions & 1 deletion lib/python/Components/InputDevice.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,13 @@ def getBoxType(self):
return self.boxType

def writeRcType(self, rctype):
open('/proc/stb/ir/rc/type', 'w').write(rctype and '%d' % rctype or '0')
if self.isSupported and rctype > 0:
open('/proc/stb/ir/rc/type', 'w').write('%d' % rctype)

def readRcType(self):
rc = 0
if self.isSupported:
rc = open('/proc/stb/ir/rc/type', 'r').read().strip()
return int(rc)

iRcTypeControl = RcTypeControl()
5 changes: 4 additions & 1 deletion lib/python/Components/Language.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ def addLanguage(self, name, lang, country, encoding):

def activateLanguage(self, index):
try:
if index not in self.lang:
print "Selected language %s does not exist, fallback to en_EN!" % index
index = "en_EN"
lang = self.lang[index]
print "Activating language " + lang[0]
self.catalog = gettext.translation('enigma2', resolveFilename(SCOPE_LANGUAGE, ""), languages=[index])
Expand All @@ -76,7 +79,7 @@ def activateLanguage(self, index):
for x in self.callbacks:
x()
except:
print "Selected language does not exist!"
print "Error in activating language!"
# NOTE: we do not use LC_ALL, because LC_ALL will not set any of the categories, when one of the categories fails.
# We'd rather try to set all available categories, and ignore the others
for category in [locale.LC_CTYPE, locale.LC_COLLATE, locale.LC_TIME, locale.LC_MONETARY, locale.LC_MESSAGES, locale.LC_NUMERIC]:
Expand Down
3 changes: 3 additions & 0 deletions lib/python/Components/Sources/HddState.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from Components.Harddisk import harddiskmanager
from Components.config import config
from enigma import eTimer
from Components.SystemInfo import SystemInfo

class HddState(Source):
ALL = 0
Expand Down Expand Up @@ -85,6 +86,8 @@ def updateHddState(self, force=False):
string = "Disk state: " + string
self.state_text = string
if prev_state != self.isSleeping or force:
if SystemInfo["LCDsymbol_hdd"]:
open(SystemInfo["LCDsymbol_hdd"], "w").write(self.isSleeping and "1" or "0")
self.changed((self.CHANGED_ALL,))

def setStandbyTime(self, cfgElem):
Expand Down
4 changes: 2 additions & 2 deletions lib/python/Components/Sources/RecordState.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ def gotRecordEvent(self, service, event):
prev_records = self.records_running
if event in (iRecordableService.evEnd, iRecordableService.evStart, None):
recs = self.session.nav.getRecordings()
if SystemInfo["LCDsymbol_circle"]:
open(SystemInfo["LCDsymbol_circle"], "w").write(recs and "1" or "0")
if SystemInfo["LCDsymbol_circle_recording"]:
open(SystemInfo["LCDsymbol_circle_recording"], "w").write(recs and "1" or "0")
self.records_running = len(recs)
if self.records_running != prev_records:
self.changed((self.CHANGED_ALL,))
Expand Down
12 changes: 11 additions & 1 deletion lib/python/Components/SystemInfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@ def countFrontpanelLEDs():
SystemInfo["ZapMode"] = fileCheck("/proc/stb/video/zapmode") or fileCheck("/proc/stb/video/zapping_mode")
SystemInfo["NumFrontpanelLEDs"] = countFrontpanelLEDs()
SystemInfo["FrontpanelDisplay"] = fileExists("/dev/dbox/oled0") or fileExists("/dev/dbox/lcd0")
SystemInfo["LCDsymbol_circle"] = fileCheck("/proc/stb/lcd/symbol_circle")
SystemInfo["LCDsymbol_circle_recording"] = fileCheck("/proc/stb/lcd/symbol_circle") or HardwareInfo().get_device_model() in ("hd51", "vs1500") and fileCheck("/proc/stb/lcd/symbol_recording")
SystemInfo["LCDsymbol_timeshift"] = fileCheck("/proc/stb/lcd/symbol_timeshift")
SystemInfo["LCDshow_symbols"] = (HardwareInfo().get_device_model().startswith("et9") or HardwareInfo().get_device_model() in ("hd51", "vs1500")) and fileCheck("/proc/stb/lcd/show_symbols")
SystemInfo["LCDsymbol_hdd"] = HardwareInfo().get_device_model() in ("hd51", "vs1500") and fileCheck("/proc/stb/lcd/symbol_hdd")
SystemInfo["FrontpanelDisplayGrayscale"] = fileExists("/dev/dbox/oled0")
SystemInfo["DeepstandbySupport"] = HardwareInfo().get_device_name() != "dm800"
SystemInfo["Fan"] = fileCheck("/proc/stb/fp/fan")
Expand Down Expand Up @@ -56,3 +58,11 @@ def countFrontpanelLEDs():
SystemInfo["CanDoTranscodeAndPIP"] = HardwareInfo().get_device_model() in "vusolo4k"
SystemInfo["HasColordepth"] = fileCheck("/proc/stb/video/hdmi_colordepth")
SystemInfo["HasHDMIpreemphasis"] = fileCheck("/proc/stb/hdmi/preemphasis")
SystemInfo["HasColorimetry"] = fileCheck("/proc/stb/video/hdmi_colorimetry")
SystemInfo["HasHDMI-CEC"] = HardwareInfo().has_hdmi() and fileExists("/usr/lib/enigma2/python/Plugins/SystemPlugins/HdmiCEC/plugin.pyo")
SystemInfo["HasAutoVolume"] = fileExists("/proc/stb/audio/avl_choices") and fileCheck("/proc/stb/audio/avl")
SystemInfo["HasAutoVolumeLevel"] = fileExists("/proc/stb/audio/autovolumelevel_choices") and fileCheck("/proc/stb/audio/autovolumelevel")
SystemInfo["Has3DSurround"] = fileExists("/proc/stb/audio/3d_surround_choices") and fileCheck("/proc/stb/audio/3d_surround")
SystemInfo["Has3DSpeaker"] = fileExists("/proc/stb/audio/3d_surround_speaker_position_choices") and fileCheck("/proc/stb/audio/3d_surround_speaker_position")
SystemInfo["Has3DSurroundSpeaker"] = fileExists("/proc/stb/audio/3dsurround_choices") and fileCheck("/proc/stb/audio/3dsurround")
SystemInfo["Has3DSurroundSoftLimiter"] = fileExists("/proc/stb/audio/3dsurround_softlimiter_choices") and fileCheck("/proc/stb/audio/3dsurround_softlimiter")
12 changes: 12 additions & 0 deletions lib/python/Components/UsageConfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,12 @@ def powerOffDisplayChanged(configElement):
config.usage.powerOffDisplay = ConfigYesNo(default = True)
config.usage.powerOffDisplay.addNotifier(powerOffDisplayChanged)

if SystemInfo["LCDshow_symbols"]:
def lcdShowSymbols(configElement):
open(SystemInfo["LCDshow_symbols"], "w").write(configElement.value and "1" or "0")
config.usage.lcd_show_symbols = ConfigYesNo(default = True)
config.usage.lcd_show_symbols.addNotifier(lcdShowSymbols)

if SystemInfo["WakeOnLAN"]:
def wakeOnLANChanged(configElement):
if "fp" in SystemInfo["WakeOnLAN"]:
Expand Down Expand Up @@ -538,6 +544,12 @@ def setHDMIpreemphasis(configElement):
config.av.hdmipreemphasis = ConfigSelection(default = "off", choices = [ ("on", _("Yes")), ("off", _("No"))] )
config.av.hdmipreemphasis.addNotifier(setHDMIpreemphasis)

if SystemInfo["HasColorimetry"]:
def setColorimetry(configElement):
open(SystemInfo["HasColorimetry"], "w").write(configElement.value)
config.av.hdmicolorimetry = ConfigSelection(default = "auto", choices = [("auto", _("Auto")), ("bt2020ncl", _("BT 2020 NCL")), ("bt2020cl", _("BT 2020 CL")), ("bt709", _("BT 709"))])
config.av.hdmicolorimetry.addNotifier(setColorimetry)

config.subtitles = ConfigSubsection()
config.subtitles.ttx_subtitle_colors = ConfigSelection(default = "1", choices = [
("0", _("original")),
Expand Down
14 changes: 13 additions & 1 deletion lib/python/Plugins/SystemPlugins/Videomode/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ def createSetup(self):
self.list.append(getConfigListEntry(_("Auto scart switching"), config.av.vcrswitch, _("When enabled, your receiver will detect activity on the VCR SCART input.")))

if level >= 1:
self.list.append(getConfigListEntry(_("Audio volume step size"), config.av.volume_stepsize, _("Configure the general audio volume step size (limit 1-10).")))
if SystemInfo["CanDownmixAC3"]:
self.list.append(getConfigListEntry(_("AC3 downmix"), config.av.downmix_ac3, _("Configure whether multi channel sound tracks should be downmixed to stereo.")))
if SystemInfo["CanDownmixDTS"]:
Expand All @@ -120,7 +121,16 @@ def createSetup(self):
))
if SystemInfo["HasMultichannelPCM"]:
self.list.append(getConfigListEntry(_("Multichannel PCM"), config.av.multichannel_pcm, _("Configure whether multi channel PCM sound should be enabled.")))
self.list.append(getConfigListEntry(_("Audio volume step size"), config.av.volume_stepsize, _("Configure the general audio volume step size (limit 1-10).")))
if SystemInfo["HasAutoVolume"] or SystemInfo["HasAutoVolumeLevel"]:
self.list.append(getConfigListEntry(_("Audio auto volume level"), SystemInfo["HasAutoVolume"] and config.av.autovolume or config.av.autovolumelevel, _("This option configures you can set auto volume level.")))
if SystemInfo["Has3DSurround"]:
self.list.append(getConfigListEntry(_("3D surround"), config.av.surround_3d, _("This option allows you to enable 3D surround sound.")))
if SystemInfo["Has3DSpeaker"] and config.av.surround_3d.value != "none":
self.list.append(getConfigListEntry(_("3D surround speaker position"), config.av.speaker_3d, _("This option allows you to change the virtuell loadspeaker position.")))
if SystemInfo["Has3DSurroundSpeaker"]:
self.list.append(getConfigListEntry(_("3D surround speaker position"), config.av.surround_3d_speaker, _("This option allows you to disable or change the virtuell loadspeaker position.")))
if SystemInfo["Has3DSurroundSoftLimiter"] and config.av.surround_3d_speaker.value != "disabled":
self.list.append(getConfigListEntry(_("3D surround softlimiter"), config.av.surround_softlimiter_3d, _("This option allows you to enable 3D surround softlimiter.")))

if SystemInfo["CanChangeOsdAlpha"]:
self.list.append(getConfigListEntry(_("OSD transparency"), config.av.osd_alpha, _("Configure the transparency of the OSD.")))
Expand All @@ -133,6 +143,8 @@ def createSetup(self):
self.list.append(getConfigListEntry(_("HDMI Colorspace"), config.av.hdmicolorspace, _("This option allows you can config the Colorspace from Auto to RGB")))
if SystemInfo["HasColordepth"]:
self.list.append(getConfigListEntry(_("HDMI Colordepth"), config.av.hdmicolordepth, _("This option allows you can config the Colordepth for UHD")))
if SystemInfo["HasColorimetry"]:
self.list.append(getConfigListEntry(_("HDMI Colorimetry"), config.av.hdmicolorimetry, _("This option allows you can config the Colorimetry for HDR.")))
if SystemInfo["HasHDMIpreemphasis"]:
self.list.append(getConfigListEntry(_("Use HDMI pre-emphasis"), config.av.hdmipreemphasis, _("This option can be useful for long HDMI cables.")))

Expand Down
15 changes: 15 additions & 0 deletions lib/python/Screens/Hotkey.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,9 @@ def getHotkeyFunctions():
hotkeyFunctions.append((_("Toggle HDMI In"), "Infobar/HDMIIn", "InfoBar"))
hotkeyFunctions.append((_("Toggle dashed flickering line for this service"), "Infobar/ToggleHideVBI", "InfoBar"))
hotkeyFunctions.append((_("Do nothing"), "Void", "InfoBar"))
if SystemInfo["HasHDMI-CEC"]:
hotkeyFunctions.append((_("HDMI-CEC Source Active"), "Infobar/SourceActiveHdmiCec", "InfoBar"))
hotkeyFunctions.append((_("HDMI-CEC Source Inactive"), "Infobar/SourceInactiveHdmiCec", "InfoBar"))
hotkeyFunctions.append((_("HotKey Setup"), "Module/Screens.Hotkey/HotkeySetup", "Setup"))
hotkeyFunctions.append((_("Software update"), "Module/Screens.SoftwareUpdate/UpdatePlugin", "Setup"))
hotkeyFunctions.append((_("Latest Commits"), "Module/Screens.About/CommitInfo", "Setup"))
Expand Down Expand Up @@ -641,3 +644,15 @@ def showServiceListOrMovies(self):
self.openServiceList()
elif hasattr(self, "showMovies"):
self.showMovies()


def SourceActiveHdmiCec(self):
self.setHdmiCec("sourceactive")

def SourceInactiveHdmiCec(self):
self.setHdmiCec("sourceinactive")

def setHdmiCec(self, cmd):
if config.hdmicec.enabled.value:
import Components.HdmiCec
Components.HdmiCec.hdmi_cec.sendMessage(0, cmd)
8 changes: 6 additions & 2 deletions lib/python/Screens/InputDeviceSetup.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ class RemoteControlType(Screen, ConfigListScreen):
("18", _("F1/F3/F4/F4-TURBO")),
("19", _("HD2400")),
("20", _("Zgemma Star S/2S/H1/H2")),
("21", _("Zgemma H.S/H.2S/H.2H/H5"))
("21", _("Zgemma H.S/H.2S/H.2H/H5/H7"))
]

defaultRcList = [
Expand Down Expand Up @@ -346,12 +346,14 @@ class RemoteControlType(Screen, ConfigListScreen):
("sh1", 20),
("h3", 21),
("h5", 21),
("h7", 21),
("et7000mini", 16)
]

def __init__(self, session):
Screen.__init__(self, session)
self.skinName = ["RemoteControlType", "Setup" ]
self.setTitle(_("Remote control type setup"))

self["actions"] = ActionMap(["SetupActions"],
{
Expand All @@ -370,7 +372,7 @@ def __init__(self, session):
self.list.append(getConfigListEntry(_("Remote control type"), self.rctype))
self["config"].list = self.list

self.defaultRcType = None
self.defaultRcType = 0
self.getDefaultRcType()

def getDefaultRcType(self):
Expand All @@ -379,6 +381,8 @@ def getDefaultRcType(self):
if x[0] in data:
self.defaultRcType = x[1]
break
if self.defaultRcType == 0:
self.defaultRcType = iRcTypeControl.readRcType()

def setDefaultRcType(self):
iRcTypeControl.writeRcType(self.defaultRcType)
Expand Down
Loading

0 comments on commit 0d2d90f

Please sign in to comment.