Encapsulate our VST3 message handling pattern

Similarly to how how we do it in `EventHandler`.
This commit is contained in:
Robbert van der Helm
2020-12-04 15:28:43 +01:00
parent db1a51af5c
commit 70405e8917
3 changed files with 172 additions and 11 deletions
+3 -5
View File
@@ -412,14 +412,10 @@ class SocketHandler {
*
* @tparam Thread The thread implementation to use. On the Linux side this
* should be `std::jthread` and on the Wine side this should be `Win32Thread`.
*
* TODO: Once we have figured out a way to encapsulate the usage patterns in
* `Vst3Sockets` we should make the constructor, `send()` and
* `receive_multi()` protected again to avoid weirdness
*/
template <typename Thread>
class AdHocSocketHandler {
public:
protected:
/**
* Sets up a single primary socket. The sockets won't be active until
* `connect()` gets called.
@@ -445,6 +441,7 @@ class AdHocSocketHandler {
}
}
public:
/**
* Depending on the value of the `listen` argument passed to the
* constructor, either accept connections made to the sockets on the Linux
@@ -477,6 +474,7 @@ class AdHocSocketHandler {
socket.close();
}
protected:
/**
* Serialize and send an event over a socket. This is used for both the host
* -> plugin 'dispatch' events and the plugin -> host 'audioMaster' host