Add notes on things that can potentially go wrong

This commit is contained in:
Robbert van der Helm
2020-12-07 16:57:56 +01:00
parent 8e09d50a54
commit 75e8cf9140
3 changed files with 29 additions and 16 deletions
+13 -12
View File
@@ -33,21 +33,22 @@ YaPluginFactoryPluginImpl::createInstance(Steinberg::FIDString cid,
// factory with thsoe same `cid` and `_iid` arguments.
// 4. It this was successful, we'll assign this object a unique number
// (by just doing a fetch-and-add on an atomic size_t) so we can
// refer to it and add it to an `std::map<size_t, IPtr<T>` (could
// also throw everything in a single map with `FUnknown`s, but
// while more verbose this sounds much less prone to breakage).
// 5. We'll serialize any payload data into a `YaT` **which includes
// refer to it and add it to an `std::map<size_t, IP tr<T>`, where
// `T` is the _original_ object (we don't have to and shouldn't
// wrap it).
// 5. We'll copy over any payload data into a `YaT` **which includes
// that unique identifier we generated** and send it back to the
// plugin.
// 6. The plugin then converts it to the correct smart pointer format
// and writes it to `obj`. We don't have to keep track of these
// objects on the plugin side and the reference counting pointers
// will cause everything to clean up after itself.
// 7. Since those `YaT` objects we'll return from `createInstance()`
// will have a reference to `Vst3PluginBridge`, they can also send
// control messages themselves.
// 6. On the plugin's side we'll create a new `YaTPluginImpl` inside
// of a VST smart pointer and deserialize the `YaT` we got sent
// into that. We then write that smart pointer into `obj`. We don't
// have to keep track of these objects on the plugin side and the
// reference counting pointers will cause everything to clean up
// after itself.
// 7. Since those `YaTPluginImpl` objects we'll return from
// `createInstance()` will have a reference to `Vst3PluginBridge`,
// they can also send control messages themselves.
// TODO: Send a control message
return Steinberg::kNotImplemented;
}
+3
View File
@@ -86,6 +86,9 @@ class Vst3PluginBridge : PluginBridge<Vst3Sockets<std::jthread>> {
* ourselves.
*
* @related get_plugin_factory
*
* FIXME: We can't use `std::unique_ptr` here because that breaks VST3's
* reference counting mechanism.
*/
std::unique_ptr<YaPluginFactory> plugin_factory;
};