Audacity 3.2.0
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
VST3Effect Class Referencefinal

Objects of this class connect Audacity with VST3 effects. More...

#include <VST3Effect.h>

Inheritance diagram for VST3Effect:
[legend]
Collaboration diagram for VST3Effect:
[legend]

Public Member Functions

 VST3Effect (std::shared_ptr< VST3::Hosting::Module > module, VST3::Hosting::ClassInfo effectClassInfo)
 
 VST3Effect (const VST3Effect &other)
 
 ~VST3Effect () override
 
PluginPath GetPath () const override
 
ComponentInterfaceSymbol GetSymbol () const override
 
VendorSymbol GetVendor () const override
 
wxString GetVersion () const override
 
TranslatableString GetDescription () const override
 
EffectType GetType () const override
 Type determines how it behaves. More...
 
EffectFamilySymbol GetFamily () const override
 Report identifier and user-visible name of the effect protocol. More...
 
bool IsInteractive () const override
 Whether the effect needs a dialog for entry of settings. More...
 
bool IsDefault () const override
 Whether the effect sorts "above the line" in the menus. More...
 
bool SupportsRealtime () const override
 Whether the effect supports realtime previewing (while audio is playing). More...
 
bool SupportsAutomation () const override
 Whether the effect has any automatable controls. More...
 
bool SaveSettings (const EffectSettings &settings, CommandParameters &parms) const override
 Store settings as keys and values. More...
 
bool LoadSettings (const CommandParameters &parms, EffectSettings &settings) const override
 Restore settings from keys and values. More...
 
bool LoadUserPreset (const RegistryPath &name, EffectSettings &settings) const override
 Change settings to a user-named preset. More...
 
bool SaveUserPreset (const RegistryPath &name, const EffectSettings &settings) const override
 Save settings in the configuration file as a user-named preset. More...
 
RegistryPaths GetFactoryPresets () const override
 Report names of factory presets. More...
 
bool LoadFactoryPreset (int id, EffectSettings &settings) const override
 Change settings to the preset whose name is GetFactoryPresets()[id] More...
 
bool LoadFactoryDefaults (EffectSettings &) const override
 Change settings back to "factory default". More...
 
unsigned GetAudioInCount () const override
 How many input buffers to allocate at once. More...
 
unsigned GetAudioOutCount () const override
 How many output buffers to allocate at once. More...
 
int GetMidiInCount () const override
 Function that has not yet found a use. More...
 
int GetMidiOutCount () const override
 Function that has not yet found a use. More...
 
size_t SetBlockSize (size_t maxBlockSize) override
 
size_t GetBlockSize () const override
 
sampleCount GetLatency () override
 
bool ProcessInitialize (EffectSettings &settings, double sampleRate, sampleCount totalLen, ChannelNames chanMap) override
 
bool ProcessFinalize () override
 
size_t ProcessBlock (EffectSettings &settings, const float *const *inBlock, float *const *outBlock, size_t blockLen) override
 Called for destructive effect computation. More...
 
bool RealtimeInitialize (EffectSettings &settings, double sampleRate) override
 
bool RealtimeAddProcessor (EffectSettings &settings, unsigned numChannels, float sampleRate) override
 
bool RealtimeFinalize (EffectSettings &settings) noexcept override
 
bool RealtimeSuspend () override
 
bool RealtimeResume () override
 
bool RealtimeProcessStart (EffectSettings &settings) override
 settings are possibly changed, since last call, by an asynchronous dialog More...
 
size_t RealtimeProcess (size_t group, EffectSettings &settings, const float *const *inbuf, float *const *outbuf, size_t numSamples) override
 
bool RealtimeProcessEnd (EffectSettings &settings) noexcept override
 settings can be updated to let a dialog change appearance at idle More...
 
int ShowClientInterface (wxWindow &parent, wxDialog &dialog, bool forceModal) override
 
bool InitializePlugin ()
 
std::shared_ptr< EffectInstanceMakeInstance () const override
 Make an object maintaining short-term state of an Effect. More...
 
std::shared_ptr< EffectInstanceDoMakeInstance ()
 
bool IsGraphicalUI () override
 
std::unique_ptr< EffectUIValidatorPopulateUI (ShuttleGui &S, EffectInstance &instance, EffectSettingsAccess &access) override
 Adds controls to a panel that is given as the parent window of S More...
 
bool ValidateUI (EffectSettings &) override
 
bool CloseUI () override
 
bool CanExportPresets () override
 
void ExportPresets (const EffectSettings &settings) const override
 
void ImportPresets (EffectSettings &settings) override
 
bool HasOptions () override
 
void ShowOptions () override
 
std::shared_ptr< EffectInstanceMakeInstance () const override
 Make an object maintaining short-term state of an Effect. More...
 
size_t SetBlockSize (size_t maxBlockSize) override
 
size_t GetBlockSize () const override
 
virtual sampleCount GetLatency ()
 
virtual bool ProcessInitialize (EffectSettings &settings, double sampleRate, sampleCount totalLen, ChannelNames chanMap=nullptr)
 
virtual bool ProcessFinalize ()
 
virtual size_t ProcessBlock (EffectSettings &settings, const float *const *inBlock, float *const *outBlock, size_t blockLen)
 Called for destructive effect computation. More...
 
- Public Member Functions inherited from StatefulEffectBase
virtual bool Init ()
 Call once to set up state for whole list of tracks to be processed. More...
 
virtual bool Process (EffectInstance &instance, EffectSettings &settings)=0
 Actually do the effect here. More...
 
virtual bool RealtimeInitialize (EffectSettings &settings, double sampleRate)
 
virtual bool RealtimeAddProcessor (EffectSettings &settings, unsigned numChannels, float sampleRate)
 
virtual bool RealtimeSuspend ()
 
virtual bool RealtimeResume ()
 
virtual bool RealtimeProcessStart (EffectSettings &settings)
 settings are possibly changed, since last call, by an asynchronous dialog More...
 
virtual size_t RealtimeProcess (size_t group, EffectSettings &settings, const float *const *inBuf, float *const *outBuf, size_t numSamples)
 
virtual bool RealtimeProcessEnd (EffectSettings &settings) noexcept
 settings can be updated to let a dialog change appearance at idle More...
 
virtual bool RealtimeFinalize (EffectSettings &settings) noexcept
 
virtual size_t SetBlockSize (size_t maxBlockSize)
 
virtual size_t GetBlockSize () const
 
- Public Member Functions inherited from PerTrackEffect
 ~PerTrackEffect () override
 
- Public Member Functions inherited from Effect
 Effect ()
 
virtual ~Effect ()
 
PluginPath GetPath () const override
 
bool VisitSettings (SettingsVisitor &visitor, EffectSettings &settings) override
 
bool VisitSettings (ConstSettingsVisitor &visitor, const EffectSettings &settings) const override
 
ComponentInterfaceSymbol GetSymbol () const override
 
VendorSymbol GetVendor () const override
 
wxString GetVersion () const override
 
TranslatableString GetDescription () const override
 
EffectType GetType () const override
 Type determines how it behaves. More...
 
EffectFamilySymbol GetFamily () const override
 Report identifier and user-visible name of the effect protocol. More...
 
bool IsInteractive () const override
 Whether the effect needs a dialog for entry of settings. More...
 
bool IsDefault () const override
 Whether the effect sorts "above the line" in the menus. More...
 
bool SupportsRealtime () const override
 Whether the effect supports realtime previewing (while audio is playing). More...
 
bool SupportsAutomation () const override
 Whether the effect has any automatable controls. More...
 
bool SaveSettings (const EffectSettings &settings, CommandParameters &parms) const override
 Store settings as keys and values. More...
 
bool LoadSettings (const CommandParameters &parms, EffectSettings &settings) const override
 Restore settings from keys and values. More...
 
bool LoadUserPreset (const RegistryPath &name, EffectSettings &settings) const override
 Change settings to a user-named preset. More...
 
bool SaveUserPreset (const RegistryPath &name, const EffectSettings &settings) const override
 Save settings in the configuration file as a user-named preset. More...
 
RegistryPaths GetFactoryPresets () const override
 Report names of factory presets. More...
 
bool LoadFactoryPreset (int id, EffectSettings &settings) const override
 Change settings to the preset whose name is GetFactoryPresets()[id] More...
 
bool LoadFactoryDefaults (EffectSettings &settings) const override
 Change settings back to "factory default". More...
 
unsigned GetAudioInCount () const override
 How many input buffers to allocate at once. More...
 
unsigned GetAudioOutCount () const override
 How many output buffers to allocate at once. More...
 
virtual const EffectParameterMethodsParameters () const
 
int ShowClientInterface (wxWindow &parent, wxDialog &dialog, bool forceModal=false) override
 
std::unique_ptr< EffectUIValidatorPopulateUI (ShuttleGui &S, EffectInstance &instance, EffectSettingsAccess &access) override
 Adds controls to a panel that is given as the parent window of S More...
 
bool IsGraphicalUI () override
 
bool ValidateUI (EffectSettings &) override
 
bool CloseUI () override
 
bool CanExportPresets () override
 
void ExportPresets (const EffectSettings &settings) const override
 
void ImportPresets (EffectSettings &settings) override
 
bool HasOptions () override
 
void ShowOptions () override
 
const EffectSettingsManagerGetDefinition () const override
 
virtual NumericFormatSymbol GetSelectionFormat ()
 
int ShowHostInterface (wxWindow &parent, const EffectDialogFactory &factory, std::shared_ptr< EffectInstance > &pInstance, EffectSettingsAccess &access, bool forceModal=false) override
 Usually applies factory to self and given access. More...
 
bool SaveSettingsAsString (const EffectSettings &settings, wxString &parms) const override
 
bool LoadSettingsFromString (const wxString &parms, EffectSettings &settings) const override
 
bool IsBatchProcessing () const override
 
void SetBatchProcessing () override
 
void UnsetBatchProcessing () override
 
bool TransferDataToWindow (const EffectSettings &settings) override
 Update controls for the settings. More...
 
