示例#1
0
	def _context_state_callback(self, context, userdata):
		state = _lib.pa_context_get_state(context)
		# print 'Context state change: %i' % (state)
		if state == _lib.PA_CONTEXT_READY:
			if self.app_name:
				op = _lib.pa_context_get_sink_input_info_list(context, self._sink_input_info_callback, None)
			else:
				op = _lib.pa_context_get_sink_info_list(context, self._sink_info_callback, None)
			_lib.pa_operation_unref(op)
示例#2
0
 def _context_state_callback(self, context, userdata):
     state = _lib.pa_context_get_state(context)
     # print 'Context state change: %i' % (state)
     if state == _lib.PA_CONTEXT_READY:
         if self.app_name:
             op = _lib.pa_context_get_sink_input_info_list(
                 context, self._sink_input_info_callback, None)
         else:
             op = _lib.pa_context_get_sink_info_list(
                 context, self._sink_info_callback, None)
         _lib.pa_operation_unref(op)
示例#3
0
    def context_notify_cb(self, context, _):
        state = pa.pa_context_get_state(context)

        if state == pa.PA_CONTEXT_READY:
            logger.debug("Pulseaudio connection ready")
            # Connected to Pulseaudio. Now request that source_info_cb
            # be called with information about the available sources.
            o = pa.pa_context_get_source_info_list(context, self._source_info_cb, None)
            pa.pa_operation_unref(o)

        elif state == pa.PA_CONTEXT_FAILED:
            logger.error("Pulseaudio connection failed")

        elif state == pa.PA_CONTEXT_TERMINATED:
            logger.info("Pulseaudio connection terminated")
示例#4
0
    def context_notify_cb(self, context, _):
        state = P.pa_context_get_state(context)

        if state == P.PA_CONTEXT_READY:
            log.info("Pulseaudio connection ready...")
            # Connected to Pulseaudio. Now request that source_info_cb
            # be called with information about the available sources.
            o = P.pa_context_get_source_info_list(context, self._source_info_cb, None)
            P.pa_operation_unref(o)

        elif state == P.PA_CONTEXT_FAILED :
            log.error("Connection failed")
            os.abort()

        elif state == P.PA_CONTEXT_TERMINATED:
            log.error("Connection terminated")
            os.abort()

        else:
            log.info('context_notify_cb state=%r', state)
    def context_notify_cb(self, context, _):
        state = P.pa_context_get_state(context)

        if state == P.PA_CONTEXT_READY:
            log.info("Pulseaudio connection ready...")
            # Connected to Pulseaudio. Now request that source_info_cb
            # be called with information about the available sources.
            o = P.pa_context_get_source_info_list(context, self._source_info_cb, None)
            P.pa_operation_unref(o)

        elif state == P.PA_CONTEXT_FAILED :
            log.error("Connection failed")
            os.abort()

        elif state == P.PA_CONTEXT_TERMINATED:
            log.error("Connection terminated")
            os.abort()

        else:
            log.info('context_notify_cb state=%r', state)