mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-09 16:24:57 +01:00
VST3: initialize controller even if it is-a component
This commit is contained in:
parent
cc084ef0a7
commit
bbbfadb832
1 changed files with 10 additions and 4 deletions
|
|
@ -1056,23 +1056,29 @@ VST3PI::VST3PI (boost::shared_ptr<ARDOUR::VST3PluginModule> m, std::string uniqu
|
|||
throw failed_constructor ();
|
||||
}
|
||||
|
||||
if (_component->initialize (HostApplication::getHostContext ()) != kResultOk) {
|
||||
if (!_component || _component->initialize (HostApplication::getHostContext ()) != kResultOk) {
|
||||
throw failed_constructor ();
|
||||
}
|
||||
|
||||
_controller = FUnknownPtr<Vst::IEditController> (_component);
|
||||
|
||||
if (!_controller) {
|
||||
TUID controllerCID;
|
||||
if (_component->getControllerClassId (controllerCID) == kResultTrue) {
|
||||
if (factory->createInstance (controllerCID, Vst::IEditController::iid, (void**)&_controller) != kResultTrue) {
|
||||
throw failed_constructor ();
|
||||
}
|
||||
if (_controller && (_controller->initialize (HostApplication::getHostContext ()) != kResultOk)) {
|
||||
_component->terminate ();
|
||||
_component->release ();
|
||||
throw failed_constructor ();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (_controller && (_controller->initialize (HostApplication::getHostContext ()) != kResultOk)) {
|
||||
_component->terminate ();
|
||||
_component->release ();
|
||||
throw failed_constructor ();
|
||||
}
|
||||
|
||||
if (!_controller) {
|
||||
_component->terminate ();
|
||||
_component->release ();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue