Audacity  3.0.3
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
 
wxString ManualPage () override
 
EffectType GetType () override
 
unsigned GetAudioInCount () override
 
unsigned GetAudioOutCount () override
 
bool ProcessInitialize (sampleCount totalLen, ChannelNames chanMap=NULL) override
 
bool ProcessFinalize () override
 
size_t ProcessBlock (float **inBlock, float **outBlock, size_t blockLen) override
 
bool DefineParams (ShuttleParams &S) override
 
bool GetAutomationParameters (CommandParameters &parms) override
 
bool SetAutomationParameters (CommandParameters &parms) override
 
RegistryPaths GetFactoryPresets () override
 
bool LoadFactoryPreset (int id) 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
 
bool IsInteractive () override
 
bool IsDefault () override
 
bool IsLegacy () override
 
bool SupportsRealtime () override
 
bool SupportsAutomation () override
 
bool SetHost (EffectHostInterface *host) override
 
int GetMidiInCount () override
 
int GetMidiOutCount () override
 
sampleCount GetLatency () override
 
size_t GetTailSize () override
 
void SetSampleRate (double rate) override
 
size_t SetBlockSize (size_t maxBlockSize) override
 
size_t GetBlockSize () const override
 
bool IsReady () override
 
bool RealtimeInitialize () override
 
bool RealtimeAddProcessor (unsigned numChannels, float sampleRate) override
 
bool RealtimeFinalize () override
 
bool RealtimeSuspend () override
 
bool RealtimeResume () override
 
bool RealtimeProcessStart () override
 
size_t RealtimeProcess (int group, float **inbuf, float **outbuf, size_t numSamples) override
 
bool RealtimeProcessEnd () override
 
bool ShowInterface (wxWindow &parent, const EffectDialogFactory &factory, bool forceModal=false) override
 
bool LoadUserPreset (const RegistryPath &name) override
 
bool SaveUserPreset (const RegistryPath &name) override
 
bool LoadFactoryDefaults () override
 
void SetHostUI (EffectUIHostInterface *host) override
 
bool PopulateUI (ShuttleGui &S) final
 
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
 
double GetDefaultDuration () 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 ()
 
bool HasSharedConfigGroup (const RegistryPath &group) override
 
bool GetSharedConfigSubgroups (const RegistryPath &group, RegistryPaths &subgroups) override
 
bool GetSharedConfig (const RegistryPath &group, const RegistryPath &key, wxString &value, const wxString &defval={}) override
 
bool GetSharedConfig (const RegistryPath &group, const RegistryPath &key, int &value, int defval=0) override
 
bool GetSharedConfig (const RegistryPath &group, const RegistryPath &key, bool &value, bool defval=false) override
 
bool GetSharedConfig (const RegistryPath &group, const RegistryPath &key, float &value, float defval=0.0) override
 
bool GetSharedConfig (const RegistryPath &group, const RegistryPath &key, double &value, double defval=0.0) override
 
bool SetSharedConfig (const RegistryPath &group, const RegistryPath &key, const wxString &value) override
 
bool SetSharedConfig (const RegistryPath &group, const RegistryPath &key, const int &value) override
 
bool SetSharedConfig (const RegistryPath &group, const RegistryPath &key, const bool &value) override
 
bool SetSharedConfig (const RegistryPath &group, const RegistryPath &key, const float &value) override
 
bool SetSharedConfig (const RegistryPath &group, const RegistryPath &key, const double &value) override
 
bool RemoveSharedConfigSubgroup (const RegistryPath &group) override
 
bool RemoveSharedConfig (const RegistryPath &group, const RegistryPath &key) override
 
bool HasPrivateConfigGroup (const RegistryPath &group) override
 
bool GetPrivateConfigSubgroups (const RegistryPath &group, RegistryPaths &paths) override
 
bool GetPrivateConfig (const RegistryPath &group, const RegistryPath &key, wxString &value, const wxString &defval={}) override
 
bool GetPrivateConfig (const RegistryPath &group, const RegistryPath &key, int &value, int defval=0) override
 
bool GetPrivateConfig (const RegistryPath &group, const RegistryPath &key, bool &value, bool defval=false) override
 
bool GetPrivateConfig (const RegistryPath &group, const RegistryPath &key, float &value, float defval=0.0) override
 
bool GetPrivateConfig (const RegistryPath &group, const RegistryPath &key, double &value, double defval=0.0) override
 
