internal AudioBuffer(Port port, uint bufferSize, StructPointer<float> pointer) { BufferSize = (int)bufferSize; Port = port; PointerWrapper = pointer; Audio = PointerWrapper.Array; }
internal static bool Connect(Port outputPort, Port inputPort) { if (outputPort.FlowDirection != FlowDirection.Out || inputPort.FlowDirection != FlowDirection.In || outputPort.ConnectionType != inputPort.ConnectionType) { return false; } JackPort outPort = PortMapper.First (map => map == outputPort); JackPort inPort = PortMapper.First (map => map == inputPort); return _jackClient.Connect (outPort.PortReference, inPort.PortReference); }
internal static bool Disconnect(Port outputPort, Port inputPort) { if (outputPort.FlowDirection != FlowDirection.Out || inputPort.FlowDirection != FlowDirection.In || outputPort.ConnectionType != inputPort.ConnectionType) { return false; } JackPort outPort = PortMapper.First (map => map == outputPort); JackPort inPort = PortMapper.First (map => map == inputPort); if (_connections.Any (c => c.InPort == inputPort && c.OutPort == outputPort)) { return _jackClient.Disconnect (outPort.PortReference, inPort.PortReference); } return true; }
/// <summary> /// Determines whether the specified <see cref="JackSharp.Ports.Port"/> is equal to the current <see cref="JackSharp.Ports.Port"/>. /// </summary> /// <param name="other">The <see cref="JackSharp.Ports.Port"/> to compare with the current <see cref="JackSharp.Ports.Port"/>.</param> /// <returns><c>true</c> if the specified <see cref="JackSharp.Ports.Port"/> is equal to the current /// <see cref="JackSharp.Ports.Port"/>; otherwise, <c>false</c>.</returns> public bool Equals(Port other) { if (other == null) return false; unsafe { return _port == other._port && _jackClient == other._jackClient; } }