Move generic logger on the Wine side to common.h

We'll also need this for VST2 plugins when we start caching the time
info.
This commit is contained in:
Robbert van der Helm
2021-04-28 23:18:45 +02:00
parent dee964ec89
commit 32db921b9b
4 changed files with 13 additions and 5 deletions
+1 -1
View File
@@ -19,7 +19,7 @@
#include "../editor.h" #include "../editor.h"
HostBridge::HostBridge(boost::filesystem::path plugin_path) HostBridge::HostBridge(boost::filesystem::path plugin_path)
: plugin_path(plugin_path) {} : plugin_path(plugin_path), generic_logger(Logger::create_wine_stderr()) {}
void HostBridge::handle_win32_events() { void HostBridge::handle_win32_events() {
MSG msg; MSG msg;
+12
View File
@@ -20,6 +20,8 @@
#include <boost/filesystem.hpp> #include <boost/filesystem.hpp>
#include "../../common/logging/common.h"
/** /**
* The base for the Wine plugin host bridge interface for all plugin types. This * The base for the Wine plugin host bridge interface for all plugin types. This
* only has to be able to handle Win32 and X11 events. Implementations of this * only has to be able to handle Win32 and X11 events. Implementations of this
@@ -87,4 +89,14 @@ class HostBridge {
* The path to the .dll being loaded in the Wine plugin host. * The path to the .dll being loaded in the Wine plugin host.
*/ */
const boost::filesystem::path plugin_path; const boost::filesystem::path plugin_path;
protected:
/**
* A logger, just like we have on the plugin side. This is normally not
* needed because we can just print to STDERR, but this way we can
* conditionally hide output based on the verbosity level.
*
* @see Logger::create_wine_stderr
*/
Logger generic_logger;
}; };
-1
View File
@@ -91,7 +91,6 @@ Vst3Bridge::Vst3Bridge(MainContext& main_context,
std::string plugin_dll_path, std::string plugin_dll_path,
std::string endpoint_base_dir) std::string endpoint_base_dir)
: HostBridge(plugin_dll_path), : HostBridge(plugin_dll_path),
generic_logger(Logger::create_wine_stderr()),
logger(generic_logger), logger(generic_logger),
main_context(main_context), main_context(main_context),
sockets(main_context.context, endpoint_base_dir, false) { sockets(main_context.context, endpoint_base_dir, false) {
-3
View File
@@ -361,9 +361,6 @@ class Vst3Bridge : public HostBridge {
void unregister_context_menu(size_t object_instance_id, void unregister_context_menu(size_t object_instance_id,
size_t context_menu_id); size_t context_menu_id);
private:
Logger generic_logger;
public: public:
/** /**
* A logger instance we'll use to log about failed * A logger instance we'll use to log about failed