commit 26153a12ec846ef1c838b8fcfc9c8cc7523bb04e
parent 723c62b5e109f5ae5f0d4fdf635ff92c31f4a9fd
Author: Alexandre Bique <bique.alexandre@gmail.com>
Date: Wed, 19 Oct 2016 10:15:33 +0200
more extern "C" and improve clap_state extension
Diffstat:
12 files changed, 112 insertions(+), 0 deletions(-)
diff --git a/include/clap/ext/audio-ports.h b/include/clap/ext/audio-ports.h
@@ -1,6 +1,10 @@
#ifndef CLAP_EXT_AUDIO_PORTS_H
# define CLAP_EXT_AUDIO_PORTS_H
+# ifdef __cplusplus
+extern "C" {
+# endif
+
# include "../clap.h"
# define CLAP_EXT_AUDIO_PORTS "clap/audio-ports"
@@ -100,4 +104,8 @@ struct clap_host_audio_ports
struct clap_plugin *plugin);
};
+# ifdef __cplusplus
+}
+# endif
+
#endif /* !CLAP_EXT_PORT_H */
diff --git a/include/clap/ext/draft/drum-map.h b/include/clap/ext/draft/drum-map.h
@@ -1,6 +1,10 @@
#ifndef CLAP_EXT_DRUM_MAP_H
# define CLAP_EXT_DRUM_MAP_H
+# ifdef __cplusplus
+extern "C" {
+# endif
+
# include "../../clap.h"
# define CLAP_EXT_DRUM_MAP "clap/draft/drum-map"
@@ -30,4 +34,16 @@ struct clap_plugin_drum_map
struct clap_drum_map_key_info *info);
};
+struct clap_host_drum_map
+{
+ /* Inform the host that the drum map has changed.
+ * [thread-safe] */
+ void (*drum_map_changed)(struct clap_host *host,
+ struct clap_plugin *plugin);
+};
+
+# ifdef __cplusplus
+}
+# endif
+
#endif /* !CLAP_EXT_DRUM_MAP_H */
diff --git a/include/clap/ext/draft/locale.h b/include/clap/ext/draft/locale.h
@@ -1,6 +1,10 @@
#ifndef CLAP_EXT_LOCALE_H
# define CLAP_EXT_LOCALE_H
+# ifdef __cplusplus
+extern "C" {
+# endif
+
# include "../../clap.h"
# define CLAP_EXT_LOCALE "clap/draft/locale"
@@ -12,4 +16,8 @@ struct clap_plugin_locale
bool (*set_locale)(struct clap_plugin *plugin, const char *locale);
};
+# ifdef __cplusplus
+}
+# endif
+
#endif /* !CLAP_EXT_LOCALE_H */
diff --git a/include/clap/ext/draft/presets.h b/include/clap/ext/draft/presets.h
@@ -1,6 +1,10 @@
#ifndef CLAP_EXT_PRESETS_H
# define CLAP_EXT_PRESETS_H
+# ifdef __cplusplus
+extern "C" {
+# endif
+
# include "../../clap.h"
# define CLAP_EXT_PRESETS "clap/draft/presets"
@@ -95,4 +99,8 @@ struct clap_preset_library
int32_t index);
};
+# ifdef __cplusplus
+}
+# endif
+
#endif /* !CLAP_EXT_PRESETS_H */
diff --git a/include/clap/ext/embed-cocoa.h b/include/clap/ext/embed-cocoa.h
@@ -1,6 +1,10 @@
#ifndef CLAP_EXT_EMBED_COCOA_H
# define CLAP_EXT_EMBED_COCOA_H
+# ifdef __cplusplus
+extern "C" {
+# endif
+
# include "../clap.h"
# include "embed.h"
@@ -24,4 +28,8 @@ struct clap_plugin_embed_cocoa
bool (*detach)(struct clap_plugin *plugin);
};
+# ifdef __cplusplus
+}
+# endif
+
#endif /* !CLAP_EXT_EMBED_COCOA_H */
diff --git a/include/clap/ext/embed-win32.h b/include/clap/ext/embed-win32.h
@@ -6,6 +6,10 @@
# include "../clap.h"
# include "embed.h"
+# ifdef __cplusplus
+extern "C" {
+# endif
+
# define CLAP_EXT_EMBED_WIN32 "clap/embed/win32"
struct clap_plugin_embed_win32
@@ -25,4 +29,8 @@ struct clap_plugin_embed_win32
bool (*detach)(struct clap_plugin *plugin);
};
+# ifdef __cplusplus
+}
+# endif
+
#endif /* !CLAP_EXT_EMBED_WIN32_H */
diff --git a/include/clap/ext/embed-x11.h b/include/clap/ext/embed-x11.h
@@ -6,6 +6,10 @@
# define CLAP_EXT_EMBED_X11 "clap/embed/x11"
+# ifdef __cplusplus
+extern "C" {
+# endif
+
struct clap_plugin_embed_x11
{
/* Get the size of the plugin UI.
@@ -30,4 +34,8 @@ struct clap_plugin_embed_x11
bool (*detach)(struct clap_plugin *plugin);
};
+# ifdef __cplusplus
+}
+# endif
+
#endif /* !CLAP_EMBED_XLIB_H */
diff --git a/include/clap/ext/embed.h b/include/clap/ext/embed.h
@@ -5,6 +5,10 @@
# define CLAP_EXT_EMBED "clap/embed"
+# ifdef __cplusplus
+extern "C" {
+# endif
+
struct clap_host_embed
{
/* Request the host to resize the client area to width, height.
@@ -13,4 +17,8 @@ struct clap_host_embed
bool (*resize)(struct clap_host *host, int32_t width, int32_t height);
};
+# ifdef __cplusplus
+}
+# endif
+
#endif /* !CLAP_EXT_EMBED_H */
diff --git a/include/clap/ext/event-ports.h b/include/clap/ext/event-ports.h
@@ -7,6 +7,10 @@
# define CLAP_MAIN_EVENT_PORT_ID 0
+# ifdef __cplusplus
+extern "C" {
+# endif
+
struct clap_audio_port_info
{
/* This number uniquely identify the port.
@@ -58,4 +62,8 @@ struct clap_plugin_event_ports
int32_t port_id);
};
+# ifdef __cplusplus
+}
+# endif
+
#endif /* !EVENT_PORTS_H */
diff --git a/include/clap/ext/gui.h b/include/clap/ext/gui.h
@@ -5,6 +5,10 @@
# define CLAP_EXT_GUI "clap/gui"
+# ifdef __cplusplus
+extern "C" {
+# endif
+
struct clap_plugin_gui
{
/* Open the GUI
@@ -33,4 +37,8 @@ struct clap_host_gui
struct clap_plugin *plugin);
};
+# ifdef __cplusplus
+}
+# endif
+
#endif /* !CLAP_EXT_GUI_H */
diff --git a/include/clap/ext/render.h b/include/clap/ext/render.h
@@ -5,6 +5,10 @@
# define CLAP_EXT_RENDER "clap/render"
+# ifdef __cplusplus
+extern "C" {
+# endif
+
enum clap_plugin_render_mode
{
/* Default setting, used to play "realtime". */
@@ -36,4 +40,8 @@ struct clap_plugin_render
enum clap_plugin_render_mode (*get_render_mode)(struct clap_plugin *plugin);
};
+# ifdef __cplusplus
+}
+# endif
+
#endif /* !CLAP_EXT_RENDER_H */
diff --git a/include/clap/ext/state.h b/include/clap/ext/state.h
@@ -5,6 +5,10 @@
# define CLAP_EXT_STATE "clap/state"
+# ifdef __cplusplus
+extern "C" {
+# endif
+
struct clap_plugin_state
{
/* The plugin has to allocate and save its state into *buffer.
@@ -17,4 +21,16 @@ struct clap_plugin_state
bool (*restore)(struct clap_plugin *plugin, const void *buffer, int32_t size);
};
+struct clap_host_state
+{
+ /* Tell the host that the plugin state has changed.
+ * [thread-safe] */
+ void (*set_dirty)(struct clap_host *host,
+ struct clap_plugin *plugin);
+};
+
+# ifdef __cplusplus
+}
+# endif
+
#endif /* !CLAP_EXT_STATE_H */