Commit Graph

298 Commits

Author SHA1 Message Date
Robbert van der Helm 49a87371bc Add todos for logging successful interface queries 2020-12-14 13:23:27 +01:00
Robbert van der Helm 0668a785b0 Add stubs for implementing IAudioProcessor 2020-12-14 13:06:02 +01:00
Robbert van der Helm e653142e45 Implement IComponent::getState()
With this the basic IComponent interface is fully implemented. Next will
be `IAudioProcessor` and `IConnectionPoint` as additions to IComponent.
We'll use the same `known_iids` mechanism as used in the plugin factory.
2020-12-14 12:38:35 +01:00
Robbert van der Helm 816d1c1501 Implement IComponent::setState() 2020-12-14 12:09:47 +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 7341fab0ea Implement IComponent::setActive() 2020-12-13 22:17:06 +01:00
Robbert van der Helm 43296675f6 Implement IComponent::activateBus() 2020-12-13 22:07:45 +01:00
Robbert van der Helm 5b6a8ebfac Implement IComponent::getRoutingInfo() 2020-12-13 21:51:56 +01:00
Robbert van der Helm 9df812952e Implement IComponent::GetBusInfo() 2020-12-13 16:56:09 +01:00
Robbert van der Helm 34b2fa8905 Implement IComponent::getBusCount() 2020-12-13 16:18:13 +01:00
Robbert van der Helm 116b618ac5 Implement IComponent::setIoMode() 2020-12-13 16:12:30 +01:00
Robbert van der Helm 3f3759e5fc Log calls to unimplemented functions 2020-12-13 16:01:52 +01:00
Robbert van der Helm 32c1028736 Implement IPluginFactory3::setHostContext()
Now the plugin factories are fully implemented (at least, functionality
wise, we still can't create most kinds of objects).
2020-12-13 15:53:39 +01:00
Robbert van der Helm e21ee31ee8 Implement plugin side of IPluginBase::initialize() 2020-12-13 14:30:51 +01:00
Robbert van der Helm cd92b7a976 Log failed calls to IComponent::queryInterface() 2020-12-12 22:25:25 +01:00
Robbert van der Helm 0ad56874e2 Abstract away logging unknown interfaces 2020-12-12 22:22:27 +01:00
Robbert van der Helm 39984ad442 Use the new approach for creating plugin factory
Directly serializing and deserializing into objects was and more
boilerplate heavy (since we now need two implementations even though we
only use one), and also much less flexible because we can't wrap
payloads in structs or provide optional values that way.
2020-12-12 21:53:38 +01:00
Robbert van der Helm 1b30000147 Keep track of active YaComponentPluginImpls
So we can do host callbacks later.
2020-12-12 21:24:11 +01:00
Robbert van der Helm efc840a51a Log unknown interfaces in IComponent::initialize() 2020-12-12 16:53:44 +01:00
Robbert van der Helm f637e6ad18 Rename Create/Destroy to Construct/Destruct
This is less likely to clash with names used by interfaces and it's a
bit clearer what's going on (since they are basically proxies for
constructors and destructors).
2020-12-12 16:18:47 +01:00
Robbert van der Helm 68084bc555 Implement IComponent::terminate() 2020-12-12 16:18:47 +01:00
Robbert van der Helm e24cecc6d7 Use the univeral tresult in IComponent creation 2020-12-11 23:54:30 +01:00
Robbert van der Helm 699ddfd2ea Implement YaComponentPluginImpl destructor
When the object gets dropped through the reference counting system, the
object should also be dropped in the Wine plugin host.
2020-12-11 22:59:32 +01:00
Robbert van der Helm cdb9dae2df Rename YaComponent::Arguments to CreateArgs 2020-12-11 22:43:12 +01:00
Robbert van der Helm d1d85711f0 Split up the VST3 class implementations 2020-12-11 22:37:20 +01:00
Robbert van der Helm 9439a62d94 Fix formatting 2020-12-11 16:56:46 +01:00
Robbert van der Helm aae98d518c Fix the with-winedbg option 2020-12-11 00:35:29 +01:00
Robbert van der Helm 225056bcff Allow instantiating IComponents 2020-12-08 23:08:07 +01:00
Robbert van der Helm 9b025052d2 Add stubs for an IComponent implementation 2020-12-08 23:02:26 +01:00
Robbert van der Helm 92ea15bcb4 Allow interface implementations to send messages 2020-12-08 23:01:50 +01:00
Robbert van der Helm f4a5aa91fb Document the plugin factory approach 2020-12-08 14:21:54 +01:00
Robbert van der Helm f1fe0fa8a4 Log a warning when encountering unknown interfaces 2020-12-07 22:21:01 +01:00
Robbert van der Helm 7b3a6af7d1 Use raw pointers for the plugin factory
Since the object cleans up after itself after the smart pointers are
dropped on the host side this would result in a use after free by the
smart pointers.
2020-12-07 18:28:17 +01:00
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 8e09d50a54 Describe how createInstance() is going to work 2020-12-07 18:28:17 +01:00
Robbert van der Helm 9954282065 Add manual reference counting to GetPluginFactory
Since even though we're passign raw pointers, it's expected that they
are actually `IPtr<T>`s.
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 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 7fb8cf97b1 Request factory after setting up callback handlers
Otherwise we'll get a deadlock.
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 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 930ebbf7d1 Add more todos for VST3 handling 2020-12-07 18:28:16 +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 0819e9fda9 Request/send config for VST3 plugins
Using the new Vst3MessageHandler.
2020-12-07 18:28:16 +01:00
Robbert van der Helm 2e9b100090 Add handlers for control messages and callbacks 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