Audacity  3.0.3
Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | List of all members
EffectWahwah Class Referencefinal

An Effect that adds a 'spectral glide'. More...

#include <Wahwah.h>

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

Public Member Functions

 EffectWahwah ()
 
virtual ~EffectWahwah ()
 
ComponentInterfaceSymbol GetSymbol () override
 
TranslatableString GetDescription () override
 
ManualPageID ManualPage () override
 
EffectType GetType () override
 
bool SupportsRealtime () override
 
unsigned GetAudioInCount () override
 
unsigned GetAudioOutCount () override
 
bool ProcessInitialize (sampleCount totalLen, ChannelNames chanMap=NULL) override
 
size_t ProcessBlock (float **inBlock, float **outBlock, size_t blockLen) override
 
bool RealtimeInitialize () override
 
bool RealtimeAddProcessor (unsigned numChannels, float sampleRate) override
 
bool RealtimeFinalize () override
 
size_t RealtimeProcess (int group, float **inbuf, float **outbuf, size_t numSamples) override
 
bool DefineParams (ShuttleParams &S) override
 
bool GetAutomationParameters (CommandParameters &parms) override
 
bool SetAutomationParameters (CommandParameters &parms) 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 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 ProcessFinalize () override
 
bool RealtimeSuspend () override
 
bool RealtimeResume () override
 
bool RealtimeProcessStart () 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
 
RegistryPaths GetFactoryPresets () override
 
bool LoadFactoryPreset (int id) 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 Startup ()
 
virtual bool GetAutomationParameters (wxString &parms)
 
virtual bool SetAutomationParameters (const wxString &parms)
 
virtual RegistryPaths GetUserPresets ()
 
virtual bool HasCurrentSettings ()
 
virtual bool HasFactoryDefaults ()
 
virtual FilePath 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("Wahwah") }
 
- 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 InstanceInit (EffectWahwahState &data, float sampleRate)
 
size_t InstanceProcess (EffectWahwahState &data, float **inBlock, float **outBlock, size_t blockLen)
 
void OnFreqSlider (wxCommandEvent &evt)
 
void OnPhaseSlider (wxCommandEvent &evt)
 
void OnDepthSlider (wxCommandEvent &evt)
 
void OnResonanceSlider (wxCommandEvent &evt)
 
void OnFreqOffSlider (wxCommandEvent &evt)
 
void OnGainSlider (wxCommandEvent &evt)
 
void OnFreqText (wxCommandEvent &evt)
 
void OnPhaseText (wxCommandEvent &evt)
 
void OnDepthText (wxCommandEvent &evt)
 
void OnResonanceText (wxCommandEvent &evt)
 
void OnFreqOffText (wxCommandEvent &evt)
 
void OnGainText (wxCommandEvent &evt)
 

Private Attributes

EffectWahwahState mMaster
 
std::vector< EffectWahwahStatemSlaves
 
double mFreq
 
double mPhase
 
int mDepth
 
double mRes
 
int mFreqOfs
 
double mOutGain
 
wxTextCtrl * mFreqT
 
wxTextCtrl * mPhaseT
 
wxTextCtrl * mDepthT
 
wxTextCtrl * mResT
 
wxTextCtrl * mFreqOfsT
 
wxTextCtrl * mOutGainT
 
wxSlider * mFreqS
 
wxSlider * mPhaseS
 
wxSlider * mDepthS
 
wxSlider * mResS
 
wxSlider * mFreqOfsS
 
wxSlider * mOutGainS
 

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

An Effect that adds a 'spectral glide'.

Definition at line 39 of file Wahwah.h.

Constructor & Destructor Documentation

◆ EffectWahwah()

EffectWahwah::EffectWahwah ( )

Definition at line 81 of file Wahwah.cpp.

82 {
83  mFreq = DEF_Freq;
84  mPhase = DEF_Phase;
85  mDepth = DEF_Depth;
86  mRes = DEF_Res;
87  mFreqOfs = DEF_FreqOfs;
88  mOutGain = DEF_OutGain;
89 
90  SetLinearEffectFlag(true);
91 }

◆ ~EffectWahwah()

EffectWahwah::~EffectWahwah ( )
virtual

Definition at line 93 of file Wahwah.cpp.

94 {
95 }

Member Function Documentation

◆ DefineParams()

bool EffectWahwah::DefineParams ( ShuttleParams S)
override

Definition at line 195 of file Wahwah.cpp.

195  {
196  S.SHUTTLE_PARAM( mFreq, Freq );
197  S.SHUTTLE_PARAM( mPhase, Phase );
198  S.SHUTTLE_PARAM( mDepth, Depth );
199  S.SHUTTLE_PARAM( mRes, Res );
200  S.SHUTTLE_PARAM( mFreqOfs, FreqOfs );
201  S.SHUTTLE_PARAM( mOutGain, OutGain );
202  return true;
203 }

