clap

CLAP Audio Plugin API
Log | Files | Refs | README | LICENSE

commit 960ac8ea6bef86d773956c733ca411bd7636dce3
parent b554435f82a1aa0e648f22f5d33fc6c01a93f824
Author: Alexandre BIQUE <bique.alexandre@gmail.com>
Date:   Fri, 16 Jul 2021 17:29:06 +0200

Refactoring

Diffstat:
Minclude/clap/all.h | 4++--
Minclude/clap/ext/audio-ports.h | 2+-
Minclude/clap/ext/draft/check-for-update.h | 2+-
Dinclude/clap/ext/draft/event-filter.h | 27---------------------------
Minclude/clap/ext/draft/file-reference.h | 2+-
Minclude/clap/ext/draft/midi-mappings.h | 2+-
Dinclude/clap/ext/draft/note-name.h | 37-------------------------------------
Minclude/clap/ext/draft/preset-load.h | 2+-
Minclude/clap/ext/draft/quick-controls.h | 2+-
Minclude/clap/ext/draft/thread-pool.h | 2+-
Minclude/clap/ext/draft/track-info.h | 2+-
Minclude/clap/ext/draft/tuning.h | 2+-
Minclude/clap/ext/draft/vst2-convert.h | 2+-
Minclude/clap/ext/draft/vst3-convert.h | 2+-
Ainclude/clap/ext/event-filter.h | 28++++++++++++++++++++++++++++
Minclude/clap/ext/event-loop.h | 2+-
Minclude/clap/ext/gui-cocoa.h | 2+-
Minclude/clap/ext/gui-free-standing.h | 2+-
Minclude/clap/ext/gui-win32.h | 2+-
Minclude/clap/ext/gui-x11.h | 2+-
Minclude/clap/ext/gui.h | 4++--
Minclude/clap/ext/latency.h | 2+-
Minclude/clap/ext/log.h | 2+-
Ainclude/clap/ext/note-name.h | 37+++++++++++++++++++++++++++++++++++++
Minclude/clap/ext/params.h | 2+-
Minclude/clap/ext/render.h | 2+-
Minclude/clap/ext/state.h | 2+-
Minclude/clap/ext/thread-check.h | 2+-
28 files changed, 91 insertions(+), 90 deletions(-)

