From 4e95590c071cd2963932713a9333132f6daf8a00 Mon Sep 17 00:00:00 2001 From: schwa Date: Fri, 17 Jan 2025 06:39:02 -0500 Subject: [PATCH] adding ext/draft/gain-reduction.h (#440) --- include/clap/ext/draft/gain-reduction.h | 35 +++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 include/clap/ext/draft/gain-reduction.h diff --git a/include/clap/ext/draft/gain-reduction.h b/include/clap/ext/draft/gain-reduction.h new file mode 100644 index 00000000..462ef04b --- /dev/null +++ b/include/clap/ext/draft/gain-reduction.h @@ -0,0 +1,35 @@ +#pragma once + +#include "../../plugin.h" + +// This extension lets the plugin report the current gain reduction to the host. + +static CLAP_CONSTEXPR const char CLAP_EXT_GAIN_REDUCTION[] = "clap.gain-reduction/0"; + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct clap_plugin_gain_reduction { + // Returns the current gain reduction in dB. The value is intended + // for informational display, for example in a host meter or tooltip. + // + // The function should be called on the audio thread to ensure consistency + // with processing time, although the host will likely use the value on + // the main thread. + // + // The returned value is in dB. Zero means the plugin is applying no gain + // reduction, or is not processing. A negative value means the plugin is + // applying gain reduction, as with a compressor or limiter. A positive + // value means the plugin is adding gain, as with an expander. The value + // represents the dynamic gain reduction or expansion applied by the + // plugin, before any make-up gain or other adjustment. A single value is + // returned for all audio channels. + // + // [audio-thread] + double(CLAP_ABI *get)(const clap_plugin_t *plugin); +} clap_plugin_gain_reduction_t; + +#ifdef __cplusplus +} +#endif