Audacity  3.2.0
Classes | Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | List of all members
EffectReverb Class Referencefinal

A reverberation effect. More...

#include <Reverb.h>

Inheritance diagram for EffectReverb:
[legend]
Collaboration diagram for EffectReverb:
[legend]

Classes

struct  Params
 

Public Member Functions

 EffectReverb ()
 
virtual ~EffectReverb ()
 
ComponentInterfaceSymbol GetSymbol () override
 
TranslatableString GetDescription () override
 
ManualPageID ManualPage () override
 Name of a page in the Audacity alpha manual, default is empty. More...
 
EffectType GetType () override
 Type determines how it behaves. More...
 
bool GetAutomationParameters (CommandParameters &parms) override
 Save current settings into parms. More...
 
bool SetAutomationParameters (CommandParameters &parms) override
 Change settings to those stored in parms. More...
 
RegistryPaths GetFactoryPresets () override
 Report names of factory presets. More...
 
bool LoadFactoryPreset (int id) override
 Change settings to the preset whose name is GetFactoryPresets()[id] More...
 
unsigned GetAudioInCount () override
 
unsigned GetAudioOutCount () override
 
bool ProcessInitialize (sampleCount totalLen, ChannelNames chanMap=NULL) override
 Called for destructive, non-realtime effect computation. More...
 
bool ProcessFinalize () override
 Called for destructive, non-realtime effect computation. More...
 
size_t ProcessBlock (float **inBlock, float **outBlock, size_t blockLen) override
 Called for destructive, non-realtime effect computation. More...
 
bool DefineParams (ShuttleParams &S) override
 
bool Startup () override
 
void PopulateOrExchange (ShuttleGui &S) override
 
bool TransferDataToWindow () override
 
bool TransferDataFromWindow () override
 
- Public Member Functions inherited from Effect
 Effect ()
 
virtual ~Effect ()
 
PluginPath GetPath () override
 
VendorSymbol GetVendor () override
 
wxString GetVersion () override
 
EffectFamilySymbol GetFamily () override
 Report identifier and user-visible name of the effect protocol. More...
 
bool IsInteractive () override
 Whether the effect needs a dialog for entry of settings. More...
 
bool IsDefault () override
 Whether the effect sorts "above the line" in the menus. More...
 
bool IsLegacy () override
 
bool SupportsRealtime () override
 Whether the effect supports realtime previewing (while audio is playing). More...
 
bool SupportsAutomation () override
 Whether the effect can be used without the UI, in a macro. More...
 
bool LoadUserPreset (const RegistryPath &name) override
 Change settings to a user-named preset. More...
 
bool SaveUserPreset (const RegistryPath &name) override
 Save current settings as a user-named preset. More...
 
bool LoadFactoryDefaults () override
 Change settings back to "factory default". More...
 
bool SetHost (EffectHostInterface *host) override
 
int GetMidiInCount () override
 
int GetMidiOutCount () override
 
sampleCount GetLatency () override
 Called for destructive, non-realtime effect computation. More...
 
size_t GetTailSize () override
 
void SetSampleRate (double rate) override
 
size_t SetBlockSize (size_t maxBlockSize) override
 
size_t GetBlockSize () const override
 
bool RealtimeInitialize () override
 
bool RealtimeAddProcessor (unsigned numChannels, float sampleRate) override
 
bool RealtimeFinalize () override
 
bool RealtimeSuspend () override
 
bool RealtimeResume () noexcept override
 
bool RealtimeProcessStart () override
 
size_t RealtimeProcess (int group, float **inbuf, float **outbuf, size_t numSamples) override
 
bool RealtimeProcessEnd () noexcept override
 
int ShowClientInterface (wxWindow &parent, wxDialog &dialog, bool forceModal=false) override
 
bool PopulateUI (ShuttleGui &S) final
 Adds controls to a panel that is given as the parent window of S More...
 
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
 
EffectDefinitionInterfaceGetDefinition () override
 
double GetDuration () override
 
NumericFormatSymbol GetDurationFormat () override
 
virtual NumericFormatSymbol GetSelectionFormat ()
 
void SetDuration (double duration) override
 
RegistryPath GetUserPresetsGroup (const RegistryPath &name) override
 
RegistryPath GetCurrentSettingsGroup () override
 
RegistryPath GetFactoryDefaultsGroup () override
 
virtual wxString GetSavedStateGroup ()
 
int ShowHostInterface (wxWindow &parent, const EffectDialogFactory &factory, bool forceModal=false) override
 
unsigned TestUIFlags (unsigned mask)
 
void SetPresetParameters (const wxArrayString *Names, const wxArrayString *Values)
 
virtual bool Startup (EffectUIClientInterface *client)
 
virtual bool GetAutomationParametersAsString (wxString &parms)
 
virtual bool SetAutomationParametersFromString (const wxString &parms)
 
virtual bool IsBatchProcessing ()
 
