Commit Graph

17 Commits

Author SHA1 Message Date
Robbert van der Helm 28886e7073 Replace all threads with Win32Thread in Wine host 2020-10-27 18:29:38 +01:00
Robbert van der Helm 8d7826f1df Handle incoming events from off-threads separately
On the Wine side we want to handle most events on the main UI thread.
We'll assume any events coming in from a secondary socket are safe and
can be handled directly.
2020-10-26 13:45:37 +01:00
Robbert van der Helm 2f6883977f Create secondary sockets for sending nested events 2020-10-26 12:13:27 +01:00
Robbert van der Helm 74c3cab046 Move event handling logic to a dedicated class
Now all pieces are in place to allow handling events over multiple
socket connections.
2020-10-26 11:40:38 +01:00
Robbert van der Helm 54ed69c408 Merge events.h into communication.h 2020-10-25 21:37:04 +01:00
Robbert van der Helm 4b53342514 💥 Encapsulate and rework all socket logic
This is a pretty huge change that will be important for being able to
handle nested or mutually recursive `dispatch()` and `audioMaster()`
calls. This sadly all had to be done in a single commit, so here's a
summary:

- `src/common/sockets.h:Sockets` contains all sockets on both the plugin
  and the Wine host side, and is used to both listen on and connect to
  the sockets.
- Sockets and other temporary files respect `$XDG_RUNTIME_DIR` instead
  of being dumped in `/tmp`.
- All sockets now have a unique endpoint in
  `/run/user/<uid>/yabridge-<plugin_name>-<random_id>/`. This is
  important for when we want to have multiple socket connections for
  handling `dispatch()` and `audioMaster()`.
- Because of the above, we no longer clean up the socket endpoint files
  after the connection gets established during initialization. Instead
  we'll remove the socket base directory when shutting down.
2020-10-25 21:24:56 +01:00
Robbert van der Helm adf33e84a8 Use a template argument for serializing behaviour
This keeps it a bit more readable.
2020-03-09 20:13:08 +01:00
Robbert van der Helm 69008e97a4 Serialize midi events using vectors
Easier than to implement C-style arrays in Bitsery and this way we also
don't have to worry about cleanup.

Serum still segfaults with multiple events so something is still off.
2020-03-09 15:31:35 +01:00
Robbert van der Helm 2fda0bc9f2 Add missing copyright headers 2020-03-08 22:34:53 +01:00
Robbert van der Helm 40142f801e Pass throug the VstEvents struct 2020-03-08 20:29:40 +01:00
Robbert van der Helm 5523871fd8 Pass a marker struct instead of an empty array 2020-03-08 18:51:16 +01:00
Robbert van der Helm 2326a92c62 Improve event passing clarity 2020-03-08 18:33:01 +01:00
Robbert van der Helm ff89d12c1a Use std::avriant to encode event payloads
It's a bit more complicated this way, but nwo we can easily add support
for the opcode specific structs.
2020-03-08 17:47:09 +01:00
Robbert van der Helm f1901de62b Add an updated version of the aeffectx.h header
From the Audacity project.
2020-03-08 13:48:09 +01:00
Robbert van der Helm 3bfb6cf38b Disable logging on the Wine side
It was incredibly verbose, and for debugging the networking part you
could still use stdout.
2020-03-07 23:36:30 +01:00
Robbert van der Helm 35b0174b9e Add log messages everywhere 2020-03-07 23:10:07 +01:00
Robbert van der Helm 54d62c6a66 Split src/common/* into headers and definitions 2020-03-06 19:18:27 +01:00