| 93 | |
| 94 | |
| 95 | bool VST3Editor::TryLoadNativeUI(wxWindow* parent) |
| 96 | { |
| 97 | using namespace Steinberg; |
| 98 | |
| 99 | if(const auto view = owned (mWrapper.mEditController->createView (Vst::ViewType::kEditor))) |
| 100 | { |
| 101 | //Workaround: override default min size set by EffectUIHost::Initialize() |
| 102 | parent->SetMinSize(wxDefaultSize); |
| 103 | //IPlugFrame::resizeView is supposed to call IPlugView::setSize |
| 104 | //in the same call stack, assign before frame is attached |
| 105 | mPlugView = view; |
| 106 | |
| 107 | #if __WXGTK__ |
| 108 | safenew internal::x11::SocketWindow(parent, wxID_ANY, view); |
| 109 | #else |
| 110 | |
| 111 | static const auto platformType = |
| 112 | # if __WXMAC__ |
| 113 | kPlatformTypeNSView; |
| 114 | # elif __WXMSW__ |
| 115 | kPlatformTypeHWND; |
| 116 | # else |
| 117 | # error "Platform not supported" |
| 118 | # endif |
| 119 | auto plugFrame = owned(safenew internal::PlugFrame { parent }); |
| 120 | view->setFrame(plugFrame); |
| 121 | if(view->attached(parent->GetHandle(), platformType) != kResultOk) |
| 122 | return false; |
| 123 | mPlugFrame = plugFrame; |
| 124 | |
| 125 | ViewRect initialSize; |
| 126 | if(view->getSize(&initialSize) == kResultOk) |
| 127 | plugFrame->init(view.get(), &initialSize); |
| 128 | #endif |
| 129 | return true; |
| 130 | } |
| 131 | return false; |
| 132 | } |
| 133 | |
| 134 | bool VST3Editor::IsGraphicalUI() |
| 135 | { |