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

An Effect derived from EffectTwoPassSimpleMono. More...

#include <Compressor.h>

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

Public Member Functions

 EffectCompressor ()
 
virtual ~EffectCompressor ()
 
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...
 
std::unique_ptr< EffectUIValidatorPopulateOrExchange (ShuttleGui &S, EffectInstance &instance, EffectSettingsAccess &access) override
 Add controls to effect panel; always succeeds. More...
 
bool DoTransferDataFromWindow ()
 
bool TransferDataToWindow (const EffectSettings &settings) override
 Update controls for the settings. More...
 
bool TransferDataFromWindow (EffectSettings &settings) override
 Update the given settings from controls. More...
 
- Public Member Functions inherited from EffectTwoPassSimpleMono
bool Process (EffectInstance &instance, EffectSettings &settings) override
 Actually do the effect here. More...
 
- Public Member Functions inherited from StatefulEffect
std::shared_ptr< EffectInstanceMakeInstance () const override
 Make an object maintaining short-term state of an Effect. 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 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...
 
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 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 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 EffectCompressorFetchParameters (EffectCompressor &e, EffectSettings &)
 
- 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...
 

Static Public Attributes

static const ComponentInterfaceSymbol Symbol { XO("Compressor") }
 
- 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

bool InitPass1 () override
 
bool InitPass2 () override
 
bool NewTrackPass1 () override
 
bool ProcessPass2 (float *buffer, size_t len) override
 
bool TwoBufferProcessPass1 (float *buffer1, size_t len1, float *buffer2, size_t len2) override
 
- Protected Member Functions inherited from EffectTwoPassSimpleMono
virtual bool InitPass1 ()
 
virtual bool InitPass2 ()
 
virtual bool NewTrackPass1 ()
 
virtual bool NewTrackPass2 ()
 
virtual bool ProcessPass1 (float *WXUNUSED(buffer), size_t WXUNUSED(len))
 
virtual bool ProcessPass2 (float *WXUNUSED(buffer), size_t WXUNUSED(len))
 
virtual bool TwoBufferProcessPass1 (float *buffer1, size_t len1, float *WXUNUSED(buffer2), size_t WXUNUSED(len2))
 
virtual bool TwoBufferProcessPass2 (float *buffer1, size_t len1, float *WXUNUSED(buffer2), size_t WXUNUSED(len2))
 
void DisableSecondPass ()
 
- 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
 

Private Member Functions

void FreshenCircle ()
 
float AvgCircle (float x)
 
void Follow (float *buffer, float *env, size_t len, float *previous, size_t previous_len)
 
float DoCompression (float x, double env)
 
void OnSlider (wxCommandEvent &evt)
 
void UpdateUI ()
 
const EffectParameterMethodsParameters () const override
 

Private Attributes

double mRMSSum
 
size_t mCircleSize
 
size_t mCirclePos
 
Doubles mCircle
 
double mAttackTime
 
double mThresholdDB
 
double mNoiseFloorDB
 
double mRatio
 
bool mNormalize
 
bool mUsePeak
 
double mDecayTime
 
double mAttackFactor
 
double mAttackInverseFactor
 
double mDecayFactor
 
double mThreshold
 
double mCompression
 
double mNoiseFloor
 
int mNoiseCounter
 
double mGain
 
double mLastLevel
 
Floats mFollow1
 
Floats mFollow2
 
size_t mFollowLen
 
double mMax
 
EffectCompressorPanelmPanel
 
wxStaticText * mThresholdLabel
 
wxSlider * mThresholdSlider
 
wxStaticText * mThresholdText
 
wxStaticText * mNoiseFloorLabel
 
wxSlider * mNoiseFloorSlider
 
wxStaticText * mNoiseFloorText
 
wxStaticText * mRatioLabel
 
wxSlider * mRatioSlider
 
wxStaticText * mRatioText
 
wxStaticText * mAttackLabel
 
wxSlider * mAttackSlider
 
wxStaticText * mAttackText
 
wxStaticText * mDecayLabel
 
wxSlider * mDecaySlider
 
wxStaticText * mDecayText
 
wxCheckBox * mGainCheckBox
 
wxCheckBox * mPeakCheckBox
 

Static Private Attributes

static constexpr EffectParameter Threshold
 
static constexpr EffectParameter NoiseFloor
 
static constexpr EffectParameter Ratio
 
static constexpr EffectParameter AttackTime
 
static constexpr EffectParameter ReleaseTime
 
static constexpr EffectParameter Normalize
 
static constexpr EffectParameter UsePeak
 

Additional Inherited Members

- Public Types inherited from Effect
enum  : long { DefaultMessageBoxStyle = wxOK | wxCENTRE }
 
- Public Types inherited from EffectPlugin
using EffectSettingsAccessPtr = std::shared_ptr< EffectSettingsAccess >
 
- Public Types inherited from EffectDefinitionInterface
enum class  RealtimeSince : unsigned { Never , Since_3_2 , Always }
 In which versions of Audacity was an effect realtime capable? More...
 
- Protected Attributes inherited from EffectTwoPassSimpleMono
int mCurTrackNum
 
double mCurRate
 
double mCurT0
 
double mCurT1
 
int mCurChannel
 
int mPass
 
bool mSecondPassDisabled
 
std::shared_ptr< TrackListmWorkTracks
 
std::shared_ptr< TrackList > * mTrackLists [2]
 
- 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

An Effect derived from EffectTwoPassSimpleMono.

Definition at line 28 of file Compressor.h.

Constructor & Destructor Documentation

◆ EffectCompressor()

