(ralfk) user defined skip times with 1/3, add 1/3 to keybindings, remove duplicate...
authorFelix Domke <tmbinc@elitedvb.net>
Wed, 18 Jul 2007 22:13:48 +0000 (22:13 +0000)
committerFelix Domke <tmbinc@elitedvb.net>
Wed, 18 Jul 2007 22:13:48 +0000 (22:13 +0000)
data/keymap.xml
data/setup.xml
lib/python/Components/UsageConfig.py
lib/python/Screens/InfoBarGenerics.py
lib/python/Tools/KeyBindings.py

index e2326e0127c67b5117b48e538d0d1cb0fed6dae8..8851e80abcbd24e2a6b0e17c6d357d83c757d604 100644 (file)
 
                <key id="KEY_OK" mapto="unPauseService" flags="m" />
                
-               <key id="KEY_2" mapto="seek:-10" flags="m" />
-               <key id="KEY_5" mapto="seek:10" flags="m" />
-               <key id="KEY_1" mapto="seek:-30" flags="m" />
-               <key id="KEY_3" mapto="seek:30" flags="m" />
-               <key id="KEY_4" mapto="seek:-90" flags="m" />
-               <key id="KEY_6" mapto="seek:90" flags="m" />
+               <key id="KEY_1" mapto="seek:-15" flags="b" />
+               <key id="KEY_3" mapto="seek:15" flags="b" />
+               <key id="KEY_1" mapto="seekBackDef" flags="l" />
+               <key id="KEY_3" mapto="seekFwdDef" flags="l" />
+               <key id="KEY_4" mapto="seek:-60" flags="m" />
+               <key id="KEY_6" mapto="seek:60" flags="m" />
+               <key id="KEY_7" mapto="seek:-300" flags="m" />
+               <key id="KEY_9" mapto="seek:300" flags="m" />
+       </map>
+
+       <map context="MediaPlayerSeekActions">
+               <device name="dreambox remote control (native)">
+                       <key id="KEY_RED" mapto="seekBack" flags="b" />
+                       <key id="KEY_BLUE" mapto="seekFwd" flags="b" />
+                       <key id="KEY_RED" mapto="seekBackManual" flags="l" />
+                       <key id="KEY_BLUE" mapto="seekFwdManual" flags="l" />
+               </device>
+               <device name="dreambox advanced remote control (native)">
+                       <key id="KEY_PREVIOUSSONG" mapto="seekBack" flags="b" />
+                       <key id="KEY_NEXTSONG" mapto="seekFwd" flags="b" />
+                       <key id="KEY_PREVIOUSSONG" mapto="seekBackManual" flags="l" />
+                       <key id="KEY_NEXTSONG" mapto="seekFwdManual" flags="l" />
+               </device>
+               
+               <key id="KEY_1" mapto="seek:-15" flags="m" />
+               <key id="KEY_3" mapto="seek:15" flags="m" />
+               <key id="KEY_1" mapto="seekBackDef" flags="l" />
+               <key id="KEY_3" mapto="seekFwdDef" flags="l" />
+               <key id="KEY_4" mapto="seek:-60" flags="m" />
+               <key id="KEY_6" mapto="seek:60" flags="m" />
                <key id="KEY_7" mapto="seek:-300" flags="m" />
                <key id="KEY_9" mapto="seek:300" flags="m" />
        </map>
        </map>
        
        <map context="InfobarCueSheetActions">
+               <device name="dreambox remote control (native)">
+                       <key id="KEY_PREVIOUS" mapto="jumpPreviousMark" flags="m" />
+                       <key id="KEY_NEXT" mapto="jumpNextMark" flags="m" />
+                       <key id="KEY_PREVIOUSSONG" mapto="jumpPreviousMark" flags="m" />
+                       <key id="KEY_PLAYPAUSE" mapto="toggleMark" flags="m" />
+                       <key id="KEY_NEXTSONG" mapto="jumpNextMark" flags="m" />
+               </device>
+               <device name="dreambox advanced remote control (native)">
+                       <key id="KEY_RED" mapto="jumpPreviousMark" flags="m" />
+                       <key id="KEY_YELLOW" mapto="toggleMark" flags="m" />
+                       <key id="KEY_BLUE" mapto="jumpNextMark" flags="m" />
+               </device>
+       </map>
+       
+       <map context="MediaPlayerCueSheetActions">
                <device name="dreambox remote control (native)">
                        <key id="KEY_PREVIOUSSONG" mapto="jumpPreviousMark" flags="m" />
                        <key id="KEY_PLAYPAUSE" mapto="toggleMark" flags="m" />
index 398052994168ec84ada3409328fea83acb2a3621..aca804013b1a6912b8eeb6e7ccb51d926c42b159 100644 (file)
@@ -28,6 +28,7 @@
                        <item text="Show infobar on channel change">config.usage.show_infobar_on_zap</item>
                        <item text="Show infobar on skip forward/backward">config.usage.show_infobar_on_skip</item>
                        <item text="Show infobar on event change">config.usage.show_infobar_on_event_change</item>
+                       <item text="Custom skip time for 1/3 keys">config.usage.self_defined_seek</item>
                </setup>
                <setup key="harddisk" title="Harddisk setup">
                        <item text="Harddisk standby after">config.usage.hdd_standby</item>
