View Single Post
  #18 (permalink)  
Old 08-30-2008, 09:05 PM
willemjav willemjav is offline
Senior Member
 
Join Date: Dec 2007
Location: Spain
Posts: 342
willemjav is on a distinguished road
So after the user selects the midi driver I wont here or him to test if midi is working. I test midi out by playing a single tone. Midi in only´s task is to read a midi pedal out. So the test is done by selecting a JCheckbox called midipedalTest. When the box is checked the test begins. When the pedal sets the flag true the test informs positive and the box gets unchecked. In case the pedal does not work (there is some problem with the driver, cables and or midi device) the test should be ended (threat should be stopped) by unchecking the box (I latter added the small code: infoPane.setText(" pedal pushed "); to indicate some more than just the checkbox). That is all there is to it? So I might not need a loop.... but how I get out of the run() method? The loop forces the run to run until 1) the pedal is pushed and works; 2) the box gets unchecked! When either one of these things is not done the threads continuos and no other thread can start. After getting out the loop the test could be done again by starting the thread new and the loop repeats....... the rest of the story has been told. Norm its not elegant but it works or not?
Reply With Quote