Exemple #1
0
func (self *PulseStream) ConnectToSink() int {
	C.pa_threaded_mainloop_lock(self.Context.MainLoop.pa)
	err := C.pa_stream_connect_playback(self.st, nil, nil, 0, nil, nil)
	C.pa_threaded_mainloop_unlock(self.Context.MainLoop.pa)
	if err == OK {
		err = C.stream_poll_unless(self.Context.MainLoop.pa, self.st, STREAM_READY)
	}
	return int(err)
}
Exemple #2
0
func (self *PulseContext) Disconnect() {
	C.pa_threaded_mainloop_lock(self.MainLoop.pa)
	C.pa_context_disconnect(self.ctx)
	C.pa_threaded_mainloop_unlock(self.MainLoop.pa)
}
Exemple #3
0
func (self *PulseStream) Disconnect() {
	C.pa_threaded_mainloop_lock(self.Context.MainLoop.pa)
	C.pa_stream_disconnect(self.st)
	C.pa_threaded_mainloop_unlock(self.Context.MainLoop.pa)
}
Exemple #4
0
// Acquire an exclusive lock on the mainloop
//
func (self *Client) Lock() {
	if self.mainloop != nil {
		C.pa_threaded_mainloop_lock(self.mainloop)
	}
}