mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-07 12:10:09 +02:00
Wrap event result data in an std::variant
Gets a bit more complicated this way, but this avoids having to use string to manually serialize and deserialize arbitrary objects. The new options for `AEffect` and `VstTimeInfo` structs are not yet used.
This commit is contained in:
@@ -230,8 +230,13 @@ class HostCallbackDataConverter : DefaultDataConverter {
|
||||
case audioMasterGetTime:
|
||||
// Write the returned `VstTimeInfo` struct into a field and make
|
||||
// the function return a poitner to it in the function below
|
||||
time = *static_cast<const VstTimeInfo*>(
|
||||
static_cast<const void*>(response.data->data()));
|
||||
// TODO: Use the fancy new `VstTimeINfo` variant here
|
||||
{
|
||||
std::string buffer =
|
||||
std::get<std::string>(response.payload);
|
||||
time = *static_cast<const VstTimeInfo*>(
|
||||
static_cast<const void*>(buffer.data()));
|
||||
}
|
||||
break;
|
||||
default:
|
||||
DefaultDataConverter::write(opcode, data, response);
|
||||
|
||||
Reference in New Issue
Block a user