bool TransferDataFromWindow (EffectSettings &settings) override
 Update the given settings from controls. More...
 
unsigned TestUIFlags (unsigned mask)
 
bool Delegate (Effect &delegate, EffectSettings &settings)
 Re-invoke DoEffect on another Effect object that implements the work. More...
 
int MessageBox (const TranslatableString &message, long style=DefaultMessageBoxStyle, const TranslatableString &titleStr={}) const
 
bool EnableApply (bool enable=true)
 
wxWindow * GetUIParent ()
 
- Public Member Functions inherited from EffectBase
 EffectBase ()
 
 ~EffectBase () override
 
- Public Member Functions inherited from EffectUIClientInterface
virtual ~EffectUIClientInterface ()
 
virtual int ShowClientInterface (wxWindow &parent, wxDialog &dialog, bool forceModal=false)=0
 
virtual bool IsGraphicalUI ()=0
 
virtual std::unique_ptr< EffectUIValidatorPopulateUI (ShuttleGui &S, EffectInstance &instance, EffectSettingsAccess &access)=0
 Adds controls to a panel that is given as the parent window of S More...
 
virtual bool CanExportPresets ()=0
 
virtual void ExportPresets (const EffectSettings &settings) const =0
 
virtual void ImportPresets (EffectSettings &settings)=0
 
virtual bool HasOptions ()=0
 
virtual void ShowOptions ()=0
 
- Public Member Functions inherited from EffectPlugin
EffectPluginoperator= (EffectPlugin &)=delete
 
virtual ~EffectPlugin ()
 
virtual const EffectSettingsManagerGetDefinition () const =0
 
virtual int ShowHostInterface (wxWindow &parent, const EffectDialogFactory &factory, std::shared_ptr< EffectInstance > &pInstance, EffectSettingsAccess &access, bool forceModal=false)=0
 Usually applies factory to self and given access. More...
 
virtual void Preview (EffectSettingsAccess &access, bool dryOnly)=0
 
virtual bool SaveSettingsAsString (const EffectSettings &settings, wxString &parms) const =0
 
virtual bool LoadSettingsFromString (const wxString &parms, EffectSettings &settings) const =0
 
virtual bool IsBatchProcessing () const =0
 
virtual void SetBatchProcessing ()=0
 
virtual void UnsetBatchProcessing ()=0
 
virtual bool DoEffect (EffectSettings &settings, double projectRate, TrackList *list, WaveTrackFactory *factory, NotifyingSelectedRegion &selectedRegion, unsigned flags, wxWindow *pParent=nullptr, const EffectDialogFactory &dialogFactory={}, const EffectSettingsAccessPtr &pAccess=nullptr)=0
 Unfortunately complicated dual-use function. More...
 
virtual bool TransferDataToWindow (const EffectSettings &settings)=0
 Update controls for the settings. More...
 
virtual bool TransferDataFromWindow (EffectSettings &settings)=0
 Update the given settings from controls. More...
 
- Public Member Functions inherited from EffectInstanceFactory
virtual ~EffectInstanceFactory ()
 
virtual std::shared_ptr< EffectInstanceMakeInstance () const =0
 Make an object maintaining short-term state of an Effect. More...
 
virtual unsigned GetAudioInCount () const =0
 How many input buffers to allocate at once. More...
 
virtual unsigned GetAudioOutCount () const =0
 How many output buffers to allocate at once. More...
 
virtual int GetMidiInCount () const
 Function that has not yet found a use. More...
 
virtual int GetMidiOutCount () const
 Function that has not yet found a use. More...
 
- Public Member Functions inherited from EffectSettingsManager
virtual ~EffectSettingsManager ()
 
virtual bool VisitSettings (SettingsVisitor &visitor, EffectSettings &settings)
 
virtual bool VisitSettings (ConstSettingsVisitor &visitor, const EffectSettings &settings) const
 
virtual EffectSettings MakeSettings () const
 
virtual bool CopySettingsContents (const EffectSettings &src, EffectSettings &dst) const
 Update one settings object from another. More...
 
- Public Member Functions inherited from EffectDefinitionInterface
virtual ~EffectDefinitionInterface ()
 
virtual EffectType GetType () const =0
 Type determines how it behaves. More...
 
virtual EffectType GetClassification () const
 Determines which menu it appears in; default same as GetType(). More...
 
virtual EffectFamilySymbol GetFamily () const =0
 Report identifier and user-visible name of the effect protocol. More...
 
virtual bool IsInteractive () const =0
 Whether the effect needs a dialog for entry of settings. More...
 
virtual bool IsDefault () const =0
 Whether the effect sorts "above the line" in the menus. More...
 
virtual bool SupportsRealtime () const =0
 Whether the effect supports realtime previewing (while audio is playing). More...
 
virtual bool SupportsAutomation () const =0
 Whether the effect has any automatable controls. More...
 
virtual bool EnablesDebug () const
 Whether the effect dialog should have a Debug button; default, always false. More...
 
virtual ManualPageID ManualPage () const
 Name of a page in the Audacity alpha manual, default is empty. More...
 
virtual FilePath HelpPage () const
 Fully qualified local help file name, default is empty. More...
 
virtual bool IsHiddenFromMenus () const
 Default is false. More...
 
- Public Member Functions inherited from ComponentInterface
virtual ~ComponentInterface ()
 
virtual PluginPath GetPath () const =0
 
virtual ComponentInterfaceSymbol GetSymbol () const =0
 
virtual VendorSymbol GetVendor () const =0
 
virtual wxString GetVersion () const =0
 
virtual TranslatableString GetDescription () const =0
 
TranslatableString GetName () const
 

Static Public Member Functions

static EffectFamilySymbol GetFamilySymbol ()
 
- Static Public Member Functions inherited from Effect
static EffectFetchParameters (Effect &e, EffectSettings &)
 
static void IncEffectCounter ()
 
- Static Public Member Functions inherited from EffectDefinitionInterface
static Identifier GetSquashedName (const Identifier &ident)
 A utility that strips spaces and CamelCases a name. More...
 

Private Member Functions

void Initialize ()
 
void OnEffectWindowResize (wxSizeEvent &evt)
 
bool LoadVSTUI (wxWindow *parent)
 
void SyncParameters (EffectSettings &) const
 
bool LoadPreset (const wxString &path)
 
void ReloadUserOptions ()
 

Private Attributes

std::shared_ptr< VST3::Hosting::Module > mModule
 
Steinberg::IPtr< Steinberg::Vst::IComponent > mEffectComponent
 
Steinberg::IPtr< Steinberg::Vst::IAudioProcessor > mAudioProcessor
 
Steinberg::Vst::ProcessSetup mSetup
 
const VST3::Hosting::ClassInfo mEffectClassInfo
 
Steinberg::IPtr< Steinberg::Vst::IConnectionPoint > mComponentConnectionProxy
 
Steinberg::IPtr< Steinberg::Vst::IConnectionPoint > mControllerConnectionProxy
 
Steinberg::IPtr< Steinberg::IPlugView > mPlugView
 
Steinberg::IPtr< Steinberg::Vst::IEditController > mEditController
 
Steinberg::IPtr< internal::ComponentHandlermComponentHandler
 
wxWindow * mParent { nullptr }
 
NumericTextCtrlmDuration { nullptr }
 
VST3ParametersWindowmPlainUI { nullptr }
 
internal::ComponentHandler::PendingChangesPtr mPendingChanges
 
std::vector< std::shared_ptr< VST3Effect > > mRealtimeGroupProcessors
 
bool mRescanFactoryPresets { true }
 
RegistryPaths mFactoryPresets
 
size_t mUserBlockSize { 8192 }
 
bool mUseLatency { true }
 
sampleCount mInitialDelay { 0 }
 

Additional Inherited Members

- Public Types inherited from Effect
enum  : long { DefaultMessageBoxStyle = wxOK | wxCENTRE }
 
- Public Types inherited from EffectPlugin
using EffectSettingsAccessPtr = std::shared_ptr< EffectSettingsAccess >
 
- Static Public Attributes inherited from EffectPlugin
static const wxString kUserPresetIdent = wxT("User Preset:")
 
static const wxString kFactoryPresetIdent = wxT("Factory Preset:")
 
static const wxString kCurrentSettingsIdent = wxT("<Current Settings>")
 
static const wxString kFactoryDefaultsIdent = wxT("<Factory Defaults>")
 
- Protected Member Functions inherited from PerTrackEffect
bool DoPass1 () const
 
bool DoPass2 () const
 
bool Process (EffectInstance &instance, EffectSettings &settings) const
 
- Protected Member Functions inherited from Effect
bool EnablePreview (bool enable=true)
 
bool CheckWhetherSkipEffect (const EffectSettings &settings) const override
 Default implementation returns false. More...
 
double CalcPreviewInputLength (const EffectSettings &settings, double previewLength) const override
 Default implementation returns previewLength More...
 
virtual std::unique_ptr< EffectUIValidatorPopulateOrExchange (ShuttleGui &S, EffectInstance &instance, EffectSettingsAccess &access)
 Add controls to effect panel; always succeeds. More...
 
bool TotalProgress (double frac, const TranslatableString &={}) const
 
bool TrackProgress (int whichTrack, double frac, const TranslatableString &={}) const
 
bool TrackGroupProgress (int whichGroup, double frac, const TranslatableString &={}) const
 
int GetNumWaveTracks () const
 
int GetNumWaveGroups () const
 
void GetBounds (const WaveTrack &track, const WaveTrack *pRight, sampleCount *start, sampleCount *len)
 
void CopyInputTracks (bool allSyncLockSelected=false)
 
std::shared_ptr< AddedAnalysisTrackAddAnalysisTrack (const wxString &name=wxString())
 
ModifiedAnalysisTrack ModifyAnalysisTrack (const LabelTrack *pOrigTrack, const wxString &name=wxString())
 
TrackAddToOutputTracks (const std::shared_ptr< Track > &t)
 
- Protected Member Functions inherited from EffectBase
void Preview (EffectSettingsAccess &access, bool dryOnly) override
 
