![]() |
Audacity 3.2.0
|
#include <VST3Wrapper.h>
Public Member Functions | |
VST3Wrapper (VST3::Hosting::Module &module, VST3::UID effectUID) | |
~VST3Wrapper () | |
VST3Wrapper (const VST3Wrapper &)=delete | |
VST3Wrapper (VST3Wrapper &&)=delete | |
VST3Wrapper & | operator= (const VST3Wrapper &)=delete |
VST3Wrapper & | operator= (VST3Wrapper &&)=delete |
VST3::Hosting::Module & | GetModule () const |
bool | IsActive () const noexcept |
void | FetchSettings (EffectSettings &) |
Fetch state from settings object, may change internal runtime data. More... | |
void | StoreSettings (EffectSettings &) const |
Saves current state inside settings object, clears all runtime data. More... | |
bool | LoadPreset (Steinberg::IBStream *fileStream) |
bool | SavePreset (Steinberg::IBStream *fileStream) const |
bool | Initialize (EffectSettings &settings, Steinberg::Vst::SampleRate sampleRate, Steinberg::int32 processMode, Steinberg::int32 maxSamplesPerBlock) |
Initializes effect for processing using settings. More... | |
void | Finalize (EffectSettings *settings) |
void | ProcessBlockStart (const EffectSettings &settings) |
Prepares effect to process next block with changes written to the settings object. More... | |
void | FlushParameters (EffectSettings &settings, bool *hasChanges=nullptr) |
size_t | Process (const float *const *inBlock, float *const *outBlock, size_t blockLen) |
void | SuspendProcessing () |
void | ResumeProcessing () |
void | BeginParameterEdit (EffectSettingsAccess &access) |
void | EndParameterEdit () |
Steinberg::int32 | GetLatencySamples () const |
Static Public Member Functions | |
static EffectSettings | MakeSettings () |
static void | LoadSettings (const CommandParameters &parms, EffectSettings &settings) |
static void | SaveSettings (const EffectSettings &settings, CommandParameters &parms) |
static OptionalMessage | LoadUserPreset (const EffectDefinitionInterface &effect, const RegistryPath &name, EffectSettings &settings) |
static void | SaveUserPreset (const EffectDefinitionInterface &effect, const RegistryPath &name, const EffectSettings &settings) |
static void | CopySettingsContents (const EffectSettings &src, EffectSettings &dst) |
Public Attributes | |
Steinberg::IPtr< Steinberg::Vst::IAudioProcessor > | mAudioProcessor |
Steinberg::Vst::ProcessSetup | mSetup |
Steinberg::IPtr< Steinberg::Vst::IComponent > | mEffectComponent |
Steinberg::IPtr< Steinberg::Vst::IEditController > | mEditController |
Steinberg::IPtr< Steinberg::Vst::IConnectionPoint > | mComponentConnectionProxy |
Steinberg::IPtr< Steinberg::Vst::IConnectionPoint > | mControllerConnectionProxy |
Steinberg::IPtr< Steinberg::Vst::IComponentHandler > | mComponentHandler |
std::function< void(Steinberg::Vst::ParamID, Steinberg::Vst::ParamValue)> | ParamChangedHandler |
Private Member Functions | |
void | ConsumeChanges (const EffectSettings &settings) |
Private Attributes | |
EffectSettings | mDefaultSettings |
VST3::Hosting::Module & | mModule |
bool | mActive {false} |
const VST3::UID | mEffectUID |
std::vector< std::pair< Steinberg::Vst::ParamID, Steinberg::Vst::ParamValue > > | mParameters |
std::unique_ptr< SingleInputParameterValue[]> | mParameterQueues |
Definition at line 53 of file VST3Wrapper.h.
VST3Wrapper::VST3Wrapper | ( | VST3::Hosting::Module & | module, |
VST3::UID | effectUID | ||
) |
Definition at line 380 of file VST3Wrapper.cpp.
References AudacityVst3HostApplication::Get(), MakeSettings(), mAudioProcessor, mComponentConnectionProxy, mComponentHandler, mControllerConnectionProxy, mDefaultSettings, mEditController, mEffectComponent, mEffectUID, mParameterQueues, mParameters, mSetup, safenew, Steinberg::MemoryStream::seek(), anonymous_namespace{VST3Wrapper.cpp}::SetupProcessing(), and StoreSettings().
VST3Wrapper::~VST3Wrapper | ( | ) |
Definition at line 464 of file VST3Wrapper.cpp.
References mComponentConnectionProxy, mControllerConnectionProxy, mEditController, and mEffectComponent.
|
delete |
|
delete |
void VST3Wrapper::BeginParameterEdit | ( | EffectSettingsAccess & | access | ) |
Definition at line 782 of file VST3Wrapper.cpp.
References mComponentHandler.
Referenced by VST3UIValidator::VST3UIValidator().
|
private |
Definition at line 629 of file VST3Wrapper.cpp.
References anonymous_namespace{VST3Wrapper.cpp}::GetSettings(), mParameters, and settings().
Referenced by Finalize(), FlushParameters(), Initialize(), and ProcessBlockStart().
|
static |
Definition at line 869 of file VST3Wrapper.cpp.
References anonymous_namespace{VST3Wrapper.cpp}::GetSettings(), and anonymous_namespace{NoteTrack.cpp}::swap().
Referenced by VST3Effect::CopySettingsContents().
void VST3Wrapper::EndParameterEdit | ( | ) |
Definition at line 787 of file VST3Wrapper.cpp.
References mComponentHandler.
Referenced by VST3UIValidator::OnClose().
void VST3Wrapper::FetchSettings | ( | EffectSettings & | settings | ) |
Fetch state from settings object, may change internal runtime data.
Definition at line 487 of file VST3Wrapper.cpp.
References PresetsBufferStream::fromString(), anonymous_namespace{VST3Wrapper.cpp}::GetSettings(), mComponentHandler, mDefaultSettings, mEditController, mEffectComponent, and settings().
Referenced by Initialize(), and VST3UIValidator::UpdateUI().
void VST3Wrapper::Finalize | ( | EffectSettings * | settings | ) |
Frees up resources allocated for processing, should be called after processing is complete. Optionally settings object may be passed to update runtime data with current internal state.
Definition at line 607 of file VST3Wrapper.cpp.
References ConsumeChanges(), mActive, mAudioProcessor, mEffectComponent, Process(), settings(), and StoreSettings().
void VST3Wrapper::FlushParameters | ( | EffectSettings & | settings, |
bool * | hasChanges = nullptr |
||
) |
hasChanges | optional output variable, set to true if flushing has changed the DSP model state |
Definition at line 651 of file VST3Wrapper.cpp.
References ConsumeChanges(), anonymous_namespace{VST3Wrapper.cpp}::GetSettings(), mActive, mAudioProcessor, mComponentHandler, mEffectComponent, mSetup, anonymous_namespace{VST3Wrapper.cpp}::VST3EffectSettings::parameterChanges, Process(), settings(), and anonymous_namespace{VST3Wrapper.cpp}::SetupProcessing().
Referenced by VST3UIValidator::OnClose(), VST3UIValidator::OnIdle(), and VST3UIValidator::ValidateUI().
Steinberg::int32 VST3Wrapper::GetLatencySamples | ( | ) | const |
Definition at line 795 of file VST3Wrapper.cpp.
References mAudioProcessor.
|
inline |
bool VST3Wrapper::Initialize | ( | EffectSettings & | settings, |
Steinberg::Vst::SampleRate | sampleRate, | ||
Steinberg::int32 | processMode, | ||
Steinberg::int32 | maxSamplesPerBlock | ||
) |
Initializes effect for processing using settings.
Definition at line 574 of file VST3Wrapper.cpp.
References ConsumeChanges(), FetchSettings(), mActive, mAudioProcessor, mEffectComponent, mSetup, Process(), settings(), anonymous_namespace{VST3Wrapper.cpp}::SetupProcessing(), and StoreSettings().
|
noexcept |
Definition at line 482 of file VST3Wrapper.cpp.
References mActive.
Referenced by VST3UIValidator::OnIdle(), and anonymous_namespace{VST3Wrapper.cpp}::ComponentHandler::performEdit().
bool VST3Wrapper::LoadPreset | ( | Steinberg::IBStream * | fileStream | ) |
Definition at line 546 of file VST3Wrapper.cpp.
References mEditController, mEffectComponent, and mEffectUID.
|
static |
Definition at line 805 of file VST3Wrapper.cpp.
References anonymous_namespace{VST3Wrapper.cpp}::controllerStateKey, anonymous_namespace{VST3Wrapper.cpp}::GetSettings(), CommandParameters::HasEntry(), anonymous_namespace{VST3Wrapper.cpp}::ParametersFromString(), anonymous_namespace{VST3Wrapper.cpp}::parametersKey, anonymous_namespace{VST3Wrapper.cpp}::processorStateKey, settings(), and anonymous_namespace{NoteTrack.cpp}::swap().
Referenced by VST3Effect::LoadSettings().
|
static |
Definition at line 833 of file VST3Wrapper.cpp.
References anonymous_namespace{VST3Wrapper.cpp}::controllerStateKey, PluginSettings::GetConfig(), anonymous_namespace{VST3Wrapper.cpp}::GetSettings(), name, anonymous_namespace{VST3Wrapper.cpp}::ParametersFromString(), anonymous_namespace{VST3Wrapper.cpp}::parametersKey, PluginSettings::Private, anonymous_namespace{VST3Wrapper.cpp}::processorStateKey, settings(), and anonymous_namespace{NoteTrack.cpp}::swap().
Referenced by VST3Effect::LoadUserPreset().
|
static |
Definition at line 800 of file VST3Wrapper.cpp.
Referenced by VST3Effect::MakeSettings(), and VST3Wrapper().
|
delete |
|
delete |
size_t VST3Wrapper::Process | ( | const float *const * | inBlock, |
float *const * | outBlock, | ||
size_t | blockLen | ||
) |
Definition at line 684 of file VST3Wrapper.cpp.
References mAudioProcessor, mEffectComponent, min(), mParameterQueues, mParameters, and mSetup.
Referenced by Finalize(), FlushParameters(), and Initialize().
void VST3Wrapper::ProcessBlockStart | ( | const EffectSettings & | settings | ) |
Prepares effect to process next block with changes written to the settings object.
Definition at line 624 of file VST3Wrapper.cpp.
References ConsumeChanges(), and settings().
void VST3Wrapper::ResumeProcessing | ( | ) |
Definition at line 777 of file VST3Wrapper.cpp.
References mAudioProcessor.
bool VST3Wrapper::SavePreset | ( | Steinberg::IBStream * | fileStream | ) | const |
Definition at line 560 of file VST3Wrapper.cpp.
References mEditController, mEffectComponent, and mEffectUID.
|
static |
Definition at line 821 of file VST3Wrapper.cpp.
References anonymous_namespace{VST3Wrapper.cpp}::controllerStateKey, anonymous_namespace{VST3Wrapper.cpp}::GetSettings(), anonymous_namespace{VST3Wrapper.cpp}::parametersKey, anonymous_namespace{VST3Wrapper.cpp}::ParametersToString(), anonymous_namespace{VST3Wrapper.cpp}::processorStateKey, and settings().
Referenced by VST3Effect::SaveSettings().
|
static |
Definition at line 854 of file VST3Wrapper.cpp.
References anonymous_namespace{VST3Wrapper.cpp}::controllerStateKey, anonymous_namespace{VST3Wrapper.cpp}::GetSettings(), name, anonymous_namespace{VST3Wrapper.cpp}::parametersKey, anonymous_namespace{VST3Wrapper.cpp}::ParametersToString(), PluginSettings::Private, anonymous_namespace{VST3Wrapper.cpp}::processorStateKey, PluginSettings::SetConfig(), and settings().
Referenced by VST3Effect::SaveUserPreset().
void VST3Wrapper::StoreSettings | ( | EffectSettings & | settings | ) | const |
Saves current state inside settings object, clears all runtime data.
Definition at line 526 of file VST3Wrapper.cpp.
References anonymous_namespace{VST3Wrapper.cpp}::GetSettings(), mEditController, mEffectComponent, settings(), anonymous_namespace{NoteTrack.cpp}::swap(), and PresetsBufferStream::toString().
Referenced by Finalize(), Initialize(), VST3UIValidator::OnClose(), VST3UIValidator::OnIdle(), VST3UIValidator::ValidateUI(), and VST3Wrapper().
void VST3Wrapper::SuspendProcessing | ( | ) |
Definition at line 772 of file VST3Wrapper.cpp.
References mAudioProcessor.
|
private |
Definition at line 133 of file VST3Wrapper.h.
Referenced by Finalize(), FlushParameters(), Initialize(), and IsActive().
Steinberg::IPtr<Steinberg::Vst::IAudioProcessor> VST3Wrapper::mAudioProcessor |
Definition at line 58 of file VST3Wrapper.h.
Referenced by Finalize(), FlushParameters(), GetLatencySamples(), Initialize(), Process(), ResumeProcessing(), SuspendProcessing(), and VST3Wrapper().
Steinberg::IPtr<Steinberg::Vst::IConnectionPoint> VST3Wrapper::mComponentConnectionProxy |
Definition at line 62 of file VST3Wrapper.h.
Referenced by VST3Wrapper(), and ~VST3Wrapper().
Steinberg::IPtr<Steinberg::Vst::IComponentHandler> VST3Wrapper::mComponentHandler |
Definition at line 64 of file VST3Wrapper.h.
Referenced by BeginParameterEdit(), EndParameterEdit(), FetchSettings(), FlushParameters(), VST3UIValidator::VST3UIValidator(), and VST3Wrapper().
Steinberg::IPtr<Steinberg::Vst::IConnectionPoint> VST3Wrapper::mControllerConnectionProxy |
Definition at line 63 of file VST3Wrapper.h.
Referenced by VST3Wrapper(), and ~VST3Wrapper().
|
private |
Definition at line 55 of file VST3Wrapper.h.
Referenced by FetchSettings(), and VST3Wrapper().
Steinberg::IPtr<Steinberg::Vst::IEditController> VST3Wrapper::mEditController |
Definition at line 61 of file VST3Wrapper.h.
Referenced by FetchSettings(), anonymous_namespace{VST3Wrapper.cpp}::ComponentHandler::LoadCurrentParamValues(), LoadPreset(), SavePreset(), StoreSettings(), VST3UIValidator::TryLoadNativeUI(), VST3UIValidator::VST3UIValidator(), VST3Wrapper(), and ~VST3Wrapper().
Steinberg::IPtr<Steinberg::Vst::IComponent> VST3Wrapper::mEffectComponent |
Definition at line 60 of file VST3Wrapper.h.
Referenced by FetchSettings(), Finalize(), FlushParameters(), Initialize(), LoadPreset(), Process(), SavePreset(), StoreSettings(), VST3Wrapper(), and ~VST3Wrapper().
|
private |
Definition at line 134 of file VST3Wrapper.h.
Referenced by LoadPreset(), SavePreset(), and VST3Wrapper().
|
private |
Definition at line 56 of file VST3Wrapper.h.
Referenced by GetModule().
|
private |
Definition at line 141 of file VST3Wrapper.h.
Referenced by Process(), and VST3Wrapper().
|
private |
Definition at line 136 of file VST3Wrapper.h.
Referenced by ConsumeChanges(), Process(), and VST3Wrapper().
Steinberg::Vst::ProcessSetup VST3Wrapper::mSetup |
Definition at line 59 of file VST3Wrapper.h.
Referenced by FlushParameters(), Initialize(), Process(), VST3UIValidator::VST3UIValidator(), and VST3Wrapper().
std::function<void (Steinberg::Vst::ParamID, Steinberg::Vst::ParamValue)> VST3Wrapper::ParamChangedHandler |
Definition at line 126 of file VST3Wrapper.h.
Referenced by anonymous_namespace{VST3Wrapper.cpp}::ComponentHandler::NotifyParamChange(), VST3UIValidator::OnClose(), VST3UIValidator::VST3UIValidator(), and VST3UIValidator::~VST3UIValidator().