def update(self, id, tunerstate):
		
		stream = getStream( id )
		if stream:
		
			eservicereference = stream.getRecordServiceRef()
			
			del stream
			
			tunerstate.name = getEventName(eservicereference)
			
			if not tunerstate.number:
				tunerstate.number = getNumber(eservicereference)
			if not tunerstate.channel:
				tunerstate.channel = getChannel(eservicereference)
			if tunerstate.reference != str(ServiceReference(eservicereference)):
				tunerstate.reference = str(ServiceReference(eservicereference))
				print "=== IBTS update Stream reference:", tunerstate.reference
				tunerstate.updatePicon()

			return True
			
		else:
			
			# Stream is not active anymore				
			return None
    def update(self, id, tunerstate):

        stream = getStream(id)
        if stream:

            eservicereference = stream.getRecordServiceRef()

            del stream

            tunerstate.name = getEventName(eservicereference)

            if not tunerstate.number:
                tunerstate.number = getNumber(eservicereference)
            if not tunerstate.channel:
                tunerstate.channel = getChannel(eservicereference)
            if tunerstate.reference != str(
                    ServiceReference(eservicereference)):
                tunerstate.reference = str(ServiceReference(eservicereference))
                print "=== IBTS update Stream reference:", tunerstate.reference
                tunerstate.updatePicon()

            return True

        else:

            # Stream is not active anymore
            return None