index 0c976db6f3612a0893118ad3b1fd74d0892735f0..507696f07864d29539881fef48faa87b36c56f8e 100644 (file)
@@ -1,4 +1,4 @@
-from config import ConfigSubsection, ConfigYesNo, config, ConfigSelection, ConfigText
+from config import ConfigSubsection, ConfigYesNo, config, ConfigSelection, ConfigText, ConfigInteger
 from enigma import Misc_Options
 import os
 
@@ -23,6 +23,7 @@ def InitUsageConfig():
                ("248", "4 " + _("hours")) ])
        config.usage.output_12V = ConfigSelection(default = "do not change", choices = [
                ("do not change", _("do not change")), ("off", _("off")), ("on", _("on")) ])
+       config.usage.self_defined_seek = ConfigInteger(default=10, limits=(1,9999))
 
        def setHDDStandby(configElement):
                os.system("hdparm -S" + configElement.value + " /dev/ide/host0/bus0/target0/lun0/disc")
index 978e73198391ed0d051518ebada89f71b5e4ae76..f1744fed053708b9da96e18d31ad39a4ec5f7bae 100644 (file)
@@ -653,7 +653,7 @@ class InfoBarSeek:
 
                self["SeekActions"] = InfoBarSeekActionMap(self, actionmap, 
                        {
-                               "playpauseService": (self.playpauseService, _("pause")),
+                               "playpauseService": self.playpauseService,
                                "pauseService": (self.pauseService, _("pause")),
                                "unPauseService": (self.unPauseService, _("continue")),
 
@@ -661,6 +661,9 @@ class InfoBarSeek:
                                "seekFwdManual": (self.seekFwdManual, _("skip forward (enter time)")),
                                "seekBack": (self.seekBack, _("skip backward")),
                                "seekBackManual": (self.seekBackManual, _("skip backward (enter time)")),
+                               
+                               "seekFwdDef": (self.seekFwdDef, _("skip forward (self defined)")),
+                               "seekBackDef": (self.seekBackDef, _("skip backward (self defined)"))
                        }, prio=-1)
                        # give them a little more priority to win over color buttons
 
@@ -828,6 +831,20 @@ class InfoBarSeek:
                        if seekable is not None:
                                seekable.seekRelative(-1, 3)
 
+       def seekFwdDef(self):
+               seconds = config.usage.self_defined_seek.value
+               print "Seek", seconds, "seconds self defined forward"
+               seekable = self.getSeek()
+               if seekable is not None:
+                       seekable.seekRelative(1, seconds * 90000)
+               
+       def seekBackDef(self):
+               seconds = config.usage.self_defined_seek.value
+               print "Seek", seconds, "seconds self defined backward"
+               seekable = self.getSeek()
+               if seekable is not None:
+                       seekable.seekRelative(1, 0 - seconds * 90000)
+               
        def seekFwdManual(self):
                self.session.openWithCallback(self.fwdSeekTo, MinuteInput)
 
@@ -1707,11 +1724,11 @@ class InfoBarCueSheetSupport:
 
        ENABLE_RESUME_SUPPORT = False
 
-       def __init__(self):
-               self["CueSheetActions"] = HelpableActionMap(self, "InfobarCueSheetActions"
+       def __init__(self, actionmap = "InfobarCueSheetActions"):
+               self["CueSheetActions"] = HelpableActionMap(self, actionmap
                        {
-                               "jumpPreviousMark": (self.jumpPreviousMark, _("jump to next marked position")),
-                               "jumpNextMark": (self.jumpNextMark, _("jump to previous marked position")),
+                               "jumpPreviousMark": (self.jumpPreviousMark, _("jump to previous marked position")),
+                               "jumpNextMark": (self.jumpNextMark, _("jump to next marked position")),
                                "toggleMark": (self.toggleMark, _("toggle a cut mark at the current position"))
                        }, prio=1) 
 
@@ -1744,6 +1761,11 @@ class InfoBarCueSheetSupport:
                        seekable = self.__getSeekable()
                        if seekable is not None:
                                seekable.seekTo(self.resume_point)
+               self.hideAfterResume()
+       
+       def hideAfterResume(self):
+               if isinstance(self, InfoBarShowHide):
+                       self.hide()
 
        def __getSeekable(self):
                service = self.session.nav.getCurrentService()
@@ -1812,10 +1834,6 @@ class InfoBarCueSheetSupport:
                if onlyreturn:
                        return None
 
-       def showAfterCuesheetOperation(self):
-               if isinstance(self, InfoBarShowHide):
-                       self.doShow()
-
        def addMark(self, point):
                insort(self.cut_list, point)
                self.uploadCuesheet()
index 09dde74b8c4751718df3a02e857ca2edfcd8e6af..6d26b433c277d94aec3a9de8f6ede74b96373c07 100644 (file)
@@ -32,6 +32,8 @@ keyDescriptions = {
                KEYIDS["KEY_CHANNELUP"]: ("ch_up", 645, 245),
                KEYIDS["KEY_CHANNELDOWN"]: ("ch_down", 630, 270),
                KEYIDS["KEY_0"]: ("0", 598, 203),
+               KEYIDS["KEY_1"]: ("1", 559, 134),
+               KEYIDS["KEY_3"]: ("3", 635, 134),
                KEYIDS["KEY_8"]: ("8", 598, 180),
                KEYIDS["KEY_EXIT"]: ("exit", 598, 255),
                KEYIDS["KEY_STOP"]: ("sh_tv", 560, 425),