Merge remote branch 'origin/bug_112_enable_extensions_manager'
authorghost <andreas.monzner@multimedia-labs.de>
Sat, 2 Jan 2010 09:58:02 +0000 (10:58 +0100)
committerghost <andreas.monzner@multimedia-labs.de>
Sat, 2 Jan 2010 09:58:02 +0000 (10:58 +0100)
24 files changed:
data/defaults/Dream/userbouquet.favourites.tv
data/skin_default.xml
data/skin_default/Makefile.am
data/skin_default/unhandled-key.png [new file with mode: 0644]
lib/actions/action.cpp
lib/driver/rc.cpp
lib/driver/rc.h
lib/driver/rcconsole.cpp
lib/driver/rcinput.cpp
lib/driver/rcinput.h
lib/python/Components/ChoiceList.py
lib/python/Components/NimManager.py
lib/python/Plugins/Extensions/DVDPlayer/src/servicedvd.cpp
lib/python/Plugins/SystemPlugins/Videomode/VideoWizard.py
lib/python/Plugins/SystemPlugins/Videomode/videowizard.xml
lib/python/Screens/ChannelSelection.py
lib/python/Screens/InfoBar.py
lib/python/Screens/InfoBarGenerics.py
lib/python/Screens/Makefile.am
lib/python/Screens/Satconfig.py
lib/python/Screens/UnhandledKey.py [new file with mode: 0644]
lib/service/servicedvb.cpp
lib/service/servicemp3.cpp
lib/service/servicexine.cpp

index f1adaf9..cc5e9fe 100644 (file)
@@ -10,7 +10,7 @@
 #SERVICE 1:0:1:33:21:85:C00000:0:0:0:\r
 #SERVICE 1:0:1:701:5:85:C00000:0:0:0:\r
 #SERVICE 1:0:1:2F1C:441:1:C00000:0:0:0:\r
-#SERVICE 1:0:1:7005:436:1:C00000:0:0:0:\r
+#SERVICE 1:0:1:6D6E:437:1:C00000:0:0:0:\r
 #SERVICE 1:0:1:2FC:5:85:C00000:0:0:0:\r
 #SERVICE 1:0:1:F98:454:1:C00000:0:0:0:\r
 #SERVICE 1:0:1:7034:41B:1:C00000:0:0:0:\r
@@ -26,7 +26,6 @@
 #SERVICE 1:64:B:0:0:0:0:0:0:0::Doku/Wissen/Themen\r
 #DESCRIPTION Doku/Wissen/Themen\r
 #SERVICE 1:0:1:6DD0:44D:1:C00000:0:0:0:\r
-#SERVICE 1:0:1:6D6E:437:1:C00000:0:0:0:\r
 #SERVICE 1:0:1:6D6B:437:1:C00000:0:0:0:\r
 #SERVICE 1:0:1:2775:444:1:C00000:0:0:0:\r
 #SERVICE 1:0:1:293:5:85:C00000:0:0:0:\r
@@ -77,8 +76,6 @@
 #SERVICE 1:64:5:0:0:0:0:0:0:0::Reisen\r
 #DESCRIPTION Reisen\r
 #SERVICE 1:0:1:20:21:85:C00000:0:0:0:\r
-#SERVICE 1:0:1:3339:45B:1:C00000:0:0:0:\r
-#SERVICE 1:0:1:27B9:444:1:C00000:0:0:0:\r
 #SERVICE 1:64:9:0:0:0:0:0:0:0::Beratung\r
 #DESCRIPTION Beratung\r
 #SERVICE 1:0:1:295:21:85:C00000:0:0:0:\r
@@ -92,7 +89,6 @@
 #SERVICE 1:0:1:36:7:85:C00000:0:0:0:\r
 #SERVICE 1:0:1:307:7:85:C00000:0:0:0:\r
 #SERVICE 1:0:1:296:5:85:C00000:0:0:0:\r
-#SERVICE 1:0:1:2791:444:1:C00000:0:0:0:\r
 #SERVICE 1:0:1:383:21:85:C00000:0:0:0:\r
 #SERVICE 1:0:1:313C:459:1:C00000:0:0:0:\r
 #SERVICE 1:0:1:3159:459:1:C00000:0:0:0:\r
 #SERVICE 1:0:19:2B66:3F3:1:C00000:0:0:0:\r
 #SERVICE 1:0:19:2B70:3F3:1:C00000:0:0:0:\r
 #SERVICE 1:0:19:6EEC:4B1:1:C00000:0:0:0:\r
