Skip to content

Commit e292447

Browse files
authored
Merge pull request #359 from free-audio/next
CLAP 1.1.10
2 parents 094bb76 + 5651cd6 commit e292447

19 files changed

+72
-36
lines changed

ChangeLog.md

+7
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
# Changes in 1.1.10
2+
3+
* [params.h](include/clap/ext/params.h): add `CLAP_PARAM_IS_ENUM` flag.
4+
* various documentation improvements:
5+
* clarification on the return value of many functions
6+
* typos
7+
18
# Changes in 1.1.9
29

310
* [entry.h](include/clap/entry.h): clarify what the `plugin_path` is on macOS

include/clap/ext/audio-ports-config.h

+7-5
Original file line numberDiff line numberDiff line change
@@ -54,20 +54,21 @@ typedef struct clap_audio_ports_config {
5454

5555
// The audio ports config scan has to be done while the plugin is deactivated.
5656
typedef struct clap_plugin_audio_ports_config {
57-
// gets the number of available configurations
57+
// Gets the number of available configurations
5858
// [main-thread]
5959
uint32_t(CLAP_ABI *count)(const clap_plugin_t *plugin);
6060

61-
// gets information about a configuration
61+
// Gets information about a configuration
62+
// Returns true on success and stores the result into config.
6263
// [main-thread]
6364
bool(CLAP_ABI *get)(const clap_plugin_t *plugin,
6465
uint32_t index,
6566
clap_audio_ports_config_t *config);
6667

67-
// selects the configuration designated by id
68-
// returns true if the configuration could be applied.
68+
// Selects the configuration designated by id
69+
// Returns true if the configuration could be applied.
6970
// Once applied the host should scan again the audio ports.
70-
// [main-thread,plugin-deactivated]
71+
// [main-thread & plugin-deactivated]
7172
bool(CLAP_ABI *select)(const clap_plugin_t *plugin, clap_id config_id);
7273
} clap_plugin_audio_ports_config_t;
7374

@@ -82,6 +83,7 @@ typedef struct clap_plugin_audio_ports_config_info {
8283

8384
// Get info about an audio port, for a given config_id.
8485
// This is analogous to clap_plugin_audio_ports.get().
86+
// Returns true on success and stores the result into info.
8587
// [main-thread]
8688
bool(CLAP_ABI *get)(const clap_plugin_t *plugin,
8789
clap_id config_id,

include/clap/ext/audio-ports.h

+3-2
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,12 @@ typedef struct clap_audio_port_info {
6767

6868
// The audio ports scan has to be done while the plugin is deactivated.
6969
typedef struct clap_plugin_audio_ports {
70-
// number of ports, for either input or output
70+
// Number of ports, for either input or output
7171
// [main-thread]
7272
uint32_t(CLAP_ABI *count)(const clap_plugin_t *plugin, bool is_input);
7373

74-
// get info about about an audio port.
74+
// Get info about an audio port.
75+
// Returns true on success and stores the result into info.
7576
// [main-thread]
7677
bool(CLAP_ABI *get)(const clap_plugin_t *plugin,
7778
uint32_t index,

include/clap/ext/draft/context-menu.h

+7-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,8 @@ typedef struct clap_context_menu_builder {
9494
void *ctx;
9595

9696
// Adds an entry to the menu.
97-
// entry_data type is determined by entry_kind.
97+
// item_data type is determined by item_kind.
98+
// Returns true on success.
9899
bool(CLAP_ABI *add_item)(const struct clap_context_menu_builder *builder,
99100
clap_context_menu_item_kind_t item_kind,
100101
const void *item_data);
@@ -107,13 +108,15 @@ typedef struct clap_context_menu_builder {
107108
typedef struct clap_plugin_context_menu {
108109
// Insert plugin's menu items into the menu builder.
109110
// If target is null, assume global context.
111+
// Returns true on success.
110112
// [main-thread]
111113
bool(CLAP_ABI *populate)(const clap_plugin_t *plugin,
112114
const clap_context_menu_target_t *target,
113115
const clap_context_menu_builder_t *builder);
114116

115117
// Performs the given action, which was previously provided to the host via populate().
116118
// If target is null, assume global context.
119+
// Returns true on success.
117120
// [main-thread]
118121
bool(CLAP_ABI *perform)(const clap_plugin_t *plugin,
119122
const clap_context_menu_target_t *target,
@@ -123,13 +126,15 @@ typedef struct clap_plugin_context_menu {
123126
typedef struct clap_host_context_menu {
124127
// Insert host's menu items into the menu builder.
125128
// If target is null, assume global context.
129+
// Returns true on success.
126130
// [main-thread]
127131
bool(CLAP_ABI *populate)(const clap_host_t *host,
128132
const clap_context_menu_target_t *target,
129133
const clap_context_menu_builder_t *builder);
130134

131135
// Performs the given action, which was previously provided to the plugin via populate().
132136
// If target is null, assume global context.
137+
// Returns true on success.
133138
// [main-thread]
134139
bool(CLAP_ABI *perform)(const clap_host_t *host,
135140
const clap_context_menu_target_t *target,
@@ -145,6 +150,7 @@ typedef struct clap_host_context_menu {
145150
// If the plugin is using embedded GUI, then x and y are relative to the plugin's window,
146151
// otherwise they're absolute coordinate, and screen index might be set accordingly.
147152
// If target is null, assume global context.
153+
// Returns true on success.
148154
// [main-thread]
149155
bool(CLAP_ABI *popup)(const clap_host_t *host,
150156
const clap_context_menu_target_t *target,

include/clap/ext/draft/midi-mappings.h

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ typedef struct clap_plugin_midi_mappings {
2626
// [main-thread]
2727
uint32_t(CLAP_ABI *count)(const clap_plugin_t *plugin);
2828

29+
// Returns true on success and stores the result into mapping.
2930
// [main-thread]
3031
bool(CLAP_ABI *get)(const clap_plugin_t *plugin, uint32_t index, clap_midi_mapping_t *mapping);
3132
} clap_plugin_midi_mappings_t;

include/clap/ext/draft/preset-load.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ extern "C" {
1111
typedef struct clap_plugin_preset_load {
1212
// Loads a preset in the plugin native preset file format from a location.
1313
// The preset discovery provider defines the location and load_key to be passed to this function.
14-
//
14+
// Returns true on success.
1515
// [main-thread]
1616
bool(CLAP_ABI *from_location)(const clap_plugin_t *plugin,
1717
uint32_t location_kind,

include/clap/ext/draft/remote-controls.h

+1
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ typedef struct clap_plugin_remote_controls {
5656
uint32_t(CLAP_ABI *count)(const clap_plugin_t *plugin);
5757

5858
// Get a page by index.
59+
// Returns true on success and stores the result into page.
5960
// [main-thread]
6061
bool(CLAP_ABI *get)(const clap_plugin_t *plugin,
6162
uint32_t page_index,

include/clap/ext/draft/track-info.h

+1
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ typedef struct clap_plugin_track_info {
5252

5353
typedef struct clap_host_track_info {
5454
// Get info about the track the plugin belongs to.
55+
// Returns true on success and stores the result into info.
5556
// [main-thread]
5657
bool(CLAP_ABI *get)(const clap_host_t *host, clap_track_info_t *info);
5758
} clap_host_track_info_t;

include/clap/ext/draft/triggers.h

-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ typedef struct clap_plugin_triggers {
8888
uint32_t(CLAP_ABI *count)(const clap_plugin_t *plugin);
8989

9090
// Copies the trigger's info to trigger_info and returns true on success.
91-
// Returns true on success.
9291
// [main-thread]
9392
bool(CLAP_ABI *get_info)(const clap_plugin_t *plugin,
9493
uint32_t index,

include/clap/ext/draft/tuning.h

+1
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ typedef struct clap_host_tuning {
6464
uint32_t(CLAP_ABI *get_tuning_count)(const clap_host_t *host);
6565

6666
// Gets info about a tuning
67+
// Returns true on success and stores the result into info.
6768
// [main-thread]
6869
bool(CLAP_ABI *get_info)(const clap_host_t *host,
6970
uint32_t tuning_index,

include/clap/ext/event-registry.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ typedef struct clap_host_event_registry {
1212
// Queries an event space id.
1313
// The space id 0 is reserved for CLAP's core events. See CLAP_CORE_EVENT_SPACE.
1414
//
15-
// Return false and sets *space to UINT16_MAX if the space name is unknown to the host.
15+
// Return false and sets *space_id to UINT16_MAX if the space name is unknown to the host.
1616
// [main-thread]
1717
bool(CLAP_ABI *query)(const clap_host_t *host, const char *space_name, uint16_t *space_id);
1818
} clap_host_event_registry_t;

include/clap/ext/gui.h

+14-15
Original file line numberDiff line numberDiff line change
@@ -204,25 +204,24 @@ typedef struct clap_host_gui {
204204
// [thread-safe & !floating]
205205
void(CLAP_ABI *resize_hints_changed)(const clap_host_t *host);
206206

207-
/* Request the host to resize the client area to width, height.
208-
* Return true if the new size is accepted, false otherwise.
209-
* The host doesn't have to call set_size().
210-
*
211-
* Note: if not called from the main thread, then a return value simply means that the host
212-
* acknowledged the request and will process it asynchronously. If the request then can't be
213-
* satisfied then the host will call set_size() to revert the operation.
214-
*
215-
* [thread-safe & !floating] */
207+
// Request the host to resize the client area to width, height.
208+
// Return true if the new size is accepted, false otherwise.
209+
// The host doesn't have to call set_size().
210+
//
211+
// Note: if not called from the main thread, then a return value simply means that the host
212+
// acknowledged the request and will process it asynchronously. If the request then can't be
213+
// satisfied then the host will call set_size() to revert the operation.
214+
// [thread-safe & !floating]
216215
bool(CLAP_ABI *request_resize)(const clap_host_t *host, uint32_t width, uint32_t height);
217216

218-
/* Request the host to show the plugin gui.
219-
* Return true on success, false otherwise.
220-
* [thread-safe] */
217+
// Request the host to show the plugin gui.
218+
// Return true on success, false otherwise.
219+
// [thread-safe]
221220
bool(CLAP_ABI *request_show)(const clap_host_t *host);
222221

223-
/* Request the host to hide the plugin gui.
224-
* Return true on success, false otherwise.
225-
* [thread-safe] */
222+
// Request the host to hide the plugin gui.
223+
// Return true on success, false otherwise.
224+
// [thread-safe]
226225
bool(CLAP_ABI *request_hide)(const clap_host_t *host);
227226

228227
// The floating window has been closed, or the connection to the gui has been lost.

include/clap/ext/note-ports.h

+3-2
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,12 @@ typedef struct clap_note_port_info {
4040

4141
// The note ports scan has to be done while the plugin is deactivated.
4242
typedef struct clap_plugin_note_ports {
43-
// number of ports, for either input or output
43+
// Number of ports, for either input or output.
4444
// [main-thread]
4545
uint32_t(CLAP_ABI *count)(const clap_plugin_t *plugin, bool is_input);
4646

47-
// get info about about a note port.
47+
// Get info about a note port.
48+
// Returns true on success and stores the result into info.
4849
// [main-thread]
4950
bool(CLAP_ABI *get)(const clap_plugin_t *plugin,
5051
uint32_t index,

include/clap/ext/params.h

+15-5
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,11 @@ enum {
195195
// A simple example would be a DC Offset, changing it will change the output signal and must be
196196
// processed.
197197
CLAP_PARAM_REQUIRES_PROCESS = 1 << 15,
198+
199+
// This parameter represents an enumerated value.
200+
// If you set this flag, then you must set CLAP_PARAM_IS_STEPPED too.
201+
// All values from min to max must not have a blank value_to_text().
202+
CLAP_PARAM_IS_ENUM = 1 << 16,
198203
};
199204
typedef uint32_t clap_param_info_flags;
200205

@@ -251,27 +256,32 @@ typedef struct clap_plugin_params {
251256
// [main-thread]
252257
uint32_t(CLAP_ABI *count)(const clap_plugin_t *plugin);
253258

254-
// Copies the parameter's info to param_info. Returns true on success.
259+
// Copies the parameter's info to param_info.
260+
// Returns true on success.
255261
// [main-thread]
256262
bool(CLAP_ABI *get_info)(const clap_plugin_t *plugin,
257263
uint32_t param_index,
258264
clap_param_info_t *param_info);
259265

260-
// Writes the parameter's current value to out_value. Returns true on success.
266+
// Writes the parameter's current value to out_value.
267+
// Returns true on success.
261268
// [main-thread]
262269
bool(CLAP_ABI *get_value)(const clap_plugin_t *plugin, clap_id param_id, double *out_value);
263270

264271
// Fills out_buffer with a null-terminated UTF-8 string that represents the parameter at the
265-
// given 'value' argument. eg: "2.3 kHz". Returns true on success. The host should always use
266-
// this to format parameter values before displaying it to the user. [main-thread]
272+
// given 'value' argument. eg: "2.3 kHz". The host should always use this to format parameter
273+
// values before displaying it to the user.
274+
// Returns true on success.
275+
// [main-thread]
267276
bool(CLAP_ABI *value_to_text)(const clap_plugin_t *plugin,
268277
clap_id param_id,
269278
double value,
270279
char *out_buffer,
271280
uint32_t out_buffer_capacity);
272281

273282
// Converts the null-terminated UTF-8 param_value_text into a double and writes it to out_value.
274-
// Returns true on success. The host can use this to convert user input into a parameter value.
283+
// The host can use this to convert user input into a parameter value.
284+
// Returns true on success.
275285
// [main-thread]
276286
bool(CLAP_ABI *text_to_value)(const clap_plugin_t *plugin,
277287
clap_id param_id,

include/clap/ext/posix-fd-support.h

+3
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,15 @@ typedef struct clap_plugin_posix_fd_support {
3131
} clap_plugin_posix_fd_support_t;
3232

3333
typedef struct clap_host_posix_fd_support {
34+
// Returns true on success.
3435
// [main-thread]
3536
bool(CLAP_ABI *register_fd)(const clap_host_t *host, int fd, clap_posix_fd_flags_t flags);
3637

38+
// Returns true on success.
3739
// [main-thread]
3840
bool(CLAP_ABI *modify_fd)(const clap_host_t *host, int fd, clap_posix_fd_flags_t flags);
3941

42+
// Returns true on success.
4043
// [main-thread]
4144
bool(CLAP_ABI *unregister_fd)(const clap_host_t *host, int fd);
4245
} clap_host_posix_fd_support_t;

include/clap/ext/timer-support.h

+2
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,11 @@ typedef struct clap_host_timer_support {
1717
// Registers a periodic timer.
1818
// The host may adjust the period if it is under a certain threshold.
1919
// 30 Hz should be allowed.
20+
// Returns true on success.
2021
// [main-thread]
2122
bool(CLAP_ABI *register_timer)(const clap_host_t *host, uint32_t period_ms, clap_id *timer_id);
2223

24+
// Returns true on success.
2325
// [main-thread]
2426
bool(CLAP_ABI *unregister_timer)(const clap_host_t *host, clap_id timer_id);
2527
} clap_host_timer_support_t;

include/clap/factory/draft/preset-discovery.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ typedef struct clap_preset_discovery_metadata_receiver {
131131
// the plugin wants but it could also be some other unique id like a database primary key or a
132132
// binary offset. It's use is entirely up to the plug-in.
133133
//
134-
// If the function returns false, the the provider must stop calling back into the receiver.
134+
// If the function returns false, then the provider must stop calling back into the receiver.
135135
bool(CLAP_ABI *begin_preset)(const struct clap_preset_discovery_metadata_receiver *receiver,
136136
const char *name,
137137
const char *load_key);
@@ -242,6 +242,7 @@ typedef struct clap_preset_discovery_provider {
242242
void(CLAP_ABI *destroy)(const struct clap_preset_discovery_provider *provider);
243243

244244
// reads metadata from the given file and passes them to the metadata receiver
245+
// Returns true on success.
245246
bool(CLAP_ABI *get_metadata)(const struct clap_preset_discovery_provider *provider,
246247
uint32_t location_kind,
247248
const char *location,

include/clap/plugin.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ typedef struct clap_plugin {
5959
// call. The process's sample rate will be constant and process's frame count will included in
6060
// the [min, max] range, which is bounded by [1, INT32_MAX].
6161
// Once activated the latency and port configuration must remain constant, until deactivation.
62-
//
62+
// Returns true on success.
6363
// [main-thread & !active_state]
6464
bool(CLAP_ABI *activate)(const struct clap_plugin *plugin,
6565
double sample_rate,
@@ -69,6 +69,7 @@ typedef struct clap_plugin {
6969
void(CLAP_ABI *deactivate)(const struct clap_plugin *plugin);
7070

7171
// Call start processing before processing.
72+
// Returns true on success.
7273
// [audio-thread & active_state & !processing_state]
7374
bool(CLAP_ABI *start_processing)(const struct clap_plugin *plugin);
7475

include/clap/version.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ typedef struct clap_version {
2222

2323
#define CLAP_VERSION_MAJOR 1
2424
#define CLAP_VERSION_MINOR 1
25-
#define CLAP_VERSION_REVISION 9
25+
#define CLAP_VERSION_REVISION 10
2626

2727
#define CLAP_VERSION_INIT \
2828
{ (uint32_t)CLAP_VERSION_MAJOR, (uint32_t)CLAP_VERSION_MINOR, (uint32_t)CLAP_VERSION_REVISION }

0 commit comments

Comments
 (0)