commit d03bfbbbe56d6277f19754434d05d84f0f52d9ae
parent 3c4f17243c9ea8b5eac6e77cbdd1504e3791e637
Author: Alexandre Bique <bique.alexandre@gmail.com>
Date: Fri, 30 Sep 2016 21:41:08 +0200
Temporary commit
Diffstat:
3 files changed, 33 insertions(+), 12 deletions(-)
diff --git a/include/clap/clap.h b/include/clap/clap.h
@@ -146,6 +146,7 @@ struct clap_event_param
float increment; // for param ramp
};
+/** Note On/Off event. */
struct clap_event_note
{
int8_t key; // 0..127
@@ -174,6 +175,7 @@ struct clap_event_jump
int32_t tempo; // tempo in samples
int32_t bar; // the bar number
int32_t bar_offset; // 0 <= bar_offset < tsig_denom * tempo
+ int64_t song_time; // song time in micro seconds
int32_t tsig_num; // time signature numerator
int32_t tsig_denom; // time signature denominator
};
@@ -195,9 +197,9 @@ struct clap_event_jump
*/
struct clap_event_program
{
- int32_t bank0; // 0..max
- int32_t bank1; // 0..max
- int32_t program; // 0..max
+ int32_t bank0; // 0..0x7FFFFFFF
+ int32_t bank1; // 0..0x7FFFFFFF
+ int32_t program; // 0..0x7FFFFFFF
};
struct clap_event
@@ -252,6 +254,8 @@ struct clap_host
{
int32_t clap_version; // initialized to CLAP_VERSION
+ void *host_data; // reserved pointer for the host
+
/* returns the size of the original string, 0 if not string */
int32_t (*get_attribute)(struct clap_host *host,
const char *attr,
@@ -264,11 +268,8 @@ struct clap_host
enum clap_log_severity severity,
const char *msg);
- /* feature extensions */
+ /* query an extension */
void *(*extension)(struct clap_host *host, const char *extention_id);
-
- /* host private data */
- void *host_data;
};
////////////
@@ -314,7 +315,7 @@ struct clap_plugin
enum clap_process_status (*process)(struct clap_plugin *plugin,
struct clap_process *process);
- /* features extensions */
+ /* query an extension */
void *(*extension)(struct clap_plugin *plugin, const char *id);
};
diff --git a/include/clap/ext/params.h b/include/clap/ext/params.h
@@ -44,7 +44,11 @@ struct clap_param
// the host
/* Can the parameter be automated at sample rate by an audio buffer? */
- bool accepts_audio_buffer;
+ bool supports_audio_buffer;
+
+ /* Can the parameter be automated by automation events? */
+ bool supports_automation_events;
+ bool supports_ramp_events;
union clap_param_value value; // current value
union clap_param_value min; // minimum value
@@ -71,6 +75,8 @@ struct clap_plugin_params
int32_t index,
struct clap_param *param);
+ /* Copies the module's info to module and returns true.
+ * If module_id is NULL or invalid then return false. */
bool (*get_module)(struct clap_plugin *plugin,
const char *module_id,
struct clap_param_module *module);
diff --git a/include/clap/ext/presets.h b/include/clap/ext/presets.h
@@ -15,25 +15,39 @@ struct clap_preset_info
uint8_t score; // 0 = garbage, ..., 100 = best
};
+struct clap_preset_handle
+{
+ void *priv;
+ int32_t num_presets;
+ // TODO cookie for fast rescan of huge bank file
+};
+
/* The principle behind this extension is that the host gets a list of
* directories to scan recursively, and then for each files, it can ask
* the interface to load the preset. */
-struct clap_plugin_presets
+struct clap_preset_library
{
/* Copies at most *path_size bytes into path.
* If directory_index is bigger than the number of directories,
* then return false. */
- bool (*get_directory)(struct clap_plugin_presets *presets,
+ bool (*get_directory)(struct clap_preset_library *reader,
int directory_index,
char *path,
int32_t *path_size);
+ bool (*open_bank)(struct clap_plugin_preset_reader *reader,
+ const char *path,
+ struct clap_preset_handle *handle);
+
+ void (*close_bank)(struct clap_plugin_preset_reader *reader,
+ struct clap_preset_handle *handle);
+
/* Get a preset info from its path and returns true.
* In case of a preset bank file, index is used, and *has_next
* should be set to false when index reaches the last preset.
* If the preset is not found, then it should return false. */
bool (*get_preset_info)(struct clap_plugin_presets *presets,
- const char *path,
+ void *cookie,
struct clap_preset_info *preset_info,
int32_t index,
bool *has_next);