virtual void SetBatchProcessing (bool start)
 
bool DoEffect (double projectRate, TrackList *list, WaveTrackFactory *factory, NotifyingSelectedRegion &selectedRegion, unsigned flags, wxWindow *pParent=nullptr, const EffectDialogFactory &dialogFactory={})
 
bool Delegate (Effect &delegate, wxWindow &parent, const EffectDialogFactory &factory)
 
int MessageBox (const TranslatableString &message, long style=DefaultMessageBoxStyle, const TranslatableString &titleStr={})
 
- Public Member Functions inherited from EffectUIClientInterface
virtual ~EffectUIClientInterface ()
 
- Public Member Functions inherited from EffectProcessor
virtual ~EffectProcessor ()
 
- Public Member Functions inherited from EffectDefinitionInterface
virtual ~EffectDefinitionInterface ()
 
virtual EffectType GetClassification ()
 Determines which menu it appears in; default same as GetType(). More...
 
virtual bool EnablesDebug ()
 Whether the effect dialog should have a Debug button; default, always false. More...
 
virtual FilePath HelpPage ()
 Fully qualified local help file name, default is empty. More...
 
virtual bool IsHiddenFromMenus ()
 Default is false. More...
 
- Public Member Functions inherited from ComponentInterface
virtual ~ComponentInterface ()
 
TranslatableString GetName ()
 
virtual bool DefineParams (ShuttleParams &WXUNUSED(S))
 
- Public Member Functions inherited from EffectUIHostInterface
virtual ~EffectUIHostInterface ()
 
- Public Member Functions inherited from EffectHostInterface
virtual ~EffectHostInterface ()
 

Static Public Attributes

static const ComponentInterfaceSymbol Symbol { XO("Reverb") }
 
- Static Public Attributes inherited from Effect
static const wxString kUserPresetIdent = wxT("User Preset:")
 
static const wxString kFactoryPresetIdent = wxT("Factory Preset:")
 
static const wxString kCurrentSettingsIdent = wxT("<Current Settings>")
 
static const wxString kFactoryDefaultsIdent = wxT("<Factory Defaults>")
 

Private Member Functions

void SetTitle (const wxString &name={})
 
 SpinSlider (RoomSize) SpinSlider(PreDelay) SpinSlider(Reverberance) SpinSlider(HfDamping) SpinSlider(ToneLow) SpinSlider(ToneHigh) SpinSlider(WetGain) SpinSlider(DryGain) SpinSlider(StereoWidth) wxCheckBox *mWetOnlyC
 

Private Attributes

SpinSliderHandlers(RoomSize) SpinSliderHandlers(PreDelay) SpinSliderHandlers(Reverberance) SpinSliderHandlers(HfDamping) SpinSliderHandlers(ToneLow) SpinSliderHandlers(ToneHigh) SpinSliderHandlers(WetGain) SpinSliderHandlers(DryGain) SpinSliderHandlers(StereoWidth) private Reverb_priv_tmP
 
Params mParams
 
bool mProcessingEvent
 

Additional Inherited Members

- Public Types inherited from Effect
enum  : long { DefaultMessageBoxStyle = wxOK | wxCENTRE }
 
- Static Public Member Functions inherited from Effect
static void IncEffectCounter ()
 
- Static Public Member Functions inherited from EffectDefinitionInterface
static Identifier GetSquashedName (const Identifier &ident)
 A utility that strips spaces and CamelCases a name. More...
 
- Protected Member Functions inherited from Effect
bool EnableApply (bool enable=true)
 
bool EnablePreview (bool enable=true)
 
virtual bool Init ()
 
virtual bool CheckWhetherSkipEffect ()
 
virtual bool Process ()
 
virtual bool ProcessPass ()
 
virtual bool InitPass1 ()
 
virtual bool InitPass2 ()
 
virtual void End ()
 
virtual double CalcPreviewInputLength (double previewLength)
 
virtual void Preview (bool dryOnly)
 
bool TotalProgress (double frac, const TranslatableString &={})
 
bool TrackProgress (int whichTrack, double frac, const TranslatableString &={})
 
bool TrackGroupProgress (int whichGroup, double frac, const TranslatableString &={})
 
int GetNumWaveTracks ()
 
int GetNumWaveGroups ()
 
void GetBounds (const WaveTrack &track, const WaveTrack *pRight, sampleCount *start, sampleCount *len)
 
void SetLinearEffectFlag (bool linearEffectFlag)
 
void SetPreviewFullSelectionFlag (bool previewDurationFlag)
 
bool IsPreviewing ()
 
void IncludeNotSelectedPreviewTracks (bool includeNotSelected)
 
void CopyInputTracks (bool allSyncLockSelected=false)
 
std::shared_ptr< AddedAnalysisTrackAddAnalysisTrack (const wxString &name=wxString())
 
ModifiedAnalysisTrack ModifyAnalysisTrack (const LabelTrack *pOrigTrack, const wxString &name=wxString())
 
