From: ghost Date: Sat, 2 Jan 2010 09:58:02 +0000 (+0100) Subject: Merge remote branch 'origin/bug_112_enable_extensions_manager' X-Git-Tag: 2.7.0~10 X-Git-Url: https://git.cweiske.de/enigma2.git/commitdiff_plain/64cfba23aba53b4ab3933284b2a4a9ef5ec68e26?hp=c32caa3b71b68fc380681670804953abb2fd4ae8 Merge remote branch 'origin/bug_112_enable_extensions_manager' --- diff --git a/data/defaults/Dream/userbouquet.favourites.tv b/data/defaults/Dream/userbouquet.favourites.tv index f1adaf9e..cc5e9fe9 100644 --- a/data/defaults/Dream/userbouquet.favourites.tv +++ b/data/defaults/Dream/userbouquet.favourites.tv @@ -10,7 +10,7 @@ #SERVICE 1:0:1:33:21:85:C00000:0:0:0: #SERVICE 1:0:1:701:5:85:C00000:0:0:0: #SERVICE 1:0:1:2F1C:441:1:C00000:0:0:0: -#SERVICE 1:0:1:7005:436:1:C00000:0:0:0: +#SERVICE 1:0:1:6D6E:437:1:C00000:0:0:0: #SERVICE 1:0:1:2FC:5:85:C00000:0:0:0: #SERVICE 1:0:1:F98:454:1:C00000:0:0:0: #SERVICE 1:0:1:7034:41B:1:C00000:0:0:0: @@ -26,7 +26,6 @@ #SERVICE 1:64:B:0:0:0:0:0:0:0::Doku/Wissen/Themen #DESCRIPTION Doku/Wissen/Themen #SERVICE 1:0:1:6DD0:44D:1:C00000:0:0:0: -#SERVICE 1:0:1:6D6E:437:1:C00000:0:0:0: #SERVICE 1:0:1:6D6B:437:1:C00000:0:0:0: #SERVICE 1:0:1:2775:444:1:C00000:0:0:0: #SERVICE 1:0:1:293:5:85:C00000:0:0:0: @@ -77,8 +76,6 @@ #SERVICE 1:64:5:0:0:0:0:0:0:0::Reisen #DESCRIPTION Reisen #SERVICE 1:0:1:20:21:85:C00000:0:0:0: -#SERVICE 1:0:1:3339:45B:1:C00000:0:0:0: -#SERVICE 1:0:1:27B9:444:1:C00000:0:0:0: #SERVICE 1:64:9:0:0:0:0:0:0:0::Beratung #DESCRIPTION Beratung #SERVICE 1:0:1:295:21:85:C00000:0:0:0: @@ -92,7 +89,6 @@ #SERVICE 1:0:1:36:7:85:C00000:0:0:0: #SERVICE 1:0:1:307:7:85:C00000:0:0:0: #SERVICE 1:0:1:296:5:85:C00000:0:0:0: -#SERVICE 1:0:1:2791:444:1:C00000:0:0:0: #SERVICE 1:0:1:383:21:85:C00000:0:0:0: #SERVICE 1:0:1:313C:459:1:C00000:0:0:0: #SERVICE 1:0:1:3159:459:1:C00000:0:0:0: @@ -104,9 +100,9 @@ #SERVICE 1:0:19:2B66:3F3:1:C00000:0:0:0: #SERVICE 1:0:19:2B70:3F3:1:C00000:0:0:0: #SERVICE 1:0:19:6EEC:4B1:1:C00000:0:0:0: -#SERVICE 1:0:19:1324:3EF:1:C00000:0:0:0: -#SERVICE 1:0:19:1325:3EF:1:C00000:0:0:0: +#SERVICE 1:0:19:EF12:421:1:C00000:0:0:0: #SERVICE 1:0:19:2B84:3F3:1:C00000:0:0:0: +#SERVICE 1:0:19:EF13:421:1:C00000:0:0:0: #SERVICE 1:64:0:0:0:0:0:0:0:0::Alternativen #DESCRIPTION Alternativen #SERVICE 1:0:1:6DCB:44D:1:C00000:0:0:0: diff --git a/data/skin_default.xml b/data/skin_default.xml index 71f579cb..85c4016a 100755 --- a/data/skin_default.xml +++ b/data/skin_default.xml @@ -70,8 +70,8 @@ - - + + @@ -253,6 +253,10 @@ self.instance.move(ePoint((720-wsizex)/2, (576-wsizey)/(count > 7 and 2 or 3) + + + + diff --git a/data/skin_default/Makefile.am b/data/skin_default/Makefile.am index 15f4a54f..9e9b7cd4 100755 --- a/data/skin_default/Makefile.am +++ b/data/skin_default/Makefile.am @@ -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 index 00000000..8e543498 Binary files /dev/null and b/data/skin_default/unhandled-key.png differ diff --git a/lib/actions/action.cpp b/lib/actions/action.cpp index 0eb4cdb1..a2d85ffd 100644 --- a/lib/actions/action.cpp +++ b/lib/actions/action.cpp @@ -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)); diff --git a/lib/driver/rc.cpp b/lib/driver/rc.cpp index c7acd113..c56fde44 100644 --- a/lib/driver/rc.cpp +++ b/lib/driver/rc.cpp @@ -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::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::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::iterator i=devices.begin(); i != devices.end(); ++i) + for (std::map::iterator i=devices.begin(); i != devices.end(); ++i) eDebug("%s", i->first.c_str()); return 0; } diff --git a/lib/driver/rc.h b/lib/driver/rc.h index 9708ea7b..52909468 100644 --- a/lib/driver/rc.h +++ b/lib/driver/rc.h @@ -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; } }; diff --git a/lib/driver/rcconsole.cpp b/lib/driver/rcconsole.cpp index bcce5601..eb5aee3d 100644 --- a/lib/driver/rcconsole.cpp +++ b/lib/driver/rcconsole.cpp @@ -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 */ diff --git a/lib/driver/rcinput.cpp b/lib/driver/rcinput.cpp index d10d94f3..e593087d 100644 --- a/lib/driver/rcinput.cpp +++ b/lib/driver/rcinput.cpp @@ -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 diff --git a/lib/driver/rcinput.h b/lib/driver/rcinput.h index c7f56975..3b4579c5 100644 --- a/lib/driver/rcinput.h +++ b/lib/driver/rcinput.h @@ -10,6 +10,7 @@ public: void handleCode(long code); eRCDeviceInputDev(eRCInputEventDriver *driver); const char *getDescription() const; + void setExclusive(bool); }; #endif diff --git a/lib/python/Components/ChoiceList.py b/lib/python/Components/ChoiceList.py index 4700e9e6..33868d61 100755 --- a/lib/python/Components/ChoiceList.py +++ b/lib/python/Components/ChoiceList.py @@ -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)) diff --git a/lib/python/Components/NimManager.py b/lib/python/Components/NimManager.py index 7d148f3c..00d06095 100644 --- a/lib/python/Components/NimManager.py +++ b/lib/python/Components/NimManager.py @@ -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 diff --git a/lib/python/Plugins/Extensions/DVDPlayer/src/servicedvd.cpp b/lib/python/Plugins/Extensions/DVDPlayer/src/servicedvd.cpp index 94f2ee38..0372c497 100644 --- a/lib/python/Plugins/Extensions/DVDPlayer/src/servicedvd.cpp +++ b/lib/python/Plugins/Extensions/DVDPlayer/src/servicedvd.cpp @@ -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) diff --git a/lib/python/Plugins/SystemPlugins/Videomode/VideoWizard.py b/lib/python/Plugins/SystemPlugins/Videomode/VideoWizard.py index cd1529aa..512bcec3 100644 --- a/lib/python/Plugins/SystemPlugins/Videomode/VideoWizard.py +++ b/lib/python/Plugins/SystemPlugins/Videomode/VideoWizard.py @@ -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 diff --git a/lib/python/Plugins/SystemPlugins/Videomode/videowizard.xml b/lib/python/Plugins/SystemPlugins/Videomode/videowizard.xml index 29ac4297..5dea661d 100644 --- a/lib/python/Plugins/SystemPlugins/Videomode/videowizard.xml +++ b/lib/python/Plugins/SystemPlugins/Videomode/videowizard.xml @@ -20,7 +20,7 @@ self.selectKey("DOWN") self["portpic"].hide() - + self.condition = (self.port != "DVI" or self.mode == "PC") @@ -33,7 +33,7 @@ self.selectKey("UP") self.selectKey("DOWN") - + self.hw.saveMode(self.port, self.mode, self.rate) diff --git a/lib/python/Screens/ChannelSelection.py b/lib/python/Screens/ChannelSelection.py index 0432823b..5fbfd591 100644 --- a/lib/python/Screens/ChannelSelection.py +++ b/lib/python/Screens/ChannelSelection.py @@ -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 diff --git a/lib/python/Screens/InfoBar.py b/lib/python/Screens/InfoBar.py index a15c7ac1..5b061245 100644 --- a/lib/python/Screens/InfoBar.py +++ b/lib/python/Screens/InfoBar.py @@ -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, \ diff --git a/lib/python/Screens/InfoBarGenerics.py b/lib/python/Screens/InfoBarGenerics.py index a3e56a40..7ae0b123 100644 --- a/lib/python/Screens/InfoBarGenerics.py +++ b/lib/python/Screens/InfoBarGenerics.py @@ -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<= 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 index 00000000..63bfed5b --- /dev/null +++ b/lib/python/Screens/UnhandledKey.py @@ -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() diff --git a/lib/service/servicedvb.cpp b/lib/service/servicedvb.cpp index b5e2651f..69329ce0 100644 --- a/lib/service/servicedvb.cpp +++ b/lib/service/servicedvb.cpp @@ -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 &ptr) diff --git a/lib/service/servicemp3.cpp b/lib/service/servicemp3.cpp index d3eaa262..cf71f781 100644 --- a/lib/service/servicemp3.cpp +++ b/lib/service/servicemp3.cpp @@ -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&i) diff --git a/lib/service/servicexine.cpp b/lib/service/servicexine.cpp index 44e6a6e0..6b9adfb9 100644 --- a/lib/service/servicexine.cpp +++ b/lib/service/servicexine.cpp @@ -315,7 +315,7 @@ RESULT eServiceXine::setTrickmode(int trick) RESULT eServiceXine::isCurrentlySeekable() { - return 1; + return 3; } RESULT eServiceXine::info(ePtr&i)