Exemplo n.º 1
0
func (client *Client) Connect(srcPort, dstPort string) int {
	csrc := C.CString(srcPort)
	defer C.free(unsafe.Pointer(csrc))
	cdst := C.CString(dstPort)
	defer C.free(unsafe.Pointer(cdst))

	return int(C.jack_connect(client.handler, csrc, cdst))
}
Exemplo n.º 2
0
func (this *Port) Connect(otherPortName string) error {
	nameCStr := C.CString(this.GetName())
	otherPortNameCStr := C.CString(otherPortName)
	defer C.free(unsafe.Pointer(nameCStr))
	defer C.free(unsafe.Pointer(otherPortNameCStr))

	res := C.jack_connect(this.client.jackClient, nameCStr, otherPortNameCStr)
	if res == 0 || res == C.EEXIST {
		return nil
	} else {
		return errors.New("jack_connect failed while connecting port '" + otherPortName + "' to port '" + this.GetName() + "'")
	}
}
Exemplo n.º 3
0
func (client *Client) ConnectPorts(srcPort, dstPort *Port) int {
	csrc := C.jack_port_name(srcPort.handler)
	cdst := C.jack_port_name(dstPort.handler)

	return int(C.jack_connect(client.handler, csrc, cdst))
}