From 5ffe4773e9ff99686d1dadacc2ec70a52a373bee Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Tue, 22 Jun 2021 17:40:29 +0200 Subject: [PATCH] Show startup errors in a desktop notification This should make it much easier to spot what goes wrong if you're new to yabridge and don't know where to look yet. --- CHANGELOG.md | 10 +++++----- src/plugin/vst2-plugin.cpp | 4 ++++ src/plugin/vst3-plugin.cpp | 4 ++++ 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7f7d85e4..e4a822e4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,11 +10,11 @@ Versioning](https://semver.org/spec/v2.0.0.html). ### Added -- When the Wine plugin host process fails to start, yabridge will now show a - desktop notification to notify you about this. This lets you diagnose issues - faster if you didn't already start your DAW from a terminal. These - notifications require `libnotify` and the `notify-send` application to be - installed. +- When a plugin fails to load or when the Wine plugin host process fails to + start, yabridge will now show you the error in a desktop notification instead + of only printing it to the logger. This makes diagnosing issues much faster if + you didn't already start your DAW from a terminal. These notifications require + `libnotify` and the `notify-send` application to be installed. - Added an environment variable to disable the watchdog timer. This allows the Wine process to run under a separate namespace. If you don't know that you need this, then you probably don't need this! diff --git a/src/plugin/vst2-plugin.cpp b/src/plugin/vst2-plugin.cpp index 16d5a17f..fa6d9f0c 100644 --- a/src/plugin/vst2-plugin.cpp +++ b/src/plugin/vst2-plugin.cpp @@ -53,6 +53,10 @@ extern "C" VST_EXPORT AEffect* VSTPluginMain( logger.log("Error during initialization:"); logger.log(error.what()); + // Also show a desktop notification most people likely won't see the + // above message + send_notification("Failed to initialize VST2 plugin", error.what()); + return nullptr; } } diff --git a/src/plugin/vst3-plugin.cpp b/src/plugin/vst3-plugin.cpp index 64e2d885..7ecd7923 100644 --- a/src/plugin/vst3-plugin.cpp +++ b/src/plugin/vst3-plugin.cpp @@ -55,6 +55,10 @@ bool InitModule() { logger.log("Error during initialization:"); logger.log(error.what()); + // Also show a desktop notification most people likely won't see the + // above message + send_notification("Failed to initialize VST3 plugin", error.what()); + return false; } }