-#SERVICE 1:0:19:1324:3EF:1:C00000:0:0:0:\r
-#SERVICE 1:0:19:1325:3EF:1:C00000:0:0:0:\r
+#SERVICE 1:0:19:EF12:421:1:C00000:0:0:0:\r
 #SERVICE 1:0:19:2B84:3F3:1:C00000:0:0:0:\r
+#SERVICE 1:0:19:EF13:421:1:C00000:0:0:0:\r
 #SERVICE 1:64:0:0:0:0:0:0:0:0::Alternativen\r
 #DESCRIPTION Alternativen\r
 #SERVICE 1:0:1:6DCB:44D:1:C00000:0:0:0:\r
index 71f579c..85c4016 100755 (executable)
@@ -70,8 +70,8 @@
                <widget name="menu" position="10,10" size="290,225" scrollbarMode="showOnDemand" />
        </screen>
        <!-- Channel context menu -->
-       <screen name="ChannelContextMenu" position="center,center" size="300,255" title="Channellist menu">
-               <widget name="menu" position="10,10" size="290,230" scrollbarMode="showOnDemand" />
+       <screen name="ChannelContextMenu" position="center,center" size="350,255" title="Channellist menu">
+               <widget name="menu" position="10,10" size="340,230" scrollbarMode="showOnDemand" />
        </screen>
        <!-- Channel selection - TV -->
        <screen name="ChannelSelection" position="center,center" size="560,430" title="Channel Selection">
@@ -253,6 +253,10 @@ self.instance.move(ePoint((720-wsizex)/2, (576-wsizey)/(count &gt; 7 and 2 or 3)
        <screen name="Dish" flags="wfNoBorder" position="300,100" size="130,160" title="Dish" zPosition="100" backgroundColor="transparent">
                <widget name="Dishpixmap" pixmap="skin_default/icons/dish.png" position="0,0" size="130,160" alphatest="off" />
        </screen>
+       <!-- unhandled key pressed -->
+       <screen name="UnhandledKey" flags="wfNoBorder" position="620,50" size="34,45" title="UnhandledKey" zPosition="100" backgroundColor="transparent">
+               <widget name="UnhandledKeyPixmap" pixmap="skin_default/unhandled-key.png" position="0,0" size="34,45" alphatest="off" />
+       </screen>
        <!-- EPG Selection - Single -->
        <screen name="EPGSelection" position="center,center" size="560,430" title="EPG Selection">
                <ePixmap pixmap="skin_default/buttons/red.png" position="0,0" size="140,40" alphatest="on" />
index 15f4a54..9e9b7cd 100755 (executable)
@@ -51,6 +51,7 @@ dist_install_DATA = \
        sleeptimer.png \
        timeline-now.png \
        timeline.png \
+       unhandled-key.png \
        verticalline-plugins.png \
        vkey_backspace.png \
        vkey_bg.png \
diff --git a/data/skin_default/unhandled-key.png b/data/skin_default/unhandled-key.png
new file mode 100644 (file)
index 0000000..8e54349
Binary files /dev/null and b/data/skin_default/unhandled-key.png differ
index 0eb4cdb..a2d85ff 100644 (file)
@@ -208,7 +208,7 @@ void eActionMap::keyPressed(const std::string &device, int key, int flags)
                                }
                        } else
                        {
-                               eDebug("wildcard.");
+//                             eDebug("wildcard.");
                                ePyObject pArgs = PyTuple_New(2);
                                PyTuple_SET_ITEM(pArgs, 0, PyInt_FromLong(key));
                                PyTuple_SET_ITEM(pArgs, 1, PyInt_FromLong(flags));
index c7acd11..c56fde4 100644 (file)
@@ -81,7 +81,6 @@ eRCShortDriver::eRCShortDriver(const char *filename): eRCDriver(eRCInput::getIns
        {
                sn=eSocketNotifier::create(eApp, handle, eSocketNotifier::Read);
                CONNECT(sn->activated, eRCShortDriver::keyPressed);
-               eRCInput::getInstance()->setFile(handle);
        }
 }
 
@@ -115,7 +114,6 @@ eRCInputEventDriver::eRCInputEventDriver(const char *filename): eRCDriver(eRCInp
        {
                sn=eSocketNotifier::create(eApp, handle, eSocketNotifier::Read);
                CONNECT(sn->activated, eRCInputEventDriver::keyPressed);
-               eRCInput::getInstance()->setFile(handle);
        }
 }
 
@@ -127,6 +125,16 @@ std::string eRCInputEventDriver::getDeviceName()
        return name;
 }
 
+void eRCInputEventDriver::setExclusive(bool b)
+{
+       if (handle >= 0)
+       {
+               int grab = b;
+               if (::ioctl(handle, EVIOCGRAB, grab) < 0)
+                       perror("EVIOCGRAB");
+       }
+}
+
 eRCInputEventDriver::~eRCInputEventDriver()
 {
        if (handle>=0)
@@ -165,7 +173,6 @@ eRCInput::eRCInput()
 {
        ASSERT( !instance);
        instance=this;
-       handle = -1;
        locked = 0;
        keyboardMode = kmNone;
 }
@@ -183,21 +190,18 @@ bool eRCInput::open()
        return false;
 }
 
-int eRCInput::lock()
+void eRCInput::lock()
 {
        locked=1;
-       return handle;
+       for (std::map<std::string,eRCDevice*>::iterator i=devices.begin(); i != devices.end(); ++i)
+               i->second->setExclusive(false);
 }
 
 void eRCInput::unlock()
 {
-       if (locked)
-               locked=0;
-}
-
-void eRCInput::setFile(int newh)
-{
-       handle=newh;
+       locked=0;
+       for (std::map<std::string,eRCDevice*>::iterator i=devices.begin(); i != devices.end(); ++i)
+               i->second->setExclusive(true);
 }
 
 void eRCInput::addDevice(const std::string &id, eRCDevice *dev)
@@ -216,7 +220,7 @@ eRCDevice *eRCInput::getDevice(const std::string &id)
        if (i == devices.end())
        {
                eDebug("failed, possible choices are:");
-               for (std::map<std::string,eRCDevice*>::iterator i=devices.begin(); i != devices.end(); ++i)     
+               for (std::map<std::string,eRCDevice*>::iterator i=devices.begin(); i != devices.end(); ++i)
                        eDebug("%s", i->first.c_str());
                return 0;
        }
index 9708ea7..5290946 100644 (file)
@@ -53,6 +53,7 @@ public:
         * \param key The key to get the description for.
         * \result User readable description of given key.
         */
+       virtual void setExclusive(bool b) { };
 };
 
 /**
@@ -89,6 +90,7 @@ public:
        ~eRCDriver();
        
        void enable(int en) { enabled=en; }
+       virtual void setExclusive(bool) { }
 };
 
 class eRCShortDriver: public eRCDriver
@@ -112,6 +114,7 @@ public:
        std::string getDeviceName();
        eRCInputEventDriver(const char *filename);
        ~eRCInputEventDriver();
+       void setExclusive(bool b); // in exclusive mode data is not carried to console device
 };
 
 class eRCKey
@@ -173,7 +176,6 @@ public:
 class eRCInput: public Object
 {
        int locked;     
-       int handle;
        static eRCInput *instance;
        int keyboardMode;
 #ifdef SWIG
@@ -199,8 +201,6 @@ public:
        void close();
        bool open();
 
-       void setFile(int handle);
-
        /* This is only relevant for "keyboard"-styled input devices,
           i.e. not plain remote controls. It's up to the input device
           driver to decide wheter an input device is a keyboard or
@@ -237,7 +237,7 @@ public:
        void setKeyboardMode(int mode) { keyboardMode = mode; }
        int  getKeyboardMode() { return keyboardMode; }
        static eRCInput *getInstance() { return instance; }
-       int lock();
+       void lock();
        void unlock();
        int islocked() { return locked; }
 };
index bcce560..eb5aee3 100644 (file)
@@ -16,7 +16,6 @@ eRCConsoleDriver::eRCConsoleDriver(const char *filename): eRCDriver(eRCInput::ge
        {
                sn=eSocketNotifier::create(eApp, handle, eSocketNotifier::Read);
                CONNECT(sn->activated, eRCConsoleDriver::keyPressed);
-               eRCInput::getInstance()->setFile(handle);
        }
        
                /* set console mode */
index d10d94f..e593087 100644 (file)
@@ -83,8 +83,13 @@ eRCDeviceInputDev::eRCDeviceInputDev(eRCInputEventDriver *driver)
                        break;
                }
        }
+       setExclusive(true);
        eDebug("Input device \"%s\" is %sa keyboard.", id.c_str(), iskeyboard ? "" : "not ");
+}
 
+void eRCDeviceInputDev::setExclusive(bool b)
+{
+       driver->setExclusive(!iskeyboard && b);
 }
 
 const char *eRCDeviceInputDev::getDescription() const
index c7f5697..3b4579c 100644 (file)
@@ -10,6 +10,7 @@ public:
        void handleCode(long code);
        eRCDeviceInputDev(eRCInputEventDriver *driver);
        const char *getDescription() const;