bool SetPrivateConfig (const RegistryPath &group, const RegistryPath &key, const wxString &value) override
 
bool SetPrivateConfig (const RegistryPath &group, const RegistryPath &key, const int &value) override
 
bool SetPrivateConfig (const RegistryPath &group, const RegistryPath &key, const bool &value) override
 
bool SetPrivateConfig (const RegistryPath &group, const RegistryPath &key, const float &value) override
 
bool SetPrivateConfig (const RegistryPath &group, const RegistryPath &key, const double &value) override
 
bool RemovePrivateConfigSubgroup (const RegistryPath &group) override
 
bool RemovePrivateConfig (const RegistryPath &group, const RegistryPath &key) override
 
virtual PluginID GetID ()
 
virtual bool Startup (EffectClientInterface *client)
 
virtual bool GetAutomationParameters (wxString &parms)
 
virtual bool SetAutomationParameters (const wxString &parms)
 
virtual RegistryPaths GetUserPresets ()
 
virtual bool HasCurrentSettings ()
 
virtual bool HasFactoryDefaults ()
 
virtual wxString HelpPage ()
 
virtual void SetUIFlags (unsigned flags)
 
virtual unsigned TestUIFlags (unsigned mask)
 
virtual bool IsBatchProcessing ()
 
virtual void SetBatchProcessing (bool start)
 
void SetPresetParameters (const wxArrayString *Names, const wxArrayString *Values)
 
bool DoEffect (double projectRate, TrackList *list, WaveTrackFactory *factory, NotifyingSelectedRegion &selectedRegion, wxWindow *pParent=nullptr, const EffectDialogFactory &dialogFactory={})
 
bool Delegate (Effect &delegate, wxWindow &parent, const EffectDialogFactory &factory)
 
virtual bool IsHidden ()
 
int MessageBox (const TranslatableString &message, long style=DefaultMessageBoxStyle, const TranslatableString &titleStr={})
 
- Public Member Functions inherited from EffectClientInterface
virtual ~EffectClientInterface ()
 
- Public Member Functions inherited from EffectDefinitionInterface
virtual ~EffectDefinitionInterface ()
 
virtual EffectType GetClassification ()
 
- Public Member Functions inherited from ComponentInterface
virtual ~ComponentInterface ()
 
TranslatableString GetName ()
 
virtual bool DefineParams (ShuttleParams &WXUNUSED(S))
 
- Public Member Functions inherited from EffectUIClientInterface
virtual ~EffectUIClientInterface ()
 
- Public Member Functions inherited from EffectHostInterface
virtual ~EffectHostInterface ()
 
- Public Member Functions inherited from ConfigClientInterface
virtual ~ConfigClientInterface ()
 

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 }
 
using VetoDialogHook = bool(*)(wxDialog *)
 
- Public Types inherited from EffectClientInterface
using EffectDialogFactory = std::function< wxDialog *(wxWindow &parent, EffectHostInterface *, EffectUIClientInterface *) >
 
- Static Public Member Functions inherited from Effect
static VetoDialogHook SetVetoDialogHook (VetoDialogHook hook)
 
static CommandID GetSquashedName (wxString name)
 
static void IncEffectCounter ()
 
- Protected Member Functions inherited from Effect
virtual bool Init ()
 
virtual bool CheckWhetherSkipEffect ()
 
virtual bool Process ()
 
virtual bool ProcessPass ()
 
virtual bool InitPass1 ()
 
virtual bool InitPass2 ()
 
virtual int GetPass ()
 
virtual void End ()
 
virtual double CalcPreviewInputLength (double previewLength)
 
virtual void Preview (bool dryOnly)
 
virtual bool EnableApply (bool enable=true)
 
virtual bool EnablePreview (bool enable=true)
 
virtual void EnableDebug (bool enable=true)
 
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
ProgressDialogmProgress
 
double mProjectRate
 
double mSampleRate
 
wxWeakRef< NotifyingSelectedRegionmpSelectedRegion {}
 
WaveTrackFactorymFactory
 
std::shared_ptr< TrackListmOutputTracks
 
double mT0
 
double mT1
 
wxArrayString mPresetNames
 
wxArrayString mPresetValues
 
int mPass
 
wxDialog * mUIDialog
 
wxWindow * mUIParent
 
int mUIResultID
 
unsigned mUIFlags
 
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, and EffectReverb::Params::mWetOnly.

◆ 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

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

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

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

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()

