static ConnectionEventArgs GetRenamedPortArgs(PortRegistrationEventArgs args, JackPort oldPort) { ConnectionEventArgs eventArgs = new ConnectionEventArgs { MessageType = MessageType.Change }; PortMapper.Remove (oldPort); JackPort port = AddNewJackPort (args.Port); eventArgs.Connectables = new List<Port> { port }; eventArgs.ChangeType = ChangeType.Content; eventArgs.ConnectionType = port.ConnectionType; eventArgs.Message = "Port renamed."; return eventArgs; }
static IConnection MapConnection(JackPort outPort, JackPort inPort) { IConnection newConn = null; switch (outPort.ConnectionType) { case ConnectionType.JackAudio: newConn = new JackAudioConnection (); break; case ConnectionType.JackMidi: newConn = new JackMidiConnection (); break; } Debug.Assert (newConn != null, "New connection is null."); newConn.OutPort = outPort; newConn.InPort = inPort; return newConn; }
static JackPort AddNewJackPort(PortReference port) { JackPort newPort = new JackPort (port); PortMapper.Add (newPort); return newPort; }