From 089f1589bfb2dc4ede60e9588189494e4d48af69 Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Mon, 28 Feb 2022 16:53:31 +0100 Subject: [PATCH] Add the remaining CLAP factory stubs --- src/wrapper/clap/factory.rs | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/src/wrapper/clap/factory.rs b/src/wrapper/clap/factory.rs index 43227335..85f75db6 100644 --- a/src/wrapper/clap/factory.rs +++ b/src/wrapper/clap/factory.rs @@ -1,5 +1,8 @@ +use clap_sys::host::clap_host; +use clap_sys::plugin::{clap_plugin, clap_plugin_descriptor}; use clap_sys::plugin_factory::clap_plugin_factory; use std::marker::PhantomData; +use std::os::raw::c_char; use crate::ClapPlugin; @@ -20,8 +23,8 @@ impl Default for Factory

{ Self { clap_plugin_factory: clap_plugin_factory { get_plugin_count: Self::get_plugin_count, - get_plugin_descriptor: todo!(), - create_plugin: todo!(), + get_plugin_descriptor: Self::get_plugin_descriptor, + create_plugin: Self::create_plugin, }, _phantom: PhantomData, } @@ -32,4 +35,19 @@ impl Factory

{ unsafe extern "C" fn get_plugin_count(_factory: *const clap_plugin_factory) -> u32 { 1 } + + unsafe extern "C" fn get_plugin_descriptor( + factory: *const clap_plugin_factory, + index: u32, + ) -> *const clap_plugin_descriptor { + todo!() + } + + unsafe extern "C" fn create_plugin( + factory: *const clap_plugin_factory, + host: *const clap_host, + plugin_id: *const c_char, + ) -> *const clap_plugin { + todo!() + } }