From: Joe E. <jo...@em...> - 2011-09-20 01:40:13
|
On 9/19/2011 6:08 PM, fra...@us... wrote: > 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. Actually, I already was planning on doing that in the refactor, so you probably saved me some work. Saving the interfaces by name will be much more reliable. While you're in that zone, consider this. In the refactor, the new MIDI code is going to be able to listen on *all* available input ports at once, so the current MIDI configuration panel (where you select a single input and single output port) is going to need to be altered a bit. I don't know if we want to let the user select which portS they want JSL to listen on, or do we want JSL to just listen to everything available all the time? - Joe |