Audacity  3.0.3
Loudness.cpp
Go to the documentation of this file.
1 /**********************************************************************
2 
3  Audacity: A Digital Audio Editor
4 
5  Loudness.cpp
6 
7  Max Maisel
8 
9 *******************************************************************//*******************************************************************/
15 
16 
17 
18 #include "Loudness.h"
19 
20 #include <math.h>
21 
22 #include <wx/intl.h>
23 #include <wx/simplebook.h>
24 #include <wx/valgen.h>
25 
26 #include "Internat.h"
27 #include "Prefs.h"
28 #include "../ProjectFileManager.h"
29 #include "../Shuttle.h"
30 #include "../ShuttleGui.h"
31 #include "../WaveTrack.h"
32 #include "../widgets/valnum.h"
33 #include "../widgets/ProgressDialog.h"
34 
35 #include "LoadEffects.h"
36 
38 {
41  nAlgos
42 };
43 
45 {
46  { XO("perceived loudness") },
47  { XO("RMS") }
48 };
49 // Define keys, defaults, minimums, and maximums for the effect parameters
50 //
51 // Name Type Key Def Min Max Scale
52 Param( StereoInd, bool, wxT("StereoIndependent"), false, false, true, 1 );
53 Param( LUFSLevel, double, wxT("LUFSLevel"), -23.0, -145.0, 0.0, 1 );
54 Param( RMSLevel, double, wxT("RMSLevel"), -20.0, -145.0, 0.0, 1 );
55 Param( DualMono, bool, wxT("DualMono"), true, false, true, 1 );
56 Param( NormalizeTo, int, wxT("NormalizeTo"), kLoudness , 0 , nAlgos-1, 1 );
57 
58 BEGIN_EVENT_TABLE(EffectLoudness, wxEvtHandler)
59  EVT_CHOICE(wxID_ANY, EffectLoudness::OnChoice)
60  EVT_CHECKBOX(wxID_ANY, EffectLoudness::OnUpdateUI)
61  EVT_TEXT(wxID_ANY, EffectLoudness::OnUpdateUI)
63 
65 { XO("Loudness Normalization") };
66 
68 
70 {
71  mStereoInd = DEF_StereoInd;
72  mLUFSLevel = DEF_LUFSLevel;
73  mRMSLevel = DEF_RMSLevel;
74  mDualMono = DEF_DualMono;
75  mNormalizeTo = DEF_NormalizeTo;
76 
77  SetLinearEffectFlag(false);
78 }
79 
81 {
82 }
83 
84 // ComponentInterface implementation
85 
87 {
88  return Symbol;
89 }
90 
92 {
93  return XO("Sets the loudness of one or more tracks");
94 }
95 
97 {
98  return L"Loudness_Normalization";
99 }
100 
101 // EffectDefinitionInterface implementation
102 
104 {
105  return EffectTypeProcess;
106 }
107 
108 // EffectClientInterface implementation
110 {
111  S.SHUTTLE_PARAM( mStereoInd, StereoInd );
112  S.SHUTTLE_PARAM( mLUFSLevel, LUFSLevel );
113  S.SHUTTLE_PARAM( mRMSLevel, RMSLevel );
114  S.SHUTTLE_PARAM( mDualMono, DualMono );
115  S.SHUTTLE_PARAM( mNormalizeTo, NormalizeTo );
116  return true;
117 }
118 
120 {
121  parms.Write(KEY_StereoInd, mStereoInd);
122  parms.Write(KEY_LUFSLevel, mLUFSLevel);
123  parms.Write(KEY_RMSLevel, mRMSLevel);
124  parms.Write(KEY_DualMono, mDualMono);
125  parms.Write(KEY_NormalizeTo, mNormalizeTo);
126 
127  return true;
128 }
129 
131 {
132  ReadAndVerifyBool(StereoInd);
133  ReadAndVerifyDouble(LUFSLevel);
134  ReadAndVerifyDouble(RMSLevel);
135  ReadAndVerifyBool(DualMono);
136  ReadAndVerifyInt(NormalizeTo);
137 
138  mStereoInd = StereoInd;
139  mLUFSLevel = LUFSLevel;
140  mRMSLevel = RMSLevel;
141  mDualMono = DualMono;
142  mNormalizeTo = NormalizeTo;
143 
144  return true;
145 }
146 
147 // Effect implementation
148 
150 {
151  return false;
152 }
153 
155 {
156  wxString base = wxT("/Effects/Loudness/");
157  // Load the old "current" settings
158  if (gPrefs->Exists(base))
159  {
160  mStereoInd = false;
161  mDualMono = DEF_DualMono;
163  mLUFSLevel = DEF_LUFSLevel;
164  mRMSLevel = DEF_RMSLevel;
165 
167 
168  gPrefs->Flush();
169  }
170  return true;
171 }
172 
174 {
175  if(mNormalizeTo == kLoudness)
176  // LU use 10*log10(...) instead of 20*log10(...)
177  // so multiply level by 2 and use standard DB_TO_LINEAR macro.
178  mRatio = DB_TO_LINEAR(TrapDouble(mLUFSLevel*2, MIN_LUFSLevel, MAX_LUFSLevel));
179  else // RMS
180  mRatio = DB_TO_LINEAR(TrapDouble(mRMSLevel, MIN_RMSLevel, MAX_RMSLevel));
181 
182  // Iterate over each track
183  this->CopyInputTracks(); // Set up mOutputTracks.
184  bool bGoodResult = true;
185  auto topMsg = XO("Normalizing Loudness...\n");
186 
187  AllocBuffers();
188  mProgressVal = 0;
189 
190  for(auto track : mOutputTracks->Selected<WaveTrack>()
192  {
193  // Get start and end times from track
194  // PRL: No accounting for multiple channels ?
195  double trackStart = track->GetStartTime();
196  double trackEnd = track->GetEndTime();
197 
198  // Set the current bounds to whichever left marker is
199  // greater and whichever right marker is less:
200  mCurT0 = mT0 < trackStart? trackStart: mT0;
201  mCurT1 = mT1 > trackEnd? trackEnd: mT1;
202 
203  // Get the track rate
204  mCurRate = track->GetRate();
205 
206  wxString msg;
207  auto trackName = track->GetName();
208  mSteps = 2;
209 
210  mProgressMsg =
211  topMsg + XO("Analyzing: %s").Format( trackName );
212 
213  auto range = mStereoInd
215  : TrackList::Channels(track);
216 
217  mProcStereo = range.size() > 1;
218 
219  if(mNormalizeTo == kLoudness)
220  {
221  mLoudnessProcessor.reset(safenew EBUR128(mCurRate, range.size()));
222  mLoudnessProcessor->Initialize();
223  if(!ProcessOne(range, true))
224  {
225  // Processing failed -> abort
226  bGoodResult = false;
227  break;
228  }
229  }
230  else // RMS
231  {
232  size_t idx = 0;
233  for(auto channel : range)
234  {
235  if(!GetTrackRMS(channel, mRMS[idx]))
236  {
237  bGoodResult = false;
238  return false;
239  }
240  ++idx;
241  }
242  mSteps = 1;
243  }
244 
245  // Calculate normalization values the analysis results
246  float extent;
247  if(mNormalizeTo == kLoudness)
248  extent = mLoudnessProcessor->IntegrativeLoudness();
249  else // RMS
250  {
251  extent = mRMS[0];
252  if(mProcStereo)
253  // RMS: use average RMS, average must be calculated in quadratic domain.
254  extent = sqrt((mRMS[0] * mRMS[0] + mRMS[1] * mRMS[1]) / 2.0);
255  }
256 
257  if(extent == 0.0)
258  {
259  mLoudnessProcessor.reset();
260  FreeBuffers();
261  return false;
262  }
263  mMult = mRatio / extent;
264 
265  if(mNormalizeTo == kLoudness)
266  {
267  // Target half the LUFS value if mono (or independent processed stereo)
268  // shall be treated as dual mono.
269  if(range.size() == 1 && (mDualMono || track->GetChannel() != Track::MonoChannel))
270  mMult /= 2.0;
271 
272  // LUFS are related to square values so the multiplier must be the root.
273  mMult = sqrt(mMult);
274  }
275 
276  mProgressMsg = topMsg + XO("Processing: %s").Format( trackName );
277  if(!ProcessOne(range, false))
278  {
279  // Processing failed -> abort
280  bGoodResult = false;
281  break;
282  }
283  }
284 
285  this->ReplaceProcessedTracks(bGoodResult);
286  mLoudnessProcessor.reset();
287  FreeBuffers();
288  return bGoodResult;
289 }
290 
292 {
293  S.StartVerticalLay(0);
294  {
295  S.StartMultiColumn(2, wxALIGN_CENTER);
296  {
297  S.StartVerticalLay(false);
298  {
299  S.StartHorizontalLay(wxALIGN_LEFT, false);
300  {
301  S.AddVariableText(XO("&Normalize"), false,
302  wxALIGN_CENTER_VERTICAL | wxALIGN_LEFT);
303 
304  mChoice = S
305  .Validator<wxGenericValidator>( &mNormalizeTo )
306  .AddChoice( {},
308  mNormalizeTo );
309  S
310  .AddVariableText(XO("t&o"), false,
311  wxALIGN_CENTER_VERTICAL | wxALIGN_LEFT);
312 
313  // Use a notebook so we can have two controls but show only one
314  // They target different variables with their validators
315  mBook =
316  S
317  .StartSimplebook();
318  {
319  S.StartNotebookPage({});
320  {
321  S.StartHorizontalLay(wxALIGN_LEFT, false);
322  {
323  S
324  /* i18n-hint: LUFS is a particular method for measuring loudnesss */
325  .Name( XO("Loudness LUFS") )
326  .Validator<FloatingPointValidator<double>>(
327  2, &mLUFSLevel,
328  NumValidatorStyle::ONE_TRAILING_ZERO,
329  MIN_LUFSLevel, MAX_LUFSLevel )
330  .AddTextBox( {}, wxT(""), 10);
331 
332  /* i18n-hint: LUFS is a particular method for measuring loudnesss */
333  S
334  .AddVariableText(XO("LUFS"), false,
335  wxALIGN_CENTER_VERTICAL | wxALIGN_LEFT);
336  }
337  S.EndHorizontalLay();
338  }
339  S.EndNotebookPage();
340 
341  S.StartNotebookPage({});
342  {
343  S.StartHorizontalLay(wxALIGN_LEFT, false);
344  {
345  S
346  .Name( XO("RMS dB") )
347  .Validator<FloatingPointValidator<double>>(
348  2, &mRMSLevel,
349  NumValidatorStyle::ONE_TRAILING_ZERO,
350  MIN_RMSLevel, MAX_RMSLevel )
351  .AddTextBox( {}, wxT(""), 10);
352 
353  S
354  .AddVariableText(XO("dB"), false,
355  wxALIGN_CENTER_VERTICAL | wxALIGN_LEFT);
356  }
357  S.EndHorizontalLay();
358  }
359  S.EndNotebookPage();
360  }
361  S.EndSimplebook();
362 
363  mWarning =
364  S
365  .AddVariableText( {}, false,
366  wxALIGN_CENTER_VERTICAL | wxALIGN_LEFT);
367  }
368  S.EndHorizontalLay();
369 
371  .Validator<wxGenericValidator>( &mStereoInd )
372  .AddCheckBox(XXO("Normalize &stereo channels independently"),
373  mStereoInd );
374 
376  .Validator<wxGenericValidator>( &mDualMono )
377  .AddCheckBox(XXO("&Treat mono as dual-mono (recommended)"),
378  mDualMono );
379  }
380  S.EndVerticalLay();
381  }
382  S.EndMultiColumn();
383  }
384  S.EndVerticalLay();
385 }
386 
388 {
389  if (!mUIParent->TransferDataToWindow())
390  {
391  return false;
392  }
393 
394  // adjust controls which depend on mchoice
395  wxCommandEvent dummy;
396  OnChoice(dummy);
397  return true;
398 }
399 
401 {
402  if (!mUIParent->Validate() || !mUIParent->TransferDataFromWindow())
403  {
404  return false;
405  }
406  return true;
407 }
408 
409 // EffectLoudness implementation
410 
414 {
416  bool stereoTrackFound = false;
417  double maxSampleRate = 0;
418  mProcStereo = false;
419 
420  for(auto track : mOutputTracks->Selected<WaveTrack>() + &Track::Any)
421  {
422  mTrackBufferCapacity = std::max(mTrackBufferCapacity, track->GetMaxBlockSize());
423  maxSampleRate = std::max(maxSampleRate, track->GetRate());
424 
425  // There is a stereo track
426  if(track->IsLeader())
427  stereoTrackFound = true;
428  }
429 
430  // Initiate a processing buffer. This buffer will (most likely)
431  // be shorter than the length of the track being processed.
433 
434  if(!mStereoInd && stereoTrackFound)
436 }
437 
439 {
440  mTrackBuffer[0].reset();
441  mTrackBuffer[1].reset();
442 }
443 
444 bool EffectLoudness::GetTrackRMS(WaveTrack* track, float& rms)
445 {
446  // set mRMS. No progress bar here as it's fast.
447  float _rms = track->GetRMS(mCurT0, mCurT1); // may throw
448  rms = _rms;
449  return true;
450 }
451 
459 {
460  WaveTrack* track = *range.begin();
461 
462  // Transform the marker timepoints to samples
463  auto start = track->TimeToLongSamples(mCurT0);
464  auto end = track->TimeToLongSamples(mCurT1);
465 
466  // Get the length of the buffer (as double). len is
467  // used simply to calculate a progress meter, so it is easier
468  // to make it a double now than it is to do it later
469  mTrackLen = (end - start).as_double();
470 
471  // Abort if the right marker is not to the right of the left marker
472  if(mCurT1 <= mCurT0)
473  return false;
474 
475  // Go through the track one buffer at a time. s counts which
476  // sample the current buffer starts at.
477  auto s = start;
478  while(s < end)
479  {
480  // Get a block of samples (smaller than the size of the buffer)
481  // Adjust the block size if it is the final block in the track
482  auto blockLen = limitSampleBufferSize(
483  track->GetBestBlockSize(s),
485 
486  const size_t remainingLen = (end - s).as_size_t();
487  blockLen = blockLen > remainingLen ? remainingLen : blockLen;
488  LoadBufferBlock(range, s, blockLen);
489 
490  // Process the buffer.
491  if(analyse)
492  {
493  if(!AnalyseBufferBlock())
494  return false;
495  }
496  else
497  {
498  if(!ProcessBufferBlock())
499  return false;
500  StoreBufferBlock(range, s, blockLen);
501  }
502 
503  // Increment s one blockfull of samples
504  s += blockLen;
505  }
506 
507  // Return true because the effect processing succeeded ... unless cancelled
508  return true;
509 }
510 
512  sampleCount pos, size_t len)
513 {
514  // Get the samples from the track and put them in the buffer
515  int idx = 0;
516  for(auto channel : range)
517  {
518  channel->GetFloats(mTrackBuffer[idx].get(), pos, len );
519  ++idx;
520  }
521  mTrackBufferLen = len;
522 }
523 
527 {
528  for(size_t i = 0; i < mTrackBufferLen; i++)
529  {
530  mLoudnessProcessor->ProcessSampleFromChannel(mTrackBuffer[0][i], 0);
531  if(mProcStereo)
532  mLoudnessProcessor->ProcessSampleFromChannel(mTrackBuffer[1][i], 1);
533  mLoudnessProcessor->NextSample();
534  }
535 
536  if(!UpdateProgress())
537  return false;
538  return true;
539 }
540 
542 {
543  for(size_t i = 0; i < mTrackBufferLen; i++)
544  {
545  mTrackBuffer[0][i] = mTrackBuffer[0][i] * mMult;
546  if(mProcStereo)
547  mTrackBuffer[1][i] = mTrackBuffer[1][i] * mMult;
548  }
549 
550  if(!UpdateProgress())
551  return false;
552  return true;
553 }
554 
556  sampleCount pos, size_t len)
557 {
558  int idx = 0;
559  for(auto channel : range)
560  {
561  // Copy the newly-changed samples back onto the track.
562  channel->Set((samplePtr) mTrackBuffer[idx].get(), floatSample, pos, len);
563  ++idx;
564  }
565 }
566 
568 {
569  mProgressVal += (double(1+mProcStereo) * double(mTrackBufferLen)
570  / (double(GetNumWaveTracks()) * double(mSteps) * mTrackLen));
572 }
573 
574 void EffectLoudness::OnChoice(wxCommandEvent & WXUNUSED(evt))
575 {
576  mChoice->GetValidator()->TransferFromWindow();
577  mBook->SetSelection( mNormalizeTo );
578  UpdateUI();
580 }
581 
582 void EffectLoudness::OnUpdateUI(wxCommandEvent & WXUNUSED(evt))
583 {
584  UpdateUI();
585 }
586 
588 {
589  if (!mUIParent->TransferDataFromWindow())
590  {
591  mWarning->SetLabel(_("(Maximum 0dB)"));
592  // TODO: recalculate layout here
593  EnableApply(false);
594  return;
595  }
596  mWarning->SetLabel(wxT(""));
597  EnableApply(true);
598 }
EffectLoudness::mCurT0
double mCurT0
Definition: Loudness.h:88
TranslatableString
Holds a msgid for the translation catalog; may also bind format arguments.
Definition: TranslatableString.h:32
ShuttleGuiBase::EndSimplebook
void EndSimplebook()
Definition: ShuttleGui.cpp:1061
CommandParameters
CommandParameters, derived from wxFileConfig, is essentially doing the same things as the Shuttle cla...
Definition: EffectAutomationParameters.h:67
EffectLoudness::GetTrackRMS
bool GetTrackRMS(WaveTrack *track, float &rms)
Definition: Loudness.cpp:444
EffectLoudness::mDualMonoCheckBox
wxCheckBox * mDualMonoCheckBox
Definition: Loudness.h:105
ShuttleGuiBase::StartVerticalLay
void StartVerticalLay(int iProp=1)
Definition: ShuttleGui.cpp:1184
WaveTrack
A Track that contains audio waveform data.
Definition: WaveTrack.h:69
EffectTypeProcess
@ EffectTypeProcess
Definition: EffectInterface.h:59
DB_TO_LINEAR
const double MIN_Threshold_Linear DB_TO_LINEAR(MIN_Threshold_dB)
Effect::SetLinearEffectFlag
void SetLinearEffectFlag(bool linearEffectFlag)
Definition: Effect.cpp:2000
Effect::EnableApply
virtual bool EnableApply(bool enable=true)
Definition: Effect.cpp:1925
EffectLoudness::mMult
float mMult
Definition: Loudness.h:96
EffectLoudness::mTrackBufferLen
size_t mTrackBufferLen
Definition: Loudness.h:108
EffectLoudness::mSteps
int mSteps
Definition: Loudness.h:91
gPrefs
FileConfig * gPrefs
Definition: Prefs.cpp:70
Effect::CopyInputTracks
void CopyInputTracks(bool allSyncLockSelected=false)
Definition: Effect.cpp:2070
EffectLoudness::OnChoice
void OnChoice(wxCommandEvent &evt)
Definition: Loudness.cpp:574
TrackList::Channels
static auto Channels(TrackType *pTrack) -> TrackIterRange< TrackType >
Definition: Track.h:1468
EffectLoudness::mCurRate
double mCurRate
Definition: Loudness.h:94
Effect::mT1
double mT1
Definition: Effect.h:467
ArrayOf::reinit
void reinit(Integral count, bool initialize=false)
Definition: MemoryX.h:57
Validator
A Validator is an object which checks whether a wxVariant satisfies a certain criterion....
Definition: Validators.h:53
nAlgos
@ nAlgos
Definition: Loudness.cpp:41
EffectLoudness::mProgressMsg
TranslatableString mProgressMsg
Definition: Loudness.h:92
EffectLoudness::mRatio
float mRatio
Definition: Loudness.h:97
XO
#define XO(s)
Definition: Internat.h:31
EffectLoudness::Process
bool Process() override
Definition: Loudness.cpp:173
anonymous_namespace{Loudness.cpp}::reg
BuiltinEffectsModule::Registration< EffectLoudness > reg
Definition: Loudness.cpp:67
EffectLoudness::mStereoInd
bool mStereoInd
Definition: Loudness.h:82
ShuttleParams
Shuttle that deals with parameters. This is a base class with lots of virtual functions that do nothi...
Definition: Shuttle.h:62
Track::Any
bool Any() const
Definition: Track.cpp:361
ShuttleGuiBase::EndMultiColumn
void EndMultiColumn()
Definition: ShuttleGui.cpp:1238
Loudness.h
ShuttleGuiBase::StartNotebookPage
wxNotebookPage * StartNotebookPage(const TranslatableString &Name)
Definition: ShuttleGui.cpp:1068
WaveTrack::GetRMS
float GetRMS(double t0, double t1, bool mayThrow=true) const
Definition: WaveTrack.cpp:1864
EffectLoudness::UpdateUI
void UpdateUI()
Definition: Loudness.cpp:587
EffectLoudness::mWarning
wxStaticText * mWarning
Definition: Loudness.h:103
ShuttleGuiBase::EndNotebookPage
void EndNotebookPage()
Definition: ShuttleGui.cpp:1091
Effect::SaveUserPreset
bool SaveUserPreset(const RegistryPath &name) override
Definition: Effect.cpp:569
EffectLoudness::mBook
wxSimplebook * mBook
Definition: Loudness.h:101
EffectLoudness::AllocBuffers
void AllocBuffers()
Definition: Loudness.cpp:413
ComponentInterfaceSymbol
ComponentInterfaceSymbol pairs a persistent string identifier used internally with an optional,...
Definition: ComponentInterfaceSymbol.h:27
EffectLoudness::TransferDataFromWindow
bool TransferDataFromWindow() override
Definition: Loudness.cpp:400
EffectLoudness::TransferDataToWindow
bool TransferDataToWindow() override
Definition: Loudness.cpp:387
EffectLoudness::FreeBuffers
void FreeBuffers()
Definition: Loudness.cpp:438
floatSample
@ floatSample
Definition: SampleFormat.h:34
EffectLoudness
An Effect to bring the loudness level up to a chosen level.
Definition: Loudness.h:30
EffectLoudness::AnalyseBufferBlock
bool AnalyseBufferBlock()
Definition: Loudness.cpp:526
EffectLoudness::mRMSLevel
double mRMSLevel
Definition: Loudness.h:84
ReadAndVerifyInt
#define ReadAndVerifyInt(name)
Definition: Effect.h:632
XXO
#define XXO(s)
Definition: Internat.h:44
ShuttleGuiBase::EndHorizontalLay
void EndHorizontalLay()
Definition: ShuttleGui.cpp:1177
Effect::mT0
double mT0
Definition: Effect.h:466
ShuttleGuiBase::StartHorizontalLay
void StartHorizontalLay(int PositionFlags=wxALIGN_CENTRE, int iProp=1)
Definition: ShuttleGui.cpp:1167
ShuttleGuiBase::StartMultiColumn
void StartMultiColumn(int nCols, int PositionFlags=wxALIGN_LEFT)
Definition: ShuttleGui.cpp:1229
ShuttleGuiBase::EndVerticalLay
void EndVerticalLay()
Definition: ShuttleGui.cpp:1203
ShuttleGuiBase::StartSimplebook
wxSimplebook * StartSimplebook()
Definition: ShuttleGui.cpp:1047
EffectLoudness::mLoudnessProcessor
std::unique_ptr< EBUR128 > mLoudnessProcessor
Definition: Loudness.h:99
Track::MonoChannel
static const auto MonoChannel
Definition: Track.h:268
Effect::ReplaceProcessedTracks
void ReplaceProcessedTracks(const bool bGoodResult)
Definition: Effect.cpp:2192
EffectLoudness::mProcStereo
bool mProcStereo
Definition: Loudness.h:110
ShuttleGui::Validator
ShuttleGui & Validator(const Factory &f)
Definition: ShuttleGui.h:678
EffectLoudness::GetType
EffectType GetType() override
Definition: Loudness.cpp:103
EffectLoudness::Startup
bool Startup() override
Definition: Loudness.cpp:154
EffectLoudness::ProcessBufferBlock
bool ProcessBufferBlock()
Definition: Loudness.cpp:541
EffectLoudness::ManualPage
ManualPageID ManualPage() override
Definition: Loudness.cpp:96
EffectLoudness::UpdateProgress
bool UpdateProgress()
Definition: Loudness.cpp:567
EffectLoudness::SetAutomationParameters
bool SetAutomationParameters(CommandParameters &parms) override
Definition: Loudness.cpp:130
TrackIterRange
Range between two TrackIters, usable in range-for statements, and with Visit member functions.
Definition: Track.h:1085
Effect::mOutputTracks
std::shared_ptr< TrackList > mOutputTracks
Definition: Effect.h:465
Msgids
TranslatableStrings Msgids(const EnumValueSymbol strings[], size_t nStrings)
Convenience function often useful when adding choice controls.
Definition: ShuttleGui.cpp:2510
ReadAndVerifyDouble
#define ReadAndVerifyDouble(name)
Definition: Effect.h:633
EffectLoudness::mTrackLen
double mTrackLen
Definition: Loudness.h:93
EffectLoudness::mDualMono
bool mDualMono
Definition: Loudness.h:85
EffectLoudness::mNormalizeTo
int mNormalizeTo
Definition: Loudness.h:86
Effect::GetCurrentSettingsGroup
RegistryPath GetCurrentSettingsGroup() override
Definition: Effect.cpp:865
EffectLoudness::GetAutomationParameters
bool GetAutomationParameters(CommandParameters &parms) override
Definition: Loudness.cpp:119
EffectLoudness::mChoice
wxChoice * mChoice
Definition: Loudness.h:102
EffectLoudness::DefineParams
bool DefineParams(ShuttleParams &S) override
Definition: Loudness.cpp:109
LoadEffects.h
Internat.h
samplePtr
char * samplePtr
Definition: SampleFormat.h:49
ShuttleGui::Name
ShuttleGui & Name(const TranslatableString &name)
Definition: ShuttleGui.h:663
EffectLoudness::ProcessOne
bool ProcessOne(TrackIterRange< WaveTrack > range, bool analyse)
Definition: Loudness.cpp:458
FileConfig::Flush
virtual bool Flush(bool bCurrentOnly=false) wxOVERRIDE
Definition: FileConfig.cpp:143
kNormalizeTargets
kNormalizeTargets
Definition: Loudness.cpp:38
WaveTrack::TimeToLongSamples
sampleCount TimeToLongSamples(double t0) const
Convert correctly between an (absolute) time in seconds and a number of samples.
Definition: WaveTrack.cpp:1770
BuiltinEffectsModule::Registration
Definition: LoadEffects.h:40
Effect::mUIParent
wxWindow * mUIParent
Definition: Effect.h:478
Track::IsLeader
bool IsLeader() const
Definition: Track.cpp:370
TaggedIdentifier< ManualPageIDTag >
kLoudness
@ kLoudness
Definition: Loudness.cpp:39
_
#define _(s)
Definition: Internat.h:75
sampleCount
Positions or offsets within audio files need a wide type.
Definition: SampleCount.h:18
EffectLoudness::mCurT1
double mCurT1
Definition: Loudness.h:89
EffectLoudness::EffectLoudness
EffectLoudness()
Definition: Loudness.cpp:69
Param
Param(StereoInd, bool, wxT("StereoIndependent"), false, false, true, 1)
EffectLoudness::mRMS
float mRMS[2]
Definition: Loudness.h:98
Effect::TotalProgress
bool TotalProgress(double frac, const TranslatableString &={})
Definition: Effect.cpp:2016
kRMS
@ kRMS
Definition: Loudness.cpp:40
EffectLoudness::Symbol
static const ComponentInterfaceSymbol Symbol
Definition: Loudness.h:32
Effect::GetNumWaveTracks
int GetNumWaveTracks()
Definition: Effect.h:345
EffectLoudness::mTrackBuffer
Floats mTrackBuffer[2]
Definition: Loudness.h:107
EffectLoudness::StoreBufferBlock
void StoreBufferBlock(TrackIterRange< WaveTrack > range, sampleCount pos, size_t len)
Definition: Loudness.cpp:555
WaveTrack::GetBestBlockSize
size_t GetBestBlockSize(sampleCount t) const
Definition: WaveTrack.cpp:1563
TrapDouble
double TrapDouble(double x, double min, double max)
Definition: Effect.h:564
EffectLoudness::GetDescription
TranslatableString GetDescription() override
Definition: Loudness.cpp:91
Prefs.h
EffectLoudness::PopulateOrExchange
void PopulateOrExchange(ShuttleGui &S) override
Definition: Loudness.cpp:291
EBUR128
Implements EBU-R128 loudness measurement.
Definition: EBUR128.h:22
ShuttleGuiBase::AddVariableText
wxStaticText * AddVariableText(const TranslatableString &Str, bool bCenter=false, int PositionFlags=0, int wrapWidth=0)
Definition: ShuttleGui.cpp:463
EffectLoudness::GetSymbol
ComponentInterfaceSymbol GetSymbol() override
Definition: Loudness.cpp:86
TrackList::SingletonRange
static auto SingletonRange(TrackType *pTrack) -> TrackIterRange< TrackType >
Definition: Track.h:1423
EffectLoudness::~EffectLoudness
virtual ~EffectLoudness()
Definition: Loudness.cpp:80
EffectType
EffectType
Definition: EffectInterface.h:55
safenew
#define safenew
Definition: MemoryX.h:10
limitSampleBufferSize
size_t limitSampleBufferSize(size_t bufferSize, sampleCount limit)
Definition: SampleCount.cpp:21
EffectLoudness::LoadBufferBlock
void LoadBufferBlock(TrackIterRange< WaveTrack > range, sampleCount pos, size_t len)
Definition: Loudness.cpp:511
END_EVENT_TABLE
END_EVENT_TABLE()
EffectLoudness::mStereoIndCheckBox
wxCheckBox * mStereoIndCheckBox
Definition: Loudness.h:104
ReadAndVerifyBool
#define ReadAndVerifyBool(name)
Definition: Effect.h:635
EffectLoudness::CheckWhetherSkipEffect
bool CheckWhetherSkipEffect() override
Definition: Loudness.cpp:149
EffectLoudness::mProgressVal
double mProgressVal
Definition: Loudness.h:90
EffectLoudness::OnUpdateUI
void OnUpdateUI(wxCommandEvent &evt)
Definition: Loudness.cpp:582
kNormalizeTargetStrings
static const EnumValueSymbol kNormalizeTargetStrings[nAlgos]
Definition: Loudness.cpp:44
EffectLoudness::mTrackBufferCapacity
size_t mTrackBufferCapacity
Definition: Loudness.h:109
ShuttleGui
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.
Definition: ShuttleGui.h:631
EffectLoudness::mLUFSLevel
double mLUFSLevel
Definition: Loudness.h:83