EffectCompressor::EffectCompressor ( )

Definition at line 83 of file Compressor.cpp.

84{
85 Parameters().Reset(*this);
86
87 mThreshold = 0.25;
88 mNoiseFloor = 0.01;
89 mCompression = 0.5;
90 mFollowLen = 0;
91
93}
void SetLinearEffectFlag(bool linearEffectFlag)
Definition: EffectBase.cpp:218
const EffectParameterMethods & Parameters() const override
Definition: Compressor.cpp:59
double mNoiseFloor
Definition: Compressor.h:98
double mCompression
Definition: Compressor.h:97
double mThreshold
Definition: Compressor.h:96
virtual void Reset(Effect &effect) const =0

Referenced by Parameters().

Here is the caller graph for this function:

◆ ~EffectCompressor()

EffectCompressor::~EffectCompressor ( )
virtual

Definition at line 95 of file Compressor.cpp.

96{
97}

Member Function Documentation

◆ AvgCircle()

float EffectCompressor::AvgCircle ( float  x)
private

Definition at line 434 of file Compressor.cpp.

435{
436 float level;
437
438 // Calculate current level from root-mean-squared of
439 // circular buffer ("RMS")
441 mCircle[mCirclePos] = value*value;
443 level = sqrt(mRMSSum/mCircleSize);
445
446 return level;
447}
Doubles mCircle
Definition: Compressor.h:83
size_t mCirclePos
Definition: Compressor.h:82
size_t mCircleSize
Definition: Compressor.h:81

References mCircle, mCirclePos, mCircleSize, and mRMSSum.

Referenced by Follow().

Here is the caller graph for this function:

◆ DoCompression()

float EffectCompressor::DoCompression ( float  x,
double  env 
)
private

Definition at line 562 of file Compressor.cpp.

563{
564 float out;
565 if(mUsePeak) {
566 // Peak values map 1.0 to 1.0 - 'upward' compression
567 out = value * pow(1.0/env, mCompression);
568 } else {
569 // With RMS-based compression don't change values below mThreshold - 'downward' compression
570 out = value * pow(mThreshold/env, mCompression);
571 }
572
573 // Retain the maximum value for use in the normalization pass
574 if(mMax < fabs(out))
575 mMax = fabs(out);
576
577 return out;
578}

References mCompression, mMax, mThreshold, and mUsePeak.

Referenced by TwoBufferProcessPass1().

Here is the caller graph for this function:

◆ DoTransferDataFromWindow()

bool EffectCompressor::DoTransferDataFromWindow ( )

Definition at line 298 of file Compressor.cpp.

299{
300 // To do: eliminate this by using control validators instead
301 mThresholdDB = (double) mThresholdSlider->GetValue();
302 mNoiseFloorDB = (double) mNoiseFloorSlider->GetValue() / NoiseFloor.scale;
303 mRatio = (double) mRatioSlider->GetValue() / Ratio.scale;
304 mAttackTime = (double) mAttackSlider->GetValue() / 100.0; //AttackTime.scale;
305 mDecayTime = (double) mDecaySlider->GetValue() / ReleaseTime.scale;
306 mNormalize = mGainCheckBox->GetValue();
307 mUsePeak = mPeakCheckBox->GetValue();
308
309 return true;
310}
wxCheckBox * mPeakCheckBox
Definition: Compressor.h:130
double mThresholdDB
Definition: Compressor.h:86
static constexpr EffectParameter Ratio
Definition: Compressor.h:139
wxSlider * mDecaySlider
Definition: Compressor.h:126
double mAttackTime
Definition: Compressor.h:85
wxSlider * mAttackSlider
Definition: Compressor.h:122
wxSlider * mNoiseFloorSlider
Definition: Compressor.h:114
wxSlider * mThresholdSlider
Definition: Compressor.h:110
double mDecayTime
Definition: Compressor.h:92
static constexpr EffectParameter NoiseFloor
Definition: Compressor.h:137
static constexpr EffectParameter ReleaseTime
Definition: Compressor.h:143
double mNoiseFloorDB
Definition: Compressor.h:87
wxSlider * mRatioSlider
Definition: Compressor.h:118
wxCheckBox * mGainCheckBox
Definition: Compressor.h:129
const Type scale
Scaling factor, for slider control.
Definition: Shuttle.h:32

References mAttackSlider, mAttackTime, mDecaySlider, mDecayTime, mGainCheckBox, mNoiseFloorDB, mNoiseFloorSlider, mNormalize, mPeakCheckBox, mRatio, mRatioSlider, mThresholdDB, mThresholdSlider, mUsePeak, NoiseFloor, Ratio, ReleaseTime, and EffectParameter< Structure, Member, Type, Value >::scale.

Referenced by OnSlider(), and TransferDataFromWindow().

Here is the caller graph for this function:

◆ FetchParameters()

static EffectCompressor * EffectCompressor::FetchParameters ( EffectCompressor e,
EffectSettings  
)
inlinestatic

Definition at line 32 of file Compressor.h.

32{ return &e; }

◆ Follow()

void EffectCompressor::Follow ( float *  buffer,
float *  env,
size_t  len,
float *  previous,
size_t  previous_len 
)
private

Definition at line 449 of file Compressor.cpp.

