core.ErrorMsg.reportError ("Warning","The test failed.\n" + "There are many reasons why this could have happened.\n" + "Most likely, you don't have the selected \"IN\" and \"OUT\" ports\n" + "connected to each other with a MIDI cable.\n",e); e.printStackTrace();
ErrorMsg.reportError("Warning","The test failed.\n" + "There are many reasons why this could have happened.\n" + "Most likely, you don't have the selected \"IN\" and \"OUT\" ports\n" + "connected to each other with a MIDI cable.",e);
	static boolean runLoopbackTest(MidiWrapper midiDriver, int inport, int outport) {		core.ErrorMsg.reportError ("Before we start",			"This process is designed to test the communication of\n" +			"your MIDI ports. Please connect a MIDI cable from the\n" +			"selected \"IN\" port to the selected \"OUT\" port.\n" +			"When you press \"OK\", a variety of MIDI messages will\n" +			"be sent from the OUT to the IN to make sure that they\n" +			"transferred properly. This process usually takes about\n" +			"5 to 10 seconds, so be patient.");		try {			Vector msgList = getMidiMessages();						/*			 * This section is for creating/driving a progress bar. However, since this			 * method is currently getting run by the UI thread, all UI updates stop while			 * the test is running, so the progress bar never gets updated. I probably			 * need to execute this thing in a separate thread in order to make this			 * work. - emenaker 2003.03.26			 *//* 			JDialog dialog = new JDialog();			JPanel panel = new JPanel();			JProgressBar pbar = new JProgressBar();			panel.add(pbar);			dialog.getContentPane().add(panel);			dialog.pack();			dialog.show();						pbar.setMinimum(0);			pbar.setMaximum(msgList.size());*/			for(int i=0; i<msgList.size(); i++) {				//pbar.setValue(i);				runLoopbackTest(midiDriver, inport, outport, (MidiMessage) msgList.elementAt(i));			}						// If we get this far, then things must have gone okay....			core.ErrorMsg.reportError ("Congratulations!",				"The test appears to have completed successfully\n" +				"Don't forget to hook your MIDI cables back up to your devices.");		} catch(Exception e) {			core.ErrorMsg.reportError ("Warning","The test failed.\n" +				"There are many reasons why this could have happened.\n" +				"Most likely, you don't have the selected \"IN\" and \"OUT\" ports\n" +				"connected to each other with a MIDI cable.\n",e);			e.printStackTrace();			return(false);		}		return(true);	}