Detect and log support for audio-ports

This commit is contained in:
Robbert van der Helm
2022-09-12 16:53:59 +02:00
parent 0854deeae2
commit 3ebccdb65b
5 changed files with 43 additions and 33 deletions
+4 -2
View File
@@ -16,6 +16,8 @@
#include "host.h"
#include <clap/ext/audio-ports.h>
namespace clap {
namespace host {
@@ -26,8 +28,8 @@ Host::Host(const clap_host_t& original)
url(original.url ? std::optional(original.url) : std::nullopt),
version((assert(original.version), original.version)) {}
// TODO: Add extensions
SupportedHostExtensions::SupportedHostExtensions(const clap_host& host) {}
SupportedHostExtensions::SupportedHostExtensions(const clap_host& host)
: supports_audio_ports(host.get_extension(&host, CLAP_EXT_AUDIO_PORTS)) {}
} // namespace host
} // namespace clap
+2 -2
View File
@@ -87,11 +87,11 @@ struct SupportedHostExtensions {
SupportedHostExtensions() noexcept {}
// Don't forget to add new extensions to the log output
// TODO: Support extensions
bool supports_audio_ports = false;
template <typename S>
void serialize(S& s) {
// s.value1b(extension_name);
s.value1b(supports_audio_ports);
}
};
+5 -3
View File
@@ -16,6 +16,8 @@
#include "plugin.h"
#include <clap/ext/audio-ports.h>
#include "version.h"
namespace clap {
@@ -74,9 +76,9 @@ const clap_plugin_descriptor_t* Descriptor::get() const {
return &clap_descriptor;
}
// TODO: Add extensions
SupportedPluginExtensions::SupportedPluginExtensions(
const clap_plugin& plugin) {}
SupportedPluginExtensions::SupportedPluginExtensions(const clap_plugin& plugin)
: supports_audio_ports(
plugin.get_extension(&plugin, CLAP_EXT_AUDIO_PORTS)) {}
} // namespace plugin
} // namespace clap
+2 -2
View File
@@ -120,11 +120,11 @@ struct SupportedPluginExtensions {
SupportedPluginExtensions() noexcept {}
// Don't forget to add new extensions to the log output
// TODO: Support extensions
bool supports_audio_ports = false;
template <typename S>
void serialize(S& s) {
// s.value1b(extension_name);
s.value1b(supports_audio_ports);
}
};