Add a function for temporarily blocking event loop

This can be used to prevent the Win32 message loop from running while
there are plugins in some partially initialized state.
This commit is contained in:
Robbert van der Helm
2021-01-27 18:46:36 +01:00
parent 04d0ff0949
commit 72e29d044a
5 changed files with 89 additions and 9 deletions
+16
View File
@@ -179,6 +179,15 @@ struct InstanceInterfaces {
Steinberg::FUnknownPtr<Steinberg::Vst::IUnitInfo> unit_info;
Steinberg::FUnknownPtr<Steinberg::Vst::IXmlRepresentationController>
xml_representation_controller;
/**
* Whether `IPluginBase:initialize()` has already been called for this
* object instance. If the object doesn't implement `IPluginBase` then this
* will always be true. I haven't run into any VST3 plugins that have issues
* with partially initialized states like the VST2 versions of T-RackS 5
* have, but we'll just do this out of precaution.
*/
bool is_initialized = false;
};
/**
@@ -209,6 +218,13 @@ class Vst3Bridge : public HostBridge {
std::string plugin_dll_path,
std::string endpoint_base_dir);
/**
* For VST3 plugins we'll have to check for every object in
* `object_instances` that supports `IPluginBase` whether
* `IPluginBase::iniitalize()` has been called.
*/
bool inhibits_event_loop() override;
/**
* Here we'll listen for and handle incoming control messages until the
* sockets get closed.