Example #3
0
    def onEventParametersChanged(self, params):
        try:
            if self.ids:
                id, ip, servicereference_string = self.ids[-1]
                print "IBTS Stream Event StreamServer Changed " + id

                if servicereference_string is None:

                    servicereference_string = str(
                        params.get(streamServerControl.URI_PARAM_REF, [""])[0])

                    self.ids[-1] = (id, ip, servicereference_string)

                    if servicereference_string:

                        eservicereference = eServiceReference(
                            servicereference_string)
                        if eservicereference and eservicereference.valid():

                            service_ref = ServiceReference(
                                servicereference_string)

                            tuner, tunertype, tunernumber = getTunerByServiceReference(
                                service_ref)

                            name = getEventName(eservicereference)

                            number = getNumber(eservicereference)
                            channel = getChannel(eservicereference)
                            name = getEventName(eservicereference)

                            client = getClient(ip)

                            from Plugins.Extensions.InfoBarTunerState.plugin import gInfoBarTunerState
                            if gInfoBarTunerState:
                                gInfoBarTunerState.addEntry(
                                    id, self.getPluginName(), self.getType(),
                                    self.getText(), tuner, tunertype,
                                    tunernumber, name, number, channel, time(),
                                    0, True, "", client, ip)
                                gInfoBarTunerState.onEvent()
        except Exception, e:
            print "IBTS exception " + str(e)
            import os, sys, traceback
            print str(sys.exc_info()[0])
            print str(traceback.format_exc())
            sys.exc_clear()
    def onEvent(self, event, stream):
        if StreamingWebScreen and stream:
            if (event == StreamingWebScreen.EVENT_START):
                id = getStreamID(stream)
                log.debug("IBTS Stream Event WebIf Start " + id)

                irecordservice = stream.getRecordService()

                eservicereference = stream.getRecordServiceRef()

                # Extract parameters
                ip = str(stream.clientIP)
                if ip and ':' in ip and '.' in ip:
                    # Mixed style ::ffff:192.168.64.27
                    ip = string.split(str(stream.clientIP), ':')[-1]

                # Delete references to avoid blocking tuners
                del stream

                tuner, tunertype, tunernumber = getTunerByPlayableService(
                    irecordservice)

                name = getEventName(eservicereference)

                number = getNumber(eservicereference)
                channel = getChannel(eservicereference)

                reference = ""
                if eservicereference is not None:
                    reference = str(ServiceReference(eservicereference))

                client = getClient(ip)

                from Plugins.Extensions.InfoBarTunerState.plugin import gInfoBarTunerState
                if gInfoBarTunerState:
                    gInfoBarTunerState.addEntry(id, self.getPluginName(),
                                                self.getType(), self.getText(),
                                                tuner, tunertype, tunernumber,
                                                name,
                                                number, channel, reference,
                                                time(), 0, True, "", client,
                                                ip)
                    if config.infobartunerstate.plugin_webif.show_events.value:
                        gInfoBarTunerState.onEvent()

            elif event == StreamingWebScreen.EVENT_END:

                # Remove Finished Stream
                id = getStreamID(stream)
                log.debug("IBTS Stream Event WebIf End " + id)

                # Delete references to avoid blocking tuners
                del stream

                from Plugins.Extensions.InfoBarTunerState.plugin import gInfoBarTunerState
                if gInfoBarTunerState:
                    gInfoBarTunerState.finishEntry(id)
                    if config.infobartunerstate.plugin_webif.show_events.value:
                        gInfoBarTunerState.onEvent()
    def onEvent(self, event, stream):
        log.debug("IBTS Stream Event OpenWebIf")
        if StreamAdapter and stream:
            if (event == StreamAdapter.EV_BEGIN):
                id = getStreamID(stream)
                log.debug("IBTS Stream Event OpenWebIf Start " + id)

                irecordservice = stream.getService()

                eservicereference = stream.ref

                # Extract parameters
                ip = stream.clientIP

                # Delete references to avoid blocking tuners
                del stream

                tuner, tunertype, tunernumber = getTunerByPlayableService(
                    irecordservice)

                name = getEventName(eservicereference)

                number = getNumber(eservicereference)
                channel = getChannel(eservicereference)
                reference = str(eservicereference)

                client = getClient(ip)

                from Plugins.Extensions.InfoBarTunerState.plugin import gInfoBarTunerState
                if gInfoBarTunerState:
                    gInfoBarTunerState.addEntry(id, self.getPluginName(),
                                                self.getType(), self.getText(),
                                                tuner, tunertype, tunernumber,
                                                name,
                                                number, channel, reference,
                                                time(), 0, True, "", client,
                                                ip)
                    if config.infobartunerstate.plugin_openwebif.show_events.value:
                        gInfoBarTunerState.onEvent()

            elif event == StreamAdapter.EV_STOP:

                # Remove Finished Stream
                id = getStreamID(stream)
                log.debug("IBTS Stream Event OpenWebIf End " + id)

                # Delete references to avoid blocking tuners
                del stream

                from Plugins.Extensions.InfoBarTunerState.plugin import gInfoBarTunerState
                if gInfoBarTunerState:
                    gInfoBarTunerState.finishEntry(id)
                    if config.infobartunerstate.plugin_openwebif.show_events.value:
                        gInfoBarTunerState.onEvent()
	def onEvent(self, event, stream):
		if StreamingWebScreen and stream:
			if (event == StreamingWebScreen.EVENT_START):
				id = getStreamID(stream)
				log.debug( "IBTS Stream Event WebIf Start " + id )
				
				irecordservice = stream.getRecordService()
				
				eservicereference = stream.getRecordServiceRef()
				
				# Extract parameters
				ip = str(stream.clientIP)
				if ip and ':' in ip and '.' in ip:
					# Mixed style ::ffff:192.168.64.27
					ip = string.split(str(stream.clientIP), ':')[-1]
				
				# Delete references to avoid blocking tuners
				del stream
				
				tuner, tunertype, tunernumber = getTunerByPlayableService( irecordservice ) 
				
				name = getEventName(eservicereference)
				
				number = getNumber(eservicereference)
				channel = getChannel(eservicereference)
				
				reference = ""
				if eservicereference is not None:
					reference = str(ServiceReference(eservicereference))
				
				client = getClient(ip)
				
				from Plugins.Extensions.InfoBarTunerState.plugin import gInfoBarTunerState
				if gInfoBarTunerState:
					gInfoBarTunerState.addEntry(id, self.getPluginName(), self.getType(), self.getText(), tuner, tunertype, tunernumber, name, number, channel, reference, time(), 0, True, "", client, ip)
					if config.infobartunerstate.plugin_webif.show_events.value:
						gInfoBarTunerState.onEvent()
				
			elif event == StreamingWebScreen.EVENT_END:
				
				# Remove Finished Stream
				id = getStreamID(stream)
				log.debug( "IBTS Stream Event WebIf End " + id )
				
				# Delete references to avoid blocking tuners
				del stream
				
				from Plugins.Extensions.InfoBarTunerState.plugin import gInfoBarTunerState
				if gInfoBarTunerState:
					gInfoBarTunerState.finishEntry(id)
					if config.infobartunerstate.plugin_webif.show_events.value:
						gInfoBarTunerState.onEvent()
