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

Method Initialize

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

Source from the content-addressed store, hash-verified

742}
743
744bool VST3Wrapper::Initialize(EffectSettings& settings, Steinberg::Vst::SampleRate sampleRate, Steinberg::int32 processMode, Steinberg::int32 maxSamplesPerBlock)
745{
746 using namespace Steinberg;
747
748 Vst::ProcessSetup setup = {
749 processMode,
750 Vst::kSample32,
751 maxSamplesPerBlock,
752 sampleRate
753 };
754
755 if(!SetupProcessing(*mEffectComponent.get(), setup))
756 return false;
757
758 mSetup = setup;
759
760 FetchSettings(settings);
761
762 if(mEffectComponent->setActive(true) == kResultOk)
763 {
764 if(mAudioProcessor->setProcessing(true) != kResultFalse)
765 {
766 mProcessContext.state = Vst::ProcessContext::kPlaying;
767 mProcessContext.sampleRate = sampleRate;
768
769 mActive = true;
770 ConsumeChanges(settings);
771 //make zero-flush, to make sure parameters are delivered to the processor...
772 Process(nullptr, nullptr, 0);
773 StoreSettings(settings);
774 return true;
775 }
776 }
777 return false;
778}
779
780void VST3Wrapper::Finalize(EffectSettings* settings)
781{

Callers 2

RealtimeInitializeMethod · 0.45
ProcessInitializeMethod · 0.45

Calls 3

SetupProcessingFunction · 0.85
ProcessFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected