Audacity 3.2.0
|
Base class for many of the effects in Audacity. More...
#include <EffectBase.h>
Public Member Functions | |
EffectBase () | |
~EffectBase () override | |
bool | IsLinearEffect () const |
bool | PreviewsFullSelection () const |
void | SetTracks (TrackList *pTracks) |
double | GetDefaultDuration () |
virtual std::any | BeginPreview (const EffectSettings &settings) |
Called when Preview() starts, to allow temporary effect state changes. More... | |
bool | DoEffect (EffectSettings &settings, const InstanceFinder &finder, double projectRate, TrackList *list, WaveTrackFactory *factory, NotifyingSelectedRegion &selectedRegion, unsigned flags, const EffectSettingsAccessPtr &pAccess) override |
virtual double | CalcPreviewInputLength (const EffectSettings &settings, double previewLength) const =0 |
void | CountWaveTracks () |
Public Member Functions inherited from EffectPlugin | |
EffectPlugin & | operator= (EffectPlugin &)=delete |
virtual | ~EffectPlugin () |
virtual bool | HasOptions () const =0 |
virtual bool | CanExportPresets () const =0 |
Whether the effect supports export of presets to files, and importing too. More... | |
virtual const EffectSettingsManager & | GetDefinition () const =0 |
virtual bool | SaveSettingsAsString (const EffectSettings &settings, wxString &parms) const =0 |
virtual OptionalMessage | 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, const InstanceFinder &finder, double projectRate, TrackList *list, WaveTrackFactory *factory, NotifyingSelectedRegion &selectedRegion, unsigned flags, const EffectSettingsAccessPtr &pAccess=nullptr)=0 |
Public Member Functions inherited from EffectInstanceFactory | |
virtual | ~EffectInstanceFactory () |
virtual std::shared_ptr< EffectInstance > | MakeInstance () const =0 |
Make an object maintaining short-term state of an Effect. 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... | |
virtual bool | SaveSettings (const EffectSettings &settings, CommandParameters &parms) const =0 |
Store settings as keys and values. More... | |
virtual bool | LoadSettings (const CommandParameters &parms, EffectSettings &settings) const =0 |
Restore settings from keys and values. More... | |
virtual RegistryPaths | GetFactoryPresets () const =0 |
Report names of factory presets. More... | |
virtual OptionalMessage | LoadUserPreset (const RegistryPath &name, EffectSettings &settings) const =0 |
virtual bool | SaveUserPreset (const RegistryPath &name, const EffectSettings &settings) const =0 |
Save settings in the configuration file as a user-named preset. More... | |
virtual OptionalMessage | LoadFactoryPreset (int id, EffectSettings &settings) const =0 |
virtual OptionalMessage | LoadFactoryDefaults (EffectSettings &settings) const =0 |
virtual std::unique_ptr< EffectOutputs > | MakeOutputs () const |
Produce an object to hold values to send to effect output meters. 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 RealtimeSince | RealtimeSupport () const =0 |
Since which version of Audacity has the effect supported realtime? More... | |
bool | SupportsRealtime () const |
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 std::optional< InstancePointer > | FindInstance (EffectPlugin &plugin) |
static InstanceFinder | DefaultInstanceFinder (EffectPlugin &plugin) |
Static Public Member Functions inherited from EffectDefinitionInterface | |
static Identifier | GetSquashedName (const Identifier &ident) |
A utility that strips spaces and CamelCases a name. More... | |
Public Attributes | |
std::shared_ptr< TrackList > | mTracks {} |
int | mNumTracks {} |
BasicUI::ProgressDialog * | mProgress {} |
double | mProjectRate {} |
WaveTrackFactory * | mFactory {} |
double | mT0 {} |
double | mT1 {} |
bool | mIsPreview { false } |
Protected Member Functions | |
virtual bool | CheckWhetherSkipEffect (const EffectSettings &settings) const =0 |
After Init(), tell whether Process() should be skipped. More... | |
void | SetLinearEffectFlag (bool linearEffectFlag) |
void | SetPreviewFullSelectionFlag (bool previewDurationFlag) |
bool | IsPreviewing () const |
const TrackList * | inputTracks () const |
const AudacityProject * | FindProject () const |
Protected Attributes | |
double | mF0 {} |
double | mF1 {} |
wxArrayString | mPresetNames |
unsigned | mUIFlags { 0 } |
Private Attributes | |
bool | mIsLinearEffect { false } |
bool | mPreviewFullSelection { false } |
int | mNumGroups {} |
Friends | |
class | au::effects::EffectsProvider |
NOTE Temporary solution. More... | |
class | au::effects::EffectExecutionScenario |
class | Effect |
Additional Inherited Members | |
Public Types inherited from EffectPlugin | |
using | EffectSettingsAccessPtr = std::shared_ptr< EffectSettingsAccess > |
using | InstancePointer = std::shared_ptr< EffectInstanceEx > |
using | InstanceFinder = std::function< std::optional< InstancePointer >(EffectSettings &settings) > |
Public Types inherited from EffectDefinitionInterface | |
enum class | RealtimeSince : unsigned { Never , After_3_1 , Always } |
In which versions of Audacity was an effect realtime capable? More... | |
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>") |
Base class for many of the effects in Audacity.
Definition at line 31 of file EffectBase.h.
EffectBase::EffectBase | ( | ) |
Definition at line 32 of file EffectBase.cpp.
References QualitySettings::DefaultSampleRate, mProjectRate, and Setting< T >::ReadWithDefault().
|
overridedefault |
|
virtual |
Called when Preview() starts, to allow temporary effect state changes.
default returns a null
Reimplemented in AmplifyBase, and TimeScaleBase.
Definition at line 234 of file EffectBase.cpp.
Referenced by EffectPreview().
|
pure virtual |
Implemented in ChangeSpeedBase, PaulstretchBase, TimeScaleBase, TruncSilenceBase, and Effect.
Referenced by EffectPreview().
|
protectedpure virtual |
After Init(), tell whether Process() should be skipped.
Implemented in BassTrebleBase, ChangeSpeedBase, ClickRemovalBase, NormalizeBase, Effect, EffectCompressor, and EffectLimiter.
Referenced by DoEffect().
void EffectBase::CountWaveTracks | ( | ) |
Definition at line 227 of file EffectBase.cpp.
References mNumGroups, mNumTracks, mTracks, and WaveTrack::NChannels().
Referenced by DoEffect(), and EffectPreview().
|
static |
Definition at line 249 of file EffectBase.cpp.
Referenced by Effect::Delegate().
|
overridevirtual |
Will only operate on tracks that have the "selected" flag set to true, which is consistent with Audacity's standard UI, and only when finder succeeds
settings | Always given; only for processing |
pAccess | Sometimes given; only for UI |
Implements EffectPlugin.
Definition at line 57 of file EffectBase.cpp.
References CheckWhetherSkipEffect(), TransactionScope::Commit(), CountWaveTracks(), WaveTrackFactory::Create(), CurrentSettingsGroup(), NumericConverterFormats::DefaultSelectionFormat(), NotifyingSelectedRegion::duration(), EffectSettingsExtra::DurationKey(), EffectTypeGenerate, NotifyingSelectedRegion::f0(), NotifyingSelectedRegion::f1(), factory, anonymous_namespace{Scrubbing.cpp}::finder, FindProject(), PluginSettings::GetConfig(), WaveTrack::GetDefaultAudioTrackNamePreference(), GetDefaultDuration(), EffectPlugin::GetDefinition(), ComponentInterface::GetName(), ComponentInterface::GetPath(), EffectDefinitionInterface::GetType(), Internal, EffectDefinitionInterface::IsInteractive(), EffectInstanceFactory::MakeInstance(), BasicUI::MakeProgress(), mF0, mF1, mFactory, mNumTracks, mPresetNames, mProgress, mProjectRate, mT0, mT1, mTracks, mUIFlags, name, NYQUIST_PROMPT_ID, PluginSettings::Private, BasicUI::ProgressShowCancel, QUANTIZED_TIME, NotifyingSelectedRegion::setTimes(), settings(), SetTracks(), NotifyingSelectedRegion::t0(), NotifyingSelectedRegion::t1(), NumericConverterFormats::TimeAndSampleFormat(), SelectedRegion::UndefinedFrequency, updater, valueRestorer(), and XO().
Referenced by Effect::Delegate().
|
static |
Definition at line 239 of file EffectBase.cpp.
Referenced by EffectUIHost::InitializeInstance().
|
protected |
Definition at line 220 of file EffectBase.cpp.
References TrackList::GetOwner(), and inputTracks().
Referenced by DoEffect(), Effect::GetSelectionFormat(), EqualizationBase::Init(), NyquistBase::Init(), Generator::Process(), EffectTwoPassSimpleMono::Process(), NyquistBase::Process(), TruncSilenceBase::ProcessIndependently(), and PerTrackEffect::ProcessPass().
double EffectBase::GetDefaultDuration | ( | ) |
Definition at line 48 of file EffectBase.cpp.
Referenced by DoEffect().
|
inlineprotected |
Definition at line 102 of file EffectBase.h.
Referenced by TruncSilenceBase::CalcPreviewInputLength(), EqualizationBase::EqualizationBase(), FindProject(), AmplifyBase::Init(), AutoDuckBase::Init(), ScienFilterBase::Init(), VampEffect::Init(), LegacyCompressorBase::InitPass1(), FindClippingBase::Process(), VampEffect::Process(), TruncSilenceBase::ProcessIndependently(), NyquistBase::ProcessOne(), and StereoToMono::ProcessOne().
|
inline |
Definition at line 38 of file EffectBase.h.
Referenced by EffectPreview().
|
inlineprotected |
Definition at line 100 of file EffectBase.h.
Referenced by NyquistBase::Process(), PaulstretchBase::ProcessOne(), and PerTrackEffect::ProcessPass().
|
inline |
Definition at line 39 of file EffectBase.h.
Referenced by EffectPreview().
|
protected |
Definition at line 210 of file EffectBase.cpp.
References mIsLinearEffect.
Referenced by AmplifyBase::AmplifyBase(), AutoDuckBase::AutoDuckBase(), BassTrebleBase::BassTrebleBase(), ChangeSpeedBase::ChangeSpeedBase(), ClickRemovalBase::ClickRemovalBase(), DistortionBase::DistortionBase(), EchoBase::EchoBase(), EffectCompressor::EffectCompressor(), EffectLimiter::EffectLimiter(), EqualizationBase::EqualizationBase(), LegacyCompressorBase::LegacyCompressorBase(), LoudnessBase::LoudnessBase(), NoiseBase::NoiseBase(), NormalizeBase::NormalizeBase(), NyquistBase::Parse(), PaulstretchBase::PaulstretchBase(), PhaserBase::PhaserBase(), RepeatBase::RepeatBase(), ReverbBase::ReverbBase(), ScienFilterBase::ScienFilterBase(), SilenceBase::SilenceBase(), TimeScaleBase::TimeScaleBase(), ToneGenBase::ToneGenBase(), TruncSilenceBase::TruncSilenceBase(), and WahWahBase::WahWahBase().
|
protected |
Definition at line 215 of file EffectBase.cpp.
References mPreviewFullSelection.
Referenced by NyquistBase::Parse().
void EffectBase::SetTracks | ( | TrackList * | pTracks | ) |
Definition at line 43 of file EffectBase.cpp.
References mTracks.
Referenced by DoEffect(), and EffectAndCommandPluginManager::PromptUser().
|
friend |
Definition at line 66 of file EffectBase.h.
|
friend |
NOTE Temporary solution.
Definition at line 65 of file EffectBase.h.
|
friend |
Definition at line 112 of file EffectBase.h.
|
protected |
Definition at line 105 of file EffectBase.h.
Referenced by DoEffect(), NyquistBase::Init(), NoiseReductionBase::Process(), and NyquistBase::Process().
|
protected |
Definition at line 106 of file EffectBase.h.
Referenced by DoEffect(), NyquistBase::Init(), NoiseReductionBase::Process(), and NyquistBase::Process().
WaveTrackFactory* EffectBase::mFactory {} |
Definition at line 121 of file EffectBase.h.
Referenced by Effect::Delegate(), DoEffect(), and EffectPreview().
|
private |
Definition at line 131 of file EffectBase.h.
Referenced by SetLinearEffectFlag().
bool EffectBase::mIsPreview { false } |
Definition at line 124 of file EffectBase.h.
Referenced by EffectPreview().
|
private |
Definition at line 134 of file EffectBase.h.
Referenced by CountWaveTracks(), Effect::GetNumWaveGroups(), and Effect::TrackGroupProgress().
int EffectBase::mNumTracks {} |
Definition at line 117 of file EffectBase.h.
Referenced by CountWaveTracks(), DoEffect(), EffectPreview(), Effect::GetNumWaveTracks(), and Effect::TrackProgress().
|
protected |
Definition at line 108 of file EffectBase.h.
Referenced by DoEffect(), and NyquistBase::Parse().
|
private |
Definition at line 132 of file EffectBase.h.
Referenced by SetPreviewFullSelectionFlag().
BasicUI::ProgressDialog* EffectBase::mProgress {} |
Definition at line 118 of file EffectBase.h.
Referenced by DoEffect(), EffectPreview(), StereoToMono::Process(), Effect::TotalProgress(), Effect::TrackGroupProgress(), and Effect::TrackProgress().
double EffectBase::mProjectRate {} |
Definition at line 119 of file EffectBase.h.
Referenced by NyquistEffect::BuildEffectWindow(), PaulstretchBase::CalcPreviewInputLength(), Effect::Delegate(), EffectRepeat::DisplayNewTime(), DoEffect(), EffectBase(), EffectPreview(), EqualizationBase::EqualizationBase(), ScienFilterBase::Init(), VampEffect::Init(), LadspaEffectBase::InitializeControls(), EffectDtmf::MakeEditor(), LadspaEffect::MakeEditor(), EffectChangeSpeed::OnTimeCtrlUpdate(), EffectNoise::PopulateOrExchange(), EffectSilence::PopulateOrExchange(), EffectToneGen::PopulateOrExchange(), LV2Effect::PopulateUI(), VSTEffect::PopulateUI(), and PaulstretchBase::ProcessOne().
double EffectBase::mT0 {} |
Definition at line 122 of file EffectBase.h.
Referenced by TruncSilenceBase::Analyze(), AutoDuckBase::ApplyDuckFade(), TruncSilenceBase::CalcPreviewInputLength(), Effect::Delegate(), EffectRepeat::DisplayNewTime(), DoEffect(), EffectPreview(), SBSMSBase::Finalize(), TruncSilenceBase::FindSilences(), Effect::GetBounds(), AmplifyBase::Init(), ChangeSpeedBase::Init(), DtmfBase::MakeInstance(), PerTrackEffect::MakeOutputTracks(), PerTrackEffect::Process(), AutoDuckBase::Process(), ChangeSpeedBase::Process(), ClickRemovalBase::Process(), EqualizationBase::Process(), FindClippingBase::Process(), Generator::Process(), LoudnessBase::Process(), NoiseReductionBase::Process(), NormalizeBase::Process(), PaulstretchBase::Process(), Repair::Process(), RepeatBase::Process(), Reverse::Process(), SBSMSBase::Process(), TimeScaleBase::Process(), EffectTwoPassSimpleMono::Process(), NyquistBase::Process(), TruncSilenceBase::ProcessAll(), TruncSilenceBase::ProcessIndependently(), ChangeSpeedBase::ProcessLabelTrack(), SBSMSBase::ProcessLabelTrack(), NyquistBase::ProcessOne(), EffectTwoPassSimpleMono::ProcessPass(), and PerTrackEffect::ProcessPass().
double EffectBase::mT1 {} |
Definition at line 123 of file EffectBase.h.
Referenced by TruncSilenceBase::Analyze(), AutoDuckBase::ApplyDuckFade(), TruncSilenceBase::CalcPreviewInputLength(), Effect::Delegate(), EffectRepeat::DisplayNewTime(), DoEffect(), EffectPreview(), SBSMSBase::Finalize(), TruncSilenceBase::FindSilences(), Effect::GetBounds(), AmplifyBase::Init(), ChangeSpeedBase::Init(), PerTrackEffect::MakeOutputTracks(), PerTrackEffect::Process(), AutoDuckBase::Process(), ChangeSpeedBase::Process(), ClickRemovalBase::Process(), EqualizationBase::Process(), FindClippingBase::Process(), Generator::Process(), LoudnessBase::Process(), NoiseReductionBase::Process(), NormalizeBase::Process(), PaulstretchBase::Process(), Repair::Process(), RepeatBase::Process(), Reverse::Process(), SBSMSBase::Process(), TimeScaleBase::Process(), EffectTwoPassSimpleMono::Process(), NyquistBase::Process(), TruncSilenceBase::ProcessAll(), TruncSilenceBase::ProcessIndependently(), ChangeSpeedBase::ProcessLabelTrack(), SBSMSBase::ProcessLabelTrack(), NyquistBase::ProcessOne(), EffectTwoPassSimpleMono::ProcessPass(), and PerTrackEffect::ProcessPass().
std::shared_ptr<TrackList> EffectBase::mTracks {} |
Definition at line 116 of file EffectBase.h.
Referenced by AddedAnalysisTrack::AddedAnalysisTrack(), CountWaveTracks(), Effect::Delegate(), DoEffect(), EffectPreview(), PerTrackEffect::MakeOutputTracks(), ModifiedAnalysisTrack::ModifiedAnalysisTrack(), PerTrackEffect::Process(), AutoDuckBase::Process(), ChangeSpeedBase::Process(), ClickRemovalBase::Process(), EqualizationBase::Process(), FindClippingBase::Process(), Generator::Process(), LoudnessBase::Process(), NoiseReductionBase::Process(), NormalizeBase::Process(), PaulstretchBase::Process(), Repair::Process(), RepeatBase::Process(), Reverse::Process(), SBSMSBase::Process(), StereoToMono::Process(), EffectTwoPassSimpleMono::Process(), NyquistBase::Process(), TruncSilenceBase::ProcessAll(), TruncSilenceBase::ProcessIndependently(), SetTracks(), AddedAnalysisTrack::~AddedAnalysisTrack(), and ModifiedAnalysisTrack::~ModifiedAnalysisTrack().
|
protected |
Definition at line 109 of file EffectBase.h.
Referenced by Effect::Delegate(), DoEffect(), and Effect::TestUIFlags().