These are the changes I mentioned in the Discord. The idea is to have VstPtr<T> mirror the VST3 SDK's Steinberg::IPtr<T>, but with clearer ownership semantics. This is explained in slightly more depth in the doc comment on VstPtr, but the short version is that VstPtr::owned() should be used with functions that return an object instance so the caller has ownership over the object, and VstPtr::shared() should be used with objects that are shared with the callee as a function argument. Lifetime management then works exactly the same as with a regular Arc<T>. There is also a RawVstPtr<T> with a corresponding StaticVstPtr<T> argument type for the FFI compatibility that doesn't do any lifetime management. This was needed because JUCE based hosts will segfault as soon as a parameter value queue is released once, no matter how many references were added before that point. The other changes made are:
Removed a lot of unused OLE machinery.
Made the couple return status constants in the vst3_com crate that are still left platform aware. These constants were used in a couple places in the implementations in that crate, so it seems like a good idea that they're actually set to the correct values on Linux and macOS.
Changed the again example to use this new, much cleaner API.
These are the changes I mentioned in the Discord. The idea is to have
VstPtr<T>
mirror the VST3 SDK'sSteinberg::IPtr<T>
, but with clearer ownership semantics. This is explained in slightly more depth in the doc comment onVstPtr
, but the short version is thatVstPtr::owned()
should be used with functions that return an object instance so the caller has ownership over the object, andVstPtr::shared()
should be used with objects that are shared with the callee as a function argument. Lifetime management then works exactly the same as with a regularArc<T>
. There is also aRawVstPtr<T>
with a correspondingStaticVstPtr<T>
argument type for the FFI compatibility that doesn't do any lifetime management. This was needed because JUCE based hosts will segfault as soon as a parameter value queue is released once, no matter how many references were added before that point. The other changes made are:vst3_com
crate that are still left platform aware. These constants were used in a couple places in the implementations in that crate, so it seems like a good idea that they're actually set to the correct values on Linux and macOS.