Audacity  3.0.3
Normalize.cpp
Go to the documentation of this file.
1 /**********************************************************************
2 
3  Audacity: A Digital Audio Editor
4 
5  Normalize.cpp
6 
7  Dominic Mazzoni
8  Vaughan Johnson (Preview)
9 
10 *******************************************************************//*******************************************************************/
16 
17 
18 
19 #include "Normalize.h"
20 #include "LoadEffects.h"
21 
22 #include <math.h>
23 
24 #include <wx/checkbox.h>
25 #include <wx/intl.h>
26 #include <wx/stattext.h>
27 #include <wx/valgen.h>
28 
29 #include "../Prefs.h"
30 #include "../ProjectFileManager.h"
31 #include "../Shuttle.h"
32 #include "../ShuttleGui.h"
33 #include "../WaveTrack.h"
34 #include "../widgets/valnum.h"
35 #include "../widgets/ProgressDialog.h"
36 
37 // Define keys, defaults, minimums, and maximums for the effect parameters
38 //
39 // Name Type Key Def Min Max Scale
40 Param( PeakLevel, double, wxT("PeakLevel"), -1.0, -145.0, 0.0, 1 );
41 Param( RemoveDC, bool, wxT("RemoveDcOffset"), true, false, true, 1 );
42 Param( ApplyGain, bool, wxT("ApplyGain"), true, false, true, 1 );
43 Param( StereoInd, bool, wxT("StereoIndependent"), false, false, true, 1 );
44 
46 { XO("Normalize") };
47 
49 
50 BEGIN_EVENT_TABLE(EffectNormalize, wxEvtHandler)
51  EVT_CHECKBOX(wxID_ANY, EffectNormalize::OnUpdateUI)
52  EVT_TEXT(wxID_ANY, EffectNormalize::OnUpdateUI)
54 
56 {
57  mPeakLevel = DEF_PeakLevel;
58  mDC = DEF_RemoveDC;
59  mGain = DEF_ApplyGain;
60  mStereoInd = DEF_StereoInd;
61 
62  SetLinearEffectFlag(false);
63 }
64 
66 {
67 }
68 
69 // ComponentInterface implementation
70 
72 {
73  return Symbol;
74 }
75 
77 {
78  return XO("Sets the peak amplitude of one or more tracks");
79 }
80 
82 {
83  return wxT("Normalize");
84 }
85 
86 // EffectDefinitionInterface implementation
87 
89 {
90  return EffectTypeProcess;
91 }
92 
93 // EffectClientInterface implementation
95  S.SHUTTLE_PARAM( mPeakLevel, PeakLevel );
96  S.SHUTTLE_PARAM( mGain, ApplyGain );
97  S.SHUTTLE_PARAM( mDC, RemoveDC );
98  S.SHUTTLE_PARAM( mStereoInd, StereoInd );
99  return true;
100 }
101 
103 {
104  parms.Write(KEY_PeakLevel, mPeakLevel);
105  parms.Write(KEY_ApplyGain, mGain);
106  parms.Write(KEY_RemoveDC, mDC);
107  parms.Write(KEY_StereoInd, mStereoInd);
108 
109  return true;
110 }
111 
113 {
114  ReadAndVerifyDouble(PeakLevel);
115  ReadAndVerifyBool(ApplyGain);
116  ReadAndVerifyBool(RemoveDC);
117  ReadAndVerifyBool(StereoInd);
118 
119  mPeakLevel = PeakLevel;
120  mGain = ApplyGain;
121  mDC = RemoveDC;
122  mStereoInd = StereoInd;
123 
124  return true;
125 }
126 
127 // Effect implementation
128 
130 {
131  return ((mGain == false) && (mDC == false));
132 }
133 
135 {
136  wxString base = wxT("/Effects/Normalize/");
137 
138  // Migrate settings from 2.1.0 or before
139 
140  // Already migrated, so bail
141  if (gPrefs->Exists(base + wxT("Migrated")))
142  {
143  return true;
144  }
145 
146  // Load the old "current" settings
147  if (gPrefs->Exists(base))
148  {
149  int boolProxy = gPrefs->Read(base + wxT("RemoveDcOffset"), 1);
150  mDC = (boolProxy == 1);
151  boolProxy = gPrefs->Read(base + wxT("Normalize"), 1);
152  mGain = (boolProxy == 1);
153  gPrefs->Read(base + wxT("Level"), &mPeakLevel, -1.0);
154  if(mPeakLevel > 0.0) // this should never happen
156  boolProxy = gPrefs->Read(base + wxT("StereoIndependent"), 0L);
157  mStereoInd = (boolProxy == 1);
158 
160 
161  // Do not migrate again
162  gPrefs->Write(base + wxT("Migrated"), true);
163  gPrefs->Flush();
164  }
165 
166  return true;
167 }
168 
170 {
171  if (mGain == false && mDC == false)
172  return true;
173 
174  float ratio;
175  if( mGain )
176  {
177  // same value used for all tracks
178  ratio = DB_TO_LINEAR(TrapDouble(mPeakLevel, MIN_PeakLevel, MAX_PeakLevel));
179  }
180  else {
181  ratio = 1.0;
182  }
183 
184  //Iterate over each track
185  this->CopyInputTracks(); // Set up mOutputTracks.
186  bool bGoodResult = true;
187  double progress = 0;
188  TranslatableString topMsg;
189  if(mDC && mGain)
190  topMsg = XO("Removing DC offset and Normalizing...\n");
191  else if(mDC && !mGain)
192  topMsg = XO("Removing DC offset...\n");
193  else if(!mDC && mGain)
194  topMsg = XO("Normalizing without removing DC offset...\n");
195  else if(!mDC && !mGain)
196  topMsg = XO("Not doing anything...\n"); // shouldn't get here
197 
198  for ( auto track : mOutputTracks->Selected< WaveTrack >()
199  + ( mStereoInd ? &Track::Any : &Track::IsLeader ) ) {
200  //Get start and end times from track
201  // PRL: No accounting for multiple channels?
202  double trackStart = track->GetStartTime();
203  double trackEnd = track->GetEndTime();
204 
205  //Set the current bounds to whichever left marker is
206  //greater and whichever right marker is less:
207  mCurT0 = mT0 < trackStart? trackStart: mT0;
208  mCurT1 = mT1 > trackEnd? trackEnd: mT1;
209 
210  auto range = mStereoInd
212  : TrackList::Channels(track);
213 
214  // Process only if the right marker is to the right of the left marker
215  if (mCurT1 > mCurT0) {
216  wxString trackName = track->GetName();
217 
218  float extent;
219  // Will compute a maximum
220  extent = std::numeric_limits<float>::lowest();
221  std::vector<float> offsets;
222 
223  auto msg = (range.size() == 1)
224  // mono or 'stereo tracks independently'
225  ? topMsg +
226  XO("Analyzing: %s").Format( trackName )
227  : topMsg +
228  // TODO: more-than-two-channels-message
229  XO("Analyzing first track of stereo pair: %s").Format( trackName );
230 
231  // Analysis loop over channels collects offsets and extent
232  for (auto channel : range) {
233  float offset = 0;
234  float extent2 = 0;
235  bGoodResult =
236  AnalyseTrack( channel, msg, progress, offset, extent2 );
237  if ( ! bGoodResult )
238  goto break2;
239  extent = std::max( extent, extent2 );
240  offsets.push_back(offset);
241  // TODO: more-than-two-channels-message
242  msg = topMsg +
243  XO("Analyzing second track of stereo pair: %s").Format( trackName );
244  }
245 
246  // Compute the multiplier using extent
247  if( (extent > 0) && mGain ) {
248  mMult = ratio / extent;
249  }
250  else
251  mMult = 1.0;
252 
253  if (range.size() == 1) {
254  if (TrackList::Channels(track).size() == 1)
255  // really mono
256  msg = topMsg +
257  XO("Processing: %s").Format( trackName );
258  else
259  //'stereo tracks independently'
260  // TODO: more-than-two-channels-message
261  msg = topMsg +
262  XO("Processing stereo channels independently: %s").Format( trackName );
263  }
264  else
265  msg = topMsg +
266  // TODO: more-than-two-channels-message
267  XO("Processing first track of stereo pair: %s").Format( trackName );
268 
269  // Use multiplier in the second, processing loop over channels
270  auto pOffset = offsets.begin();
271  for (auto channel : range) {
272  if (false ==
273  (bGoodResult = ProcessOne(channel, msg, progress, *pOffset++)) )
274  goto break2;
275  // TODO: more-than-two-channels-message
276  msg = topMsg +
277  XO("Processing second track of stereo pair: %s").Format( trackName );
278  }
279  }
280  }
281 
282  break2:
283 
284  this->ReplaceProcessedTracks(bGoodResult);
285  return bGoodResult;
286 }
287 
289 {
290  mCreating = true;
291 
292  S.StartVerticalLay(0);
293  {
294  S.StartMultiColumn(2, wxALIGN_CENTER);
295  {
296  S.StartVerticalLay(false);
297  {
298  mDCCheckBox = S.Validator<wxGenericValidator>(&mDC)
299  .AddCheckBox(XXO("&Remove DC offset (center on 0.0 vertically)"),
300  mDC);
301 
302  S.StartHorizontalLay(wxALIGN_LEFT, false);
303  {
304  mGainCheckBox = S
305  .MinSize()
306  .Validator<wxGenericValidator>(&mGain)
307  .AddCheckBox(XXO("&Normalize peak amplitude to "),
308  mGain);
309 
310  mLevelTextCtrl = S
311  .Name(XO("Peak amplitude dB"))
312  .Validator<FloatingPointValidator<double>>(
313  2,
314  &mPeakLevel,
315  NumValidatorStyle::ONE_TRAILING_ZERO,
316  MIN_PeakLevel,
317  MAX_PeakLevel
318  )
319  .AddTextBox( {}, wxT(""), 10);
320  mLeveldB = S.AddVariableText(XO("dB"), false,
321  wxALIGN_CENTER_VERTICAL | wxALIGN_LEFT);
322  mWarning = S.AddVariableText( {}, false,
323  wxALIGN_CENTER_VERTICAL | wxALIGN_LEFT);
324  }
325  S.EndHorizontalLay();
326 
328  .Validator<wxGenericValidator>(&mStereoInd)
329  .AddCheckBox(XXO("N&ormalize stereo channels independently"),
330  mStereoInd);
331  }
332  S.EndVerticalLay();
333  }
334  S.EndMultiColumn();
335  }
336  S.EndVerticalLay();
337  mCreating = false;
338 }
339 
341 {
342  if (!mUIParent->TransferDataToWindow())
343  {
344  return false;
345  }
346 
347  UpdateUI();
348 
349  return true;
350 }
351 
353 {
354  if (!mUIParent->Validate() || !mUIParent->TransferDataFromWindow())
355  {
356  return false;
357  }
358 
359  return true;
360 }
361 
362 // EffectNormalize implementation
363 
365  double &progress, float &offset, float &extent)
366 {
367  bool result = true;
368  float min, max;
369 
370  if(mGain)
371  {
372  // set mMin, mMax. No progress bar here as it's fast.
373  auto pair = track->GetMinMax(mCurT0, mCurT1); // may throw
374  min = pair.first, max = pair.second;
375 
376  if(mDC)
377  {
378  result = AnalyseTrackData(track, msg, progress, offset);
379  min += offset;
380  max += offset;
381  }
382  }
383  else if(mDC)
384  {
385  min = -1.0, max = 1.0; // sensible defaults?
386  result = AnalyseTrackData(track, msg, progress, offset);
387  min += offset;
388  max += offset;
389  }
390  else
391  {
392  wxFAIL_MSG("Analysing Track when nothing to do!");
393  min = -1.0, max = 1.0; // sensible defaults?
394  offset = 0.0;
395  }
396  extent = fmax(fabs(min), fabs(max));
397 
398  return result;
399 }
400 
401 //AnalyseTrackData() takes a track, transforms it to bunch of buffer-blocks,
402 //and executes selected AnalyseOperation on it...
404  double &progress, float &offset)
405 {
406  bool rc = true;
407 
408  //Transform the marker timepoints to samples
409  auto start = track->TimeToLongSamples(mCurT0);
410  auto end = track->TimeToLongSamples(mCurT1);
411 
412  //Get the length of the buffer (as double). len is
413  //used simply to calculate a progress meter, so it is easier
414  //to make it a double now than it is to do it later
415  auto len = (end - start).as_double();
416 
417  //Initiate a processing buffer. This buffer will (most likely)
418  //be shorter than the length of the track being processed.
419  Floats buffer{ track->GetMaxBlockSize() };
420 
421  mSum = 0.0; // dc offset inits
422 
423  sampleCount blockSamples;
424  sampleCount totalSamples = 0;
425 
426  //Go through the track one buffer at a time. s counts which
427  //sample the current buffer starts at.
428  auto s = start;
429  while (s < end) {
430  //Get a block of samples (smaller than the size of the buffer)
431  //Adjust the block size if it is the final block in the track
432  const auto block = limitSampleBufferSize(
433  track->GetBestBlockSize(s),
434  end - s
435  );
436 
437  //Get the samples from the track and put them in the buffer
438  track->Get((samplePtr) buffer.get(), floatSample, s, block, fillZero, true, &blockSamples);
439  totalSamples += blockSamples;
440 
441  //Process the buffer.
442  AnalyseDataDC(buffer.get(), block);
443 
444  //Increment s one blockfull of samples
445  s += block;
446 
447  //Update the Progress meter
448  if (TotalProgress(progress +
449  ((s - start).as_double() / len)/double(2*GetNumWaveTracks()), msg)) {
450  rc = false; //lda .. break, not return, so that buffer is deleted
451  break;
452  }
453  }
454  if( totalSamples > 0 )
455  offset = -mSum / totalSamples.as_double(); // calculate actual offset (amount that needs to be added on)
456  else
457  offset = 0.0;
458 
459  progress += 1.0/double(2*GetNumWaveTracks());
460  //Return true because the effect processing succeeded ... unless cancelled
461  return rc;
462 }
463 
464 //ProcessOne() takes a track, transforms it to bunch of buffer-blocks,
465 //and executes ProcessData, on it...
466 // uses mMult and offset to normalize a track.
467 // mMult must be set before this is called
469  WaveTrack * track, const TranslatableString &msg, double &progress, float offset)
470 {
471  bool rc = true;
472 
473  //Transform the marker timepoints to samples
474  auto start = track->TimeToLongSamples(mCurT0);
475  auto end = track->TimeToLongSamples(mCurT1);
476 
477  //Get the length of the buffer (as double). len is
478  //used simply to calculate a progress meter, so it is easier
479  //to make it a double now than it is to do it later
480  auto len = (end - start).as_double();
481 
482  //Initiate a processing buffer. This buffer will (most likely)
483  //be shorter than the length of the track being processed.
484  Floats buffer{ track->GetMaxBlockSize() };
485 
486  //Go through the track one buffer at a time. s counts which
487  //sample the current buffer starts at.
488  auto s = start;
489  while (s < end) {
490  //Get a block of samples (smaller than the size of the buffer)
491  //Adjust the block size if it is the final block in the track
492  const auto block = limitSampleBufferSize(
493  track->GetBestBlockSize(s),
494  end - s
495  );
496 
497  //Get the samples from the track and put them in the buffer
498  track->Get((samplePtr) buffer.get(), floatSample, s, block);
499 
500  //Process the buffer.
501  ProcessData(buffer.get(), block, offset);
502 
503  //Copy the newly-changed samples back onto the track.
504  track->Set((samplePtr) buffer.get(), floatSample, s, block);
505 
506  //Increment s one blockfull of samples
507  s += block;
508 
509  //Update the Progress meter
510  if (TotalProgress(progress +
511  ((s - start).as_double() / len)/double(2*GetNumWaveTracks()), msg)) {
512  rc = false; //lda .. break, not return, so that buffer is deleted
513  break;
514  }
515  }
516  progress += 1.0/double(2*GetNumWaveTracks());
517 
518  //Return true because the effect processing succeeded ... unless cancelled
519  return rc;
520 }
521 
523 void EffectNormalize::AnalyseDataDC(float *buffer, size_t len)
524 {
525  for(decltype(len) i = 0; i < len; i++)
526  mSum += (double)buffer[i];
527 }
528 
529 void EffectNormalize::ProcessData(float *buffer, size_t len, float offset)
530 {
531  for(decltype(len) i = 0; i < len; i++) {
532  float adjFrame = (buffer[i] + offset) * mMult;
533  buffer[i] = adjFrame;
534  }
535 }
536 
537 void EffectNormalize::OnUpdateUI(wxCommandEvent & WXUNUSED(evt))
538 {
539  UpdateUI();
540 }
541 
543 {
544 
545  if (!mUIParent->TransferDataFromWindow())
546  {
547  mWarning->SetLabel(_("(Maximum 0dB)"));
548  EnableApply(false);
549  return;
550  }
551  mWarning->SetLabel(wxT(""));
552 
553  // Disallow level stuff if not normalizing
554  mLevelTextCtrl->Enable(mGain);
555  mLeveldB->Enable(mGain);
556  mStereoIndCheckBox->Enable(mGain);
557 
558  // Disallow OK/Preview if doing nothing
559  EnableApply(mGain || mDC);
560 }
EffectNormalize::SetAutomationParameters
bool SetAutomationParameters(CommandParameters &parms) override
Definition: Normalize.cpp:112
Normalize.h
EffectNormalize::mStereoInd
bool mStereoInd
Definition: Normalize.h:75
TranslatableString
Definition: Types.h:290
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
ShuttleGuiBase::StartVerticalLay
void StartVerticalLay(int iProp=1)
Definition: ShuttleGui.cpp:1177
WaveTrack
A Track that contains audio waveform data.
Definition: WaveTrack.h:68
EffectTypeProcess
@ EffectTypeProcess
Definition: EffectInterface.h:59
DB_TO_LINEAR
const double MIN_Threshold_Linear DB_TO_LINEAR(MIN_Threshold_dB)
Effect::EnableApply
virtual bool EnableApply(bool enable=true)
Definition: Effect.cpp:1925
gPrefs
FileConfig * gPrefs
Definition: Prefs.cpp:67
EffectNormalize::GetAutomationParameters
bool GetAutomationParameters(CommandParameters &parms) override
Definition: Normalize.cpp:102
Effect::CopyInputTracks
void CopyInputTracks(bool allSyncLockSelected=false)
Definition: Effect.cpp:2070
EffectNormalize::mLevelTextCtrl
wxTextCtrl * mLevelTextCtrl
Definition: Normalize.h:84
TrackList::Channels
static auto Channels(TrackType *pTrack) -> TrackIterRange< TrackType >
Definition: Track.h:1467
Effect::mT1
double mT1
Definition: Effect.h:466
EffectNormalize::Startup
bool Startup() override
Definition: Normalize.cpp:134
Validator
A Validator is an object which checks whether a wxVariant satisfies a certain criterion....
Definition: Validators.h:53
EffectNormalize::GetSymbol
ComponentInterfaceSymbol GetSymbol() override
Definition: Normalize.cpp:71
EffectNormalize::TransferDataFromWindow
bool TransferDataFromWindow() override
Definition: Normalize.cpp:352
ShuttleGui::MinSize
ShuttleGui & MinSize()
Definition: ShuttleGui.h:740
XO
#define XO(s)
Definition: Internat.h:32
WaveTrack::GetMinMax
std::pair< float, float > GetMinMax(double t0, double t1, bool mayThrow=true) const
Definition: WaveTrack.cpp:1822
ShuttleParams
Shuttle that deals with parameters. This is a base class with lots of virtual functions that do nothi...
Definition: Shuttle.h:61
EffectNormalize::Symbol
static const ComponentInterfaceSymbol Symbol
Definition: Normalize.h:26
Track::Any
bool Any() const
Definition: Track.cpp:361
ShuttleGuiBase::EndMultiColumn
void EndMultiColumn()
Definition: ShuttleGui.cpp:1212
floatSample
@ floatSample
Definition: Types.h:722
EffectNormalize::ProcessData
void ProcessData(float *buffer, size_t len, float offset)
Definition: Normalize.cpp:529
Effect::SaveUserPreset
bool SaveUserPreset(const RegistryPath &name) override
Definition: Effect.cpp:569
EffectNormalize::mGainCheckBox
wxCheckBox * mGainCheckBox
Definition: Normalize.h:82
fillZero
@ fillZero
Definition: SampleFormat.h:39
EffectNormalize::OnUpdateUI
void OnUpdateUI(wxCommandEvent &evt)
Definition: Normalize.cpp:537
ComponentInterfaceSymbol
ComponentInterfaceSymbol pairs a persistent string identifier used internally with an optional,...
Definition: ComponentInterface.h:60
EffectNormalize::mPeakLevel
double mPeakLevel
Definition: Normalize.h:72
WaveTrack::Get
bool Get(samplePtr buffer, sampleFormat format, sampleCount start, size_t len, fillFormat fill=fillZero, bool mayThrow=true, sampleCount *pNumWithinClips=nullptr) const
Definition: WaveTrack.cpp:1895
limitSampleBufferSize
size_t limitSampleBufferSize(size_t bufferSize, sampleCount limit)
Definition: Types.h:706
EffectNormalize::mCurT0
double mCurT0
Definition: Normalize.h:77
EffectNormalize::GetDescription
TranslatableString GetDescription() override
Definition: Normalize.cpp:76
WaveTrack::Set
void Set(constSamplePtr buffer, sampleFormat format, sampleCount start, size_t len)
Definition: WaveTrack.cpp:1978
samplePtr
char * samplePtr
Definition: Types.h:737
EffectNormalize::AnalyseTrackData
bool AnalyseTrackData(const WaveTrack *track, const TranslatableString &msg, double &progress, float &offset)
Definition: Normalize.cpp:403
XXO
#define XXO(s)
Definition: Internat.h:45
ShuttleGuiBase::EndHorizontalLay
void EndHorizontalLay()
Definition: ShuttleGui.cpp:1170
Effect::mT0
double mT0
Definition: Effect.h:465
sampleCount::as_double
double as_double() const
Definition: Types.h:616
EffectNormalize::GetType
EffectType GetType() override
Definition: Normalize.cpp:88
EffectNormalize::mSum
double mSum
Definition: Normalize.h:80
ShuttleGuiBase::StartHorizontalLay
void StartHorizontalLay(int PositionFlags=wxALIGN_CENTRE, int iProp=1)
Definition: ShuttleGui.cpp:1160
ShuttleGuiBase::StartMultiColumn
void StartMultiColumn(int nCols, int PositionFlags=wxALIGN_LEFT)
Definition: ShuttleGui.cpp:1203
ShuttleGuiBase::EndVerticalLay
void EndVerticalLay()
Definition: ShuttleGui.cpp:1196
EffectNormalize::mWarning
wxStaticText * mWarning
Definition: Normalize.h:86
Effect::ReplaceProcessedTracks
void ReplaceProcessedTracks(const bool bGoodResult)
Definition: Effect.cpp:2192
EffectNormalize::PopulateOrExchange
void PopulateOrExchange(ShuttleGui &S) override
Definition: Normalize.cpp:288
EffectNormalize::mMult
float mMult
Definition: Normalize.h:79
ShuttleGui::Validator
ShuttleGui & Validator(const Factory &f)
Definition: ShuttleGui.h:685
EffectNormalize::AnalyseTrack
bool AnalyseTrack(const WaveTrack *track, const TranslatableString &msg, double &progress, float &offset, float &extent)
Definition: Normalize.cpp:364
Effect::mOutputTracks
std::shared_ptr< TrackList > mOutputTracks
Definition: Effect.h:464
EffectNormalize::mGain
bool mGain
Definition: Normalize.h:73
ReadAndVerifyDouble
#define ReadAndVerifyDouble(name)
Definition: Effect.h:632
Param
Param(PeakLevel, double, wxT("PeakLevel"), -1.0, -145.0, 0.0, 1)
Effect::GetCurrentSettingsGroup
RegistryPath GetCurrentSettingsGroup() override
Definition: Effect.cpp:865
EffectNormalize::AnalyseDataDC
void AnalyseDataDC(float *buffer, size_t len)
Definition: Normalize.cpp:523
LoadEffects.h
WaveTrack::GetMaxBlockSize
size_t GetMaxBlockSize() const
Definition: WaveTrack.cpp:1578
min
int min(int a, int b)
Definition: CompareAudioCommand.cpp:106
EffectNormalize::Process
bool Process() override
Definition: Normalize.cpp:169
ShuttleGui::Name
ShuttleGui & Name(const TranslatableString &name)
Definition: ShuttleGui.h:670
FileConfig::Flush
virtual bool Flush(bool bCurrentOnly=false) wxOVERRIDE
Definition: FileConfig.cpp:151
WaveTrack::TimeToLongSamples
sampleCount TimeToLongSamples(double t0) const
Convert correctly between an (absolute) time in seconds and a number of samples.
Definition: WaveTrack.cpp:1767
BuiltinEffectsModule::Registration
Definition: LoadEffects.h:40
EffectNormalize::mDC
bool mDC
Definition: Normalize.h:74
Effect::mUIParent
wxWindow * mUIParent
Definition: Effect.h:477
Track::IsLeader
bool IsLeader() const
Definition: Track.cpp:370
EffectNormalize::mLeveldB
wxStaticText * mLeveldB
Definition: Normalize.h:85
_
#define _(s)
Definition: Internat.h:76
sampleCount
Definition: Types.h:589
EffectNormalize::TransferDataToWindow
bool TransferDataToWindow() override
Definition: Normalize.cpp:340
Effect::TotalProgress
bool TotalProgress(double frac, const TranslatableString &={})
Definition: Effect.cpp:2016
EffectNormalize::~EffectNormalize
virtual ~EffectNormalize()
Definition: Normalize.cpp:65
Effect::GetNumWaveTracks
int GetNumWaveTracks()
Definition: Effect.h:344
EffectNormalize::ManualPage
wxString ManualPage() override
Definition: Normalize.cpp:81
WaveTrack::GetBestBlockSize
size_t GetBestBlockSize(sampleCount t) const
Definition: WaveTrack.cpp:1560
TrapDouble
double TrapDouble(double x, double min, double max)
Definition: Effect.h:563
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
ShuttleGuiBase::AddVariableText
wxStaticText * AddVariableText(const TranslatableString &Str, bool bCenter=false, int PositionFlags=0, int wrapWidth=0)
Definition: ShuttleGui.cpp:456
TrackList::SingletonRange
static auto SingletonRange(TrackType *pTrack) -> TrackIterRange< TrackType >
Definition: Track.h:1422
EffectType
EffectType
Definition: EffectInterface.h:55
EffectNormalize::CheckWhetherSkipEffect
bool CheckWhetherSkipEffect() override
Definition: Normalize.cpp:129
EffectNormalize::mCreating
bool mCreating
Definition: Normalize.h:88
anonymous_namespace{Normalize.cpp}::reg
BuiltinEffectsModule::Registration< EffectNormalize > reg
Definition: Normalize.cpp:48
END_EVENT_TABLE
END_EVENT_TABLE()
EffectNormalize::DefineParams
bool DefineParams(ShuttleParams &S) override
Definition: Normalize.cpp:94
ArrayOf< float >
EffectNormalize::mDCCheckBox
wxCheckBox * mDCCheckBox
Definition: Normalize.h:83
EffectNormalize::mStereoIndCheckBox
wxCheckBox * mStereoIndCheckBox
Definition: Normalize.h:87
ReadAndVerifyBool
#define ReadAndVerifyBool(name)
Definition: Effect.h:634
ShuttleGui
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.
Definition: ShuttleGui.h:638