mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-06 19:40:10 +02:00
Add a serialization function for AEffect structs
This commit is contained in:
@@ -63,8 +63,9 @@ using InputAdapter = bitsery::InputBufferAdapter<Buffer<N>>;
|
|||||||
struct Event {
|
struct Event {
|
||||||
int32_t opcode;
|
int32_t opcode;
|
||||||
int32_t index;
|
int32_t index;
|
||||||
// TODO: This is an intptr_t, is this actually a poitner that should be
|
// TODO: This is an intptr_t, if we want to support 32 bit Wine plugins all
|
||||||
// dereferenced?
|
// of these these intptr_t types should be replace by `uint64_t` to
|
||||||
|
// remain compatible with the Linux VST plugin.
|
||||||
intptr_t value;
|
intptr_t value;
|
||||||
float option;
|
float option;
|
||||||
/**
|
/**
|
||||||
@@ -113,6 +114,28 @@ struct EventResult {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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
|
||||||
|
* can deserialize to an existing `AEffect` instance.
|
||||||
|
*/
|
||||||
|
template <typename S>
|
||||||
|
void serialize(S& s, AEffect& plugin) {
|
||||||
|
s.value4b(plugin.magic);
|
||||||
|
s.value4b(plugin.numPrograms);
|
||||||
|
s.value4b(plugin.numInputs);
|
||||||
|
s.value4b(plugin.numOutputs);
|
||||||
|
s.value4b(plugin.flags);
|
||||||
|
|
||||||
|
// These fields can contain some values that are rarely used and/or
|
||||||
|
// deprecated, but we should pass them along anyway
|
||||||
|
s.container1b(plugin.empty3);
|
||||||
|
s.value4b(plugin.unknown_float);
|
||||||
|
|
||||||
|
s.value4b(plugin.uniqueID);
|
||||||
|
s.container1b(plugin.unknown1);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Serialize an object using bitsery and write it to a socket.
|
* Serialize an object using bitsery and write it to a socket.
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user