| @@ -0,0 +1,80 @@ | ||
| #ifndef __dvb_fbc_h | ||
| #define __dvb_fbc_h | ||
|
|
||
| /* FBC Manager */ | ||
| #include <lib/base/ebase.h> | ||
| #include <lib/base/object.h> | ||
| #include <lib/base/eptrlist.h> | ||
| #include <lib/dvb/idvb.h> | ||
|
|
||
| class eDVBResourceManager; | ||
| class eDVBRegisteredFrontend; | ||
|
|
||
| class eFBCTunerManager: public iObject, public Object | ||
| { | ||
| private: | ||
| DECLARE_REF(eFBCTunerManager); | ||
| ePtr<eDVBResourceManager> m_res_mgr; | ||
| int m_fbc_tuner_num; | ||
| static bool isDestroyed; | ||
|
|
||
| int getFBCTunerNum(); | ||
| void procInit(); | ||
| bool isSameFbcSet(int a, int b); | ||
| bool isSupportDVBS(eDVBRegisteredFrontend *fe); | ||
| int getFBCID(int root_fe_id); | ||
|
|
||
| eDVBRegisteredFrontend *getPrev(eDVBRegisteredFrontend *fe); | ||
| eDVBRegisteredFrontend *getNext(eDVBRegisteredFrontend *fe); | ||
| eDVBRegisteredFrontend *getTop(eDVBRegisteredFrontend *fe); | ||
| eDVBRegisteredFrontend *getLast(eDVBRegisteredFrontend *fe); | ||
| bool isLinked(eDVBRegisteredFrontend *fe); | ||
| bool isLinkedByIndex(int fe_idx); | ||
| bool checkTop(eDVBRegisteredFrontend *fe); | ||
| int connectLinkByIndex(int link_fe_index, int prev_fe_index, int next_fe_index, bool simulate); | ||
| int connectLinkByIndex(int link_fe_index, int prev_fe_index, bool simulate); | ||
| int disconnectLinkByIndex(int link_fe_index, int prev_fe_index, int next_fe_index, bool simulate); | ||
| int disconnectLinkByIndex(int link_fe_index, int prev_fe_index, bool simulate); | ||
| int connectLink(eDVBRegisteredFrontend *link_fe, eDVBRegisteredFrontend *prev_fe, eDVBRegisteredFrontend *next_fe, bool simulate); | ||
| int connectLink(eDVBRegisteredFrontend *link_fe, eDVBRegisteredFrontend *prev_fe, bool simulate); | ||
| int disconnectLink(eDVBRegisteredFrontend *link_fe, eDVBRegisteredFrontend *prev_fe, eDVBRegisteredFrontend *next_fe, bool simulate); | ||
| int disconnectLink(eDVBRegisteredFrontend *linkable_fe, eDVBRegisteredFrontend *top_fe, bool simulate); | ||
| void connectLinkNoSimulate(eDVBRegisteredFrontend *link_fe, eDVBRegisteredFrontend *top_fe); | ||
| void disconnectLinkNoSimulate(eDVBRegisteredFrontend *link_fe); | ||
|
|
||
| bool checkUsed(eDVBRegisteredFrontend *fe, bool a_simulate); | ||
| void connectSortedLink(eDVBRegisteredFrontend *link_fe, eDVBRegisteredFrontend *top_fe, bool simulate); | ||
| int updateLNBSlotMask(int dest_slot, int src_slot, bool remove); | ||
| void printLinks(eDVBRegisteredFrontend *fe); | ||
|
|
||
| public: | ||
| eFBCTunerManager(); | ||
| virtual ~eFBCTunerManager(); | ||
| int setProcFBCID(int fe_id, int fbc_id); | ||
| int setDefaultFBCID(eDVBRegisteredFrontend *fe); | ||
| void updateFBCID(eDVBRegisteredFrontend *next_fe, eDVBRegisteredFrontend *prev_fe); | ||
| bool isRootFeSlot(int fe_slot_id); | ||
| bool isRootFe(eDVBRegisteredFrontend *fe); | ||
| bool canLink(eDVBRegisteredFrontend *fe); | ||
| bool isUnicable(eDVBRegisteredFrontend *fe); | ||
| int isCompatibleWith(ePtr<iDVBFrontendParameters> &feparm, eDVBRegisteredFrontend *link_fe, bool simulate); | ||
| int isCompatibleWith(ePtr<iDVBFrontendParameters> &feparm, eDVBRegisteredFrontend *link_fe, eDVBRegisteredFrontend *&fbc_fe, bool simulate); | ||
| void addLink(eDVBRegisteredFrontend *link_fe, eDVBRegisteredFrontend *top_fe, bool simulate); | ||
| void unset(eDVBRegisteredFrontend *fe); | ||
| bool canAllocateLink(eDVBRegisteredFrontend *fe, bool simulate); | ||
|
|
||
| static eFBCTunerManager* getInstance() | ||
| { | ||
| if (isDestroyed == true) | ||
| { | ||
| eDebug("eFBCTunerManager is already destroyed!"); | ||
| return 0; | ||
| } | ||
| static eFBCTunerManager instance; | ||
| return &instance; | ||
| } | ||
|
|
||
| int getLinkedSlotID(int feid); | ||
| }; | ||
|
|
||
| #endif /* __dvb_fbc_h */ |
| @@ -0,0 +1,7 @@ | ||
| installdir = $(pkglibdir)/python/Plugins/Extensions/MiniTV | ||
|
|
||
| SUBDIRS = meta | ||
|
|
||
| install_PYTHON = \ | ||
| __init__.py \ | ||
| plugin.py |
| @@ -0,0 +1,2 @@ | ||
|
|
||
|
|
| @@ -0,0 +1,3 @@ | ||
| installdir = $(datadir)/meta | ||
|
|
||
| dist_install_DATA = plugin_minitv.xml |
| @@ -0,0 +1,17 @@ | ||
| <default> | ||
| <prerequisites> | ||
| <tag type="Display" /> | ||
| <tag type="System" /> | ||
| </prerequisites> | ||
| <info> | ||
| <author>hschang</author> | ||
| <name>MiniTV</name> | ||
| <packagename>enigma2-plugin-extensions-minitv</packagename> | ||
| <shortdescription>Support MiniTV of your VU+</shortdescription> | ||
| <description>Support MiniTV of your VU+</description> | ||
| </info> | ||
|
|
||
| <files type="package"> <!-- without version, without .ipk --> | ||
| <file type="package" name="enigma2-plugin-extensions-minitv" /> | ||
| </files> | ||
| </default> |
| @@ -0,0 +1,66 @@ | ||
| from Plugins.Plugin import PluginDescriptor | ||
| from Components.PluginComponent import plugins | ||
| from Components.config import config, ConfigSubsection, ConfigSelection | ||
| from enigma import eDBoxLCD | ||
|
|
||
| config.plugins.minitv = ConfigSubsection() | ||
| config.plugins.minitv.enable = ConfigSelection(default = "disable", choices = [ ("enable", "enable"), ("disable", "disable")]) | ||
|
|
||
| class MiniTV: | ||
| def __init__(self): | ||
| config.plugins.minitv.enable.addNotifier(self.miniTVChanged, initial_call = True) | ||
| config.misc.standbyCounter.addNotifier(self.standbyCounterChanged, initial_call = False) | ||
|
|
||
| def getExtensionName(self): | ||
| if config.plugins.minitv.enable.value == "enable": | ||
| return _("Disable MiniTV") | ||
|
|
||
| return _("Enable MiniTV") | ||
|
|
||
| def showMiniTV(self): | ||
| old_value = config.plugins.minitv.enable.value | ||
| config.plugins.minitv.enable.value = (old_value == "enable") and "disable" or "enable" | ||
| config.plugins.minitv.enable.save() | ||
|
|
||
| def miniTVChanged(self, configElement): | ||
| self.setMiniTV(configElement.value) | ||
|
|
||
| def setMiniTV(self, value): | ||
| cur_value = open("/proc/stb/lcd/live_enable", "r").read().strip() | ||
| if cur_value != value: | ||
| open("/proc/stb/lcd/live_enable", "w").write(value) | ||
|
|
||
| def standbyCounterChanged(self, configElement): | ||
| from Screens.Standby import inStandby | ||
| if self.leaveStandby not in inStandby.onClose: | ||
| inStandby.onClose.append(self.leaveStandby) | ||
|
|
||
| self.setMiniTV("disable") | ||
|
|
||
| def leaveStandby(self): | ||
| self.setMiniTV(config.plugins.minitv.enable.value) | ||
|
|
||
| minitv_instance = MiniTV() | ||
|
|
||
| def addExtentions(infobarExtensions): | ||
| infobarExtensions.addExtension((minitv_instance.getExtensionName, minitv_instance.showMiniTV, lambda: True), None) | ||
|
|
||
| def autoStart(reason, **kwargs): | ||
| if reason == 1: | ||
| minitv_instance.setMiniTV("standby") | ||
|
|
||
| def Plugins(**kwargs): | ||
| list = [] | ||
| list.append( | ||
| PluginDescriptor(name="MiniTV", | ||
| description="MiniTV", | ||
| where = [PluginDescriptor.WHERE_EXTENSIONSINGLE], | ||
| fnc = addExtentions)) | ||
|
|
||
| list.append( | ||
| PluginDescriptor( | ||
| where = [PluginDescriptor.WHERE_AUTOSTART], | ||
| fnc = autoStart)) | ||
|
|
||
| return list | ||
|
|
| @@ -0,0 +1,7 @@ | ||
| installdir = $(pkglibdir)/python/Plugins/SystemPlugins/BoxModeConfig | ||
|
|
||
| SUBDIRS = meta | ||
|
|
||
| install_PYTHON = \ | ||
| __init__.py \ | ||
| plugin.py |
| @@ -0,0 +1,3 @@ | ||
| installdir = $(datadir)/meta | ||
|
|
||
| dist_install_DATA = plugin_boxmodeconfig.xml |
| @@ -0,0 +1,16 @@ | ||
| <default> | ||
| <prerequisites> | ||
| <tag type="System" /> | ||
| </prerequisites> | ||
| <info> | ||
| <author>hschang</author> | ||
| <name>BoxModeConfig</name> | ||
| <packagename>enigma2-plugin-systemplugins-boxmodeconfig</packagename> | ||
| <shortdescription>configuration boxmode.</shortdescription> | ||
| <description>configuration boxmode.</description> | ||
| </info> | ||
|
|
||
| <files type="package"> <!-- without version, without .ipk --> | ||
| <file type="package" name="enigma2-plugin-systemplugins-boxmodeconfig" /> | ||
| </files> | ||
| </default> |
| @@ -0,0 +1,121 @@ | ||
| from Screens.Screen import Screen | ||
| from Components.ConfigList import ConfigListScreen | ||
| from Components.config import ConfigSelection, getConfigListEntry | ||
| from Components.Sources.StaticText import StaticText | ||
| from Screens.MessageBox import MessageBox | ||
| from Screens.Standby import TryQuitMainloop | ||
| import os | ||
|
|
||
| BOXMODE_BINNAME = "/usr/bin/nvram" | ||
|
|
||
| description_list = {} | ||
| description_list["1"] = "current box mode : 1" | ||
| description_list["2"] = "current box mode : 2" | ||
| description_list["3"] = "current box mode : 3" | ||
| description_list["4"] = "current box mode : 4" | ||
| description_list["5"] = "current box mode : 5" | ||
|
|
||
| class BoxModeConfig(Screen, ConfigListScreen): | ||
| skin = """ | ||
| <screen position="center,center" size="400,190" title="BoxModeConfig" > | ||
| <ePixmap pixmap="skin_default/buttons/red.png" position="30,10" size="140,40" alphatest="on" /> | ||
| <ePixmap pixmap="skin_default/buttons/green.png" position="230,10" size="140,40" alphatest="on" /> | ||
| <widget source="key_red" render="Label" position="30,10" zPosition="1" size="140,40" font="Regular;20" halign="center" valign="center" backgroundColor="#9f1313" foregroundColor="#ffffff" transparent="1" /> | ||
| <widget source="key_green" render="Label" position="230,10" zPosition="1" size="140,40" font="Regular;20" halign="center" valign="center" backgroundColor="#1f771f" foregroundColor="#ffffff" transparent="1" /> | ||
| <widget name="config" zPosition="2" position="5,70" size="380,90" scrollbarMode="showOnDemand" transparent="1" /> | ||
| <widget source="description" render="Label" position="30,160" size="380,30" font="Regular;24" halign="center" valign="center" /> | ||
| </screen> | ||
| """ | ||
|
|
||
| def __init__(self, session): | ||
| self.skin = BoxModeConfig.skin | ||
| Screen.__init__(self, session) | ||
|
|
||
| from Components.ActionMap import ActionMap | ||
| from Components.Button import Button | ||
| self["key_red"] = StaticText(_("Cancel")) | ||
| self["key_green"] = StaticText(_("Save")) | ||
| self["description"] = StaticText(_("starting...")) | ||
|
|
||
| self["actions"] = ActionMap(["SetupActions", "ColorActions"], | ||
| { | ||
| "ok": self.keyOk, | ||
| "save": self.keyOk, | ||
| "cancel": self.keyCancel, | ||
| "green": self.keyOk, | ||
| "red": self.keyCancel, | ||
| }, -2) | ||
|
|
||
| self.list = [] | ||
| ConfigListScreen.__init__(self, self.list, session = self.session) | ||
| setmodelist = [ ("1", "1 "), ("2", "2 "), ("3", "3 "), ("4", "4 "), ("5", "5 ") ] | ||
| self.oldconfig = self.getCurrentValue() | ||
| self.boxmode = ConfigSelection(choices = setmodelist, default = self.oldconfig) | ||
| self.list.append(getConfigListEntry(_("BoxMode : "), self.boxmode)) | ||
| self["config"].list = self.list | ||
| self["config"].l.setList(self.list) | ||
|
|
||
| if not self.showDescription in self["config"].onSelectionChanged: | ||
| self["config"].onSelectionChanged.append(self.showDescription) | ||
|
|
||
| def getCurrentValue(self): | ||
| global BOXMODE_BINNAME | ||
| cmd = "%s getenv BOXMODE" % (BOXMODE_BINNAME) | ||
| print "CMD : ", cmd | ||
| current_value = os.popen(cmd).read().strip() | ||
| try: | ||
| if int(current_value) < 1: | ||
| current_value = "1" | ||
| elif int(current_value) > 5: | ||
| current_value = "5" | ||
| except: | ||
| print '%s -> failed, force to set "3"' % cmd | ||
| current_value = "3" | ||
| return current_value | ||
|
|
||
| def showDescription(self): | ||
| global description_list | ||
| current_value = self["config"].getCurrent()[1].value | ||
| if current_value: | ||
| text = description_list[current_value] | ||
| self["description"].setText( _(text) ) | ||
|
|
||
| def keyLeft(self): | ||
| ConfigListScreen.keyLeft(self) | ||
| self.showDescription() | ||
|
|
||
| def keyRight(self): | ||
| ConfigListScreen.keyRight(self) | ||
| self.showDescription() | ||
|
|
||
| def keyOk(self): | ||
| current_value = self["config"].getCurrent()[1].value | ||
| if self.oldconfig != current_value: | ||
| cmd = "%s setenv BOXMODE %s" % (BOXMODE_BINNAME, current_value) | ||
| print "CMD : ", cmd | ||
| os.system(cmd) | ||
|
|
||
| msg = "You should reboot your STB now.\n Press OK Button." | ||
| self.session.openWithCallback(self.doReboot, MessageBox, _(msg), type = MessageBox.TYPE_INFO) | ||
| else: | ||
| self.close() | ||
|
|
||
| def doReboot(self, res = None): | ||
| self.session.open(TryQuitMainloop, 2) | ||
|
|
||
| def keyCancel(self): | ||
| self.close() | ||
|
|
||
| def main(session, **kwargs): | ||
| session.open(BoxModeConfig) | ||
|
|
||
| def Plugins(**kwargs): | ||
| descriptors = [] | ||
| from os import path | ||
| global BOXMODE_BINNAME | ||
| if path.exists(BOXMODE_BINNAME): | ||
| from Plugins.Plugin import PluginDescriptor | ||
| descriptors.append(PluginDescriptor(name = "BoxModeConfig", description = _("BoxMode Configuration."), where = PluginDescriptor.WHERE_PLUGINMENU, fnc = main)) | ||
| return descriptors |
| @@ -0,0 +1,7 @@ | ||
| installdir = $(pkglibdir)/python/Plugins/SystemPlugins/FastZapSupport | ||
|
|
||
| SUBDIRS = meta | ||
|
|
||
| install_PYTHON = \ | ||
| __init__.py \ | ||
| plugin.py |
| @@ -0,0 +1,2 @@ | ||
|
|
||
|
|
| @@ -0,0 +1,3 @@ | ||
| installdir = $(datadir)/meta | ||
|
|
||
| dist_install_DATA = plugin_fastzapsupport.xml |
| @@ -0,0 +1,16 @@ | ||
| <default> | ||
| <prerequisites> | ||
| <tag type="System" /> | ||
| </prerequisites> | ||
| <info> | ||
| <author>hschang</author> | ||
| <name>FastZapSupport</name> | ||
| <packagename>enigma2-plugin-systemplugins-fastzapsupport</packagename> | ||
| <shortdescription>Support FastZapping of your VU+</shortdescription> | ||
| <description>Support FastZapping of your VU+</description> | ||
| </info> | ||
|
|
||
| <files type="package"> <!-- without version, without .ipk --> | ||
| <file type="package" name="enigma2-plugin-systemplugins-fastzapsupport" /> | ||
| </files> | ||
| </default> |