| 543 | } |
| 544 | |
| 545 | void VST3Wrapper::InitializeComponents() |
| 546 | { |
| 547 | using namespace Steinberg; |
| 548 | |
| 549 | //Preinitialize with some default values in case if parameters |
| 550 | //flush happens before processing initialized |
| 551 | mSetup.maxSamplesPerBlock = 512; |
| 552 | mSetup.processMode = Vst::kOffline; |
| 553 | mSetup.symbolicSampleSize = Vst::kSample32; |
| 554 | mSetup.sampleRate = 44100.0; |
| 555 | |
| 556 | if(!SetupProcessing(*mEffectComponent, mSetup)) |
| 557 | throw std::runtime_error("bus configuration not supported"); |
| 558 | |
| 559 | mParameterQueues = std::make_unique<SingleInputParameterValue[]>(mEditController->getParameterCount()); |
| 560 | mParameters.reserve(mEditController->getParameterCount()); |
| 561 | |
| 562 | Steinberg::MemoryStream stateStream; |
| 563 | if(mEffectComponent->getState(&stateStream) == kResultOk) |
| 564 | { |
| 565 | int64 unused; |
| 566 | stateStream.seek(0, IBStream::kIBSeekSet, &unused); |
| 567 | mEditController->setComponentState(&stateStream); |
| 568 | } |
| 569 | |
| 570 | { |
| 571 | auto cache = GetCache(mEffectClassInfo.ID()); |
| 572 | if(!cache->defaultSettings.has_value()) |
| 573 | { |
| 574 | cache->defaultSettings = MakeSettings(); |
| 575 | StoreSettings(cache->defaultSettings); |
| 576 | } |
| 577 | } |
| 578 | |
| 579 | static_cast<ComponentHandler*>(mComponentHandler.get()) |
| 580 | ->LoadCurrentParamValues(); |
| 581 | } |
| 582 | |
| 583 | const VST3::Hosting::ClassInfo& VST3Wrapper::GetEffectClassInfo() const |
| 584 | { |
no test coverage detected