Audacity  2.2.0
EffectCompressor Class Referencefinal

An Effect derived from EffectTwoPassSimpleMono. More...

#include <Compressor.h>

Inheritance diagram for EffectCompressor:
EffectTwoPassSimpleMono Effect

Public Member Functions

 EffectCompressor ()
 
virtual ~EffectCompressor ()
 
wxString GetSymbol () override
 
wxString GetDescription () override
 
wxString ManualPage () override
 
EffectType GetType () override
 
bool GetAutomationParameters (EffectAutomationParameters &parms) override
 
bool SetAutomationParameters (EffectAutomationParameters &parms) override
 
bool Startup () override
 
void PopulateOrExchange (ShuttleGui &S) override
 
bool TransferDataToWindow () override
 
bool TransferDataFromWindow () override
 
- Public Member Functions inherited from EffectTwoPassSimpleMono
bool Process () override
 
- Public Member Functions inherited from Effect
 Effect ()
 
virtual ~Effect ()
 
wxString GetPath () override
 
wxString GetSymbol () override
 
wxString GetName () override
 
wxString GetVendor () override
 
wxString GetVersion () override
 
wxString GetDescription () override
 
EffectType GetType () override
 
wxString GetFamily () override
 
bool IsInteractive () override
 
bool IsDefault () override
 
bool IsLegacy () override
 
bool SupportsRealtime () override
 
bool SupportsAutomation () override
 
bool SetHost (EffectHostInterface *host) override
 
unsigned GetAudioInCount () override
 
unsigned GetAudioOutCount () override
 
int GetMidiInCount () override
 
int GetMidiOutCount () override
 
sampleCount GetLatency () override
 
size_t GetTailSize () override
 
void SetSampleRate (double rate) override
 
size_t SetBlockSize (size_t maxBlockSize) override
 
bool IsReady () override
 
bool ProcessInitialize (sampleCount totalLen, ChannelNames chanMap=NULL) override
 
bool ProcessFinalize () override
 
size_t ProcessBlock (float **inBlock, float **outBlock, size_t blockLen) override
 
bool RealtimeInitialize () override
 
bool RealtimeAddProcessor (unsigned numChannels, float sampleRate) override
 
bool RealtimeFinalize () override
 
bool RealtimeSuspend () override
 
bool RealtimeResume () override
 
bool RealtimeProcessStart () override
 
size_t RealtimeProcess (int group, float **inbuf, float **outbuf, size_t numSamples) override
 
bool RealtimeProcessEnd () override
 
bool ShowInterface (wxWindow *parent, bool forceModal=false) override
 
bool GetAutomationParameters (EffectAutomationParameters &parms) override
 
bool SetAutomationParameters (EffectAutomationParameters &parms) override
 
bool LoadUserPreset (const wxString &name) override
 
bool SaveUserPreset (const wxString &name) override
 
wxArrayString GetFactoryPresets () override
 
bool LoadFactoryPreset (int id) override
 
bool LoadFactoryDefaults () override
 
void SetHostUI (EffectUIHostInterface *host) override
 
bool PopulateUI (wxWindow *parent) override
 
bool IsGraphicalUI () override
 
bool ValidateUI () override
 
bool HideUI () override
 
bool CloseUI () override
 
bool CanExportPresets () override
 
void ExportPresets () override
 
void ImportPresets () override
 
bool HasOptions () override
 
void ShowOptions () override
 
double GetDefaultDuration () override
 
double GetDuration () override
 
wxString GetDurationFormat () override
 
virtual wxString GetSelectionFormat ()
 
void SetDuration (double duration) override
 
bool Apply () override
 
void Preview () override
 
wxDialog * CreateUI (wxWindow *parent, EffectUIClientInterface *client) override
 
wxString GetUserPresetsGroup (const wxString &name) override
 
wxString GetCurrentSettingsGroup () override
 
wxString GetFactoryDefaultsGroup () override
 