References mDepth, mFreq, mFreqOfs, mOutGain, mPhase, and mRes.

◆ GetAudioInCount()

unsigned EffectWahwah::GetAudioInCount ( )
overridevirtual

Reimplemented from Effect.

Definition at line 132 of file Wahwah.cpp.

133 {
134  return 1;
135 }

◆ GetAudioOutCount()

unsigned EffectWahwah::GetAudioOutCount ( )
overridevirtual

Reimplemented from Effect.

Definition at line 137 of file Wahwah.cpp.

138 {
139  return 1;
140 }

◆ GetAutomationParameters()

bool EffectWahwah::GetAutomationParameters ( CommandParameters parms)
overridevirtual

Reimplemented from Effect.

Definition at line 205 of file Wahwah.cpp.

206 {
207  parms.Write(KEY_Freq, mFreq);
208  parms.Write(KEY_Phase, mPhase);
209  parms.Write(KEY_Depth, mDepth);
210  parms.Write(KEY_Res, mRes);
211  parms.Write(KEY_FreqOfs, mFreqOfs);
212  parms.Write(KEY_OutGain, mOutGain);
213 
214  return true;
215 }

References mDepth, mFreq, mFreqOfs, mOutGain, mPhase, and mRes.

◆ GetDescription()

TranslatableString EffectWahwah::GetDescription ( )
overridevirtual

Reimplemented from Effect.

Definition at line 104 of file Wahwah.cpp.

105 {
106  return XO("Rapid tone quality variations, like that guitar sound so popular in the 1970's");
107 }

References XO.

◆ GetSymbol()

ComponentInterfaceSymbol EffectWahwah::GetSymbol ( )
overridevirtual

Reimplemented from Effect.

Definition at line 99 of file Wahwah.cpp.

100 {
101  return Symbol;
102 }

References Symbol.

◆ GetType()

EffectType EffectWahwah::GetType ( )
overridevirtual

Reimplemented from Effect.

Definition at line 116 of file Wahwah.cpp.

117 {
118  return EffectTypeProcess;
119 }

References EffectTypeProcess.

◆ InstanceInit()

void EffectWahwah::InstanceInit ( EffectWahwahState data,
float  sampleRate 
)
private

Definition at line 346 of file Wahwah.cpp.

347 {
348  data.samplerate = sampleRate;
349  data.lfoskip = mFreq * 2 * M_PI / sampleRate;
350  data.skipcount = 0;
351  data.xn1 = 0;
352  data.xn2 = 0;
353  data.yn1 = 0;
354  data.yn2 = 0;
355  data.b0 = 0;
356  data.b1 = 0;
357  data.b2 = 0;
358  data.a0 = 0;
359  data.a1 = 0;
360  data.a2 = 0;
361 
362  data.depth = mDepth / 100.0;
363  data.freqofs = mFreqOfs / 100.0;
364  data.phase = mPhase * M_PI / 180.0;
365  data.outgain = DB_TO_LINEAR(mOutGain);
366 }

References EffectWahwahState::a0, EffectWahwahState::a1, EffectWahwahState::a2, EffectWahwahState::b0, EffectWahwahState::b1, EffectWahwahState::b2, DB_TO_LINEAR(), EffectWahwahState::depth, EffectWahwahState::freqofs, EffectWahwahState::lfoskip, M_PI, mDepth, mFreq, mFreqOfs, mOutGain, mPhase, EffectWahwahState::outgain, EffectWahwahState::phase, EffectWahwahState::samplerate, EffectWahwahState::skipcount, EffectWahwahState::xn1, EffectWahwahState::xn2, EffectWahwahState::yn1, and EffectWahwahState::yn2.

Referenced by ProcessInitialize(), and RealtimeAddProcessor().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ InstanceProcess()

size_t EffectWahwah::InstanceProcess ( EffectWahwahState data,
float **  inBlock,
float **  outBlock,
size_t  blockLen 
)
private

Definition at line 368 of file Wahwah.cpp.

