mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-06-16 08:23:55 +02:00
Also warn on version mismatch for VST2 plugins
This commit is contained in:
@@ -175,8 +175,12 @@ Vst2PluginBridge::Vst2PluginBridge(audioMasterCallback host_callback)
|
|||||||
// calls `audioMasterIOChanged()` and after the host calls `effOpen()`.
|
// calls `audioMasterIOChanged()` and after the host calls `effOpen()`.
|
||||||
const auto initialization_data =
|
const auto initialization_data =
|
||||||
sockets.host_vst_control.receive_single<Vst2EventResult>();
|
sockets.host_vst_control.receive_single<Vst2EventResult>();
|
||||||
|
|
||||||
const auto initialized_plugin =
|
const auto initialized_plugin =
|
||||||
std::get<AEffect>(initialization_data.payload);
|
std::get<AEffect>(initialization_data.payload);
|
||||||
|
const auto host_version =
|
||||||
|
std::get<std::string>(*initialization_data.value_payload);
|
||||||
|
warn_on_version_mismatch(host_version);
|
||||||
|
|
||||||
// After receiving the `AEffect` values we'll want to send the configuration
|
// After receiving the `AEffect` values we'll want to send the configuration
|
||||||
// back to complete the startup process
|
// back to complete the startup process
|
||||||
|
|||||||
@@ -19,6 +19,9 @@
|
|||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <set>
|
#include <set>
|
||||||
|
|
||||||
|
// Generated inside of the build directory
|
||||||
|
#include <version.h>
|
||||||
|
|
||||||
#include "../../common/communication/vst2.h"
|
#include "../../common/communication/vst2.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -194,9 +197,12 @@ Vst2Bridge::Vst2Bridge(MainContext& main_context,
|
|||||||
// Send the plugin's information to the Linux VST plugin. Any other updates
|
// Send the plugin's information to the Linux VST plugin. Any other updates
|
||||||
// of this object will be sent over the `dispatcher()` socket. This would be
|
// of this object will be sent over the `dispatcher()` socket. This would be
|
||||||
// done after the host calls `effOpen()`, and when the plugin calls
|
// done after the host calls `effOpen()`, and when the plugin calls
|
||||||
// `audioMasterIOChanged()`.
|
// `audioMasterIOChanged()`. We will also send along this host's version so
|
||||||
sockets.host_vst_control.send(Vst2EventResult{
|
// we can show a warning when the plugin's version doesn't match.
|
||||||
.return_value = 0, .payload = *plugin, .value_payload = std::nullopt});
|
sockets.host_vst_control.send(
|
||||||
|
Vst2EventResult{.return_value = 0,
|
||||||
|
.payload = *plugin,
|
||||||
|
.value_payload = yabridge_git_version});
|
||||||
|
|
||||||
// After sending the AEffect struct we'll receive this instance's
|
// After sending the AEffect struct we'll receive this instance's
|
||||||
// configuration as a response
|
// configuration as a response
|
||||||
|
|||||||
Reference in New Issue
Block a user