mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-09 20:29:10 +02:00
Detect and log support for audio-ports
This commit is contained in:
+30
-24
@@ -18,6 +18,8 @@
|
|||||||
|
|
||||||
#include <bitset>
|
#include <bitset>
|
||||||
|
|
||||||
|
#include <clap/ext/audio-ports.h>
|
||||||
|
|
||||||
#include "../serialization/clap.h"
|
#include "../serialization/clap.h"
|
||||||
|
|
||||||
ClapLogger::ClapLogger(Logger& generic_logger) : logger_(generic_logger) {}
|
ClapLogger::ClapLogger(Logger& generic_logger) : logger_(generic_logger) {}
|
||||||
@@ -56,21 +58,23 @@ bool ClapLogger::log_request(bool is_host_plugin,
|
|||||||
message << request.instance_id
|
message << request.instance_id
|
||||||
<< ": clap_plugin::init(), supported host extensions: ";
|
<< ": clap_plugin::init(), supported host extensions: ";
|
||||||
|
|
||||||
// TODO: Log supported extensions
|
|
||||||
bool first = true;
|
bool first = true;
|
||||||
// for (const auto& [supported, extension_name] : {}) {
|
const auto& supported_extensions = request.supported_host_extensions;
|
||||||
// if (!supported) {
|
for (const auto& [supported, extension_name] :
|
||||||
// continue;
|
{std::pair(supported_extensions.supports_audio_ports,
|
||||||
// }
|
CLAP_EXT_AUDIO_PORTS)}) {
|
||||||
|
if (!supported) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
// if (first) {
|
if (first) {
|
||||||
// message << extension_name;
|
message << '"' << extension_name << '"';
|
||||||
// } else {
|
} else {
|
||||||
// message << ", " << extension_name;
|
message << ", \"" << extension_name << '"';
|
||||||
// }
|
}
|
||||||
|
|
||||||
// first = false;
|
first = false;
|
||||||
// }
|
}
|
||||||
|
|
||||||
if (first) {
|
if (first) {
|
||||||
message << "<none>";
|
message << "<none>";
|
||||||
@@ -182,21 +186,23 @@ void ClapLogger::log_response(bool is_host_plugin,
|
|||||||
message << (response.result ? "true" : "false")
|
message << (response.result ? "true" : "false")
|
||||||
<< ", supported plugin extensions: ";
|
<< ", supported plugin extensions: ";
|
||||||
|
|
||||||
// TODO: Log supported extensions
|
|
||||||
bool first = true;
|
bool first = true;
|
||||||
// for (const auto& [supported, extension_name] : {}) {
|
const auto& supported_extensions = response.supported_plugin_extensions;
|
||||||
// if (!supported) {
|
for (const auto& [supported, extension_name] :
|
||||||
// continue;
|
{std::pair(supported_extensions.supports_audio_ports,
|
||||||
// }
|
CLAP_EXT_AUDIO_PORTS)}) {
|
||||||
|
if (!supported) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
// if (first) {
|
if (first) {
|
||||||
// message << extension_name;
|
message << '"' << extension_name << '"';
|
||||||
// } else {
|
} else {
|
||||||
// message << ", " << extension_name;
|
message << ", \"" << extension_name << '"';
|
||||||
// }
|
}
|
||||||
|
|
||||||
// first = false;
|
first = false;
|
||||||
// }
|
}
|
||||||
|
|
||||||
if (first) {
|
if (first) {
|
||||||
message << "<none>";
|
message << "<none>";
|
||||||
|
|||||||
@@ -16,6 +16,8 @@
|
|||||||
|
|
||||||
#include "host.h"
|
#include "host.h"
|
||||||
|
|
||||||
|
#include <clap/ext/audio-ports.h>
|
||||||
|
|
||||||
namespace clap {
|
namespace clap {
|
||||||
namespace host {
|
namespace host {
|
||||||
|
|
||||||
@@ -26,8 +28,8 @@ Host::Host(const clap_host_t& original)
|
|||||||
url(original.url ? std::optional(original.url) : std::nullopt),
|
url(original.url ? std::optional(original.url) : std::nullopt),
|
||||||
version((assert(original.version), original.version)) {}
|
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 host
|
||||||
} // namespace clap
|
} // namespace clap
|
||||||
|
|||||||
@@ -87,11 +87,11 @@ struct SupportedHostExtensions {
|
|||||||
SupportedHostExtensions() noexcept {}
|
SupportedHostExtensions() noexcept {}
|
||||||
|
|
||||||
// Don't forget to add new extensions to the log output
|
// Don't forget to add new extensions to the log output
|
||||||
// TODO: Support extensions
|
bool supports_audio_ports = false;
|
||||||
|
|
||||||
template <typename S>
|
template <typename S>
|
||||||
void serialize(S& s) {
|
void serialize(S& s) {
|
||||||
// s.value1b(extension_name);
|
s.value1b(supports_audio_ports);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -16,6 +16,8 @@
|
|||||||
|
|
||||||
#include "plugin.h"
|
#include "plugin.h"
|
||||||
|
|
||||||
|
#include <clap/ext/audio-ports.h>
|
||||||
|
|
||||||
#include "version.h"
|
#include "version.h"
|
||||||
|
|
||||||
namespace clap {
|
namespace clap {
|
||||||
@@ -74,9 +76,9 @@ const clap_plugin_descriptor_t* Descriptor::get() const {
|
|||||||
return &clap_descriptor;
|
return &clap_descriptor;
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Add extensions
|
SupportedPluginExtensions::SupportedPluginExtensions(const clap_plugin& plugin)
|
||||||
SupportedPluginExtensions::SupportedPluginExtensions(
|
: supports_audio_ports(
|
||||||
const clap_plugin& plugin) {}
|
plugin.get_extension(&plugin, CLAP_EXT_AUDIO_PORTS)) {}
|
||||||
|
|
||||||
} // namespace plugin
|
} // namespace plugin
|
||||||
} // namespace clap
|
} // namespace clap
|
||||||
|
|||||||
@@ -120,11 +120,11 @@ struct SupportedPluginExtensions {
|
|||||||
SupportedPluginExtensions() noexcept {}
|
SupportedPluginExtensions() noexcept {}
|
||||||
|
|
||||||
// Don't forget to add new extensions to the log output
|
// Don't forget to add new extensions to the log output
|
||||||
// TODO: Support extensions
|
bool supports_audio_ports = false;
|
||||||
|
|
||||||
template <typename S>
|
template <typename S>
|
||||||
void serialize(S& s) {
|
void serialize(S& s) {
|
||||||
// s.value1b(extension_name);
|
s.value1b(supports_audio_ports);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user