void ReplaceProcessedTracks (const bool bGoodResult)
 
TrackAddToOutputTracks (const std::shared_ptr< Track > &t)
 
const TrackListinputTracks () const
 
const AudacityProjectFindProject () const
 
- Protected Attributes inherited from Effect
BasicUI::ProgressDialogmProgress = nullptr
 
double mProjectRate
 
double mSampleRate
 
WaveTrackFactorymFactory
 
std::shared_ptr< TrackListmOutputTracks
 
double mT0
 
double mT1
 
wxArrayString mPresetNames
 
wxArrayString mPresetValues
 
int mPass
 
wxWeakRef< wxDialog > mHostUIDialog
 This smart pointer tracks the lifetime of the dialog. More...
 
wxWeakRef< wxDialog > mUIDialog
 This weak pointer may be the same as the above, or null. More...
 
wxWindow * mUIParent
 
unsigned mUIFlags { 0 }
 
sampleCount mSampleCnt
 
- Static Protected Attributes inherited from Effect
static int nEffectsDone =0
 

Detailed Description

A reverberation effect.

Definition at line 24 of file Reverb.h.

Constructor & Destructor Documentation

◆ EffectReverb()

EffectReverb::EffectReverb ( )

◆ ~EffectReverb()

EffectReverb::~EffectReverb ( )
virtual

Definition at line 136 of file Reverb.cpp.

137 {
138 }

Member Function Documentation

◆ DefineParams()

bool EffectReverb::DefineParams ( ShuttleParams S)
override

Definition at line 281 of file Reverb.cpp.

281  {
282  S.SHUTTLE_PARAM( mParams.mRoomSize, RoomSize );
283  S.SHUTTLE_PARAM( mParams.mPreDelay, PreDelay );
284  S.SHUTTLE_PARAM( mParams.mReverberance, Reverberance );
285  S.SHUTTLE_PARAM( mParams.mHfDamping, HfDamping );
286  S.SHUTTLE_PARAM( mParams.mToneLow, ToneLow );
287  S.SHUTTLE_PARAM( mParams.mToneHigh, ToneHigh );
288  S.SHUTTLE_PARAM( mParams.mWetGain, WetGain );
289  S.SHUTTLE_PARAM( mParams.mDryGain, DryGain );
290  S.SHUTTLE_PARAM( mParams.mStereoWidth, StereoWidth );
291  S.SHUTTLE_PARAM( mParams.mWetOnly, WetOnly );
292  return true;
293 }

References EffectReverb::Params::mDryGain, EffectReverb::Params::mHfDamping, mParams, EffectReverb::Params::mPreDelay, EffectReverb::Params::mReverberance, EffectReverb::Params::mRoomSize, EffectReverb::Params::mStereoWidth, EffectReverb::Params::mToneHigh, EffectReverb::Params::mToneLow, EffectReverb::Params::mWetGain, EffectReverb::Params::mWetOnly, and S.

◆ GetAudioInCount()

unsigned EffectReverb::GetAudioInCount ( )
overridevirtual

Reimplemented from Effect.

Definition at line 166 of file Reverb.cpp.

167 {
168  return mParams.mStereoWidth ? 2 : 1;
169 }

References mParams, and EffectReverb::Params::mStereoWidth.

◆ GetAudioOutCount()

unsigned EffectReverb::GetAudioOutCount ( )
overridevirtual

Reimplemented from Effect.

Definition at line 171 of file Reverb.cpp.

172 {
173  return mParams.mStereoWidth ? 2 : 1;
174 }

References mParams, and EffectReverb::Params::mStereoWidth.

◆ GetAutomationParameters()

bool EffectReverb::GetAutomationParameters ( CommandParameters parms)
overridevirtual

Save current settings into parms.

Reimplemented from Effect.

Definition at line 295 of file Reverb.cpp.

296 {
297  parms.Write(KEY_RoomSize, mParams.mRoomSize);
298  parms.Write(KEY_PreDelay, mParams.mPreDelay);
299  parms.Write(KEY_Reverberance, mParams.mReverberance);
300  parms.Write(KEY_HfDamping, mParams.mHfDamping);
301  parms.Write(KEY_ToneLow, mParams.mToneLow);
302  parms.Write(KEY_ToneHigh, mParams.mToneHigh);
303  parms.Write(KEY_WetGain, mParams.mWetGain);
304  parms.Write(KEY_DryGain, mParams.mDryGain);
305  parms.Write(KEY_StereoWidth, mParams.mStereoWidth);
306  parms.Write(KEY_WetOnly, mParams.mWetOnly);
307 
308  return true;
309 }

