3#include <public.sdk/source/vst/utility/uid.h>
13 const Steinberg::Vst::MediaTypes mediaType,
14 const Steinberg::Vst::BusDirection busDirection,
15 const Steinberg::Vst::BusType busType)
19 unsigned channelsCount{0};
21 const auto busCount = component->getBusCount(mediaType, busDirection);
22 for(
auto i = 0; i < busCount; ++i)
25 if(component->getBusInfo(mediaType, busDirection, i, busInfo) == kResultOk)
27 if(busInfo.busType == busType)
28 channelsCount += busInfo.channelCount;
39 mWrapper = std::make_unique<VST3Wrapper>(module, effectClassInfo);
47 return Instance::GetTailSize();
61 std::make_unique<VST3Instance>(effect,
mWrapper->GetModule(),
mWrapper->GetEffectClassInfo());
70return GuardedCall<bool>([&]{
73 for (
auto &pProcessor : mProcessors)
74 pProcessor->mWrapper->Finalize(
nullptr);
91 float*
const* outBuf,
size_t numSamples)
97 return mWrapper->Process(inBuf, outBuf, numSamples);
99 return mProcessors[group]->mWrapper->Process(inBuf, outBuf, numSamples);
113 pProcessor->mWrapper->ProcessBlockStart(
settings);
121 pProcessor->mWrapper->ResumeProcessing();
129 pProcessor->mWrapper->SuspendProcessing();
137 return mInitialDelay.as_long_long();
143 return GuardedCall<bool>([&]
175 return mWrapper->Process(inBlock, outBlock, blockLen);
188 Steinberg::Vst::kAudio,
189 Steinberg::Vst::kInput,
190 Steinberg::Vst::kMain
199 Steinberg::Vst::kAudio,
200 Steinberg::Vst::kOutput,
201 Steinberg::Vst::kMain
210 wxT(
"BufferSize"), userBlockSize, 8192);
Declare abstract class AudacityException, some often-used subclasses, and GuardedCall.
static Settings & settings()
Hold values to send to effect output meters.
const PerTrackEffect & mProcessor
Base class for many of the effects in Audacity.
size_t mProcessingBlockSize
bool RealtimeProcessEnd(EffectSettings &settings) noexcept override
settings can be updated to let a dialog change appearance at idle
SampleCount GetLatency(const EffectSettings &settings, double sampleRate) const override
std::vector< std::unique_ptr< VST3Instance > > mProcessors
bool RealtimeFinalize(EffectSettings &settings) noexcept override
size_t GetTailSize() const override
size_t SetBlockSize(size_t maxBlockSize) override
bool ProcessFinalize() noexcept override
size_t ProcessBlock(EffectSettings &settings, const float *const *inBlock, float *const *outBlock, size_t blockLen) override
Called for destructive effect computation.
VST3Instance(const PerTrackEffect &effect, VST3::Hosting::Module &module, const VST3::Hosting::ClassInfo &effectClassInfo)
unsigned GetAudioInCount() const override
How many input buffers to allocate at once.
bool RealtimeInitialize(EffectSettings &settings, double sampleRate) override
bool RealtimeSuspend() override
sampleCount mInitialDelay
std::unique_ptr< VST3Wrapper > mWrapper
size_t RealtimeProcess(size_t group, EffectSettings &settings, const float *const *inBuf, float *const *outBuf, size_t numSamples) override
VST3Wrapper & GetWrapper()
bool ProcessInitialize(EffectSettings &settings, double sampleRate, ChannelNames chanMap) override
bool RealtimeAddProcessor(EffectSettings &settings, EffectOutputs *pOutputs, unsigned numChannels, float sampleRate) override
size_t GetBlockSize() const override
unsigned GetAudioOutCount() const override
How many output buffers to allocate at once.
bool RealtimeProcessStart(MessagePackage &package) override
settings are possibly changed, since last call, by an asynchronous dialog
bool RealtimeResume() override
bool GetConfig(const EffectDefinitionInterface &ident, ConfigurationType type, const RegistryPath &group, const RegistryPath &key, Value &var, const Value &defval)
constexpr auto sampleRate
constexpr auto maxBlockSize
unsigned CountChannels(Steinberg::Vst::IComponent *component, const Steinberg::Vst::MediaTypes mediaType, const Steinberg::Vst::BusDirection busDirection, const Steinberg::Vst::BusType busType)
EffectSettings & settings
Externalized state of a plug-in.