MidiInput device unique identifier?


#1

AudioDeviceManager is really well defined with the ability to save and restore device identifiers and parameters to XML across launches.

But where is the MidiInput device support? All we get is an index and a name? Is the name guaranteed to be unique on all platforms? Can I save the name across launches?

How can I handle the case where the midi input devices change between launches?


#2

you can’t, especialy on windows it’s impossible to be certain that a device you are opening is the device you closed remembered some time ago.

i save both the device index (int the device table that juce gives) and the device name as a String, and try to match both, if both don’t match try to match the name, if the name doesn’t match try to match the index, if that fails, give an error.