+       void setExclusive(bool);
 };
 
 #endif
index 4700e9e..33868d6 100755 (executable)
@@ -3,7 +3,7 @@ from Tools.Directories import SCOPE_CURRENT_SKIN, resolveFilename
 from enigma import RT_HALIGN_LEFT, eListboxPythonMultiContent, gFont
 from Tools.LoadPixmap import LoadPixmap
 
-def ChoiceEntryComponent(key, text):
+def ChoiceEntryComponent(key = "", text = ["--"]):
        res = [ text ]
        if text[0] == "--":
                res.append((eListboxPythonMultiContent.TYPE_TEXT, 0, 00, 800, 25, 0, RT_HALIGN_LEFT, "-"*200))
index 7d148f3..00d0609 100644 (file)
@@ -1213,10 +1213,21 @@ def InitNimManager(nimmgr):
                                tmp.lnb = lnb
                                nim.advanced.sat[x] = tmp
 
+       def toneAmplitudeChanged(configElement):
+               fe_id = configElement.fe_id
+               slot_id = configElement.slot_id
+               if nimmgr.nim_slots[slot_id].description == 'Alps BSBE2':
+                       open("/proc/stb/frontend/%d/tone_amplitude" %(fe_id), "w").write(configElement.value)
+
+       empty_slots = 0
        for slot in nimmgr.nim_slots:
                x = slot.slot
                nim = config.Nims[x]
                if slot.isCompatible("DVB-S"):
+                       nim.toneAmplitude = ConfigSelection([("9", "600mV"), ("8", "700mV"), ("7", "800mV"), ("6", "900mV"), ("5", "1100mV")], "7")
+                       nim.toneAmplitude.fe_id = x - empty_slots
+                       nim.toneAmplitude.slot_id = x
+                       nim.toneAmplitude.addNotifier(toneAmplitudeChanged)
                        nim.diseqc13V = ConfigYesNo(False)
                        nim.diseqcMode = ConfigSelection(diseqc_mode_choices, "diseqc_a_b")
                        nim.connectedTo = ConfigSelection([(str(id), nimmgr.getNimDescription(id)) for id in nimmgr.getNimListOfType("DVB-S") if id != x])
@@ -1306,6 +1317,7 @@ def InitNimManager(nimmgr):
                        nim.terrestrial = ConfigSelection(choices = list)
                        nim.terrestrial_5V = ConfigOnOff()
                else:
+                       empty_slots += 1
                        nim.configMode = ConfigSelection(choices = { "nothing": _("disabled") }, default="nothing");
                        if slot.type is not None:
                                print "pls add support for this frontend type!", slot.type
index 94f2ee3..0372c49 100644 (file)
@@ -696,7 +696,7 @@ RESULT eServiceDVD::setTrickmode(int /*trick*/)
 
 RESULT eServiceDVD::isCurrentlySeekable()
 {
-       return m_state == stRunning;
+       return m_state == stRunning ? 3 : 0;
 }
 
 RESULT eServiceDVD::keyPressed(int key)
index cd1529a..512bcec 100644 (file)
@@ -131,8 +131,12 @@ class VideoWizard(WizardLanguage, Rc):
        def modeSelect(self, mode):
                ratesList = self.listRates(mode)
                print "ratesList:", ratesList
-               self.hw.setMode(port = self.port, mode = mode, rate = ratesList[0][0])
-               
+               if self.port == "DVI" and mode in ("720p", "1080i"):
+                       self.rate = "multi"
+                       self.hw.setMode(port = self.port, mode = mode, rate = "multi")
+               else:
+                       self.hw.setMode(port = self.port, mode = mode, rate = ratesList[0][0])
+       
        def listRates(self, querymode = None):
                if querymode is None:
                        querymode = self.mode
index 29ac429..5dea661 100644 (file)
@@ -20,7 +20,7 @@ self.selectKey("DOWN")
 self["portpic"].hide()
                </code>
        </step>
-       <step id="rateselection" nextstep="dvirateintroduction" timeout="20" timeoutaction="selectnext">
+       <step id="rateselection" nextstep="end" timeout="20" timeoutaction="selectnext">
                <condition>
 self.condition = (self.port != "DVI" or self.mode == "PC")
                </condition>            
@@ -33,7 +33,7 @@ self.selectKey("UP")
 self.selectKey("DOWN")
                </code>
        </step>
-       <step id="dvirateintroduction" nextstep="dvirateselection">
+       <!--step id="dvirateintroduction" nextstep="dvirateselection">
                <condition>
 self.condition = (self.port == "DVI" and self.mode in ["720p", "1080i"])
                </condition>