diff --git a/include/clap/all.h b/include/clap/all.h @@ -15,9 +15,9 @@ #include "ext/latency.h" #include "ext/thread-check.h" #include "ext/event-loop.h" +#include "ext/note-name.h" +#include "ext/event-filter.h" -#include "ext/draft/event-filter.h" -#include "ext/draft/note-name.h" #include "ext/draft/preset-load.h" #include "ext/draft/quick-controls.h" #include "ext/draft/thread-pool.h" diff --git a/include/clap/ext/audio-ports.h b/include/clap/ext/audio-ports.h @@ -30,7 +30,7 @@ /// Plugin with very complex configuration possibilities should let the user configure the ports /// from the plugin GUI, and call @ref clap_host_audio_ports.rescan(CLAP_AUDIO_PORTS_RESCAN_ALL). -static CLAP_CONSTEXPR const char CLAP_EXT_AUDIO_PORTS[] = "clap/audio-ports"; +static CLAP_CONSTEXPR const char CLAP_EXT_AUDIO_PORTS[] = "clap.audio-ports"; #ifdef __cplusplus extern "C" { diff --git a/include/clap/ext/draft/check-for-update.h b/include/clap/ext/draft/check-for-update.h @@ -2,7 +2,7 @@ #include "../../clap.h" -static CLAP_CONSTEXPR const char CLAP_EXT_CHECK_FOR_UPDATE[] = "clap/draft/check_for_update"; +static CLAP_CONSTEXPR const char CLAP_EXT_CHECK_FOR_UPDATE[] = "clap.check_for_update.draft/0"; #ifdef __cplusplus extern "C" { diff --git a/include/clap/ext/draft/event-filter.h b/include/clap/ext/draft/event-filter.h @@ -1,26 +0,0 @@ -#pragma once - -#include "../../clap.h" - -static CLAP_CONSTEXPR const char CLAP_EXT_EVENT_FILTER[] = "clap/draft/event_filter"; - -#ifdef __cplusplus -extern "C" { -#endif - -// This extension lets the host know which event types the plugin is interested -// in. -typedef struct clap_plugin_event_filter { - // Returns true if the plugin is interested in the given event type. - // [audio-thread] - bool (*accepts)(const clap_plugin *plugin, clap_event_type event_type); -} clap_plugin_event_filter; - - -typedef struct clap_host_event_filter { - void (*changed)(const clap_host *host); -} clap_host_event_filter; - -#ifdef __cplusplus -} -#endif -\ No newline at end of file diff --git a/include/clap/ext/draft/file-reference.h b/include/clap/ext/draft/file-reference.h @@ -3,7 +3,7 @@ #include "../../clap.h" #include "../../hash.h" -static CLAP_CONSTEXPR const char CLAP_EXT_FILE_REFERENCE[] = "clap/draft/file-reference"; +static CLAP_CONSTEXPR const char CLAP_EXT_FILE_REFERENCE[] = "clap.file-reference.draft/0"; #ifdef __cplusplus extern "C" { diff --git a/include/clap/ext/draft/midi-mappings.h b/include/clap/ext/draft/midi-mappings.h @@ -2,7 +2,7 @@ #include "../../clap.h" -static CLAP_CONSTEXPR const char CLAP_EXT_MIDI_MAPPINGS[] = "clap/draft/midi-mappings"; +static CLAP_CONSTEXPR const char CLAP_EXT_MIDI_MAPPINGS[] = "clap.midi-mappings.draft/0"; #ifdef __cplusplus extern "C" { diff --git a/include/clap/ext/draft/note-name.h b/include/clap/ext/draft/note-name.h @@ -1,36 +0,0 @@ -#pragma once - - -#include "../../clap.h" - -#ifdef __cplusplus -extern "C" { -#endif - -static CLAP_CONSTEXPR const char CLAP_EXT_NOTE_NAME[] = "clap/draft/note-name"; - -typedef struct clap_note_name { - char name[CLAP_NAME_SIZE]; - int8_t key; - int8_t channel; // -1 for every channels -} clap_note_name; - -typedef struct clap_plugin_note_name { - // Return the number of note names - // [main-thread] - uint32_t (*count)(const clap_plugin *plugin); - - // Returns true on success and stores the result into note_name - // [main-thread] - bool (*get)(const clap_plugin *plugin, uint32_t index, clap_note_name *note_name); -} clap_plugin_note_name; - -typedef struct clap_host_note_name { - // Informs the host that the note names has changed. - // [main-thread] - void (*changed)(const clap_host *host); -} clap_host_note_name; - -#ifdef __cplusplus -} -#endif -\ No newline at end of file diff --git a/include/clap/ext/draft/preset-load.h b/include/clap/ext/draft/preset-load.h @@ -2,7 +2,7 @@ #include "../../clap.h" -static const char CLAP_EXT_PRESET_LOAD[] = "clap/draft/preset-load"; +static const char CLAP_EXT_PRESET_LOAD[] = "clap.preset-load.draft/0"; #ifdef __cplusplus extern "C" { diff --git a/include/clap/ext/draft/quick-controls.h b/include/clap/ext/draft/quick-controls.h @@ -2,7 +2,7 @@ #include "../../clap.h" -static CLAP_CONSTEXPR const char CLAP_EXT_QUICK_CONTROLS[] = "clap/draft/quick-controls"; +static CLAP_CONSTEXPR const char CLAP_EXT_QUICK_CONTROLS[] = "clap.quick-controls.draft/0"; #ifdef __cplusplus extern "C" { diff --git a/include/clap/ext/draft/thread-pool.h b/include/clap/ext/draft/thread-pool.h @@ -32,7 +32,7 @@ /// } /// @endcode -static CLAP_CONSTEXPR const char CLAP_EXT_THREAD_POOL[] = "clap/draft/thread-pool"; +static CLAP_CONSTEXPR const char CLAP_EXT_THREAD_POOL[] = "clap.thread-pool.draft/0"; #ifdef __cplusplus extern "C" { diff --git a/include/clap/ext/draft/track-info.h b/include/clap/ext/draft/track-info.h @@ -4,7 +4,7 @@ #include "../../chmap.h" #include "../../color.h" -static CLAP_CONSTEXPR const char CLAP_EXT_TRACK_INFO[] = "clap/draft/track-info"; +static CLAP_CONSTEXPR const char CLAP_EXT_TRACK_INFO[] = "clap.track-info.draft/0"; #ifdef __cplusplus extern "C" { diff --git a/include/clap/ext/draft/tuning.h b/include/clap/ext/draft/tuning.h @@ -2,7 +2,7 @@ #include "../../clap.h" -static CLAP_CONSTEXPR const char CLAP_EXT_TUNING[] = "clap/draft/tuning"; +static CLAP_CONSTEXPR const char CLAP_EXT_TUNING[] = "clap.tuning.draft/0"; #ifdef __cplusplus extern "C" { diff --git a/include/clap/ext/draft/vst2-convert.h b/include/clap/ext/draft/vst2-convert.h @@ -3,7 +3,7 @@ #include "../../clap.h" #include "../../stream.h" -static CLAP_CONSTEXPR const char CLAP_EXT_VST2_CONVERT[] = "clap/draft/vst2-convert"; +static CLAP_CONSTEXPR const char CLAP_EXT_VST2_CONVERT[] = "clap.vst2-convert.draft/0"; #ifdef __cplusplus extern "C" { diff --git a/include/clap/ext/draft/vst3-convert.h b/include/clap/ext/draft/vst3-convert.h @@ -3,7 +3,7 @@ #include "../../clap.h" #include "../../stream.h" -static CLAP_CONSTEXPR const char CLAP_EXT_VST3_CONVERT[] = "clap/draft/vst3-convert"; +static CLAP_CONSTEXPR const char CLAP_EXT_VST3_CONVERT[] = "clap.vst3-convert.draft/0"; #ifdef __cplusplus extern "C" { diff --git a/include/clap/ext/event-filter.h b/include/clap/ext/event-filter.h @@ -0,0 +1,27 @@ +#pragma once + +#include "../clap.h" + +static CLAP_CONSTEXPR const char CLAP_EXT_EVENT_FILTER[] = "clap.event_filter"; + +#ifdef __cplusplus +extern "C" { +#endif + +// This extension lets the host know which event types the plugin is interested +// in. +typedef struct clap_plugin_event_filter { + // Returns true if the plugin is interested in the given event type. + // [audio-thread] + bool (*accepts)(const clap_plugin *plugin, clap_event_type event_type); +} clap_plugin_event_filter; + + +typedef struct clap_host_event_filter { + // [main-thread] + void (*changed)(const clap_host *host); +} clap_host_event_filter; + +#ifdef __cplusplus +} +#endif +\ No newline at end of file diff --git a/include/clap/ext/event-loop.h b/include/clap/ext/event-loop.h @@ -4,7 +4,7 @@ #include "../clap.h" -static CLAP_CONSTEXPR const char CLAP_EXT_EVENT_LOOP[] = "clap/event-loop"; +static CLAP_CONSTEXPR const char CLAP_EXT_EVENT_LOOP[] = "clap.event-loop"; #ifdef __cplusplus extern "C" { diff --git a/include/clap/ext/gui-cocoa.h b/include/clap/ext/gui-cocoa.h @@ -2,7 +2,7 @@ #include "../clap.h" -static CLAP_CONSTEXPR const char CLAP_EXT_GUI_COCOA[] = "clap/gui-cocoa"; +static CLAP_CONSTEXPR const char CLAP_EXT_GUI_COCOA[] = "clap.gui-cocoa"; #ifdef __cplusplus extern "C" { diff --git a/include/clap/ext/gui-free-standing.h b/include/clap/ext/gui-free-standing.h @@ -2,7 +2,7 @@ #include "../clap.h" -static CLAP_CONSTEXPR const char CLAP_EXT_GUI_FREE_STANDING[] = "clap/gui-free-standing"; +static CLAP_CONSTEXPR const char CLAP_EXT_GUI_FREE_STANDING[] = "clap.gui-free-standing"; #ifdef __cplusplus extern "C" { diff --git a/include/clap/ext/gui-win32.h b/include/clap/ext/gui-win32.h @@ -2,7 +2,7 @@ #include "../clap.h" -static CLAP_CONSTEXPR const char CLAP_EXT_GUI_WIN32[] = "clap/gui-win32"; +static CLAP_CONSTEXPR const char CLAP_EXT_GUI_WIN32[] = "clap.gui-win32"; #ifdef __cplusplus extern "C" { diff --git a/include/clap/ext/gui-x11.h b/include/clap/ext/gui-x11.h @@ -2,7 +2,7 @@ #include "../clap.h" -static CLAP_CONSTEXPR const char CLAP_EXT_GUI_X11[] = "clap/gui-x11"; +static CLAP_CONSTEXPR const char CLAP_EXT_GUI_X11[] = "clap.gui-x11"; #ifdef __cplusplus extern "C" { diff --git a/include/clap/ext/gui.h b/include/clap/ext/gui.h @@ -2,7 +2,7 @@ #include "../clap.h" -static CLAP_CONSTEXPR const char CLAP_EXT_GUI[] = "clap/gui"; +static CLAP_CONSTEXPR const char CLAP_EXT_GUI[] = "clap.gui"; #ifdef __cplusplus extern "C" { @@ -40,7 +40,7 @@ typedef struct clap_host_gui { /* Request the host to resize the client area to width, height. * Return true on success, false otherwise. * [thread-safe] */ - bool (*resize)(const clap_host *host, int32_t width, int32_t height); + bool (*resize)(const clap_host *host, uint32_t width, uint32_t height); } clap_host_gui; #ifdef __cplusplus diff --git a/include/clap/ext/latency.h b/include/clap/ext/latency.h @@ -3,7 +3,7 @@ #include "../clap.h" #include <stdint.h> -static CLAP_CONSTEXPR const char CLAP_EXT_LATENCY[] = "clap/latency"; +static CLAP_CONSTEXPR const char CLAP_EXT_LATENCY[] = "clap.latency"; #ifdef __cplusplus extern "C" { diff --git a/include/clap/ext/log.h b/include/clap/ext/log.h @@ -2,7 +2,7 @@ #include "../clap.h" -static CLAP_CONSTEXPR const char CLAP_EXT_LOG[] = "clap/log"; +static CLAP_CONSTEXPR const char CLAP_EXT_LOG[] = "clap.log"; #ifdef __cplusplus extern "C" { diff --git a/include/clap/ext/note-name.h b/include/clap/ext/note-name.h @@ -0,0 +1,36 @@ +#pragma once + + +#include "../clap.h" + +#ifdef __cplusplus +extern "C" { +#endif + +static CLAP_CONSTEXPR const char CLAP_EXT_NOTE_NAME[] = "clap.note-name"; + +typedef struct clap_note_name { + char name[CLAP_NAME_SIZE]; + int8_t key; + int8_t channel; // -1 for every channels +} clap_note_name; + +typedef struct clap_plugin_note_name { + // Return the number of note names + // [main-thread] + uint32_t (*count)(const clap_plugin *plugin); + + // Returns true on success and stores the result into note_name + // [main-thread] + bool (*get)(const clap_plugin *plugin, uint32_t index, clap_note_name *note_name); +} clap_plugin_note_name; + +typedef struct clap_host_note_name { + // Informs the host that the note names has changed. + // [main-thread] + void (*changed)(const clap_host *host); +} clap_host_note_name; + +#ifdef __cplusplus +} +#endif +\ No newline at end of file diff --git a/include/clap/ext/params.h b/include/clap/ext/params.h @@ -73,7 +73,7 @@ /// - if a parameter is created with an id that may have been used before, /// call clap_host_params.clear(host, param_id, CLAP_PARAM_CLEAR_ALL) -static CLAP_CONSTEXPR const char CLAP_EXT_PARAMS[] = "clap/params"; +static CLAP_CONSTEXPR const char CLAP_EXT_PARAMS[] = "clap.params"; #ifdef __cplusplus extern "C" { diff --git a/include/clap/ext/render.h b/include/clap/ext/render.h @@ -2,7 +2,7 @@ #include "../clap.h" -static CLAP_CONSTEXPR const char CLAP_EXT_RENDER[] = "clap/render"; +static CLAP_CONSTEXPR const char CLAP_EXT_RENDER[] = "clap.render"; #ifdef __cplusplus extern "C" { diff --git a/include/clap/ext/state.h b/include/clap/ext/state.h @@ -3,7 +3,7 @@ #include "../clap.h" #include "../stream.h" -static CLAP_CONSTEXPR const char CLAP_EXT_STATE[] = "clap/state"; +static CLAP_CONSTEXPR const char CLAP_EXT_STATE[] = "clap.state"; #ifdef __cplusplus extern "C" { diff --git a/include/clap/ext/thread-check.h b/include/clap/ext/thread-check.h @@ -2,7 +2,7 @@ #include "../clap.h" -static CLAP_CONSTEXPR const char CLAP_EXT_THREAD_CHECK[] = "clap/thread-check"; +static CLAP_CONSTEXPR const char CLAP_EXT_THREAD_CHECK[] = "clap.thread-check"; #ifdef __cplusplus extern "C" {