Is there a way to recover a usb midi device if it has been unplugged and plugged back in without restarting the juce application?
More specifically, I would like to be able to send a message to a device, have that device restart, at which time it re-enumerates as a midi device (USB Audio Device), and be able to send more messages without the need of restarting my application.
I have tried something like this:
//Init Midi Device
sendMessageCausingDeviceToRestart();
while(MidiOutput::getDevices().contains(midiDevice)); //wait for device to unload
while(!MidiOutput::getDevices().contains(midiDevice));//wait for device to come back
audioDeviceManager.refreshDeviceList();
audioDeviceManager.setDefaultMidiOutput (outputName);
if I try to send midi data now it will not work.
Any ideas??