Skip to content

Commit 41e83c9

Browse files
committed
Merge mini cure display and the hints extension
1 parent ef40453 commit 41e83c9

File tree

3 files changed

+51
-70
lines changed

3 files changed

+51
-70
lines changed

include/clap/all.h

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
#include "ext/draft/extensible-audio-ports.h"
99
#include "ext/draft/gain-adjustment-metering.h"
1010
#include "ext/draft/mini-curve-display.h"
11-
#include "ext/draft/mini-curve-display-hints.h"
1211
#include "ext/draft/project-location.h"
1312
#include "ext/draft/resource-directory.h"
1413
#include "ext/draft/scratch-memory.h"

include/clap/ext/draft/mini-curve-display-hints.h

-69
This file was deleted.

include/clap/ext/draft/mini-curve-display.h

+51
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,50 @@ static CLAP_CONSTEXPR const char CLAP_EXT_MINI_CURVE_DISPLAY[] = "clap.mini-curv
1111
extern "C" {
1212
#endif
1313

14+
enum clap_mini_curve_display_curve_kind {
15+
// The mini curve is intended to draw the total gain response of the plugin.
16+
// In this case the y values are in dB and the x values are in hz (logarithmic).
17+
// This would be useful in for example an equalizer.
18+
CLAP_MINI_CURVE_DISPLAY_CURVE_KIND_GAIN_RESPONSE = 1,
19+
20+
// The mini curve is intended to draw the total phase response of the plugin.
21+
// In this case the y values are in radians and the x values are in hz (logarithmic).
22+
// This would be useful in for example an equalizer.
23+
CLAP_MINI_CURVE_DISPLAY_CURVE_KIND_PHASE_RESPONSE = 2,
24+
25+
// The mini curve is intended to draw the transfer curve of the plugin.
26+
// In this case the both x and y values are in dB.
27+
// This would be useful in for example a compressor or distortion plugin.
28+
CLAP_MINI_CURVE_DISPLAY_CURVE_KIND_TRANSFER_CURVE = 3,
29+
30+
// This mini curve is intended to draw gain reduction over time. In this case
31+
// x refers to the window in seconds and y refers to level in dB, x_min is
32+
// always 0, and x_max would be the duration of the window.
33+
// This would be useful in for example a compressor or limiter.
34+
CLAP_MINI_CURVE_DISPLAY_CURVE_KIND_GAIN_REDUCTION = 4,
35+
36+
// This curve is intended as a generic time series plot. In this case
37+
// x refers to the window in seconds. x_min is always 0, and x_max would be the duration of the
38+
// window.
39+
// Y is not specified and up to the plugin.
40+
CLAP_MINI_CURVE_DISPLAY_CURVE_KIND_TIME_SERIES = 5,
41+
42+
// Note: more entries could be added here in the future
43+
};
44+
45+
typedef struct clap_mini_display_curve_hints {
46+
47+
// Range for the x axis.
48+
double x_min;
49+
double x_max;
50+
51+
// Range for the y axis.
52+
double y_min;
53+
double y_max;
54+
55+
} clap_mini_display_curve_hints_t;
56+
57+
1458
typedef struct clap_plugin_mini_curve_display {
1559
// Renders the curve into the data buffer.
1660
// The value 0 will be at the bottom of the curve and UINT16_MAX will be at the top.
@@ -49,6 +93,13 @@ enum clap_mini_curve_display_change_flags {
4993
};
5094

5195
typedef struct clap_host_mini_curve_display {
96+
// Fills in the given clap_mini_display_curve_hints_t structure and returns
97+
// true if succesful. If not, return false.
98+
// [main-thread]
99+
bool(CLAP_ABI *get)(const clap_host_t *host,
100+
uint32_t kind,
101+
clap_mini_display_curve_hints_t *hints);
102+
52103
// Mark the curve as being static or dynamic.
53104
// The curve is initially considered as static, though the plugin should explicitely
54105
// initialize this state.

0 commit comments

Comments
 (0)