virtual wxString GetSavedStateGroup ()
 
bool HasSharedConfigGroup (const wxString &group) override
 
bool GetSharedConfigSubgroups (const wxString &group, wxArrayString &subgroups) override
 
bool GetSharedConfig (const wxString &group, const wxString &key, wxString &value, const wxString &defval=wxEmptyString) override
 
bool GetSharedConfig (const wxString &group, const wxString &key, int &value, int defval=0) override
 
bool GetSharedConfig (const wxString &group, const wxString &key, bool &value, bool defval=false) override
 
bool GetSharedConfig (const wxString &group, const wxString &key, float &value, float defval=0.0) override
 
bool GetSharedConfig (const wxString &group, const wxString &key, double &value, double defval=0.0) override
 
bool SetSharedConfig (const wxString &group, const wxString &key, const wxString &value) override
 
bool SetSharedConfig (const wxString &group, const wxString &key, const int &value) override
 
bool SetSharedConfig (const wxString &group, const wxString &key, const bool &value) override
 
bool SetSharedConfig (const wxString &group, const wxString &key, const float &value) override
 
bool SetSharedConfig (const wxString &group, const wxString &key, const double &value) override
 
bool RemoveSharedConfigSubgroup (const wxString &group) override
 
bool RemoveSharedConfig (const wxString &group, const wxString &key) override
 
bool HasPrivateConfigGroup (const wxString &group) override
 
bool GetPrivateConfigSubgroups (const wxString &group, wxArrayString &subgroups) override
 
bool GetPrivateConfig (const wxString &group, const wxString &key, wxString &value, const wxString &defval=wxEmptyString) override
 
bool GetPrivateConfig (const wxString &group, const wxString &key, int &value, int defval=0) override
 
bool GetPrivateConfig (const wxString &group, const wxString &key, bool &value, bool defval=false) override
 
bool GetPrivateConfig (const wxString &group, const wxString &key, float &value, float defval=0.0) override
 
bool GetPrivateConfig (const wxString &group, const wxString &key, double &value, double defval=0.0) override
 
bool SetPrivateConfig (const wxString &group, const wxString &key, const wxString &value) override
 
bool SetPrivateConfig (const wxString &group, const wxString &key, const int &value) override
 
bool SetPrivateConfig (const wxString &group, const wxString &key, const bool &value) override
 
bool SetPrivateConfig (const wxString &group, const wxString &key, const float &value) override
 
bool SetPrivateConfig (const wxString &group, const wxString &key, const double &value) override
 
bool RemovePrivateConfigSubgroup (const wxString &group) override
 
bool RemovePrivateConfig (const wxString &group, const wxString &key) override
 
virtual PluginID GetID ()
 
virtual bool Startup (EffectClientInterface *client)
 
virtual bool GetAutomationParameters (wxString &parms)
 
virtual bool SetAutomationParameters (const wxString &parms)
 
virtual wxArrayString GetUserPresets ()
 
virtual bool HasCurrentSettings ()
 
virtual bool HasFactoryDefaults ()
 
virtual wxString GetPreset (wxWindow *parent, const wxString &parms)
 
virtual wxString HelpPage ()
 
virtual bool IsBatchProcessing ()
 
virtual void SetBatchProcessing (bool start)
 
void SetPresetParameters (const wxArrayString *Names, const wxArrayString *Values)
 
bool DoEffect (wxWindow *parent, double projectRate, TrackList *list, TrackFactory *factory, SelectedRegion *selectedRegion, bool shouldPrompt=true)
 
bool Delegate (Effect &delegate, wxWindow *parent, SelectedRegion *selectedRegion, bool shouldPrompt)
 
bool RealtimeAddProcessor (int group, unsigned chans, float rate)
 
size_t RealtimeProcess (int group, unsigned chans, float **inbuf, float **outbuf, size_t numSamples)
 
bool IsRealtimeActive ()
 
virtual bool IsHidden ()
 
int MessageBox (const wxString &message, long style=DefaultMessageBoxStyle, const wxString &titleStr=wxString{})
 

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
bool InitPass1 () override
 
bool InitPass2 () override
 
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
virtual bool Init ()
 
virtual bool PromptUser (wxWindow *parent)
 
virtual bool CheckWhetherSkipEffect ()
 
virtual int GetPass ()
 
virtual void End ()
 
virtual double CalcPreviewInputLength (double previewLength)
 
virtual void Preview (bool dryOnly)
 
virtual bool EnableApply (bool enable=true)
 
virtual bool EnablePreview (bool enable=true)
 
virtual void EnableDebug (bool enable=true)
 
bool TotalProgress (double frac)
 
bool TrackProgress (int whichTrack, double frac, const wxString &=wxEmptyString)
 
bool TrackGroupProgress (int whichGroup, double frac, const wxString &=wxEmptyString)
 
int GetNumWaveTracks ()
 
int GetNumWaveGroups ()
 
void GetSamples (const WaveTrack *track, sampleCount *start, sampleCount *len)
 
void SetLinearEffectFlag (bool linearEffectFlag)
 
void SetPreviewFullSelectionFlag (bool previewDurationFlag)
 
bool IsPreviewing ()
 
void IncludeNotSelectedPreviewTracks (bool includeNotSelected)
 
void CopyInputTracks ()
 
void CopyInputTracks (int trackType)
 
std::shared_ptr
< AddedAnalysisTrack
AddAnalysisTrack (const wxString &name=wxString())
 
ModifiedAnalysisTrack ModifyAnalysisTrack (const LabelTrack *pOrigTrack, const wxString &name=wxString())
 
void ReplaceProcessedTracks (const bool bGoodResult)
 
TrackAddToOutputTracks (std::unique_ptr< Track > &&t)
 
TrackListinputTracks () 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 ()
 

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
 

Additional Inherited Members

- Public Types inherited from Effect
enum  : long { DefaultMessageBoxStyle = wxOK | wxCENTRE }
 
- Protected Attributes inherited from EffectTwoPassSimpleMono
int mCurTrackNum
 
double mCurRate
 
double mCurT0
 
double mCurT1
 
int mCurChannel
 
int mPass
 
bool mSecondPassDisabled
 
- Protected Attributes inherited from Effect
ProgressDialogmProgress
 
double mProjectRate
 
double mSampleRate
 
TrackFactorymFactory
 
std::shared_ptr< TrackListmOutputTracks
 
double mT0
 
double mT1
 
double mF0
 
double mF1
 
wxArrayString mPresetNames
 
wxArrayString mPresetValues
 
int mPass
 
wxDialog * mUIDialog
 
wxWindow * mUIParent
 
int mUIResultID
 
sampleCount mSampleCnt
 
int mOutputTracksType
 

Detailed Description

An Effect derived from EffectTwoPassSimpleMono.

Constructor & Destructor Documentation

EffectCompressor::EffectCompressor ( )
EffectCompressor::~EffectCompressor ( )
virtual

Member Function Documentation

float EffectCompressor::AvgCircle ( float  x)
private

References mCircle, mCirclePos, mCircleSize, and mRMSSum.

Referenced by Follow().

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

References mCompression, mMax, mThreshold, and mUsePeak.

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

References mCircle, mCircleSize, and mRMSSum.

Referenced by Follow().

bool EffectCompressor::GetAutomationParameters ( EffectAutomationParameters &  parms)
override
wxString EffectCompressor::GetDescription ( )
override

References XO.

wxString EffectCompressor::GetSymbol ( )
override
EffectType EffectCompressor::GetType ( )
override
bool EffectCompressor::InitPass2 ( )
overrideprotectedvirtual

Reimplemented from Effect.

References mNormalize.

wxString EffectCompressor::ManualPage ( )
overridevirtual

