Pass through getParameter and setParameter

This commit is contained in:
Robbert van der Helm
2020-03-05 17:00:45 +01:00
parent 814a3b40b5
commit bea600a13a
5 changed files with 91 additions and 10 deletions
+31 -2
View File
@@ -104,8 +104,6 @@ struct EventResult {
*/
std::optional<std::string> data;
// TODO: Add missing return value fields;
template <typename S>
void serialize(S& s) {
s.value8b(return_value);
@@ -114,6 +112,37 @@ struct EventResult {
}
};
/**
* Represents a call to either `getParameter` or `setParameter`, depending on
* whether `value` contains a value or not.
*/
struct Parameter {
int32_t index;
std::optional<float> value;
template <typename S>
void serialize(S& s) {
s.value4b(index);
s.ext(value, bitsery::ext::StdOptional(),
[](S& s, auto& v) { s.value4b(v); });
}
};
/**
* The result of a `getParameter` or a `setParameter` call. For `setParameter`
* this struct won't contain any values and mostly acts as an acknowledgement
* from the Wine VST host.
*/
struct ParameterResult {
std::optional<float> value;
template <typename S>
void serialize(S& s) {
s.ext(value, bitsery::ext::StdOptional(),
[](S& s, auto& v) { s.value4b(v); });
}
};
/**
* The serialization function for `AEffect` structs. This will s serialize all
* of the values but it will not touch any of the pointer fields. That way you