Skip to content

Commit 3411a78

Browse files
committed
[Menu]
* press TXT long to force 720p video resolution #2882
1 parent f106555 commit 3411a78

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

data/keymap.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1349,6 +1349,11 @@
13491349
<key id="KEY_POWER" mapto="exit" flags="m" />
13501350
</map>
13511351

1352+
<map context="TextActions">
1353+
<key id="KEY_TEXT" mapto="text" flags="b" />
1354+
<key id="KEY_TEXT" mapto="textlong" flags="l" />
1355+
</map>
1356+
13521357
<map context="TextEntryActions">
13531358
<key id="KEY_NEXT" mapto="deleteForward" flags="mr" />
13541359
<key id="KEY_PREVIOUS" mapto="deleteBackward" flags="mr" />

lib/python/Components/AVSwitch.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,8 @@ def setInput(self, input):
386386

387387
def setVideoModeDirect(self, mode):
388388
if BoxInfo.getItem("AmlogicFamily"):
389+
if not (mode.endswith("Hz") or mode.endswith("hz")):
390+
mode = "%sHz" % mode
389391
rate = mode[-4:].replace("hz", "Hz")
390392
force = int(rate[:-2])
391393
mode = mode[:-4]

lib/python/Screens/Menu.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
from skin import findSkinScreen, menus
77
from Components.ActionMap import HelpableNumberActionMap, HelpableActionMap
8+
from Components.AVSwitch import iAVSwitch
89
from Components.config import ConfigDictionarySet, NoSave, config, configfile
910
from Components.Pixmap import Pixmap
1011
from Components.PluginComponent import plugins
@@ -210,7 +211,7 @@ def __init__(self, session, parentMenu):
210211
self.onShown.append(self.openTestA)
211212
elif config.usage.menuType.value == "horzicon" and findSkinScreen("Iconmain"):
212213
self.onShown.append(self.openTestB)
213-
self["menuActions"] = HelpableNumberActionMap(self, ["OkCancelActions", "MenuActions", "ColorActions", "NumberActions"], {
214+
self["menuActions"] = HelpableNumberActionMap(self, ["OkCancelActions", "MenuActions", "ColorActions", "NumberActions", "TextActions"], {
214215
"ok": (self.okbuttonClick, _("Select the current menu item")),
215216
"cancel": (self.closeNonRecursive, _("Exit menu")),
216217
"close": (self.closeRecursive, _("Exit all menus")),
@@ -225,7 +226,8 @@ def __init__(self, session, parentMenu):
225226
"7": (self.keyNumberGlobal, _("Direct menu item selection")),
226227
"8": (self.keyNumberGlobal, _("Direct menu item selection")),
227228
"9": (self.keyNumberGlobal, _("Direct menu item selection")),
228-
"0": (self.keyNumberGlobal, _("Direct menu item selection"))
229+
"0": (self.keyNumberGlobal, _("Direct menu item selection")),
230+
"textlong": (self.keyText, _("Switch to 720p video"))
229231
}, prio=0, description=_("Menu Common Actions"))
230232
if config.usage.menuSortOrder.value == "user":
231233
self["moveActions"] = HelpableActionMap(self, ["NavigationActions"], {
@@ -625,6 +627,9 @@ def keyBottom(self):
625627
if self.sortMode and self.selectedEntry is not None:
626628
self.moveAction()
627629

630+
def keyText(self):
631+
iAVSwitch.setVideoModeDirect("720p50")
632+
628633
def moveAction(self):
629634
menuListCopy = list(self.menuList)
630635
entry = menuListCopy.pop(self.currentIndex)

0 commit comments

Comments
 (0)