Skip to content

Commit

Permalink
[Menu]
Browse files Browse the repository at this point in the history
* press TXT long to force 720p video resolution

#2882
  • Loading branch information
jbleyel committed Aug 4, 2023
1 parent f106555 commit 3411a78
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
5 changes: 5 additions & 0 deletions data/keymap.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1349,6 +1349,11 @@
<key id="KEY_POWER" mapto="exit" flags="m" />
</map>

<map context="TextActions">
<key id="KEY_TEXT" mapto="text" flags="b" />
<key id="KEY_TEXT" mapto="textlong" flags="l" />
</map>

<map context="TextEntryActions">
<key id="KEY_NEXT" mapto="deleteForward" flags="mr" />
<key id="KEY_PREVIOUS" mapto="deleteBackward" flags="mr" />
Expand Down
2 changes: 2 additions & 0 deletions lib/python/Components/AVSwitch.py
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,8 @@ def setInput(self, input):

def setVideoModeDirect(self, mode):
if BoxInfo.getItem("AmlogicFamily"):
if not (mode.endswith("Hz") or mode.endswith("hz")):
mode = "%sHz" % mode
rate = mode[-4:].replace("hz", "Hz")
force = int(rate[:-2])
mode = mode[:-4]
Expand Down
9 changes: 7 additions & 2 deletions lib/python/Screens/Menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

from skin import findSkinScreen, menus
from Components.ActionMap import HelpableNumberActionMap, HelpableActionMap
from Components.AVSwitch import iAVSwitch
from Components.config import ConfigDictionarySet, NoSave, config, configfile
from Components.Pixmap import Pixmap
from Components.PluginComponent import plugins
Expand Down Expand Up @@ -210,7 +211,7 @@ def __init__(self, session, parentMenu):
self.onShown.append(self.openTestA)
elif config.usage.menuType.value == "horzicon" and findSkinScreen("Iconmain"):
self.onShown.append(self.openTestB)
self["menuActions"] = HelpableNumberActionMap(self, ["OkCancelActions", "MenuActions", "ColorActions", "NumberActions"], {
self["menuActions"] = HelpableNumberActionMap(self, ["OkCancelActions", "MenuActions", "ColorActions", "NumberActions", "TextActions"], {
"ok": (self.okbuttonClick, _("Select the current menu item")),
"cancel": (self.closeNonRecursive, _("Exit menu")),
"close": (self.closeRecursive, _("Exit all menus")),
Expand All @@ -225,7 +226,8 @@ def __init__(self, session, parentMenu):
"7": (self.keyNumberGlobal, _("Direct menu item selection")),
"8": (self.keyNumberGlobal, _("Direct menu item selection")),
"9": (self.keyNumberGlobal, _("Direct menu item selection")),
"0": (self.keyNumberGlobal, _("Direct menu item selection"))
"0": (self.keyNumberGlobal, _("Direct menu item selection")),
"textlong": (self.keyText, _("Switch to 720p video"))
}, prio=0, description=_("Menu Common Actions"))
if config.usage.menuSortOrder.value == "user":
self["moveActions"] = HelpableActionMap(self, ["NavigationActions"], {
Expand Down Expand Up @@ -625,6 +627,9 @@ def keyBottom(self):
if self.sortMode and self.selectedEntry is not None:
self.moveAction()

def keyText(self):
iAVSwitch.setVideoModeDirect("720p50")

def moveAction(self):
menuListCopy = list(self.menuList)
entry = menuListCopy.pop(self.currentIndex)
Expand Down

0 comments on commit 3411a78

Please sign in to comment.