Commit Graph

495 Commits

Author SHA1 Message Date
Robbert van der Helm 17cff5722e Lock the active plugins map early
To prevent a race condition when an exiting plugin wants to terminate
the process when it think there are no plugins left just as another
yabridge instance is connecting to the group socket.
2020-05-21 17:12:41 +02:00
Robbert van der Helm 8eb01cb519 Listen on the group socket and handle requests 2020-05-20 18:45:33 +02:00
Robbert van der Helm 6d6d928838 Move all plugin group handling boilerplate 2020-05-19 15:29:48 +02:00
Robbert van der Helm 8bd1dc8c50 Encapsulate the STDOUT/STDERR capturing 2020-05-18 16:15:07 +02:00
Robbert van der Helm 53acb1f78a Move wine-bridge.h -> bridges/vst2.h
This way we can structure the group handling and a potential future VST3
bridge in the same way.
2020-05-18 16:15:07 +02:00
Robbert van der Helm b8028b8e13 Remap STDOUT and STDERR in group process to log
This is not very pretty, but there's not really another way and I"m
surprised that it actually works.
2020-05-18 16:15:07 +02:00
Robbert van der Helm 2f39650322 Remove last traces of Boost.Filesystem from host
Missed this in e728dbe5a2.
2020-05-18 16:15:07 +02:00
Robbert van der Helm 994f3c9e38 Add a plugin group host application 2020-05-18 16:15:07 +02:00
Robbert van der Helm 95e716d229 Rename vst-host.cpp -> individual-host.cpp 2020-05-17 14:43:21 +02:00
Robbert van der Helm 37a74c8f98 Get rid of the dedicated AEffect socket 2020-05-13 13:15:52 +02:00
Robbert van der Helm 0900dc9e18 Work around race condition in certain plugins
Some plugins would either crash or freeze on the next Win32 message loop
when `effEditGetRect` gets called before `effEditOpen` and we run the
message loop between these two event calls.

Fixes the issue with Superior Drummer 3 in Bitwig mentioned in #12 and a
similar issue with the Roland Cloud synths.
2020-05-12 13:17:24 +02:00
Robbert van der Helm 33e5d2bd56 Add a workaround for compilation with Wine 5.7+ 2020-05-11 18:11:44 +02:00
Robbert van der Helm ba91971829 Simplify object reading
No longer needs to read into an existing object after the last change,
and reusing that function here too makes it less error prone.
2020-05-10 13:10:58 +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 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 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 e4cfc8f43b Fix typo in .dll loading error message 2020-05-06 01:39:14 +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 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 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 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 dcc1a34a41 Use a better check for the 32-bit host 2020-04-30 15:09:13 +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 e33f418206 Add a notice when the host is in 23-bit mode 2020-04-29 19:12:29 +02:00
Robbert van der Helm e414c1a341 Fix screen resolution detection 2020-04-28 12:22:56 +02:00
Robbert van der Helm 8adb944445 Use maximum display resolution for the window size
Instead of it being hardcoded to 1440p.
2020-04-28 11:47:39 +02:00
Robbert van der Helm 4b84f663ab Always run the event loop, fixing processing issue
Also remove any special `effEditIdle` handling.

Apparently plugins rely on the message loop for their internal tasks,
even for things that have nothing to do with GUIs, such as deferring
initialization.
2020-04-27 18:53:06 +02:00
Robbert van der Helm 7f0a8c8efd Extend the midi event lock
This should not make any difference, but if this event ever gets called
at the same time as the processing then this at least won't cause any
issues with plugins that are not thread safe themselves.
2020-04-27 16:53:44 +02:00
Robbert van der Helm af6ae2c2ad Fix capitalization of the word MIDI 2020-04-26 18:19:10 +02:00
Robbert van der Helm 85afd4107e Extend the lifetime of MIDI events, fixing Kontakt 2020-04-26 18:17:30 +02:00
Robbert van der Helm aee890fbf6 Remove the now unused ability to skip opcodes
If this is needed again in the future (it shouldn't be), then it should
be re-implemented using a separate function.
2020-04-26 16:30:11 +02:00
Robbert van der Helm 5ce20be9d9 Allow storing and loading of larger chunks 2020-04-25 17:35:02 +02:00
Robbert van der Helm 631e82f2ad Print the version and any VCS info at startup 2020-04-25 16:14:22 +02:00
Robbert van der Helm 0efdd1a790 Add missing license headers 2020-04-24 15:41:18 +02:00
Robbert van der Helm d0c8d8a2e7 Clean up Win32 thread API usage using RAII 2020-04-24 15:40:44 +02:00
Robbert van der Helm 9dfa83df20 Change todo regarding drag-and-drop 2020-04-23 23:16:31 +02:00
Robbert van der Helm 060712ee4d Remote the WS_EX_ACCEPTFILES
It doesn't matter, but we shouldn't be the window accepting drag and
drop operations.
2020-04-23 23:13:55 +02:00
Robbert van der Helm 259d23ec57 Add support for legacy plugins with only process()
By emulating the behavior of `processReplacing()`. Not that there should
still be any plugins around that don't support processReplacing.
2020-04-22 16:57:18 +02:00
Robbert van der Helm 27ca18869b Change variable names for consistency 2020-04-21 17:02:28 +02:00
Robbert van der Helm d2bf5c35a4 Fix hanging when closing the editor 2020-04-21 16:56:36 +02:00
Robbert van der Helm 421ed21901 Get rid of now no longer needed synchronisation
This was mostly a workaround to get Serum to not crash when audio was
being processed during a specific point of its `WM_PAINT` message
handler. This is no longer needed when using `CreateThread` instead of
`std::thread`.
2020-04-20 23:36:17 +02:00
Robbert van der Helm 86974ebe2d Fix typo 2020-04-20 23:25:01 +02:00
Robbert van der Helm 357dec315a Swap out std::thread for CreateThread
Not entirely sure why, but this gets rid of the impossible to debug data
races when Serum's GUI is being repainted while another thread is
calling `processReplacing`. This is possibly because std::thread does
not respect Windows calling conventions and CreateThread does.
2020-04-20 23:24:39 +02:00
Robbert van der Helm 1a6a094c2b Fix reopening closed editor windows 2020-04-19 20:36:39 +02:00
Robbert van der Helm b44d98b4c7 Mention more Wine debugging strategies 2020-04-19 16:38:09 +02:00
Robbert van der Helm 9f3ed85208 Replace std::monostate with std::nullptr_t
This represents the underlying meaning better since we're mostly dealing
with the `data` void pointer argument.
2020-04-19 16:05:37 +02:00
Robbert van der Helm 6025efb0fc Fix grammar in comments 2020-04-19 15:46:32 +02:00
Robbert van der Helm 0cce91d460 Reuse output buffers 2020-04-19 15:38:31 +02:00