bool DoEffect (EffectSettings &settings, double projectRate, TrackList *list, WaveTrackFactory *factory, NotifyingSelectedRegion &selectedRegion, unsigned flags, wxWindow *pParent, const EffectDialogFactory &dialogFactory, const EffectSettingsAccessPtr &pAccess) override
 Unfortunately complicated dual-use function. More...
 
virtual bool CheckWhetherSkipEffect (const EffectSettings &settings) const =0
 After Init(), tell whether Process() should be skipped. More...
 
virtual double CalcPreviewInputLength (const EffectSettings &settings, double previewLength) const =0
 
void SetLinearEffectFlag (bool linearEffectFlag)
 
void SetPreviewFullSelectionFlag (bool previewDurationFlag)
 
bool IsPreviewing () const
 
void IncludeNotSelectedPreviewTracks (bool includeNotSelected)
 
void ReplaceProcessedTracks (const bool bGoodResult)
 
const TrackListinputTracks () const
 
const AudacityProjectFindProject () const
 
virtual bool ValidateUI (EffectSettings &settings)=0
 
virtual bool CloseUI ()=0
 
- Protected Attributes inherited from PerTrackEffect
sampleCount mSampleCnt {}
 
- Protected Attributes inherited from Effect
wxWeakRef< wxDialog > mHostUIDialog
 This smart pointer tracks the lifetime of the dialog. More...
 
wxWindow * mUIParent {}
 
- Protected Attributes inherited from EffectBase
BasicUI::ProgressDialogmProgress {}
 
double mProjectRate {}
 
WaveTrackFactorymFactory {}
 
std::shared_ptr< TrackListmOutputTracks
 
double mT0 {}
 
double mT1 {}
 
wxArrayString mPresetNames
 
unsigned mUIFlags { 0 }
 
- Protected Attributes inherited from EffectUIClientInterface
friend EffectUIValidator
 
friend DefaultEffectUIValidator
 
- Static Protected Attributes inherited from EffectBase
static int nEffectsDone = 0
 

Detailed Description

Objects of this class connect Audacity with VST3 effects.

Definition at line 45 of file VST3Effect.h.

Constructor & Destructor Documentation

◆ VST3Effect() [1/2]

VST3Effect::VST3Effect ( std::shared_ptr< VST3::Hosting::Module >  module,
VST3::Hosting::ClassInfo  effectClassInfo 
)

Definition at line 215 of file VST3Effect.cpp.

218 : mModule(std::move(module)), mEffectClassInfo(std::move(effectClassInfo))
219{
220 using namespace Steinberg;
221 Initialize();
222
223 const auto& pluginFactory = mModule->getFactory();
224 auto editController = FUnknownPtr<Vst::IEditController>(mEffectComponent);
225 if(!editController)
226 {
227 //Plugin does not have a separate edit controller
228 TUID controllerCID;
229
230 if (mEffectComponent->getControllerClassId (controllerCID) == kResultTrue)
231 {
232 if(mEditController = pluginFactory.createInstance<Vst::IEditController> (VST3::UID (controllerCID)))
233 {
234 if(mEditController->initialize(&LocalContext()) != kResultOk)
235 {
236 wxLogMessage("Cannot create edit controller: initialization failed");
237 mEditController = nullptr;
238 }
239 }
240 else
241 wxLogMessage("Cannot create edit controller: attempt failed");
242 }
243 else
244 wxLogMessage("Cannot create edit controller: failed read controller Class ID from the effect component");
245 }
246 else
247 mEditController = editController;
248
250 {
252 mEditController->setComponentHandler(mComponentHandler);
253
254 auto componentConnectionPoint = FUnknownPtr<Vst::IConnectionPoint>{ mEffectComponent };
255 auto controllerConnectionPoint = FUnknownPtr<Vst::IConnectionPoint>{ mEditController };
256
257 if (componentConnectionPoint && controllerConnectionPoint)
258 {
259 mComponentConnectionProxy = owned(safenew internal::ConnectionProxy(componentConnectionPoint));
260 mControllerConnectionProxy = owned(safenew internal::ConnectionProxy(controllerConnectionPoint));
261
262 mComponentConnectionProxy->connect(controllerConnectionPoint);
263 mControllerConnectionProxy->connect(componentConnectionPoint);
264 }
265 }
266}
#define safenew
Definition: MemoryX.h:10
const VST3::Hosting::ClassInfo mEffectClassInfo
Definition: VST3Effect.h:55
Steinberg::IPtr< Steinberg::Vst::IEditController > mEditController
Definition: VST3Effect.h:64
std::shared_ptr< VST3::Hosting::Module > mModule
Definition: VST3Effect.h:48
Steinberg::IPtr< Steinberg::Vst::IComponent > mEffectComponent
Definition: VST3Effect.h:52
Steinberg::IPtr< Steinberg::Vst::IConnectionPoint > mComponentConnectionProxy
Definition: VST3Effect.h:60
Steinberg::IPtr< internal::ComponentHandler > mComponentHandler
Definition: VST3Effect.h:65
Steinberg::IPtr< Steinberg::Vst::IConnectionPoint > mControllerConnectionProxy
Definition: VST3Effect.h:61
void Initialize()
Definition: VST3Effect.cpp:147
Host's proxy object between connection points.
Steinberg::Vst::IHostApplication & LocalContext()
Definition: VST3Effect.cpp:62

References Initialize(), anonymous_namespace{VST3Effect.cpp}::LocalContext(), mComponentConnectionProxy, mComponentHandler, mControllerConnectionProxy, mEditController, mEffectComponent, mModule, and safenew.

Here is the call graph for this function:

◆ VST3Effect() [2/2]

VST3Effect::VST3Effect ( const VST3Effect other)

Definition at line 186 of file VST3Effect.cpp.

188{
189 mUseLatency = other.mUseLatency;
191 Initialize();
192 mSetup = other.mSetup;
193}
bool mUseLatency
Definition: VST3Effect.h:82
Steinberg::Vst::ProcessSetup mSetup
Definition: VST3Effect.h:54
size_t mUserBlockSize
Definition: VST3Effect.h:81

References Initialize(), mSetup, mUseLatency, and mUserBlockSize.

Here is the call graph for this function:

◆ ~VST3Effect()

VST3Effect::~VST3Effect ( )
override

Definition at line 195 of file VST3Effect.cpp.

196{
197 using namespace Steinberg;
198
199 CloseUI();
200
202 mComponentConnectionProxy->disconnect(FUnknownPtr<Vst::IConnectionPoint>(mEditController));
204 mControllerConnectionProxy->disconnect(FUnknownPtr<Vst::IConnectionPoint>(mEffectComponent));
205
207 {
208 mEditController->setComponentHandler(nullptr);
209 mEditController->terminate();
210 }
212 mEffectComponent->terminate();
213}
bool CloseUI() override
Definition: VST3Effect.cpp:939

References CloseUI(), mComponentConnectionProxy, mControllerConnectionProxy, mEditController, and mEffectComponent.

Here is the call graph for this function:

Member Function Documentation

◆ CanExportPresets()

bool VST3Effect::CanExportPresets ( )
overridevirtual

Reimplemented from Effect.

Definition at line 953 of file VST3Effect.cpp.

954{
955 return true;
956}

◆ CloseUI()

bool VST3Effect::CloseUI ( )
overridevirtual

Reimplemented from Effect.

Definition at line 939 of file VST3Effect.cpp.

940{
941 mPlainUI = nullptr;
942 mParent = nullptr;
943 if(mPlugView)
944 {
945 mPlugView->setFrame(nullptr);
946 mPlugView->removed();
947 mPlugView = nullptr;
948 return true;
949 }
950 return false;
951}
wxWindow * mParent
Definition: VST3Effect.h:66
Steinberg::IPtr< Steinberg::IPlugView > mPlugView
Definition: VST3Effect.h:63
VST3ParametersWindow * mPlainUI
Definition: VST3Effect.h:69

References mParent, mPlainUI, and mPlugView.

Referenced by ~VST3Effect().

Here is the caller graph for this function:

◆ DoMakeInstance()

std::shared_ptr< EffectInstance > VST3Effect::DoMakeInstance ( )

Definition at line 862 of file VST3Effect.cpp.

863{
865 return std::make_shared<Instance>(*this);
866}
void ReloadUserOptions()

References ReloadUserOptions().

Referenced by MakeInstance().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ExportPresets()

void VST3Effect::ExportPresets ( const EffectSettings settings) const
overridevirtual

Reimplemented from Effect.

Definition at line 958 of file VST3Effect.cpp.

959{
960 using namespace Steinberg;
961
962 auto path = SelectFile(FileNames::Operation::Presets,
963 XO("Save VST3 Preset As:"),
964 wxEmptyString,
965 wxEmptyString,
966 wxT(".vstpreset"),
967 {
968 { XO("VST3 preset file"), { wxT("vstpreset") }, true }
969 },
970 wxFD_SAVE | wxFD_OVERWRITE_PROMPT | wxRESIZE_BORDER,
971 NULL);
972
973 if (path.empty())
974 return;
975
976 auto dialogPlacement = wxWidgetsWindowPlacement { mParent };
977
978 auto fileStream = owned(Vst::FileStream::open(path.c_str(), "wb"));
979 if(!fileStream)
980 {
982 //i18n-hint: VST3 preset export error
983 XO("Cannot open file"),
985 .Caption(XO("Error"))
986 .Parent(&dialogPlacement)
987 );
988 return;
989 }
990
991 if(!Vst::PresetFile::savePreset(
992 fileStream,
993 FUID::fromTUID (mEffectClassInfo.ID().data()),
994 mEffectComponent.get(),
995 mEditController.get()))
996 {
998 XO("Failed to save VST3 preset to file"),
1000 .Caption(XO("Error"))
1001 .Parent(&dialogPlacement)
1002 );
1003 return;
1004 }
1005}
#define XO(s)
Definition: Internat.h:31
FilePath SelectFile(FileNames::Operation op, const TranslatableString &message, const FilePath &default_path, const FilePath &default_filename, const FileExtension &default_extension, const FileTypes &fileTypes, int flags, wxWindow *parent)
Definition: SelectFile.cpp:17
MessageBoxResult ShowMessageBox(const TranslatableString &message, MessageBoxOptions options={})
Show a modal message box with either Ok or Yes and No, and optionally Cancel.
Definition: BasicUI.h:256
Window placement information for wxWidgetsBasicUI can be constructed from a wxWindow pointer.

References mEditController, mEffectClassInfo, mEffectComponent, mParent, SelectFile(), BasicUI::ShowMessageBox(), and XO.

Here is the call graph for this function:

◆ GetAudioInCount()

unsigned VST3Effect::GetAudioInCount ( ) const
overridevirtual

How many input buffers to allocate at once.

If the effect ALWAYS processes channels independently, this can return 1

Reimplemented from Effect.

Definition at line 560 of file VST3Effect.cpp.

561{
562 return CountChannels(
564 Steinberg::Vst::kAudio,
566 Steinberg::Vst::kMain);
567}
unsigned CountChannels(Steinberg::Vst::IComponent *component, const Steinberg::Vst::MediaTypes mediaType, const Steinberg::Vst::BusDirection busDirection, const Steinberg::Vst::BusType busType)
Definition: VST3Effect.cpp:537

References anonymous_namespace{VST3Effect.cpp}::CountChannels(), anonymous_namespace{AudioSetupToolBar.cpp}::kInput, and mEffectComponent.

Here is the call graph for this function:

◆ GetAudioOutCount()

unsigned VST3Effect::GetAudioOutCount ( ) const
overridevirtual

How many output buffers to allocate at once.

Reimplemented from Effect.

Definition at line 569 of file VST3Effect.cpp.

570{
571 return CountChannels(
573 Steinberg::Vst::kAudio,
575 Steinberg::Vst::kMain);
576}

References anonymous_namespace{VST3Effect.cpp}::CountChannels(), anonymous_namespace{AudioSetupToolBar.cpp}::kOutput, and mEffectComponent.

Here is the call graph for this function:

◆ GetBlockSize()

size_t VST3Effect::GetBlockSize ( ) const
overridevirtual

Default implementation returns mEffectBlockSize

Reimplemented from StatefulPerTrackEffect.

Definition at line 597 of file VST3Effect.cpp.

598{
599 return mSetup.maxSamplesPerBlock;
600}

References mSetup.

◆ GetDescription()

TranslatableString VST3Effect::GetDescription ( ) const
overridevirtual

Reimplemented from Effect.

Definition at line 289 of file VST3Effect.cpp.

290{
291 //i18n-hint VST3 effect description string
292 return XO("SubCategories: %s").Format( mEffectClassInfo.subCategoriesString() );
293}

References mEffectClassInfo, and XO.

◆ GetFactoryPresets()

RegistryPaths VST3Effect::GetFactoryPresets ( ) const
overridevirtual

Report names of factory presets.

Reimplemented from Effect.

Definition at line 473 of file VST3Effect.cpp.

474{
476 return mFactoryPresets;
477
478 wxArrayString paths;
479 wxDir::GetAllFiles(GetFactoryPresetsPath(mEffectClassInfo), &paths);
480
481 RegistryPaths result;
482 for(auto& path : paths)
483 {
484 wxFileName filename(path);
485 result.push_back(filename.GetName());
486 }
487 mFactoryPresets = std::move(result);
488 mRescanFactoryPresets = false;
489
490 return mFactoryPresets;
491}
std::vector< RegistryPath > RegistryPaths
Definition: Identifier.h:219
bool mRescanFactoryPresets
Definition: VST3Effect.h:78
RegistryPaths mFactoryPresets
Definition: VST3Effect.h:79
wxString GetFactoryPresetsPath(const VST3::Hosting::ClassInfo &effectClassInfo)
Definition: VST3Effect.cpp:137

References anonymous_namespace{VST3Effect.cpp}::GetFactoryPresetsPath(), mEffectClassInfo, mFactoryPresets, and mRescanFactoryPresets.

Here is the call graph for this function:

◆ GetFamily()

EffectFamilySymbol VST3Effect::GetFamily ( ) const
overridevirtual

Report identifier and user-visible name of the effect protocol.

Reimplemented from Effect.

Definition at line 308 of file VST3Effect.cpp.

309{
311}
static EffectFamilySymbol GetFamilySymbol()
Definition: VST3Effect.cpp:181

References GetFamilySymbol().

Here is the call graph for this function:

◆ GetFamilySymbol()

EffectFamilySymbol VST3Effect::GetFamilySymbol ( )
static

Definition at line 181 of file VST3Effect.cpp.

182{
183 return XO("VST3");
184}

References XO.

Referenced by GetFamily(), and VST3EffectsModule::GetOptionalFamilySymbol().

Here is the caller graph for this function:

◆ GetLatency()

sampleCount VST3Effect::GetLatency ( )
overridevirtual

Called for destructive, non-realtime effect computation Default implementation returns zero

Reimplemented from StatefulPerTrackEffect.

Definition at line 602 of file VST3Effect.cpp.

603{
604 if(mUseLatency)
605 {
606 if(!mRealtimeGroupProcessors.empty())
607 return mRealtimeGroupProcessors[0]->GetLatency();
608 auto delay = mInitialDelay;
609 mInitialDelay = 0u;
610 return delay;
611 }
612 return { 0u };
613}
std::vector< std::shared_ptr< VST3Effect > > mRealtimeGroupProcessors
Definition: VST3Effect.h:75
sampleCount mInitialDelay
Definition: VST3Effect.h:83

References mInitialDelay, mRealtimeGroupProcessors, and mUseLatency.

◆ GetMidiInCount()

int VST3Effect::GetMidiInCount ( ) const
overridevirtual

Function that has not yet found a use.

Reimplemented from EffectInstanceFactory.

Definition at line 578 of file VST3Effect.cpp.

579{
580 //Dummy
581 return 0;
582}

◆ GetMidiOutCount()

int VST3Effect::GetMidiOutCount ( ) const
overridevirtual

Function that has not yet found a use.

Reimplemented from EffectInstanceFactory.

Definition at line 584 of file VST3Effect.cpp.

585{
586 //Dummy
587 return 0;
588}

◆ GetPath()

PluginPath VST3Effect::GetPath ( ) const
overridevirtual

Reimplemented from Effect.

Definition at line 269 of file VST3Effect.cpp.

270{
271 return VST3Utils::MakePluginPathString( { mModule->getPath() }, mEffectClassInfo.ID().toString());
272}
static wxString MakePluginPathString(const wxString &modulePath, const std::string &effectUIDString)
Definition: VST3Utils.cpp:21

References VST3Utils::MakePluginPathString(), mEffectClassInfo, and mModule.

Here is the call graph for this function:

◆ GetSymbol()

ComponentInterfaceSymbol VST3Effect::GetSymbol ( ) const
overridevirtual

Reimplemented from Effect.

Definition at line 274 of file VST3Effect.cpp.

275{
276 return wxString { mEffectClassInfo.name() };
277}

References mEffectClassInfo.

◆ GetType()

EffectType VST3Effect::GetType ( ) const
overridevirtual

Type determines how it behaves.

Reimplemented from Effect.

Definition at line 295 of file VST3Effect.cpp.

296{
297 using namespace Steinberg::Vst::PlugType;
298 if(mEffectClassInfo.subCategoriesString() == kFxGenerator)
299 return EffectTypeGenerate;
300 const auto& cats = mEffectClassInfo.subCategories();
301
302 if(std::find(cats.begin(), cats.end(), kFx) != cats.end())
303 return EffectTypeProcess;
304
305 return EffectTypeNone;
306}
@ EffectTypeGenerate
@ EffectTypeNone
@ EffectTypeProcess

References EffectTypeGenerate, EffectTypeNone, EffectTypeProcess, and mEffectClassInfo.

Referenced by PopulateUI().

Here is the caller graph for this function:

◆ GetVendor()

VendorSymbol VST3Effect::GetVendor ( ) const
overridevirtual

Reimplemented from Effect.

Definition at line 279 of file VST3Effect.cpp.

280{
281 return wxString { mEffectClassInfo.vendor() };
282}

References mEffectClassInfo.

◆ GetVersion()

wxString VST3Effect::GetVersion ( ) const
overridevirtual

Reimplemented from Effect.

Definition at line 284 of file VST3Effect.cpp.

285{
286 return mEffectClassInfo.version();
287}

References mEffectClassInfo.

◆ HasOptions()

bool VST3Effect::HasOptions ( )
overridevirtual

Reimplemented from Effect.

Definition at line 1028 of file VST3Effect.cpp.

1029{
1030 return true;
1031}

◆ ImportPresets()

void VST3Effect::ImportPresets ( EffectSettings settings)
overridevirtual

Reimplemented from Effect.

Definition at line 1007 of file VST3Effect.cpp.

1008{
1009 using namespace Steinberg;
1010
1011 auto path = SelectFile(FileNames::Operation::Presets,
1012 XO("Load VST3 preset:"),
1013 wxEmptyString,
1014 wxEmptyString,
1015 wxT(".vstpreset"),
1016 {
1017 { XO("VST3 preset file"), { wxT("vstpreset") }, true }
1018 },
1019 wxFD_OPEN | wxRESIZE_BORDER,
1020 nullptr
1021 );
1022 if(path.empty())
1023 return;
1024
1025 LoadPreset(path);
1026}
bool LoadPreset(const wxString &path)

References LoadPreset(), SelectFile(), and XO.

Here is the call graph for this function:

◆ Initialize()

void VST3Effect::Initialize ( )
private

Definition at line 147 of file VST3Effect.cpp.

