commit aae23f69a03c3bfe8b0e96591d718f50ed819d9e
parent 9d9bf3dd03ebbbdc9abbdfc4cc8ef4ecbd8949f1
Author: Alexandre Bique <bique.alexandre@gmail.com>
Date: Fri, 13 Jan 2023 09:28:53 +0100
Merge pull request #283 from defiantnerd/defiantnerd-patch-audio-ports-config-info
added CLAP_EXT_AUDIO_PORTS_CONFIG_INFO extension
Diffstat:
1 file changed, 22 insertions(+), 0 deletions(-)
diff --git a/include/clap/ext/audio-ports-config.h b/include/clap/ext/audio-ports-config.h
@@ -2,6 +2,7 @@
#include "../string-sizes.h"
#include "../plugin.h"
+#include "audio-ports.h"
/// @page Audio Ports Config
///
@@ -20,8 +21,12 @@
///
/// Plugins 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).
+///
+/// To inquire the exact bus layout, the plugin implements the clap_plugin_audio_ports_config_info_t
+/// extension where all busses can be retrieved in the same way as in the audio-port extension.
static CLAP_CONSTEXPR const char CLAP_EXT_AUDIO_PORTS_CONFIG[] = "clap.audio-ports-config";
+static CLAP_CONSTEXPR const char CLAP_EXT_AUDIO_PORTS_CONFIG_INFO[] = "clap.audio-ports-config-info";
#ifdef __cplusplus
extern "C" {
@@ -65,6 +70,23 @@ typedef struct clap_plugin_audio_ports_config {
bool(CLAP_ABI *select)(const clap_plugin_t *plugin, clap_id config_id);
} clap_plugin_audio_ports_config_t;
+typedef struct clap_plugin_audio_ports_config_info {
+ // get info about about an audio port.
+
+ // gets the clap_id of the currently selected config
+ // clap_id might now match the index, can be used to call
+ // clap_plugin_audio_ports_config::select()
+ // [main-thread]
+ clap_id(CLAP_ABI* current_config)(const clap_plugin_t* plugin);
+
+ // [main-thread]
+ bool(CLAP_ABI* get)(const clap_plugin_t* plugin,
+ clap_id config_id,
+ uint32_t port_index,
+ bool is_input,
+ clap_audio_port_info_t* info);
+} clap_plugin_audio_ports_config_info_t;
+
typedef struct clap_host_audio_ports_config {
// Rescan the full list of configs.
// [main-thread]