mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-08 20:40:11 +02:00
Move special effVendorSpecific handling for REAPER
It's a bit less hacky if we do the effVendorSpecific check where we're supposed to be checking for those things.
This commit is contained in:
@@ -16,16 +16,10 @@
|
||||
|
||||
#include "vst2.h"
|
||||
|
||||
EventPayload DefaultDataConverter::read(const int opcode,
|
||||
const int index,
|
||||
EventPayload DefaultDataConverter::read(const int /*opcode*/,
|
||||
const int /*index*/,
|
||||
const intptr_t /*value*/,
|
||||
const void* data) const {
|
||||
// HACK: REAPER has recently started using `effVendorSpecific` with a
|
||||
// non-pointer `data` argument, so we need to explicitly handle this
|
||||
if (opcode == effVendorSpecific && index == effSetSpeakerArrangement) {
|
||||
return static_cast<native_size_t>(reinterpret_cast<size_t>(data));
|
||||
}
|
||||
|
||||
if (!data) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@@ -196,6 +196,18 @@ class DispatchDataConverter : DefaultDataConverter {
|
||||
// data (or at least Bitwig does this)
|
||||
return *static_cast<const VstIOProperties*>(data);
|
||||
break;
|
||||
// HACK: REAPER has recently started using `effVendorSpecific` with
|
||||
// a non-pointer `data` argument, so we need to explicitly
|
||||
// handle this
|
||||
case effVendorSpecific:
|
||||
if (index == effSetSpeakerArrangement) {
|
||||
return static_cast<native_size_t>(
|
||||
reinterpret_cast<size_t>(data));
|
||||
} else {
|
||||
return DefaultDataConverter::read(opcode, index, value,
|
||||
data);
|
||||
}
|
||||
break;
|
||||
case effGetParameterProperties:
|
||||
return *static_cast<const VstParameterProperties*>(data);
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user