| 514 | } |
| 515 | |
| 516 | VSTEditor::VSTEditor( |
| 517 | VSTInstance& instance, |
| 518 | EffectType type, |
| 519 | bool gui, |
| 520 | const EffectUIServices& services, |
| 521 | EffectSettingsAccess& access, |
| 522 | wxWindow* pParent, |
| 523 | int numParams |
| 524 | ) |
| 525 | : EffectEditor(services, access), |
| 526 | mType{ type }, |
| 527 | mInstance(instance), |
| 528 | mGui{ gui }, |
| 529 | mParent(pParent), |
| 530 | mDialog( static_cast<wxDialog*>(wxGetTopLevelParent(pParent)) ), |
| 531 | mNumParams(numParams) |
| 532 | { |
| 533 | // In case of nondestructive processing, put an initial message in the |
| 534 | // queue for the instance |
| 535 | mAccess.ModifySettings([&](EffectSettings &settings){ |
| 536 | return GetInstance().MakeMessageFS(VSTInstance::GetSettings(settings)); |
| 537 | }); |
| 538 | |
| 539 | auto settings = mAccess.Get(); |
| 540 | StoreSettingsToInstance(settings); |
| 541 | |
| 542 | //! Note the parameter names for later use |
| 543 | mInstance.ForEachParameter([&](const VSTWrapper::ParameterInfo &pi) { |
| 544 | mParamNames.push_back(pi.mName); |
| 545 | return true; |
| 546 | } ); |
| 547 | |
| 548 | mTimer = std::make_unique<VSTTimer>(this); |
| 549 | |
| 550 | wxTheApp->Bind(wxEVT_IDLE, &VSTEditor::OnIdle, this); |
| 551 | } |
| 552 | |
| 553 | |
| 554 | VSTInstance& VSTEditor::GetInstance() const |
nothing calls this directly
no test coverage detected