mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-08 04:20:13 +02:00
Implement CLAP audio-ports-config extension
This commit is contained in:
@@ -62,6 +62,9 @@ using ClapMainThreadControlRequest =
|
||||
clap::plugin::Deactivate,
|
||||
clap::ext::audio_ports::plugin::Count,
|
||||
clap::ext::audio_ports::plugin::Get,
|
||||
clap::ext::audio_ports_config::plugin::Count,
|
||||
clap::ext::audio_ports_config::plugin::Get,
|
||||
clap::ext::audio_ports_config::plugin::Select,
|
||||
clap::ext::gui::plugin::IsApiSupported,
|
||||
clap::ext::gui::plugin::Create,
|
||||
clap::ext::gui::plugin::Destroy,
|
||||
@@ -173,6 +176,7 @@ using ClapMainThreadCallbackRequest =
|
||||
clap::ext::latency::host::Changed,
|
||||
clap::ext::audio_ports::host::IsRescanFlagSupported,
|
||||
clap::ext::audio_ports::host::Rescan,
|
||||
clap::ext::audio_ports_config::host::Rescan,
|
||||
clap::ext::gui::host::ResizeHintsChanged,
|
||||
clap::ext::gui::host::RequestResize,
|
||||
clap::ext::gui::host::RequestShow,
|
||||
|
||||
@@ -18,7 +18,7 @@ Yabridge currently tracks CLAP 1.1.1. The implementation status for CLAP's core
|
||||
| extension | status |
|
||||
| ------------------------- | ------------------------------------------------------------ |
|
||||
| `clap.audio-ports` | :heavy_check_mark: |
|
||||
| `clap.audio-ports-config` | :x: Not supported yet |
|
||||
| `clap.audio-ports-config` | :heavy_check_mark: |
|
||||
| `clap.event-registry` | :x: Not needed for any of the supported extensions |
|
||||
| `clap.gui` | :heavy_check_mark: Currently only does embedded GUIs |
|
||||
| `clap.latency` | :heavy_check_mark: |
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
#include "host.h"
|
||||
|
||||
#include <clap/ext/audio-ports-config.h>
|
||||
#include <clap/ext/audio-ports.h>
|
||||
#include <clap/ext/gui.h>
|
||||
#include <clap/ext/latency.h>
|
||||
@@ -36,9 +37,10 @@ Host::Host(const clap_host_t& original)
|
||||
url(original.url ? std::optional(original.url) : std::nullopt),
|
||||
version((assert(original.version), original.version)) {}
|
||||
|
||||
std::array<std::pair<bool, const char*>, 9> SupportedHostExtensions::list()
|
||||
std::array<std::pair<bool, const char*>, 10> SupportedHostExtensions::list()
|
||||
const noexcept {
|
||||
return {std::pair(supports_audio_ports, CLAP_EXT_AUDIO_PORTS),
|
||||
std::pair(supports_audio_ports_config, CLAP_EXT_AUDIO_PORTS_CONFIG),
|
||||
std::pair(supports_gui, CLAP_EXT_GUI),
|
||||
std::pair(supports_latency, CLAP_EXT_LATENCY),
|
||||
std::pair(supports_log, CLAP_EXT_LOG),
|
||||
|
||||
@@ -82,6 +82,7 @@ struct Host {
|
||||
struct SupportedHostExtensions {
|
||||
// Don't forget to add new extensions to below method
|
||||
bool supports_audio_ports = false;
|
||||
bool supports_audio_ports_config = false;
|
||||
bool supports_gui = false;
|
||||
bool supports_latency = false;
|
||||
bool supports_log = false;
|
||||
@@ -95,11 +96,12 @@ struct SupportedHostExtensions {
|
||||
* Get a list of `<bool, extension_name>` tuples for the supported
|
||||
* extensions. Used during logging.
|
||||
*/
|
||||
std::array<std::pair<bool, const char*>, 9> list() const noexcept;
|
||||
std::array<std::pair<bool, const char*>, 10> list() const noexcept;
|
||||
|
||||
template <typename S>
|
||||
void serialize(S& s) {
|
||||
s.value1b(supports_audio_ports);
|
||||
s.value1b(supports_audio_ports_config);
|
||||
s.value1b(supports_gui);
|
||||
s.value1b(supports_latency);
|
||||
s.value1b(supports_log);
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
#include "plugin.h"
|
||||
|
||||
#include <clap/ext/audio-ports-config.h>
|
||||
#include <clap/ext/audio-ports.h>
|
||||
#include <clap/ext/gui.h>
|
||||
#include <clap/ext/latency.h>
|
||||
@@ -84,9 +85,10 @@ const clap_plugin_descriptor_t* Descriptor::get() const {
|
||||
return &clap_descriptor;
|
||||
}
|
||||
|
||||
std::array<std::pair<bool, const char*>, 9> SupportedPluginExtensions::list()
|
||||
std::array<std::pair<bool, const char*>, 10> SupportedPluginExtensions::list()
|
||||
const noexcept {
|
||||
return {std::pair(supports_audio_ports, CLAP_EXT_AUDIO_PORTS),
|
||||
std::pair(supports_audio_ports_config, CLAP_EXT_AUDIO_PORTS_CONFIG),
|
||||
std::pair(supports_gui, CLAP_EXT_GUI),
|
||||
std::pair(supports_latency, CLAP_EXT_LATENCY),
|
||||
std::pair(supports_note_ports, CLAP_EXT_NOTE_PORTS),
|
||||
|
||||
@@ -116,6 +116,7 @@ struct Descriptor {
|
||||
struct SupportedPluginExtensions {
|
||||
// Don't forget to add new extensions to below method
|
||||
bool supports_audio_ports = false;
|
||||
bool supports_audio_ports_config = false;
|
||||
bool supports_gui = false;
|
||||
bool supports_latency = false;
|
||||
bool supports_note_ports = false;
|
||||
@@ -129,11 +130,12 @@ struct SupportedPluginExtensions {
|
||||
* Get a list of `<bool, extension_name>` tuples for the supported
|
||||
* extensions. Used during logging.
|
||||
*/
|
||||
std::array<std::pair<bool, const char*>, 9> list() const noexcept;
|
||||
std::array<std::pair<bool, const char*>, 10> list() const noexcept;
|
||||
|
||||
template <typename S>
|
||||
void serialize(S& s) {
|
||||
s.value1b(supports_audio_ports);
|
||||
s.value1b(supports_audio_ports_config);
|
||||
s.value1b(supports_gui);
|
||||
s.value1b(supports_latency);
|
||||
s.value1b(supports_note_ports);
|
||||
|
||||
Reference in New Issue
Block a user