Exemple #1
0
	def writeName(self):
		if config.plugins.vfdicon.displayshow.value != "date" and config.plugins.vfdicon.displayshow.value != "day_date":
			servicename = "    "
			if config.plugins.vfdicon.displayshow.value != "nothing":
				service = self.session.nav.getCurrentlyPlayingServiceOrGroup()
				if service:
					path = service.getPath()
					if path:
						self.play = True
						servicename = "PLAY"
						currPlay = self.session.nav.getCurrentService()
						if currPlay != None and self.mp3Available: # show the MP3 tag
							servicename = currPlay.info().getInfoString(iServiceInformation.sTagTitle) + " - " + currPlay.info().getInfoString(iServiceInformation.sTagArtist)
						else: # show the file name
							self.service = self.session.nav.getCurrentlyPlayingServiceReference()
							if not self.service is None:
								service = self.service.toCompareString()
								servicename = ServiceReference(service).getServiceName().replace('\xc2\x87', '').replace('\xc2\x86', '').ljust(16)
					else:
						if config.plugins.vfdicon.displayshow.value == "channel number": #show the channel number
							servicename = str(service.getChannelNum())
							if len(servicename) == 1:
								servicename = '000' + servicename
							elif len(servicename) == 2:
								servicename = '00' + servicename
							elif len(servicename) == 3:
								servicename = '0' + servicename
						elif config.plugins.vfdicon.displayshow.value == "channel namenumber": #show the channel number & name
							servicename = str(service.getChannelNum()) + ' ' + ServiceReference(service).getServiceName()
						else:
							servicename = ServiceReference(service).getServiceName() #show the channel name
			if config.plugins.vfdicon.uppercase.value == True:
				servicename = servicename.upper()
			servicename = servicename.replace('  ', ' ')
			evfd.getInstance().vfd_write_string(servicename[0:63])
Exemple #2
0
    def UpdInfo(self):
        #react only when there is a change in service or service event and there are apropriate settings in configuration
        if config.plugins.OSD3DSetup.auto.value and self.session.nav.getCurrentlyPlayingServiceReference(
        ):
            CurrentService = self.session.nav.getCurrentService()
            Service = self.session.nav.getCurrentlyPlayingServiceReference()
            #check if there is a file being played
            if Service.getPath():
                import os
                ServiceName = os.path.basename(Service.getPath())
                extension = ServiceName.split('.')
                extension = extension[-1].lower()
                if not EXTENSIONS.has_key(extension):
                    ServiceName = ""
            #or a channel...
            else:
                ServiceName = ""
                ServiceName = ServiceReference(
                    CurrentService.info().getInfoString(
                        iServiceInformation.sServiceref)).getServiceName()
                hwnd = eServiceCenter.getInstance()
                ServRef = eServiceReference(
                    CurrentService.info().getInfoString(
                        iServiceInformation.sServiceref))
                info = hwnd.info(ServRef)
                if info:
                    evt = info.getEvent(ServRef)
                    if evt:
                        ServiceName = ServiceName + " " + evt.getEventName()

                #self.session.open(MessageBox,_(ServiceName), type = MessageBox.TYPE_INFO, timeout = 5)

            if AutoToggle3D.OldServiceName != ServiceName:
                AutoToggle3D.OldServiceName = ServiceName
                #NewMode = self.CurrentMode
                # - if it contains "3D" string, switch 3D mode on
                if ServiceName.upper().count("3D") > 0:
                    if config.plugins.OSD3DSetup.prompt.value > 0:
                        NewMode = nz(config.plugins.OSD3DSetup.toggle.value,
                                     val_auto)
                        if self.CurrentMode != NewMode and self.Confirming == False:
                            self.Confirming = True
                            self.session.openWithCallback(
                                self.setNewMode, InfoAuto3D, NewMode,
                                self.Confirming)
                    else:
                        if config.plugins.OSD3DSetup.toggle.value:
                            NewMode = config.plugins.OSD3DSetup.toggle.value
                        else:
                            NewMode = val_sidebyside
                else:
                    NewMode = val_auto
                self.setNewMode([NewMode, self.Confirming])
