Ejemplo n.º 1
0
 unsafe PortReference MapPort(uint portId)
 {
     UnsafeStructs.jack_port_t *portPointer = PortApi.GetPortById(JackClient, portId);
     if (portPointer == null)
     {
         return(null);
     }
     return(new PortReference(portPointer));
 }
Ejemplo n.º 2
0
 unsafe PortReference MapPort(string portName)
 {
     UnsafeStructs.jack_port_t *portPointer = PortApi.GetPortByName(JackClient, portName);
     if (portPointer == null)
     {
         return(null);
     }
     return(new PortReference(portPointer));
 }
Ejemplo n.º 3
0
 internal unsafe Port(UnsafeStructs.jack_client_t*jackClient, int index, Direction direction, PortType portType, string nameFormat)
 {
     if (nameFormat == null) {
         nameFormat = "{type}{direction}_{index}";
     }
     _jackClient = jackClient;
     Direction = direction;
     Name = CreateName (nameFormat, index, direction, portType);
     PortType = portType;
     _port = RegisterPort (direction, portType);
 }
Ejemplo n.º 4
0
 unsafe void Dispose(bool isDisposing)
 {
     if (_jackClient == null || _port == null)
     {
         return;
     }
     if (PortApi.Unregister(_jackClient, _port) == 0)
     {
         _jackClient = null;
         _port       = null;
     }
 }
Ejemplo n.º 5
0
        internal unsafe PortReference(UnsafeStructs.jack_port_t *portPointer)
        {
            PortPointer = portPointer;
            FullName    = PortApi.GetName(portPointer).PtrToString();
            bool      isPhysicalPort;
            Direction direction;

            ReadJackPortFlags(portPointer, out direction, out isPhysicalPort);
            Direction      = direction;
            IsPhysicalPort = isPhysicalPort;
            PortType       = GetPortType(portPointer);
        }
Ejemplo n.º 6
0
 internal unsafe Port(UnsafeStructs.jack_client_t *jackClient, int index, Direction direction, PortType portType, string nameFormat)
 {
     if (nameFormat == null)
     {
         nameFormat = "{type}{direction}_{index}";
     }
     _jackClient = jackClient;
     Direction   = direction;
     Name        = CreateName(nameFormat, index, direction, portType);
     PortType    = portType;
     _port       = RegisterPort(direction, portType);
 }
Ejemplo n.º 7
0
        static unsafe PortType GetPortType(UnsafeStructs.jack_port_t *portPointer)
        {
            string connectionTypeName = PortApi.GetType(portPointer).PtrToString();

            switch (connectionTypeName)
            {
            case Constants.JACK_DEFAULT_AUDIO_TYPE:
                return(PortType.Audio);

            case Constants.JACK_DEFAULT_MIDI_TYPE:
                return(PortType.Midi);
            }
            throw new IndexOutOfRangeException("jack_port_type");
        }
Ejemplo n.º 8
0
        static unsafe void ReadJackPortFlags(UnsafeStructs.jack_port_t *portPointer, out Direction direction, out bool isPhysicalPort)
        {
            JackPortFlags portFlags = (JackPortFlags)PortApi.GetPortFlags(portPointer);

            isPhysicalPort = (portFlags & JackPortFlags.JackPortIsPhysical) == JackPortFlags.JackPortIsPhysical;
            if ((portFlags & JackPortFlags.JackPortIsInput) == JackPortFlags.JackPortIsInput)
            {
                direction = Direction.In;
                return;
            }
            if ((portFlags & JackPortFlags.JackPortIsOutput) == JackPortFlags.JackPortIsOutput)
            {
                direction = Direction.Out;
                return;
            }
            throw new IndexOutOfRangeException("jack_port_flags");
        }
Ejemplo n.º 9
0
 public static extern unsafe ulong GetUuid(UnsafeStructs.jack_port_t *port);
Ejemplo n.º 10
0
 public static extern unsafe int Disconnect(UnsafeStructs.jack_client_t *client, UnsafeStructs.jack_port_t *port);
Ejemplo n.º 11
0
 public static extern unsafe void SetLatencyRange(UnsafeStructs.jack_port_t *port, JackLatencyCallbackMode mode, IntPtr range);
Ejemplo n.º 12
0
 public static extern unsafe int GetPortFlags(UnsafeStructs.jack_port_t *port);
Ejemplo n.º 13
0
 public static extern unsafe int EnsureMonitor(UnsafeStructs.jack_port_t *port, int onoff);
Ejemplo n.º 14
0
 public static extern unsafe int MonitoringInput(UnsafeStructs.jack_port_t *port);
Ejemplo n.º 15
0
 public static extern unsafe float *GetBuffer(UnsafeStructs.jack_port_t *port, uint frames);
Ejemplo n.º 16
0
 public static extern unsafe int RequestMonitor(UnsafeStructs.jack_port_t *port, int onoff);
Ejemplo n.º 17
0
 public static extern unsafe IntPtr GetType(UnsafeStructs.jack_port_t *port);
Ejemplo n.º 18
0
 unsafe void Dispose(bool isDisposing)
 {
     if (_jackClient == null || _port == null) {
         return;
     }
     if (PortApi.Unregister (_jackClient, _port) == 0){
         _jackClient = null;
         _port = null;
     }
 }
Ejemplo n.º 19
0
 public static extern unsafe IntPtr GetAllConnections(UnsafeStructs.jack_client_t *client, UnsafeStructs.jack_port_t *port);
Ejemplo n.º 20
0
 public static extern unsafe IntPtr GetConnections(UnsafeStructs.jack_port_t *port);
Ejemplo n.º 21
0
 public static extern unsafe int IsConnectedTo(UnsafeStructs.jack_port_t *port, string portName);
Ejemplo n.º 22
0
 public static extern unsafe int IsConnected(UnsafeStructs.jack_port_t *port);
Ejemplo n.º 23
0
 public static extern unsafe int IsMine(UnsafeStructs.jack_client_t *client, UnsafeStructs.jack_port_t *port);
Ejemplo n.º 24
0
 public static extern unsafe int UnsetAlias(UnsafeStructs.jack_port_t *port, string alias);
Ejemplo n.º 25
0
 public static extern unsafe int GetAliases(UnsafeStructs.jack_port_t *port, IntPtr[] aliases);
Ejemplo n.º 26
0
 public static extern unsafe int SetName(UnsafeStructs.jack_port_t *port, string portName);
Ejemplo n.º 27
0
 public static extern unsafe int Unregister(UnsafeStructs.jack_client_t *client, UnsafeStructs.jack_port_t *port);