Skip to content

Commit

Permalink
[Navigation] Update. Based on OpenATV
Browse files Browse the repository at this point in the history
  • Loading branch information
fairbird committed Feb 21, 2025
1 parent 6a87e4c commit e516f54
Show file tree
Hide file tree
Showing 11 changed files with 1,595 additions and 186 deletions.
4 changes: 4 additions & 0 deletions data/setup.xml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@
<item level="2" text="Fan operation" description="Configure how the fan should operate" requires="Fan">config.usage.fan</item>
<item level="2" text="Fan speed" description="Configure the speed of the fan" requires="FanPWM">config.usage.fanspeed</item>
<item level="2" text="Wake On LAN" description="When enabled the set top box is able to wakeup on LAN" requires="WakeOnLAN">config.usage.wakeOnLAN</item>
<item level="2" text="Wake up time before a timer begins [mins]" description="The default settings are 5 minutes earlier to wake up from deep standby. It possibly may be necessary to change this. (e.g.: the actual wake-up time is inaccurate or to late, waiting to a network-drive, etc.)">config.workaround.wakeuptime</item>
<item level="1" text="Use workaround for wake up from deep-standby" description="If enabled, using a time window to detect a wake up from deep standby by a timer. Default setting ist disabled and used a special signal from the receiver. But some devices set a wrong or none signal and the wake up detection can fails.">config.workaround.deeprecord</item>
<item level="2" text="Time window for detection of the wake up by a timer [mins]" description="The default settings are wake up time - 5 minutes and timer begin time + 5 minutes. This setting changed the time window before the wake up time. So can be detected a wake up by a timer even at very early starting receivers." requires="config.workaround.deeprecord">config.workaround.wakeupwindow</item>
<item level="1" text="Startup to Standby" description="Startup the set top box in standby">config.usage.startup_to_standby</item>
<item level="2" text="Config resolution of pictures" description="Select in which resolution pictures are displayed with picture viewer or movie player.">config.usage.pic_resolution</item>
<item level="2" text="Ignore DVB-S namespace sub network" description="On valid ONIDs, ignore frequency sub network part">config.usage.subnetwork</item>
Expand Down Expand Up @@ -395,6 +398,7 @@
<item level="2" text="Include action map data" description="Enable this option to add action map / remote control mapping data to the debug log file.">config.crash.debugActionMaps</item>
<item level="2" text="Include screen load data" description="Enable this option to add screen names and resolution data to the debug log file.">config.crash.debugScreens</item>
<item level="2" text="Include opkg output data" description="Enable this option to add opkg output data to the debug log file.">config.crash.debugOpkg</item>
<item level="2" text="Include timer data" description="Enable this option to add timer debugging data to the debug log file.">config.crash.debugTimers</item>
<item level="2" text="Include DVB scan data" description="Enable this option to add extra DVB scan data to the debug log file.">config.crash.debugDVBScan</item>
<item level="2" text="Include DVB timesync data" description="Enable this option to add extra DVB time sync data to the debug log file.">config.crash.debugDVBTime</item>
<item level="2" text="Include DVB details" description="Enable this option to add extra DVB details to the debug log file.">config.crash.debugDVB</item>
Expand Down
6 changes: 6 additions & 0 deletions lib/python/Components/HdmiCec.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,12 @@
"activity": _("Any activity"),
},
default="streamrequest")
config.hdmicec.advanced_settings = ConfigYesNo(default=False)
config.hdmicec.deepstandby_waitfortimesync = ConfigYesNo(default=True)
config.hdmicec.tv_wakeup_zaptimer = ConfigYesNo(default=True)
config.hdmicec.tv_wakeup_zapandrecordtimer = ConfigYesNo(default=True)
config.hdmicec.tv_wakeup_wakeuppowertimer = ConfigYesNo(default=True)
config.hdmicec.check_tv_state = ConfigYesNo(default=False)
config.hdmicec.tv_wakeup_command = ConfigSelection(
choices={
"imageview": _("Image View On"),
Expand Down
66 changes: 22 additions & 44 deletions lib/python/Components/Sources/CurrentService.py
Original file line number Diff line number Diff line change
@@ -1,77 +1,55 @@
# -*- coding: utf-8 -*-
from enigma import iPlayableService

from Components.Element import cached
from Components.PerServiceDisplay import PerServiceBase
from enigma import iPlayableService, iPlayableService, eServiceCenter
from Components.Sources.Source import Source
from Components.Element import cached
import NavigationInstance


class CurrentService(PerServiceBase, Source):
def __init__(self, navcore):
Source.__init__(self)
PerServiceBase.__init__(self, navcore,
{
iPlayableService.evStart: self.serviceEvent,
iPlayableService.evEnd: self.serviceEvent,
# FIXME: we should check 'interesting_events'
# which is not always provided.
iPlayableService.evUpdatedInfo: self.serviceEvent,
iPlayableService.evUpdatedEventInfo: self.serviceEvent,
iPlayableService.evNewProgramInfo: self.serviceEvent,
iPlayableService.evCuesheetChanged: self.serviceEvent,
iPlayableService.evVideoSizeChanged: self.serviceEvent,
iPlayableService.evVideoGammaChanged: self.serviceEvent,
iPlayableService.evHBBTVInfo: self.serviceEvent
}, with_event=True)
PerServiceBase.__init__(self, navcore, {
iPlayableService.evStart: self.serviceEvent,
iPlayableService.evEnd: self.serviceEvent,
# FIXME: We should check 'interesting_events' which is not always provided.
iPlayableService.evUpdatedInfo: self.serviceEvent,
iPlayableService.evUpdatedEventInfo: self.serviceEvent,
iPlayableService.evNewProgramInfo: self.serviceEvent,
iPlayableService.evCuesheetChanged: self.serviceEvent,
iPlayableService.evVideoSizeChanged: self.serviceEvent,
iPlayableService.evVideoGammaChanged: self.serviceEvent,
iPlayableService.evHBBTVInfo: self.serviceEvent
}, with_event=True)
self.navcore = navcore
self.srv = None
self.info = None
self.ref = None
self.onManualNewService = []

def serviceEvent(self, event):
self.srv = None
self.info = None
self.changed((self.CHANGED_SPECIFIC, event))

@cached
def getCurrentService(self):
return self.srv or self.navcore.getCurrentService()
return self.navcore.getCurrentService()

def getCurrentServiceReference(self):
return self.navcore.getCurrentlyPlayingServiceReference()

service = property(getCurrentService)

@cached
def getCurrentServiceRef(self):
if self.ref:
return self.ref
if NavigationInstance.instance is not None:
return self.srv or NavigationInstance.instance.getCurrentlyPlayingServiceOrGroup()
return None
return NavigationInstance.instance.getCurrentlyPlayingServiceOrGroup() if NavigationInstance.instance is not None else None

def setCurrentServiceRef(self, ref):
self.ref = ref

serviceref = property(getCurrentServiceRef, setCurrentServiceRef)

def newService(self, ref):
if ref and isinstance(ref, bool):
self.srv = None
elif ref:
self.srv = ref
self.info = eServiceCenter.getInstance().info(ref)
else:
self.srv = ref

for x in self.onManualNewService:
x()

self.changed((self.CHANGED_SPECIFIC, iPlayableService.evStart))
serviceref = property(getCurrentServiceRef, setCurrentServiceRef) # TODO: serviceRef

@cached
def getCurrentBouquetName(self):
if NavigationInstance.instance is not None:
return NavigationInstance.instance.currentBouquetName
return ""
return NavigationInstance.instance.currentBouquetName if NavigationInstance.instance is not None else ""

currentBouquetName = property(getCurrentBouquetName)

Expand Down
5 changes: 5 additions & 0 deletions lib/python/Components/UsageConfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -2081,6 +2081,11 @@ def preferredTunerChoicesUpdate(update=False):
atsc_nims.append((str(slot.slot), slot.getSlotName()))
nims.append((str(slot.slot), slot.getSlotName()))

config.workaround = ConfigSubsection()
config.workaround.deeprecord = ConfigYesNo(default=False)
config.workaround.wakeuptime = ConfigSelectionNumber(default=5, stepwidth=1, min=0, max=30, wraparound=True)
config.workaround.wakeupwindow = ConfigSelectionNumber(default=5, stepwidth=5, min=5, max=60, wraparound=True)

config.usage.menutype = ConfigSelection(default="standard", choices=[
("horzanim", _("Horizontal menu")),
("horzicon", _("Horizontal icons")),
Expand Down
1 change: 1 addition & 0 deletions lib/python/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ install_PYTHON = \
Navigation.py \
NavigationInstance.py \
RecordTimer.py \
Scheduler.py \
ServiceReference.py \
skin.py \
StartEnigma.py \
Expand Down
Loading

0 comments on commit e516f54

Please sign in to comment.