mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-09 20:29:10 +02:00
Add message structs for initializing plugins
This commit is contained in:
@@ -71,5 +71,20 @@ struct Host {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Extensions supported by the host. This can only be queried in
|
||||||
|
* `clap_plugin::init()` so it cannot be part of `Host`. We'll create make these
|
||||||
|
* same extensions available to the bridged CLAP plugins using proxies.
|
||||||
|
*/
|
||||||
|
struct SupportedHostExtensions {
|
||||||
|
// Don't forget to add new extensions to the log output
|
||||||
|
// TODO: Support extensions
|
||||||
|
|
||||||
|
template <typename S>
|
||||||
|
void serialize(S& s) {
|
||||||
|
// s.value1b(extension_name);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
} // namespace host
|
} // namespace host
|
||||||
} // namespace clap
|
} // namespace clap
|
||||||
|
|||||||
@@ -25,6 +25,7 @@
|
|||||||
|
|
||||||
#include "../../bitsery/ext/in-place-optional.h"
|
#include "../../bitsery/ext/in-place-optional.h"
|
||||||
#include "../common.h"
|
#include "../common.h"
|
||||||
|
#include "host.h"
|
||||||
|
|
||||||
// Serialization messages for `clap/plugin.h`
|
// Serialization messages for `clap/plugin.h`
|
||||||
|
|
||||||
@@ -105,6 +106,51 @@ struct Descriptor {
|
|||||||
mutable clap_plugin_descriptor_t clap_descriptor;
|
mutable clap_plugin_descriptor_t clap_descriptor;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Extensions supported by the plugin. Queried after `clap_plugin::init()`.
|
||||||
|
*/
|
||||||
|
struct SupportedPluginExtensions {
|
||||||
|
// Don't forget to add new extensions to the log output
|
||||||
|
// TODO: Support extensions
|
||||||
|
|
||||||
|
template <typename S>
|
||||||
|
void serialize(S& s) {
|
||||||
|
// s.value1b(extension_name);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The response to the `clap::plugin::Init` message defined below.
|
||||||
|
*/
|
||||||
|
struct InitResponse {
|
||||||
|
bool result;
|
||||||
|
SupportedPluginExtensions supported_plugin_extensions;
|
||||||
|
|
||||||
|
template <typename S>
|
||||||
|
void serialize(S& s) {
|
||||||
|
s.value1b(result);
|
||||||
|
s.object(supported_plugin_extensions);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Message struct for `clap_plugin::init()`. This is where we set the supported
|
||||||
|
* host extensions on the Wine side, and query the plugin's supported extensions
|
||||||
|
* so we can proxy them.
|
||||||
|
*/
|
||||||
|
struct Init {
|
||||||
|
using Response = InitResponse;
|
||||||
|
|
||||||
|
native_size_t instance_id;
|
||||||
|
clap::host::SupportedHostExtensions supported_host_extensions;
|
||||||
|
|
||||||
|
template <typename S>
|
||||||
|
void serialize(S& s) {
|
||||||
|
s.value8b(instance_id);
|
||||||
|
s.boject(supported_host_extensions);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Message struct for `clap_plugin::destroy()`. The Wine plugin host should
|
* Message struct for `clap_plugin::destroy()`. The Wine plugin host should
|
||||||
* clean up the plugin, and everything is also cleaned up on the plugin side
|
* clean up the plugin, and everything is also cleaned up on the plugin side
|
||||||
|
|||||||
Reference in New Issue
Block a user