Exemplo n.º 1
0
	def onEvent(self, mask):
		self.mask = mask
		self.tuners = []
		
		bit = 1;
		for tunernumber in range(8):
			#print "IBTS UNKNOWN ", tunernumber, bit, bool(mask & bit)
			if bool(mask & bit):
				#print "IBTS UNKNOWN append tuner", tunernumber
				self.tuners.append(tunernumber)
			bit = bit << 1
		
		# Remove live tuner
		if self.tuners:
			from NavigationInstance import instance
			iplayableservice = instance and instance.getCurrentService()
			if iplayableservice:
				tuner, tunertype, tunernumber = getTunerByPlayableService(iplayableservice)
				#print "IBTS UNKNOWN live tuner", tunernumber
				if tunernumber in self.tuners:
					#print "IBTS UNKNOWN remove tuner", tunernumber
					self.tuners.remove(tunernumber)
				else:
					del self.tuners[-1]
		
		if config.infobartunerstate.show_events.value:
			from Plugins.Extensions.InfoBarTunerState.plugin import gInfoBarTunerState
			if gInfoBarTunerState:
				gInfoBarTunerState.onEvent()
Exemplo n.º 2
0
    def onEvent(self, mask):
        self.mask = mask
        self.tuners = []

        bit = 1
        for tunernumber in range(8):
            #print "IBTS UNKNOWN ", tunernumber, bit, bool(mask & bit)
            if bool(mask & bit):
                #print "IBTS UNKNOWN append tuner", tunernumber
                self.tuners.append(tunernumber)
            bit = bit << 1

        # Remove live tuner
        if self.tuners:
            from NavigationInstance import instance
            iplayableservice = instance and instance.getCurrentService()
            if iplayableservice:
                tuner, tunertype, tunernumber = getTunerByPlayableService(
                    iplayableservice)
                #print "IBTS UNKNOWN live tuner", tunernumber
                if tunernumber in self.tuners:
                    #print "IBTS UNKNOWN remove tuner", tunernumber
                    self.tuners.remove(tunernumber)
                else:
                    del self.tuners[-1]

        if config.infobartunerstate.show_events.value:
            from Plugins.Extensions.InfoBarTunerState.plugin import gInfoBarTunerState
            if gInfoBarTunerState:
                gInfoBarTunerState.onEvent()
Exemplo n.º 3
0
    def onEvent(self, ev):
        #log.debug( "IBTS Live onEvent ev", ev, str(self.tunerstate) )
        if ev == iPlayableService.evUpdatedEventInfo or ev == iPlayableService.evUpdatedInfo:

            if self.tunerstate:
                tunerstate = self.tunerstate

                from NavigationInstance import instance
                if instance:

                    changed = False

                    eservicereference = instance.getCurrentlyPlayingServiceReference(
                    )
                    eservicereference_string = str(eservicereference)

                    # Avoid recalculations
                    if self.eservicereference_string != eservicereference_string:
                        tunerstate.number = None
                        tunerstate.channel = ""

                        tunerstate.tuner, tunerstate.tunertype, tunerstate.tunernumber = "", "", None
                        tunerstate.name, tunerstate.begin, tunerstate.end = "", 0, 0

                        self.eservicereference_string = eservicereference_string

                    if not tunerstate.number:
                        tunerstate.number = getNumber(eservicereference)
                        changed = True
                    if not tunerstate.channel:
                        tunerstate.channel = getChannel(eservicereference)
                        changed = True
                    if not tunerstate.reference:
                        tunerstate.reference = eservicereference_string
                        changed = True

                    iplayableservice = instance.getCurrentService()

                    if not tunerstate.tuner or not tunerstate.tunertype or not tunerstate.tunernumber:
                        tunerstate.tuner, tunerstate.tunertype, tunerstate.tunernumber = getTunerByPlayableService(
                            iplayableservice)
                        changed = True

                    if not tunerstate.name or not tunerstate.begin or not tunerstate.end:
                        tunerstate.name, tunerstate.begin, tunerstate.end = getEventData(
                            iplayableservice)
                        changed = True

                    if changed:
                        from Plugins.Extensions.InfoBarTunerState.plugin import gInfoBarTunerState
                        if gInfoBarTunerState:
                            gInfoBarTunerState.updateMetrics()

            from Plugins.Extensions.InfoBarTunerState.plugin import gInfoBarTunerState
            if gInfoBarTunerState:
                gInfoBarTunerState.onEvent()
Exemplo n.º 4
0
    def onEvent(self, ev):
        # print "IBTS Live onEvent ev", ev, str(self.tunerstate)
        if ev == iPlayableService.evUpdatedEventInfo or ev == iPlayableService.evUpdatedInfo:

            if self.tunerstate:
                tunerstate = self.tunerstate

                from NavigationInstance import instance

                if instance:

                    changed = False

                    eservicereference = instance.getCurrentlyPlayingServiceReference()
                    eservicereference_string = str(eservicereference)

                    # Avoid recalculations
                    if self.eservicereference_string != eservicereference_string:
                        tunerstate.number = None
                        tunerstate.channel = ""

                        tunerstate.tuner, tunerstate.tunertype, tunerstate.tunernumber = "", "", None
                        tunerstate.name, tunerstate.begin, tunerstate.end = "", 0, 0

                        self.eservicereference_string = eservicereference_string

                    if not tunerstate.number:
                        tunerstate.number = getNumber(eservicereference)
                        changed = True
                    if not tunerstate.channel:
                        tunerstate.channel = getChannel(eservicereference)
                        changed = True

                    iplayableservice = instance.getCurrentService()

                    if not tunerstate.tuner or not tunerstate.tunertype or not tunerstate.tunernumber:
                        tunerstate.tuner, tunerstate.tunertype, tunerstate.tunernumber = getTunerByPlayableService(
                            iplayableservice
                        )
                        changed = True

                    if not tunerstate.name or not tunerstate.begin or not tunerstate.end:
                        tunerstate.name, tunerstate.begin, tunerstate.end = getEventData(iplayableservice)
                        changed = True

                    if changed:
                        from Plugins.Extensions.InfoBarTunerState.plugin import gInfoBarTunerState

                        gInfoBarTunerState.updateMetrics()