Show a notification on version mismatch

Between the plugin and the Wine plugin host application.
This commit is contained in:
Robbert van der Helm
2021-07-13 22:14:31 +02:00
parent 4013aea63a
commit 5fc7acccd1
5 changed files with 44 additions and 5 deletions
+24
View File
@@ -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.
+4 -1
View File
@@ -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)