369 {
370  float *ibuf = inBlock[0];
371  float *obuf = outBlock[0];
372  double frequency, omega, sn, cs, alpha;
373  double in, out;
374 
375  data.lfoskip = mFreq * 2 * M_PI / data.samplerate;
376  data.depth = mDepth / 100.0;
377  data.freqofs = mFreqOfs / 100.0;
378 
379  data.phase = mPhase * M_PI / 180.0;
380  data.outgain = DB_TO_LINEAR(mOutGain);
381 
382  for (decltype(blockLen) i = 0; i < blockLen; i++)
383  {
384  in = (double) ibuf[i];
385 
386  if ((data.skipcount++) % lfoskipsamples == 0)
387  {
388  frequency = (1 + cos(data.skipcount * data.lfoskip + data.phase)) / 2;
389  frequency = frequency * data.depth * (1 - data.freqofs) + data.freqofs;
390  frequency = exp((frequency - 1) * 6);
391  omega = M_PI * frequency;
392  sn = sin(omega);
393  cs = cos(omega);
394  alpha = sn / (2 * mRes);
395  data.b0 = (1 - cs) / 2;
396  data.b1 = 1 - cs;
397  data.b2 = (1 - cs) / 2;
398  data.a0 = 1 + alpha;
399  data.a1 = -2 * cs;
400  data.a2 = 1 - alpha;
401  };
402  out = (data.b0 * in + data.b1 * data.xn1 + data.b2 * data.xn2 - data.a1 * data.yn1 - data.a2 * data.yn2) / data.a0;
403  data.xn2 = data.xn1;
404  data.xn1 = in;
405  data.yn2 = data.yn1;
406  data.yn1 = out;
407  out *= data.outgain;
408 
409  obuf[i] = (float) out;
410  }
411 
412  return blockLen;
413 }

References EffectWahwahState::a0, EffectWahwahState::a1, EffectWahwahState::a2, EffectWahwahState::b0, EffectWahwahState::b1, EffectWahwahState::b2, DB_TO_LINEAR(), EffectWahwahState::depth, EffectWahwahState::freqofs, EffectWahwahState::lfoskip, lfoskipsamples, M_PI, mDepth, mFreq, mFreqOfs, mOutGain, mPhase, mRes, EffectWahwahState::outgain, EffectWahwahState::phase, EffectWahwahState::samplerate, EffectWahwahState::skipcount, EffectWahwahState::xn1, EffectWahwahState::xn2, EffectWahwahState::yn1, and EffectWahwahState::yn2.

Referenced by ProcessBlock(), and RealtimeProcess().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ManualPage()

ManualPageID EffectWahwah::ManualPage ( )
overridevirtual

Reimplemented from Effect.

Definition at line 109 of file Wahwah.cpp.

110 {
111  return L"Wahwah";
112 }

◆ OnDepthSlider()

void EffectWahwah::OnDepthSlider ( wxCommandEvent &  evt)
private

Definition at line 432 of file Wahwah.cpp.

433 {
434  mDepth = evt.GetInt() / SCL_Depth;
435  mDepthT->GetValidator()->TransferToWindow();
436  EnableApply(mUIParent->Validate());
437 }

References Effect::EnableApply(), mDepth, mDepthT, and Effect::mUIParent.

Here is the call graph for this function:

◆ OnDepthText()

void EffectWahwah::OnDepthText ( wxCommandEvent &  evt)
private

Definition at line 480 of file Wahwah.cpp.

481 {
482  if (!EnableApply(mUIParent->TransferDataFromWindow()))
483  {
484  return;
485  }
486 
487  mDepthS->SetValue((int) (mDepth * SCL_Depth));
488 }

References Effect::EnableApply(), mDepth, mDepthS, and Effect::mUIParent.

Here is the call graph for this function:

◆ OnFreqOffSlider()

void EffectWahwah::OnFreqOffSlider ( wxCommandEvent &  evt)
private

Definition at line 446 of file Wahwah.cpp.

447 {
448  mFreqOfs = evt.GetInt() / SCL_FreqOfs;
449  mFreqOfsT->GetValidator()->TransferToWindow();
450  EnableApply(mUIParent->Validate());
451 }

References Effect::EnableApply(), mFreqOfs, mFreqOfsT, and Effect::mUIParent.

Here is the call graph for this function:

◆ OnFreqOffText()

void EffectWahwah::OnFreqOffText ( wxCommandEvent &  evt)
private

Definition at line 500 of file Wahwah.cpp.

501 {
502  if (!EnableApply(mUIParent->TransferDataFromWindow()))
503  {
504  return;
505  }
506 
507  mFreqOfsS->SetValue((int) (mFreqOfs * SCL_FreqOfs));
508 }

References Effect::EnableApply(), mFreqOfs, mFreqOfsS, and Effect::mUIParent.

Here is the call graph for this function:

◆ OnFreqSlider()

void EffectWahwah::OnFreqSlider ( wxCommandEvent &  evt)
private

Definition at line 415 of file Wahwah.cpp.

416 {
417  mFreq = (double) evt.GetInt() / SCL_Freq;
418  mFreqT->GetValidator()->TransferToWindow();
419  EnableApply(mUIParent->Validate());
420 }

References Effect::EnableApply(), mFreq, mFreqT, and Effect::mUIParent.

Here is the call graph for this function:

◆ OnFreqText()

void EffectWahwah::OnFreqText ( wxCommandEvent &  evt)
private

Definition at line 460 of file Wahwah.cpp.

461 {
462  if (!EnableApply(mUIParent->TransferDataFromWindow()))
463  {
464  return;
465  }
466 
467  mFreqS->SetValue((int) (mFreq * SCL_Freq));
468 }

