def setMute(self): if eDVBVolumecontrol.getInstance().isMuted(): self.wasMuted = 1 print "[Standby] mute already active" else: self.wasMuted = 0 eDVBVolumecontrol.getInstance().volumeToggleMute()
def _volDown(self): print "_volDown" from enigma import eDVBVolumecontrol eDVBVolumecontrol.getInstance().volumeDown() self.volumeDialog.setValue(eDVBVolumecontrol.getInstance().getVolume()) self.volumeDialog.show() self.hideVolTimer.start(3000, True)
def _volUp(self): print "_volUp" from enigma import eDVBVolumecontrol eDVBVolumecontrol.getInstance().volumeUp() self.volumeDialog.setValue(eDVBVolumecontrol.getInstance().getVolume()) self.volumeDialog.show() self.hideVolTimer.start(3000, True) config.audio.volume.value = eDVBVolumecontrol.getInstance().getVolume() config.audio.volume.save()
def layoutFinished(self): model = HardwareInfo().get_device_name() if model == "optimussos1": self["info0_s"].setText(_(" OPTIMUSS OS1")) elif model == "optimussos2": self["info0_s"].setText(_(" OPTIMUSS OS2")) elif model == "optimussos1plus": self["info0_s"].setText(_(" OPTIMUSS OS1+")) elif model == "optimussos2plus": self["info0_s"].setText(_(" OPTIMUSS OS2+")) else: self["info0_s"].setText(_(" %s" % (about.getHardwareTypeString()))) self["info1_s"].setText(_(" %s" % (self.TEST_PROG_VERSION))) self["mac_s"].setText(_(" %s" % self.getMacaddress())) self["micom_s"].setText(_(" %s" % self.getMicomVersion())) securityRes = self.checkSecurityChip() if securityRes == 0xf: for i in (0, 1): self["security%d_i" % i].hide() self["security%d_s" % i].hide() elif self.has_sc41cr: if securityRes: self["security0_s"].setText(_(" SC41CR - NOK")) self["security0_s"].setForegroundColorNum(1) else: self["security0_s"].setText(_(" SC41CR - OK")) self["security1_i"].hide() self["security1_s"].hide() elif self.has_sc50cr: if securityRes: self["security0_s"].setText(_(" SC50CR - NOK")) self["security0_s"].setForegroundColorNum(1) else: self["security0_s"].setText(_(" SC50CR - OK")) self["security1_i"].hide() self["security1_s"].hide() else: if securityRes>>1 & 1: self["security0_s"].setText(_(" CO164 - NOK")) self["security0_s"].setForegroundColorNum(1) else: self["security0_s"].setText(_(" CO164 - OK")) self["security1_i"].hide() self["security1_s"].hide() self.keyNumberGlobal(1) from enigma import eDVBVolumecontrol eDVBVolumecontrol.getInstance().setVolume(100, 100)
def __evStopped(self): print "[SVA] __evStopped" if config.plugins.SVA.PreviewHelper.value == True: self.dst_left = open("/proc/stb/vmpeg/0/dst_left").readline().strip() self.dst_top = open("/proc/stb/vmpeg/0/dst_top").readline().strip() self.dst_width = open("/proc/stb/vmpeg/0/dst_width").readline().strip() self.dst_height = open("/proc/stb/vmpeg/0/dst_height").readline().strip() print ("[SVA]__evStopped: %s, %s, %s, %s\n" % (self.dst_left,self.dst_top,self.dst_width,self.dst_height)) if config.plugins.SVA.muteONzap.value == True: self.Muted = True self.MuteVolume = eDVBVolumecontrol.getInstance().getVolume() eDVBVolumecontrol.getInstance().setVolume(0,0) print('[SVArun:__evStopped] %i>0' % self.MuteVolume) else: print('[SVArun:__evStopped] muteONzap disabled')
def VOLU(self, args): volctrl = eDVBVolumecontrol.getInstance() if args == "mute": from Components.VolumeControl import VolumeControl VolumeControl.instance.volMute() elif args == "+": from Components.VolumeControl import VolumeControl VolumeControl.instance.volUp() elif args == "-": from Components.VolumeControl import VolumeControl VolumeControl.instance.volDown() elif args: try: num = int(args) / 2.55 except ValueError: payload = "%d %s" % (CODE_SYNTAX, str(e).replace("\n", " ").replace("\r", "")) return self.sendLine(payload) else: volctr.setVolume(num, num) if volctrl.isMuted(): payload = "%d Audio is mute" % (CODE_OK,) else: payload = "%d Audio volume is %d." % (CODE_OK, volctrl.getVolume() * 2.55) self.sendLine(payload)
def changed(self, what): if not self.suspended: # self.text = str(eDVBVolumecontrol.getInstance().getVolume()) self.actvol = eDVBVolumecontrol.getInstance().getVolume() self.text = "3BYK: " + ((self.actvol/5) * "|") if self.actvol == 0: self.text="3BYK:OTK"
def __init__(self, session): self.session = session Screen.__init__(self, session) print "[AutomaticVolumeAdjustment] Starting AutomaticVolumeAdjustment..." self.__event_tracker = ServiceEventTracker( screen=self, eventmap={ iPlayableService.evUpdatedInfo: self.__evUpdatedInfo, iPlayableService.evStart: self.__evStart, iPlayableService.evEnd: self.__evEnd, }, ) self.newService = False # switching flag self.pluginStarted = False # is plugin started? self.lastAdjustedValue = 0 # remember delta from last automatic volume up/down self.currentVolume = 0 # only set when AC3 or DTS is available self.enabled = False # AutomaticVolumeAdjustment enabled in setup? self.serviceList = {} # values from config configVA = AutomaticVolumeAdjustmentConfig() # get config values assert not AutomaticVolumeAdjustment.instance, "only one AutomaticVolumeAdjustment instance is allowed!" AutomaticVolumeAdjustment.instance = self # set instance self.volumeControlInstance = None # VolumeControlInstance self.currentAC3DTS = False # current service = AC3||DTS? self.initializeConfigValues(configVA, False) self.volctrl = eDVBVolumecontrol.getInstance()
def __init__(self, session): global globalActionMap globalActionMap.actions["volumeUp"]=self.volUp globalActionMap.actions["volumeDown"]=self.volDown globalActionMap.actions["volumeMute"]=self.volMute assert not VolumeControl.instance, "only one VolumeControl instance is allowed!" VolumeControl.instance = self config.audio = ConfigSubsection() config.audio.volume = ConfigInteger(default = 50, limits = (0, 100)) self.volumeDialog = session.instantiateDialog(Volume) self.volumeDialog.setAnimationMode(0) self.muteDialog = session.instantiateDialog(Mute) self.muteDialog.setAnimationMode(0) self.hideVolTimer = eTimer() self.hideVolTimer.callback.append(self.volHide) self.stepVolTimer = eTimer() self.repeat = 500 self.delay = 3000 vol = config.audio.volume.value self.volumeDialog.setValue(vol) self.volctrl = eDVBVolumecontrol.getInstance() self.volctrl.setVolume(vol, vol)
def __init__(self, session, command_default="state"): self.cmd = command_default Source.__init__(self) global globalActionMap # hackalert :) self.actionmap = globalActionMap self.volctrl = eDVBVolumecontrol.getInstance() # this is not nice self.vol = ( True, "State", self.volctrl.getVolume(), self.volctrl.isMuted() )
def __init__(self): # support only tm models self.devices = { "tm2toe":1, "tmnano2t":1, "tmtwinoe":2, "tmsingle":4, "tmnanooe":4} self.models = { 1:"TM-2T-OE/TM-NANO-2T", 2:"TM-TWIN-OE", 4:"TM-SINGLE/TM-NANO-OE" } self.rcu = self.devices.get(HardwareInfo().get_device_name()) self.rcuSaveFile = "/etc/.rcu" if os.path.exists(self.rcuSaveFile): fd = open(self.rcuSaveFile, "r") try: if int(fd.readline().strip()) in self.devices.values(): self.rcu = int(fd.readline().strip()) except: pass self.menuKeyCount = 0 self.ChannelMinusKeyCount = 0 self.volctrl = eDVBVolumecontrol.getInstance() #IQON model = HardwareInfo().get_device_name() # tmnano2t has not menu key. if model in ("tmnano2t"): self.resetChannelMinusKeyCountTimer = eTimer() self.resetChannelMinusKeyCountTimer.callback.append(self.resetChannelMinusKeyCount) else: self.resetMenuKeyCountTimer = eTimer() self.resetMenuKeyCountTimer.callback.append(self.resetMenuKeyCount)
def __evUpdatedInfo(self): print "[SVArun:__evUpdatedInfo] >>>" global FirstTimeRun if FirstTimeRun is True: FirstTimeRun = False if config.plugins.SVA.enabled.value == True: service=self.session.nav.getCurrentService() if service is not None: audio = service.audioTracks() if audio: n = audio.getNumberOfTracks() selectedAudio = audio.getCurrentTrack() for x in range(n): if x == selectedAudio: i = audio.getTrackInfo(x) description = i.getDescription(); if description.find("MP3") != -1: self.currentVolume = int(config.plugins.SVA.mp2.value) + int(config.plugins.SVA.mp3adjust.value) print "[SVArun:__evUpdatedInfo]MP3 Volume: %i" % self.currentVolume elif description.find("AC3") != -1 or description.find("DTS") != -1: self.currentVolume = int(config.plugins.SVA.mp2.value) + int(config.plugins.SVA.ac3adjust.value) print "[SVArun:__evUpdatedInfo]AC3/DTS Volume: %i" % self.currentVolume else: self.currentVolume = int(config.plugins.SVA.mp2.value) print "[SVArun:__evUpdatedInfo]MP2 Volume: %i" % self.currentVolume eDVBVolumecontrol.getInstance().setVolume(self.currentVolume, self.currentVolume ) if config.plugins.SVA.muteONzap.value == True and self.MuteVolume != 0 and self.Muted == True: print "[SVArun:__evUpdatedInfo] unmute to %i" % self.MuteVolume eDVBVolumecontrol.getInstance().setVolume(self.MuteVolume, self.MuteVolume ) self.MuteVolume = 0 self.Muted == False if self.NewService == True: self.NewService = False if self.dst_top == "0" or self.dst_left == "0" or self.dst_width == "0" or self.dst_height == "0": print('[SVA] no need to resize') else: print('[SVA] __evStart: echo "%s, %s, %s ,%s">/proc/stb/vmpeg/0/dst_all' % (self.dst_left,self.dst_top,self.dst_width,self.dst_height) ) #with open('/proc/stb/vmpeg/0/dst_all', "w") as f: f.write("%s %s %s %s\n" % (self.dst_left,self.dst_top,self.dst_width,self.dst_height)) with open('/proc/stb/vmpeg/0/dst_left', "w") as f: f.write("%s\n" % self.dst_left) with open('/proc/stb/vmpeg/0/dst_top', "w") as f: f.write("%s\n" % self.dst_top) with open('/proc/stb/vmpeg/0/dst_width', "w") as f: f.write("%s\n" % self.dst_width) with open('/proc/stb/vmpeg/0/dst_height', "w") as f: f.write("%s\n" % self.dst_height) self.dst_left = 0
def changed(self, what=""): if self.instance is None: return if self.start: offset = eDVBVolumecontrol.getInstance().getVolume() if self.allColors.has_key(str(offset)): self.instance.clear(self.bgColor) color = parseColor(self.allColors.get(str(offset))) self.instance.fillRect(eRect(((2*offset)-10), 0, 10, 25), color)
def setVolume(self, value): if config.plugins.airplayer.allowiOSVolumeControl.value: print '[AirTunes] set Volume : ', value vcontrol = eDVBVolumecontrol.getInstance() if value < 0: value = 0 if value > 100: value = 100 vcontrol.setVolume(value, value)
def getStatusInfo(self): statusinfo = {} # Get Current Volume and Mute Status vcontrol = eDVBVolumecontrol.getInstance() statusinfo['volume'] = vcontrol.getVolume() statusinfo['muted'] = vcontrol.isMuted() # Get currently running Service event = None serviceref = self.session.nav.getCurrentlyPlayingServiceReference() if serviceref is not None: serviceHandler = eServiceCenter.getInstance() serviceHandlerInfo = serviceHandler.info(serviceref) service = self.session.nav.getCurrentService() serviceinfo = service and service.info() event = serviceinfo and serviceinfo.getEvent(0) else: event = None if event is not None: curEvent = parseEvent(event) statusinfo['currservice_name'] = curEvent[2].replace('\xc2\x86', '').replace('\xc2\x87', '') statusinfo['currservice_serviceref'] = serviceref.toString() statusinfo['currservice_begin'] = strftime("%H:%M", (localtime(int(curEvent[0])+(config.recording.margin_before.value*60)))) statusinfo['currservice_end'] = strftime("%H:%M", (localtime(int(curEvent[1])-(config.recording.margin_after.value*60)))) statusinfo['currservice_description'] = curEvent[3] if len(curEvent[3].decode('utf-8')) > 220: statusinfo['currservice_description'] = curEvent[3].decode('utf-8')[0:220].encode('utf-8') + "..." statusinfo['currservice_station'] = serviceHandlerInfo.getName(serviceref).replace('\xc2\x86', '').replace('\xc2\x87', '') else: statusinfo['currservice_name'] = "N/A" statusinfo['currservice_begin'] = "" statusinfo['currservice_end'] = "" statusinfo['currservice_description'] = "" if serviceref: statusinfo['currservice_serviceref'] = serviceref.toString() statusinfo['currservice_station'] = serviceHandlerInfo.getName(serviceref).replace('\xc2\x86', '').replace('\xc2\x87', '') # Get Standby State from Screens.Standby import inStandby if inStandby == None: statusinfo['inStandby'] = "false" else: statusinfo['inStandby'] = "true" # Get recording state recs = NavigationInstance.instance.getRecordings() if recs: statusinfo['isRecording'] = "true" else: statusinfo['isRecording'] = "false" return statusinfo
def getStatusInfo(self): statusinfo = {} # Get Current Volume and Mute Status vcontrol = eDVBVolumecontrol.getInstance() statusinfo["volume"] = vcontrol.getVolume() statusinfo["muted"] = vcontrol.isMuted() # Get currently running Service event = None serviceref = self.session.nav.getCurrentlyPlayingServiceReference() if serviceref is not None: serviceHandler = eServiceCenter.getInstance() serviceHandlerInfo = serviceHandler.info(serviceref) service = self.session.nav.getCurrentService() serviceinfo = service and service.info() event = serviceinfo and serviceinfo.getEvent(0) else: event = None if event is not None: curEvent = parseEvent(event) statusinfo["currservice_name"] = curEvent[2].replace("\xc2\x86", "").replace("\xc2\x87", "") statusinfo["currservice_serviceref"] = serviceref.toString() statusinfo["currservice_begin"] = strftime( "%H:%M", (localtime(int(curEvent[0]) + (config.recording.margin_before.value * 60))) ) statusinfo["currservice_end"] = strftime( "%H:%M", (localtime(int(curEvent[1]) - (config.recording.margin_after.value * 60))) ) statusinfo["currservice_description"] = curEvent[3] if len(curEvent[3]) > 220: statusinfo["currservice_description"] = curEvent[3][0:220] + "..." statusinfo["currservice_station"] = ( serviceHandlerInfo.getName(serviceref).replace("\xc2\x86", "").replace("\xc2\x87", "") ) else: statusinfo["currservice_name"] = "N/A" statusinfo["currservice_begin"] = "" statusinfo["currservice_end"] = "" statusinfo["currservice_description"] = "" if serviceref: statusinfo["currservice_serviceref"] = serviceref.toString() statusinfo["currservice_station"] = ( serviceHandlerInfo.getName(serviceref).replace("\xc2\x86", "").replace("\xc2\x87", "") ) # Get Standby State if inStandby == None: statusinfo["inStandby"] = "false" else: statusinfo["inStandby"] = "true" return statusinfo
def changed(self, what): sss = (eDVBVolumecontrol.getInstance().getVolume()*0.6) if what[0] == self.CHANGED_CLEAR: pass else: if self.instance: if self.numval != sss: self.numval = sss self.instance.clear(self.fColor) self.hand()
def getText(self): text = "" if self.type==self.VOLUMEN: try: self.volctrl = eDVBVolumecontrol.getInstance() valor=self.volctrl.getVolume() text=str(valor)+"%" except: pass return text
def __init__(self, session): self.session = session self.onClose = [] self.pluginStarted = False self.volumeUp = False self.newService = False self.volctrl = eDVBVolumecontrol.getInstance() self.__event_tracker = ServiceEventTracker(screen=self, eventmap={ iPlayableService.evUpdatedInfo: self.updateInfo, iPlayableService.evStart: self.__evStart })
def AntyRadioStandby__init__(self, session): StandbyScreen__init__(self, session) self.aqwakeup(False) self["actions"] = ActionMap( [ "StandbyActions", "GlobalActions", "OkCancelActions", "TvRadioActions"], { "power": self.__aqPower, "volumeMute": self.toggleMute, "volumeDown": self.volDown, "volumeUp": self.volUp, "ok": self.toggleAntyRadio, "keyRadio": self.toggleAntyRadio }, -1) self.volctrl = eDVBVolumecontrol.getInstance() self.downmix_config = config.av.downmix_ac3.value self.AntyRadio_enabled = False
def displayHddUsed(self): isMuted = eDVBVolumecontrol.getInstance().isMuted() if self.isMuted != isMuted: self.isMuted = isMuted evfd.getInstance().vfd_set_icon(8, isMuted) print "[VFD Display] Mute icon", isMuted self.SetMount() if self.mount: used = self.CheckSize() print "[VFD Display] HDD used", self.mount, used if self.hddUsed != used: self.hddUsed = used evfd.getInstance().vfd_set_icon(30, True) if used >= 1: evfd.getInstance().vfd_set_icon(24,True) else: evfd.getInstance().vfd_set_icon(24,False) if used >= 2: evfd.getInstance().vfd_set_icon(23,True) else: evfd.getInstance().vfd_set_icon(23,False) if used >= 3: evfd.getInstance().vfd_set_icon(21,True) else: evfd.getInstance().vfd_set_icon(21,False) if used >= 4: evfd.getInstance().vfd_set_icon(20,True) else: evfd.getInstance().vfd_set_icon(20,False) if used >= 5: evfd.getInstance().vfd_set_icon(19,True) else: evfd.getInstance().vfd_set_icon(19,False) if used >= 6: evfd.getInstance().vfd_set_icon(18,True) else: evfd.getInstance().vfd_set_icon(18,False) if used >= 7: evfd.getInstance().vfd_set_icon(17,True) else: evfd.getInstance().vfd_set_icon(17,False) if used >= 8: evfd.getInstance().vfd_set_icon(16,True) else: evfd.getInstance().vfd_set_icon(16,False) if used == 9: evfd.getInstance().vfd_set_icon(22, True) print "[VFD Display] HDD used icon", used
def __init__(self, session, infobar=None, page=PAGE_AUDIO): Screen.__init__(self, session) self["streams"] = List([]) self["key_red"] = Boolean(False) self["key_green"] = Boolean(False) self["key_yellow"] = Boolean(True) self["key_blue"] = Boolean(False) ConfigListScreen.__init__(self, []) self.infobar = infobar or self.session.infobar self.__event_tracker = ServiceEventTracker(screen=self, eventmap= { iPlayableService.evUpdatedInfo: self.__updatedInfo }) self.cached_subtitle_checked = False self.__selected_subtitle = None self["actions"] = NumberActionMap(["ColorActions", "SetupActions", "DirectionActions"], { "red": self.keyRed, "green": self.keyGreen, "yellow": self.keyYellow, "blue": self.keyBlue, "ok": self.keyOk, "cancel": self.cancel, "up": self.keyUp, "down": self.keyDown, "1": self.keyNumberGlobal, "2": self.keyNumberGlobal, "3": self.keyNumberGlobal, "4": self.keyNumberGlobal, "5": self.keyNumberGlobal, "6": self.keyNumberGlobal, "7": self.keyNumberGlobal, "8": self.keyNumberGlobal, "9": self.keyNumberGlobal, }, -2) self.settings = ConfigSubsection() choicelist = [(PAGE_AUDIO,_("audio tracks")), (PAGE_SUBTITLES,_("Subtitles"))] self.settings.menupage = ConfigSelection(choices = choicelist, default=page) self.onLayoutFinish.append(self.__layoutFinished) self.volctrl = eDVBVolumecontrol.getInstance()
def __init__(self, session): global globalActionMap globalActionMap.actions['volumeUp'] = self.volUp globalActionMap.actions['volumeDown'] = self.volDown globalActionMap.actions['volumeMute'] = self.volMute VolumeControl.instance = self config.audio = ConfigSubsection() config.audio.volume = ConfigInteger(default=100, limits=(0, 100)) self.volumeDialog = session.instantiateDialog(Volume) self.volumeDialog.setAnimationMode(0) self.muteDialog = session.instantiateDialog(Mute) self.muteDialog.setAnimationMode(0) self.hideVolTimer = eTimer() self.hideVolTimer.callback.append(self.volHide) vol = config.audio.volume.value self.volumeDialog.setValue(vol) self.volctrl = eDVBVolumecontrol.getInstance() self.volctrl.setVolume(vol, vol)
def hand(self): volumevalue = eDVBVolumecontrol.getInstance().getVolume() width = self.instance.size().width() height = self.instance.size().height() r = (min(width, height) / 2) self.wh = r/10 i = 0 if volumevalue > 25: i = 25 self.instance.fillRect(eRect(width/2, 0, r, r), self.bColor) if volumevalue > 50: i = 50 self.instance.fillRect(eRect(width/2, width/2, r, r), self.bColor) if volumevalue > 75: i = 75 self.instance.fillRect(eRect(0, width/2, r, r), self.bColor) i = i*0.6 if volumevalue > 0: while i <= self.numval: (endX, endY,) = self.calculate(i, r, r) self.draw_line(r, r, endX, endY) i = i + 1
def notifyCall(date, number, caller): if Standby.inStandby is None or config.plugins.NcidClient.afterStandby.value == "each": global global_muted if config.plugins.NcidClient.muteOnCall.value and not global_muted: # eDVBVolumecontrol.getInstance().volumeMute() # with this, we get no mute icon... if not eDVBVolumecontrol.getInstance().isMuted(): globalActionMap.actions["volumeMute"]() text = _("Incoming Call on %s from\n---------------------------------------------\n%s\n%s\n---------------------------------------------") % (date, number, caller) debug("[NcidClient] notifyCall:\n%s" % text) Notifications.AddNotification(MessageBox, text, type=MessageBox.TYPE_INFO, timeout=config.plugins.NcidClient.timeout.value) #Notifications.AddNotification(MessageBoxPixmap, text, number=number, name=caller, timeout=config.plugins.NcidClient.timeout.value) elif config.plugins.NcidClient.afterStandby.value == "inList": # # if not yet done, register function to show call list global standbyMode if not standbyMode : standbyMode = True Standby.inStandby.onHide.append(callList.display) #@UndefinedVariable # add text/timeout to call list callList.add(date, number, caller) debug("[NcidClient] notifyCall: added to callList") else: # this is the "None" case debug("[NcidClient] notifyCall: standby and no show")
def __init__(self, session): global globalActionMap globalActionMap.actions["volumeUp"]=self.volUp globalActionMap.actions["volumeDown"]=self.volDown globalActionMap.actions["volumeMute"]=self.volMute assert not VolumeControl.instance, "only one VolumeControl instance is allowed!" VolumeControl.instance = self config.audio = ConfigSubsection() config.audio.volume = ConfigInteger(default = 100, limits = (0, 100)) self.volumeDialog = session.instantiateDialog(Volume,zPosition=10000) self.volumeDialog.neverAnimate() self.muteDialog = session.instantiateDialog(Mute,zPosition=10000) self.muteDialog.neverAnimate() self.hideVolTimer = eTimer() self.hideVolTimer_conn = self.hideVolTimer.timeout.connect(self.volHide) vol = config.audio.volume.value self.volumeDialog.setValue(vol) self.volctrl = eDVBVolumecontrol.getInstance() self.volctrl.setVolume(vol, vol)
def __init__(self, session, handlePlayback=False): global globalActionMap #fixme #hack self.actionmap = globalActionMap self.session = session self._handlePlayback = handlePlayback self.uri = None self.metadata = {} self.mimetype = None self._state = UPnPMediaRenderer.STATE_IDLE self.onStateChange = [] self.onClose = [] #hack self.__poll_pos_timer = eTimer() self.__poll_pos_timer_conn = self.__poll_pos_timer.timeout.connect(self.updatePosition) self.volctrl = eDVBVolumecontrol.getInstance() # this is not nice if self._handlePlayback: self.__event_tracker = ServiceEventTracker(screen=self, eventmap={ iPlayableService.evEOF: self.__onEOF, })
def getStatusInfo2(session): statusinfo = {} vcontrol = eDVBVolumecontrol.getInstance() statusinfo['volume'] = vcontrol.getVolume() statusinfo['muted'] = vcontrol.isMuted() event = None serviceref = session.nav.getCurrentlyPlayingServiceReference() if serviceref is not None: serviceHandler = eServiceCenter.getInstance() serviceHandlerInfo = serviceHandler.info(serviceref) service = session.nav.getCurrentService() serviceinfo = service and service.info() event = serviceinfo and serviceinfo.getEvent(0) else: event = None if event is not None: curEvent = parseEvent(event) statusinfo['currservice_name'] = curEvent[2].replace('\xc2\x86', '').replace('\xc2\x87', '') statusinfo['currservice_serviceref'] = serviceref.toString() statusinfo['currservice_begin'] = strftime('%H:%M', localtime(int(curEvent[0]) + config.recording.margin_before.value * 60)) statusinfo['currservice_end'] = strftime('%H:%M', localtime(int(curEvent[1]) - config.recording.margin_after.value * 60)) statusinfo['currservice_description'] = curEvent[3] statusinfo['currservice_station'] = serviceHandlerInfo.getName(serviceref).replace('\xc2\x86', '').replace('\xc2\x87', '') else: statusinfo['currservice_name'] = 'N/A' statusinfo['currservice_begin'] = '' statusinfo['currservice_end'] = '' statusinfo['currservice_description'] = '' if serviceref: statusinfo['currservice_serviceref'] = serviceref.toString() statusinfo['currservice_station'] = serviceHandlerInfo.getName(serviceref).replace('\xc2\x86', '').replace('\xc2\x87', '') if inStandby == None: statusinfo['inStandby'] = 'false' else: statusinfo['inStandby'] = 'true' return statusinfo
def getStatusInfo(self): # Get Current Volume and Mute Status vcontrol = eDVBVolumecontrol.getInstance() statusinfo = { 'volume': vcontrol.getVolume(), 'muted': vcontrol.isMuted(), 'transcoding': getTranscodingSupport(), 'currservice_filename': "", 'currservice_id': -1, 'state': { 'standby': False, 'recording': False } } # Get currently running Service event = None serviceref = self.session.nav.getCurrentlyPlayingServiceReference() serviceref_string = None currservice_station = None if serviceref is not None: serviceHandler = eServiceCenter.getInstance() serviceHandlerInfo = serviceHandler.info(serviceref) service = self.session.nav.getCurrentService() serviceinfo = service and service.info() event = serviceinfo and serviceinfo.getEvent(0) serviceref_string = serviceref.toString() currservice_station = mangle_epg_text( serviceHandlerInfo.getName(serviceref)) else: event = None serviceHandlerInfo = None if event is not None: # (begin, end, name, description, eit) curEvent = parseEvent(event) margin_before = config.recording.margin_before.value margin_after = config.recording.margin_after.value begin_timestamp = int(curEvent[0]) + (margin_before * 60) end_timestamp = int(curEvent[1]) - (margin_after * 60) statusinfo['currservice_name'] = mangle_epg_text(curEvent[2]) statusinfo['currservice_serviceref'] = serviceref_string statusinfo['currservice_begin'] = time.strftime( "%H:%M", (time.localtime(begin_timestamp))) statusinfo['currservice_begin_timestamp'] = begin_timestamp statusinfo['currservice_end'] = time.strftime( "%H:%M", (time.localtime(end_timestamp))) statusinfo['currservice_end_timestamp'] = end_timestamp statusinfo['currservice_description'] = curEvent[3] statusinfo['currservice_station'] = currservice_station if statusinfo['currservice_serviceref'].startswith('1:0:0'): fn = '/' + '/'.join(serviceref_string.split("/")[1:]) statusinfo['currservice_filename'] = fn statusinfo['currservice_fulldescription'] = mangle_epg_text( event.getExtendedDescription()) statusinfo['currservice_id'] = curEvent[4] else: statusinfo['currservice_name'] = "N/A" statusinfo['currservice_begin'] = "" statusinfo['currservice_end'] = "" statusinfo['currservice_description'] = "" statusinfo['currservice_fulldescription'] = "N/A" if serviceref: statusinfo['currservice_serviceref'] = serviceref_string if serviceHandlerInfo: statusinfo['currservice_station'] = currservice_station elif serviceref_string.find("http") != -1: statusinfo['currservice_station'] = serviceref_string.replace( '%3a', ':')[serviceref_string.find("http"):] else: statusinfo['currservice_station'] = "N/A" # Get Standby State from Screens.Standby import inStandby statusinfo['state']['standby'] = inStandby is not None if statusinfo['state']['standby'] is False: statusinfo['inStandby'] = "false" else: statusinfo['inStandby'] = "true" # Get recording state recs = NavigationInstance.instance.getRecordings() statusinfo['state']['recording'] = len(recs) > 0 if recs: statusinfo['Recording_list'] = "\n" for timer in NavigationInstance.instance.RecordTimer.timer_list: if timer.state == TimerEntry.StateRunning: if not timer.justplay: s_name = timer.service_ref.getServiceName() label = mangle_epg_text(s_name) + ": " + timer.name + "\n" statusinfo['Recording_list'] += label if statusinfo['state']['recording']: statusinfo['isRecording'] = "true" else: statusinfo['isRecording'] = "false" return statusinfo
def changed(self, what): if not self.suspended: value = str(eDVBVolumecontrol.getInstance().getVolume()) self.instance.setPixmapFromFile( '/usr/share/enigma2/4HDF_2_2_speedy_mod/volume/img/volume/' + value + '.png')
def setMute(self): self.wasMuted = eDVBVolumecontrol.getInstance().isMuted() if not self.wasMuted: eDVBVolumecontrol.getInstance().volumeMute()
def __init__(self): self.volctrl = eDVBVolumecontrol.getInstance() self.hideVolTimer = eTimer() self.hideVolTimer_conn = self.hideVolTimer.timeout.connect( self.volHide)
def changed(self, what): if not self.suspended: value = str(eDVBVolumecontrol.getInstance().getVolume()) self.instance.setPixmapFromFile('/usr/share/enigma2/DarknessFHD/volume/' + value + '.png')
def changed(self, what=""): if self.start: self.text = str(eDVBVolumecontrol.getInstance().getVolume()) + "%"
def __init__(self): self.volctrl = eDVBVolumecontrol.getInstance() self.hideVolTimer = eTimer() self.hideVolTimer.callback.append(self.volHide)
def leaveMute(self): if not self.wasMuted: eDVBVolumecontrol.getInstance().openMixerOnMute() # fix for vuplus eDVBVolumecontrol.getInstance().volumeUnMute()
def getStatusInfo(self): statusinfo = {} # Get Current Volume and Mute Status vcontrol = eDVBVolumecontrol.getInstance() statusinfo['volume'] = vcontrol.getVolume() statusinfo['muted'] = vcontrol.isMuted() # Get currently running Service event = None serviceref = self.session.nav.getCurrentlyPlayingServiceReference() if serviceref is not None: serviceHandler = eServiceCenter.getInstance() serviceHandlerInfo = serviceHandler.info(serviceref) service = self.session.nav.getCurrentService() serviceinfo = service and service.info() event = serviceinfo and serviceinfo.getEvent(0) else: event = None if event is not None: curEvent = parseEvent(event) statusinfo['currservice_name'] = curEvent[2].replace( '\xc2\x86', '').replace('\xc2\x87', '') statusinfo['currservice_serviceref'] = serviceref.toString() statusinfo['currservice_begin'] = strftime("%H:%M", (localtime( int(curEvent[0]) + (config.recording.margin_before.value * 60)))) statusinfo['currservice_end'] = strftime("%H:%M", (localtime( int(curEvent[1]) - (config.recording.margin_after.value * 60)))) statusinfo['currservice_description'] = curEvent[3] if len(curEvent[3].decode('utf-8')) > 220: statusinfo['currservice_description'] = curEvent[3].decode( 'utf-8')[0:220].encode('utf-8') + "..." statusinfo['currservice_station'] = serviceHandlerInfo.getName( serviceref).replace('\xc2\x86', '').replace('\xc2\x87', '') else: statusinfo['currservice_name'] = "N/A" statusinfo['currservice_begin'] = "" statusinfo['currservice_end'] = "" statusinfo['currservice_description'] = "" if serviceref: statusinfo['currservice_serviceref'] = serviceref.toString() statusinfo['currservice_station'] = serviceHandlerInfo.getName( serviceref).replace('\xc2\x86', '').replace('\xc2\x87', '') # Get Standby State from Screens.Standby import inStandby if inStandby == None: statusinfo['inStandby'] = "false" else: statusinfo['inStandby'] = "true" # Get recording state recs = NavigationInstance.instance.getRecordings() if recs: statusinfo['isRecording'] = "true" else: statusinfo['isRecording'] = "false" return statusinfo
def getStatusInfo(self): statusinfo = {} # Get Current Volume and Mute Status vcontrol = eDVBVolumecontrol.getInstance() statusinfo['volume'] = vcontrol.getVolume() statusinfo['muted'] = vcontrol.isMuted() statusinfo['transcoding'] = getTranscodingSupport() # Get currently running Service event = None serviceref = self.session.nav.getCurrentlyPlayingServiceReference() if serviceref is not None: serviceHandler = eServiceCenter.getInstance() serviceHandlerInfo = serviceHandler.info(serviceref) service = self.session.nav.getCurrentService() serviceinfo = service and service.info() event = serviceinfo and serviceinfo.getEvent(0) else: event = None statusinfo['currservice_filename'] = "" if event is not None: curEvent = parseEvent(event) statusinfo['currservice_name'] = curEvent[2].replace( '\xc2\x86', '').replace('\xc2\x87', '') statusinfo['currservice_serviceref'] = serviceref.toString() statusinfo['currservice_begin'] = strftime("%H:%M", (localtime( int(curEvent[0]) + (config.recording.margin_before.value * 60)))) statusinfo['currservice_end'] = strftime("%H:%M", (localtime( int(curEvent[1]) - (config.recording.margin_after.value * 60)))) statusinfo['currservice_description'] = curEvent[3] if len(curEvent[3].decode('utf-8')) > 220: statusinfo['currservice_description'] = curEvent[3].decode( 'utf-8')[0:220].encode('utf-8') + "..." statusinfo['currservice_station'] = serviceHandlerInfo.getName( serviceref).replace('\xc2\x86', '').replace('\xc2\x87', '') if statusinfo['currservice_serviceref'].startswith('1:0:0'): statusinfo['currservice_filename'] = '/' + '/'.join( serviceref.toString().split("/")[1:]) full_desc = statusinfo['currservice_name'] + '\n' full_desc += statusinfo['currservice_begin'] + " - " + statusinfo[ 'currservice_end'] + '\n\n' full_desc += event.getExtendedDescription().replace( '\xc2\x86', '').replace('\xc2\x87', '').replace('\xc2\x8a', '\n') statusinfo['currservice_fulldescription'] = full_desc else: statusinfo['currservice_name'] = "N/A" statusinfo['currservice_begin'] = "" statusinfo['currservice_end'] = "" statusinfo['currservice_description'] = "" statusinfo['currservice_fulldescription'] = "N/A" if serviceref: statusinfo['currservice_serviceref'] = serviceref.toString() if serviceHandlerInfo: statusinfo['currservice_station'] = serviceHandlerInfo.getName( serviceref).replace('\xc2\x86', '').replace('\xc2\x87', '') elif serviceref.toString().find("http") != -1: statusinfo['currservice_station'] = serviceref.toString( ).replace('%3a', ':')[serviceref.toString().find("http"):] else: statusinfo['currservice_station'] = "N/A" # Get Standby State from Screens.Standby import inStandby if inStandby == None: statusinfo['inStandby'] = "false" else: statusinfo['inStandby'] = "true" # Get recording state recs = NavigationInstance.instance.getRecordings() if recs: statusinfo['isRecording'] = "true" statusinfo['Recording_list'] = "\n" for timer in NavigationInstance.instance.RecordTimer.timer_list: if timer.state == TimerEntry.StateRunning: if not timer.justplay: statusinfo[ 'Recording_list'] += timer.service_ref.getServiceName( ).replace('\xc2\x86', '').replace( '\xc2\x87', '') + ": " + timer.name + "\n" else: statusinfo['isRecording'] = "false" return statusinfo
def leaveMute(self): if self.wasMuted == 0: eDVBVolumecontrol.getInstance().volumeToggleMute()
def changed(self, what): if not self.suspended: self.text = str(eDVBVolumecontrol.getInstance().getVolume())
def leaveMute(self): if self.wasMuted == 0: eDVBVolumecontrol.getInstance().openMixerOnMute() # fix for vuplus eDVBVolumecontrol.getInstance().volumeToggleMute()
def setVolumeStepsize(configElement): eDVBVolumecontrol.getInstance().setVolumeSteps(int( configElement.value))
def getStatusInfo(self): # Get Current Volume and Mute Status vcontrol = eDVBVolumecontrol.getInstance() statusinfo = { 'volume': vcontrol.getVolume(), 'muted': vcontrol.isMuted(), 'transcoding': TRANSCODING, 'currservice_filename': "", 'currservice_id': -1, } # Get currently running Service event = None serviceref = NavigationInstance.instance.getCurrentlyPlayingServiceReference( ) serviceref_string = None currservice_station = None if serviceref is not None: serviceHandler = eServiceCenter.getInstance() serviceHandlerInfo = serviceHandler.info(serviceref) service = NavigationInstance.instance.getCurrentService() serviceinfo = service and service.info() event = serviceinfo and serviceinfo.getEvent(0) serviceref_string = serviceref.toString() currservice_station = removeBad(serviceHandlerInfo.getName(serviceref)) else: event = None serviceHandlerInfo = None if event is not None: # (begin, end, name, description, eit) curEvent = parseEvent(event) begin_timestamp = int( curEvent[0]) + (config.recording.margin_before.value * 60) end_timestamp = int( curEvent[1]) - (config.recording.margin_after.value * 60) statusinfo['currservice_name'] = removeBad(curEvent[2]) statusinfo['currservice_serviceref'] = serviceref_string statusinfo['currservice_begin'] = time.strftime( "%H:%M", (time.localtime(begin_timestamp))) statusinfo['currservice_begin_timestamp'] = begin_timestamp statusinfo['currservice_end'] = time.strftime( "%H:%M", (time.localtime(end_timestamp))) statusinfo['currservice_end_timestamp'] = end_timestamp desc = curEvent[3] if six.PY2: desc = desc.decode('utf-8') if len(desc) > 220: desc = desc + u"..." if six.PY2: desc = desc.encode('utf-8') statusinfo['currservice_description'] = desc statusinfo['currservice_station'] = currservice_station if statusinfo['currservice_serviceref'].startswith('1:0:0'): statusinfo['currservice_filename'] = '/' + '/'.join( serviceref_string.split("/")[1:]) full_desc = statusinfo['currservice_name'] + '\n' full_desc += statusinfo['currservice_begin'] + " - " + statusinfo[ 'currservice_end'] + '\n\n' full_desc += removeBad2(event.getExtendedDescription()) statusinfo['currservice_fulldescription'] = full_desc statusinfo['currservice_id'] = curEvent[4] else: statusinfo['currservice_name'] = "N/A" statusinfo['currservice_begin'] = "" statusinfo['currservice_end'] = "" statusinfo['currservice_description'] = "" statusinfo['currservice_fulldescription'] = "N/A" if serviceref: statusinfo['currservice_serviceref'] = serviceref_string if statusinfo['currservice_serviceref'].startswith( '1:0:0' ) or statusinfo['currservice_serviceref'].startswith('4097:0:0'): this_path = '/' + '/'.join(serviceref_string.split("/")[1:]) if os.path.exists(this_path): statusinfo['currservice_filename'] = this_path if serviceHandlerInfo: statusinfo['currservice_station'] = currservice_station elif serviceref_string.find("http") != -1: statusinfo['currservice_station'] = serviceref_string.replace( '%3a', ':')[serviceref_string.find("http"):] else: statusinfo['currservice_station'] = "N/A" # Get Standby State from Screens.Standby import inStandby if inStandby is None: statusinfo['inStandby'] = "false" else: statusinfo['inStandby'] = "true" # Get recording state recs = NavigationInstance.instance.getRecordings() if recs: statusinfo['isRecording'] = "true" statusinfo['Recording_list'] = "\n" for timer in NavigationInstance.instance.RecordTimer.timer_list: if timer.state == TimerEntry.StateRunning: if not timer.justplay: statusinfo['Recording_list'] += removeBad( timer.service_ref.getServiceName( )) + ": " + timer.name + "\n" if statusinfo['Recording_list'] == "\n": statusinfo['isRecording'] = "false" else: statusinfo['isRecording'] = "false" # Get streaminfo streams = GetStreamInfo() Streaming_list = [] try: # TODO move this code to javascript getStatusinfo for stream in streams: st = '' s = stream["name"] e = stream["eventname"] i = stream["ip"] del stream if i is not None: st += i + ": " st += s + ' - ' + e if st != '': Streaming_list.append(st) except Exception as error: # nosec # noqa: E722 # print("[OpenWebif] -D- build Streaming_list %s" % error) pass if len(streams) > 0: statusinfo['Streaming_list'] = '\n'.join(Streaming_list) statusinfo['isStreaming'] = 'true' else: statusinfo['Streaming_list'] = '' statusinfo['isStreaming'] = 'false' return statusinfo
def leaveMute(self): if not self.wasMuted: eDVBVolumecontrol.getInstance().volumeUnMute()
def setVolume(self, volume): vol = eDVBVolumecontrol.getInstance() vol.setVolume(volume)
def getStatusInfo(self): # Get Current Volume and Mute Status vcontrol = eDVBVolumecontrol.getInstance() statusinfo = { 'volume': vcontrol.getVolume(), 'muted': vcontrol.isMuted(), 'transcoding': TRANSCODING, 'currservice_filename': "", 'currservice_id': -1, } # Get currently running Service event = None serviceref = self.session.nav.getCurrentlyPlayingServiceReference() serviceref_string = None currservice_station = None if serviceref is not None: serviceHandler = eServiceCenter.getInstance() serviceHandlerInfo = serviceHandler.info(serviceref) service = self.session.nav.getCurrentService() serviceinfo = service and service.info() event = serviceinfo and serviceinfo.getEvent(0) serviceref_string = serviceref.toString() currservice_station = serviceHandlerInfo.getName( serviceref).replace('\xc2\x86', '').replace('\xc2\x87', '') else: event = None serviceHandlerInfo = None if event is not None: # (begin, end, name, description, eit) curEvent = parseEvent(event) begin_timestamp = int(curEvent[0]) + (config.recording.margin_before.value * 60) end_timestamp = int(curEvent[1]) - (config.recording.margin_after.value * 60) statusinfo['currservice_name'] = curEvent[2].replace('\xc2\x86', '').replace('\xc2\x87', '') statusinfo['currservice_serviceref'] = serviceref_string statusinfo['currservice_begin'] = time.strftime("%H:%M", (time.localtime(begin_timestamp))) statusinfo['currservice_begin_timestamp'] = begin_timestamp statusinfo['currservice_end'] = time.strftime("%H:%M", (time.localtime(end_timestamp))) statusinfo['currservice_end_timestamp'] = end_timestamp statusinfo['currservice_description'] = curEvent[3] if len(curEvent[3].decode('utf-8')) > 220: statusinfo['currservice_description'] = curEvent[3].decode('utf-8')[0:220].encode('utf-8') + "..." statusinfo['currservice_station'] = currservice_station if statusinfo['currservice_serviceref'].startswith('1:0:0'): statusinfo['currservice_filename'] = '/' + '/'.join(serviceref_string.split("/")[1:]) full_desc = statusinfo['currservice_name'] + '\n' full_desc += statusinfo['currservice_begin'] + " - " + statusinfo['currservice_end'] + '\n\n' full_desc += event.getExtendedDescription().replace('\xc2\x86', '').replace('\xc2\x87', '').replace('\xc2\x8a', '\n') statusinfo['currservice_fulldescription'] = full_desc statusinfo['currservice_id'] = curEvent[4] else: statusinfo['currservice_name'] = "N/A" statusinfo['currservice_begin'] = "" statusinfo['currservice_end'] = "" statusinfo['currservice_description'] = "" statusinfo['currservice_fulldescription'] = "N/A" if serviceref: statusinfo['currservice_serviceref'] = serviceref_string if statusinfo['currservice_serviceref'].startswith('1:0:0') or statusinfo['currservice_serviceref'].startswith('4097:0:0'): this_path = '/' + '/'.join(serviceref_string.split("/")[1:]) if os.path.exists(this_path): statusinfo['currservice_filename'] = this_path if serviceHandlerInfo: statusinfo['currservice_station'] = currservice_station elif serviceref_string.find("http") != -1: statusinfo['currservice_station'] = serviceref_string.replace('%3a', ':')[serviceref_string.find("http"):] else: statusinfo['currservice_station'] = "N/A" # Get Standby State from Screens.Standby import inStandby if inStandby is None: statusinfo['inStandby'] = "false" else: statusinfo['inStandby'] = "true" # Get recording state recs = NavigationInstance.instance.getRecordings() if recs: statusinfo['isRecording'] = "true" statusinfo['Recording_list'] = "\n" for timer in NavigationInstance.instance.RecordTimer.timer_list: if timer.state == TimerEntry.StateRunning: if not timer.justplay: statusinfo['Recording_list'] += timer.service_ref.getServiceName().replace('\xc2\x86', '').replace('\xc2\x87', '') + ": " + timer.name + "\n" if statusinfo['Recording_list'] == "\n": statusinfo['isRecording'] = "false" else: statusinfo['isRecording'] = "false" return statusinfo