Reorder arguments

This commit is contained in:
Robbert van der Helm
2020-03-11 16:08:09 +01:00
parent 6ab7af10f9
commit ea8feb07a9
+10 -10
View File
@@ -202,25 +202,25 @@ void passthrough_event(boost::asio::local::stream_protocol::socket& socket,
// because it was not zeroed out by the host) for an event that should // because it was not zeroed out by the host) for an event that should
// report some data back? // report some data back?
const auto response_data = std::visit( const auto response_data = std::visit(
overload{ overload{[&](auto) -> EventResposnePayload { return std::monostate(); },
[&](WantsChunkBuffer&) -> EventResposnePayload { [&](WantsChunkBuffer&) -> EventResposnePayload {
// In this case the plugin will have written its data stored in // In this case the plugin will have written its data
// an array to which a pointer is stored in `data`, with the // stored in an array to which a pointer is stored in
// return value from the event determines how much data the // `data`, with the return value from the event determines
// plugin has written // how much data the plugin has written
return std::string(*static_cast<char**>(data), return_value); return std::string(*static_cast<char**>(data),
return_value);
}, },
[&](WantsVstTimeInfo&) -> EventResposnePayload { [&](WantsVstTimeInfo&) -> EventResposnePayload {
// Not sure why the VST API has twenty different ways of // Not sure why the VST API has twenty different ways of
// returning structs, but in this case the value returned from // returning structs, but in this case the value returned
// the callback function is actually a pointer to a // from the callback function is actually a pointer to a
// `VstTimeInfo` struct! // `VstTimeInfo` struct!
return *reinterpret_cast<const VstTimeInfo*>(return_value); return *reinterpret_cast<const VstTimeInfo*>(return_value);
}, },
[&](WantsString&) -> EventResposnePayload { [&](WantsString&) -> EventResposnePayload {
return std::string(static_cast<char*>(data)); return std::string(static_cast<char*>(data));
}, }},
[&](auto) -> EventResposnePayload { return std::monostate(); }},
event.payload); event.payload);
if (logging.has_value()) { if (logging.has_value()) {