if (faderPort!=inport) { sourceDevice=MidiSystem.getMidiDevice((MidiDevice.Info)sourceInfoVector.get(faderPort)); fader=sourceDevice.getTransmitter(); fader.setReceiver(this); } initialized = true;
if (faderPort!=inport) { sourceDevice=MidiSystem.getMidiDevice((MidiDevice.Info)sourceInfoVector.get(faderPort)); fader=sourceDevice.getTransmitter(); fader.setReceiver(this);
	public void init(int inport, int outport) throws DriverInitializationException, MidiUnavailableException {		initialized = false;	    currentInport=inport;	    currentOutport=outport;	    faderPort=PatchEdit.appConfig.getFaderPort();    	    sourceInfoVector=new Vector ();	    destinationInfoVector=new Vector ();    	    mdi=MidiSystem.getMidiDeviceInfo ();		// This loop populates the InfoVectors with MidiDeviceInfo objects that are NOT		// from the built-in JavaSound system		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) {//				ErrorMsg.reportError("Error","Something really strange happened during initialization?",e);//				e.printStackTrace();//			}		}		if(destinationInfoVector.size()==0) {			System.err.println("No output ports");			ErrorMsg.reportError("Error","No Midi output ports were found\nIs WireProvider installed?");			output=null;			initialized = false;			return;		}		if(sourceInfoVector.size()==0) {			System.err.println("No input ports");			ErrorMsg.reportError("Error","No Midi input ports were found\nIs WireProvider installed?");			input=null;			fader=null;			initialized = false;			return;		}        try {			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);		} catch (Exception e) {			output=null;			input=null;			initialized = false;			ErrorMsg.reportError("Error","No Midi ports avaliable\nIs WireProvider installed?",e);			e.printStackTrace();        }		if (faderPort!=inport) {			sourceDevice=MidiSystem.getMidiDevice((MidiDevice.Info)sourceInfoVector.get(faderPort));			fader=sourceDevice.getTransmitter();			fader.setReceiver(this);		}		initialized = true;	}