Audacity  3.2.0
BassTreble.cpp
Go to the documentation of this file.
1 /**********************************************************************
2 
3  Audacity: A Digital Audio Editor
4  Audacity(R) is copyright (c) 1999-2016 Audacity Team.
5  License: GPL v2 or later. See License.txt.
6 
7  BassTreble.cpp
8  Steve Daulton
9 
10 ******************************************************************//*******************************************************************/
16 
17 
18 #include "BassTreble.h"
19 #include "LoadEffects.h"
20 
21 #include <math.h>
22 #include <algorithm>
23 
24 #include <wx/button.h>
25 #include <wx/checkbox.h>
26 #include <wx/intl.h>
27 #include <wx/panel.h>
28 #include <wx/sizer.h>
29 #include <wx/slider.h>
30 
31 #include "Prefs.h"
32 #include "../Shuttle.h"
33 #include "../ShuttleGui.h"
34 #include "../WaveTrack.h"
35 #include "../widgets/valnum.h"
36 
37 enum
38 {
39  ID_Bass = 10000,
42  ID_Link
43 };
44 
45 // Define keys, defaults, minimums, and maximums for the effect parameters
46 //
47 // Name Type Key Def Min Max Scale
48 Param( Bass, double, wxT("Bass"), 0.0, -30.0, 30.0, 1 );
49 Param( Treble, double, wxT("Treble"), 0.0, -30.0, 30.0, 1 );
50 Param( Gain, double, wxT("Gain"), 0.0, -30.0, 30.0, 1 );
51 Param( Link, bool, wxT("Link Sliders"), false, false, true, 1 );
52 
53 // Used to communicate the type of the filter.
55 {
57  kTreble
58 };
59 
61 { XO("Bass and Treble") };
62 
64 
65 BEGIN_EVENT_TABLE(EffectBassTreble, wxEvtHandler)
74 
76 {
77  mBass = DEF_Bass;
78  mTreble = DEF_Treble;
79  mGain = DEF_Gain;
80  mLink = DEF_Link;
81 
82  SetLinearEffectFlag(true);
83 }
84 
86 {
87 }
88 
89 // ComponentInterface implementation
90 
92 {
93  return Symbol;
94 }
95 
97 {
98  return XO("Simple tone control effect");
99 }
100 
102 {
103  return L"Bass_and_Treble";
104 }
105 
106 // EffectDefinitionInterface implementation
107 
109 {
110  return EffectTypeProcess;
111 }
112 
114 {
115  return true;
116 }
117 
118 
119 // EffectProcessor implementation
120 
122 {
123  return 1;
124 }
125 
127 {
128  return 1;
129 }
130 
131 bool EffectBassTreble::ProcessInitialize(sampleCount WXUNUSED(totalLen), ChannelNames WXUNUSED(chanMap))
132 {
134 
135  return true;
136 }
137 
138 size_t EffectBassTreble::ProcessBlock(float **inBlock, float **outBlock, size_t blockLen)
139 {
140  return InstanceProcess(mMaster, inBlock, outBlock, blockLen);
141 }
142 
144 {
145  SetBlockSize(512);
146 
147  mSlaves.clear();
148 
149  return true;
150 }
151 
152 bool EffectBassTreble::RealtimeAddProcessor(unsigned WXUNUSED(numChannels), float sampleRate)
153 {
154  EffectBassTrebleState slave;
155 
156  InstanceInit(slave, sampleRate);
157 
158  mSlaves.push_back(slave);
159 
160  return true;
161 }
162 
164 {
165  mSlaves.clear();
166 
167  return true;
168 }
169 
171  float **inbuf,
172  float **outbuf,
173  size_t numSamples)
174 {
175  return InstanceProcess(mSlaves[group], inbuf, outbuf, numSamples);
176 }
178  S.SHUTTLE_PARAM( mBass, Bass );
179  S.SHUTTLE_PARAM( mTreble, Treble );
180  S.SHUTTLE_PARAM( mGain, Gain );
181  S.SHUTTLE_PARAM( mLink, Link );
182  return true;
183 }
184 
186 {
187  parms.Write(KEY_Bass, mBass);
188  parms.Write(KEY_Treble, mTreble);
189  parms.Write(KEY_Gain, mGain);
190  parms.Write(KEY_Link, mLink);
191 
192  return true;
193 }
194 
196 {
197  ReadAndVerifyDouble(Bass);
198  ReadAndVerifyDouble(Treble);
199  ReadAndVerifyDouble(Gain);
200  ReadAndVerifyBool(Link);
201 
202  mBass = Bass;
203  mTreble = Treble;
204  mGain = Gain;
205  mLink = Link;
206 
207  return true;
208 }
209 
211 {
212  return (mBass == 0.0 && mTreble == 0.0 && mGain == 0.0);
213 }
214 
215 
216 // Effect implementation
217 
219 {
220  S.SetBorder(5);
221  S.AddSpace(0, 5);
222 
223  S.StartStatic(XO("Tone controls"));
224  {
225  S.StartMultiColumn(3, wxEXPAND);
226  {
227  S.SetStretchyCol(2);
228 
229  // Bass control
230  mBassT = S.Id(ID_Bass)
231  .Name(XO("Bass (dB):"))
232  .Validator<FloatingPointValidator<double>>(
233  1, &mBass, NumValidatorStyle::DEFAULT, MIN_Bass, MAX_Bass)
234  .AddTextBox(XXO("Ba&ss (dB):"), wxT(""), 10);
235 
236  mBassS = S.Id(ID_Bass)
237  .Name(XO("Bass"))
238  .Style(wxSL_HORIZONTAL)
239  .AddSlider( {}, 0, MAX_Bass * SCL_Bass, MIN_Bass * SCL_Bass);
240 
241  // Treble control
242  mTrebleT = S.Id(ID_Treble)
243  .Validator<FloatingPointValidator<double>>(
244  1, &mTreble, NumValidatorStyle::DEFAULT, MIN_Treble, MAX_Treble)
245  .AddTextBox(XXO("&Treble (dB):"), wxT(""), 10);
246 
247  mTrebleS = S.Id(ID_Treble)
248  .Name(XO("Treble"))
249  .Style(wxSL_HORIZONTAL)
250  .AddSlider( {}, 0, MAX_Treble * SCL_Treble, MIN_Treble * SCL_Treble);
251  }
252  S.EndMultiColumn();
253  }
254  S.EndStatic();
255 
256  S.StartStatic(XO("Output"));
257  {
258  S.StartMultiColumn(3, wxEXPAND);
259  {
260  S.SetStretchyCol(2);
261 
262  // Gain control
263  mGainT = S.Id(ID_Gain)
264  .Validator<FloatingPointValidator<double>>(
265  1, &mGain, NumValidatorStyle::DEFAULT, MIN_Gain, MAX_Gain)
266  .AddTextBox(XXO("&Volume (dB):"), wxT(""), 10);
267 
268  mGainS = S.Id(ID_Gain)
269  .Name(XO("Level"))
270  .Style(wxSL_HORIZONTAL)
271  .AddSlider( {}, 0, MAX_Gain * SCL_Gain, MIN_Gain * SCL_Gain);
272  }
273  S.EndMultiColumn();
274 
275  S.StartMultiColumn(2, wxCENTER);
276  {
277  // Link checkbox
278  mLinkCheckBox = S.Id(ID_Link).AddCheckBox(XXO("&Link Volume control to Tone controls"),
279  DEF_Link);
280  }
281  S.EndMultiColumn();
282  }
283  S.EndStatic();
284 }
285 
287 {
288  if (!mUIParent->TransferDataToWindow())
289  {
290  return false;
291  }
292 
293  mBassS->SetValue((int) (mBass * SCL_Bass));
294  mTrebleS->SetValue((int) mTreble *SCL_Treble);
295  mGainS->SetValue((int) mGain * SCL_Gain);
296  mLinkCheckBox->SetValue(mLink);
297 
298  return true;
299 }
300 
302 {
303  if (!mUIParent->Validate() || !mUIParent->TransferDataFromWindow())
304  {
305  return false;
306  }
307 
308  return true;
309 }
310 
311 
312 // EffectBassTreble implementation
313 
315 {
316  data.samplerate = sampleRate;
317  data.slope = 0.4f; // same slope for both filters
318  data.hzBass = 250.0f; // could be tunable in a more advanced version
319  data.hzTreble = 4000.0f; // could be tunable in a more advanced version
320 
321  data.a0Bass = 1;
322  data.a1Bass = 0;
323  data.a2Bass = 0;
324  data.b0Bass = 0;
325  data.b1Bass = 0;
326  data.b2Bass = 0;
327 
328  data.a0Treble = 1;
329  data.a1Treble = 0;
330  data.a2Treble = 0;
331  data.b0Treble = 0;
332  data.b1Treble = 0;
333  data.b2Treble = 0;
334 
335  data.xn1Bass = 0;
336  data.xn2Bass = 0;
337  data.yn1Bass = 0;
338  data.yn2Bass = 0;
339 
340  data.xn1Treble = 0;
341  data.xn2Treble = 0;
342  data.yn1Treble = 0;
343  data.yn2Treble = 0;
344 
345  data.bass = -1;
346  data.treble = -1;
347  data.gain = DB_TO_LINEAR(mGain);
348 
349 }
350 
351 
352 // EffectProcessor implementation
353 
354 
356  float **inBlock,
357  float **outBlock,
358  size_t blockLen)
359 {
360  float *ibuf = inBlock[0];
361  float *obuf = outBlock[0];
362 
363  // Set value to ensure correct rounding
364  double oldBass = DB_TO_LINEAR(mBass);
365  double oldTreble = DB_TO_LINEAR(mTreble);
366 
367  data.gain = DB_TO_LINEAR(mGain);
368 
369  // Compute coefficients of the low shelf biquand IIR filter
370  if (data.bass != oldBass)
371  Coefficients(data.hzBass, data.slope, mBass, data.samplerate, kBass,
372  data.a0Bass, data.a1Bass, data.a2Bass,
373  data.b0Bass, data.b1Bass, data.b2Bass);
374 
375  // Compute coefficients of the high shelf biquand IIR filter
376  if (data.treble != oldTreble)
378  data.a0Treble, data.a1Treble, data.a2Treble,
379  data.b0Treble, data.b1Treble, data.b2Treble);
380 
381  for (decltype(blockLen) i = 0; i < blockLen; i++) {
382  obuf[i] = DoFilter(data, ibuf[i]) * data.gain;
383  }
384 
385  return blockLen;
386 }
387 
388 
389 
390 // Effect implementation
391 
392 
393 void EffectBassTreble::Coefficients(double hz, double slope, double gain, double samplerate, int type,
394  double& a0, double& a1, double& a2,
395  double& b0, double& b1, double& b2)
396 {
397  double w = 2 * M_PI * hz / samplerate;
398  double a = exp(log(10.0) * gain / 40);
399  double b = sqrt((a * a + 1) / slope - (pow((a - 1), 2)));
400 
401  if (type == kBass)
402  {
403  b0 = a * ((a + 1) - (a - 1) * cos(w) + b * sin(w));
404  b1 = 2 * a * ((a - 1) - (a + 1) * cos(w));
405  b2 = a * ((a + 1) - (a - 1) * cos(w) - b * sin(w));
406  a0 = ((a + 1) + (a - 1) * cos(w) + b * sin(w));
407  a1 = -2 * ((a - 1) + (a + 1) * cos(w));
408  a2 = (a + 1) + (a - 1) * cos(w) - b * sin(w);
409  }
410  else //assumed kTreble
411  {
412  b0 = a * ((a + 1) + (a - 1) * cos(w) + b * sin(w));
413  b1 = -2 * a * ((a - 1) + (a + 1) * cos(w));
414  b2 = a * ((a + 1) + (a - 1) * cos(w) - b * sin(w));
415  a0 = ((a + 1) - (a - 1) * cos(w) + b * sin(w));
416  a1 = 2 * ((a - 1) - (a + 1) * cos(w));
417  a2 = (a + 1) - (a - 1) * cos(w) - b * sin(w);
418  }
419 }
420 
422 {
423  // Bass filter
424  float out = (data.b0Bass * in + data.b1Bass * data.xn1Bass + data.b2Bass * data.xn2Bass -
425  data.a1Bass * data.yn1Bass - data.a2Bass * data.yn2Bass) / data.a0Bass;
426  data.xn2Bass = data.xn1Bass;
427  data.xn1Bass = in;
428  data.yn2Bass = data.yn1Bass;
429  data.yn1Bass = out;
430 
431  // Treble filter
432  in = out;
433  out = (data.b0Treble * in + data.b1Treble * data.xn1Treble + data.b2Treble * data.xn2Treble -
434  data.a1Treble * data.yn1Treble - data.a2Treble * data.yn2Treble) / data.a0Treble;
435  data.xn2Treble = data.xn1Treble;
436  data.xn1Treble = in;
437  data.yn2Treble = data.yn1Treble;
438  data.yn1Treble = out;
439 
440  return out;
441 }
442 
443 
444 void EffectBassTreble::OnBassText(wxCommandEvent & WXUNUSED(evt))
445 {
446  double oldBass = mBass;
447 
448  if (!EnableApply(mUIParent->TransferDataFromWindow()))
449  {
450  return;
451  }
452 
453  if (mLink) UpdateGain(oldBass, kBass);
454  mBassS->SetValue((int) (mBass * SCL_Bass));
455 }
456 
457 void EffectBassTreble::OnTrebleText(wxCommandEvent & WXUNUSED(evt))
458 {
459  double oldTreble = mTreble;
460 
461  if (!EnableApply(mUIParent->TransferDataFromWindow()))
462  {
463  return;
464  }
465 
466  if (mLink) UpdateGain(oldTreble, kTreble);
467  mTrebleS->SetValue((int) (mTreble * SCL_Treble));
468 }
469 
470 void EffectBassTreble::OnGainText(wxCommandEvent & WXUNUSED(evt))
471 {
472  if (!EnableApply(mUIParent->TransferDataFromWindow()))
473  {
474  return;
475  }
476 
477  mGainS->SetValue((int) (mGain * SCL_Gain));
478 }
479 
480 void EffectBassTreble::OnBassSlider(wxCommandEvent & evt)
481 {
482  double oldBass = mBass;
483  mBass = (double) evt.GetInt() / SCL_Bass;
484  mBassT->GetValidator()->TransferToWindow();
485 
486  if (mLink) UpdateGain(oldBass, kBass);
487  EnableApply(mUIParent->Validate());
488 }
489 
490 void EffectBassTreble::OnTrebleSlider(wxCommandEvent & evt)
491 {
492  double oldTreble = mTreble;
493  mTreble = (double) evt.GetInt() / SCL_Treble;
494  mTrebleT->GetValidator()->TransferToWindow();
495 
496  if (mLink) UpdateGain(oldTreble, kTreble);
497  EnableApply(mUIParent->Validate());
498 }
499 
500 void EffectBassTreble::OnGainSlider(wxCommandEvent & evt)
501 {
502  mGain = (double) evt.GetInt() / SCL_Gain;
503  mGainT->GetValidator()->TransferToWindow();
504 
505  EnableApply(mUIParent->Validate());
506 }
507 
508 void EffectBassTreble::OnLinkCheckbox(wxCommandEvent& /*evt*/)
509 {
510  mLink = mLinkCheckBox->GetValue();
511 }
512 
513 void EffectBassTreble::UpdateGain(double oldVal, int control)
514 {
515  double newVal;
516  oldVal = (oldVal > 0)? oldVal / 2.0 : oldVal / 4.0;
517 
518  if (control == kBass)
519  newVal = (mBass > 0)? mBass / 2.0 : mBass / 4.0;
520  else
521  newVal = (mTreble > 0)? mTreble / 2.0 : mTreble / 4.0;
522 
523  mGain -= newVal - oldVal;
524  mGain = std::min(MAX_Gain, std::max(MIN_Gain, mGain));
525 
526  mGainS->SetValue(mGain);
527  mGainT->GetValidator()->TransferToWindow();
528 
529 }
EffectBassTreble::GetType
EffectType GetType() override
Type determines how it behaves.
Definition: BassTreble.cpp:108
EffectBassTreble::GetAudioOutCount
unsigned GetAudioOutCount() override
Definition: BassTreble.cpp:126
TranslatableString
Holds a msgid for the translation catalog; may also bind format arguments.
Definition: TranslatableString.h:32
EffectBassTrebleState
Definition: BassTreble.h:23
EffectBassTrebleState::xn2Treble
double xn2Treble
Definition: BassTreble.h:33
CommandParameters
CommandParameters, derived from wxFileConfig, is essentially doing the same things as the Shuttle cla...
Definition: EffectAutomationParameters.h:67
EffectBassTrebleState::slope
double slope
Definition: BassTreble.h:29
EffectBassTreble::TransferDataFromWindow
bool TransferDataFromWindow() override
Definition: BassTreble.cpp:301
kBass
@ kBass
Definition: BassTreble.cpp:56
EffectBassTreble::RealtimeAddProcessor
bool RealtimeAddProcessor(unsigned numChannels, float sampleRate) override
Definition: BassTreble.cpp:152
EffectBassTreble::mTrebleT
wxTextCtrl * mTrebleT
Definition: BassTreble.h:116
EffectBassTrebleState::b0Treble
double b0Treble
Definition: BassTreble.h:31
EffectBassTrebleState::b2Treble
double b2Treble
Definition: BassTreble.h:31
EffectTypeProcess
@ EffectTypeProcess
Definition: EffectInterface.h:56
DB_TO_LINEAR
const double MIN_Threshold_Linear DB_TO_LINEAR(MIN_Threshold_dB)
Effect::EnableApply
bool EnableApply(bool enable=true)
Definition: Effect.cpp:1694
EffectBassTrebleState::yn1Bass
double yn1Bass
Definition: BassTreble.h:32
S
#define S(N)
Definition: ToChars.cpp:64
EffectBassTreble::mLinkCheckBox
wxCheckBox * mLinkCheckBox
Definition: BassTreble.h:119
EffectBassTrebleState::yn2Treble
double yn2Treble
Definition: BassTreble.h:33
EffectBassTreble::GetAutomationParameters
bool GetAutomationParameters(CommandParameters &parms) override
Save current settings into parms.
Definition: BassTreble.cpp:185
EffectBassTrebleState::a2Bass
double a2Bass
Definition: BassTreble.h:30
EffectBassTreble::mTrebleS
wxSlider * mTrebleS
Definition: BassTreble.h:112
EffectBassTrebleState::yn2Bass
double yn2Bass
Definition: BassTreble.h:32
EffectBassTreble::ProcessInitialize
bool ProcessInitialize(sampleCount totalLen, ChannelNames chanMap=NULL) override
Called for destructive, non-realtime effect computation.
Definition: BassTreble.cpp:131
EffectBassTrebleState::gain
double gain
Definition: BassTreble.h:28
EffectBassTreble::RealtimeFinalize
bool RealtimeFinalize() override
Definition: BassTreble.cpp:163
kShelfType
kShelfType
Definition: BassTreble.cpp:55
EffectBassTrebleState::b0Bass
double b0Bass
Definition: BassTreble.h:30
EffectBassTreble::RealtimeProcess
size_t RealtimeProcess(int group, float **inbuf, float **outbuf, size_t numSamples) override
Definition: BassTreble.cpp:170
EffectBassTrebleState::a2Treble
double a2Treble
Definition: BassTreble.h:31
EffectBassTreble::GetAudioInCount
unsigned GetAudioInCount() override
Definition: BassTreble.cpp:121
XO
#define XO(s)
Definition: Internat.h:31
ShuttleParams
Shuttle that deals with parameters. This is a base class with lots of virtual functions that do nothi...
Definition: Shuttle.h:61
EffectBassTrebleState::b1Treble
double b1Treble
Definition: BassTreble.h:31
EffectBassTrebleState::bass
double bass
Definition: BassTreble.h:27
EffectBassTreble::OnGainText
void OnGainText(wxCommandEvent &evt)
Definition: BassTreble.cpp:470
EffectBassTrebleState::samplerate
float samplerate
Definition: BassTreble.h:25
ComponentInterfaceSymbol
ComponentInterfaceSymbol pairs a persistent string identifier used internally with an optional,...
Definition: ComponentInterfaceSymbol.h:27
EffectBassTrebleState::hzTreble
double hzTreble
Definition: BassTreble.h:29
EffectBassTreble::OnLinkCheckbox
void OnLinkCheckbox(wxCommandEvent &evt)
Definition: BassTreble.cpp:508
EffectBassTrebleState::b2Bass
double b2Bass
Definition: BassTreble.h:30
EffectBassTreble::RealtimeInitialize
bool RealtimeInitialize() override
Definition: BassTreble.cpp:143
EffectBassTrebleState::xn1Treble
double xn1Treble
Definition: BassTreble.h:33
EffectBassTreble::Symbol
static const ComponentInterfaceSymbol Symbol
Definition: BassTreble.h:39
EffectBassTreble::mGainT
wxTextCtrl * mGainT
Definition: BassTreble.h:117
EffectBassTreble::InstanceInit
void InstanceInit(EffectBassTrebleState &data, float sampleRate)
Definition: BassTreble.cpp:314
EffectBassTreble::CheckWhetherSkipEffect
bool CheckWhetherSkipEffect() override
Definition: BassTreble.cpp:210
EffectBassTreble::OnBassSlider
void OnBassSlider(wxCommandEvent &evt)
Definition: BassTreble.cpp:480
EffectBassTreble::DefineParams
bool DefineParams(ShuttleParams &S) override
Definition: BassTreble.cpp:177
anonymous_namespace{BassTreble.cpp}::reg
BuiltinEffectsModule::Registration< EffectBassTreble > reg
Definition: BassTreble.cpp:63
kTreble
@ kTreble
Definition: BassTreble.cpp:57
XXO
#define XXO(s)
Definition: Internat.h:44
EffectBassTreble::mSlaves
std::vector< EffectBassTrebleState > mSlaves
Definition: BassTreble.h:104
EffectBassTreble::OnTrebleText
void OnTrebleText(wxCommandEvent &evt)
Definition: BassTreble.cpp:457
EffectBassTreble::DoFilter
float DoFilter(EffectBassTrebleState &data, float in)
Definition: BassTreble.cpp:421
Param
Param(Bass, double, wxT("Bass"), 0.0, -30.0, 30.0, 1)
ID_Gain
@ ID_Gain
Definition: BassTreble.cpp:41
EffectBassTreble::mGain
double mGain
Definition: BassTreble.h:108
EffectBassTreble::ProcessBlock
size_t ProcessBlock(float **inBlock, float **outBlock, size_t blockLen) override
Called for destructive, non-realtime effect computation.
Definition: BassTreble.cpp:138
EffectBassTreble::mLink
bool mLink
Definition: BassTreble.h:109
EffectBassTreble::SetAutomationParameters
bool SetAutomationParameters(CommandParameters &parms) override
Change settings to those stored in parms.
Definition: BassTreble.cpp:195
EffectBassTrebleState::a0Treble
double a0Treble
Definition: BassTreble.h:31
EffectBassTrebleState::b1Bass
double b1Bass
Definition: BassTreble.h:30
EffectBassTreble::mBass
double mBass
Definition: BassTreble.h:106
EffectBassTrebleState::yn1Treble
double yn1Treble
Definition: BassTreble.h:33
EffectBassTreble::PopulateOrExchange
void PopulateOrExchange(ShuttleGui &S) override
Definition: BassTreble.cpp:218
EffectBassTrebleState::xn1Bass
double xn1Bass
Definition: BassTreble.h:32
ChannelNames
enum ChannelName * ChannelNames
EffectBassTreble::OnGainSlider
void OnGainSlider(wxCommandEvent &evt)
Definition: BassTreble.cpp:500
ReadAndVerifyDouble
#define ReadAndVerifyDouble(name)
Definition: Effect.h:592
EffectBassTreble::SupportsRealtime
bool SupportsRealtime() override
Whether the effect supports realtime previewing (while audio is playing).
Definition: BassTreble.cpp:113
EffectBassTreble::~EffectBassTreble
virtual ~EffectBassTreble()
Definition: BassTreble.cpp:85
EffectBassTrebleState::a1Treble
double a1Treble
Definition: BassTreble.h:31
EffectBassTreble
A high shelf and low shelf filter.
Definition: BassTreble.h:37
EffectBassTrebleState::xn2Bass
double xn2Bass
Definition: BassTreble.h:32
LoadEffects.h
EffectBassTreble::OnTrebleSlider
void OnTrebleSlider(wxCommandEvent &evt)
Definition: BassTreble.cpp:490
min
int min(int a, int b)
Definition: CompareAudioCommand.cpp:106
EffectBassTreble::mBassS
wxSlider * mBassS
Definition: BassTreble.h:111
ID_Treble
@ ID_Treble
Definition: BassTreble.cpp:40
EffectBassTreble::mBassT
wxTextCtrl * mBassT
Definition: BassTreble.h:115
EffectBassTreble::TransferDataToWindow
bool TransferDataToWindow() override
Definition: BassTreble.cpp:286
Effect::mSampleRate
double mSampleRate
Definition: Effect.h:418
EffectBassTreble::Coefficients
void Coefficients(double hz, double slope, double gain, double samplerate, int type, double &a0, double &a1, double &a2, double &b0, double &b1, double &b2)
Definition: BassTreble.cpp:393
BuiltinEffectsModule::Registration
Definition: LoadEffects.h:40
Effect::mUIParent
wxWindow * mUIParent
Definition: Effect.h:438
TaggedIdentifier< ManualPageIDTag >
EffectBassTreble::mTreble
double mTreble
Definition: BassTreble.h:107
sampleCount
Positions or offsets within audio files need a wide type.
Definition: SampleCount.h:18
EffectBassTreble::OnBassText
void OnBassText(wxCommandEvent &evt)
Definition: BassTreble.cpp:444
BassTreble.h
EffectBassTreble::mGainS
wxSlider * mGainS
Definition: BassTreble.h:113
EffectBassTreble::UpdateGain
void UpdateGain(double oldVal, int control)
Definition: BassTreble.cpp:513
EffectBassTreble::ManualPage
ManualPageID ManualPage() override
Name of a page in the Audacity alpha manual, default is empty.
Definition: BassTreble.cpp:101
EffectBassTrebleState::a1Bass
double a1Bass
Definition: BassTreble.h:30
M_PI
#define M_PI
Definition: Distortion.cpp:29
Prefs.h
ID_Link
@ ID_Link
Definition: BassTreble.cpp:42
EffectBassTreble::GetSymbol
ComponentInterfaceSymbol GetSymbol() override
Definition: BassTreble.cpp:91
EffectBassTreble::InstanceProcess
size_t InstanceProcess(EffectBassTrebleState &data, float **inBlock, float **outBlock, size_t blockLen)
Definition: BassTreble.cpp:355
EffectBassTrebleState::a0Bass
double a0Bass
Definition: BassTreble.h:30
EffectBassTrebleState::hzBass
double hzBass
Definition: BassTreble.h:29
EffectType
EffectType
Definition: EffectInterface.h:52
EffectBassTreble::GetDescription
TranslatableString GetDescription() override
Definition: BassTreble.cpp:96
Effect::SetBlockSize
size_t SetBlockSize(size_t maxBlockSize) override
Definition: Effect.cpp:294
END_EVENT_TABLE
END_EVENT_TABLE()
EffectBassTreble::mMaster
EffectBassTrebleState mMaster
Definition: BassTreble.h:103
EffectBassTrebleState::treble
double treble
Definition: BassTreble.h:26
ReadAndVerifyBool
#define ReadAndVerifyBool(name)
Definition: Effect.h:594
ID_Bass
@ ID_Bass
Definition: BassTreble.cpp:39
ShuttleGui
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.
Definition: ShuttleGui.h:631