References EffectReverb::Params::mDryGain, EffectReverb::Params::mHfDamping, mParams, EffectReverb::Params::mPreDelay, EffectReverb::Params::mReverberance, EffectReverb::Params::mRoomSize, EffectReverb::Params::mStereoWidth, EffectReverb::Params::mToneHigh, EffectReverb::Params::mToneLow, EffectReverb::Params::mWetGain, and EffectReverb::Params::mWetOnly.

◆ GetDescription()

TranslatableString EffectReverb::GetDescription ( )
overridevirtual

Reimplemented from Effect.

Definition at line 147 of file Reverb.cpp.

148 {
149  return XO("Adds ambience or a \"hall effect\"");
150 }

References XO.

◆ GetFactoryPresets()

RegistryPaths EffectReverb::GetFactoryPresets ( )
overridevirtual

Report names of factory presets.

Reimplemented from Effect.

Definition at line 338 of file Reverb.cpp.

339 {
341 
342  for (size_t i = 0; i < WXSIZEOF(FactoryPresets); i++)
343  {
344  names.push_back( FactoryPresets[i].name.Translation() );
345  }
346 
347  return names;
348 }

References FactoryPresets, name, names, and TranslatableString::Translation().

Here is the call graph for this function:

◆ GetSymbol()

ComponentInterfaceSymbol EffectReverb::GetSymbol ( )
overridevirtual

Reimplemented from Effect.

Definition at line 142 of file Reverb.cpp.

143 {
144  return Symbol;
145 }

References Symbol.

◆ GetType()

EffectType EffectReverb::GetType ( )
overridevirtual

Type determines how it behaves.

Reimplemented from Effect.

Definition at line 159 of file Reverb.cpp.

160 {
161  return EffectTypeProcess;
162 }

References EffectTypeProcess.

◆ LoadFactoryPreset()

bool EffectReverb::LoadFactoryPreset ( int  id)
overridevirtual

Change settings to the preset whose name is GetFactoryPresets()[id]

Reimplemented from Effect.

Definition at line 350 of file Reverb.cpp.

351 {
352  if (id < 0 || id >= (int) WXSIZEOF(FactoryPresets))
353  {
354  return false;
355  }
356 
357  mParams = FactoryPresets[id].params;
358 
359  if (mUIDialog)
360  {
362  }
363 
364  return true;
365 }

References FactoryPresets, id, mParams, Effect::mUIDialog, and TransferDataToWindow().

Here is the call graph for this function:

◆ ManualPage()

ManualPageID EffectReverb::ManualPage ( )
overridevirtual

Name of a page in the Audacity alpha manual, default is empty.

Reimplemented from EffectDefinitionInterface.

Definition at line 152 of file Reverb.cpp.

153 {
154  return L"Reverb";
155 }

◆ PopulateOrExchange()

void EffectReverb::PopulateOrExchange ( ShuttleGui S)
overridevirtual

Reimplemented from Effect.

Definition at line 437 of file Reverb.cpp.