Exemple #3
0
	def writeName(self):
		if (config.plugins.vfdicon.displayshow.value != "date" and config.plugins.vfdicon.displayshow.value != "day_date"
			and config.plugins.vfdicon.displayshow.value != "time_date" and config.plugins.vfdicon.displayshow.value != "time"):
			servicename = "        "
			if config.plugins.vfdicon.displayshow.value != "nothing":
				service = self.session.nav.getCurrentlyPlayingServiceOrGroup()
				if service:
					path = service.getPath()
					if path:
						self.play = True
						servicename = "Play"
						currPlay = self.session.nav.getCurrentService()
						if currPlay != None and self.mp3Available: # show the MP3 tag
							servicename = currPlay.info().getInfoString(iServiceInformation.sTagTitle) + " - " + currPlay.info().getInfoString(iServiceInformation.sTagArtist)
							Console().ePopen("fp_control -i 27 0 -i 29 0 -i 31 0 -i 32 0 -i 38 0 -i 39 1") #Radio icon on, TV off
						else: # show the file name
							Console().ePopen("fp_control -i 38 1 -i 39 0") #Radio icon off, TV on
							self.service = self.session.nav.getCurrentlyPlayingServiceReference()
							if not self.service is None:
								service = self.service.toCompareString()
#								servicename = ServiceReference(service).getServiceName().replace('\xc2\x87', '').replace('\xc2\x86', '').ljust(63)
								servicename = ServiceReference(service).getServiceName().replace('\xc2\x87', '').replace('\xc2\x86', '')
						Console().ePopen("fp_control -i 15 1 -i 16 1 -i 25 1") #play, file
					else:
						if config.plugins.vfdicon.displayshow.value == "channel number": #show the channel number
							servicename = str(service.getChannelNum())
							if len(servicename) == 1:
								servicename = '000' + servicename
							elif len(servicename) == 2:
								servicename = '00' + servicename
							elif len(servicename) == 3:
								servicename = '0' + servicename
						elif config.plugins.vfdicon.displayshow.value == "channel namenumber": #show the channel number & name
							servicename = str(service.getChannelNum()) + ' ' + ServiceReference(service).getServiceName()
						else:
							servicename = ServiceReference(service).getServiceName() #show the channel name
						self.play = False
						Console().ePopen("fp_control -i 15 0 -i 16 0 -i 25 0") #play, file off
						#evaluate radio or tv
						if config.plugins.vfdicon.showicons.value == "all":
							if config.servicelist.lastmode.value == 'tv':
								Console().ePopen("fp_control -i 38 1 -i 39 0") #TV icon on, Radio off
							else:
								Console().ePopen("fp_control -i 27 0 -i 29 0 -i 31 0 -i 32 0 -i 38 0 -i 39 1") #Radio icon on, TV off
			if config.plugins.vfdicon.uppercase.value == True:
				servicename = servicename.upper()
			servicename = servicename.replace('  ', ' ')
			evfd.getInstance().vfd_write_string(servicename[0:63])
