commit d3a7bce74306e098565d02a6c769bea43f51303c
parent a4b8348a21edba768d435a61e13626b8cc0e601d
Author: Alexandre BIQUE <bique.alexandre@gmail.com>
Date: Mon, 7 Feb 2022 18:53:21 +0100
Merge branch 'main' into next
Diffstat:
7 files changed, 49 insertions(+), 24 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
@@ -1,4 +1,5 @@
cmake_minimum_required(VERSION 3.17)
+enable_testing()
project(CLAP C CXX)
# If you use clap as a submodule of your plugin you need some interface projects
@@ -9,22 +10,26 @@ target_include_directories(clap-core INTERFACE include)
install(DIRECTORY include DESTINATION "." OPTIONAL EXCLUDE_FROM_ALL)
-add_executable(clap-compile-test-c EXCLUDE_FROM_ALL src/main.c)
-target_link_libraries(clap-compile-test-c clap-core)
-set_target_properties(clap-compile-test-c PROPERTIES C_STANDARD 11)
+add_executable(clap-compile-c EXCLUDE_FROM_ALL src/main.c)
+target_link_libraries(clap-compile-c clap-core)
+set_target_properties(clap-compile-c PROPERTIES C_STANDARD 11)
-add_executable(clap-compile-test-cpp EXCLUDE_FROM_ALL src/main.cc)
-target_link_libraries(clap-compile-test-cpp clap-core)
-set_target_properties(clap-compile-test-cpp PROPERTIES CXX_STANDARD 14)
-
-add_custom_target(clap-compile-tests DEPENDS clap-compile-test-c clap-compile-test-cpp)
+add_executable(clap-compile-cpp EXCLUDE_FROM_ALL src/main.cc)
+target_link_libraries(clap-compile-cpp clap-core)
+set_target_properties(clap-compile-cpp PROPERTIES CXX_STANDARD 14)
if (${CMAKE_C_COMPILER_ID} STREQUAL "GNU" OR ${CMAKE_C_COMPILER_ID} STREQUAL "Clang")
- target_compile_options(clap-compile-test-c PRIVATE -Wall -Wextra -pedantic)
- target_compile_options(clap-compile-test-cpp PRIVATE -Wall -Wextra -pedantic)
+ target_compile_options(clap-compile-c PRIVATE -Wall -Wextra -pedantic)
+ target_compile_options(clap-compile-cpp PRIVATE -Wall -Wextra -pedantic)
endif()
if (${CMAKE_C_COMPILER_ID} STREQUAL "Clang")
- target_compile_options(clap-compile-test-c PRIVATE -Werror=pragma-pack)
- target_compile_options(clap-compile-test-cpp PRIVATE -Werror=pragma-pack)
+ target_compile_options(clap-compile-c PRIVATE -Werror=pragma-pack)
+ target_compile_options(clap-compile-cpp PRIVATE -Werror=pragma-pack)
endif()
+
+add_test(NAME test-clap-compile-c COMMAND clap-compile-c)
+add_test(NAME test-clap-compile-cpp COMMAND clap-compile-cpp)
+
+add_custom_target(clap-tests)
+add_dependencies(clap-tests clap-compile-c clap-compile-cpp)
diff --git a/CMakePresets.json b/CMakePresets.json
@@ -26,7 +26,8 @@
"configurePreset": "ninja",
"displayName": "Build ninja-release",
"description": "Build ninja Release configuration",
- "configuration": "RelWithDebInfo"
+ "configuration": "RelWithDebInfo",
+ "targets": ["clap-tests"]
}
],
"testPresets": [
diff --git a/README.md b/README.md
@@ -13,6 +13,17 @@
**CL**ever **A**udio **P**lugin.
+- [Learn about CLAP](#learn-about-clap)
+ - [Entry point](#entry-point)
+ - [Extensions](#extensions)
+ - [Fundamental extensions](#fundamental-extensions)
+ - [GUI extensions](#gui-extensions)
+ - [Extra extensions](#extra-extensions)
+- [Resources](#resources)
+ - [Programming Language Bingings](#programming-language-bingings)
+ - [Examples](#examples)
+ - [Community related projects](#community-related-projects)
+
# Learn about CLAP
To work with clap, include [clap/clap.h](include/clap/clap.h).
@@ -94,13 +105,20 @@ and use to get a basic plugin experience:
- [audio-ports-config](include/clap/ext/audio-ports-config.h), simple list of possible configurations
- [surround](include/clap/ext/draft/surround.h), inspect the surround channel mapping
+# Resources
+
+## Programming Language Bingings
+
+- [clap-sys](https://github.com/glowcoil/clap-sys), rust binding
+- [CLAP-for-Delphi](https://github.com/Bremmers/CLAP-for-Delphi), Delphi binding
+
## Examples
-- [clap-examples](https://github.com/free-audio/clap-examples), very simple host and plugins
-- [clap-juce-extension ](https://github.com/free-audio/clap-juce-extension), juce add-on
+- [clap-host](https://github.com/free-audio/clap-host), very simple host
+- [clap-plugins](https://github.com/free-audio/clap-plugins), very simple plugins
## Community related projects
+- [clap-juce-extension](https://github.com/free-audio/clap-juce-extension), juce add-on
- [MIP2](https://github.com/skei/MIP2), host and plugins
-- [clap-sys](https://github.com/glowcoil/clap-sys), rust binding
- [schwaaa's plugin](https://github.com/schwaaa/clap-plugin), basic example for prototyping CLAP audio plugins using Dear ImGui as the user interface
\ No newline at end of file
diff --git a/include/clap/ext/gui.h b/include/clap/ext/gui.h
@@ -55,7 +55,7 @@ typedef struct clap_plugin_gui {
// [main-thread,optional]
bool (*set_scale)(const clap_plugin_t *plugin, double scale);
- // Get the current size of the plugin UI, with the scaling applied.
+ // Get the current size of the plugin UI, in physical pixels.
// clap_plugin_gui->create() must have been called prior to asking the size.
// [main-thread]
bool (*get_size)(const clap_plugin_t *plugin, uint32_t *width, uint32_t *height);
diff --git a/include/clap/version.h b/include/clap/version.h
@@ -29,7 +29,8 @@ static CLAP_CONSTEXPR const uint32_t CLAP_VERSION_MINOR = 18;
static CLAP_CONSTEXPR const uint32_t CLAP_VERSION_REVISION = 0;
static CLAP_CONSTEXPR const clap_version_t CLAP_VERSION = {
- CLAP_VERSION_MAJOR, CLAP_VERSION_MINOR, CLAP_VERSION_REVISION};
+ CLAP_VERSION_MAJOR, CLAP_VERSION_MINOR, CLAP_VERSION_REVISION
+};
// For version 0, we require the same minor version because
// we may still break the ABI at this point
diff --git a/src/main.c b/src/main.c
@@ -1,7 +1,7 @@
#include <clap/clap.h>
// The purpose of this file is to check that all headers compile
-
-clap_version_t m = CLAP_VERSION;
-
-int main(int argc, char **argv) { return !clap_version_is_compatible(m); }
-\ No newline at end of file
+int main(int argc, char **argv) {
+ clap_version_t m = CLAP_VERSION;
+ return !clap_version_is_compatible(m);
+}
+\ No newline at end of file
diff --git a/src/main.cc b/src/main.cc
@@ -2,6 +2,6 @@
// The purpose of this file is to check that all headers compile
-clap_version m = CLAP_VERSION;
+static const constexpr clap_version m = CLAP_VERSION;
int main(int, char **) { return !clap_version_is_compatible(m); }
\ No newline at end of file