faderPort=PatchEdit.prefsDialog.faderPort;
faderPort=PatchEdit.appConfig.getFaderPort();
  public  WireMidiWrapper (int inport, int outport) throws Exception  {    currentInport=inport;    currentOutport=outport;    faderPort=PatchEdit.prefsDialog.faderPort;        sourceInfoVector=new Vector ();    destinationInfoVector=new Vector ();        mdi=MidiSystem.getMidiDeviceInfo ();        for (int i=0;i<mdi.length;i++)    {      try      {        md=MidiSystem.getMidiDevice (mdi[i]);                if (md.getMaxReceivers ()!=0)        {          if ((mdi[i].getClass ().toString ().indexOf ("com.sun.media.sound")<0))            destinationInfoVector.add (mdi[i]);        }                        if (md.getMaxTransmitters ()!=0)        {          if ((mdi[i].getClass ().toString ().indexOf ("com.sun.media.sound")<0))            sourceInfoVector.add (mdi[i]);        }      }      catch (Exception e)      {e.printStackTrace ();}    }        MidiDevice destDevice=MidiSystem.getMidiDevice ((MidiDevice.Info)destinationInfoVector.get (outport));    output=destDevice.getReceiver ();        MidiDevice sourceDevice=MidiSystem.getMidiDevice ((MidiDevice.Info)sourceInfoVector.get (inport));    input=sourceDevice.getTransmitter ();    input.setReceiver (this);        if (faderPort!=inport)    {      sourceDevice=MidiSystem.getMidiDevice ((MidiDevice.Info)sourceInfoVector.get (faderPort));      fader=sourceDevice.getTransmitter ();      fader.setReceiver (this);    }  }