Audacity  3.0.3
Normalize.h
Go to the documentation of this file.
1 /**********************************************************************
2 
3  Audacity: A Digital Audio Editor
4 
5  Normalize.h
6 
7  Dominic Mazzoni
8  Vaughan Johnson (Preview)
9 
10 **********************************************************************/
11 
12 #ifndef __AUDACITY_EFFECT_NORMALIZE__
13 #define __AUDACITY_EFFECT_NORMALIZE__
14 
15 #include "Effect.h"
16 #include "Biquad.h"
17 
18 class wxCheckBox;
19 class wxStaticText;
20 class wxTextCtrl;
21 class ShuttleGui;
22 
23 class EffectNormalize final : public Effect
24 {
25 public:
27 
29  virtual ~EffectNormalize();
30 
31  // ComponentInterface implementation
32 
35  ManualPageID ManualPage() override;
36 
37  // EffectDefinitionInterface implementation
38 
39  EffectType GetType() override;
40 
41  // EffectClientInterface implementation
42 
43  bool DefineParams( ShuttleParams & S ) override;
44  bool GetAutomationParameters(CommandParameters & parms) override;
45  bool SetAutomationParameters(CommandParameters & parms) override;
46 
47  // Effect implementation
48 
49  bool CheckWhetherSkipEffect() override;
50  bool Startup() override;
51  bool Process() override;
52  void PopulateOrExchange(ShuttleGui & S) override;
53  bool TransferDataToWindow() override;
54  bool TransferDataFromWindow() override;
55 
56 private:
57  // EffectNormalize implementation
58 
59  bool ProcessOne(
60  WaveTrack * t, const TranslatableString &msg, double& progress, float offset);
61  bool AnalyseTrack(const WaveTrack * track, const TranslatableString &msg,
62  double &progress, float &offset, float &extent);
63  bool AnalyseTrackData(const WaveTrack * track, const TranslatableString &msg, double &progress,
64  float &offset);
65  void AnalyseDataDC(float *buffer, size_t len);
66  void ProcessData(float *buffer, size_t len, float offset);
67 
68  void OnUpdateUI(wxCommandEvent & evt);
69  void UpdateUI();
70 
71 private:
72  double mPeakLevel;
73  bool mGain;
74  bool mDC;
75  bool mStereoInd;
76 
77  double mCurT0;
78  double mCurT1;
79  float mMult;
80  double mSum;
81 
82  wxCheckBox *mGainCheckBox;
83  wxCheckBox *mDCCheckBox;
84  wxTextCtrl *mLevelTextCtrl;
85  wxStaticText *mLeveldB;
86  wxStaticText *mWarning;
87  wxCheckBox *mStereoIndCheckBox;
88  bool mCreating;
89 
90 
91  DECLARE_EVENT_TABLE()
92 };
93 
94 #endif
EffectNormalize::SetAutomationParameters
bool SetAutomationParameters(CommandParameters &parms) override
Definition: Normalize.cpp:112
EffectNormalize::mStereoInd
bool mStereoInd
Definition: Normalize.h:75
TranslatableString
Holds a msgid for the translation catalog; may also bind format arguments.
Definition: TranslatableString.h:32
EffectNormalize::UpdateUI
void UpdateUI()
Definition: Normalize.cpp:542
EffectNormalize::ProcessOne
bool ProcessOne(WaveTrack *t, const TranslatableString &msg, double &progress, float offset)
Definition: Normalize.cpp:468
CommandParameters
CommandParameters, derived from wxFileConfig, is essentially doing the same things as the Shuttle cla...
Definition: EffectAutomationParameters.h:67
WaveTrack
A Track that contains audio waveform data.
Definition: WaveTrack.h:69
Effect.h
EffectNormalize::GetAutomationParameters
bool GetAutomationParameters(CommandParameters &parms) override
Definition: Normalize.cpp:102
Biquad.h
Effect
Base class for many of the effects in Audacity.
Definition: Effect.h:72
EffectNormalize::mLevelTextCtrl
wxTextCtrl * mLevelTextCtrl
Definition: Normalize.h:84
EffectNormalize::Startup
bool Startup() override
Definition: Normalize.cpp:134
EffectNormalize::GetSymbol
ComponentInterfaceSymbol GetSymbol() override
Definition: Normalize.cpp:71
EffectNormalize::TransferDataFromWindow
bool TransferDataFromWindow() override
Definition: Normalize.cpp:352
ShuttleParams
Shuttle that deals with parameters. This is a base class with lots of virtual functions that do nothi...
Definition: Shuttle.h:62
EffectNormalize::Symbol
static const ComponentInterfaceSymbol Symbol
Definition: Normalize.h:26
EffectNormalize::ProcessData
void ProcessData(float *buffer, size_t len, float offset)
Definition: Normalize.cpp:529
EffectNormalize::mGainCheckBox
wxCheckBox * mGainCheckBox
Definition: Normalize.h:82
EffectNormalize::OnUpdateUI
void OnUpdateUI(wxCommandEvent &evt)
Definition: Normalize.cpp:537
ComponentInterfaceSymbol
ComponentInterfaceSymbol pairs a persistent string identifier used internally with an optional,...
Definition: ComponentInterfaceSymbol.h:27
EffectNormalize::mPeakLevel
double mPeakLevel
Definition: Normalize.h:72
EffectNormalize::mCurT0
double mCurT0
Definition: Normalize.h:77
EffectNormalize::GetDescription
TranslatableString GetDescription() override
Definition: Normalize.cpp:76
EffectNormalize::AnalyseTrackData
bool AnalyseTrackData(const WaveTrack *track, const TranslatableString &msg, double &progress, float &offset)
Definition: Normalize.cpp:403
EffectNormalize::GetType
EffectType GetType() override
Definition: Normalize.cpp:88
EffectNormalize::mSum
double mSum
Definition: Normalize.h:80
EffectNormalize::mWarning
wxStaticText * mWarning
Definition: Normalize.h:86
EffectNormalize::PopulateOrExchange
void PopulateOrExchange(ShuttleGui &S) override
Definition: Normalize.cpp:288
EffectNormalize::mMult
float mMult
Definition: Normalize.h:79
EffectNormalize::EffectNormalize
EffectNormalize()
Definition: Normalize.cpp:55
EffectNormalize::AnalyseTrack
bool AnalyseTrack(const WaveTrack *track, const TranslatableString &msg, double &progress, float &offset, float &extent)
Definition: Normalize.cpp:364
EffectNormalize::mGain
bool mGain
Definition: Normalize.h:73
EffectNormalize::AnalyseDataDC
void AnalyseDataDC(float *buffer, size_t len)
Definition: Normalize.cpp:523
EffectNormalize::Process
bool Process() override
Definition: Normalize.cpp:169
EffectNormalize::mDC
bool mDC
Definition: Normalize.h:74
EffectNormalize::mLeveldB
wxStaticText * mLeveldB
Definition: Normalize.h:85
TaggedIdentifier< ManualPageIDTag >
EffectNormalize::TransferDataToWindow
bool TransferDataToWindow() override
Definition: Normalize.cpp:340
EffectNormalize::~EffectNormalize
virtual ~EffectNormalize()
Definition: Normalize.cpp:65
EffectNormalize::mCurT1
double mCurT1
Definition: Normalize.h:78
EffectNormalize
An Effect to bring the peak level up to a chosen level.
Definition: Normalize.h:24
EffectType
EffectType
Definition: EffectInterface.h:55
EffectNormalize::CheckWhetherSkipEffect
bool CheckWhetherSkipEffect() override
Definition: Normalize.cpp:129
EffectNormalize::mCreating
bool mCreating
Definition: Normalize.h:88
EffectNormalize::DefineParams
bool DefineParams(ShuttleParams &S) override
Definition: Normalize.cpp:94
EffectNormalize::mDCCheckBox
wxCheckBox * mDCCheckBox
Definition: Normalize.h:83
EffectNormalize::mStereoIndCheckBox
wxCheckBox * mStereoIndCheckBox
Definition: Normalize.h:87
EffectNormalize::ManualPage
ManualPageID ManualPage() override
Definition: Normalize.cpp:81
ShuttleGui
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.
Definition: ShuttleGui.h:631