sim_lib_plugin_clap/
descriptor.rs1use sim_kernel::Result;
2use sim_lib_audio_graph_core::{PortDecl, PortDir, PortMedia};
3use sim_lib_plugin_core::{
4 ParameterDescriptor, ParameterKind, PluginDescriptor, PluginFormat, PluginId,
5};
6
7pub fn clap_audio_effect_descriptor(
13 stable_id: impl Into<String>,
14 name: impl Into<String>,
15 channels: u16,
16) -> Result<PluginDescriptor> {
17 PluginDescriptor::audio_effect(PluginFormat::Clap, stable_id, name, channels)
18}
19
20pub fn clap_gain_descriptor() -> Result<PluginDescriptor> {
25 Ok(
26 clap_audio_effect_descriptor("org.sim.gain", "SIM Gain", 2)?.with_parameter(
27 ParameterDescriptor::new(0, "gain", "Gain", 0.0, 2.0, 1.0)?
28 .with_kind(ParameterKind::Float),
29 ),
30 )
31}
32
33pub fn clap_synth_descriptor() -> Result<PluginDescriptor> {
39 let mut descriptor = PluginDescriptor::new(
40 PluginId::new(PluginFormat::Clap, "org.sim.subtractive-synth")?,
41 "SIM Subtractive Synth",
42 "sim",
43 env!("CARGO_PKG_VERSION"),
44 )?;
45 descriptor
46 .ports
47 .push(PortDecl::new("events-in", PortMedia::Event, PortDir::In, 1));
48 descriptor.ports.push(PortDecl::new(
49 "audio-out",
50 PortMedia::Audio,
51 PortDir::Out,
52 2,
53 ));
54 descriptor.parameters.push(ParameterDescriptor::new(
55 0,
56 "output-gain",
57 "Output Gain",
58 0.0,
59 1.0,
60 0.25,
61 )?);
62 Ok(descriptor)
63}