Commit Graph

274 Commits

Author SHA1 Message Date
Robbert van der Helm 54295f3a27 Fix shutdown cleanup issue for Ardour and Mixbus
Instead of just detaching the threads, it's much better to terminate the
Wine process and let the threads terminate themselves.

This fixes #11 on my machine.
2020-05-09 21:31:57 +02:00
Robbert van der Helm 484032202a Stop accepting sockets if Wine crashes on startup 2020-05-09 16:31:11 +02:00
Robbert van der Helm 9c19a1d01c Move plugin bridge helper functions to utils.h 2020-05-09 15:18:32 +02:00
Robbert van der Helm d173ab9123 Clean up main plugin entry point 2020-05-09 13:57:54 +02:00
Robbert van der Helm 57cb404f6b Use a Logger to print initialization errors
This way the errors will get written to a file instead of to STDERR if
`YABRIDGE_DEBUG_FILE` is set.
2020-05-09 11:15:27 +02:00
Robbert van der Helm 99ecb2803e Add logging for the input speaker configuration 2020-05-07 18:23:54 +02:00
Robbert van der Helm 868b0fd357 Finally implement eff{Set,Get}SpeakerConfiguration
As mentioned in #1. This also indirectly allows yabridge to work under
Renoise.
2020-05-07 18:23:41 +02:00
Robbert van der Helm 92f0d95357 Rename EventResponsePayload to be clearer 2020-05-07 17:23:22 +02:00
Robbert van der Helm a3aad51e41 Also add a second payload value to event responses
This will only be used for `effGetSpeakerArrangement`.
2020-05-07 17:23:22 +02:00
Robbert van der Helm 044b7fa9a2 Add a second payload value to events
This is for data passed through the `value` `intptr_t` parameter. The
only two events that use this are `effSetSpeakerArrangement` and
`effGetSpeakerArrangement`. Since this is such a rare occurrence we'll
leave the regular `value` field as it is.
2020-05-07 17:19:34 +02:00
Robbert van der Helm ff9f151639 Work around incorrect GCC warning in debug builds 2020-05-07 17:19:34 +02:00
Robbert van der Helm 3202239a93 Add speaker arrangement to event payload types 2020-05-07 16:47:30 +02:00
Robbert van der Helm 384805ac41 Add serialization for speaker arrangements 2020-05-07 16:47:30 +02:00
Robbert van der Helm ee5a4e6b50 Move the serialization function for VST events 2020-05-07 16:47:30 +02:00
Robbert van der Helm a82c3ac08c Add a dynamic wrapper for VstSpeakerArrangement
Similar to `DynamicVstEvents`, so we can serialize the object to binary
data transfer it over our sockets.
2020-05-07 16:45:04 +02:00
Robbert van der Helm 0822e49c59 Add opcodes and structs for speaker arrangements 2020-05-07 15:53:43 +02:00
Robbert van der Helm cb329f5b5f Fix 192154f869
I forgot to stage the other changes.
2020-05-07 14:53:10 +02:00
Robbert van der Helm 192154f869 Print the used Wine version on startup 2020-05-07 14:42:38 +02:00
Robbert van der Helm 7b07a2bfe1 💥 Rename HostBridge to PluginBridge
As mentioned in the last commit. The original reasoning behind these
names was that the HostBridge talks to the host, and the PluginBridge
talks to the plugin, but you could also argue that the HostBridge should
be part of the Wine VST host and the PluginBridge should be part of the
VST plugin. This removes that ambiguity.
2020-05-07 13:10:03 +02:00
Robbert van der Helm 2d0998047c 💥 Rename PluginBridge to WineBridge
I had swapped these names around once before but I think going with
PluginBridge for the plugin and WineBridge for the Wine VST host is the
least ambiguous it can get.
2020-05-07 13:04:00 +02:00
Robbert van der Helm dd684c26e1 Increase the maximum number of audio channels
This fixes #10, as Scaler was reporting 64 inputs.
2020-05-06 23:47:05 +02:00
Robbert van der Helm 261cf0554c Change prefix detection to be relative to the .dll 2020-05-06 19:16:19 +02:00
Robbert van der Helm f79115992b Work around issue with invalid plugin paths #2
I'm not sure what would be causing this in some cases.
2020-05-06 18:30:38 +02:00
Robbert van der Helm 905e60b9b2 Rename find_plugin_*() -> find_vst_*()
For cinsistency's sake.
2020-05-06 14:42:13 +02:00
Robbert van der Helm e4cfc8f43b Fix typo in .dll loading error message 2020-05-06 01:39:14 +02:00
Robbert van der Helm e40f90085c Revert accidental removal of audioMaster logging
Got removed in af060054d3.
2020-05-06 01:22:07 +02:00
Robbert van der Helm af060054d3 Implement audioMasterProcessEvents, closing #5
This allows plugins to output MIDI events.
2020-05-06 01:04:20 +02:00
Robbert van der Helm e71fd433f9 Clarify LoadLibrary() related startup error
The old message sounds too much like something that would come from
Linux's dynamic linker.
2020-05-06 00:06:46 +02:00
Robbert van der Helm 750130e4a5 Print errors that happen early during startup 2020-05-05 23:23:37 +02:00
Robbert van der Helm ad03d870ee Allow yet another symlinking method, fixing #3
This allows symlinking to a copy of `libyabridge.so.` Now we support:

