Using iOS 8.4.1 on iPad mini.
It seems that the MidiInput::getDevices() returns "<error>" (i.e. the device name string is blank) when unplugging a USB Midi device from the iPad.
I created a Hello World project (based on GUI IntroJucer template) with the following code:
#include "MainComponent.h" String mainMessage; int count = 0; //============================================================================== MainContentComponent::MainContentComponent() { setSize (600, 400); mainMessage = "Nothing yet"; startTimer(1000); } MainContentComponent::~MainContentComponent() { stopTimer(); } void MainContentComponent::timerCallback() { StringArray midiInputs = MidiInput::getDevices(); mainMessage = String(count++)+": "+midiInputs[0]; repaint(); } void MainContentComponent::paint (Graphics& g) { g.fillAll (Colour (0xff001F36)); g.setFont (Font (16.0f)); g.setColour (Colours::white); g.drawText (mainMessage, getLocalBounds(), Justification::centred, true); }
Before the MIDI Device is unplugged mainMessage is "Network Session 1".
When the device is unplugged, after a few seconds, mainMessage contains "<error>".
Note that it also shows the same problem as described here: http://www.juce.com/forum/topic/issues-midioutputgetdevices. I also see the abort app syndrom described there, but the workaround (as Jules suggested) is to wait for a few seconds before re-launching the app. However in the case above, this is really annoying and I can't even find a workaround.
Is that a bug or am I doing something wrong ?