mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-08 12:30:12 +02:00
Rename parameters for clarity
This commit is contained in:
@@ -27,7 +27,7 @@
|
||||
* in one of the dispatch functions. This is used as a buffer size and also as a
|
||||
* cutoff for checking if c-style strings behind a `char*` have changed.
|
||||
*/
|
||||
constexpr size_t max_string_size = 128;
|
||||
constexpr size_t max_string_length = 128;
|
||||
|
||||
/**
|
||||
* An event as dispatched by the VST host. These events will get forwarded to
|
||||
@@ -36,7 +36,7 @@ constexpr size_t max_string_size = 128;
|
||||
*/
|
||||
struct Event {
|
||||
int32_t opcode;
|
||||
int32_t parameter;
|
||||
int32_t index;
|
||||
// TODO: This is an intptr_t, is this actually a poitner that should be
|
||||
// dereferenced?
|
||||
intptr_t value;
|
||||
@@ -49,7 +49,7 @@ struct Event {
|
||||
*/
|
||||
std::optional<std::string> data;
|
||||
|
||||
MSGPACK_DEFINE(opcode, parameter, value, option, data)
|
||||
MSGPACK_DEFINE(opcode, index, value, option, data)
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -74,7 +74,7 @@ Bridge::Bridge()
|
||||
*/
|
||||
intptr_t Bridge::dispatch(AEffect* /*plugin*/,
|
||||
int32_t opcode,
|
||||
int32_t parameter,
|
||||
int32_t index,
|
||||
intptr_t value,
|
||||
void* data,
|
||||
float option) {
|
||||
@@ -102,7 +102,7 @@ intptr_t Bridge::dispatch(AEffect* /*plugin*/,
|
||||
? std::nullopt
|
||||
: std::make_optional(std::string(static_cast<char*>(data)));
|
||||
|
||||
const Event event{opcode, parameter, value, option, payload};
|
||||
const Event event{opcode, index, value, option, payload};
|
||||
write_object(host_vst_dispatch, event);
|
||||
|
||||
const auto response = read_object<EventResult>(host_vst_dispatch);
|
||||
|
||||
+1
-1
@@ -50,7 +50,7 @@ class Bridge {
|
||||
*/
|
||||
intptr_t dispatch(AEffect* plugin,
|
||||
int32_t opcode,
|
||||
int32_t parameter,
|
||||
int32_t index,
|
||||
intptr_t value,
|
||||
void* data,
|
||||
float option);
|
||||
|
||||
@@ -93,12 +93,12 @@ VST_EXPORT AEffect* VSTPluginMain(audioMasterCallback /*audioMaster*/) {
|
||||
|
||||
intptr_t dispatch(AEffect* plugin,
|
||||
int32_t opcode,
|
||||
int32_t parameter,
|
||||
int32_t index,
|
||||
intptr_t value,
|
||||
void* data,
|
||||
float option) {
|
||||
return get_bridge_instance(*plugin).dispatch(plugin, opcode, parameter,
|
||||
value, data, option);
|
||||
return get_bridge_instance(*plugin).dispatch(plugin, opcode, index, value,
|
||||
data, option);
|
||||
}
|
||||
|
||||
void process(AEffect* plugin,
|
||||
|
||||
@@ -79,7 +79,7 @@ int main(int argc, char* argv[]) {
|
||||
|
||||
// TODO: Remove debug, we're just reporting the plugin's name we retrieved
|
||||
// above
|
||||
std::array<char, max_string_size> buffer;
|
||||
std::array<char, max_string_length> buffer;
|
||||
while (true) {
|
||||
auto event = read_object<Event>(host_vst_dispatch);
|
||||
|
||||
@@ -100,8 +100,8 @@ int main(int argc, char* argv[]) {
|
||||
}
|
||||
|
||||
const intptr_t return_value =
|
||||
plugin->dispatcher(plugin, event.opcode, event.option,
|
||||
event.parameter, payload, event.option);
|
||||
plugin->dispatcher(plugin, event.opcode, event.option, event.index,
|
||||
payload, event.option);
|
||||
|
||||
// Only write back the value from `payload` if we were passed an empty
|
||||
// buffer to write into
|
||||
@@ -120,7 +120,7 @@ int main(int argc, char* argv[]) {
|
||||
// TODO: Placeholder
|
||||
intptr_t VST_CALL_CONV host_callback(AEffect* plugin,
|
||||
int32_t opcode,
|
||||
int32_t parameter,
|
||||
int32_t index,
|
||||
intptr_t value,
|
||||
void* data,
|
||||
float option) {
|
||||
|
||||
Reference in New Issue
Block a user