References Effect::EnableApply(), mFreq, mFreqS, and Effect::mUIParent.

Here is the call graph for this function:

◆ OnGainSlider()

void EffectWahwah::OnGainSlider ( wxCommandEvent &  evt)
private

Definition at line 453 of file Wahwah.cpp.

454 {
455  mOutGain = evt.GetInt() / SCL_OutGain;
456  mOutGainT->GetValidator()->TransferToWindow();
457  EnableApply(mUIParent->Validate());
458 }

References Effect::EnableApply(), mOutGain, mOutGainT, and Effect::mUIParent.

Here is the call graph for this function:

◆ OnGainText()

void EffectWahwah::OnGainText ( wxCommandEvent &  evt)
private

Definition at line 510 of file Wahwah.cpp.

511 {
512  if (!EnableApply(mUIParent->TransferDataFromWindow()))
513  {
514  return;
515  }
516 
517  mOutGainS->SetValue((int) (mOutGain * SCL_OutGain));
518 }

References Effect::EnableApply(), mOutGain, mOutGainS, and Effect::mUIParent.

Here is the call graph for this function:

◆ OnPhaseSlider()

void EffectWahwah::OnPhaseSlider ( wxCommandEvent &  evt)
private

Definition at line 422 of file Wahwah.cpp.

423 {
424  int val = ((evt.GetInt() + 5) / 10) * 10; // round to nearest multiple of 10
425  val = val > MAX_Phase * SCL_Phase ? MAX_Phase * SCL_Phase : val;
426  mPhaseS->SetValue(val);
427  mPhase = (double) val / SCL_Phase;
428  mPhaseT->GetValidator()->TransferToWindow();
429  EnableApply(mUIParent->Validate());
430 }

References Effect::EnableApply(), mPhase, mPhaseS, mPhaseT, and Effect::mUIParent.

Here is the call graph for this function:

◆ OnPhaseText()

void EffectWahwah::OnPhaseText ( wxCommandEvent &  evt)
private

Definition at line 470 of file Wahwah.cpp.

471 {
472  if (!EnableApply(mUIParent->TransferDataFromWindow()))
473  {
474  return;
475  }
476 
477  mPhaseS->SetValue((int) (mPhase * SCL_Phase));
478 }

References Effect::EnableApply(), mPhase, mPhaseS, and Effect::mUIParent.

Here is the call graph for this function:

◆ OnResonanceSlider()

void EffectWahwah::OnResonanceSlider ( wxCommandEvent &  evt)
private

Definition at line 439 of file Wahwah.cpp.

440 {
441  mRes = (double) evt.GetInt() / SCL_Res;
442  mResT->GetValidator()->TransferToWindow();
443  EnableApply(mUIParent->Validate());
444 }

References Effect::EnableApply(), mRes, mResT, and Effect::mUIParent.

Here is the call graph for this function:

◆ OnResonanceText()

void EffectWahwah::OnResonanceText ( wxCommandEvent &  evt)
private

Definition at line 490 of file Wahwah.cpp.

491 {
492  if (!EnableApply(mUIParent->TransferDataFromWindow()))
493  {
494  return;
495  }
496 
497  mResS->SetValue((int) (mRes * SCL_Res));
498 }

References Effect::EnableApply(), mRes, mResS, and Effect::mUIParent.

Here is the call graph for this function:

◆ PopulateOrExchange()

void EffectWahwah::PopulateOrExchange ( ShuttleGui S)
overridevirtual

Reimplemented from Effect.

Definition at line 238 of file Wahwah.cpp.

