clap

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

commit 3410aabf7d91e317621514a6bb10341c03250ad2
parent e25b94eb12d94e143c4c1140f09455ba61919445
Author: Alexandre Bique <bique.alexandre@gmail.com>
Date:   Fri, 15 Jul 2022 10:17:22 +0200

promote `voice-info` out of draft

Diffstat:
MChangeLog.md | 1+
Minclude/clap/clap.h | 28++++++++++++++--------------
Dinclude/clap/ext/draft/voice-info.h | 56--------------------------------------------------------
Ainclude/clap/ext/voice-info.h | 56++++++++++++++++++++++++++++++++++++++++++++++++++++++++
4 files changed, 71 insertions(+), 70 deletions(-)

diff --git a/ChangeLog.md b/ChangeLog.md @@ -5,6 +5,7 @@ * [note-name.h](include/clap/ext/note-name.h): missing typedef `clap_plugin_note_name_t`. * [params.h](include/clap/ext/params.h): clarify `request_flush()` documentation. * [thread-check.h](include/clap/ext/thread-check.h): clarify documentation. +* [voice-info.h](include/clap/ext/voice-info.h): promote `voice-info` out of draft. # Changes in 1.0.3 diff --git a/include/clap/clap.h b/include/clap/clap.h @@ -33,30 +33,30 @@ #include "plugin.h" #include "host.h" -#include "ext/audio-ports.h" #include "ext/audio-ports-config.h" +#include "ext/audio-ports.h" +#include "ext/event-registry.h" #include "ext/gui.h" +#include "ext/latency.h" #include "ext/log.h" +#include "ext/note-name.h" +#include "ext/note-ports.h" #include "ext/params.h" +#include "ext/posix-fd-support.h" #include "ext/render.h" #include "ext/state.h" -#include "ext/latency.h" +#include "ext/tail.h" #include "ext/thread-check.h" -#include "ext/timer-support.h" -#include "ext/posix-fd-support.h" -#include "ext/note-name.h" -#include "ext/note-ports.h" #include "ext/thread-pool.h" -#include "ext/event-registry.h" -#include "ext/tail.h" +#include "ext/timer-support.h" +#include "ext/voice-info.h" +#include "ext/draft/ambisonic.h" +#include "ext/draft/cv.h" +#include "ext/draft/file-reference.h" +#include "ext/draft/midi-mappings.h" #include "ext/draft/preset-load.h" #include "ext/draft/quick-controls.h" +#include "ext/draft/surround.h" #include "ext/draft/track-info.h" #include "ext/draft/tuning.h" -#include "ext/draft/file-reference.h" -#include "ext/draft/midi-mappings.h" -#include "ext/draft/surround.h" -#include "ext/draft/cv.h" -#include "ext/draft/ambisonic.h" -#include "ext/draft/voice-info.h" diff --git a/include/clap/ext/draft/voice-info.h b/include/clap/ext/draft/voice-info.h @@ -1,56 +0,0 @@ -#pragma once - -#include "../../plugin.h" - -// This extension indicates the number of voices the synthesizer has. -// It is useful for the host when performing polyphonic modulations, -// because the host needs its own voice management and should try to follow -// what the plugin is doing: -// - make the host's voice pool coherent with what the plugin has -// - turn the host's voice management to mono when the plugin is mono - -static const char CLAP_EXT_VOICE_INFO[] = "clap.voice-info.draft/0"; - -#ifdef __cplusplus -extern "C" { -#endif - -enum { - // Allows the host to send overlapping NOTE_ON events. - // The plugin will then rely upon the note_id to distinguish between them. - CLAP_VOICE_INFO_SUPPORTS_OVERLAPPING_NOTES = 1 << 0, -}; - -typedef struct clap_voice_info { - // voice_count is the current number of voices that the patch can use - // voice_capacity is the number of voices allocated voices - // voice_count should not be confused with the number of active voices. - // - // 1 <= voice_count <= voice_capacity - // - // For example, a synth can have a capacity of 8 voices, but be configured - // to only use 4 voices: {count: 4, capacity: 8}. - // - // If the voice_count is 1, then the synth is working in mono and the host - // can decide to only use global modulation mapping. - uint32_t voice_count; - uint32_t voice_capacity; - - uint64_t flags; -} clap_voice_info_t; - -typedef struct clap_plugin_voice_info { - // gets the voice info, returns true on success - // [main-thread && active] - bool (*get)(const clap_plugin_t *plugin, clap_voice_info_t *info); -} clap_plugin_voice_info_t; - -typedef struct clap_host_voice_info { - // informs the host that the voice info has changed - // [main-thread] - void (*changed)(const clap_host_t *host); -} clap_host_voice_info_t; - -#ifdef __cplusplus -} -#endif diff --git a/include/clap/ext/voice-info.h b/include/clap/ext/voice-info.h @@ -0,0 +1,56 @@ +#pragma once + +#include "../plugin.h" + +// This extension indicates the number of voices the synthesizer has. +// It is useful for the host when performing polyphonic modulations, +// because the host needs its own voice management and should try to follow +// what the plugin is doing: +// - make the host's voice pool coherent with what the plugin has +// - turn the host's voice management to mono when the plugin is mono + +static const char CLAP_EXT_VOICE_INFO[] = "clap.voice-info"; + +#ifdef __cplusplus +extern "C" { +#endif + +enum { + // Allows the host to send overlapping NOTE_ON events. + // The plugin will then rely upon the note_id to distinguish between them. + CLAP_VOICE_INFO_SUPPORTS_OVERLAPPING_NOTES = 1 << 0, +}; + +typedef struct clap_voice_info { + // voice_count is the current number of voices that the patch can use + // voice_capacity is the number of voices allocated voices + // voice_count should not be confused with the number of active voices. + // + // 1 <= voice_count <= voice_capacity + // + // For example, a synth can have a capacity of 8 voices, but be configured + // to only use 4 voices: {count: 4, capacity: 8}. + // + // If the voice_count is 1, then the synth is working in mono and the host + // can decide to only use global modulation mapping. + uint32_t voice_count; + uint32_t voice_capacity; + + uint64_t flags; +} clap_voice_info_t; + +typedef struct clap_plugin_voice_info { + // gets the voice info, returns true on success + // [main-thread && active] + bool (*get)(const clap_plugin_t *plugin, clap_voice_info_t *info); +} clap_plugin_voice_info_t; + +typedef struct clap_host_voice_info { + // informs the host that the voice info has changed + // [main-thread] + void (*changed)(const clap_host_t *host); +} clap_host_voice_info_t; + +#ifdef __cplusplus +} +#endif