Commit Graph

26 Commits

Author SHA1 Message Date
Robbert van der Helm d79bc3b936 Don't use STL smart pointers with VST3 interfaces
This would cause double frees since those objects are supposed to clean
up after themselves.
2020-12-07 18:28:17 +01:00
Robbert van der Helm 75e8cf9140 Add notes on things that can potentially go wrong 2020-12-07 18:28:17 +01:00
Robbert van der Helm 547b11e8ba Remove interface filtering from the plugin factory
This doesn't work that way, and CIDs really are class IDs (good thing
that everything's documented, oh right).
2020-12-07 18:28:17 +01:00
Robbert van der Helm e20fc8c7e6 Fix Vst{2,3}Logger::log_trace 2020-12-07 18:28:17 +01:00
Robbert van der Helm 8ea40cd9f9 Rework Vst3MessageHandler::receive_messages
This now takes a regular overloaded function and the visiting is done in
`receive_messages()` itself. This way we can use templates to ensure
that the return type is correct. Otherwise auto will cause issues in the
future when we want to return multiple concrete types from a function
that takes a single variant. The alternative would be both receiving a
variant as a parameter and then returning another variant as a result,
but that is much less type safe.
2020-12-07 18:28:16 +01:00
Robbert van der Helm c2503f8aaa Send the factory from the Wine host to the plugin 2020-12-07 18:28:16 +01:00
Robbert van der Helm 79c6f02d91 Request and deserialize plugin factory from plugin 2020-12-07 18:28:16 +01:00
Robbert van der Helm d5374e4540 💥 Rework Vst3MessageHandler
- Now allows direct deserialization into existing objects. This will be
  necessary for our VST3 implementations since the interface instances
  we'll deserialize into will not be trivially constructable because
  they have to be able to do callbacks.
- `ControlResponse` and `CallbackResponse` were dropped. These response
  enums are not necessary because of the `T::Response` associated type
  and returning the types directly makes the direct deserialization
  possible.
2020-12-07 18:28:16 +01:00
Robbert van der Helm 3be5836c07 Log and ignore unsupported interfaces 2020-12-07 18:28:16 +01:00
Robbert van der Helm 5f14958146 Implement IpluginFactory3::getClassInfoUnicode 2020-12-07 18:28:16 +01:00
Robbert van der Helm ef3f82e00f Implement IpluginFactory2::getClassInfo2 2020-12-07 18:28:16 +01:00
Robbert van der Helm 049eb257c5 Make YaPluginFactory abstract
And add separate implementations for the native plugin and the Wine
plugin host. This way we can easily allow the native host to do
callbacks without having to manage a load of lambdas.
2020-12-07 18:28:16 +01:00
Robbert van der Helm 1db3c0371f Expand on the VST3 implementation readme 2020-12-07 18:28:16 +01:00
Robbert van der Helm dd48523183 Implement IPluginFactory::getClassInfo 2020-12-07 18:28:16 +01:00
Robbert van der Helm e6da03ae84 Implement IPluginFactory::countClasses() 2020-12-07 18:28:16 +01:00
Robbert van der Helm 79df8fecc2 Serialize the factory info 2020-12-07 18:28:16 +01:00
Robbert van der Helm fa10600114 Add more thoughts on how the factory should work 2020-12-07 18:28:16 +01:00
Robbert van der Helm 82c1542b74 Add boilerplate for copying factory interfaces 2020-12-07 18:28:16 +01:00
Robbert van der Helm 8f152c7af5 Clean up the query interface serialization 2020-12-07 18:28:16 +01:00
Robbert van der Helm 42f3639e93 Add boilerplate for PluginFactory serialization 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 70405e8917 Encapsulate our VST3 message handling pattern
Similarly to how how we do it in `EventHandler`.
2020-12-07 18:28:16 +01:00
Robbert van der Helm db1a51af5c Add serialization primitives for VST3 2020-12-07 18:28:16 +01:00
Robbert van der Helm e21d3e020f Rename GroupRequest to HostRequest
We'll also use this to encode information in when launching
`yabridge-host.exe` for individually hosted plugins.
2020-12-07 18:28:16 +01:00
Robbert van der Helm f9bb3822de Pass plugin type when calling the host application 2020-12-07 18:28:16 +01:00
Robbert van der Helm 9c8b543d5d Split serialization.h into common and VST2 parts 2020-12-07 18:28:16 +01:00