450{
451 /*
452
453 "Follow"ing algorithm by Roger B. Dannenberg, taken from
454 Nyquist. His description follows. -DMM
455
456 Description: this is a sophisticated envelope follower.
457 The input is an envelope, e.g. something produced with
458 the AVG function. The purpose of this function is to
459 generate a smooth envelope that is generally not less
460 than the input signal. In other words, we want to "ride"
461 the peaks of the signal with a smooth function. The
462 algorithm is as follows: keep a current output value
463 (called the "value"). The value is allowed to increase
464 by at most rise_factor and decrease by at most fall_factor.
465 Therefore, the next value should be between
466 value * rise_factor and value * fall_factor. If the input
467 is in this range, then the next value is simply the input.
468 If the input is less than value * fall_factor, then the
469 next value is just value * fall_factor, which will be greater
470 than the input signal. If the input is greater than value *
471 rise_factor, then we compute a rising envelope that meets
472 the input value by working bacwards in time, changing the
473 previous values to input / rise_factor, input / rise_factor^2,
474 input / rise_factor^3, etc. until this NEW envelope intersects
475 the previously computed values. There is only a limited buffer
476 in which we can work backwards, so if the NEW envelope does not
477 intersect the old one, then make yet another pass, this time
478 from the oldest buffered value forward, increasing on each
479 sample by rise_factor to produce a maximal envelope. This will
480 still be less than the input.
481
482 The value has a lower limit of floor to make sure value has a
483 reasonable positive value from which to begin an attack.
484 */
485 double level,last;
486
487 if(!mUsePeak) {
488 // Update RMS sum directly from the circle buffer
489 // to avoid accumulation of rounding errors
491 }
492 // First apply a peak detect with the requested decay rate
493 last = mLastLevel;
494 for(size_t i=0; i<len; i++) {
495 if(mUsePeak)
496 level = fabs(buffer[i]);
497 else // use RMS
498 level = AvgCircle(buffer[i]);
499 // Don't increase gain when signal is continuously below the noise floor
500 if(level < mNoiseFloor) {
502 } else {
503 mNoiseCounter = 0;
504 }
505 if(mNoiseCounter < 100) {
506 last *= mDecayFactor;
507 if(last < mThreshold)
508 last = mThreshold;
509 if(level > last)
510 last = level;
511 }
512 env[i] = last;
513 }
514 mLastLevel = last;
515
516 // Next do the same process in reverse direction to get the requested attack rate
517 last = mLastLevel;
518 for(size_t i = len; i--;) {
519 last *= mAttackInverseFactor;
520 if(last < mThreshold)
521 last = mThreshold;
522 if(env[i] < last)
523 env[i] = last;
524 else
525 last = env[i];
526 }
527
528 if((previous != NULL) && (previous_len > 0)) {
529 // If the previous envelope was passed, propagate the rise back until we intersect
530 for(size_t i = previous_len; i--;) {
531 last *= mAttackInverseFactor;
532 if(last < mThreshold)
533 last = mThreshold;
534 if(previous[i] < last)
535 previous[i] = last;
536 else // Intersected the previous envelope buffer, so we are finished
537 return;
538 }
539 // If we can't back up far enough, project the starting level forward
540 // until we intersect the desired envelope
541 last = previous[0];
542 for(size_t i=1; i<previous_len; i++) {
543 last *= mAttackFactor;
544 if(previous[i] > last)
545 previous[i] = last;
546 else // Intersected the desired envelope, so we are finished
547 return;
548 }
549 // If we still didn't intersect, then continue ramp up into current buffer
550 for(size_t i=0; i<len; i++) {
551 last *= mAttackFactor;
552 if(buffer[i] > last)
553 buffer[i] = last;
554 else // Finally got an intersect
555 return;
556 }
557 // If we still didn't intersect, then reset mLastLevel
558 mLastLevel = last;
559 }
560}
float AvgCircle(float x)
Definition: Compressor.cpp:434
double mAttackFactor
Definition: Compressor.h:93
double mDecayFactor
Definition: Compressor.h:95
double mAttackInverseFactor
Definition: Compressor.h:94

References AvgCircle(), FreshenCircle(), mAttackFactor, mAttackInverseFactor, mDecayFactor, mLastLevel, mNoiseCounter, mNoiseFloor, mThreshold, and mUsePeak.

Referenced by TwoBufferProcessPass1().

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

◆ FreshenCircle()

void EffectCompressor::FreshenCircle ( )
private

Definition at line 425 of file Compressor.cpp.

426{
427 // Recompute the RMS sum periodically to prevent accumulation of rounding errors
428 // during long waveforms
429 mRMSSum = 0;
430 for(size_t i=0; i<mCircleSize; i++)
431 mRMSSum += mCircle[i];
432}

References mCircle, mCircleSize, and mRMSSum.

Referenced by Follow().

Here is the caller graph for this function:

◆ GetDescription()

TranslatableString EffectCompressor::GetDescription ( ) const
overridevirtual

Implements ComponentInterface.

Definition at line 106 of file Compressor.cpp.

107{
108 return XO("Compresses the dynamic range of audio");
109}
#define XO(s)
Definition: Internat.h:31

References XO.

◆ GetSymbol()

ComponentInterfaceSymbol EffectCompressor::GetSymbol ( ) const
overridevirtual

Implements ComponentInterface.

Definition at line 101 of file Compressor.cpp.

102{
103 return Symbol;
104}
static const ComponentInterfaceSymbol Symbol
Definition: Compressor.h:34

References Symbol.

◆ GetType()

EffectType EffectCompressor::GetType ( ) const
overridevirtual

Type determines how it behaves.

Implements EffectDefinitionInterface.

Definition at line 118 of file Compressor.cpp.

119{
120 return EffectTypeProcess;
121}
@ EffectTypeProcess

References EffectTypeProcess.

◆ InitPass1()

bool EffectCompressor::InitPass1 ( )
overrideprotectedvirtual