438 {
439  S.AddSpace(0, 5);
440 
441  S.StartMultiColumn(3, wxEXPAND);
442  {
443  S.SetStretchyCol(2);
444 
445 #define SpinSlider(n, p) \
446  m ## n ## T = S.Id(ID_ ## n). \
447  AddSpinCtrl( p, DEF_ ## n, MAX_ ## n, MIN_ ## n); \
448  S; \
449  m ## n ## S = S.Id(ID_ ## n) \
450  .Style(wxSL_HORIZONTAL) \
451  .AddSlider( {}, DEF_ ## n, MAX_ ## n, MIN_ ## n);
452 
453  SpinSlider(RoomSize, XXO("&Room Size (%):"))
454  SpinSlider(PreDelay, XXO("&Pre-delay (ms):"))
455  SpinSlider(Reverberance, XXO("Rever&berance (%):"))
456  SpinSlider(HfDamping, XXO("Da&mping (%):"))
457  SpinSlider(ToneLow, XXO("Tone &Low (%):"))
458  SpinSlider(ToneHigh, XXO("Tone &High (%):"))
459  SpinSlider(WetGain, XXO("Wet &Gain (dB):"))
460  SpinSlider(DryGain, XXO("Dr&y Gain (dB):"))
461  SpinSlider(StereoWidth, XXO("Stereo Wid&th (%):"))
462 
463 #undef SpinSlider
464 
465  }
466  S.EndMultiColumn();
467 
468  S.StartHorizontalLay(wxCENTER, false);
469  {
470  mWetOnlyC = S.Id(ID_WetOnly).
471  AddCheckBox(XXO("Wet O&nly"), DEF_WetOnly);
472  }
473  S.EndHorizontalLay();
474 
475  return;
476 }

References ID_WetOnly, S, SpinSlider(), and XXO.

Here is the call graph for this function:

◆ ProcessBlock()

size_t EffectReverb::ProcessBlock ( float **  inBlock,
float **  outBlock,
size_t  blockLen 
)
overridevirtual

Called for destructive, non-realtime effect computation.

Reimplemented from Effect.

Definition at line 221 of file Reverb.cpp.

222 {
223  float *ichans[2] = {NULL, NULL};
224  float *ochans[2] = {NULL, NULL};
225 
226  for (unsigned int c = 0; c < mNumChans; c++)
227  {
228  ichans[c] = inBlock[c];
229  ochans[c] = outBlock[c];
230  }
231 
232  float const dryMult = mParams.mWetOnly ? 0 : dB_to_linear(mParams.mDryGain);
233 
234  auto remaining = blockLen;
235 
236  while (remaining)
237  {
238  auto len = std::min(remaining, decltype(remaining)(BLOCK));
239  for (unsigned int c = 0; c < mNumChans; c++)
240  {
241  // Write the input samples to the reverb fifo. Returned value is the address of the
242  // fifo buffer which contains a copy of the input samples.
243  mP[c].dry = (float *) fifo_write(&mP[c].reverb.input_fifo, len, ichans[c]);
244  reverb_process(&mP[c].reverb, len);
245  }
246 
247  if (mNumChans == 2)
248  {
249  for (decltype(len) i = 0; i < len; i++)
250  {
251  for (int w = 0; w < 2; w++)
252  {
253  ochans[w][i] = dryMult *
254  mP[w].dry[i] +
255  0.5 *
256  (mP[0].wet[w][i] + mP[1].wet[w][i]);
257  }
258  }
259  }
260  else
261  {
262  for (decltype(len) i = 0; i < len; i++)
263  {
264  ochans[0][i] = dryMult *
265  mP[0].dry[i] +
266  mP[0].wet[0][i];
267  }
268  }
269 
270  remaining -= len;
271 
272  for (unsigned int c = 0; c < mNumChans; c++)
273  {
274  ichans[c] += len;
275  ochans[c] += len;
276  }
277  }
278 
279  return blockLen;
280 }

References BLOCK, dB_to_linear, Reverb_priv_t::dry, fifo_write(), EffectReverb::Params::mDryGain, min(), mP, mParams, EffectReverb::Params::mWetOnly, reverb_process(), and Reverb_priv_t::wet.

Here is the call graph for this function:

◆ ProcessFinalize()

bool EffectReverb::ProcessFinalize ( )
overridevirtual

Called for destructive, non-realtime effect computation.

Reimplemented from Effect.

Definition at line 209 of file Reverb.cpp.

210 {
211  for (unsigned int i = 0; i < mNumChans; i++)
212  {
213  reverb_delete(&mP[i].reverb);
214  }
215 
216  free(mP);
217 
218  return true;
219 }

References mP, and reverb_delete().

Here is the call graph for this function:

◆ ProcessInitialize()

bool EffectReverb::ProcessInitialize ( sampleCount  totalLen,
ChannelNames  chanMap = NULL 
)
overridevirtual

Called for destructive, non-realtime effect computation.

Reimplemented from Effect.

Definition at line 178 of file Reverb.cpp.

179 {
180  bool isStereo = false;
181  mNumChans = 1;
182  if (chanMap && chanMap[0] != ChannelNameEOL && chanMap[1] == ChannelNameFrontRight)
183  {
184  isStereo = true;
185  mNumChans = 2;
186  }
187 
188  mP = (Reverb_priv_t *) calloc(sizeof(*mP), mNumChans);
189 
190  for (unsigned int i = 0; i < mNumChans; i++)
191  {
192  reverb_create(&mP[i].reverb,
193  mSampleRate,
199  mParams.mStereoWidth * (isStereo ? 1 : 0),
202  BLOCK,
203  mP[i].wet);
204  }
205 
206  return true;
207 }

References BLOCK, ChannelNameEOL, ChannelNameFrontRight, EffectReverb::Params::mHfDamping, mP, mParams, EffectReverb::Params::mPreDelay, EffectReverb::Params::mReverberance, EffectReverb::Params::mRoomSize, Effect::mSampleRate, EffectReverb::Params::mStereoWidth, EffectReverb::Params::mToneHigh, EffectReverb::Params::mToneLow, EffectReverb::Params::mWetGain, reverb_create(), and Reverb_priv_t::wet.

Here is the call graph for this function:

◆ SetAutomationParameters()

bool EffectReverb::SetAutomationParameters ( CommandParameters parms)
overridevirtual

Change settings to those stored in parms.

Reimplemented from Effect.

Definition at line 311 of file Reverb.cpp.

312 {
313  ReadAndVerifyDouble(RoomSize);
314  ReadAndVerifyDouble(PreDelay);
315  ReadAndVerifyDouble(Reverberance);
316  ReadAndVerifyDouble(HfDamping);
317  ReadAndVerifyDouble(ToneLow);
318  ReadAndVerifyDouble(ToneHigh);
319  ReadAndVerifyDouble(WetGain);
320  ReadAndVerifyDouble(DryGain);
321  ReadAndVerifyDouble(StereoWidth);
322  ReadAndVerifyBool(WetOnly);
323 
324  mParams.mRoomSize = RoomSize;
325  mParams.mPreDelay = PreDelay;
326  mParams.mReverberance = Reverberance;
327  mParams.mHfDamping = HfDamping;
328  mParams.mToneLow = ToneLow;
329  mParams.mToneHigh = ToneHigh;
330  mParams.mWetGain = WetGain;
331  mParams.mDryGain = DryGain;
332  mParams.mStereoWidth = StereoWidth;
333  mParams.mWetOnly = WetOnly;
334 
335  return true;
336 }

References EffectReverb::Params::mDryGain, EffectReverb::Params::mHfDamping, mParams, EffectReverb::Params::mPreDelay, EffectReverb::Params::mReverberance, EffectReverb::Params::mRoomSize, EffectReverb::Params::mStereoWidth, EffectReverb::Params::mToneHigh, EffectReverb::Params::mToneLow, EffectReverb::Params::mWetGain, EffectReverb::Params::mWetOnly, ReadAndVerifyBool, and ReadAndVerifyDouble.

◆ SetTitle()

void EffectReverb::SetTitle ( const wxString &  name = {})
private

◆ SpinSlider()

EffectReverb::SpinSlider ( RoomSize  )
private

Referenced by PopulateOrExchange().

Here is the caller graph for this function:

◆ Startup()

bool EffectReverb::Startup ( )
overridevirtual

Reimplemented from Effect.

Definition at line 369 of file Reverb.cpp.

370 {
371  wxString base = wxT("/Effects/Reverb/");
372 
373  // Migrate settings from 2.1.0 or before
374 
375  // Already migrated, so bail
376  if (gPrefs->Exists(base + wxT("Migrated")))
377  {
378  return true;
379  }
380 
381  // Load the old "current" settings
382  if (gPrefs->Exists(base))
383  {
384  gPrefs->Read(base + wxT("RoomSize"), &mParams.mRoomSize, DEF_RoomSize);
385  gPrefs->Read(base + wxT("Delay"), &mParams.mPreDelay, DEF_PreDelay);
386  gPrefs->Read(base + wxT("Reverberance"), &mParams.mReverberance, DEF_Reverberance);
387  gPrefs->Read(base + wxT("HfDamping"), &mParams.mHfDamping, DEF_HfDamping);
388  gPrefs->Read(base + wxT("ToneLow"), &mParams.mToneLow, DEF_ToneLow);
389  gPrefs->Read(base + wxT("ToneHigh"), &mParams.mToneHigh, DEF_ToneHigh);
390  gPrefs->Read(base + wxT("WetGain"), &mParams.mWetGain, DEF_WetGain);
391  gPrefs->Read(base + wxT("DryGain"), &mParams.mDryGain, DEF_DryGain);
392  gPrefs->Read(base + wxT("StereoWidth"), &mParams.mStereoWidth, DEF_StereoWidth);
393  gPrefs->Read(base + wxT("WetOnly"), &mParams.mWetOnly, DEF_WetOnly);
394 
396 
397  // Do not migrate again
398  gPrefs->Write(base + wxT("Migrated"), true);
399  }
400 
401  // Load the previous user presets
402  for (int i = 0; i < 10; i++)
403  {
404  wxString path = base + wxString::Format(wxT("%d/"), i);
405  if (gPrefs->Exists(path))
406  {
407  Params save = mParams;
408  wxString name;
409 
410  gPrefs->Read(path + wxT("RoomSize"), &mParams.mRoomSize, DEF_RoomSize);
411  gPrefs->Read(path + wxT("Delay"), &mParams.mPreDelay, DEF_PreDelay);
412  gPrefs->Read(path + wxT("Reverberance"), &mParams.mReverberance, DEF_Reverberance);
413  gPrefs->Read(path + wxT("HfDamping"), &mParams.mHfDamping, DEF_HfDamping);
414  gPrefs->Read(path + wxT("ToneLow"), &mParams.mToneLow, DEF_ToneLow);
415  gPrefs->Read(path + wxT("ToneHigh"), &mParams.mToneHigh, DEF_ToneHigh);
416  gPrefs->Read(path + wxT("WetGain"), &mParams.mWetGain, DEF_WetGain);
417  gPrefs->Read(path + wxT("DryGain"), &mParams.mDryGain, DEF_DryGain);
418  gPrefs->Read(path + wxT("StereoWidth"), &mParams.mStereoWidth, DEF_StereoWidth);
419  gPrefs->Read(path + wxT("WetOnly"), &mParams.mWetOnly, DEF_WetOnly);
420  gPrefs->Read(path + wxT("name"), &name, wxEmptyString);
421 
422  if (!name.empty())
423  {
424  name.Prepend(wxT(" - "));
425  }
426  name.Prepend(wxString::Format(wxT("Settings%d"), i));
427 
429 
430  mParams = save;
431  }
432  }
433 
434  return true;
435 }

References TranslatableString::empty(), Effect::GetCurrentSettingsGroup(), Effect::GetUserPresetsGroup(), gPrefs, EffectReverb::Params::mDryGain, EffectReverb::Params::mHfDamping, mParams, EffectReverb::Params::mPreDelay, EffectReverb::Params::mReverberance, EffectReverb::Params::mRoomSize, EffectReverb::Params::mStereoWidth, EffectReverb::Params::mToneHigh, EffectReverb::Params::mToneLow, EffectReverb::Params::mWetGain, EffectReverb::Params::mWetOnly, name, and Effect::SaveUserPreset().

Here is the call graph for this function:

◆ TransferDataFromWindow()

bool EffectReverb::TransferDataFromWindow ( )
overridevirtual

Reimplemented from Effect.

Definition at line 501 of file Reverb.cpp.

502 {
503  if (!mUIParent->Validate())
504  {
505  return false;
506  }
507 
508  mParams.mRoomSize = mRoomSizeS->GetValue();
509  mParams.mPreDelay = mPreDelayS->GetValue();
510  mParams.mReverberance = mReverberanceS->GetValue();
511  mParams.mHfDamping = mHfDampingS->GetValue();
512  mParams.mToneLow = mToneLowS->GetValue();
513  mParams.mToneHigh = mToneHighS->GetValue();
514  mParams.mWetGain = mWetGainS->GetValue();
515  mParams.mDryGain = mDryGainS->GetValue();
516  mParams.mStereoWidth = mStereoWidthS->GetValue();
517  mParams.mWetOnly = mWetOnlyC->GetValue();
518 
519  return true;
520 }

References EffectReverb::Params::mDryGain, EffectReverb::Params::mHfDamping, mParams, EffectReverb::Params::mPreDelay, EffectReverb::Params::mReverberance, EffectReverb::Params::mRoomSize, EffectReverb::Params::mStereoWidth, EffectReverb::Params::mToneHigh, EffectReverb::Params::mToneLow, Effect::mUIParent, EffectReverb::Params::mWetGain, and EffectReverb::Params::mWetOnly.

◆ TransferDataToWindow()

bool EffectReverb::TransferDataToWindow ( )
overridevirtual

Reimplemented from Effect.

Definition at line 478 of file Reverb.cpp.

479 {
480 #define SetSpinSlider(n) \
481  m ## n ## S->SetValue((int) mParams.m ## n); \
482  m ## n ## T->SetValue(wxString::Format(wxT("%d"), (int) mParams.m ## n));
483 
484  SetSpinSlider(RoomSize);
485  SetSpinSlider(PreDelay);
486  SetSpinSlider(Reverberance);
487  SetSpinSlider(HfDamping);
488  SetSpinSlider(ToneLow);
489  SetSpinSlider(ToneHigh);
490  SetSpinSlider(WetGain);
491  SetSpinSlider(DryGain);
492  SetSpinSlider(StereoWidth);
493 
494 #undef SetSpinSlider
495 
496  mWetOnlyC->SetValue((int) mParams.mWetOnly);
497 
498  return true;
499 }

References mParams, EffectReverb::Params::mWetOnly, and SetSpinSlider.

Referenced by LoadFactoryPreset().

Here is the caller graph for this function:

Member Data Documentation

◆ mP

SpinSliderHandlers (RoomSize) SpinSliderHandlers(PreDelay) SpinSliderHandlers(Reverberance) SpinSliderHandlers(HfDamping) SpinSliderHandlers(ToneLow) SpinSliderHandlers(ToneHigh) SpinSliderHandlers(WetGain) SpinSliderHandlers(DryGain) SpinSliderHandlers(StereoWidth) private Reverb_priv_t* EffectReverb::mP
private

Definition at line 99 of file Reverb.h.

Referenced by ProcessBlock(), ProcessFinalize(), and ProcessInitialize().

◆ mParams

Params EffectReverb::mParams
private

◆ mProcessingEvent

bool EffectReverb::mProcessingEvent
private

Definition at line 103 of file Reverb.h.

◆ Symbol

const ComponentInterfaceSymbol EffectReverb::Symbol { XO("Reverb") }
static

Definition at line 27 of file Reverb.h.

Referenced by GetSymbol().


The documentation for this class was generated from the following files:
EffectReverb::Params::mDryGain
double mDryGain
Definition: Reverb.h:41
TranslatableString::empty
bool empty() const
Definition: TranslatableString.h:72
name
const TranslatableString name
Definition: Reverb.cpp:64
Effect::mUIDialog
wxWeakRef< wxDialog > mUIDialog
This weak pointer may be the same as the above, or null.
Definition: Effect.h:437
EffectReverb::mP
SpinSliderHandlers(RoomSize) SpinSliderHandlers(PreDelay) SpinSliderHandlers(Reverberance) SpinSliderHandlers(HfDamping) SpinSliderHandlers(ToneLow) SpinSliderHandlers(ToneHigh) SpinSliderHandlers(WetGain) SpinSliderHandlers(DryGain) SpinSliderHandlers(StereoWidth) private Reverb_priv_t * mP
Definition: Reverb.h:85
EffectTypeProcess
@ EffectTypeProcess
Definition: EffectInterface.h:56
Reverb_priv_t::dry
float * dry
Definition: Reverb.cpp:85
S
#define S(N)
Definition: ToChars.cpp:64
EffectReverb::Params::mPreDelay
double mPreDelay
Definition: Reverb.h:35
gPrefs
FileConfig * gPrefs
Definition: Prefs.cpp:71
ChannelNameFrontRight
@ ChannelNameFrontRight
Definition: EffectInterface.h:166
SetSpinSlider
#define SetSpinSlider(n)
RegistryPaths
std::vector< RegistryPath > RegistryPaths
Definition: Identifier.h:219
fifo_write
static void * fifo_write(fifo_t *f, FIFO_SIZE_T n, void const *data)
Definition: Reverb_libSoX.h:74
XO
#define XO(s)
Definition: Internat.h:31
ChannelNameEOL
@ ChannelNameEOL
Definition: EffectInterface.h:161
Effect::GetUserPresetsGroup
RegistryPath GetUserPresetsGroup(const RegistryPath &name) override
Definition: Effect.cpp:809
Effect::SaveUserPreset
bool SaveUserPreset(const RegistryPath &name) override
Save current settings as a user-named preset.
Definition: Effect.cpp:547
reverb_process
static void reverb_process(reverb_t *p, size_t length)
Definition: Reverb_libSoX.h:253
Reverb_priv_t
Definition: Reverb.cpp:83
reverb_delete
static void reverb_delete(reverb_t *p)
Definition: Reverb_libSoX.h:261
XXO
#define XXO(s)
Definition: Internat.h:44
EffectReverb::mParams
Params mParams
Definition: Reverb.h:101
EffectReverb::Params::mHfDamping
double mHfDamping
Definition: Reverb.h:37
EffectReverb::Params::mStereoWidth
double mStereoWidth
Definition: Reverb.h:42
FactoryPresets
static const struct @1 FactoryPresets[]
EffectReverb::TransferDataToWindow
bool TransferDataToWindow() override
Definition: Reverb.cpp:478
reverb_create
static void reverb_create(reverb_t *p, double sample_rate_Hz, double wet_gain_dB, double room_scale, double reverberance, double hf_damping, double pre_delay_ms, double stereo_depth, double tone_low, double tone_high, size_t buffer_size, float **out)
Definition: Reverb_libSoX.h:221
EffectReverb::Params::mToneLow
double mToneLow
Definition: Reverb.h:38
Reverb_priv_t::wet
float * wet[2]
Definition: Reverb.cpp:86
names
static TranslatableStrings names
Definition: TagsEditor.cpp:151
dB_to_linear
#define dB_to_linear(x)
Definition: Reverb_libSoX.h:27
ReadAndVerifyDouble
#define ReadAndVerifyDouble(name)
Definition: Effect.h:592
Effect::GetCurrentSettingsGroup
RegistryPath GetCurrentSettingsGroup() override
Definition: Effect.cpp:820
id
int id
Definition: WaveTrackControls.cpp:577
min
int min(int a, int b)
Definition: CompareAudioCommand.cpp:106
Effect::mSampleRate
double mSampleRate
Definition: Effect.h:418
EffectReverb::SpinSlider
SpinSlider(RoomSize) SpinSlider(PreDelay) SpinSlider(Reverberance) SpinSlider(HfDamping) SpinSlider(ToneLow) SpinSlider(ToneHigh) SpinSlider(WetGain) SpinSlider(DryGain) SpinSlider(StereoWidth) wxCheckBox *mWetOnlyC
EffectReverb::Params::mRoomSize
double mRoomSize
Definition: Reverb.h:34
Effect::mUIParent
wxWindow * mUIParent
Definition: Effect.h:438
EffectReverb::Params::mToneHigh
double mToneHigh
Definition: Reverb.h:39
EffectReverb::Params::mReverberance
double mReverberance
Definition: Reverb.h:36
BLOCK
static size_t BLOCK
Definition: Reverb.cpp:176
EffectReverb::Params::mWetGain
double mWetGain
Definition: Reverb.h:40
ID_WetOnly
@ ID_WetOnly
Definition: Reverb.cpp:45
TranslatableString::Translation
wxString Translation() const
Definition: TranslatableString.h:79
EffectReverb::Params::mWetOnly
bool mWetOnly
Definition: Reverb.h:43
EffectReverb::Symbol
static const ComponentInterfaceSymbol Symbol
Definition: Reverb.h:27
ReadAndVerifyBool
#define ReadAndVerifyBool(name)
Definition: Effect.h:594