Reimplemented from Effect.

void EffectCompressor::OnSlider ( wxCommandEvent &  evt)
private
bool EffectCompressor::ProcessPass2 ( float *  buffer,
size_t  len 
)
overrideprotected

References mMax.

bool EffectCompressor::SetAutomationParameters ( EffectAutomationParameters &  parms)
override
bool EffectCompressor::Startup ( )
overridevirtual
bool EffectCompressor::TransferDataFromWindow ( )
overridevirtual
bool EffectCompressor::TransferDataToWindow ( )
overridevirtual
bool EffectCompressor::TwoBufferProcessPass1 ( float *  buffer1,
size_t  len1,
float *  buffer2,
size_t  len2 
)
overrideprotected

Member Data Documentation

double EffectCompressor::mAttackFactor
private

Referenced by Follow(), and NewTrackPass1().

double EffectCompressor::mAttackInverseFactor
private

Referenced by Follow(), and NewTrackPass1().

wxStaticText* EffectCompressor::mAttackLabel
private

Referenced by PopulateOrExchange(), and UpdateUI().

wxSlider* EffectCompressor::mAttackSlider
private
wxStaticText* EffectCompressor::mAttackText
private

Referenced by PopulateOrExchange(), and UpdateUI().

Doubles EffectCompressor::mCircle
private
size_t EffectCompressor::mCirclePos
private

Referenced by AvgCircle(), and NewTrackPass1().

size_t EffectCompressor::mCircleSize
private
double EffectCompressor::mCompression
private

Referenced by DoCompression(), and NewTrackPass1().

double EffectCompressor::mDecayFactor
private

Referenced by Follow(), and NewTrackPass1().

wxStaticText* EffectCompressor::mDecayLabel
private

Referenced by PopulateOrExchange(), and UpdateUI().

wxSlider* EffectCompressor::mDecaySlider
private
wxStaticText* EffectCompressor::mDecayText
private

Referenced by PopulateOrExchange(), and UpdateUI().

Floats EffectCompressor::mFollow1
private

Referenced by InitPass1().

Floats EffectCompressor::mFollow2
private

Referenced by InitPass1().

size_t EffectCompressor::mFollowLen
private

Referenced by InitPass1().

double EffectCompressor::mGain
private
wxCheckBox* EffectCompressor::mGainCheckBox
private
double EffectCompressor::mLastLevel
private

Referenced by Follow(), and NewTrackPass1().

double EffectCompressor::mMax
private
int EffectCompressor::mNoiseCounter
private

Referenced by Follow(), and NewTrackPass1().

double EffectCompressor::mNoiseFloor
private

Referenced by Follow(), and NewTrackPass1().

wxStaticText* EffectCompressor::mNoiseFloorLabel
private

Referenced by PopulateOrExchange(), and UpdateUI().

wxSlider* EffectCompressor::mNoiseFloorSlider
private
wxStaticText* EffectCompressor::mNoiseFloorText
private

Referenced by PopulateOrExchange(), and UpdateUI().

EffectCompressorPanel* EffectCompressor::mPanel
private

Referenced by PopulateOrExchange(), and UpdateUI().

wxCheckBox* EffectCompressor::mPeakCheckBox
private
wxStaticText* EffectCompressor::mRatioLabel
private

Referenced by PopulateOrExchange(), and UpdateUI().

wxSlider* EffectCompressor::mRatioSlider
private
wxStaticText* EffectCompressor::mRatioText
private

Referenced by PopulateOrExchange(), and UpdateUI().

double EffectCompressor::mRMSSum
private
double EffectCompressor::mThreshold
private
wxStaticText* EffectCompressor::mThresholdLabel
private

Referenced by PopulateOrExchange(), and UpdateUI().

wxSlider* EffectCompressor::mThresholdSlider
private
wxStaticText* EffectCompressor::mThresholdText
private

Referenced by PopulateOrExchange(), and UpdateUI().


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