148{
149 using namespace Steinberg;
150
151 const auto& pluginFactory = mModule->getFactory();
152 if(auto effectComponent = pluginFactory.createInstance<Vst::IComponent>(mEffectClassInfo.ID()))
153 {
154 if(effectComponent->initialize(&LocalContext()) == kResultOk)
155 {
156 if(auto audioProcessor = FUnknownPtr<Vst::IAudioProcessor>(effectComponent))
157 {
158 mEffectComponent = effectComponent;
159 mAudioProcessor = audioProcessor;
160 }
161 else
162 //It's stated that "This interface must always be supported by audio processing plug-ins."
163 throw std::runtime_error("VST3 plugin does not provide audio processor interface");
164 }
165 else
166 throw std::runtime_error("Cannot initialize VST3 effect component");
167 }
168 else
169 throw std::runtime_error("Cannot create VST3 effect component");
170
171 //defaults
172 mSetup.processMode = Vst::kOffline;
173 mSetup.symbolicSampleSize = Vst::kSample32;
174 mSetup.maxSamplesPerBlock = mUserBlockSize;
175 mSetup.sampleRate = 44100.0;
176
177 ActivateDefaultBuses(mEffectComponent.get(), Vst::kAudio, Vst::kInput, true);
178 ActivateDefaultBuses(mEffectComponent.get(), Vst::kAudio, Vst::kOutput, true);
179}
Steinberg::IPtr< Steinberg::Vst::IAudioProcessor > mAudioProcessor
Definition: VST3Effect.h:53
void ActivateDefaultBuses(Steinberg::Vst::IComponent *component, const Steinberg::Vst::MediaType mediaType, const Steinberg::Vst::BusDirection direction, bool state)
Definition: VST3Effect.cpp:91

References anonymous_namespace{VST3Effect.cpp}::ActivateDefaultBuses(), anonymous_namespace{AudioSetupToolBar.cpp}::kInput, anonymous_namespace{AudioSetupToolBar.cpp}::kOutput, anonymous_namespace{VST3Effect.cpp}::LocalContext(), mAudioProcessor, mEffectClassInfo, mEffectComponent, mModule, mSetup, and mUserBlockSize.

Referenced by VST3Effect().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ InitializePlugin()

bool VST3Effect::InitializePlugin ( )

Definition at line 852 of file VST3Effect.cpp.

853{
854 return true;
855}

◆ IsDefault()

bool VST3Effect::IsDefault ( ) const
overridevirtual

Whether the effect sorts "above the line" in the menus.

Reimplemented from Effect.

Definition at line 318 of file VST3Effect.cpp.

319{
320 return false;
321}

◆ IsGraphicalUI()

bool VST3Effect::IsGraphicalUI ( )
overridevirtual

Reimplemented from Effect.

Definition at line 868 of file VST3Effect.cpp.

869{
870 return mPlugView != nullptr;
871}

References mPlugView.

Referenced by ShowClientInterface().

Here is the caller graph for this function:

◆ IsInteractive()

bool VST3Effect::IsInteractive ( ) const
overridevirtual

Whether the effect needs a dialog for entry of settings.

Reimplemented from Effect.

Definition at line 313 of file VST3Effect.cpp.

314{
315 return mEditController != nullptr;
316}

References mEditController.

◆ LoadFactoryDefaults()

bool VST3Effect::LoadFactoryDefaults ( EffectSettings settings) const
overridevirtual

Change settings back to "factory default".

Reimplemented from Effect.

Definition at line 504 of file VST3Effect.cpp.

505{
506 using namespace Steinberg;
507 if(mComponentHandler == nullptr)
508 return false;
509
510 for(int i = 0, count = mEditController->getParameterCount(); i < count; ++i)
511 {
512 Vst::ParameterInfo parameterInfo { };
513 if(mEditController->getParameterInfo(i, parameterInfo) == kResultOk)
514 {
515 if(parameterInfo.flags & Vst::ParameterInfo::kIsReadOnly)
516 continue;
517
518 if(mComponentHandler->beginEdit(parameterInfo.id) == kResultOk)
519 {
520 auto cleanup = finally([&]{
521 mComponentHandler->endEdit(parameterInfo.id);
522 });
523 mComponentHandler->performEdit(parameterInfo.id, parameterInfo.defaultNormalizedValue);
524 }
525 mEditController->setParamNormalized(parameterInfo.id, parameterInfo.defaultNormalizedValue);
526 }
527 }
528
529 if(mPlainUI != nullptr)
531
532 return true;
533}

References mComponentHandler, mEditController, mPlainUI, and VST3ParametersWindow::ReloadParameters().

Here is the call graph for this function:

◆ LoadFactoryPreset()

bool VST3Effect::LoadFactoryPreset ( int  id,
EffectSettings settings 
) const
overridevirtual

Change settings to the preset whose name is GetFactoryPresets()[id]

Reimplemented from Effect.

Definition at line 493 of file VST3Effect.cpp.

494{
495 if(id >= 0 && id < mFactoryPresets.size())
496 {
497 auto filename = wxFileName(GetFactoryPresetsPath(mEffectClassInfo), mFactoryPresets[id] + ".vstpreset");
498 // To do: externalize state so const_cast isn't needed
499 return const_cast<VST3Effect*>(this)->LoadPreset(filename.GetFullPath());
500 }
501 return true;
502}
Objects of this class connect Audacity with VST3 effects.
Definition: VST3Effect.h:46

References anonymous_namespace{VST3Effect.cpp}::GetFactoryPresetsPath(), LoadPreset(), mEffectClassInfo, and mFactoryPresets.

Here is the call graph for this function:

◆ LoadPreset()

bool VST3Effect::LoadPreset ( const wxString &  path)
private

Definition at line 1181 of file VST3Effect.cpp.

1182{
1183 using namespace Steinberg;
1184
1185 auto dialogPlacement = wxWidgetsWindowPlacement { mParent };
1186
1187 auto fileStream = owned(Vst::FileStream::open(path.c_str(), "rb"));
1188 if(!fileStream)
1189 {
1191 XO("Cannot open VST3 preset file %s").Format(path),
1193 .Caption(XO("Error"))
1194 .Parent(&dialogPlacement)
1195 );
1196 return false;
1197 }
1198
1199 if(!Vst::PresetFile::loadPreset(
1200 fileStream,
1201 FUID::fromTUID(mEffectClassInfo.ID().data()),
1202 mEffectComponent.get(),
1203 mEditController.get()))
1204 {
1206 XO("Unable to apply VST3 preset file %s").Format(path),
1208 .Caption(XO("Error"))
1209 .Parent(&dialogPlacement)
1210 );
1211 return false;
1212 }
1213
1214 if(mPlainUI != nullptr)
1216
1217 return true;
1218}
Abstract base class used in importing a file.

References mEditController, mEffectClassInfo, mEffectComponent, mParent, mPlainUI, VST3ParametersWindow::ReloadParameters(), BasicUI::ShowMessageBox(), and XO.

Referenced by ImportPresets(), and LoadFactoryPreset().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ LoadSettings()

bool VST3Effect::LoadSettings ( const CommandParameters parms,
EffectSettings settings 
) const
overridevirtual

Restore settings from keys and values.

Returns
true on success

Reimplemented from Effect.

Definition at line 378 of file VST3Effect.cpp.

380{
381 using namespace Steinberg;
382
383 if(mComponentHandler == nullptr)
384 return false;
385
386 long index { };
387 wxString key;
388 if(parms.GetFirstEntry(key, index))
389 {
390 do
391 {
392 Steinberg::Vst::ParamID id;
393 Vst::ParamValue value;
394 if(VST3Utils::ParseAutomationParameterKey(key, id) && parms.Read(key, &value))
395 {
396 if(mComponentHandler->beginEdit(id) == kResultOk)
397 {
398 auto cleanup = finally([&]{
399 mComponentHandler->endEdit(id);
400 });
401 mComponentHandler->performEdit(id, value);
402 }
403 mEditController->setParamNormalized(id, value);
404 }
405 } while(parms.GetNextEntry(key, index));
406 }
407
408 if(mPlainUI != nullptr)
410
411 return true;
412}
static const AudacityProject::AttachedObjects::RegisteredFactory key
int id
static bool ParseAutomationParameterKey(const wxString &key, Steinberg::Vst::ParamID &paramId)
Definition: VST3Utils.cpp:63

References id, key, mComponentHandler, mEditController, mPlainUI, VST3Utils::ParseAutomationParameterKey(), and VST3ParametersWindow::ReloadParameters().

Here is the call graph for this function:

◆ LoadUserPreset()

bool VST3Effect::LoadUserPreset ( const RegistryPath name,
EffectSettings settings 
) const
overridevirtual

Change settings to a user-named preset.

Reimplemented from Effect.

Definition at line 414 of file VST3Effect.cpp.

416{
417 using namespace Steinberg;
418
419 if(!mEditController)
420 return false;
421
423 return false;
424
425 wxString processorStateStr;
426 if(!GetConfig(*this, PluginSettings::Private, name, processorStateKey, processorStateStr, wxEmptyString))
427 return false;
428 auto processorState = PresetsBufferStream::fromString(processorStateStr);
429 if(mEffectComponent->setState(processorState) != kResultOk)
430 return false;
431
433 {
434 wxString controllerStateStr;
435 if(!GetConfig(*this, PluginSettings::Private, name, controllerStateKey, controllerStateStr, wxEmptyString))
436 return false;
437 auto controllerState = PresetsBufferStream::fromString(controllerStateStr);
438
439 if(mEditController->setComponentState(processorState) != kResultOk ||
440 mEditController->setState(controllerState) != kResultOk)
441 return false;
442 }
443
445
446 if(mPlainUI != nullptr)
448
449 return true;
450}
const TranslatableString name
Definition: Distortion.cpp:82
static Settings & settings()
Definition: TrackInfo.cpp:87
void SyncParameters(EffectSettings &) const
bool HasConfigValue(const EffectDefinitionInterface &ident, PluginSettings::ConfigurationType type, const RegistryPath &group, const RegistryPath &key)
bool GetConfig(const EffectDefinitionInterface &ident, ConfigurationType type, const RegistryPath &group, const RegistryPath &key, Value &var, const Value &defval)

References anonymous_namespace{VST3Effect.cpp}::controllerStateKey, PluginSettings::GetConfig(), PluginSettings::HasConfigValue(), mEditController, mEffectComponent, mPlainUI, name, PluginSettings::Private, anonymous_namespace{VST3Effect.cpp}::processorStateKey, VST3ParametersWindow::ReloadParameters(), settings(), and SyncParameters().

