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)) }
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() + "'") } }
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)) }