Exemple #4
0
	def UpdInfo(self):
		#react only when there is a change in service or service event and there are apropriate settings in configuration
		if config.plugins.OSD3DSetup.auto.value and self.session.nav.getCurrentlyPlayingServiceReference():
			CurrentService = self.session.nav.getCurrentService()
			Service = self.session.nav.getCurrentlyPlayingServiceReference()
			#check if there is a file being played
			if Service.getPath():
				import os
				ServiceName = os.path.basename(Service.getPath())
				extension = ServiceName.split('.')
				extension = extension[-1].lower()
				if not EXTENSIONS.has_key(extension):
					ServiceName = ""
			#or a channel...
			else:
				ServiceName = ""
				ServiceName = ServiceReference(CurrentService.info().getInfoString(iServiceInformation.sServiceref)).getServiceName()
				hwnd = eServiceCenter.getInstance()
				ServRef = eServiceReference(CurrentService.info().getInfoString(iServiceInformation.sServiceref))
				info = hwnd.info(ServRef)
				if info:
					evt = info.getEvent(ServRef)
					if evt: ServiceName = ServiceName + " " + evt.getEventName()

				#self.session.open(MessageBox,_(ServiceName), type = MessageBox.TYPE_INFO, timeout = 5)

			if AutoToggle3D.OldServiceName != ServiceName:
				AutoToggle3D.OldServiceName = ServiceName
				#NewMode = self.CurrentMode
				# - if it contains "3D" string, switch 3D mode on
				if ServiceName.upper().count("3D") > 0:
					if config.plugins.OSD3DSetup.prompt.value > 0:
						NewMode = nz(config.plugins.OSD3DSetup.toggle.value, val_auto)
						if self.CurrentMode != NewMode and self.Confirming == False:
							self.Confirming = True
							self.session.openWithCallback(self.setNewMode, InfoAuto3D, NewMode, self.Confirming)
					else:
						if config.plugins.OSD3DSetup.toggle.value:
							NewMode = config.plugins.OSD3DSetup.toggle.value
						else:
							NewMode = val_sidebyside
				else:
					NewMode = val_auto
				self.setNewMode([NewMode, self.Confirming])
Exemple #5
0
 def writeName(self):
     displayshow = config.plugins.vfdicon.displayshow.value
     if displayshow != "time" and displayshow != "date" and displayshow != "day_date":
         servicename = "        "
         if displayshow != "nothing":
             service = self.session.nav.getCurrentlyPlayingServiceOrGroup()
             if service:
                 path = service.getPath()
                 if path:
                     self.play = True
                     servicename = "PLAY"
                     currPlay = self.session.nav.getCurrentService()
                     if currPlay != None and self.mp3Available:  # show the MP3 tag
                         servicename = currPlay.info().getInfoString(
                             iServiceInformation.sTagTitle
                         ) + " - " + currPlay.info().getInfoString(
                             iServiceInformation.sTagArtist)
                         if DisplayType == 8:
                             Console().ePopen("fp_control -i 28 1 -i 27 0"
                                              )  #Radio icon on, TV off
                     else:  # show the file name
                         self.service = self.session.nav.getCurrentlyPlayingServiceReference(
                         )
                         if not self.service is None:
                             service = self.service.toCompareString()
                             servicename = ServiceReference(
                                 service).getServiceName().replace(
                                     '\xc2\x87',
                                     '').replace('\xc2\x86', '').ljust(16)
                         if DisplayType == 8:
                             Console().ePopen("fp_control -i 27 1 -i 28 0"
                                              )  #TV icon on, Radio off
                     if DisplayType == 8:
                         Console().ePopen("fp_control -i 3 1")  #play
                         if config.plugins.vfdicon.hddicons.value == "no":
                             self.displayHddUsedOff(
                             )  #switch off signal strength
                 else:
                     if displayshow == "channel_number" or displayshow == "channel_namenumber":
                         servicename = str(service.getChannelNum())
                         if len(servicename) == 1:
                             servicename = '000' + servicename
                         elif len(servicename) == 2:
                             servicename = '00' + servicename
                         elif len(servicename) == 3:
                             servicename = '0' + servicename
                     if displayshow == "channel_namenumber":
                         servicename = servicename + ' ' + ServiceReference(
                             service).getServiceName()
                     if displayshow == "channel":
                         servicename = ServiceReference(
                             service).getServiceName()
                     if DisplayType == 8:
                         Console().ePopen("fp_control -i 3 0")  #play
                         self.play = False
                         #evaluate radio or tv
                         if config.plugins.vfdicon.showicons.value == "all":
                             if config.servicelist.lastmode.value == 'tv':
                                 Console().ePopen(
                                     "fp_control -i 27 1 -i 28 0"
                                 )  #TV icon on, Radio off
                             else:
                                 Console().ePopen(
                                     "fp_control -i 28 1 -i 27 0"
                                 )  #Radio icon on, TV off
         if config.plugins.vfdicon.uppercase.value is not None:
             servicename = servicename.upper()
         evfd.getInstance().vfd_write_string(servicename[0:63])