Example #7
0
	def onEventParametersChanged(self, params):
		try:
			if self.ids:
				id, ip, servicereference_string = self.ids[-1]
				print "IBTS Stream Event StreamServer Changed " + id
				
				if servicereference_string is None:
				
					servicereference_string = str(params.get(streamServerControl.URI_PARAM_REF, [""])[0])
					
					self.ids[-1] = (id, ip, servicereference_string)
					
					if servicereference_string:
						
						eservicereference = eServiceReference(servicereference_string)
						if eservicereference and eservicereference.valid():
							
							service_ref = ServiceReference(servicereference_string)
							
							tuner, tunertype, tunernumber = getTunerByServiceReference( service_ref ) 
							
							name = getEventName(eservicereference)
							
							number = getNumber(eservicereference)
							channel = getChannel(eservicereference)
							name = getEventName(eservicereference)
							
							client = getClient(ip)
							
							from Plugins.Extensions.InfoBarTunerState.plugin import gInfoBarTunerState
							if gInfoBarTunerState:
								gInfoBarTunerState.addEntry(id, self.getPluginName(), self.getType(), self.getText(), tuner, tunertype, tunernumber, name, number, channel, time(), 0, True, "", client, ip)
								gInfoBarTunerState.onEvent()
		except Exception, e:
			print "IBTS exception " + str(e)
			import os, sys, traceback
			print str(sys.exc_info()[0])
			print str(traceback.format_exc())
			sys.exc_clear()
Example #8
0
	def onEventParametersChanged(self, params):
		try:
			if self.ids:
				id, ip, servicereference_string = self.ids[-1]
				log.debug( "IBTS Stream Event StreamServer Changed " + id )
				
				if servicereference_string is None:
				
					servicereference_string = str(params.get(streamServerControl.URI_PARAM_REF, [""])[0])
					
					self.ids[-1] = (id, ip, servicereference_string)
					
					if servicereference_string:
						
						eservicereference = eServiceReference(servicereference_string)
						if eservicereference and eservicereference.valid():
							
							service_ref = ServiceReference(servicereference_string)
							
							tuner, tunertype, tunernumber = getTunerByServiceReference( service_ref ) 
							
							name = getEventName(eservicereference)
							
							number = getNumber(eservicereference)
							channel = getChannel(eservicereference)
							name = getEventName(eservicereference)
							reference = str(eservicereference)
							
							client = getClient(ip)
							
							from Plugins.Extensions.InfoBarTunerState.plugin import gInfoBarTunerState
							if gInfoBarTunerState:
								gInfoBarTunerState.addEntry(id, self.getPluginName(), self.getType(), self.getText(), tuner, tunertype, tunernumber, name, number, channel, reference, time(), 0, True, "", client, ip)
								if config.infobartunerstate.plugin_openwebif.show_events.value:
									gInfoBarTunerState.onEvent()
		except Exception, e:
			log.exception( "IBTS exception " + str(e) )
	def onEvent(self, event, stream):
		log.debug( "IBTS Stream Event OpenWebIf" )
		if StreamAdapter and stream:
			if (event == StreamAdapter.EV_BEGIN):
				id = getStreamID(stream)
				log.debug( "IBTS Stream Event OpenWebIf Start " + id )
				
				irecordservice = stream.getService()
				
				eservicereference = stream.ref
				
				# Extract parameters
				ip = stream.clientIP
				
				# Delete references to avoid blocking tuners
				del stream
				
				tuner, tunertype, tunernumber = getTunerByPlayableService(irecordservice) 
				
				name = getEventName(eservicereference)
				
				number =  getNumber(eservicereference)
				channel = getChannel(eservicereference)
				reference = str(eservicereference)
				
				client = getClient(ip)
				
				from Plugins.Extensions.InfoBarTunerState.plugin import gInfoBarTunerState
				if gInfoBarTunerState:
					gInfoBarTunerState.addEntry(id, self.getPluginName(), self.getType(), self.getText(), tuner, tunertype, tunernumber, name, number, channel, reference, time(), 0, True, "", client, ip)
					if config.infobartunerstate.plugin_openwebif.show_events.value:
						gInfoBarTunerState.onEvent()
			
			elif event == StreamAdapter.EV_STOP:
				
				# Remove Finished Stream
				id = getStreamID(stream)
				log.debug( "IBTS Stream Event OpenWebIf End " + id )
				
				# Delete references to avoid blocking tuners
				del stream
				
				from Plugins.Extensions.InfoBarTunerState.plugin import gInfoBarTunerState
				if gInfoBarTunerState:
					gInfoBarTunerState.finishEntry(id)
					if config.infobartunerstate.plugin_openwebif.show_events.value:
						gInfoBarTunerState.onEvent()
	def update(self, id, tunerstate):
		
		stream = getStream( id )
		if stream:
		
			ref = stream.ref
			
			del stream
			
			tunerstate.name = getEventName(ref)
			
			return True
			
		else:
			
			# Stream is not active anymore
			return None
    def update(self, id, tunerstate):

        stream = getStream(id)
        if stream:

            ref = stream.ref

            del stream

            tunerstate.name = getEventName(ref)

            return True

        else:

            # Stream is not active anymore
            return None