239 {
240  S.SetBorder(5);
241  S.AddSpace(0, 5);
242 
243  S.StartMultiColumn(3, wxEXPAND);
244  {
245  S.SetStretchyCol(2);
246 
247  mFreqT = S.Id(ID_Freq)
248  .Validator<FloatingPointValidator<double>>(
249  5, &mFreq, NumValidatorStyle::ONE_TRAILING_ZERO, MIN_Freq, MAX_Freq)
250  .AddTextBox(XXO("LFO Freq&uency (Hz):"), wxT(""), 12);
251 
252  mFreqS = S.Id(ID_Freq)
253  .Name(XO("LFO frequency in hertz"))
254  .Style(wxSL_HORIZONTAL)
255  .MinSize( { 100, -1 } )
256  .AddSlider( {}, DEF_Freq * SCL_Freq, MAX_Freq * SCL_Freq, MIN_Freq * SCL_Freq);
257 
258  mPhaseT = S.Id(ID_Phase)
259  .Validator<FloatingPointValidator<double>>(
260  1, &mPhase, NumValidatorStyle::DEFAULT, MIN_Phase, MAX_Phase)
261  .AddTextBox(XXO("LFO Sta&rt Phase (deg.):"), wxT(""), 12);
262 
263  mPhaseS = S.Id(ID_Phase)
264  .Name(XO("LFO start phase in degrees"))
265  .Style(wxSL_HORIZONTAL)
266  .MinSize( { 100, -1 } )
267  .AddSlider( {}, DEF_Phase * SCL_Phase, MAX_Phase * SCL_Phase, MIN_Phase * SCL_Phase);
268  mPhaseS->SetLineSize(10);
269 
270  mDepthT = S.Id(ID_Depth)
271  .Validator<IntegerValidator<int>>(
272  &mDepth, NumValidatorStyle::DEFAULT, MIN_Depth, MAX_Depth)
273  .AddTextBox(XXO("Dept&h (%):"), wxT(""), 12);
274 
275  mDepthS = S.Id(ID_Depth)
276  .Name(XO("Depth in percent"))
277  .Style(wxSL_HORIZONTAL)
278  .MinSize( { 100, -1 } )
279  .AddSlider( {}, DEF_Depth * SCL_Depth, MAX_Depth * SCL_Depth, MIN_Depth * SCL_Depth);
280 
281  mResT = S.Id(ID_Res)
282  .Validator<FloatingPointValidator<double>>(
283  1, &mRes, NumValidatorStyle::DEFAULT, MIN_Res, MAX_Res)
284  .AddTextBox(XXO("Reso&nance:"), wxT(""), 12);
285 
286  mResS = S.Id(ID_Res)
287  .Name(XO("Resonance"))
288  .Style(wxSL_HORIZONTAL)
289  .MinSize( { 100, -1 } )
290  .AddSlider( {}, DEF_Res * SCL_Res, MAX_Res * SCL_Res, MIN_Res * SCL_Res);
291 
292  mFreqOfsT = S.Id(ID_FreqOfs)
293  .Validator<IntegerValidator<int>>(
294  &mFreqOfs, NumValidatorStyle::DEFAULT, MIN_FreqOfs, MAX_FreqOfs)
295  .AddTextBox(XXO("Wah Frequency Offse&t (%):"), wxT(""), 12);
296 
297  mFreqOfsS = S.Id(ID_FreqOfs)
298  .Name(XO("Wah frequency offset in percent"))
299  .Style(wxSL_HORIZONTAL)
300  .MinSize( { 100, -1 } )
301  .AddSlider( {}, DEF_FreqOfs * SCL_FreqOfs, MAX_FreqOfs * SCL_FreqOfs, MIN_FreqOfs * SCL_FreqOfs);
302 
303  mOutGainT = S.Id(ID_OutGain)
304  .Validator<FloatingPointValidator<double>>(
305  1, &mOutGain, NumValidatorStyle::DEFAULT, MIN_OutGain, MAX_OutGain)
306  .AddTextBox(XXO("&Output gain (dB):"), wxT(""), 12);
307 
308  mOutGainS = S.Id(ID_OutGain)
309  .Name(XO("Output gain (dB)"))
310  .Style(wxSL_HORIZONTAL)
311  .MinSize( { 100, -1 } )
312  .AddSlider( {}, DEF_OutGain * SCL_OutGain, MAX_OutGain * SCL_OutGain, MIN_OutGain * SCL_OutGain);
313  }
314  S.EndMultiColumn();
315 }

References ShuttleGui::AddSpace(), ShuttleGuiBase::EndMultiColumn(), ShuttleGui::Id(), ID_Depth, ID_Freq, ID_FreqOfs, ID_OutGain, ID_Phase, ID_Res, mDepth, mDepthS, mDepthT, mFreq, mFreqOfs, mFreqOfsS, mFreqOfsT, mFreqS, mFreqT, ShuttleGui::MinSize(), mOutGain, mOutGainS, mOutGainT, mPhase, mPhaseS, mPhaseT, mRes, mResS, mResT, ShuttleGui::Name(), ShuttleGuiBase::SetBorder(), ShuttleGuiBase::SetStretchyCol(), ShuttleGuiBase::StartMultiColumn(), ShuttleGui::Validator(), XO, and XXO.

Here is the call graph for this function:

◆ ProcessBlock()

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

Reimplemented from Effect.

Definition at line 154 of file Wahwah.cpp.

155 {
156  return InstanceProcess(mMaster, inBlock, outBlock, blockLen);
157 }

References InstanceProcess(), and mMaster.

Here is the call graph for this function:

◆ ProcessInitialize()

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

Reimplemented from Effect.

Definition at line 142 of file Wahwah.cpp.

143 {
145 
146  if (chanMap[0] == ChannelNameFrontRight)
147  {
148  mMaster.phase += M_PI;
149  }
150 
151  return true;
152 }

References ChannelNameFrontRight, InstanceInit(), M_PI, mMaster, Effect::mSampleRate, and EffectWahwahState::phase.

Here is the call graph for this function:

◆ RealtimeAddProcessor()

bool EffectWahwah::RealtimeAddProcessor ( unsigned  numChannels,
float  sampleRate 
)
overridevirtual

Reimplemented from Effect.

Definition at line 168 of file Wahwah.cpp.

169 {
170  EffectWahwahState slave;
171 
172  InstanceInit(slave, sampleRate);
173 
174  mSlaves.push_back(slave);
175 
176  return true;
177 }

References InstanceInit(), and mSlaves.

Here is the call graph for this function:

◆ RealtimeFinalize()

bool EffectWahwah::RealtimeFinalize ( )
overridevirtual

Reimplemented from Effect.

Definition at line 179 of file Wahwah.cpp.

180 {
181  mSlaves.clear();
182 
183  return true;
184 }

References mSlaves.

◆ RealtimeInitialize()

bool EffectWahwah::RealtimeInitialize ( )
overridevirtual

Reimplemented from Effect.

Definition at line 159 of file Wahwah.cpp.

160 {
161  SetBlockSize(512);
162 
163  mSlaves.clear();
164 
165  return true;
166 }

References mSlaves, and Effect::SetBlockSize().

Here is the call graph for this function:

◆ RealtimeProcess()

size_t EffectWahwah::RealtimeProcess ( int  group,
float **  inbuf,
float **  outbuf,
size_t  numSamples 
)
overridevirtual

Reimplemented from Effect.

Definition at line 186 of file Wahwah.cpp.

190 {
191 
192  return InstanceProcess(mSlaves[group], inbuf, outbuf, numSamples);
193 }

References InstanceProcess(), and mSlaves.

Here is the call graph for this function:

◆ SetAutomationParameters()

bool EffectWahwah::SetAutomationParameters ( CommandParameters parms)
overridevirtual

Reimplemented from Effect.

Definition at line 217 of file Wahwah.cpp.

218 {
219  ReadAndVerifyDouble(Freq);
220  ReadAndVerifyDouble(Phase);
221  ReadAndVerifyInt(Depth);
222  ReadAndVerifyDouble(Res);
223  ReadAndVerifyInt(FreqOfs);
224  ReadAndVerifyDouble(OutGain);
225 
226  mFreq = Freq;
227  mPhase = Phase;
228  mDepth = Depth;
229  mRes = Res;
230  mFreqOfs = FreqOfs;
231  mOutGain = OutGain;
232 
233  return true;
234 }

References mDepth, mFreq, mFreqOfs, mOutGain, mPhase, mRes, ReadAndVerifyDouble, and ReadAndVerifyInt.

◆ SupportsRealtime()

bool EffectWahwah::SupportsRealtime ( )
overridevirtual

Reimplemented from Effect.

Definition at line 121 of file Wahwah.cpp.

122 {
123 #if defined(EXPERIMENTAL_REALTIME_AUDACITY_EFFECTS)
124  return true;
125 #else
126  return false;
127 #endif
128 }

◆ TransferDataFromWindow()

bool EffectWahwah::TransferDataFromWindow ( )
overridevirtual

Reimplemented from Effect.

Definition at line 334 of file Wahwah.cpp.

335 {
336  if (!mUIParent->Validate() || !mUIParent->TransferDataFromWindow())
337  {
338  return false;
339  }
340 
341  return true;
342 }

References Effect::mUIParent.

◆ TransferDataToWindow()

bool EffectWahwah::TransferDataToWindow ( )
overridevirtual

Reimplemented from Effect.

Definition at line 317 of file Wahwah.cpp.

318 {
319  if (!mUIParent->TransferDataToWindow())
320  {
321  return false;
322  }
323 
324  mFreqS->SetValue((int) (mFreq * SCL_Freq));
325  mPhaseS->SetValue((int) (mPhase * SCL_Phase));
326  mDepthS->SetValue((int) (mDepth * SCL_Depth));
327  mResS->SetValue((int) (mRes * SCL_Res));
328  mFreqOfsS->SetValue((int) (mFreqOfs * SCL_FreqOfs));
329  mOutGainS->SetValue((int) (mOutGain * SCL_OutGain));
330 
331  return true;
332 }

References mDepth, mDepthS, mFreq, mFreqOfs, mFreqOfsS, mFreqS, mOutGain, mOutGainS, mPhase, mPhaseS, mRes, mResS, and Effect::mUIParent.

Member Data Documentation

◆ mDepth

int EffectWahwah::mDepth
private

◆ mDepthS

wxSlider* EffectWahwah::mDepthS
private

Definition at line 133 of file Wahwah.h.

Referenced by OnDepthText(), PopulateOrExchange(), and TransferDataToWindow().

◆ mDepthT

wxTextCtrl* EffectWahwah::mDepthT
private

Definition at line 126 of file Wahwah.h.

Referenced by OnDepthSlider(), and PopulateOrExchange().

