Audacity 3.2.0
|
#include <VST3Wrapper.h>
Classes | |
struct | FactoryPresetDesc |
Public Member Functions | |
VST3Wrapper (VST3::Hosting::Module &module, const VST3::Hosting::ClassInfo &effectClassInfo) | |
~VST3Wrapper () | |
VST3Wrapper (const VST3Wrapper &)=delete | |
VST3Wrapper (VST3Wrapper &&)=delete | |
VST3Wrapper & | operator= (const VST3Wrapper &)=delete |
VST3Wrapper & | operator= (VST3Wrapper &&)=delete |
void | InitializeComponents () |
Should be called once before almost any other method call. More... | |
VST3::Hosting::Module & | GetModule () const |
const VST3::Hosting::ClassInfo & | GetEffectClassInfo () 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... | |
void | LoadPreset (const wxString &presetId) |
void | SavePresetToFile (const wxString &filepath) 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 () |
std::vector< FactoryPresetDesc > | FindFactoryPresets () const |
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 | |
bool | LoadPresetFromStream (Steinberg::IBStream *fileStream) |
bool | SavePresetToStream (Steinberg::IBStream *fileStream) const |
void | ConsumeChanges (const EffectSettings &settings) |
Private Attributes | |
EffectSettings | mDefaultSettings |
VST3::Hosting::Module & | mModule |
const VST3::Hosting::ClassInfo & | mEffectClassInfo |
bool | mActive {false} |
std::vector< std::pair< Steinberg::Vst::ParamID, Steinberg::Vst::ParamValue > > | mParameters |
std::unique_ptr< SingleInputParameterValue[]> | mParameterQueues |
Steinberg::Vst::ProcessContext | mProcessContext { } |
Definition at line 54 of file VST3Wrapper.h.
VST3Wrapper::VST3Wrapper | ( | VST3::Hosting::Module & | module, |
const VST3::Hosting::ClassInfo & | effectClassInfo | ||
) |
Definition at line 407 of file VST3Wrapper.cpp.
References anonymous_namespace{VST3Wrapper.cpp}::CreateCache(), AudacityVst3HostApplication::Get(), anonymous_namespace{VST3Wrapper.cpp}::GetCache(), mAudioProcessor, mComponentConnectionProxy, mComponentHandler, mControllerConnectionProxy, mEditController, mEffectClassInfo, mEffectComponent, and safenew.
VST3Wrapper::~VST3Wrapper | ( | ) |
Definition at line 527 of file VST3Wrapper.cpp.
References mComponentConnectionProxy, mControllerConnectionProxy, mEditController, and mEffectComponent.
|
delete |
|
delete |
void VST3Wrapper::BeginParameterEdit | ( | EffectSettingsAccess & | access | ) |
Definition at line 959 of file VST3Wrapper.cpp.
References mComponentHandler.
Referenced by VST3Editor::VST3Editor().
|
private |
Definition at line 803 of file VST3Wrapper.cpp.
References anonymous_namespace{VST3Wrapper.cpp}::GetSettings(), mParameters, and settings().
Referenced by Finalize(), FlushParameters(), Initialize(), and ProcessBlockStart().
|
static |
Definition at line 1103 of file VST3Wrapper.cpp.
References anonymous_namespace{VST3Wrapper.cpp}::GetSettings(), and anonymous_namespace{NoteTrack.cpp}::swap().
Referenced by VST3EffectBase::CopySettingsContents().
void VST3Wrapper::EndParameterEdit | ( | ) |
Definition at line 964 of file VST3Wrapper.cpp.
References mComponentHandler.
Referenced by VST3Editor::OnClose().
void VST3Wrapper::FetchSettings | ( | EffectSettings & | settings | ) |
Fetch state from settings object, may change internal runtime data.
Definition at line 593 of file VST3Wrapper.cpp.
References anonymous_namespace{VST3Wrapper.cpp}::VST3PluginCache::defaultSettings, PresetsBufferStream::fromString(), anonymous_namespace{VST3Wrapper.cpp}::GetCache(), anonymous_namespace{VST3Wrapper.cpp}::GetSettings(), mComponentHandler, mEditController, mEffectClassInfo, mEffectComponent, and settings().
Referenced by Initialize(), and VST3Editor::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 780 of file VST3Wrapper.cpp.
References ConsumeChanges(), mActive, mAudioProcessor, mEffectComponent, mProcessContext, Process(), settings(), and StoreSettings().
std::vector< VST3Wrapper::FactoryPresetDesc > VST3Wrapper::FindFactoryPresets | ( | ) | const |
Returns an array of factory preset ids. Safe to call before InitializeComponents
Definition at line 970 of file VST3Wrapper.cpp.
References anonymous_namespace{VST3Wrapper.cpp}::GetCache(), VST3Utils::GetFactoryPresetsPath(), VST3Utils::MakeFactoryPresetID(), mEditController, mEffectClassInfo, and VST3Utils::ToWxString().
Referenced by VST3EffectBase::GetFactoryPresets().
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 825 of file VST3Wrapper.cpp.
References ConsumeChanges(), anonymous_namespace{VST3Wrapper.cpp}::GetSettings(), mActive, mAudioProcessor, mComponentHandler, mEffectComponent, mProcessContext, mSetup, anonymous_namespace{VST3Wrapper.cpp}::VST3EffectSettings::parameterChanges, Process(), settings(), and anonymous_namespace{VST3Wrapper.cpp}::SetupProcessing().
Referenced by VST3EffectBase::LoadFactoryPreset(), VST3Editor::OnClose(), VST3Editor::OnIdle(), and VST3Editor::ValidateUI().
const VST3::Hosting::ClassInfo & VST3Wrapper::GetEffectClassInfo | ( | ) | const |
Definition at line 583 of file VST3Wrapper.cpp.
References mEffectClassInfo.
Steinberg::int32 VST3Wrapper::GetLatencySamples | ( | ) | const |
Definition at line 1029 of file VST3Wrapper.cpp.
References mAudioProcessor.
|
inline |
Definition at line 86 of file VST3Wrapper.h.
bool VST3Wrapper::Initialize | ( | EffectSettings & | settings, |
Steinberg::Vst::SampleRate | sampleRate, | ||
Steinberg::int32 | processMode, | ||
Steinberg::int32 | maxSamplesPerBlock | ||
) |
Initializes effect for processing using settings.
Definition at line 744 of file VST3Wrapper.cpp.
References ConsumeChanges(), FetchSettings(), mActive, mAudioProcessor, mEffectComponent, mProcessContext, mSetup, Process(), anonymous_namespace{ClipSegmentTest.cpp}::sampleRate, settings(), anonymous_namespace{VST3Wrapper.cpp}::SetupProcessing(), and StoreSettings().
void VST3Wrapper::InitializeComponents | ( | ) |
Should be called once before almost any other method call.
Definition at line 545 of file VST3Wrapper.cpp.
References anonymous_namespace{VST3Wrapper.cpp}::GetCache(), MakeSettings(), mComponentHandler, mEditController, mEffectClassInfo, mEffectComponent, mParameterQueues, mParameters, mSetup, Steinberg::MemoryStream::seek(), anonymous_namespace{VST3Wrapper.cpp}::SetupProcessing(), and StoreSettings().
Referenced by VST3EffectBase::LoadFactoryPreset(), and VST3PluginValidator::Validate().
|
noexcept |
Definition at line 588 of file VST3Wrapper.cpp.
References mActive.
Referenced by VST3Editor::OnIdle(), and anonymous_namespace{VST3Wrapper.cpp}::ComponentHandler::performEdit().
void VST3Wrapper::LoadPreset | ( | const wxString & | presetId | ) |
Definition at line 652 of file VST3Wrapper.cpp.
References BadEnvironment, anonymous_namespace{VST3Wrapper.cpp}::GetCache(), LoadPresetFromStream(), mComponentHandler, mEditController, mEffectClassInfo, FileException::Open, VST3Utils::ParseFactoryPresetID(), and XO().
Referenced by VST3EffectBase::LoadFactoryPreset().
|
private |
Definition at line 716 of file VST3Wrapper.cpp.
References mEditController, mEffectClassInfo, and mEffectComponent.
Referenced by LoadPreset().
|
static |
Definition at line 1039 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 VST3EffectBase::LoadSettings().
|
static |
Definition at line 1067 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 VST3EffectBase::LoadUserPreset().
|
static |
Definition at line 1034 of file VST3Wrapper.cpp.
Referenced by InitializeComponents(), and VST3EffectBase::MakeSettings().
|
delete |
|
delete |
size_t VST3Wrapper::Process | ( | const float *const * | inBlock, |
float *const * | outBlock, | ||
size_t | blockLen | ||
) |
Definition at line 860 of file VST3Wrapper.cpp.
References mAudioProcessor, mEffectComponent, min(), mParameterQueues, mParameters, mProcessContext, 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 798 of file VST3Wrapper.cpp.
References ConsumeChanges(), and settings().
void VST3Wrapper::ResumeProcessing | ( | ) |
Definition at line 954 of file VST3Wrapper.cpp.
References mAudioProcessor.
void VST3Wrapper::SavePresetToFile | ( | const wxString & | filepath | ) | const |
Definition at line 700 of file VST3Wrapper.cpp.
References BadEnvironment, FileException::Open, SavePresetToStream(), and XO().
|
private |
Definition at line 730 of file VST3Wrapper.cpp.
References mEditController, mEffectClassInfo, and mEffectComponent.
Referenced by SavePresetToFile().
|
static |
Definition at line 1055 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 VST3EffectBase::SaveSettings().
|
static |
Definition at line 1088 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 VST3EffectBase::SaveUserPreset().
void VST3Wrapper::StoreSettings | ( | EffectSettings & | settings | ) | const |
Saves current state inside settings object, clears all runtime data.
Definition at line 632 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(), InitializeComponents(), VST3EffectBase::LoadFactoryPreset(), VST3Editor::OnClose(), VST3Editor::OnIdle(), and VST3Editor::ValidateUI().
void VST3Wrapper::SuspendProcessing | ( | ) |
Definition at line 949 of file VST3Wrapper.cpp.
References mAudioProcessor.
|
private |
Definition at line 153 of file VST3Wrapper.h.
Referenced by Finalize(), FlushParameters(), Initialize(), and IsActive().
Steinberg::IPtr<Steinberg::Vst::IAudioProcessor> VST3Wrapper::mAudioProcessor |
Definition at line 67 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 71 of file VST3Wrapper.h.
Referenced by VST3Wrapper(), and ~VST3Wrapper().
Steinberg::IPtr<Steinberg::Vst::IComponentHandler> VST3Wrapper::mComponentHandler |
Definition at line 73 of file VST3Wrapper.h.
Referenced by BeginParameterEdit(), EndParameterEdit(), FetchSettings(), FlushParameters(), InitializeComponents(), LoadPreset(), VST3Editor::VST3Editor(), and VST3Wrapper().
Steinberg::IPtr<Steinberg::Vst::IConnectionPoint> VST3Wrapper::mControllerConnectionProxy |
Definition at line 72 of file VST3Wrapper.h.
Referenced by VST3Wrapper(), and ~VST3Wrapper().
|
private |
Definition at line 56 of file VST3Wrapper.h.
Steinberg::IPtr<Steinberg::Vst::IEditController> VST3Wrapper::mEditController |
Definition at line 70 of file VST3Wrapper.h.
Referenced by FetchSettings(), FindFactoryPresets(), InitializeComponents(), anonymous_namespace{VST3Wrapper.cpp}::ComponentHandler::LoadCurrentParamValues(), LoadPreset(), LoadPresetFromStream(), SavePresetToStream(), StoreSettings(), VST3Editor::TryLoadNativeUI(), VST3Editor::VST3Editor(), VST3Wrapper(), and ~VST3Wrapper().
|
private |
Definition at line 58 of file VST3Wrapper.h.
Referenced by FetchSettings(), FindFactoryPresets(), GetEffectClassInfo(), InitializeComponents(), LoadPreset(), LoadPresetFromStream(), SavePresetToStream(), and VST3Wrapper().
Steinberg::IPtr<Steinberg::Vst::IComponent> VST3Wrapper::mEffectComponent |
Definition at line 69 of file VST3Wrapper.h.
Referenced by FetchSettings(), Finalize(), FlushParameters(), Initialize(), InitializeComponents(), LoadPresetFromStream(), Process(), SavePresetToStream(), StoreSettings(), VST3Wrapper(), and ~VST3Wrapper().
|
private |
Definition at line 57 of file VST3Wrapper.h.
|
private |
Definition at line 160 of file VST3Wrapper.h.
Referenced by InitializeComponents(), and Process().
|
private |
Definition at line 155 of file VST3Wrapper.h.
Referenced by ConsumeChanges(), InitializeComponents(), and Process().
|
private |
Definition at line 162 of file VST3Wrapper.h.
Referenced by Finalize(), FlushParameters(), Initialize(), and Process().
Steinberg::Vst::ProcessSetup VST3Wrapper::mSetup |
Definition at line 68 of file VST3Wrapper.h.
Referenced by FlushParameters(), Initialize(), InitializeComponents(), Process(), and VST3Editor::VST3Editor().
std::function<void (Steinberg::Vst::ParamID, Steinberg::Vst::ParamValue)> VST3Wrapper::ParamChangedHandler |
Definition at line 143 of file VST3Wrapper.h.
Referenced by anonymous_namespace{VST3Wrapper.cpp}::ComponentHandler::NotifyParamChange(), VST3Editor::OnClose(), VST3Editor::VST3Editor(), and VST3Editor::~VST3Editor().