![]() |
Audacity 3.2.0
|
An Effect that can generate a sine, square or sawtooth wave. An extended mode of EffectToneGen supports 'chirps' where the frequency changes smoothly during the tone. More...
#include <ToneGen.h>
Public Member Functions | |
EffectToneGen (bool isChirp) | |
virtual | ~EffectToneGen () |
ComponentInterfaceSymbol | GetSymbol () const override |
TranslatableString | GetDescription () const override |
ManualPageID | ManualPage () const override |
Name of a page in the Audacity alpha manual, default is empty. More... | |
EffectType | GetType () const override |
Type determines how it behaves. More... | |
unsigned | GetAudioOutCount () const override |
How many output buffers to allocate at once. More... | |
bool | ProcessInitialize (EffectSettings &settings, double sampleRate, sampleCount totalLen, ChannelNames chanMap) override |
size_t | ProcessBlock (EffectSettings &settings, const float *const *inBlock, float *const *outBlock, size_t blockLen) override |
Called for destructive effect computation. More... | |
std::unique_ptr< EffectUIValidator > | PopulateOrExchange (ShuttleGui &S, EffectInstance &instance, EffectSettingsAccess &access) override |
Add controls to effect panel; always succeeds. More... | |
bool | TransferDataToWindow (const EffectSettings &settings) override |
Update controls for the settings. More... | |
bool | TransferDataFromWindow (EffectSettings &settings) override |
Update the given settings from controls. More... | |
![]() | |
std::shared_ptr< EffectInstance > | MakeInstance () 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... | |
![]() | |
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 |
![]() | |
~PerTrackEffect () override | |
![]() | |
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... | |
RealtimeSince | RealtimeSupport () const override |
Since which version of Audacity has the effect supported realtime? 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 EffectParameterMethods & | Parameters () const |
int | ShowClientInterface (wxWindow &parent, wxDialog &dialog, bool forceModal=false) override |
std::unique_ptr< EffectUIValidator > | PopulateUI (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 EffectSettingsManager & | GetDefinition () 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 () |
![]() | |
EffectBase () | |
~EffectBase () override | |
![]() | |
virtual | ~EffectUIClientInterface () |
virtual int | ShowClientInterface (wxWindow &parent, wxDialog &dialog, bool forceModal=false)=0 |
virtual bool | IsGraphicalUI ()=0 |
virtual std::unique_ptr< EffectUIValidator > | PopulateUI (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 |
![]() | |
EffectPlugin & | operator= (EffectPlugin &)=delete |
virtual | ~EffectPlugin () |
virtual const EffectSettingsManager & | GetDefinition () 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... | |
![]() | |
virtual | ~EffectInstanceFactory () |
virtual std::shared_ptr< EffectInstance > | MakeInstance () 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... | |
![]() | |
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 | ~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... | |
![]() | |
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 EffectToneGen * | FetchParameters (EffectToneGen &e, EffectSettings &) |
![]() | |
static Effect * | FetchParameters (Effect &e, EffectSettings &) |
static void | IncEffectCounter () |
![]() | |
static Identifier | GetSquashedName (const Identifier &ident) |
A utility that strips spaces and CamelCases a name. More... | |
Private Types | |
enum | kWaveforms { kSine , kSquare , kSawtooth , kSquareNoAlias , kTriangle , nWaveforms } |
enum | kInterpolations { kLinear , kLogarithmic , nInterpolations } |
Private Member Functions | |
void | OnControlUpdate (wxCommandEvent &evt) |
void | PostSet () |
const EffectParameterMethods & | Parameters () const override |
Private Attributes | |
double | mSampleRate {} |
const bool | mChirp |
sampleCount | mSample |
double | mPositionInCycles |
int | mWaveform |
int | mInterpolation |
double | mFrequency0 |
double | mFrequency1 |
double | mAmplitude0 |
double | mAmplitude1 |
double | mLogFrequency [2] |
NumericTextCtrl * | mToneDurationT |
Static Private Attributes | |
static const EnumValueSymbol | kWaveStrings [nWaveforms] |
static const EnumValueSymbol | kInterStrings [nInterpolations] |
static constexpr EffectParameter | StartFreq |
static constexpr EffectParameter | EndFreq |
static constexpr EffectParameter | StartAmp |
static constexpr EffectParameter | EndAmp |
static constexpr EffectParameter | Frequency |
static constexpr EffectParameter | Amplitude |
static constexpr EnumParameter | Waveform |
static constexpr EnumParameter | Interp |
Additional Inherited Members | |
![]() | |
enum | : long { DefaultMessageBoxStyle = wxOK | wxCENTRE } |
![]() | |
using | EffectSettingsAccessPtr = std::shared_ptr< EffectSettingsAccess > |
![]() | |
enum class | RealtimeSince : unsigned { Never , Since_3_2 , Always } |
In which versions of Audacity was an effect realtime capable? More... | |
![]() | |
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>") |
![]() | |
bool | DoPass1 () const |
bool | DoPass2 () const |
bool | Process (EffectInstance &instance, EffectSettings &settings) const |
![]() | |
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< EffectUIValidator > | PopulateOrExchange (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< AddedAnalysisTrack > | AddAnalysisTrack (const wxString &name=wxString()) |
ModifiedAnalysisTrack | ModifyAnalysisTrack (const LabelTrack *pOrigTrack, const wxString &name=wxString()) |
Track * | AddToOutputTracks (const std::shared_ptr< Track > &t) |
![]() | |
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 TrackList * | inputTracks () const |
const AudacityProject * | FindProject () const |
virtual bool | ValidateUI (EffectSettings &settings)=0 |
virtual bool | CloseUI ()=0 |
![]() | |
sampleCount | mSampleCnt {} |
![]() | |
wxWeakRef< wxDialog > | mHostUIDialog |
This smart pointer tracks the lifetime of the dialog. More... | |
wxWindow * | mUIParent {} |
![]() | |
BasicUI::ProgressDialog * | mProgress {} |
double | mProjectRate {} |
WaveTrackFactory * | mFactory {} |
std::shared_ptr< TrackList > | mOutputTracks |
double | mT0 {} |
double | mT1 {} |
wxArrayString | mPresetNames |
unsigned | mUIFlags { 0 } |
![]() | |
friend | EffectUIValidator |
friend | DefaultEffectUIValidator |
![]() | |
static int | nEffectsDone = 0 |
An Effect that can generate a sine, square or sawtooth wave. An extended mode of EffectToneGen supports 'chirps' where the frequency changes smoothly during the tone.
|
private |
Enumerator | |
---|---|
kLinear | |
kLogarithmic | |
nInterpolations |
|
private |
Enumerator | |
---|---|
kSine | |
kSquare | |
kSawtooth | |
kSquareNoAlias | |
kTriangle | |
nWaveforms |
EffectToneGen::EffectToneGen | ( | bool | isChirp | ) |
Definition at line 91 of file ToneGen.cpp.
Referenced by Parameters().
|
virtual |
Definition at line 107 of file ToneGen.cpp.
|
inlinestatic |
|
overridevirtual |
How many output buffers to allocate at once.
Reimplemented from Effect.
Definition at line 141 of file ToneGen.cpp.
|
overridevirtual |
|
overridevirtual |
Reimplemented from Effect.
Definition at line 113 of file ToneGen.cpp.
References mChirp, EffectChirp::Symbol, and EffectTone::Symbol.
|
overridevirtual |
Type determines how it behaves.
Reimplemented from Effect.
Definition at line 136 of file ToneGen.cpp.
References EffectTypeGenerate.
|
overridevirtual |
Name of a page in the Audacity alpha manual, default is empty.
Reimplemented from EffectDefinitionInterface.
Definition at line 127 of file ToneGen.cpp.
References mChirp.
|
private |
Definition at line 415 of file ToneGen.cpp.
References Effect::EnableApply(), and Effect::mUIParent.
|
overrideprivatevirtual |
Reimplemented from Effect.
Definition at line 53 of file ToneGen.cpp.
References Amplitude, EffectToneGen(), EndAmp, EndFreq, Frequency, Interp, mChirp, StartAmp, StartFreq, and Waveform.
|
overridevirtual |
Add controls to effect panel; always succeeds.
Reimplemented from Effect.
Definition at line 273 of file ToneGen.cpp.
References Amplitude, NumericTextCtrl::Options::AutoPos(), EndAmp, EndFreq, EffectSettings::extra, Frequency, EffectSettingsAccess::Get(), kInterStrings, kWaveStrings, mAmplitude0, mAmplitude1, EffectParameter< Structure, Member, Type, Value >::max, mChirp, mFrequency0, mFrequency1, EffectParameter< Structure, Member, Type, Value >::min, mInterpolation, EffectBase::mProjectRate, Msgids(), mToneDurationT, mWaveform, nInterpolations, nWaveforms, S, safenew, StartAmp, StartFreq, NumericConverter::TIME, XO, and XXO.
|
private |
Definition at line 257 of file ToneGen.cpp.
References mAmplitude0, mAmplitude1, mChirp, mFrequency0, and mFrequency1.
|
overridevirtual |
Called for destructive effect computation.
Reimplemented from StatefulPerTrackEffect.
Definition at line 155 of file ToneGen.cpp.
References sampleCount::as_double(), kLogarithmic, kSawtooth, kSine, kSquare, kSquareNoAlias, kTriangle, M_PI, mAmplitude0, mAmplitude1, mFrequency0, mFrequency1, mInterpolation, mLogFrequency, mPositionInCycles, mSample, PerTrackEffect::mSampleCnt, mSampleRate, and mWaveform.
|
overridevirtual |
Called at start of destructive processing, for each (mono/stereo) track Default implementation does nothing, returns true
Reimplemented from StatefulPerTrackEffect.
Definition at line 146 of file ToneGen.cpp.
References mPositionInCycles, mSample, and mSampleRate.
|
overridevirtual |
Update the given settings from controls.
Reimplemented from Effect.
Definition at line 400 of file ToneGen.cpp.
References NumericConverter::GetValue(), mAmplitude0, mAmplitude1, mChirp, mFrequency0, mFrequency1, mToneDurationT, and settings().
|
overridevirtual |
Update controls for the settings.
Reimplemented from Effect.
Definition at line 394 of file ToneGen.cpp.
References mToneDurationT, settings(), and NumericTextCtrl::SetValue().
|
staticconstexprprivate |
Definition at line 118 of file ToneGen.h.
Referenced by Parameters(), and PopulateOrExchange().
|
staticconstexprprivate |
Definition at line 114 of file ToneGen.h.
Referenced by Parameters(), and PopulateOrExchange().
|
staticconstexprprivate |
Definition at line 110 of file ToneGen.h.
Referenced by Parameters(), and PopulateOrExchange().
|
staticconstexprprivate |
Definition at line 116 of file ToneGen.h.
Referenced by Parameters(), and PopulateOrExchange().
|
staticconstexprprivate |
|
staticprivate |
Definition at line 105 of file ToneGen.h.
Referenced by PopulateOrExchange().
|
staticprivate |
|
private |
Definition at line 75 of file ToneGen.h.
Referenced by PopulateOrExchange(), PostSet(), ProcessBlock(), and TransferDataFromWindow().
|
private |
Definition at line 76 of file ToneGen.h.
Referenced by PopulateOrExchange(), PostSet(), ProcessBlock(), and TransferDataFromWindow().
|
private |
Definition at line 62 of file ToneGen.h.
Referenced by GetDescription(), GetSymbol(), ManualPage(), Parameters(), PopulateOrExchange(), PostSet(), and TransferDataFromWindow().
|
private |
Definition at line 73 of file ToneGen.h.
Referenced by PopulateOrExchange(), PostSet(), ProcessBlock(), and TransferDataFromWindow().
|
private |
Definition at line 74 of file ToneGen.h.
Referenced by PopulateOrExchange(), PostSet(), ProcessBlock(), and TransferDataFromWindow().
|
private |
Definition at line 72 of file ToneGen.h.
Referenced by PopulateOrExchange(), and ProcessBlock().
|
private |
Definition at line 77 of file ToneGen.h.
Referenced by ProcessBlock().
|
private |
Definition at line 67 of file ToneGen.h.
Referenced by ProcessBlock(), and ProcessInitialize().
|
private |
Definition at line 66 of file ToneGen.h.
Referenced by ProcessBlock(), and ProcessInitialize().
|
private |
Definition at line 61 of file ToneGen.h.
Referenced by ProcessBlock(), and ProcessInitialize().
|
private |
Definition at line 79 of file ToneGen.h.
Referenced by PopulateOrExchange(), TransferDataFromWindow(), and TransferDataToWindow().
|
private |
Definition at line 71 of file ToneGen.h.
Referenced by PopulateOrExchange(), and ProcessBlock().
|
staticconstexprprivate |
Definition at line 112 of file ToneGen.h.
Referenced by Parameters(), and PopulateOrExchange().
|
staticconstexprprivate |
Definition at line 108 of file ToneGen.h.
Referenced by Parameters(), and PopulateOrExchange().
|
staticconstexprprivate |