Here is the call graph for this function:

◆ LoadVSTUI()

bool VST3Effect::LoadVSTUI ( wxWindow *  parent)
private

Definition at line 1071 of file VST3Effect.cpp.

1072{
1073 using namespace Steinberg;
1074 if(mEditController == nullptr)
1075 return false;
1076
1077 bool useGUI { true };
1078 GetConfig(*this, PluginSettings::Shared, wxT("Options"),
1079 wxT("UseGUI"),
1080 useGUI,
1081 useGUI);
1082 if(!useGUI)
1083 return false;
1084
1085 if(const auto view = owned (mEditController->createView (Vst::ViewType::kEditor)))
1086 {
1087 parent->Bind(wxEVT_SIZE, &VST3Effect::OnEffectWindowResize, this);
1088
1089 ViewRect defaultSize;
1090 if(view->getSize(&defaultSize) == kResultOk)
1091 {
1092 if(view->canResize() == Steinberg::kResultTrue)
1093 {
1094 ViewRect minSize {0, 0, parent->GetMinWidth(), parent->GetMinHeight()};
1095 ViewRect maxSize {0, 0, 10000, 10000};
1096 if(view->checkSizeConstraint(&minSize) != kResultOk)
1097 minSize = defaultSize;
1098
1099 if(view->checkSizeConstraint(&maxSize) != kResultOk)
1100 maxSize = defaultSize;
1101
1102 //No need to accommodate the off-by-one error with Steinberg::ViewRect
1103 //as we do it with wxRect
1104
1105 if(defaultSize.getWidth() < minSize.getWidth())
1106 defaultSize.right = defaultSize.left + minSize.getWidth();
1107 if(defaultSize.getWidth() > maxSize.getWidth())
1108 defaultSize.right = defaultSize.left + maxSize.getWidth();
1109
1110 if(defaultSize.getHeight() < minSize.getHeight())
1111 defaultSize.bottom = defaultSize.top + minSize.getHeight();
1112 if(defaultSize.getHeight() > maxSize.getHeight())
1113 defaultSize.bottom = defaultSize.top + maxSize.getHeight();
1114
1115 parent->SetMinSize({minSize.getWidth(), minSize.getHeight()});
1116 parent->SetMaxSize({maxSize.getWidth(), maxSize.getHeight()});
1117 }
1118 else
1119 {
1120 parent->SetMinSize({defaultSize.getWidth(), defaultSize.getHeight()});
1121 parent->SetMaxSize(parent->GetMinSize());
1122 }
1123
1124 parent->SetSize({defaultSize.getWidth(), defaultSize.getHeight()});
1125 }
1126
1127#if __WXGTK__
1128 mPlugView = view;
1129 safenew internal::x11::SocketWindow(parent, wxID_ANY, view);
1130 return true;
1131#else
1132
1133 static const auto platformType =
1134# if __WXMAC__
1135 kPlatformTypeNSView;
1136# elif __WXMSW__
1137 kPlatformTypeHWND;
1138# else
1139# error "Platform not supported"
1140# endif
1141 auto plugFrame = owned(safenew internal::PlugFrame { parent });
1142 view->setFrame(plugFrame);
1143 if(view->attached(parent->GetHandle(), platformType) != kResultOk)
1144 return false;
1145
1146 mPlugView = view;
1147
1148 return true;
1149#endif
1150
1151
1152 }
1153 return false;
1154}
void OnEffectWindowResize(wxSizeEvent &evt)
Dispatches window resize events from VST PlugView to the wxWindow.
Definition: PlugFrame.h:23
Wrapper for GtkSocket object, which provides X window mapping via XEmbed protocol.
Definition: SocketWindow.h:35

References PluginSettings::GetConfig(), mEditController, mPlugView, OnEffectWindowResize(), safenew, and PluginSettings::Shared.

Referenced by PopulateUI().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ MakeInstance()

std::shared_ptr< EffectInstance > VST3Effect::MakeInstance ( ) const
overridevirtual

Make an object maintaining short-term state of an Effect.

One effect may have multiple instances extant simultaneously. Instances have state, may be implemented in foreign code, and are temporary, whereas EffectSettings represents persistent effect state that can be saved and reloaded from files.

Parameters
settingsmay be assumed to have a lifetime enclosing the instance's
Postcondition
true (no promises that the result isn't null)

Reimplemented from StatefulPerTrackEffect.

Definition at line 857 of file VST3Effect.cpp.

858{
859 return const_cast<VST3Effect*>(this)->DoMakeInstance();
860}
std::shared_ptr< EffectInstance > DoMakeInstance()
Definition: VST3Effect.cpp:862

References DoMakeInstance().

Here is the call graph for this function:

◆ OnEffectWindowResize()

void VST3Effect::OnEffectWindowResize ( wxSizeEvent &  evt)
private

Definition at line 1042 of file VST3Effect.cpp.

1043{
1044 using namespace Steinberg;
1045
1046 if(!mPlugView)
1047 return;
1048
1049 const auto window = static_cast<wxWindow*>(evt.GetEventObject());
1050 const auto windowSize = evt.GetSize();
1051
1052 {
1053 //Workaround to prevent dialog window resize when
1054 //plugin window reaches its maximum size
1055 auto root = wxGetTopLevelParent(window);
1056 wxSize maxRootSize = root->GetMaxSize();
1057
1058 //remember the current dialog size as its new maximum size
1059 if(window->GetMaxWidth() != -1 && windowSize.GetWidth() >= window->GetMaxWidth())
1060 maxRootSize.SetWidth(root->GetSize().GetWidth());
1061 if(window->GetMaxHeight() != -1 && windowSize.GetHeight() >= window->GetMaxHeight())
1062 maxRootSize.SetHeight(root->GetSize().GetHeight());
1063 root->SetMaxSize(maxRootSize);
1064 }
1065
1066 ViewRect plugViewSize { 0, 0, windowSize.x, windowSize.y };
1067 mPlugView->checkSizeConstraint(&plugViewSize);
1068 mPlugView->onSize(&plugViewSize);
1069}

References mPlugView.

Referenced by LoadVSTUI().

Here is the caller graph for this function:

◆ PopulateUI()

std::unique_ptr< EffectUIValidator > VST3Effect::PopulateUI ( ShuttleGui S,
EffectInstance instance,
EffectSettingsAccess access 
)
overridevirtual

Adds controls to a panel that is given as the parent window of S

Parameters
Sinterface for adding controls to a panel in a dialog
instanceguaranteed to have a lifetime containing that of the returned object
accessguaranteed to have a lifetime containing that of the returned object
Returns
null for failure; else an object invoked to retrieve values of UI controls; it might also hold some state needed to implement event handlers of the controls; it will exist only while the dialog continues to exist

Reimplemented from Effect.

Definition at line 873 of file VST3Effect.cpp.

875{
876 using namespace Steinberg;
877
878 mParent = S.GetParent();
879
880 if(mComponentHandler != nullptr)
881 {
882 // PRL: Is this sync really needed?
885 });
886
887 auto parent = S.GetParent();
889 {
890 auto vSizer = std::make_unique<wxBoxSizer>(wxVERTICAL);
891 auto controlsRoot = safenew wxWindow(parent, wxID_ANY);
892 if(!LoadVSTUI(controlsRoot))
894 vSizer->Add(controlsRoot);
895
896 auto &extra = access.Get().extra;
898 parent, wxID_ANY,
900 extra.GetDurationFormat(),
901 extra.GetDuration(),
902 mSetup.sampleRate,
904 .AutoPos(true)
905 );
906 mDuration->SetName( XO("Duration") );
907
908 auto hSizer = std::make_unique<wxBoxSizer>(wxHORIZONTAL);
909 hSizer->Add(safenew wxStaticText(parent, wxID_ANY, _("Duration:")));
910 hSizer->AddSpacer(5);
911 hSizer->Add(mDuration);
912 vSizer->AddSpacer(10);
913 vSizer->Add(hSizer.release());
914
915 parent->SetMinSize(vSizer->CalcMin());
916 parent->SetSizer(vSizer.release());
917 }
918 else if(!LoadVSTUI(parent))
919 {
921 *parent,
924 );
925 }
926
927 return std::make_unique<DefaultEffectUIValidator>(*this, access);
928 }
929 return nullptr;
930}
#define _(s)
Definition: Internat.h:75
#define S(N)
Definition: ToChars.cpp:64
void ModifySettings(Function &&function)
Do a correct read-modify-write of settings.
virtual const EffectSettings & Get()=0
void SetName(const TranslatableString &name)
NumericTextCtrl * mDuration
Definition: VST3Effect.h:67
EffectType GetType() const override
Type determines how it behaves.
Definition: VST3Effect.cpp:295
bool LoadVSTUI(wxWindow *parent)
static VST3ParametersWindow * Setup(wxWindow &parent, Steinberg::Vst::IEditController &editController, Steinberg::Vst::IComponentHandler &componentHandler)
Creates VST3ParametersWindow inside parent.
Externalized state of a plug-in.
EffectSettingsExtra extra
Options & AutoPos(bool enable)

References _, NumericTextCtrl::Options::AutoPos(), EffectTypeGenerate, EffectSettings::extra, EffectSettingsAccess::Get(), GetType(), LoadVSTUI(), mComponentHandler, mDuration, mEditController, EffectSettingsAccess::ModifySettings(), mParent, mPlainUI, mSetup, S, safenew, NumericTextCtrl::SetName(), settings(), VST3ParametersWindow::Setup(), SyncParameters(), NumericConverter::TIME, and XO.

Here is the call graph for this function:

◆ ProcessBlock()

size_t VST3Effect::ProcessBlock ( EffectSettings settings,
const float *const *  inBlock,
float *const *  outBlock,
size_t  blockLen 
)
overridevirtual

Called for destructive effect computation.

Reimplemented from StatefulPerTrackEffect.

Definition at line 739 of file VST3Effect.cpp.

