iOS audio interface not showing up


#1

I have written a custom audio device selector for an iOS app, which shows up the default CoreAudio device, however, it does not show an external interface (Focusrite Scarlett), although the same device does show up as a MIDI device.

The code is below - do I need to scan through device types and add those to the list?

class AudioDeviceSelectorController
{
public:
AudioDeviceSelectorController(AudioDeviceSelectorView& view)
    : view (view)
{
    deviceManager.initialise(4, 4, 0, true, String::empty);
}

void updateView()
{

    DBG ("updateView");

    auto &types = deviceManager.getAvailableDeviceTypes();
    if (types.size() > 1) {
        // TODO: Complete or remove?
//            int id = 1;
//            for (auto &deviceType : types) {
//                deviceTypeSelector.addItem (deviceType->getTypeName(), id++);
//            }
    }

    view.inputDeviceSelector.clear(dontSendNotification);
    view.outputDeviceSelector.clear(dontSendNotification);
    view.midiDeviceSelector.clear(dontSendNotification);

    addNamesToDeviceBox(view.inputDeviceSelector, false);
    addNamesToDeviceBox(view.outputDeviceSelector, true);
    addNamesToMidiInputBox(view.midiDeviceSelector);
}

void addNamesToDeviceBox (ComboBox& combo, bool isInputs)
{
    const StringArray devices (deviceManager.getCurrentDeviceTypeObject()->getDeviceNames (isInputs));

    combo.clear (dontSendNotification);

    for (int i = 0; i < devices.size(); ++i)
        combo.addItem (devices[i], i + 1);

    combo.addItem (getNoDeviceString(), -1);

    int current = 1 + deviceManager.getCurrentDeviceTypeObject()->getDefaultDeviceIndex (isInputs);

    combo.setSelectedId (current, dontSendNotification);
}

void addNamesToMidiInputBox (ComboBox& combo)
{
    const StringArray midiIns (MidiInput::getDevices());

    combo.addItem (getNoDeviceString(), -1);
    combo.addSeparator();

    for (int i = 0; i < midiIns.size(); ++i)
        combo.addItem (midiIns[i], i + 1);

    int current = midiIns.size() > 0 ? 1 + MidiInput::getDefaultDeviceIndex() : -1;

    combo.setSelectedId (current, dontSendNotification);
}

~AudioDeviceSelectorController()
{
//        deviceType = nullptr;
}

private:
AudioDeviceManager deviceManager;
AudioDeviceSelectorView& view;

JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (AudioDeviceSelectorController)
};