Commit Graph

40 Commits

Author SHA1 Message Date
Robbert van der Helm df93944f3b Prevent allocations caused by Logger::log_trace
C++ would always construct an `std::string` from the string constant
every iteration. Since this also happened when `YABRIDGE_DEBUG_LEVEL` is
not set to 2, this ended up causing unnecessary allocations.
2021-05-23 00:21:21 +02:00
Robbert van der Helm bd0dd63ad2 Rename the EventResult struct to Vst2EventResult 2021-05-20 15:53:16 +02:00
Robbert van der Helm 2bf41c6fe1 Move EventPayload to Vst2Event::Payload 2021-05-20 15:52:40 +02:00
Robbert van der Helm b1c9d75112 Rename the Event struct to Vst2Event 2021-05-20 15:50:09 +02:00
Robbert van der Helm ccfda51a69 Clarify the DefaultDataConverter method names 2021-05-20 14:49:11 +02:00
Robbert van der Helm c2186fa55b Use the std::derived_from concept when applicable
This probably makes things much clearer at a glance instead of using a
blanked typename.
2021-05-20 14:31:59 +02:00
Robbert van der Helm 37257298a1 Add noexcept qualifications on the plugin side
See the last few commits.
2021-05-14 18:22:58 +02:00
Robbert van der Helm ce668ec022 Clean up style 2021-05-05 19:38:46 +02:00
Robbert van der Helm 6f6e6c5b94 Reword caching to prefetching
Since that makes it much clearer what we're actually doing. With old
`cache_time_info` was actually caching the response, but now we're
querying it before the plugin has even requested the information.
2021-04-29 01:07:14 +02:00
Robbert van der Helm c82eb35243 Also cache audioMasterGetCurrentProcessLevel()
Melda plugins seem to call this during every processing cycle.
2021-04-29 01:02:10 +02:00
Robbert van der Helm 1deb4cf664 Send the VST2 transport info along with processing
And cache it during the processing cycle. This greatly reduces the
overhead of bridging VST2 plugins.
2021-04-29 00:32:25 +02:00
Robbert van der Helm 3a73fb9689 Allow hiding the DAW name for VST2 plugins
This can be useful when plugins have (broken) host-specific behaviour
that you want to avoid. I'll later add a list of host/plugin
combinations where this may be useful to the readme.
2021-04-27 18:41:36 +02:00
Robbert van der Helm 68c846324c Also explicitly list simple dispatcher opcodes 2021-04-25 23:07:24 +02:00
Robbert van der Helm 0d1cb0bd77 Move special effVendorSpecific handling for REAPER
It's a bit less hacky if we do the effVendorSpecific check where we're
supposed to be checking for those things.
2021-04-24 20:23:23 +02:00
Robbert van der Helm d5e4424463 Also sync VST3 audio thread scheduling priorities
The exact same thing as the last commit, but for VST3 plugins.
2021-01-23 15:22:10 +01:00
Robbert van der Helm f03b9b1497 Sync VST2 audio thread scheduling priorities
We'll periodically copy the scheduling priorities from the host's audio
threads to the Wine plugin host's audio threads. The overhead of doing
this is about 1 microsecond on my system, so doing this every cycle
really adds up. But getting the Unix epoch time and comparing some
timestamps has a neglegible overhead, so this should give you the best
of both worlds.

Next we'll do the same thing for VST3 plugins.

