MCPcopy Create free account
hub / github.com/audacity/audacity / InitializeComponents

Method InitializeComponents

libraries/lib-vst3/VST3Wrapper.cpp:545–581  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

543}
544
545void 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
583const VST3::Hosting::ClassInfo& VST3Wrapper::GetEffectClassInfo() const
584{

Callers 5

LoadFactoryPresetMethod · 0.80
LoadPresetMethod · 0.80
ValidateMethod · 0.80
VST3InstanceMethod · 0.80
ExportPresetsMethod · 0.80

Calls 8

SetupProcessingFunction · 0.85
GetCacheFunction · 0.85
getParameterCountMethod · 0.80
has_valueMethod · 0.80
seekMethod · 0.45
IDMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected