diff --git a/examples/gain/src/lib.rs b/examples/gain/src/lib.rs
index f78ec69..f7cf0d8 100644
--- a/examples/gain/src/lib.rs
+++ b/examples/gain/src/lib.rs
@@ -1,5 +1,6 @@
use std::io::{self, Read, Write};
+use coupler::format::clap::*;
use coupler::format::vst3::*;
use coupler::{buffers::*, bus::*, events::*, param::*, parent::*, *};
@@ -92,6 +93,14 @@ impl Vst3Plugin for Gain {
}
}
+impl ClapPlugin for Gain {
+ fn clap_info() -> ClapInfo {
+ ClapInfo {
+ id: "rs.coupler.gain".to_string(),
+ }
+ }
+}
+
pub struct GainProcessor {
gain: f32,
}
diff --git a/src/format/clap/factory.rs b/src/format/clap/factory.rs
new file mode 100644
index 0000000..70cd44a
--- /dev/null
+++ b/src/format/clap/factory.rs
@@ -0,0 +1,106 @@
+use std::cell::UnsafeCell;
+use std::ffi::{c_char, c_void, CStr, CString};
+use std::marker::PhantomData;
+use std::ptr;
+
+use clap_sys::{host::*, plugin::*, plugin_factory::*, version::*};
+
+use super::ClapPlugin;
+use crate::Plugin;
+
+#[doc(hidden)]
+#[repr(C)]
+pub struct Factory
{
+ #[allow(unused)]
+ factory: clap_plugin_factory,
+ descriptor: UnsafeCell