From: <fra...@us...> - 2011-09-20 01:08:51
|
Revision: 1158 http://jsynthlib.svn.sourceforge.net/jsynthlib/?rev=1158&view=rev Author: frankster Date: 2011-09-20 01:08:45 +0000 (Tue, 20 Sep 2011) Log Message: ----------- fixed crash which can occur at startup when less midi devices are installed than when prefs were saved. The problem was that the midi device is stored in the prefs as an integer. When the prefs are loaded, the device number is loaded and no checks are performed causing an array out of bounds exception if you now have less devices than the device number you had previously configured. This also caused a problem that the configured devices could change if you plugged in or unplugged a usb device that wasn't even used by JSL, as the correct device would now be in a different position in the array. Given that USB midi devices are probably a lot more common now than 10 years ago, its probably quite common now that available devices might vary from session to session. I have changed it so that the midi device is stored as a string (using vladimir's de-duplicated name). When JSL is re-started, as long as the same device name exists, it will be configured correctly regardless of where the device appears in the array. If a device name loaded from prefs can't be found, then it will default to device 0 which is the same behaviour as before. Modified Paths: -------------- trunk/JSynthLib/core/AppConfig.java trunk/JSynthLib/core/Device.java This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |