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, const EffectOutputs *pOutputs) 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, EffectOutputs *pOutputs, unsigned numChannels, float sampleRate)
 
virtual bool RealtimeSuspend ()
 
virtual bool RealtimeResume ()
 
virtual bool RealtimeProcessStart (MessagePackage &package)
 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
 
virtual unsigned GetAudioInCount () const
 How many input buffers to allocate at once. More...
 
virtual unsigned GetAudioOutCount () const
 How many output buffers to allocate at once. More...
 
virtual sampleCount GetLatency () 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...
 
OptionalMessage LoadUserPreset (const RegistryPath &name, EffectSettings &settings) const override
 
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...
 
OptionalMessage LoadFactoryPreset (int id, EffectSettings &settings) const override
 
OptionalMessage LoadFactoryDefaults (EffectSettings &settings) const override
 
virtual const EffectParameterMethodsParameters () const
 
int ShowClientInterface (wxWindow &parent, wxDialog &dialog, EffectUIValidator *pValidator, bool forceModal) override
 
EffectUIClientInterfaceGetEffectUIClientInterface () override
 Returns the EffectUIClientInterface instance for this effect. More...
 
std::unique_ptr< EffectUIValidatorPopulateUI (ShuttleGui &S, EffectInstance &instance, EffectSettingsAccess &access, const EffectOutputs *pOutputs) 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
 
OptionalMessage 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
 
OptionalMessage 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
 
void SetTracks (TrackList *pTracks)
 
- Public Member Functions inherited from EffectUIClientInterface
virtual ~EffectUIClientInterface ()
 
virtual int ShowClientInterface (wxWindow &parent, wxDialog &dialog, EffectUIValidator *pValidator, bool forceModal=false)=0
 
virtual bool IsGraphicalUI ()=0
 
virtual std::unique_ptr< EffectUIValidatorPopulateUI (ShuttleGui &S, EffectInstance &instance, EffectSettingsAccess &access, const EffectOutputs *pOutputs)=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 OptionalMessage ImportPresets (EffectSettings &settings)=0
 
virtual bool HasOptions ()=0
 
virtual void ShowOptions ()=0
 
virtual bool ValidateUI (EffectSettings &settings)=0
 
virtual bool CloseUI ()=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 EffectUIClientInterfaceGetEffectUIClientInterface ()=0
 Returns the EffectUIClientInterface instance for this effect. More...
 
virtual void Preview (EffectSettingsAccess &access, bool dryOnly)=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, 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...
 
- 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 std::unique_ptr< EffectOutputsMakeOutputs () 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 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, const EffectOutputs *pOutputs)
 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
 

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 StatefulEffectBase
using MessagePackage = EffectInstance::MessagePackage
 
- 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 }
 
- 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:222
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 439 of file Compressor.cpp.

440{
441 float level;
442
443 // Calculate current level from root-mean-squared of
444 // circular buffer ("RMS")
446 mCircle[mCirclePos] = value*value;
448 level = sqrt(mRMSSum/mCircleSize);
450
451 return level;
452}
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 567 of file Compressor.cpp.

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

References mCompression, mMax, mThreshold, and mUsePeak.

Referenced by TwoBufferProcessPass1().

Here is the caller graph for this function:

◆ DoTransferDataFromWindow()

bool EffectCompressor::DoTransferDataFromWindow ( )

Definition at line 303 of file Compressor.cpp.

304{
305 // To do: eliminate this by using control validators instead
306 mThresholdDB = (double) mThresholdSlider->GetValue();
307 mNoiseFloorDB = (double) mNoiseFloorSlider->GetValue() / NoiseFloor.scale;
308 mRatio = (double) mRatioSlider->GetValue() / Ratio.scale;
309 mAttackTime = (double) mAttackSlider->GetValue() / 100.0; //AttackTime.scale;
310 mDecayTime = (double) mDecaySlider->GetValue() / ReleaseTime.scale;
311 mNormalize = mGainCheckBox->GetValue();
312 mUsePeak = mPeakCheckBox->GetValue();
313
314 return true;
315}
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 454 of file Compressor.cpp.

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

431{
432 // Recompute the RMS sum periodically to prevent accumulation of rounding errors
433 // during long waveforms
434 mRMSSum = 0;
435 for(size_t i=0; i<mCircleSize; i++)
436 mRMSSum += mCircle[i];
437}

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 344 of file Compressor.cpp.

345{
346 mMax=0.0;
347 if (!mNormalize)
349
350 // Find the maximum block length required for any track
351 size_t maxlen = inputTracks()->Selected< const WaveTrack >().max(
353 );
354 mFollow1.reset();
355 mFollow2.reset();
356 // Allocate buffers for the envelope
357 if(maxlen > 0) {
358 mFollow1.reinit(maxlen);
359 mFollow2.reinit(maxlen);
360 }
361 mFollowLen = maxlen;
362
363 return true;
364}
void reinit(Integral count, bool initialize=false)
Definition: MemoryX.h:57
const TrackList * inputTracks() const
Definition: EffectBase.h:104
auto Selected() -> TrackIterRange< TrackType >
Definition: Track.h:1454
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:1816

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 366 of file Compressor.cpp.

367{
368 // Actually, this should not even be called, because we call
369 // DisableSecondPass() before, if mNormalize is false.
370 return mNormalize;
371}

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 319 of file Compressor.cpp.

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

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 585 of file Compressor.cpp.

586{
588 UpdateUI();
589}
bool DoTransferDataFromWindow()
Definition: Compressor.cpp:303

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,
const EffectOutputs pOutputs 
)
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.

