commit 158197351681ae692be73811b98aa4ab7114e268
parent bb238cbc782299fa9db88e637d504f648bdcd22f
Author: Alexandre BIQUE <bique.alexandre@gmail.com>
Date: Mon, 28 Jun 2021 11:26:07 +0200
More work
Diffstat:
5 files changed, 56 insertions(+), 12 deletions(-)
diff --git a/examples/plugins/CMakeLists.txt b/examples/plugins/CMakeLists.txt
@@ -9,6 +9,11 @@ add_library(
plugin-helper.cc
plugin-helper.hh
stream-helper.hh
+
+ abstract-gui.hh
+ remote-gui.hh
+ remote-gui.cc
+
dc-offset/dc-offset.hh
dc-offset/dc-offset.cc
gain/gain.hh
diff --git a/examples/plugins/abstract-gui.hh b/examples/plugins/abstract-gui.hh
@@ -4,11 +4,13 @@
namespace clap {
+ class PluginHelper;
class AbstractGui {
public:
- virtual ~AbstractGui();
+ AbstractGui(PluginHelper &plugin) : plugin_(plugin) {}
+ virtual ~AbstractGui() = default;
- virtual bool attach(void *nsView) noexcept = 0;
+ virtual bool attachCocoa(void *nsView) noexcept = 0;
virtual bool attachWin32(clap_hwnd window) noexcept = 0;
virtual bool attachX11(const char *display_name, unsigned long window) noexcept = 0;
@@ -19,6 +21,9 @@ namespace clap {
virtual bool hide() noexcept = 0;
virtual void close() noexcept = 0;
+
+ protected:
+ PluginHelper &plugin_;
};
} // namespace clap
\ No newline at end of file
diff --git a/examples/plugins/parameters.hh b/examples/plugins/parameters.hh
@@ -66,16 +66,6 @@ namespace clap {
}
private:
- friend class boost::serialization::access;
- // When the class Archive corresponds to an output archive, the
- // & operator is defined similar to <<. Likewise, when the class Archive
- // is a type of input archive the & operator is defined similar to >>.
- template <class Archive>
- void serialize(Archive &ar, const unsigned int version) {
- ar &info_.id;
- ar &value_;
- }
-
clap_param_info info_;
double value_;
diff --git a/examples/plugins/remote-gui.cc b/examples/plugins/remote-gui.cc
@@ -0,0 +1,12 @@
+#include "remote-gui.hh"
+
+namespace clap {
+
+ bool RemoteGui::spawn() {
+ assert(!child_.running());
+
+ child_ = boost::process::child("clap-gui", boost::process::std_out = wpipe_);
+ return child_.running();
+ }
+
+} // namespace clap
+\ No newline at end of file
diff --git a/examples/plugins/remote-gui.hh b/examples/plugins/remote-gui.hh
@@ -0,0 +1,30 @@
+#pragma once
+
+#include <boost/process.hpp>
+
+#include "abstract-gui.hh"
+
+namespace clap {
+ class RemoteGui : public AbstractGui {
+ RemoteGui(PluginHelper &plugin) : AbstractGui(plugin) {}
+
+ bool spawn();
+
+ bool attachCocoa(void *nsView) noexcept override;
+ bool attachWin32(clap_hwnd window) noexcept override;
+ bool attachX11(const char *display_name, unsigned long window) noexcept override;
+
+ void size(int32_t *width, int32_t *height) noexcept override;
+ void setScale(double scale) noexcept override;
+
+ bool show() noexcept override;
+ bool hide() noexcept override;
+
+ void close() noexcept override;
+
+ private:
+ boost::process::child child_;
+ boost::process::pipe wpipe_;
+ boost::process::pipe rpipe_;
+ };
+} // namespace clap
+\ No newline at end of file