From 1151a80769188f307371a6e2b1e3abf4b3e7f482 Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Mon, 28 Feb 2022 17:18:11 +0100 Subject: [PATCH] Add the other CLAP metadata fields --- plugins/diopser/src/lib.rs | 5 +++++ plugins/examples/gain-gui/src/lib.rs | 4 ++++ plugins/examples/gain/src/lib.rs | 4 ++++ plugins/examples/sine/src/lib.rs | 4 ++++ src/plugin.rs | 14 ++++++++++++++ 5 files changed, 31 insertions(+) diff --git a/plugins/diopser/src/lib.rs b/plugins/diopser/src/lib.rs index 938fe28a..e9b5793e 100644 --- a/plugins/diopser/src/lib.rs +++ b/plugins/diopser/src/lib.rs @@ -412,6 +412,11 @@ fn unnormalize_automation_precision(normalized: f32) -> u32 { impl ClapPlugin for Diopser { const CLAP_ID: &'static str = "nl.robbertvanderhelm.diopser"; + const CLAP_DESCRIPTION: &'static str = "A totally original phase rotation plugin"; + const CLAP_KEYWORDS: &'static [&'static str] = + &["audio_effect", "mono", "stereo", "filter", "utility"]; + const CLAP_MANUAL_URL: &'static str = Self::URL; + const CLAP_SUPPORT_URL: &'static str = Self::URL; } impl Vst3Plugin for Diopser { diff --git a/plugins/examples/gain-gui/src/lib.rs b/plugins/examples/gain-gui/src/lib.rs index 7cc61e95..171e59ab 100644 --- a/plugins/examples/gain-gui/src/lib.rs +++ b/plugins/examples/gain-gui/src/lib.rs @@ -204,6 +204,10 @@ impl Plugin for Gain { impl ClapPlugin for Gain { const CLAP_ID: &'static str = "com.moist-plugins-gmbh.gain"; + const CLAP_DESCRIPTION: &'static str = "A smoothed gain parameter example plugin"; + const CLAP_KEYWORDS: &'static [&'static str] = &["audio_effect", "mono", "stereo", "tool"]; + const CLAP_MANUAL_URL: &'static str = Self::URL; + const CLAP_SUPPORT_URL: &'static str = Self::URL; } impl Vst3Plugin for Gain { diff --git a/plugins/examples/gain/src/lib.rs b/plugins/examples/gain/src/lib.rs index dafc6a5f..472c54d3 100644 --- a/plugins/examples/gain/src/lib.rs +++ b/plugins/examples/gain/src/lib.rs @@ -131,6 +131,10 @@ impl Plugin for Gain { impl ClapPlugin for Gain { const CLAP_ID: &'static str = "com.moist-plugins-gmbh.gain"; + const CLAP_DESCRIPTION: &'static str = "A smoothed gain parameter example plugin"; + const CLAP_KEYWORDS: &'static [&'static str] = &["audio_effect", "mono", "stereo", "tool"]; + const CLAP_MANUAL_URL: &'static str = Self::URL; + const CLAP_SUPPORT_URL: &'static str = Self::URL; } impl Vst3Plugin for Gain { diff --git a/plugins/examples/sine/src/lib.rs b/plugins/examples/sine/src/lib.rs index f36250e3..da060673 100644 --- a/plugins/examples/sine/src/lib.rs +++ b/plugins/examples/sine/src/lib.rs @@ -178,6 +178,10 @@ impl Plugin for Sine { impl ClapPlugin for Sine { const CLAP_ID: &'static str = "com.moist-plugins-gmbh.sine"; + const CLAP_DESCRIPTION: &'static str = "An optionally MIDI controlled sine test tone"; + const CLAP_KEYWORDS: &'static [&'static str] = &["instrument", "mono", "stereo", "utility"]; + const CLAP_MANUAL_URL: &'static str = Self::URL; + const CLAP_SUPPORT_URL: &'static str = Self::URL; } impl Vst3Plugin for Sine { diff --git a/src/plugin.rs b/src/plugin.rs index aeb9b6b7..d9fa5f76 100644 --- a/src/plugin.rs +++ b/src/plugin.rs @@ -106,6 +106,20 @@ pub trait ClapPlugin: Plugin { /// A unique ID that identifies this particular plugin. This is usually in reverse domain name /// notation, e.g. `com.manufacturer.plugin-name`. const CLAP_ID: &'static str; + /// A short description for the plugin. + const CLAP_DESCRIPTION: &'static str; + /// Arbitrary keywords describing the plugin. See the CLAP specification for examples: + /// . + // + // TODO: CLAP mentions that `win32-dpi-aware` is a special keyword that informs the host that + // the plugin is DPI aware, can and should we have special handling for this? + const CLAP_KEYWORDS: &'static [&'static str]; + /// A URL to the plugin's manual, CLAP does not specify what to do when there is none. + // + // TODO: CLAP does not specify this, can these manual fields be null pointers? + const CLAP_MANUAL_URL: &'static str; + /// A URL to the plugin's support page, CLAP does not specify what to do when there is none. + const CLAP_SUPPORT_URL: &'static str; } /// Provides auxiliary metadata needed for a VST3 plugin.