741{
742 internal::ComponentHandler::PendingChangesPtr pendingChanges { nullptr };
744 pendingChanges = mComponentHandler->getPendingChanges();
745 return VST3ProcessBlock(mEffectComponent.get(), mSetup, inBlock, outBlock, blockLen, pendingChanges.get());
746}
std::unique_ptr< Steinberg::Vst::IParameterChanges, std::function< void(Steinberg::Vst::IParameterChanges *)> > PendingChangesPtr
size_t VST3ProcessBlock(Steinberg::Vst::IComponent *effect, const Steinberg::Vst::ProcessSetup &setup, const float *const *inBlock, float *const *outBlock, size_t blockLen, Steinberg::Vst::IParameterChanges *inputParameterChanges)
Definition: VST3Effect.cpp:645

References mComponentHandler, mEffectComponent, mSetup, and anonymous_namespace{VST3Effect.cpp}::VST3ProcessBlock().

Here is the call graph for this function:

◆ ProcessFinalize()

bool VST3Effect::ProcessFinalize ( void  )
overridevirtual

Called at end of destructive processing, for each (mono/stereo) track Default implementation does nothing, returns true This may be called during stack unwinding:

Reimplemented from StatefulPerTrackEffect.

Definition at line 635 of file VST3Effect.cpp.

636{
637 using namespace Steinberg;
638
639 mAudioProcessor->setProcessing(false);
640 return mEffectComponent->setActive(false) == Steinberg::kResultOk;
641}

References mAudioProcessor, and mEffectComponent.

◆ ProcessInitialize()

bool VST3Effect::ProcessInitialize ( EffectSettings settings,
double  sampleRate,
sampleCount  totalLen,
ChannelNames  chanMap 
)
overridevirtual

Called at start of destructive processing, for each (mono/stereo) track Default implementation does nothing, returns true

Reimplemented from StatefulPerTrackEffect.

Definition at line 615 of file VST3Effect.cpp.

617{
618 mSetup.sampleRate = sampleRate;
619 using namespace Steinberg;
620
621 if(mAudioProcessor->canProcessSampleSize(mSetup.symbolicSampleSize) ==kResultTrue &&
622 mAudioProcessor->setupProcessing(mSetup) == kResultOk)
623 {
624 if(mEffectComponent->setActive(true) == kResultOk)
625 {
626 SyncParameters(settings);//will do nothing for realtime effect
627 mAudioProcessor->setProcessing(true);
628 mInitialDelay = static_cast<decltype(mInitialDelay)>(mAudioProcessor->getLatencySamples());
629 return true;
630 }
631 }
632 return false;
633}

References mAudioProcessor, mEffectComponent, mInitialDelay, mSetup, settings(), and SyncParameters().

Here is the call graph for this function:

◆ RealtimeAddProcessor()

bool VST3Effect::RealtimeAddProcessor ( EffectSettings settings,
unsigned  numChannels,
float  sampleRate 
)
overridevirtual

Returns
success Default implementation does nothing, returns true Default implementation does nothing, returns true

Reimplemented from StatefulEffectBase.

Definition at line 756 of file VST3Effect.cpp.

758{
759 using namespace Steinberg;
760
761 try
762 {
763 auto effect = std::make_unique<VST3Effect>(*this);
764 effect->mSetup.processMode = Vst::kRealtime;
765 effect->mSetup.sampleRate = sampleRate;
766 if(!effect->ProcessInitialize(settings, sampleRate, {0}, nullptr))
767 throw std::runtime_error { "VST3 realtime initialization failed" };
768
769 mRealtimeGroupProcessors.push_back(std::move(effect));
770 return true;
771 }
772 catch(std::exception& e)
773 {
774 //make_unique<> isn't likely to fail here since this effect instance
775 //somehow succeeded
776 wxLogError("Failed to add realtime processor: %s", e.what());
777 }
778 return false;
779}

References mRealtimeGroupProcessors, and settings().

Here is the call graph for this function:

◆ RealtimeFinalize()

bool VST3Effect::RealtimeFinalize ( EffectSettings settings)
overridevirtualnoexcept

Returns
success Default implementation does nothing, returns true Default implementation does nothing, returns false

Reimplemented from StatefulEffectBase.

Definition at line 781 of file VST3Effect.cpp.

782{
783 return GuardedCall<bool>([this]()
784 {
785 for(auto& processor : mRealtimeGroupProcessors)
786 processor->ProcessFinalize();
787
789 mPendingChanges.reset();
790
791 return true;
792 });
793}
internal::ComponentHandler::PendingChangesPtr mPendingChanges
Definition: VST3Effect.h:73

◆ RealtimeInitialize()

bool VST3Effect::RealtimeInitialize ( EffectSettings settings,
double  sampleRate 
)
overridevirtual

Returns
success Default implementation does nothing, returns false (so assume realtime is not supported). Other member functions related to realtime return true or zero, but will not be called, unless a derived class overrides RealtimeInitialize. Default implementation does nothing, returns false

Reimplemented from StatefulEffectBase.

Definition at line 748 of file VST3Effect.cpp.

749{
750 mSetup.sampleRate = sampleRate;
751 //reload current parameters form the editor into parameter queues
753 return true;
754}

References mSetup, settings(), and SyncParameters().

Here is the call graph for this function:

◆ RealtimeProcess()

size_t VST3Effect::RealtimeProcess ( size_t  group,
EffectSettings settings,
const float *const *  inBuf,
float *const *  outBuf,
size_t  numSamples 
)
overridevirtual

Returns
success Default implementation does nothing, returns 0 Default implementation does nothing, returns 0

Reimplemented from StatefulEffectBase.

Definition at line 819 of file VST3Effect.cpp.

821{
822 if (group >= mRealtimeGroupProcessors.size())
823 return 0;
824 auto& effect = mRealtimeGroupProcessors[group];
825 return VST3ProcessBlock(effect->mEffectComponent.get(), effect->mSetup, inBuf, outBuf, numSamples, mPendingChanges.get());
826}

References mPendingChanges, mRealtimeGroupProcessors, and anonymous_namespace{VST3Effect.cpp}::VST3ProcessBlock().

Here is the call graph for this function:

◆ RealtimeProcessEnd()

bool VST3Effect::RealtimeProcessEnd ( EffectSettings settings)
overridevirtualnoexcept

settings can be updated to let a dialog change appearance at idle

Returns
success Default implementation does nothing, returns true Default implementation does nothing, returns true

Reimplemented from StatefulEffectBase.

Definition at line 828 of file VST3Effect.cpp.

829{
830 return GuardedCall<bool>([this]()
831 {
832 mPendingChanges.reset();
833 return true;
834 });
835}

◆ RealtimeProcessStart()

bool VST3Effect::RealtimeProcessStart ( EffectSettings settings)
overridevirtual

settings are possibly changed, since last call, by an asynchronous dialog

Returns
success Default implementation does nothing, returns true Default implementation does nothing, returns true

Reimplemented from StatefulEffectBase.

Definition at line 809 of file VST3Effect.cpp.

810{
811 assert(mPendingChanges == nullptr);
812
813 if(mComponentHandler != nullptr)
814 //Same parameter changes are used among all of the realtime processors
815 mPendingChanges = mComponentHandler->getPendingChanges();
816 return true;
817}

References mComponentHandler, and mPendingChanges.

◆ RealtimeResume()

bool VST3Effect::RealtimeResume ( )
overridevirtual

Returns
success Default implementation does nothing, returns true Default implementation does nothing, returns true

Reimplemented from StatefulEffectBase.

Definition at line 802 of file VST3Effect.cpp.

803{
804 for(auto& effect : mRealtimeGroupProcessors)
805 effect->mAudioProcessor->setProcessing(true);
806 return true;
807}

References mRealtimeGroupProcessors.

◆ RealtimeSuspend()

bool VST3Effect::RealtimeSuspend ( )
overridevirtual

Returns
success Default implementation does nothing, returns true Default implementation does nothing, returns true

Reimplemented from StatefulEffectBase.

Definition at line 795 of file VST3Effect.cpp.

796{
797 for(auto& effect : mRealtimeGroupProcessors)
798 effect->mAudioProcessor->setProcessing(false);
799 return true;
800}

References mRealtimeGroupProcessors.

◆ ReloadUserOptions()

void VST3Effect::ReloadUserOptions ( )
private

Definition at line 1220 of file VST3Effect.cpp.

1221{
1222 // Reinitialize configuration settings
1223 int userBlockSize;
1224 GetConfig(*this, PluginSettings::Shared, wxT("Options"),
1225 wxT("BufferSize"), userBlockSize, 8192);
1226 mUserBlockSize = std::max( 1, userBlockSize );
1227 GetConfig(*this, PluginSettings::Shared, wxT("Options"),
1228 wxT("UseLatency"), mUseLatency, true);
1229
1231}
size_t SetBlockSize(size_t maxBlockSize) override
Definition: VST3Effect.cpp:590

References PluginSettings::GetConfig(), mUseLatency, mUserBlockSize, SetBlockSize(), and PluginSettings::Shared.

Referenced by DoMakeInstance(), and ShowOptions().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SaveSettings()

bool VST3Effect::SaveSettings ( const EffectSettings settings,
CommandParameters parms 
) const
overridevirtual

Store settings as keys and values.

The override may assume parms is initially empty

Returns
true on success

Reimplemented from Effect.

Definition at line 352 of file VST3Effect.cpp.

354{
355 if(mEditController == nullptr)
356 return false;
357
358 using namespace Steinberg;
359
360 for(int i = 0, count = mEditController->getParameterCount(); i < count; ++i)
361 {
362 Vst::ParameterInfo parameterInfo { };
363 if(mEditController->getParameterInfo(i, parameterInfo) == kResultOk)
364 {
365 if(parameterInfo.flags & Vst::ParameterInfo::kCanAutomate)
366 {
367 parms.Write(
369 mEditController->getParamNormalized(parameterInfo.id)
370 );
371 }
372 }
373 }
374
375 return true;
376}
static wxString MakeAutomationParameterKey(const Steinberg::Vst::ParameterInfo &info)
Definition: VST3Utils.cpp:51

