| 240 | } |
| 241 | |
| 242 | void VSTEditor::BuildFancy(EffectInstance& instance) |
| 243 | { |
| 244 | auto& vstEffInstance = dynamic_cast<VSTInstance&>(instance); |
| 245 | |
| 246 | // Turn the power on...some effects need this when the editor is open |
| 247 | vstEffInstance.PowerOn(); |
| 248 | |
| 249 | auto control = Destroy_ptr<VSTControl>{ safenew VSTControl }; |
| 250 | if (!control) |
| 251 | { |
| 252 | return; |
| 253 | } |
| 254 | |
| 255 | if (!control->Create(mParent, &vstEffInstance)) |
| 256 | { |
| 257 | return; |
| 258 | } |
| 259 | |
| 260 | { |
| 261 | auto mainSizer = std::make_unique<wxBoxSizer>(wxVERTICAL); |
| 262 | |
| 263 | mainSizer->Add((mControl = control.release()), 0, wxALIGN_CENTER); |
| 264 | |
| 265 | mParent->SetMinSize(wxDefaultSize); |
| 266 | mParent->SetSizer(mainSizer.release()); |
| 267 | } |
| 268 | |
| 269 | NeedEditIdle(true); |
| 270 | |
| 271 | mDialog->Bind(wxEVT_SIZE, OnSize); |
| 272 | |
| 273 | |
| 274 | BindTo(*mDialog, EVT_SIZEWINDOW, &VSTEditor::OnSizeWindow); |
| 275 | |
| 276 | #ifdef __WXMAC__ |
| 277 | #ifdef __WX_EVTLOOP_BUSY_WAITING__ |
| 278 | wxEventLoop::SetBusyWaiting(true); |
| 279 | #endif |
| 280 | #endif |
| 281 | |
| 282 | return; |
| 283 | } |
| 284 | |
| 285 | void VSTEditor::BuildPlain(EffectSettingsAccess &access, EffectType effectType, double projectRate) |
| 286 | { |