@@ -89,7 +89,7 @@ self.selectKey("UP")
 self.selectKey("DOWN")
 self.rateSelect("50Hz")
                </code>
-       </step>
+       </step-->
        <step id="end">
                <code>
 self.hw.saveMode(self.port, self.mode, self.rate)
index 0432823..5fbfd59 100644 (file)
@@ -21,10 +21,13 @@ profile("ChannelSelection.py 2.3")
 from Components.Input import Input
 profile("ChannelSelection.py 3")
 from Components.ParentalControl import parentalControl
+from Components.ChoiceList import ChoiceList, ChoiceEntryComponent
+from Components.SystemInfo import SystemInfo
 from Screens.InputBox import InputBox, PinInput
 from Screens.MessageBox import MessageBox
 from Screens.ServiceInfo import ServiceInfo
 profile("ChannelSelection.py 4")
+from Screens.PictureInPicture import PictureInPicture
 from Screens.RdsDisplay import RassInteractive
 from ServiceReference import ServiceReference
 from Tools.BoundFunction import boundFunction
@@ -69,9 +72,9 @@ OFF = 0
 EDIT_BOUQUET = 1
 EDIT_ALTERNATIVES = 2
 
-def append_when_current_valid(current, menu, args, level = 0):
+def append_when_current_valid(current, menu, args, level = 0, key = ""):
        if current and current.valid() and level <= config.usage.setup_level.index:
-               menu.append(args)
+               menu.append(ChoiceEntryComponent(key, args))
 
 class ChannelContextMenu(Screen):
        def __init__(self, session, csel):
@@ -80,13 +83,15 @@ class ChannelContextMenu(Screen):
                self.csel = csel
                self.bsel = None
 
