clap

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

commit 8cc97718878abe0213e678ecdbc54fa7d4fb5f3e
parent fe25f584c109be423621e94f76ec5ff64302eb4f
Author: Alexandre BIQUE <bique.alexandre@gmail.com>
Date:   Wed, 19 May 2021 00:24:56 +0200

More work

Diffstat:
Mexamples/host/CMakeLists.txt | 17+++++++----------
Minclude/clap/all.h | 2+-
Minclude/clap/ext/draft/event-filter.h | 5+++++
Ainclude/clap/ext/draft/quick-controls.h | 44++++++++++++++++++++++++++++++++++++++++++++
Dinclude/clap/ext/draft/remote-controls.h | 38--------------------------------------
Minclude/clap/ext/draft/track-info.h | 4++--
6 files changed, 59 insertions(+), 51 deletions(-)

diff --git a/examples/host/CMakeLists.txt b/examples/host/CMakeLists.txt @@ -8,7 +8,7 @@ find_package(Qt6Widgets REQUIRED) #pkg_check_modules(PortAudio REQUIRED IMPORTED_TARGET portaudio-2.0) #pkg_check_modules(PortMidi REQUIRED IMPORTED_TARGET portmidi) -add_executable(Host EXCLUDE_FROM_ALL +add_executable(clap-host EXCLUDE_FROM_ALL application.cc application.hh audio-settings.cc @@ -47,19 +47,16 @@ add_executable(Host EXCLUDE_FROM_ALL settings-widget.hh ) -set_target_properties(Host PROPERTIES CXX_STANDARD 17) -target_compile_options(Host PRIVATE -fsanitize=address) -target_link_options(Host PRIVATE -fsanitize=address) - -target_link_libraries(Host portmidi portaudio) -target_link_libraries(Host Qt6::Widgets Qt6::Core) +set_target_properties(clap-host PROPERTIES CXX_STANDARD 17) +target_link_libraries(clap-host Qt6::Widgets Qt6::Core) +target_link_libraries(clap-host portmidi portaudio) if (LINUX) - target_link_libraries(Host dl pthread) + target_link_libraries(clap-host dl pthread) endif() if (APPLE) - set_target_properties(Host PROPERTIES OSX_ARCHITECTURES x86_64) + set_target_properties(clap-host PROPERTIES OSX_ARCHITECTURES x86_64) find_library(CORE_FOUNDATION CoreFoundation) find_library(CORE_AUDIO CoreAudio) @@ -68,5 +65,5 @@ if (APPLE) find_library(AUDIO_UNIT AudioUnit) find_library(AUDIO_TOOLBOX AudioToolbox) find_library(CARBON Carbon) - target_link_libraries(Host ${CARBON} ${AUDIO_UNIT} ${AUDIO_TOOLBOX} ${CORE_MIDI} ${CORE_AUDIO} ${CORE_SERVICES} ${CORE_FOUNDATION}) + target_link_libraries(clap-host ${CARBON} ${AUDIO_UNIT} ${AUDIO_TOOLBOX} ${CORE_MIDI} ${CORE_AUDIO} ${CORE_SERVICES} ${CORE_FOUNDATION}) endif() diff --git a/include/clap/all.h b/include/clap/all.h @@ -19,7 +19,7 @@ #include "ext/draft/event-filter.h" #include "ext/draft/key-name.h" #include "ext/draft/preset-load.h" -#include "ext/draft/remote-controls.h" +#include "ext/draft/quick-controls.h" #include "ext/draft/thread-pool.h" #include "ext/draft/track-info.h" #include "ext/draft/tuning.h" diff --git a/include/clap/ext/draft/event-filter.h b/include/clap/ext/draft/event-filter.h @@ -16,6 +16,11 @@ typedef struct clap_plugin_event_filter { bool (*accepts)(clap_plugin *plugin, clap_event_type event_type); } clap_plugin_event_filter; + +typedef struct clap_host_event_filter { + void (*changed)(clap_host *host); +} clap_host_event_filter; + #ifdef __cplusplus } #endif \ No newline at end of file diff --git a/include/clap/ext/draft/quick-controls.h b/include/clap/ext/draft/quick-controls.h @@ -0,0 +1,43 @@ +#pragma once + +#include "../../clap.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define CLAP_EXT_QUICK_CONTROLS "clap/draft/quick-controls" + +typedef struct clap_quick_controls_page { + clap_id id; + char name[CLAP_NAME_SIZE]; + char keywords[CLAP_KEYWORDS_SIZE]; + clap_id param_id[8]; +} clap_quick_controls_page; + +typedef struct clap_plugin_quick_controls { + int32_t (*page_count)(clap_plugin *plugin); + + // [main-thread] + bool (*get_page)(clap_plugin *plugin, int32_t page_index, clap_quick_controls_page *page); + + // [main-thread] + void (*select_page)(clap_plugin *plugin, clap_id page_id); + + // [main-thread] + clap_id (*get_selected_page)(clap_plugin *plugin); +} clap_host_plugin_info; + +typedef struct clap_host_quick_controls { + // Informs the host that the quick controls pages has changed. + // [main-thread] + void (*pages_changed)(clap_host *host); + + // Informs the host that the user did change the selected page, from the plugin. + // [main-thread] + void (*selected_page_changed)(clap_host *host, clap_id page_id); +} clap_host_quick_controls; + +#ifdef __cplusplus +} +#endif +\ No newline at end of file diff --git a/include/clap/ext/draft/remote-controls.h b/include/clap/ext/draft/remote-controls.h @@ -1,37 +0,0 @@ -#pragma once - -#include "../../clap.h" -#include "../audio-ports.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#define CLAP_EXT_REMOTE_CONTROLS "clap/draft/remote-controls" - -typedef struct clap_remote_controls_page { - clap_id id; - char name[CLAP_NAME_SIZE]; - char keywords[CLAP_KEYWORDS_SIZE]; - clap_id param_id[8]; -} clap_remote_controls_page; - -typedef struct clap_plugin_remote_controls { - int32_t (*page_count)(clap_plugin *plugin); - - // [main-thread] - bool (*get_page)(clap_plugin *plugin, int32_t page_index, clap_remote_controls_page *page); - - // [main-thread] - void (*select_page)(clap_plugin *plugin, clap_id page_id); -} clap_host_plugin_info; - -typedef struct clap_host_remote_controls { - // Informs the host that the remote controls page has changed. - // [main-thread] - void (*changed)(clap_host *host); -} clap_host_remote_controls; - -#ifdef __cplusplus -} -#endif -\ No newline at end of file diff --git a/include/clap/ext/draft/track-info.h b/include/clap/ext/draft/track-info.h @@ -23,13 +23,13 @@ typedef struct clap_track_info { typedef struct clap_plugin_track_info { // [main-thread] - int (*track_info_changed)(clap_plugin *plugin, const clap_track_info *info); + void (*set_track_info)(clap_plugin *plugin, const clap_track_info *info); } clap_plugin_track_info; typedef struct clap_host_track_info { // Informs the host that the note names has changed. // [main-thread] - void (*get_track_info)(clap_host *host, clap_track_info *info); + bool (*get_track_info)(clap_host *host, clap_track_info *info); } clap_host_track_info; #ifdef __cplusplus