◆ mFreq

double EffectWahwah::mFreq
private

◆ mFreqOfs

int EffectWahwah::mFreqOfs
private

◆ mFreqOfsS

wxSlider* EffectWahwah::mFreqOfsS
private

Definition at line 135 of file Wahwah.h.

Referenced by OnFreqOffText(), PopulateOrExchange(), and TransferDataToWindow().

◆ mFreqOfsT

wxTextCtrl* EffectWahwah::mFreqOfsT
private

Definition at line 128 of file Wahwah.h.

Referenced by OnFreqOffSlider(), and PopulateOrExchange().

◆ mFreqS

wxSlider* EffectWahwah::mFreqS
private

Definition at line 131 of file Wahwah.h.

Referenced by OnFreqText(), PopulateOrExchange(), and TransferDataToWindow().

◆ mFreqT

wxTextCtrl* EffectWahwah::mFreqT
private

Definition at line 124 of file Wahwah.h.

Referenced by OnFreqSlider(), and PopulateOrExchange().

◆ mMaster

EffectWahwahState EffectWahwah::mMaster
private

Definition at line 102 of file Wahwah.h.

Referenced by ProcessBlock(), and ProcessInitialize().

◆ mOutGain

double EffectWahwah::mOutGain
private

◆ mOutGainS

wxSlider* EffectWahwah::mOutGainS
private

Definition at line 136 of file Wahwah.h.

Referenced by OnGainText(), PopulateOrExchange(), and TransferDataToWindow().

◆ mOutGainT

wxTextCtrl* EffectWahwah::mOutGainT
private

Definition at line 129 of file Wahwah.h.

Referenced by OnGainSlider(), and PopulateOrExchange().

◆ mPhase

double EffectWahwah::mPhase
private

◆ mPhaseS

wxSlider* EffectWahwah::mPhaseS
private

Definition at line 132 of file Wahwah.h.

Referenced by OnPhaseSlider(), OnPhaseText(), PopulateOrExchange(), and TransferDataToWindow().

◆ mPhaseT

wxTextCtrl* EffectWahwah::mPhaseT
private

Definition at line 125 of file Wahwah.h.

Referenced by OnPhaseSlider(), and PopulateOrExchange().

◆ mRes

double EffectWahwah::mRes
private

◆ mResS

wxSlider* EffectWahwah::mResS
private

Definition at line 134 of file Wahwah.h.

Referenced by OnResonanceText(), PopulateOrExchange(), and TransferDataToWindow().

◆ mResT

wxTextCtrl* EffectWahwah::mResT
private

Definition at line 127 of file Wahwah.h.

Referenced by OnResonanceSlider(), and PopulateOrExchange().

◆ mSlaves

std::vector<EffectWahwahState> EffectWahwah::mSlaves
private

◆ Symbol

const ComponentInterfaceSymbol EffectWahwah::Symbol { XO("Wahwah") }
static

Definition at line 42 of file Wahwah.h.

Referenced by GetSymbol().