-               self["actions"] = ActionMap(["OkCancelActions"],
+               self["actions"] = ActionMap(["OkCancelActions", "ColorActions", "NumberActions"],
                        {
                                "ok": self.okbuttonClick,
-                               "cancel": self.cancelClick
+                               "cancel": self.cancelClick,
+                               "blue": self.showServiceInPiP
                        })
                menu = [ ]
 
+               self.pipAvailable = False
                current = csel.getCurrentSelection()
                current_root = csel.getRoot()
                current_sel_path = current.getPath()
@@ -122,8 +127,11 @@ class ChannelContextMenu(Screen):
                                        append_when_current_valid(current, menu, (_("remove entry"), self.removeCurrentService), level = 0)
                                if current_root and current_root.getPath().find("flags == %d" %(FLAG_SERVICE_NEW_FOUND)) != -1:
                                        append_when_current_valid(current, menu, (_("remove new found flag"), self.removeNewFoundFlag), level = 0)
+                               if isPlayable and SystemInfo.get("NumVideoDecoders", 1) > 1:
+                                       append_when_current_valid(current, menu, (_("Activate Picture in Picture"), self.showServiceInPiP), level = 0, key = "blue")
+                                       self.pipAvailable = True
                        else:
-                                       menu.append((_("add bouquet"), self.showBouquetInputBox))
+                                       menu.append(ChoiceEntryComponent(text = (_("add bouquet"), self.showBouquetInputBox)))
                                        append_when_current_valid(current, menu, (_("remove entry"), self.removeBouquet), level = 0)
 
                if inBouquet: # current list is editable?
@@ -131,7 +139,7 @@ class ChannelContextMenu(Screen):
                                if not csel.movemode:
                                        append_when_current_valid(current, menu, (_("enable move mode"), self.toggleMoveMode), level = 1)
                                        if not inBouquetRootList and current_root and not (current_root.flags & eServiceReference.isGroup):
-                                               menu.append((_("add marker"), self.showMarkerInputBox))
+                                               menu.append(ChoiceEntryComponent(text = (_("add marker"), self.showMarkerInputBox)))
                                                if haveBouquets:
                                                        append_when_current_valid(current, menu, (_("enable bouquet edit"), self.bouquetMarkStart), level = 0)
                                                else:
@@ -156,11 +164,11 @@ class ChannelContextMenu(Screen):
                                                append_when_current_valid(current, menu, (_("end alternatives edit"), self.bouquetMarkEnd), level = 0)
                                                append_when_current_valid(current, menu, (_("abort alternatives edit"), self.bouquetMarkAbort), level = 0)
 
-               menu.append((_("back"), self.cancelClick))
-               self["menu"] = MenuList(menu)
+               menu.append(ChoiceEntryComponent(text = (_("back"), self.cancelClick)))
+               self["menu"] = ChoiceList(menu)
 
        def okbuttonClick(self):
-               self["menu"].getCurrent()[1]()
+               self["menu"].getCurrent()[0][1]()
 
        def cancelClick(self):
                self.close(False)
@@ -189,6 +197,23 @@ class ChannelContextMenu(Screen):
                        self.close()
                else:
                        self.session.openWithCallback(self.close, MessageBox, _("The pin code you entered is wrong."), MessageBox.TYPE_ERROR)
+                       
+       def showServiceInPiP(self):
+               if not self.pipAvailable:
+                       return
+               if self.session.pipshown:
+                       del self.session.pip
+               self.session.pip = self.session.instantiateDialog(PictureInPicture)
+               self.session.pip.show()
+               newservice = self.csel.servicelist.getCurrent()
+               if self.session.pip.playService(newservice):
+                       self.session.pipshown = True
+                       self.session.pip.servicePath = self.csel.getCurrentServicePath()
+                       self.close(True)
+               else:
+                       self.session.pipshown = False
+                       del self.session.pip
+                       self.session.openWithCallback(self.close, MessageBox, _("Could not open Picture in Picture"), MessageBox.TYPE_ERROR)
 
        def addServiceToBouquetSelected(self):
                bouquets = self.csel.getBouquetList()
@@ -648,7 +673,11 @@ class ChannelSelectionEdit:
                        self.entry_marked = True
 
        def doContext(self):
-               self.session.open(ChannelContextMenu, self)
+               self.session.openWithCallback(self.exitContext, ChannelContextMenu, self)
+               
+       def exitContext(self, close = False):
+               if close:
+                       self.cancel()
 
 MODE_TV = 0
 MODE_RADIO = 1
index a15c7ac..5b06124 100644 (file)
@@ -12,7 +12,7 @@ profile("LOAD:InfoBarGenerics")
 from Screens.InfoBarGenerics import InfoBarShowHide, \
        InfoBarNumberZap, InfoBarChannelSelection, InfoBarMenu, InfoBarRdsDecoder, \
        InfoBarEPG, InfoBarSeek, InfoBarInstantRecord, \
-       InfoBarAudioSelection, InfoBarAdditionalInfo, InfoBarNotifications, InfoBarDish, \
+       InfoBarAudioSelection, InfoBarAdditionalInfo, InfoBarNotifications, InfoBarDish, InfoBarUnhandledKey, \
        InfoBarSubserviceSelection, InfoBarShowMovies, InfoBarTimeshift,  \
        InfoBarServiceNotifications, InfoBarPVRState, InfoBarCueSheetSupport, InfoBarSimpleEventView, \
        InfoBarSummarySupport, InfoBarMoviePlayerSummarySupport, InfoBarTimeshiftState, InfoBarTeletextPlugin, InfoBarExtensions, \
@@ -29,7 +29,7 @@ from Screens.HelpMenu import HelpableScreen
 class InfoBar(InfoBarBase, InfoBarShowHide,
        InfoBarNumberZap, InfoBarChannelSelection, InfoBarMenu, InfoBarEPG, InfoBarRdsDecoder,
        InfoBarInstantRecord, InfoBarAudioSelection, 
-       HelpableScreen, InfoBarAdditionalInfo, InfoBarNotifications, InfoBarDish,
+       HelpableScreen, InfoBarAdditionalInfo, InfoBarNotifications, InfoBarDish, InfoBarUnhandledKey,
        InfoBarSubserviceSelection, InfoBarTimeshift, InfoBarSeek,
        InfoBarSummarySupport, InfoBarTimeshiftState, InfoBarTeletextPlugin, InfoBarExtensions,
        InfoBarPiP, InfoBarPlugins, InfoBarSubtitleSupport, InfoBarServiceErrorPopupSupport, InfoBarJobman,
@@ -52,7 +52,7 @@ class InfoBar(InfoBarBase, InfoBarShowHide,
                for x in HelpableScreen, \
                                InfoBarBase, InfoBarShowHide, \
                                InfoBarNumberZap, InfoBarChannelSelection, InfoBarMenu, InfoBarEPG, InfoBarRdsDecoder, \
-                               InfoBarInstantRecord, InfoBarAudioSelection, \
+                               InfoBarInstantRecord, InfoBarAudioSelection, InfoBarUnhandledKey, \
                                InfoBarAdditionalInfo, InfoBarNotifications, InfoBarDish, InfoBarSubserviceSelection, \
                                InfoBarTimeshift, InfoBarSeek, InfoBarSummarySupport, InfoBarTimeshiftState, \
                                InfoBarTeletextPlugin, InfoBarExtensions, InfoBarPiP, InfoBarSubtitleSupport, InfoBarJobman, \
index a3e56a4..7ae0b12 100644 (file)
@@ -26,13 +26,14 @@ from Screens.PictureInPicture import PictureInPicture
 from Screens.SubtitleDisplay import SubtitleDisplay
 from Screens.RdsDisplay import RdsInfoDisplay, RassInteractive
 from Screens.TimeDateInput import TimeDateInput
+from Screens.UnhandledKey import UnhandledKey
 from ServiceReference import ServiceReference
 
 from Tools import Notifications
 from Tools.Directories import fileExists
 
 from enigma import eTimer, eServiceCenter, eDVBServicePMTHandler, iServiceInformation, \
-       iPlayableService, eServiceReference, eEPGCache
+       iPlayableService, eServiceReference, eEPGCache, eActionMap
 
 from time import time, localtime, strftime
 from os import stat as os_stat
@@ -47,6 +48,39 @@ class InfoBarDish:
        def __init__(self):
                self.dishDialog = self.session.instantiateDialog(Dish)
 
+class InfoBarUnhandledKey:
+       def __init__(self):
+               self.unhandledKeyDialog = self.session.instantiateDialog(UnhandledKey)
+               self.hideUnhandledKeySymbolTimer = eTimer()
+               self.hideUnhandledKeySymbolTimer.callback.append(self.unhandledKeyDialog.hide)
+               self.checkUnusedTimer = eTimer()
+               self.checkUnusedTimer.callback.append(self.checkUnused)
+               self.onLayoutFinish.append(self.unhandledKeyDialog.hide)
+               eActionMap.getInstance().bindAction('', -0x7FFFFFFF, self.actionA) #highest prio
+               eActionMap.getInstance().bindAction('', 0x7FFFFFFF, self.actionB) #lowest prio
+               self.flags = (1<<1);
+               self.uflags = 0;
+
+       #this function is called on every keypress!
+       def actionA(self, key, flag):
+               if flag != 4:
+                       if self.flags & (1<<1):
+                               self.flags = self.uflags = 0
+                       self.flags |= (1<<flag)
+                       if flag == 1: # break
+                               self.checkUnusedTimer.start(0, True)
+               return 0
+
+       #this function is only called when no other action has handled this key
+       def actionB(self, key, flag):
+               if flag != 4:
+                       self.uflags |= (1<<flag)
+
+       def checkUnused(self):
+               if self.flags == self.uflags:
+                       self.unhandledKeyDialog.show()
+                       self.hideUnhandledKeySymbolTimer.start(2000, True)
+
 class InfoBarShowHide:
        """ InfoBar show/hide control, accepts toggleShow and hide actions, might start
        fancy animations. """
@@ -691,6 +725,7 @@ class InfoBarSeek:
                                iPlayableService.evEOF: self.__evEOF,
                                iPlayableService.evSOF: self.__evSOF,
                        })
+               self.fast_winding_hint_message_showed = False
 
                class InfoBarSeekActionMap(HelpableActionMap):
                        def __init__(self, screen, *args, **kwargs):
@@ -817,6 +852,7 @@ class InfoBarSeek:
 #                      print "seekable"
 
        def __serviceStarted(self):
+               self.fast_winding_hint_message_showed = False
                self.seekstate = self.SEEK_STATE_PLAY
                self.__seekableStatusChanged()
 
@@ -907,6 +943,13 @@ class InfoBarSeek:
                        self.showAfterSeek()
 
        def seekFwd(self):
+               seek = self.getSeek()
+               if seek and not (seek.isCurrentlySeekable() & 2):
+                       if not self.fast_winding_hint_message_showed and (seek.isCurrentlySeekable() & 1):
+                               self.session.open(MessageBox, _("No fast winding possible yet.. but you can use the number buttons to skip forward/backward!"), MessageBox.TYPE_INFO, timeout=10)
+                               self.fast_winding_hint_message_showed = True
+                               return
+                       return 0 # trade as unhandled action
                if self.seekstate == self.SEEK_STATE_PLAY:
                        self.setSeekState(self.makeStateForward(int(config.seek.enter_forward.value)))
                elif self.seekstate == self.SEEK_STATE_PAUSE:
@@ -936,6 +979,13 @@ class InfoBarSeek:
                        self.setSeekState(self.makeStateSlowMotion(speed))
 
        def seekBack(self):
+               seek = self.getSeek()
+               if seek and not (seek.isCurrentlySeekable() & 2):
+                       if not self.fast_winding_hint_message_showed and (seek.isCurrentlySeekable() & 1):
+                               self.session.open(MessageBox, _("No fast winding possible yet.. but you can use the number buttons to skip forward/backward!"), MessageBox.TYPE_INFO, timeout=10)
+                               self.fast_winding_hint_message_showed = True
+                               return
+                       return 0 # trade as unhandled action
                seekstate = self.seekstate
                if seekstate == self.SEEK_STATE_PLAY:
                        self.setSeekState(self.makeStateBackward(int(config.seek.enter_backward.value)))
index 585983c..5457bf6 100755 (executable)
@@ -14,5 +14,5 @@ install_PYTHON = \
        SubtitleDisplay.py SubservicesQuickzap.py ParentalControlSetup.py NumericalTextInputHelpDialog.py \
        SleepTimerEdit.py Ipkg.py RdsDisplay.py Globals.py DefaultWizard.py \
        SessionGlobals.py LocationBox.py WizardLanguage.py TaskView.py Rc.py VirtualKeyBoard.py \
-       TextBox.py FactoryReset.py RecordPaths.py
+       TextBox.py FactoryReset.py RecordPaths.py UnhandledKey.py
 
index 93fdcd3..d5249b9 100644 (file)
@@ -146,6 +146,8 @@ class NimSetup(Screen, ConfigListScreen):
                                        currSat = self.nimConfig.advanced.sat[cur_orb_pos]
                                        self.fillListWithAdvancedSatEntrys(currSat)
                                self.have_advanced = True
+                       if self.nim.description == "Alps BSBE2" and config.usage.setup_level.index >= 2: # expert
+                               self.list.append(getConfigListEntry(_("Tone Amplitude"), self.nimConfig.toneAmplitude))
                elif self.nim.isCompatible("DVB-C"):
                        self.configMode = getConfigListEntry(_("Configuration Mode"), self.nimConfig.configMode)
                        self.list.append(self.configMode)
diff --git a/lib/python/Screens/UnhandledKey.py b/lib/python/Screens/UnhandledKey.py
new file mode 100644 (file)
index 0000000..63bfed5
--- /dev/null
@@ -0,0 +1,7 @@
+from Screen import Screen
+from Components.Pixmap import Pixmap
+
+class UnhandledKey(Screen):
+       def __init__(self, session):
+               Screen.__init__(self, session)
+               self["UnhandledKeyPixmap"] = Pixmap()
index b5e2651..69329ce 100644 (file)
@@ -1387,7 +1387,14 @@ RESULT eDVBServicePlay::setTrickmode(int trick)
 
 RESULT eDVBServicePlay::isCurrentlySeekable()
 {
-       return m_is_pvr || m_timeshift_active;
+       int ret = 0;
+       if (m_decoder)
+       {
+               ret = (m_is_pvr || m_timeshift_active) ? 3 : 0; // fast forward/backward possible and seeking possible
+               if (m_decoder->getVideoWidth() == -1)
+                       ret &= ~2;
+       }
+       return ret;
 }
 
 RESULT eDVBServicePlay::frontendInfo(ePtr<iFrontendInformation> &ptr)
index d3eaa26..cf71f78 100644 (file)
@@ -640,7 +640,31 @@ RESULT eServiceMP3::setTrickmode(int trick)
 
 RESULT eServiceMP3::isCurrentlySeekable()
 {
-       return 1;
+       int ret = 3; // seeking and fast/slow winding possible
+       GstElement *sink;
+
+       if (!m_gst_playbin)
+               return 0;
+       if (m_state != stRunning)
+               return 0;
+
+       g_object_get (G_OBJECT (m_gst_playbin), "video-sink", &sink, NULL);
+
+       // disable fast winding yet when a dvbvideosink or dvbaudiosink is used
+       // for this we must do some changes on different places.. (gstreamer.. our sinks.. enigma2)
+       if (sink) {
+               ret &= ~2; // only seeking possible
+               gst_object_unref(sink);
+       }
+       else {
+               g_object_get (G_OBJECT (m_gst_playbin), "audio-sink", &sink, NULL);
+               if (sink) {
+                       ret &= ~2; // only seeking possible
+                       gst_object_unref(sink);
+               }
+       }
+
+       return ret;
 }
 
 RESULT eServiceMP3::info(ePtr<iServiceInformation>&i)
index 44e6a6e..6b9adfb 100644 (file)
@@ -315,7 +315,7 @@ RESULT eServiceXine::setTrickmode(int trick)
 
 RESULT eServiceXine::isCurrentlySeekable()
 {
-       return 1;
+       return 3;
 }
 
 RESULT eServiceXine::info(ePtr<iServiceInformation>&i)