References VST3Utils::MakeAutomationParameterKey(), and mEditController.

Here is the call graph for this function:

◆ SaveUserPreset()

bool VST3Effect::SaveUserPreset ( const RegistryPath name,
const EffectSettings settings 
) const
overridevirtual

Save settings in the configuration file as a user-named preset.

Reimplemented from Effect.

Definition at line 452 of file VST3Effect.cpp.

454{
455 using namespace Steinberg;
456
457 if(!mEditController)
458 return false;
459
460 auto processorState = owned(safenew PresetsBufferStream);
461 if(mEffectComponent->getState(processorState) != kResultOk)
462 return false;
463
464 SetConfig(*this, PluginSettings::Private, name, processorStateKey, processorState->toString());
465
466 auto controllerState = owned(safenew PresetsBufferStream);
467 if(mEditController->getState(controllerState) == kResultOk)
468 SetConfig(*this, PluginSettings::Private, name, controllerStateKey, controllerState->toString());
469
470 return true;
471}
bool SetConfig(const EffectDefinitionInterface &ident, ConfigurationType type, const RegistryPath &group, const RegistryPath &key, const Value &value)

References anonymous_namespace{VST3Effect.cpp}::controllerStateKey, mEditController, mEffectComponent, name, PluginSettings::Private, anonymous_namespace{VST3Effect.cpp}::processorStateKey, safenew, and PluginSettings::SetConfig().

Here is the call graph for this function:

◆ SetBlockSize()

size_t VST3Effect::SetBlockSize ( size_t  maxBlockSize)
overridevirtual

Default implementation assigns mEffectBlockSize, returns it

Reimplemented from StatefulPerTrackEffect.

Definition at line 590 of file VST3Effect.cpp.

591{
592 mSetup.maxSamplesPerBlock =
593 static_cast<Steinberg::int32>(std::min(maxBlockSize, mUserBlockSize));
594 return mSetup.maxSamplesPerBlock;
595}
int min(int a, int b)

References min(), mSetup, and mUserBlockSize.

Referenced by ReloadUserOptions().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ShowClientInterface()

int VST3Effect::ShowClientInterface ( wxWindow &  parent,
wxDialog &  dialog,
bool  forceModal 
)
overridevirtual
Returns
0 if destructive effect processing should not proceed (and there may be a non-modal dialog still opened); otherwise, modal dialog return code

Reimplemented from Effect.

Definition at line 837 of file VST3Effect.cpp.

838{
839 if(!IsGraphicalUI())
840 {
841 //Restrict resize of the "plain" dialog
842 dialog.SetMaxSize(dialog.GetSize());
843 dialog.SetMinSize(dialog.GetSize());
844 }
845 if(forceModal)
846 return dialog.ShowModal();
847
848 dialog.Show();
849 return 0;
850}
bool IsGraphicalUI() override
Definition: VST3Effect.cpp:868

References IsGraphicalUI().

Here is the call graph for this function:

◆ ShowOptions()

void VST3Effect::ShowOptions ( )
overridevirtual

Reimplemented from Effect.

Definition at line 1033 of file VST3Effect.cpp.

1034{
1035 VST3OptionsDialog dlg(mParent, *this);
1036 if (dlg.ShowModal())
1037 {
1039 }
1040}

References mParent, and ReloadUserOptions().

Here is the call graph for this function:

◆ SupportsAutomation()

bool VST3Effect::SupportsAutomation ( ) const
overridevirtual

Whether the effect has any automatable controls.

Reimplemented from Effect.

Definition at line 332 of file VST3Effect.cpp.

333{
334 if(mEditController == nullptr)
335 return false;
336
337 using namespace Steinberg;
338
339 for(int i = 0, count = mEditController->getParameterCount(); i < count; ++i)
340 {
341 Vst::ParameterInfo parameterInfo { };
342 if(mEditController->getParameterInfo(i, parameterInfo) == kResultOk)
343 {
344 if(parameterInfo.flags & Vst::ParameterInfo::kCanAutomate)
345 return true;
346 }
347 }
348
349 return false;
350}

References mEditController.

◆ SupportsRealtime()

bool VST3Effect::SupportsRealtime ( ) const
overridevirtual

Whether the effect supports realtime previewing (while audio is playing).

Reimplemented from Effect.

Definition at line 323 of file VST3Effect.cpp.

324{
325 // TODO reenable after achieving statelessness
326 // Also, as with old VST, perhaps only for plug-ins known not to be
327 // just generators
328 return false;
329// return true;
330}

◆ SyncParameters()

void VST3Effect::SyncParameters ( EffectSettings ) const
private

Definition at line 1157 of file VST3Effect.cpp.

1158{
1159 using namespace Steinberg;
1160
1161 if(mComponentHandler != nullptr)
1162 {
1163 for(int i = 0, count = mEditController->getParameterCount(); i < count; ++i)
1164 {
1165 Vst::ParameterInfo parameterInfo { };
1166 if(mEditController->getParameterInfo(i, parameterInfo) == kResultOk)
1167 {
1168 if(parameterInfo.flags & Vst::ParameterInfo::kIsReadOnly)
1169 continue;
1170
1171 if(mComponentHandler->beginEdit(parameterInfo.id) == kResultOk)
1172 {
1173 auto cleanup = finally([&]{ mComponentHandler->endEdit(parameterInfo.id); });
1174 mComponentHandler->performEdit(parameterInfo.id, mEditController->getParamNormalized(parameterInfo.id));
1175 }
1176 }
1177 }
1178 }
1179}

References mComponentHandler, and mEditController.

Referenced by LoadUserPreset(), PopulateUI(), ProcessInitialize(), and RealtimeInitialize().

Here is the caller graph for this function:

◆ ValidateUI()

bool VST3Effect::ValidateUI ( EffectSettings settings)
overridevirtual

Reimplemented from Effect.

Definition at line 932 of file VST3Effect.cpp.

933{
934 if (mDuration != nullptr)
935 settings.extra.SetDuration(mDuration->GetValue());
936 return true;
937}

References NumericConverter::GetValue(), mDuration, and settings().

Here is the call graph for this function:

Member Data Documentation

◆ mAudioProcessor

Steinberg::IPtr<Steinberg::Vst::IAudioProcessor> VST3Effect::mAudioProcessor
private

Definition at line 53 of file VST3Effect.h.

Referenced by Initialize(), ProcessFinalize(), and ProcessInitialize().

◆ mComponentConnectionProxy

Steinberg::IPtr<Steinberg::Vst::IConnectionPoint> VST3Effect::mComponentConnectionProxy
private

Definition at line 60 of file VST3Effect.h.

Referenced by VST3Effect(), and ~VST3Effect().

◆ mComponentHandler

Steinberg::IPtr<internal::ComponentHandler> VST3Effect::mComponentHandler
private

◆ mControllerConnectionProxy

Steinberg::IPtr<Steinberg::Vst::IConnectionPoint> VST3Effect::mControllerConnectionProxy
private

Definition at line 61 of file VST3Effect.h.

Referenced by VST3Effect(), and ~VST3Effect().

◆ mDuration

NumericTextCtrl* VST3Effect::mDuration { nullptr }
private

Definition at line 67 of file VST3Effect.h.

Referenced by PopulateUI(), and ValidateUI().

◆ mEditController

Steinberg::IPtr<Steinberg::Vst::IEditController> VST3Effect::mEditController
private

◆ mEffectClassInfo

const VST3::Hosting::ClassInfo VST3Effect::mEffectClassInfo
private

◆ mEffectComponent

Steinberg::IPtr<Steinberg::Vst::IComponent> VST3Effect::mEffectComponent
private

◆ mFactoryPresets

RegistryPaths VST3Effect::mFactoryPresets
mutableprivate

Definition at line 79 of file VST3Effect.h.

Referenced by GetFactoryPresets(), and LoadFactoryPreset().

◆ mInitialDelay

sampleCount VST3Effect::mInitialDelay { 0 }
private

Definition at line 83 of file VST3Effect.h.

Referenced by GetLatency(), and ProcessInitialize().

◆ mModule

std::shared_ptr<VST3::Hosting::Module> VST3Effect::mModule
private

Definition at line 48 of file VST3Effect.h.

Referenced by GetPath(), Initialize(), and VST3Effect().

◆ mParent

wxWindow* VST3Effect::mParent { nullptr }
private

Definition at line 66 of file VST3Effect.h.

Referenced by CloseUI(), ExportPresets(), LoadPreset(), PopulateUI(), and ShowOptions().

◆ mPendingChanges

internal::ComponentHandler::PendingChangesPtr VST3Effect::mPendingChanges
private

Definition at line 73 of file VST3Effect.h.

Referenced by RealtimeProcess(), and RealtimeProcessStart().

◆ mPlainUI

VST3ParametersWindow* VST3Effect::mPlainUI { nullptr }
private

◆ mPlugView

Steinberg::IPtr<Steinberg::IPlugView> VST3Effect::mPlugView
private

Definition at line 63 of file VST3Effect.h.

Referenced by CloseUI(), IsGraphicalUI(), LoadVSTUI(), and OnEffectWindowResize().

◆ mRealtimeGroupProcessors

std::vector<std::shared_ptr<VST3Effect> > VST3Effect::mRealtimeGroupProcessors
private

◆ mRescanFactoryPresets

bool VST3Effect::mRescanFactoryPresets { true }
mutableprivate

Definition at line 78 of file VST3Effect.h.

Referenced by GetFactoryPresets().

◆ mSetup

Steinberg::Vst::ProcessSetup VST3Effect::mSetup
private

◆ mUseLatency

bool VST3Effect::mUseLatency { true }
private

Definition at line 82 of file VST3Effect.h.

Referenced by GetLatency(), ReloadUserOptions(), and VST3Effect().

◆ mUserBlockSize

size_t VST3Effect::mUserBlockSize { 8192 }
private

Definition at line 81 of file VST3Effect.h.

Referenced by Initialize(), ReloadUserOptions(), SetBlockSize(), and VST3Effect().


The documentation for this class was generated from the following files: