Exemplo n.º 1
0
Arquivo: simple.go Projeto: shazow/mog
// Stream.Drain blocks until all buffered data has finished playing.
func (s *Stream) Drain() (int, error) {
	var err C.int
	written := C.pa_simple_drain(s.simple, &err)
	if err == C.PA_OK {
		return int(written), nil
	}
	return int(written), errorFromCode(err)
}
Exemplo n.º 2
0
Arquivo: simple.go Projeto: kaey/pulse
// Drain waits until all written data is played by the server.
func (conn *Conn) Drain() error {
	C.pa_simple_drain(
		conn.simple,
		&conn.err.no,
	)
	if conn.err.no != C.int(0) {
		return conn.err
	}

	return nil
}