mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-08 12:30:12 +02:00
Show a notification on version mismatch
Between the plugin and the Wine plugin host application.
This commit is contained in:
@@ -339,6 +339,30 @@ class PluginBridge {
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* Show a desktop notification if the Wine plugin host is using a different
|
||||
* version of yabridge than this library. Yabridge may still work (and we do
|
||||
* this often during development), but at some point a request may fail the
|
||||
* plugin and the host are out of sync.
|
||||
*/
|
||||
void warn_on_version_mismatch(const std::string& host_version) {
|
||||
if (host_version != yabridge_git_version) {
|
||||
generic_logger.log(
|
||||
"WARNING: The host application's version does not match");
|
||||
generic_logger.log(
|
||||
" this plugin's. If you just updated yabridge, then");
|
||||
generic_logger.log(
|
||||
" you may need rerun 'yabridgectl sync' first to");
|
||||
generic_logger.log(" update your plugins.");
|
||||
|
||||
send_notification(
|
||||
"Version mismatch",
|
||||
"If you just updated yabridge, then you may need "
|
||||
"to rerun 'yabridgectl sync' first to update your plugins.",
|
||||
true);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* The configuration for this instance of yabridge. Set based on the values
|
||||
* from a `yabridge.toml`, if it exists.
|
||||
|
||||
@@ -63,7 +63,10 @@ Vst3PluginBridge::Vst3PluginBridge()
|
||||
|
||||
return Ack{};
|
||||
},
|
||||
[&](const WantsConfiguration&) -> WantsConfiguration::Response {
|
||||
[&](const WantsConfiguration& request)
|
||||
-> WantsConfiguration::Response {
|
||||
warn_on_version_mismatch(request.host_version);
|
||||
|
||||
return config;
|
||||
},
|
||||
[&](const YaComponentHandler::BeginEdit& request)
|
||||
|
||||
Reference in New Issue
Block a user