vst-rs
vst-rs copied to clipboard
Improve errors in PluginLoader::load()
In PluginLoader::load() when the VST file path exists but is the wrong bit size (e.g. trying to load a 32-bit VST in a 64-bit host), it returns PluginLoadError::InvalidPath which is confusing. It should only return that when !path.exists(), there should be a different error for failing to load the VST from the existing path.
Also, some VSTs, like the "kjaerhus audio classic series" only export a "main" function, not "VSTPluginMain". For those plugins it currently returns PluginLoadError::NotAPlugin but it should also be more differentiated. Either it should still load the VST with the "main" func or return a more useful error.
Also, it would make sense to take P: AsRef<Path> instead of &Path in load()..