How to use the pulsectl._pulsectl.pa.context_set_state_callback function in pulsectl

To help you get started, we’ve selected a few pulsectl examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mk-fg / python-pulse-control / pulsectl / pulsectl.py View on Github external
def _ctx_init(self):
		if self._ctx:
			with self._loop_lock:
				self.disconnect()
				c.pa.context_unref(self._ctx)
		self._ctx = c.pa.context_new(self._api, self.name)
		c.pa.context_set_state_callback(self._ctx, self._pa_state_cb, None)
		c.pa.context_set_subscribe_callback(self._ctx, self._pa_subscribe_cb, None)