- A symlink to `libyabridge.so` with a `.dll` file in the same directory
  as that symlink.
- A symlink to `libyabridge.so` with a symlinked `.dll`.
- A copy of `libyabridge.so` with a `.dll` file in the same directory as
  that copy.
- A symlink to a copy of `libyabridge.so` with a `.dll` file in the same
  directory as that copy.
- A symlink to a copy of `libyabridge.so` with a symlinked `.dll` file.

That seems a bit overkill, but hey, more options are always better,
right?
2020-05-04 13:15:28 +02:00
Robbert van der Helm ae92e61bcc Rename find_wine_vst_host -> find_vst_hsot
This way it's a bit more coherent and it's easier to see what's going on
with this function ordering.
2020-05-04 12:52:56 +02:00
Robbert van der Helm 592b5acdf1 Fix small typos 2020-05-04 00:21:44 +02:00
Robbert van der Helm 40d607353b Clarify and update documentation 2020-05-03 13:45:46 +02:00
Robbert van der Helm 9c6fc78471 Fix editor window handling in Reaper
And other hosts that embed the parent window into another window.
2020-05-02 18:28:43 +02:00
Robbert van der Helm 1f404511d9 Make sure docstrings are at the declarations 2020-05-02 17:46:05 +02:00
Robbert van der Helm 4d7724c5b6 Add a workaround for a bug in Ardour 5.X
Ardour will send events to the plugin before it has even finished
initializing. This has been fixed back in 2018 but Ardour has not seen a
stable release since then.

https://tracker.ardour.org/view.php?id=7668
2020-05-01 17:53:06 +02:00
Robbert van der Helm ed8e3ba114 Refactor event receiving to optimize MIDI handlign
This keeps compatibility with some weirdly designed plugins (such as
Kontakt) while avoiding some unnecessary data transformations. Before
this we'd convert from a `DynamicVstEvents` object to a `VstEvents`
object, back to a `DynamicVstEvents` and then finally back into another
`VstEvents` object. With this change we can skip the second half of the
conversions.
2020-05-01 14:06:06 +02:00
Robbert van der Helm 6c496da455 Clean up after reverting buffer handling change
This is what you get from not taking any breaks.
2020-04-30 22:45:22 +02:00
Robbert van der Helm eb94f63e2c Revert "Clean up chunk buffer retrieval for effGetChunk"
This reverts commit fb8fe035d8.

I was getting things mixed up.
2020-04-30 22:41:07 +02:00
Robbert van der Helm 6266072641 Explicitly list opcodes that should return strings
The automatic detection works fine in every case I've tested other than
Fabfilter plugins, but this is probably for the best.
2020-04-30 20:55:49 +02:00
Robbert van der Helm efe5017788 Clarify comments in the PE architecture detection 2020-04-30 19:09:31 +02:00
Robbert van der Helm 2701907614 Improve the 'invalid architecture' error message
Not that I'm expecting to ever see this error message.
2020-04-30 19:07:26 +02:00
Robbert van der Helm 67c3e151d8 Choose a host application by parsing PE headers
Now yabridge can load both 64 and 32 bit plugins without having to
specify which are which.
2020-04-30 18:45:33 +02:00
Robbert van der Helm c051123796 Improve the look of the enabled features list 2020-04-30 16:44:26 +02:00
Robbert van der Helm dcc1a34a41 Use a better check for the 32-bit host 2020-04-30 15:09:13 +02:00
Robbert van der Helm 5958f8058a Print out a list of enabled compile time features 2020-04-30 13:40:55 +02:00
Robbert van der Helm 79e8a37c39 Simplify the 32-bit mode detection 2020-04-30 12:59:11 +02:00
Robbert van der Helm 6ca7eae16a Mention 32-bit support in the readme 2020-04-30 12:48:03 +02:00
Robbert van der Helm 2e9adbe310 Always write message sizes in 64-bit integers
This will make sure the sizes match on both the 32 and 64 bit host
applications. This way only the 32-bit application will have to convert
between 32 and 64 bit integers.
2020-04-30 12:32:27 +02:00
Robbert van der Helm e33f418206 Add a notice when the host is in 23-bit mode 2020-04-29 19:12:29 +02:00