162{
163 S.SetBorder(5);
164
165 S.StartHorizontalLay(wxEXPAND, true);
166 {
167 S.SetBorder(10);
168 mPanel = safenew EffectCompressorPanel(S.GetParent(), wxID_ANY,
171 mRatio);
172 S.Prop(true)
173 .Position(wxEXPAND | wxALL)
174 .MinSize( { 400, 200 } )
175 .AddWindow(mPanel);
176 S.SetBorder(5);
177 }
178 S.EndHorizontalLay();
179
180 S.StartStatic( {} );
181 {
182 S.StartMultiColumn(3, wxEXPAND);
183 {
184 S.SetStretchyCol(1);
185 mThresholdLabel = S.AddVariableText(XO("&Threshold:"), true,
186 wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
188 .Name(XO("Threshold"))
189 .Style(wxSL_HORIZONTAL)
190 .AddSlider( {},
194 mThresholdText = S.AddVariableText(ThresholdFormat(999), true,
195 wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL);
196
197 mNoiseFloorLabel = S.AddVariableText(XO("&Noise Floor:"), true,
198 wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
200 .Name(XO("Noise Floor"))
201 .Style(wxSL_HORIZONTAL)
202 .AddSlider( {},
206 mNoiseFloorText = S.AddVariableText(ThresholdFormat(999),
207 true, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL);
208
209 mRatioLabel = S.AddVariableText(XO("&Ratio:"), true,
210 wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
212 .Name(XO("Ratio"))
213 .Style(wxSL_HORIZONTAL)
214 .AddSlider( {},
217 Ratio.min * Ratio.scale);
218 mRatioSlider->SetPageSize(5);
219 mRatioText = S.AddVariableText(RatioTextFormat( 1, 99.9 ), true,
220 wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL);
221
222 /* i18n-hint: Particularly in percussion, sounds can be regarded as having
223 * an 'attack' phase where the sound builds up and a 'decay' where the
224 * sound dies away. So this means 'onset duration'. */
225 mAttackLabel = S.AddVariableText(XO("&Attack Time:"), true,
226 wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
228 /* i18n-hint: Particularly in percussion, sounds can be regarded as having
229 * an 'attack' phase where the sound builds up and a 'decay' where the
230 * sound dies away. So this means 'onset duration'. */
231 .Name(XO("Attack Time"))
232 .Style(wxSL_HORIZONTAL)
233 .AddSlider( {},
237 mAttackText = S.AddVariableText(
238 AttackTimeFormat(9.99),
239 true, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL);
240
241 /* i18n-hint: Particularly in percussion, sounds can be regarded as having
242 * an 'attack' phase where the sound builds up and a 'decay' or 'release' where the
243 * sound dies away. */
244 mDecayLabel = S.AddVariableText(XO("R&elease Time:"), true,
245 wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
247 /* i18n-hint: Particularly in percussion, sounds can be regarded as having
248 * an 'attack' phase where the sound builds up and a 'decay' or 'release' where the
249 * sound dies away. */
250 .Name(XO("Release Time"))
251 .Style(wxSL_HORIZONTAL)
252 .AddSlider( {},
256
257 mDecayText = S.AddVariableText(
258 DecayTimeFormat(99.9),
259 true, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL);
260 }
261 S.EndMultiColumn();
262 }
263 S.EndStatic();
264
265 S.StartHorizontalLay(wxCENTER, false);
266 {
267 /* i18n-hint: Make-up, i.e. correct for any reduction, rather than fabricate it.*/
268 mGainCheckBox = S.AddCheckBox(XXO("Ma&ke-up gain for 0 dB after compressing"),
269 Normalize.def);
270 /* i18n-hint: "Compress" here means reduce variations of sound volume,
271 NOT related to file-size compression; Peaks means extremes in volume */
272 mPeakCheckBox = S.AddCheckBox(XXO("C&ompress based on Peaks"),
273 UsePeak.def);
274 }
275 S.EndHorizontalLay();
276 return nullptr;
277}
@ 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 419 of file Compressor.cpp.

420{
421 if (mMax != 0)
422 {
423 for (size_t i = 0; i < len; i++)
424 buffer[i] /= mMax;
425 }
426
427 return true;
428}

References mMax.

◆ TransferDataFromWindow()

bool EffectCompressor::TransferDataFromWindow ( EffectSettings settings)
overridevirtual

Update the given settings from controls.

Implements EffectPlugin.

Definition at line 294 of file Compressor.cpp.

295{
296 if (!mUIParent->Validate())
297 {
298 return false;
299 }
301}
wxWindow * mUIParent
Definition: Effect.h:307

References DoTransferDataFromWindow(), and Effect::mUIParent.

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 279 of file Compressor.cpp.

280{
283 mRatioSlider->SetValue(lrint(mRatio * Ratio.scale));
286 mGainCheckBox->SetValue(mNormalize);
287 mPeakCheckBox->SetValue(mUsePeak);
288
289 UpdateUI();
290
291 return true;
292}
#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 376 of file Compressor.cpp.

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

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 591 of file Compressor.cpp.

592{
593 mThresholdLabel->SetName(wxString::Format(_("Threshold %d dB"), (int) mThresholdDB));
594 mThresholdText->SetLabel(ThresholdFormat((int) mThresholdDB).Translation());
595 mThresholdText->SetName(mThresholdText->GetLabel()); // fix for bug 577 (NVDA/Narrator screen readers do not read static text in dialogs)
596
597 mNoiseFloorLabel->SetName(wxString::Format(_("Noise Floor %d dB"), (int) mNoiseFloorDB));
598 mNoiseFloorText->SetLabel(ThresholdFormat((int) mNoiseFloorDB).Translation());
599 mNoiseFloorText->SetName(mNoiseFloorText->GetLabel()); // fix for bug 577 (NVDA/Narrator screen readers do not read static text in dialogs)
600
601 mRatioLabel->SetName(
603 mRatioText->SetLabel(
605 mRatioText->SetName(mRatioText->GetLabel()); // fix for bug 577 (NVDA/Narrator screen readers do not read static text in dialogs)
606
607 mAttackLabel->SetName(wxString::Format(_("Attack Time %.2f secs"), mAttackTime));
608 mAttackText->SetLabel(AttackTimeFormat(mAttackTime).Translation());
609 mAttackText->SetName(mAttackText->GetLabel()); // fix for bug 577 (NVDA/Narrator screen readers do not read static text in dialogs)
610
611 mDecayLabel->SetName(wxString::Format(_("Release Time %.1f secs"), mDecayTime));
612 mDecayText->SetLabel(DecayTimeFormat(mDecayTime).Translation());
613 mDecayText->SetName(mDecayText->GetLabel()); // fix for bug 577 (NVDA/Narrator screen readers do not read static text in dialogs)
614
615 mPanel->Refresh(false);
616
617 return;
618}
#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: