AudioPluginInstance* AudioPluginFormatManager::createPluginInstance (const PluginDescription& description, double rate,
                                                                     int blockSize, String& errorMessage) const
{
    for (int i = 0; i < formats.size(); ++i)
        if (AudioPluginInstance* result = formats.getUnchecked(i)->createInstanceFromDescription (description, rate, blockSize))
            return result;

    errorMessage = doesPluginStillExist (description) ? TRANS ("This plug-in failed to load correctly")
                                                      : TRANS ("This plug-in file no longer exists");
    return nullptr;
}
AudioPluginInstance* AudioPluginFormatManager::createPluginInstance (const PluginDescription& description,
                                                                     String& errorMessage) const
{
    AudioPluginInstance* result = nullptr;

    for (int i = 0; i < formats.size(); ++i)
    {
        result = formats.getUnchecked(i)->createInstanceFromDescription (description);

        if (result != nullptr)
            break;
    }

    if (result == nullptr)
    {
        if (! doesPluginStillExist (description))
            errorMessage = TRANS ("This plug-in file no longer exists");
        else
            errorMessage = TRANS ("This plug-in failed to load correctly");
    }

    return result;
}