Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding ext/draft/gain-reduction.h #440

Merged
merged 3 commits into from
Jan 17, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions include/clap/ext/draft/gain-reduction.h
Original file line number Diff line number Diff line change
@@ -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
Loading