Request: AudioDeviceManager::removeAudioDeviceType

Bit of a niche request here but would it be possible to add a
AudioDeviceManager::removeAudioDeviceType (AudioIODeviceType*) method?

The reason being that to test various recording and input configurations in CI, we have a dummy AudioDeviceType that we can configure so it doesn’t have to be connected to real hardware (think CI fully in the cloud). This works well except once it’s been added to the AudioDeviceManager there’s no way to remove it. This makes it difficult to run multiple tests and randomise their orders etc.

Probably like this:

    /** Removes a previously added device type from the manager. */
    void removeAudioDeviceType (AudioIODeviceType* deviceTypeToRemove);
void AudioDeviceManager::removeAudioDeviceType (AudioIODeviceType* deviceTypeToRemove)
{
    jassert (lastDeviceTypeConfigs.size() == availableDeviceTypes.size());
    const int index = availableDeviceTypes.indexOf (deviceTypeToRemove);

    if (auto removed = std::unique_ptr<AudioIODeviceType> (availableDeviceTypes.removeAndReturn (index)))
    {
        removed->removeListener (callbackHandler.get());
        lastDeviceTypeConfigs.remove (index, true);
    }
}

Any chance of getting that added?

1 Like

Thanks Ed!