Example #12
0
	def update(self, id, tunerstate):
		
		servicereference_string = self.getRef(id)
		
		if servicereference_string:
			
			eservicereference = eServiceReference(servicereference_string)
			if eservicereference and eservicereference.valid():
				
				tunerstate.name = getEventName(eservicereference)
				
				if not tunerstate.number:
					tunerstate.number = getNumber(eservicereference)
				if not tunerstate.channel:
					tunerstate.channel = getChannel(eservicereference)
		
			return True
		
		else:
			
			return None
Example #13
0
    def update(self, id, tunerstate):

        servicereference_string = self.getRef(id)

        if servicereference_string:

            eservicereference = eServiceReference(servicereference_string)
            if eservicereference and eservicereference.valid():

                tunerstate.name = getEventName(eservicereference)

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

            return True

        else:

            return None
Example #14
0
    def update(self, id, tunerstate):

        stream = getStream(id)
        if stream:

            eservicereference = stream.getRecordServiceRef()

            del stream

            tunerstate.name = getEventName(eservicereference)

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

            return True

        else:

            # Stream is not active anymore
            return None
    def update(self, id, tunerstate):

        stream = getStream(id)
        if stream:

            eservicereference = stream.getRecordServiceRef()

            del stream

            tunerstate.name = getEventName(eservicereference)

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

            return True

        else:

            # Stream is not active anymore
            return None
    def onEvent(self, event, stream):
        if StreamingWebScreen and stream:
            if event == StreamingWebScreen.EVENT_START:
                id = getStreamID(stream)
                print "IBTS Stream Event WebIf Start " + id

                irecordservice = stream.getRecordService()

                eservicereference = stream.getRecordServiceRef()

                # Extract parameters
                ip = str(stream.clientIP)
                if ip and ":" in ip and "." in ip:
                    # Mixed style ::ffff:192.168.64.27
                    ip = string.split(str(stream.clientIP), ":")[-1]

                    # Delete references to avoid blocking tuners
                del stream

                tuner, tunertype, tunernumber = getTunerByPlayableService(irecordservice)

                name = getEventName(eservicereference)

                number = getNumber(eservicereference)
                channel = getChannel(eservicereference)

                client = getClient(ip)

                from Plugins.Extensions.InfoBarTunerState.plugin import gInfoBarTunerState

                gInfoBarTunerState.addEntry(
                    id,
                    self.getPluginName(),
                    self.getType(),
                    self.getText(),
                    tuner,
                    tunertype,
                    tunernumber,
                    name,
                    number,
                    channel,
                    time(),
                    0,
                    True,
                    "",
                    client,
                    ip,
                )
                gInfoBarTunerState.onEvent()

            elif event == StreamingWebScreen.EVENT_END:

                # Remove Finished Stream
                id = getStreamID(stream)
                print "IBTS Stream Event WebIf End " + id

                # Delete references to avoid blocking tuners
                del stream

                from Plugins.Extensions.InfoBarTunerState.plugin import gInfoBarTunerState

                gInfoBarTunerState.finishEntry(id)
                gInfoBarTunerState.onEvent()