Reimplemented from EffectTwoPassSimpleMono.

Definition at line 339 of file Compressor.cpp.

340{
341 mMax=0.0;
342 if (!mNormalize)
344
345 // Find the maximum block length required for any track
346 size_t maxlen = inputTracks()->Selected< const WaveTrack >().max(
348 );
349 mFollow1.reset();
350 mFollow2.reset();
351 // Allocate buffers for the envelope
352 if(maxlen > 0) {
353 mFollow1.reinit(maxlen);
354 mFollow2.reinit(maxlen);
355 }
356 mFollowLen = maxlen;
357
358 return true;
359}
void reinit(Integral count, bool initialize=false)
Definition: MemoryX.h:57
const TrackList * inputTracks() const
Definition: EffectBase.h:102
auto Selected() -> TrackIterRange< TrackType >
Definition: Track.h:1452
A Track that contains audio waveform data.
Definition: WaveTrack.h:57
size_t GetMaxBlockSize() const override
This returns a nonnegative number of samples meant to size a memory buffer.
Definition: WaveTrack.cpp:1806

References EffectTwoPassSimpleMono::DisableSecondPass(), WaveTrack::GetMaxBlockSize(), EffectBase::inputTracks(), mFollow1, mFollow2, mFollowLen, mMax, mNormalize, ArrayOf< X >::reinit(), and TrackList::Selected().

Here is the call graph for this function:

◆ InitPass2()

bool EffectCompressor::InitPass2 ( )
overrideprotectedvirtual

Reimplemented from EffectTwoPassSimpleMono.

Definition at line 361 of file Compressor.cpp.

362{
363 // Actually, this should not even be called, because we call
364 // DisableSecondPass() before, if mNormalize is false.
365 return mNormalize;
366}

References mNormalize.

◆ ManualPage()

ManualPageID EffectCompressor::ManualPage ( ) const
overridevirtual

Name of a page in the Audacity alpha manual, default is empty.

Reimplemented from EffectDefinitionInterface.

Definition at line 111 of file Compressor.cpp.

112{
113 return L"Compressor";
114}

◆ NewTrackPass1()

bool EffectCompressor::NewTrackPass1 ( )
overrideprotectedvirtual

Reimplemented from EffectTwoPassSimpleMono.

Definition at line 314 of file Compressor.cpp.

315{
318 mNoiseCounter = 100;
319
320 mAttackInverseFactor = exp(log(mThreshold) / (mCurRate * mAttackTime + 0.5));
322 mDecayFactor = exp(log(mThreshold) / (mCurRate * mDecayTime + 0.5));
323
324 if(mRatio > 1)
325 mCompression = 1.0-1.0/mRatio;
326 else
327 mCompression = 0.0;
328
330
331 mCircleSize = 100;
332 mCircle.reinit( mCircleSize, true );
333 mCirclePos = 0;
334 mRMSSum = 0.0;
335
336 return true;
337}
#define DB_TO_LINEAR(x)
Definition: MemoryX.h:535

References DB_TO_LINEAR, mAttackFactor, mAttackInverseFactor, mAttackTime, mCircle, mCirclePos, mCircleSize, mCompression, EffectTwoPassSimpleMono::mCurRate, mDecayFactor, mDecayTime, mLastLevel, mNoiseCounter, mNoiseFloor, mNoiseFloorDB, mRatio, mRMSSum, mThreshold, mThresholdDB, and ArrayOf< X >::reinit().

Here is the call graph for this function:

◆ OnSlider()

void EffectCompressor::OnSlider ( wxCommandEvent &  evt)
private

Definition at line 580 of file Compressor.cpp.

581{
583 UpdateUI();
584}
bool DoTransferDataFromWindow()
Definition: Compressor.cpp:298

References DoTransferDataFromWindow(), and UpdateUI().

Here is the call graph for this function:

◆ Parameters()

const EffectParameterMethods & EffectCompressor::Parameters ( ) const
overrideprivatevirtual

Reimplemented from Effect.

Definition at line 59 of file Compressor.cpp.

60{
62 Threshold, NoiseFloor, Ratio, // positive number > 1.0
63 AttackTime, // seconds
64 ReleaseTime, // seconds
66 > parameters;
67 return parameters;
68}
Generates EffectParameterMethods overrides from variadic template arguments.
static constexpr EffectParameter Threshold
Definition: Compressor.h:135
static constexpr EffectParameter UsePeak
Definition: Compressor.h:147
static constexpr EffectParameter AttackTime
Definition: Compressor.h:141
static constexpr EffectParameter Normalize
Definition: Compressor.h:145

References AttackTime, EffectCompressor(), NoiseFloor, Normalize, Ratio, ReleaseTime, Threshold, and UsePeak.

Here is the call graph for this function:

◆ PopulateOrExchange()

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

Add controls to effect panel; always succeeds.

Returns
if not null, then return it from Effect::PopulateUI instead of a DefaultEffectUIValidator; default implementation returns null

Reimplemented from Effect.

Definition at line 159 of file Compressor.cpp.

