Fully implement the CLAP params extension

This commit is contained in:
Robbert van der Helm
2022-09-23 20:51:44 +02:00
parent 5732b45769
commit 0f58f3409b
12 changed files with 362 additions and 11 deletions
+6 -2
View File
@@ -85,7 +85,9 @@ bool ClapLogger::log_request(bool is_host_plugin,
{std::pair(supported_extensions.supports_audio_ports,
CLAP_EXT_AUDIO_PORTS),
std::pair(supported_extensions.supports_note_ports,
CLAP_EXT_NOTE_PORTS)}) {
CLAP_EXT_NOTE_PORTS),
std::pair(supported_extensions.supports_params,
CLAP_EXT_PARAMS)}) {
if (!supported) {
continue;
}
@@ -382,7 +384,9 @@ void ClapLogger::log_response(bool is_host_plugin,
{std::pair(supported_extensions.supports_audio_ports,
CLAP_EXT_AUDIO_PORTS),
std::pair(supported_extensions.supports_note_ports,
CLAP_EXT_NOTE_PORTS)}) {
CLAP_EXT_NOTE_PORTS),
std::pair(supported_extensions.supports_params,
CLAP_EXT_PARAMS)}) {
if (!supported) {
continue;
}
+19 -4
View File
@@ -53,7 +53,16 @@ using ClapMainThreadControlRequest =
clap::ext::audio_ports::plugin::Count,
clap::ext::audio_ports::plugin::Get,
clap::ext::note_ports::plugin::Count,
clap::ext::note_ports::plugin::Get>;
clap::ext::note_ports::plugin::Get,
clap::ext::params::plugin::Count,
clap::ext::params::plugin::GetInfo,
clap::ext::params::plugin::GetValue,
clap::ext::params::plugin::ValueToText,
clap::ext::params::plugin::TextToValue
// Flush may be called from the audio thread and it may not be
// called at the same time as process, so that's handled using
// the audio thread handler
>;
template <typename S>
void serialize(S& s, ClapMainThreadControlRequest& payload) {
@@ -86,7 +95,8 @@ struct ClapAudioThreadControlRequest {
using Payload = std::variant<clap::plugin::StartProcessing,
clap::plugin::StopProcessing,
clap::plugin::Reset>;
clap::plugin::Reset,
clap::ext::params::plugin::Flush>;
Payload payload;
@@ -131,7 +141,6 @@ struct ClapAudioThreadControlRequest {
* the information we want or the operation we want to perform. A request of
* type `ClapMainThreadCallbackRequest(T)` should send back a `T::Response`.
*/
// TODO: Placeholder
using ClapMainThreadCallbackRequest =
std::variant<WantsConfiguration,
clap::host::RequestRestart,
@@ -139,7 +148,13 @@ using ClapMainThreadCallbackRequest =
clap::ext::audio_ports::host::IsRescanFlagSupported,
clap::ext::audio_ports::host::Rescan,
clap::ext::note_ports::host::SupportedDialects,
clap::ext::note_ports::host::Rescan>;
clap::ext::note_ports::host::Rescan,
clap::ext::params::host::Rescan,
clap::ext::params::host::Clear,
// This doesn't need to be done on the main thread, but we
// don't have an alternative per-plugin instance socket
// available so this is probably fine
clap::ext::params::host::RequestFlush>;
template <typename S>
void serialize(S& s, ClapMainThreadCallbackRequest& payload) {
+1 -1
View File
@@ -22,7 +22,7 @@ Yabridge currently tracks CLAP 1.1.1. The implementation status for CLAP's core
| `clap.log` | :x: Not supported yet |
| `clap.note-name` | :x: Not supported yet |
| `clap.note-ports` | :heavy_check_mark: |
| `clap.params` | :x: Not supported yet |
| `clap.params` | :heavy_check_mark: |
| `clap.posix-fd-support` | :x: Not supported yet |
| `clap.render` | :x: Not supported yet |
| `clap.state` | :x: Not supported yet |
+2
View File
@@ -84,11 +84,13 @@ struct SupportedHostExtensions {
// method
bool supports_audio_ports = false;
bool supports_note_ports = false;
bool supports_params = false;
template <typename S>
void serialize(S& s) {
s.value1b(supports_audio_ports);
s.value1b(supports_note_ports);
s.value1b(supports_params);
}
};
+2
View File
@@ -117,11 +117,13 @@ struct SupportedPluginExtensions {
// method
bool supports_audio_ports = false;
bool supports_note_ports = false;
bool supports_params = false;
template <typename S>
void serialize(S& s) {
s.value1b(supports_audio_ports);
s.value1b(supports_note_ports);
s.value1b(supports_params);
}
};