From 4014d83a9b91a6f4f8bc77bee54b73519c7e3b06 Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Wed, 26 Jan 2022 21:12:02 +0100 Subject: [PATCH] Allow creating VST3 plugin instances --- src/wrapper/vst3.rs | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/wrapper/vst3.rs b/src/wrapper/vst3.rs index e0987abf..35f9e5bd 100644 --- a/src/wrapper/vst3.rs +++ b/src/wrapper/vst3.rs @@ -90,12 +90,17 @@ impl IPluginFactory for Factory

{ unsafe fn create_instance( &self, - cid: *const vst3_com::IID, - _iid: *const vst3_com::IID, - obj: *mut *mut vst3_com::c_void, + cid: *const vst3_sys::IID, + _iid: *const vst3_sys::IID, + obj: *mut *mut vst3_sys::c_void, ) -> tresult { - return kResultFalse; - todo!() + if *cid != self.cid { + return kNoInterface; + } + + *obj = Box::into_raw(Wrapper::

::new()) as *mut vst3_sys::c_void; + + kResultOk } }