The documentation for this class was generated from the following files:
EffectWahwah::mSlaves
std::vector< EffectWahwahState > mSlaves
Definition: Wahwah.h:103
EffectWahwah::mFreqOfsT
wxTextCtrl * mFreqOfsT
Definition: Wahwah.h:128
ID_Phase
@ ID_Phase
Definition: Wahwah.cpp:37
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:2001
EffectWahwah::mOutGain
double mOutGain
Definition: Wahwah.h:122
Effect::EnableApply
virtual bool EnableApply(bool enable=true)
Definition: Effect.cpp:1926
EffectWahwahState::samplerate
float samplerate
Definition: Wahwah.h:28
ChannelNameFrontRight
@ ChannelNameFrontRight
Definition: EffectInterface.h:150
EffectWahwahState::depth
double depth
Definition: Wahwah.h:29
EffectWahwah::mResT
wxTextCtrl * mResT
Definition: Wahwah.h:127
EffectWahwahState::b1
double b1
Definition: Wahwah.h:36
ShuttleGui::AddSpace
wxSizerItem * AddSpace(int width, int height, int prop=0)
Definition: ShuttleGui.cpp:2459
ShuttleGui::MinSize
ShuttleGui & MinSize()
Definition: ShuttleGui.h:733
XO
#define XO(s)
Definition: Internat.h:31
EffectWahwah::mDepth
int mDepth
Definition: Wahwah.h:119
EffectWahwahState::a2
double a2
Definition: Wahwah.h:36
ID_FreqOfs
@ ID_FreqOfs
Definition: Wahwah.cpp:40
ShuttleGuiBase::EndMultiColumn
void EndMultiColumn()
Definition: ShuttleGui.cpp:1238
EffectWahwahState::freqofs
double freqofs
Definition: Wahwah.h:30
EffectWahwah::mDepthS
wxSlider * mDepthS
Definition: Wahwah.h:133
EffectWahwah::mPhaseS
wxSlider * mPhaseS
Definition: Wahwah.h:132
ShuttleGui::Id
ShuttleGui & Id(int id)
Definition: ShuttleGui.cpp:2274
EffectWahwahState::b2
double b2
Definition: Wahwah.h:36
EffectWahwahState::skipcount
unsigned long skipcount
Definition: Wahwah.h:34
ReadAndVerifyInt
#define ReadAndVerifyInt(name)
Definition: Effect.h:632
EffectWahwah::mPhaseT
wxTextCtrl * mPhaseT
Definition: Wahwah.h:125
XXO
#define XXO(s)
Definition: Internat.h:44
EffectWahwahState::outgain
double outgain
Definition: Wahwah.h:32
EffectWahwah::mOutGainS
wxSlider * mOutGainS
Definition: Wahwah.h:136
EffectWahwahState::phase
double phase
Definition: Wahwah.h:31
EffectWahwah::mFreqT
wxTextCtrl * mFreqT
Definition: Wahwah.h:124
ShuttleGuiBase::StartMultiColumn
void StartMultiColumn(int nCols, int PositionFlags=wxALIGN_LEFT)
Definition: ShuttleGui.cpp:1229
EffectWahwah::mRes
double mRes
Definition: Wahwah.h:120
EffectWahwah::mFreqOfsS
wxSlider * mFreqOfsS
Definition: Wahwah.h:135
EffectWahwahState::xn2
double xn2
Definition: Wahwah.h:35
ShuttleGui::Validator
ShuttleGui & Validator(const Factory &f)
Definition: ShuttleGui.h:678
EffectWahwahState::yn1
double yn1
Definition: Wahwah.h:35
EffectWahwahState::lfoskip
double lfoskip
Definition: Wahwah.h:33
ReadAndVerifyDouble
#define ReadAndVerifyDouble(name)
Definition: Effect.h:633
EffectWahwah::mDepthT
wxTextCtrl * mDepthT
Definition: Wahwah.h:126
EffectWahwah::mFreqOfs
int mFreqOfs
Definition: Wahwah.h:121
ID_Depth
@ ID_Depth
Definition: Wahwah.cpp:38
EffectWahwah::mFreqS
wxSlider * mFreqS
Definition: Wahwah.h:131
EffectWahwah::mMaster
EffectWahwahState mMaster
Definition: Wahwah.h:102
ShuttleGui::Name
ShuttleGui & Name(const TranslatableString &name)
Definition: ShuttleGui.h:663
Effect::mSampleRate
double mSampleRate
Definition: Effect.h:460
lfoskipsamples
#define lfoskipsamples
Definition: Wahwah.cpp:55
Effect::mUIParent
wxWindow * mUIParent
Definition: Effect.h:478
EffectWahwah::Symbol
static const ComponentInterfaceSymbol Symbol
Definition: Wahwah.h:42
ID_OutGain
@ ID_OutGain
Definition: Wahwah.cpp:41
EffectWahwahState::a1
double a1
Definition: Wahwah.h:36
EffectWahwahState::xn1
double xn1
Definition: Wahwah.h:35
EffectWahwah::mResS
wxSlider * mResS
Definition: Wahwah.h:134
EffectWahwah::InstanceInit
void InstanceInit(EffectWahwahState &data, float sampleRate)
Definition: Wahwah.cpp:346
EffectWahwahState::a0
double a0
Definition: Wahwah.h:36
M_PI
#define M_PI
Definition: Distortion.cpp:29
ID_Res
@ ID_Res
Definition: Wahwah.cpp:39
EffectWahwahState::yn2
double yn2
Definition: Wahwah.h:35
ShuttleGuiBase::SetBorder
void SetBorder(int Border)
Definition: ShuttleGui.h:489
EffectWahwah::mOutGainT
wxTextCtrl * mOutGainT
Definition: Wahwah.h:129
ID_Freq
@ ID_Freq
Definition: Wahwah.cpp:36
EffectWahwah::mFreq
double mFreq
Definition: Wahwah.h:117
ShuttleGuiBase::SetStretchyCol
void SetStretchyCol(int i)
Used to modify an already placed FlexGridSizer to make a column stretchy.
Definition: ShuttleGui.cpp:202
Effect::SetBlockSize
size_t SetBlockSize(size_t maxBlockSize) override
Definition: Effect.cpp:317
EffectWahwahState::b0
double b0
Definition: Wahwah.h:36
EffectWahwah::mPhase
double mPhase
Definition: Wahwah.h:118
EffectWahwahState
Definition: Wahwah.h:26
EffectWahwah::InstanceProcess
size_t InstanceProcess(EffectWahwahState &data, float **inBlock, float **outBlock, size_t blockLen)
Definition: Wahwah.cpp:368