161{
162 S.SetBorder(5);
163
164 S.StartHorizontalLay(wxEXPAND, true);
165 {
166 S.SetBorder(10);
167 mPanel = safenew EffectCompressorPanel(S.GetParent(), wxID_ANY,
170 mRatio);
171 S.Prop(true)
172 .Position(wxEXPAND | wxALL)
173 .MinSize( { 400, 200 } )
174 .AddWindow(mPanel);
175 S.SetBorder(5);
176 }
177 S.EndHorizontalLay();
178
179 S.StartStatic( {} );
180 {
181 S.StartMultiColumn(3, wxEXPAND);
182 {
183 S.SetStretchyCol(1);
184 mThresholdLabel = S.AddVariableText(XO("&Threshold:"), true,
185 wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
187 .Name(XO("Threshold"))
188 .Style(wxSL_HORIZONTAL)
189 .AddSlider( {},
193 mThresholdText = S.AddVariableText(ThresholdFormat(999), true,
194 wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL);
195
196 mNoiseFloorLabel = S.AddVariableText(XO("&Noise Floor:"), true,
197 wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
199 .Name(XO("Noise Floor"))
200 .Style(wxSL_HORIZONTAL)
201 .AddSlider( {},
205 mNoiseFloorText = S.AddVariableText(ThresholdFormat(999),
206 true, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL);
207
208 mRatioLabel = S.AddVariableText(XO("&Ratio:"), true,
209 wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
211 .Name(XO("Ratio"))
212 .Style(wxSL_HORIZONTAL)
213 .AddSlider( {},
216 Ratio.min * Ratio.scale);
217 mRatioSlider->SetPageSize(5);
218 mRatioText = S.AddVariableText(RatioTextFormat( 1, 99.9 ), true,
219 wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL);
220
221 /* i18n-hint: Particularly in percussion, sounds can be regarded as having
222 * an 'attack' phase where the sound builds up and a 'decay' where the
223 * sound dies away. So this means 'onset duration'. */
224 mAttackLabel = S.AddVariableText(XO("&Attack Time:"), true,
225 wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
227 /* i18n-hint: Particularly in percussion, sounds can be regarded as having
228 * an 'attack' phase where the sound builds up and a 'decay' where the
229 * sound dies away. So this means 'onset duration'. */
230 .Name(XO("Attack Time"))
231 .Style(wxSL_HORIZONTAL)
232 .AddSlider( {},
236 mAttackText = S.AddVariableText(
237 AttackTimeFormat(9.99),
238 true, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL);
239
240 /* i18n-hint: Particularly in percussion, sounds can be regarded as having
241 * an 'attack' phase where the sound builds up and a 'decay' or 'release' where the
242 * sound dies away. */
243 mDecayLabel = S.AddVariableText(XO("R&elease Time:"), true,
244 wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
246 /* i18n-hint: Particularly in percussion, sounds can be regarded as having
247 * an 'attack' phase where the sound builds up and a 'decay' or 'release' where the
248 * sound dies away. */
249 .Name(XO("Release Time"))
250 .Style(wxSL_HORIZONTAL)
251 .AddSlider( {},
255
256 mDecayText = S.AddVariableText(
257 DecayTimeFormat(99.9),
258 true, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL);
259 }
260 S.EndMultiColumn();
261 }
262 S.EndStatic();
263
264 S.StartHorizontalLay(wxCENTER, false);
265 {
266 /* i18n-hint: Make-up, i.e. correct for any reduction, rather than fabricate it.*/
267 mGainCheckBox = S.AddCheckBox(XXO("Ma&ke-up gain for 0 dB after compressing"),
268 Normalize.def);
269 /* i18n-hint: "Compress" here means reduce variations of sound volume,
270 NOT related to file-size compression; Peaks means extremes in volume */
271 mPeakCheckBox = S.AddCheckBox(XXO("C&ompress based on Peaks"),
272 UsePeak.def);
273 }
274 S.EndHorizontalLay();
275 return nullptr;
276}
@ ID_Ratio
Definition: Compressor.cpp:54
@ ID_Threshold
Definition: Compressor.cpp:52
@ ID_Attack
Definition: Compressor.cpp:55
@ ID_NoiseFloor
Definition: Compressor.cpp:53
@ ID_Decay
Definition: Compressor.cpp:56
#define XXO(s)
Definition: Internat.h:44
#define safenew
Definition: MemoryX.h:10
#define S(N)
Definition: ToChars.cpp:64
wxStaticText * mRatioText
Definition: Compressor.h:119
wxStaticText * mRatioLabel
Definition: Compressor.h:117
wxStaticText * mAttackLabel
Definition: Compressor.h:121
wxStaticText * mDecayText
Definition: Compressor.h:127
wxStaticText * mDecayLabel
Definition: Compressor.h:125
EffectCompressorPanel * mPanel
Definition: Compressor.h:107
wxStaticText * mNoiseFloorText
Definition: Compressor.h:115
wxStaticText * mAttackText
Definition: Compressor.h:123
wxStaticText * mThresholdText
Definition: Compressor.h:111
wxStaticText * mNoiseFloorLabel
Definition: Compressor.h:113
wxStaticText * mThresholdLabel
Definition: Compressor.h:109
TranslatableString DecayTimeFormat(double value)
Definition: Compressor.cpp:134
TranslatableString RatioTextFormat(int sliderValue, double value)
Definition: Compressor.cpp:137
TranslatableString ThresholdFormat(int value)
Definition: Compressor.cpp:127
TranslatableString AttackTimeFormat(double value)
Definition: Compressor.cpp:131
const Type def
Default value.
Definition: Shuttle.h:29
const Type min
Minimum value.
Definition: Shuttle.h:30
const Type max
Maximum value.
Definition: Shuttle.h:31

References AttackTime, anonymous_namespace{Compressor.cpp}::AttackTimeFormat(), anonymous_namespace{Compressor.cpp}::DecayTimeFormat(), EffectParameter< Structure, Member, Type, Value >::def, ID_Attack, ID_Decay, ID_NoiseFloor, ID_Ratio, ID_Threshold, mAttackLabel, mAttackSlider, mAttackText, EffectParameter< Structure, Member, Type, Value >::max, mDecayLabel, mDecaySlider, mDecayText, mGainCheckBox, EffectParameter< Structure, Member, Type, Value >::min, mNoiseFloorDB, mNoiseFloorLabel, mNoiseFloorSlider, mNoiseFloorText, mPanel, mPeakCheckBox, mRatio, mRatioLabel, mRatioSlider, mRatioText, mThresholdDB, mThresholdLabel, mThresholdSlider, mThresholdText, NoiseFloor, Normalize, Ratio, anonymous_namespace{Compressor.cpp}::RatioTextFormat(), ReleaseTime, S, safenew, EffectParameter< Structure, Member, Type, Value >::scale, Threshold, anonymous_namespace{Compressor.cpp}::ThresholdFormat(), UsePeak, XO, and XXO.

Here is the call graph for this function:

◆ ProcessPass2()

bool EffectCompressor::ProcessPass2 ( float *  buffer,
size_t  len 
)
overrideprotected

Definition at line 414 of file Compressor.cpp.

415{
416 if (mMax != 0)
417 {
418 for (size_t i = 0; i < len; i++)
419 buffer[i] /= mMax;
420 }
421
422 return true;
423}

References mMax.

◆ TransferDataFromWindow()

bool EffectCompressor::TransferDataFromWindow ( EffectSettings settings)
overridevirtual

Update the given settings from controls.

Implements EffectPlugin.

Definition at line 293 of file Compressor.cpp.

294{
296}

References DoTransferDataFromWindow().

Here is the call graph for this function:

◆ TransferDataToWindow()

bool EffectCompressor::TransferDataToWindow ( const EffectSettings settings)
overridevirtual

Update controls for the settings.

Implements EffectPlugin.

Definition at line 278 of file Compressor.cpp.

279{
282 mRatioSlider->SetValue(lrint(mRatio * Ratio.scale));
285 mGainCheckBox->SetValue(mNormalize);
286 mPeakCheckBox->SetValue(mUsePeak);
287
288 UpdateUI();
289
290 return true;
291}
#define lrint(dbl)
Definition: float_cast.h:169

References AttackTime, lrint, mAttackSlider, mAttackTime, mDecaySlider, mDecayTime, mGainCheckBox, mNoiseFloorDB, mNoiseFloorSlider, mNormalize, mPeakCheckBox, mRatio, mRatioSlider, mThresholdDB, mThresholdSlider, mUsePeak, NoiseFloor, Ratio, ReleaseTime, EffectParameter< Structure, Member, Type, Value >::scale, and UpdateUI().

Here is the call graph for this function:

◆ TwoBufferProcessPass1()

bool EffectCompressor::TwoBufferProcessPass1 ( float *  buffer1,
size_t  len1,
float *  buffer2,
size_t  len2 
)
overrideprotected

Definition at line 371 of file Compressor.cpp.

373{
374 // If buffers are bigger than allocated, then abort
375 // (this should never happen, but if it does, we don't want to crash)
376 if((len1 > mFollowLen) || (len2 > mFollowLen))
377 return false;
378
379 // This makes sure that the initial value is well-chosen
380 // buffer1 == NULL on the first and only the first call
381 if (buffer1 == NULL) {
382 // Initialize the mLastLevel to the peak level in the first buffer
383 // This avoids problems with large spike events near the beginning of the track
385 for(size_t i=0; i<len2; i++) {
386 if(mLastLevel < fabs(buffer2[i]))
387 mLastLevel = fabs(buffer2[i]);
388 }
389 }
390
391 // buffer2 is NULL on the last and only the last call
392 if(buffer2 != NULL) {
393 Follow(buffer2, mFollow2.get(), len2, mFollow1.get(), len1);
394 }
395
396 if(buffer1 != NULL) {
397 for (size_t i = 0; i < len1; i++) {
398 buffer1[i] = DoCompression(buffer1[i], mFollow1[i]);
399 }
400 }
401
402
403#if 0
404 // Copy the envelope over the track data (for debug purposes)
405 memcpy(buffer1, mFollow1, len1*sizeof(float));
406#endif
407
408 // Rotate the buffer pointers
409 mFollow1.swap(mFollow2);
410
411 return true;
412}
void Follow(float *buffer, float *env, size_t len, float *previous, size_t previous_len)
Definition: Compressor.cpp:449
float DoCompression(float x, double env)
Definition: Compressor.cpp:562

References DoCompression(), Follow(), mFollow1, mFollow2, mFollowLen, mLastLevel, and mThreshold.

Here is the call graph for this function:

◆ UpdateUI()

void EffectCompressor::UpdateUI ( )
private

Definition at line 586 of file Compressor.cpp.

587{
588 mThresholdLabel->SetName(wxString::Format(_("Threshold %d dB"), (int) mThresholdDB));
589 mThresholdText->SetLabel(ThresholdFormat((int) mThresholdDB).Translation());
590 mThresholdText->SetName(mThresholdText->GetLabel()); // fix for bug 577 (NVDA/Narrator screen readers do not read static text in dialogs)
591
592 mNoiseFloorLabel->SetName(wxString::Format(_("Noise Floor %d dB"), (int) mNoiseFloorDB));
593 mNoiseFloorText->SetLabel(ThresholdFormat((int) mNoiseFloorDB).Translation());
594 mNoiseFloorText->SetName(mNoiseFloorText->GetLabel()); // fix for bug 577 (NVDA/Narrator screen readers do not read static text in dialogs)
595
596 mRatioLabel->SetName(
598 mRatioText->SetLabel(
600 mRatioText->SetName(mRatioText->GetLabel()); // fix for bug 577 (NVDA/Narrator screen readers do not read static text in dialogs)
601
602 mAttackLabel->SetName(wxString::Format(_("Attack Time %.2f secs"), mAttackTime));
603 mAttackText->SetLabel(AttackTimeFormat(mAttackTime).Translation());
604 mAttackText->SetName(mAttackText->GetLabel()); // fix for bug 577 (NVDA/Narrator screen readers do not read static text in dialogs)
605
606 mDecayLabel->SetName(wxString::Format(_("Release Time %.1f secs"), mDecayTime));
607 mDecayText->SetLabel(DecayTimeFormat(mDecayTime).Translation());
608 mDecayText->SetName(mDecayText->GetLabel()); // fix for bug 577 (NVDA/Narrator screen readers do not read static text in dialogs)
609
610 mPanel->Refresh(false);
611
612 return;
613}
#define _(s)
Definition: Internat.h:75
wxString Translation() const
TranslatableString RatioLabelFormat(int sliderValue, double value)
Definition: Compressor.cpp:149

References _, anonymous_namespace{Compressor.cpp}::AttackTimeFormat(), anonymous_namespace{Compressor.cpp}::DecayTimeFormat(), mAttackLabel, mAttackText, mAttackTime, mDecayLabel, mDecayText, mDecayTime, mNoiseFloorDB, mNoiseFloorLabel, mNoiseFloorText, mPanel, mRatio, mRatioLabel, mRatioSlider, mRatioText, mThresholdDB, mThresholdLabel, mThresholdText, anonymous_namespace{Compressor.cpp}::RatioLabelFormat(), anonymous_namespace{Compressor.cpp}::RatioTextFormat(), anonymous_namespace{Compressor.cpp}::ThresholdFormat(), and TranslatableString::Translation().

Referenced by OnSlider(), and TransferDataToWindow().

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

Member Data Documentation

◆ AttackTime

constexpr EffectParameter EffectCompressor::AttackTime
staticconstexprprivate
Initial value:
L"AttackTime", 0.2, 0.1, 5.0, 100 }

Definition at line 141 of file Compressor.h.

Referenced by Parameters(), PopulateOrExchange(), and TransferDataToWindow().

◆ mAttackFactor

double EffectCompressor::mAttackFactor
private

Definition at line 93 of file Compressor.h.

Referenced by Follow(), and NewTrackPass1().

◆ mAttackInverseFactor

double EffectCompressor::mAttackInverseFactor
private

Definition at line 94 of file Compressor.h.

Referenced by Follow(), and NewTrackPass1().

◆ mAttackLabel

wxStaticText* EffectCompressor::mAttackLabel
private

Definition at line 121 of file Compressor.h.

Referenced by PopulateOrExchange(), and UpdateUI().

◆ mAttackSlider

wxSlider* EffectCompressor::mAttackSlider
private

◆ mAttackText

wxStaticText* EffectCompressor::mAttackText
private

Definition at line 123 of file Compressor.h.

Referenced by PopulateOrExchange(), and UpdateUI().

◆ mAttackTime

double EffectCompressor::mAttackTime
private

◆ mCircle

Doubles EffectCompressor::mCircle
private

Definition at line 83 of file Compressor.h.

Referenced by AvgCircle(), FreshenCircle(), and NewTrackPass1().

◆ mCirclePos

size_t EffectCompressor::mCirclePos
private

Definition at line 82 of file Compressor.h.

Referenced by AvgCircle(), and NewTrackPass1().

◆ mCircleSize

size_t EffectCompressor::mCircleSize
private

Definition at line 81 of file Compressor.h.

Referenced by AvgCircle(), FreshenCircle(), and NewTrackPass1().

◆ mCompression

double EffectCompressor::mCompression
private

Definition at line 97 of file Compressor.h.

Referenced by DoCompression(), and NewTrackPass1().

◆ mDecayFactor

double EffectCompressor::mDecayFactor
private

Definition at line 95 of file Compressor.h.

Referenced by Follow(), and NewTrackPass1().

◆ mDecayLabel

wxStaticText* EffectCompressor::mDecayLabel
private

Definition at line 125 of file Compressor.h.

Referenced by PopulateOrExchange(), and UpdateUI().

◆ mDecaySlider

wxSlider* EffectCompressor::mDecaySlider
private

◆ mDecayText

wxStaticText* EffectCompressor::mDecayText
private

Definition at line 127 of file Compressor.h.

Referenced by PopulateOrExchange(), and UpdateUI().

◆ mDecayTime

double EffectCompressor::mDecayTime
private

◆ mFollow1

Floats EffectCompressor::mFollow1
private

Definition at line 102 of file Compressor.h.

Referenced by InitPass1(), and TwoBufferProcessPass1().

◆ mFollow2

Floats EffectCompressor::mFollow2
private

Definition at line 102 of file Compressor.h.

Referenced by InitPass1(), and TwoBufferProcessPass1().

◆ mFollowLen

size_t EffectCompressor::mFollowLen
private

Definition at line 103 of file Compressor.h.

Referenced by InitPass1(), and TwoBufferProcessPass1().

◆ mGain

double EffectCompressor::mGain
private

Definition at line 100 of file Compressor.h.

◆ mGainCheckBox

wxCheckBox* EffectCompressor::mGainCheckBox
private

◆ mLastLevel

double EffectCompressor::mLastLevel
private

Definition at line 101 of file Compressor.h.

Referenced by Follow(), NewTrackPass1(), and TwoBufferProcessPass1().

◆ mMax

double EffectCompressor::mMax
private

Definition at line 105 of file Compressor.h.

Referenced by DoCompression(), InitPass1(), and ProcessPass2().

◆ mNoiseCounter

int EffectCompressor::mNoiseCounter
private

Definition at line 99 of file Compressor.h.

Referenced by Follow(), and NewTrackPass1().

◆ mNoiseFloor

double EffectCompressor::mNoiseFloor
private

Definition at line 98 of file Compressor.h.

Referenced by Follow(), and NewTrackPass1().

◆ mNoiseFloorDB

double EffectCompressor::mNoiseFloorDB
private

◆ mNoiseFloorLabel

wxStaticText* EffectCompressor::mNoiseFloorLabel
private

Definition at line 113 of file Compressor.h.

Referenced by PopulateOrExchange(), and UpdateUI().

◆ mNoiseFloorSlider

wxSlider* EffectCompressor::mNoiseFloorSlider
private

◆ mNoiseFloorText

wxStaticText* EffectCompressor::mNoiseFloorText
private

Definition at line 115 of file Compressor.h.

Referenced by PopulateOrExchange(), and UpdateUI().

◆ mNormalize

bool EffectCompressor::mNormalize
private

Definition at line 89 of file Compressor.h.

Referenced by DoTransferDataFromWindow(), InitPass1(), InitPass2(), and TransferDataToWindow().

◆ mPanel

EffectCompressorPanel* EffectCompressor::mPanel
private

Definition at line 107 of file Compressor.h.

Referenced by PopulateOrExchange(), and UpdateUI().

◆ mPeakCheckBox

wxCheckBox* EffectCompressor::mPeakCheckBox
private

◆ mRatio

double EffectCompressor::mRatio
private

◆ mRatioLabel

wxStaticText* EffectCompressor::mRatioLabel
private

Definition at line 117 of file Compressor.h.

Referenced by PopulateOrExchange(), and UpdateUI().

◆ mRatioSlider

wxSlider* EffectCompressor::mRatioSlider
private

◆ mRatioText

wxStaticText* EffectCompressor::mRatioText
private

Definition at line 119 of file Compressor.h.

Referenced by PopulateOrExchange(), and UpdateUI().

◆ mRMSSum

double EffectCompressor::mRMSSum
private

Definition at line 80 of file Compressor.h.

Referenced by AvgCircle(), FreshenCircle(), and NewTrackPass1().

◆ mThreshold

double EffectCompressor::mThreshold
private

Definition at line 96 of file Compressor.h.

Referenced by DoCompression(), Follow(), NewTrackPass1(), and TwoBufferProcessPass1().

◆ mThresholdDB

double EffectCompressor::mThresholdDB
private

◆ mThresholdLabel

wxStaticText* EffectCompressor::mThresholdLabel
private

Definition at line 109 of file Compressor.h.

Referenced by PopulateOrExchange(), and UpdateUI().

◆ mThresholdSlider

wxSlider* EffectCompressor::mThresholdSlider
private

◆ mThresholdText

wxStaticText* EffectCompressor::mThresholdText
private

Definition at line 111 of file Compressor.h.

Referenced by PopulateOrExchange(), and UpdateUI().

◆ mUsePeak

bool EffectCompressor::mUsePeak
private

Definition at line 90 of file Compressor.h.

Referenced by DoCompression(), DoTransferDataFromWindow(), Follow(), and TransferDataToWindow().

◆ NoiseFloor

constexpr EffectParameter EffectCompressor::NoiseFloor
staticconstexprprivate
Initial value:
L"NoiseFloor", -40.0, -80.0, -20.0, 0.2 }

Definition at line 137 of file Compressor.h.

Referenced by DoTransferDataFromWindow(), Parameters(), PopulateOrExchange(), and TransferDataToWindow().

◆ Normalize

constexpr EffectParameter EffectCompressor::Normalize
staticconstexprprivate
Initial value:
L"Normalize", true, false, true, 1 }

Definition at line 145 of file Compressor.h.

Referenced by Parameters(), and PopulateOrExchange().

◆ Ratio

constexpr EffectParameter EffectCompressor::Ratio
staticconstexprprivate
Initial value:
L"Ratio", 2.0, 1.1, 10.0, 10 }

Definition at line 139 of file Compressor.h.

Referenced by DoTransferDataFromWindow(), Parameters(), PopulateOrExchange(), and TransferDataToWindow().

◆ ReleaseTime

constexpr EffectParameter EffectCompressor::ReleaseTime
staticconstexprprivate
Initial value:
L"ReleaseTime", 1.0, 1.0, 30.0, 10 }

Definition at line 143 of file Compressor.h.

Referenced by DoTransferDataFromWindow(), Parameters(), PopulateOrExchange(), and TransferDataToWindow().

◆ Symbol

const ComponentInterfaceSymbol EffectCompressor::Symbol { XO("Compressor") }
static

Definition at line 34 of file Compressor.h.

Referenced by GetSymbol().

◆ Threshold

constexpr EffectParameter EffectCompressor::Threshold
staticconstexprprivate
Initial value:
L"Threshold", -12.0, -60.0, -1.0, 1 }

Definition at line 135 of file Compressor.h.

Referenced by Parameters(), and PopulateOrExchange().

◆ UsePeak

constexpr EffectParameter EffectCompressor::UsePeak
staticconstexprprivate
Initial value:
L"UsePeak", false, false, true, 1 }

Definition at line 147 of file Compressor.h.

Referenced by Parameters(), and PopulateOrExchange().


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