As suggested by @jhernberg
2021-01-23 15:14:52 +01:00
Robbert van der Helm 96511ca8a3 Make realtime priority setting more granular
On the plugin side.
2021-01-23 14:43:06 +01:00
Robbert van der Helm d7d5725ae9 Fix typo 2021-01-19 18:02:35 +01:00
Robbert van der Helm 36535fc3b5 Fix VST2 editor resizing in REAPER
After solving this for VST3 plugins it become clear that REAPER required
us to do the exact same thing for VST2 plugins.
2021-01-19 17:49:40 +01:00
Robbert van der Helm b2ccfed2e6 Add a note for a potential fix for REAPER resizing 2021-01-18 16:00:45 +01:00
Robbert van der Helm 4ec8b01bcc Completely run effEditIdle from a timer
Although it hasn't shown up, this will get rid of the possibility of
off-thread effEditIdle calls causing issues. And since we need some way
to run call this function while the event loop is running anyways, doing
it entirely from a timer similar to how hosts on Windows would do it
seems like the best solution.
2021-01-04 15:50:17 +01:00
Robbert van der Helm 34f8d3b1d2 Update the copyright notices for 2021 2021-01-01 18:54:02 +01:00
Robbert van der Helm f71c7a3895 Move work dropping to Vst2PluginBridge destructor
For consistency with `Vst3PluginBridge`.
2020-12-17 13:52:12 +01:00
Robbert van der Helm 62f376d952 Allow the module to be properly unloaded
Terminating the host process will cause all sockets to be closed so we
can join the threads.
2020-12-14 22:49:20 +01:00
Robbert van der Helm 42664be378 Use std::copy_n instead of pointer arithmetic 2020-12-13 23:19:37 +01:00
Robbert van der Helm 426231a22b Avoid potential UB in loggers using composition
This cast would work fine, but any other fields added to those loggers
would be left uninitialized.
2020-12-07 18:28:16 +01:00
Robbert van der Helm c1e7f53cd0 💥 Major refactor of initialization plumbing
To account for the differences in VST2 plugins and VST3 modules we had
to wrap most of our old functions from `src/plugin/utils.h` in a new
`PluginInfo` struct that gathers all of this information while taking
into account the differences between VST2 and VST3 plugins.

With this change things are also a lot more organized. We can just query
the plugin information we need rather than having to store things
separately or having to recalculate things. This also moved the
responsibility of all the weird `WINEPREFIX` behaviour to a single place
instead of having it spread around `utils.pp`, the initialisation
message, and `host-procoess.cpp`.
2020-12-07 18:28:16 +01:00
Robbert van der Helm b9e63ea335 Move the host guard handler to PluginBridge 2020-12-07 18:28:16 +01:00
Robbert van der Helm 6b9ae78b27 Factor out all plumbing in Vst2PluginBridge
So we can reuse it in Vst3PluginBridge later.
2020-12-07 18:28:16 +01:00
Robbert van der Helm f845763af0 Print the plugin type during initialisation 2020-12-07 18:28:16 +01:00
Robbert van der Helm c57fd67aa8 Don't store the Wine version as a field
It's only needed for the initialisation message, and it doesn't throw so
doing this later shouldn't make a difference.
2020-12-07 18:28:16 +01:00
Robbert van der Helm 3c72ab31f8 Shut up clang/ccls 2020-12-07 18:28:16 +01:00
Robbert van der Helm a9b7a6a835 List VST3 support in the initialization message 2020-12-07 18:28:16 +01:00
Robbert van der Helm f9a1bcd7bd Split VST2 specific functionality into Vst2Logger 2020-12-07 18:28:16 +01:00
Robbert van der Helm 278cd2e710 Spawn all hosts directly using HostRequest
This way we can set the plugin type inside of the `Vst*PluginBridge`
instance.
2020-12-07 18:28:16 +01:00
Robbert van der Helm 1c5a9423d2 Print the plugin type on initialization 2020-12-07 18:28:16 +01:00
Robbert van der Helm 47baef3107 Rename architecture related functions and structs 2020-12-07 18:28:16 +01:00
Robbert van der Helm 46bc0301af Move communication.h to communication/vst2.h 2020-12-07 18:28:16 +01:00
Robbert van der Helm 4291083a46 Rename PluginBridge to Vst2PluginBridge 2020-12-07 18:28:16 +01:00
Robbert van der Helm 6195caf53e Move src/plugin-bridge to src/bridges/vst2 2020-12-07 18:28:16 +01:00