wxString EffectReverb::ManualPage ( )
overridevirtual

Reimplemented from Effect.

Definition at line 152 of file Reverb.cpp.

153 {
154  return wxT("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 ShuttleGui::AddSpace(), ShuttleGuiBase::EndHorizontalLay(), ShuttleGuiBase::EndMultiColumn(), ShuttleGui::Id(), ID_WetOnly, ShuttleGuiBase::SetStretchyCol(), SpinSlider(), ShuttleGuiBase::StartHorizontalLay(), ShuttleGuiBase::StartMultiColumn(), and XXO.

Here is the call graph for this function:

◆ ProcessBlock()

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

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

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

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

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:
RegistryPaths
std::vector< RegistryPath > RegistryPaths
Definition: Types.h:262
EffectReverb::Params::mDryGain
double mDryGain
Definition: Reverb.h:41
TranslatableString::empty
bool empty() const
Definition: Types.h:329
name
const TranslatableString name
Definition: Reverb.cpp:64
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:59
Effect::mUIDialog
wxDialog * mUIDialog
Definition: Effect.h:476
Reverb_priv_t::dry
float * dry
Definition: Reverb.cpp:85
EffectReverb::Params::mPreDelay
double mPreDelay
Definition: Reverb.h:35
gPrefs
FileConfig * gPrefs
Definition: Prefs.cpp:67
SetSpinSlider
#define SetSpinSlider(n)
fifo_write
static void * fifo_write(fifo_t *f, FIFO_SIZE_T n, void const *data)
Definition: Reverb_libSoX.h:74
ShuttleGui::AddSpace
wxSizerItem * AddSpace(int width, int height, int prop=0)
Definition: ShuttleGui.cpp:2421
ID_WetOnly
@ ID_WetOnly
Definition: Reverb.cpp:45
XO
#define XO(s)
Definition: Internat.h:32
ShuttleGuiBase::EndMultiColumn
void EndMultiColumn()
Definition: ShuttleGui.cpp:1212
Effect::GetUserPresetsGroup
RegistryPath GetUserPresetsGroup(const RegistryPath &name) override
Definition: Effect.cpp:854
Effect::SaveUserPreset
bool SaveUserPreset(const RegistryPath &name) override
Definition: Effect.cpp:569
reverb_process
static void reverb_process(reverb_t *p, size_t length)
Definition: Reverb_libSoX.h:253
Reverb_priv_t
Definition: Reverb.cpp:83
ShuttleGui::Id
ShuttleGui & Id(int id)
Definition: ShuttleGui.cpp:2248
reverb_delete
static void reverb_delete(reverb_t *p)
Definition: Reverb_libSoX.h:261
XXO
#define XXO(s)
Definition: Internat.h:45
ShuttleGuiBase::EndHorizontalLay
void EndHorizontalLay()
Definition: ShuttleGui.cpp:1170
ChannelNameEOL
@ ChannelNameEOL
Definition: Types.h:752
ShuttleGuiBase::StartHorizontalLay
void StartHorizontalLay(int PositionFlags=wxALIGN_CENTRE, int iProp=1)
Definition: ShuttleGui.cpp:1160
EffectReverb::mParams
Params mParams
Definition: Reverb.h:101
ShuttleGuiBase::StartMultiColumn
void StartMultiColumn(int nCols, int PositionFlags=wxALIGN_LEFT)
Definition: ShuttleGui.cpp:1203
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
dB_to_linear
#define dB_to_linear(x)
Definition: Reverb_libSoX.h:27
ReadAndVerifyDouble
#define ReadAndVerifyDouble(name)
Definition: Effect.h:632
Effect::GetCurrentSettingsGroup
RegistryPath GetCurrentSettingsGroup() override
Definition: Effect.cpp:865
id
int id
Definition: WaveTrackControls.cpp:589
min
int min(int a, int b)
Definition: CompareAudioCommand.cpp:106
Effect::mSampleRate
double mSampleRate
Definition: Effect.h:459
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:477
names
static TranslatableStrings names
Definition: Tags.cpp:743
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
TranslatableString::Translation
wxString Translation() const
Definition: Types.h:337
ChannelNameFrontRight
@ ChannelNameFrontRight
Definition: Types.h:757
ShuttleGuiBase::SetStretchyCol
void SetStretchyCol(int i)
Used to modify an already placed FlexGridSizer to make a column stretchy.
Definition: ShuttleGui.cpp:195
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:634