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

An Effect that applies 'classical' IIR filters. More...

#include <ScienFilter.h>

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

Public Member Functions

 EffectScienFilter ()
 
virtual ~EffectScienFilter ()
 
ComponentInterfaceSymbol GetSymbol () override
 
TranslatableString GetDescription () override
 
ManualPageID ManualPage () override
 
EffectType GetType () 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 DefineParams (ShuttleParams &S) override
 
bool GetAutomationParameters (CommandParameters &parms) override
 
bool SetAutomationParameters (CommandParameters &parms) override
 
bool Startup () override
 
bool Init () 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 ProcessFinalize () 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
 
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 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("Classic Filters") }
 
- 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

bool TransferGraphLimitsFromWindow ()
 
void CalcFilter ()
 
float FilterMagnAtFreq (float Freq)
 
void EnableDisableRippleCtl (int FilterType)
 
void OnSize (wxSizeEvent &evt)
 
void OnSlider (wxCommandEvent &evt)
 
void OnOrder (wxCommandEvent &evt)
 
void OnCutoff (wxCommandEvent &evt)
 
void OnRipple (wxCommandEvent &evt)
 
void OnStopbandRipple (wxCommandEvent &evt)
 
void OnFilterType (wxCommandEvent &evt)
 
void OnFilterSubtype (wxCommandEvent &evt)
 
void OnSliderDBMAX (wxCommandEvent &evt)
 
void OnSliderDBMIN (wxCommandEvent &evt)
 

Private Attributes

float mCutoff
 
float mRipple
 
float mStopbandRipple
 
int mFilterType
 
int mFilterSubtype
 
int mOrder
 
int mOrderIndex
 
ArrayOf< BiquadmpBiquad
 
double mdBMax
 
double mdBMin
 
bool mEditingBatchParams
 
double mLoFreq
 
double mNyquist
 
EffectScienFilterPanelmPanel
 
wxSlider * mdBMinSlider
 
wxSlider * mdBMaxSlider
 
wxStaticText * mRippleCtlP
 
wxTextCtrl * mRippleCtl
 
wxStaticText * mRippleCtlU
 
wxTextCtrl * mCutoffCtl
 
wxStaticText * mStopbandRippleCtlP
 
wxTextCtrl * mStopbandRippleCtl
 
wxStaticText * mStopbandRippleCtlU
 
wxChoice * mFilterTypeCtl
 
wxChoice * mFilterSubTypeCtl
 
wxChoice * mFilterOrderCtl
 
RulerPanelmdBRuler
 
RulerPanelmfreqRuler
 

Friends

class EffectScienFilterPanel
 

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 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 applies 'classical' IIR filters.

Performs IIR filtering that emulates analog filters, specifically Butterworth, Chebyshev Type I and Type II. Highpass and lowpass filters are supported, as are filter orders from 1 to 10.

The filter is applied using biquads

Definition at line 32 of file ScienFilter.h.

Constructor & Destructor Documentation

◆ EffectScienFilter()

EffectScienFilter::EffectScienFilter ( )

Definition at line 158 of file ScienFilter.cpp.

159 {
160  mOrder = DEF_Order;
161  mFilterType = DEF_Type;
162  mFilterSubtype = DEF_Subtype;
163  mCutoff = DEF_Cutoff;
164  mRipple = DEF_Passband;
165  mStopbandRipple = DEF_Stopband;
166 
167  SetLinearEffectFlag(true);
168 
169  mOrderIndex = mOrder - 1;
170 
171  mdBMin = -30.0;
172  mdBMax = 30.0;
173 
174  mLoFreq = 20; // Lowest frequency to display in response graph
175  mNyquist = 44100.0 / 2.0; // only used during initialization, updated when effect is used
176 }

◆ ~EffectScienFilter()

EffectScienFilter::~EffectScienFilter ( )
virtual

Definition at line 178 of file ScienFilter.cpp.

179 {
180 }

Member Function Documentation

◆ CalcFilter()

void EffectScienFilter::CalcFilter ( )
private

Definition at line 630 of file ScienFilter.cpp.

References Biquad::CalcButterworthFilter(), Biquad::CalcChebyshevType1Filter(), Biquad::CalcChebyshevType2Filter(), kButterworth, kChebyshevTypeI, kChebyshevTypeII, mCutoff, mFilterSubtype, mFilterType, mNyquist, mOrder, mpBiquad, mRipple, and mStopbandRipple.

Referenced by SetAutomationParameters(), and TransferDataFromWindow().

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

◆ DefineParams()

bool EffectScienFilter::DefineParams ( ShuttleParams S)
override

Definition at line 239 of file ScienFilter.cpp.

239  {
240  S.SHUTTLE_ENUM_PARAM( mFilterType, Type, kTypeStrings, nTypes );
241  S.SHUTTLE_ENUM_PARAM( mFilterSubtype, Subtype, kSubTypeStrings, nSubTypes );
242  S.SHUTTLE_PARAM( mOrder, Order );
243  S.SHUTTLE_PARAM( mCutoff, Cutoff );
244  S.SHUTTLE_PARAM( mRipple, Passband );
245  S.SHUTTLE_PARAM( mStopbandRipple, Stopband );
246  return true;
247 }

References kSubTypeStrings, kTypeStrings, mCutoff, mFilterSubtype, mFilterType, mOrder, mRipple, mStopbandRipple, nSubTypes, and nTypes.

◆ EnableDisableRippleCtl()

void EffectScienFilter::EnableDisableRippleCtl ( int  FilterType)
private

Definition at line 784 of file ScienFilter.cpp.

785 {
786  bool ripple;
787  bool stop;
788 
789  if (FilterType == kButterworth) // Butterworth
790  {
791  ripple = false;
792  stop = false;
793  }
794  else if (FilterType == kChebyshevTypeI) // Chebyshev Type1
795  {
796  ripple = true;
797  stop = false;
798  }
799  else // Chebyshev Type2
800  {
801  ripple = false;
802  stop = true;
803  }
804 
805  mRippleCtlP->Enable(ripple);
806  mRippleCtl->Enable(ripple);
807  mRippleCtlU->Enable(ripple);
808  mStopbandRippleCtlP->Enable(stop);
809  mStopbandRippleCtl->Enable(stop);
810  mStopbandRippleCtlU->Enable(stop);
811 }

References kButterworth, kChebyshevTypeI, mRippleCtl, mRippleCtlP, mRippleCtlU, mStopbandRippleCtl, mStopbandRippleCtlP, and mStopbandRippleCtlU.

Referenced by OnFilterType(), and TransferDataToWindow().

Here is the caller graph for this function:

◆ FilterMagnAtFreq()

float EffectScienFilter::FilterMagnAtFreq ( float  Freq)
private

Definition at line 646 of file ScienFilter.cpp.

647 {
648  float Magn;
649  if (Freq >= mNyquist)
650  Freq = mNyquist - 1; // prevent tan(PI/2)
651  float FreqWarped = tan (PI * Freq/(2*mNyquist));
652  if (mCutoff >= mNyquist)
653  mCutoff = mNyquist - 1;
654  float CutoffWarped = tan (PI * mCutoff/(2*mNyquist));
655  float fOverflowThresh = pow (10.0, 12.0 / (2*mOrder)); // once we exceed 10^12 there's not much to be gained and overflow could happen
656 
657  switch (mFilterType)
658  {
659  case kButterworth: // Butterworth
660  default:
661  switch (mFilterSubtype)
662  {
663  case kLowPass: // lowpass
664  default:
665  if (FreqWarped/CutoffWarped > fOverflowThresh) // prevent pow() overflow
666  Magn = 0;
667  else
668  Magn = sqrt (1 / (1 + pow (FreqWarped/CutoffWarped, 2*mOrder)));
669  break;
670  case kHighPass: // highpass
671  if (FreqWarped/CutoffWarped > fOverflowThresh)
672  Magn = 1;
673  else
674  Magn = sqrt (pow (FreqWarped/CutoffWarped, 2*mOrder) / (1 + pow (FreqWarped/CutoffWarped, 2*mOrder)));
675  break;
676  }
677  break;
678 
679  case kChebyshevTypeI: // Chebyshev Type 1
680  double eps; eps = sqrt(pow (10.0, wxMax(0.001, mRipple)/10.0) - 1);
681  double chebyPolyVal;
682  switch (mFilterSubtype)
683  {
684  case 0: // lowpass
685  default:
686  chebyPolyVal = Biquad::ChebyPoly(mOrder, FreqWarped/CutoffWarped);
687  Magn = sqrt (1 / (1 + square(eps) * square(chebyPolyVal)));
688  break;
689  case 1:
690  chebyPolyVal = Biquad::ChebyPoly(mOrder, CutoffWarped/FreqWarped);
691  Magn = sqrt (1 / (1 + square(eps) * square(chebyPolyVal)));
692  break;
693  }
694  break;
695 
696  case kChebyshevTypeII: // Chebyshev Type 2
697  eps = 1 / sqrt(pow (10.0, wxMax(0.001, mStopbandRipple)/10.0) - 1);
698  switch (mFilterSubtype)
699  {
700  case kLowPass: // lowpass
701  default:
702  chebyPolyVal = Biquad::ChebyPoly(mOrder, CutoffWarped/FreqWarped);
703  Magn = sqrt (1 / (1 + 1 / (square(eps) * square(chebyPolyVal))));
704  break;
705  case kHighPass:
706  chebyPolyVal = Biquad::ChebyPoly(mOrder, FreqWarped/CutoffWarped);
707  Magn = sqrt (1 / (1 + 1 / (square(eps) * square(chebyPolyVal))));
708  break;
709  }
710  break;
711  }
712 
713  return Magn;
714 }

References Biquad::ChebyPoly(), kButterworth, kChebyshevTypeI, kChebyshevTypeII, kHighPass, kLowPass, mCutoff, mFilterSubtype, mFilterType, mNyquist, mOrder, mRipple, mStopbandRipple, PI, and square.

Referenced by EffectScienFilterPanel::OnPaint().

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

◆ GetAudioInCount()

unsigned EffectScienFilter::GetAudioInCount ( )
overridevirtual

Reimplemented from Effect.

Definition at line 210 of file ScienFilter.cpp.

211 {
212  return 1;
213 }

◆ GetAudioOutCount()

unsigned EffectScienFilter::GetAudioOutCount ( )
overridevirtual

Reimplemented from Effect.

Definition at line 215 of file ScienFilter.cpp.

216 {
217  return 1;
218 }

◆ GetAutomationParameters()

bool EffectScienFilter::GetAutomationParameters ( CommandParameters parms)
overridevirtual

Reimplemented from Effect.

Definition at line 249 of file ScienFilter.cpp.

250 {
251  parms.Write(KEY_Type, kTypeStrings[mFilterType].Internal());
252  parms.Write(KEY_Subtype, kSubTypeStrings[mFilterSubtype].Internal());
253  parms.Write(KEY_Order, mOrder);
254  parms.WriteFloat(KEY_Cutoff, mCutoff);
255  parms.WriteFloat(KEY_Passband, mRipple);
256  parms.WriteFloat(KEY_Stopband, mStopbandRipple);
257 
258  return true;
259 }

References Internal, kSubTypeStrings, kTypeStrings, mCutoff, mFilterSubtype, mFilterType, mOrder, mRipple, mStopbandRipple, and CommandParameters::WriteFloat().

Here is the call graph for this function:

◆ GetDescription()

TranslatableString EffectScienFilter::GetDescription ( )
overridevirtual

Reimplemented from Effect.

Definition at line 189 of file ScienFilter.cpp.

190 {
191  /* i18n-hint: "infinite impulse response" */
192  return XO("Performs IIR filtering that emulates analog filters");
193 }

References XO.

◆ GetSymbol()

ComponentInterfaceSymbol EffectScienFilter::GetSymbol ( )
overridevirtual

Reimplemented from Effect.

Definition at line 184 of file ScienFilter.cpp.

185 {
186  return Symbol;
187 }

References Symbol.

◆ GetType()

EffectType EffectScienFilter::GetType ( )
overridevirtual

Reimplemented from Effect.

Definition at line 203 of file ScienFilter.cpp.

204 {
205  return EffectTypeProcess;
206 }

References EffectTypeProcess.

◆ Init()

bool EffectScienFilter::Init ( )
overridevirtual

Reimplemented from Effect.

Definition at line 334 of file ScienFilter.cpp.

335 {
336  int selcount = 0;
337  double rate = 0.0;
338 
339  auto trackRange = inputTracks()->Selected< const WaveTrack >();
340 
341  {
342  auto t = *trackRange.begin();
343  mNyquist =
344  (t
345  ? t->GetRate()
346  : mProjectRate)
347  / 2.0;
348  }
349 
350  for (auto t : trackRange)
351  {
352  if (selcount == 0)
353  {
354  rate = t->GetRate();
355  }
356  else
357  {
358  if (t->GetRate() != rate)
359  {
361  XO(
362 "To apply a filter, all selected tracks must have the same sample rate.") );
363  return false;
364  }
365  }
366  selcount++;
367  }
368 
369  return true;
370 }

References Effect::inputTracks(), Effect::MessageBox(), mNyquist, Effect::mProjectRate, TrackList::Selected(), and XO.

Here is the call graph for this function:

◆ ManualPage()

ManualPageID EffectScienFilter::ManualPage ( )
overridevirtual

Reimplemented from Effect.

Definition at line 195 of file ScienFilter.cpp.

196 {
197  return L"Classic_Filters";
198 }

◆ OnCutoff()

void EffectScienFilter::OnCutoff ( wxCommandEvent &  evt)
private

Definition at line 736 of file ScienFilter.cpp.

737 {
738  if (!EnableApply(mUIParent->TransferDataFromWindow()))
739  {
740  return;
741  }
742 
743  mPanel->Refresh(false);
744 }

References Effect::EnableApply(), mPanel, and Effect::mUIParent.

Here is the call graph for this function:

◆ OnFilterSubtype()

void EffectScienFilter::OnFilterSubtype ( wxCommandEvent &  evt)
private

Definition at line 730 of file ScienFilter.cpp.

731 {
732  mFilterSubtype = mFilterSubTypeCtl->GetSelection();
733  mPanel->Refresh(false);
734 }

References mFilterSubtype, mFilterSubTypeCtl, and mPanel.

◆ OnFilterType()

void EffectScienFilter::OnFilterType ( wxCommandEvent &  evt)
private

Definition at line 723 of file ScienFilter.cpp.

724 {
725  mFilterType = mFilterTypeCtl->GetSelection();
727  mPanel->Refresh(false);
728 }

References EnableDisableRippleCtl(), mFilterType, mFilterTypeCtl, and mPanel.

Here is the call graph for this function:

◆ OnOrder()

void EffectScienFilter::OnOrder ( wxCommandEvent &  evt)
private

Definition at line 716 of file ScienFilter.cpp.

717 {
718  mOrderIndex = mFilterOrderCtl->GetSelection();
719  mOrder = mOrderIndex + 1; // 0..n-1 -> 1..n
720  mPanel->Refresh(false);
721 }

References mFilterOrderCtl, mOrder, mOrderIndex, and mPanel.

◆ OnRipple()

void EffectScienFilter::OnRipple ( wxCommandEvent &  evt)
private

Definition at line 746 of file ScienFilter.cpp.

747 {
748  if (!EnableApply(mUIParent->TransferDataFromWindow()))
749  {
750  return;
751  }
752 
753  mPanel->Refresh(false);
754 }

References Effect::EnableApply(), mPanel, and Effect::mUIParent.

Here is the call graph for this function:

◆ OnSize()

void EffectScienFilter::OnSize ( wxSizeEvent &  evt)
private

Definition at line 776 of file ScienFilter.cpp.

777 {
778  // On Windows the Passband and Stopband boxes do not refresh properly
779  // on a resize...no idea why.
780  mUIParent->Refresh();
781  evt.Skip();
782 }

References Effect::mUIParent.

◆ OnSlider()

void EffectScienFilter::OnSlider ( wxCommandEvent &  evt)
private

◆ OnSliderDBMAX()

void EffectScienFilter::OnSliderDBMAX ( wxCommandEvent &  evt)
private

Definition at line 771 of file ScienFilter.cpp.

772 {
774 }

References TransferGraphLimitsFromWindow().

Here is the call graph for this function:

◆ OnSliderDBMIN()

void EffectScienFilter::OnSliderDBMIN ( wxCommandEvent &  evt)
private

Definition at line 766 of file ScienFilter.cpp.

767 {
769 }

References TransferGraphLimitsFromWindow().

Here is the call graph for this function:

◆ OnStopbandRipple()

void EffectScienFilter::OnStopbandRipple ( wxCommandEvent &  evt)
private

Definition at line 756 of file ScienFilter.cpp.

757 {
758  if (!EnableApply(mUIParent->TransferDataFromWindow()))
759  {
760  return;
761  }
762 
763  mPanel->Refresh(false);
764 }

References Effect::EnableApply(), mPanel, and Effect::mUIParent.

Here is the call graph for this function:

◆ PopulateOrExchange()

void EffectScienFilter::PopulateOrExchange ( ShuttleGui S)
overridevirtual

Reimplemented from Effect.

Definition at line 372 of file ScienFilter.cpp.

373 {
374  S.AddSpace(5);
375  S.SetSizerProportion(1);
376  S.StartMultiColumn(3, wxEXPAND);
377  {
378  S.SetStretchyCol(1);
379  S.SetStretchyRow(0);
380 
381  // -------------------------------------------------------------------
382  // ROW 1: Freq response panel and sliders for vertical scale
383  // -------------------------------------------------------------------
384 
385  S.StartVerticalLay();
386  {
388  S.GetParent(), wxID_ANY, wxVERTICAL,
389  wxSize{ 100, 100 }, // Ruler can't handle small sizes
390  RulerPanel::Range{ 30.0, -120.0 },
392  XO("dB"),
394  .LabelEdges(true)
395  );
396 
397  S.SetBorder(1);
398  S.AddSpace(1, 1);
399  S.Prop(1)
400  .Position(wxALIGN_RIGHT | wxTOP)
402  S.AddSpace(1, 1);
403  }
404  S.EndVerticalLay();
405 
407  S.GetParent(), wxID_ANY,
408  this, mLoFreq, mNyquist
409  );
410 
411  S.SetBorder(5);
412  S.Prop(1)
413  .Position(wxEXPAND | wxRIGHT)
414  .MinSize( { -1, -1 } )
415  .AddWindow(mPanel);
416 
417  S.StartVerticalLay();
418  {
419  S.AddVariableText(XO("+ dB"), false, wxCENTER);
421  .Name(XO("Max dB"))
422  .Style(wxSL_VERTICAL | wxSL_INVERSE)
423  .AddSlider( {}, 10, 20, 0);
424 #if wxUSE_ACCESSIBILITY
425  mdBMaxSlider->SetAccessible(safenew SliderAx(mdBMaxSlider, XO("%d dB")));
426 #endif
428  .Name(XO("Min dB"))
429  .Style(wxSL_VERTICAL | wxSL_INVERSE)
430  .AddSlider( {}, -10, -10, -120);
431 #if wxUSE_ACCESSIBILITY
432  mdBMinSlider->SetAccessible(safenew SliderAx(mdBMinSlider, XO("%d dB")));
433 #endif
434 
435  S.AddVariableText(XO("- dB"), false, wxCENTER);
436  }
437  S.EndVerticalLay();
438 
439  // -------------------------------------------------------------------
440  // ROW 2: Frequency ruler
441  // -------------------------------------------------------------------
442 
443  S.AddSpace(1, 1);
444 
446  S.GetParent(), wxID_ANY, wxHORIZONTAL,
447  wxSize{ 100, 100 }, // Ruler can't handle small sizes
448  RulerPanel::Range{ mLoFreq, mNyquist },
450  {},
452  .Log(true)
453  .Flip(true)
454  .LabelEdges(true)
455  );
456 
457  S.Prop(1)
458  .Position(wxEXPAND | wxALIGN_LEFT | wxRIGHT)
460 
461  S.AddSpace(1, 1);
462 
463  // -------------------------------------------------------------------
464  // ROW 3 and 4: Type, Order, Ripple, Subtype, Cutoff
465  // -------------------------------------------------------------------
466 
467  S.AddSpace(1, 1);
468  S.SetSizerProportion(0);
469  S.StartMultiColumn(8, wxALIGN_CENTER);
470  {
471  wxASSERT(nTypes == WXSIZEOF(kTypeStrings));
472 
474  .Focus()
475  .Validator<wxGenericValidator>(&mFilterType)
476  .MinSize( { -1, -1 } )
477  .AddChoice(XXO("&Filter Type:"),
479  );
480 
482  .Validator<wxGenericValidator>(&mOrderIndex)
483  .MinSize( { -1, -1 } )
484  /*i18n-hint: 'Order' means the complexity of the filter, and is a number between 1 and 10.*/
485  .AddChoice(XXO("O&rder:"),
486  []{
487  TranslatableStrings orders;
488  for (int i = 1; i <= 10; i++)
489  orders.emplace_back( Verbatim("%d").Format( i ) );
490  return orders;
491  }()
492  );
493  S.AddSpace(1, 1);
494 
495  mRippleCtlP = S.AddVariableText( XO("&Passband Ripple:"),
496  false, wxALL | wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
497  mRippleCtl = S.Id(ID_Ripple)
498  .Name(XO("Passband Ripple (dB)"))
499  .Validator<FloatingPointValidator<float>>(
500  1, &mRipple, NumValidatorStyle::DEFAULT,
501  MIN_Passband, MAX_Passband)
502  .AddTextBox( {}, wxT(""), 10);
503  mRippleCtlU = S.AddVariableText(XO("dB"),
504  false, wxALL | wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL);
505 
507  .Validator<wxGenericValidator>(&mFilterSubtype)
508  .MinSize( { -1, -1 } )
509  .AddChoice(XXO("&Subtype:"),
511  );
512 
513  mCutoffCtl = S.Id(ID_Cutoff)
514  .Name(XO("Cutoff (Hz)"))
515  .Validator<FloatingPointValidator<float>>(
516  1, &mCutoff, NumValidatorStyle::DEFAULT,
517  MIN_Cutoff, mNyquist - 1)
518  .AddTextBox(XXO("C&utoff:"), wxT(""), 10);
519  S.AddUnits(XO("Hz"));
520 
522  S.AddVariableText(XO("Minimum S&topband Attenuation:"),
523  false, wxALL | wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
525  .Name(XO("Minimum S&topband Attenuation (dB)"))
526  .Validator<FloatingPointValidator<float>>(
527  1, &mStopbandRipple, NumValidatorStyle::DEFAULT,
528  MIN_Stopband, MAX_Stopband)
529  .AddTextBox( {}, wxT(""), 10);
531  S.AddVariableText(XO("dB"),
532  false, wxALL | wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL);
533  }
534  S.EndMultiColumn();
535  S.AddSpace(1, 1);
536  }
537  S.EndMultiColumn();
538 
539  return;
540 }

References ShuttleGuiBase::AddSlider(), ShuttleGui::AddSpace(), ShuttleGuiBase::AddUnits(), ShuttleGuiBase::AddVariableText(), ShuttleGuiBase::AddWindow(), EffectScienFilterPanel, ShuttleGuiBase::EndMultiColumn(), ShuttleGuiBase::EndVerticalLay(), RulerPanel::Options::Flip(), ShuttleGui::Focus(), TranslatableString::Format(), ShuttleGuiBase::GetParent(), ShuttleGui::Id(), ID_Cutoff, ID_dBMax, ID_dBMin, ID_Order, ID_Ripple, ID_StopbandRipple, ID_SubType, ID_Type, Ruler::IntFormat, kSubTypeStrings, kTypeStrings, RulerPanel::Options::LabelEdges(), Ruler::LinearDBFormat, RulerPanel::Options::Log(), mCutoff, mCutoffCtl, mdBMaxSlider, mdBMinSlider, mdBRuler, mFilterOrderCtl, mFilterSubtype, mFilterSubTypeCtl, mFilterType, mFilterTypeCtl, mfreqRuler, ShuttleGui::MinSize(), mLoFreq, mNyquist, mOrderIndex, mPanel, mRipple, mRippleCtl, mRippleCtlP, mRippleCtlU, Msgids(), mStopbandRipple, mStopbandRippleCtl, mStopbandRippleCtlP, mStopbandRippleCtlU, ShuttleGui::Name(), nSubTypes, nTypes, ShuttleGui::Position(), ShuttleGui::Prop(), safenew, ShuttleGuiBase::SetBorder(), ShuttleGuiBase::SetSizerProportion(), ShuttleGuiBase::SetStretchyCol(), ShuttleGuiBase::SetStretchyRow(), ShuttleGuiBase::StartMultiColumn(), ShuttleGuiBase::StartVerticalLay(), ShuttleGui::Style(), ShuttleGui::Validator(), Verbatim(), XO, and XXO.

Here is the call graph for this function:

◆ ProcessBlock()

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

Reimplemented from Effect.

Definition at line 228 of file ScienFilter.cpp.

229 {
230  float *ibuf = inBlock[0];
231  for (int iPair = 0; iPair < (mOrder + 1) / 2; iPair++)
232  {
233  mpBiquad[iPair].Process(ibuf, outBlock[0], blockLen);
234  ibuf = outBlock[0];
235  }
236 
237  return blockLen;
238 }

References mOrder, and mpBiquad.

◆ ProcessInitialize()

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

Reimplemented from Effect.

Definition at line 220 of file ScienFilter.cpp.

221 {
222  for (int iPair = 0; iPair < (mOrder + 1) / 2; iPair++)
223  mpBiquad[iPair].Reset();
224 
225  return true;
226 }

References mOrder, and mpBiquad.

◆ SetAutomationParameters()

bool EffectScienFilter::SetAutomationParameters ( CommandParameters parms)
overridevirtual

Reimplemented from Effect.

Definition at line 261 of file ScienFilter.cpp.

262 {
265  ReadAndVerifyInt(Order);
266  ReadAndVerifyFloat(Cutoff);
267  ReadAndVerifyFloat(Passband);
268  ReadAndVerifyFloat(Stopband);
269 
270  mFilterType = Type;
271  mFilterSubtype = Subtype;
272  mOrder = Order;
273  mCutoff = Cutoff;
274  mRipple = Passband;
275  mStopbandRipple = Stopband;
276 
277  mOrderIndex = mOrder - 1;
278 
279  CalcFilter();
280 
281  return true;
282 }

References CalcFilter(), kSubTypeStrings, kTypeStrings, mCutoff, mFilterSubtype, mFilterType, mOrder, mOrderIndex, mRipple, mStopbandRipple, nSubTypes, nTypes, ReadAndVerifyEnum, ReadAndVerifyFloat, and ReadAndVerifyInt.

Here is the call graph for this function:

◆ Startup()

bool EffectScienFilter::Startup ( )
overridevirtual

Reimplemented from Effect.

Definition at line 286 of file ScienFilter.cpp.

287 {
288  wxString base = wxT("/SciFilter/");
289 
290  // Migrate settings from 2.1.0 or before
291 
292  // Already migrated, so bail
293  if (gPrefs->Exists(base + wxT("Migrated")))
294  {
295  return true;
296  }
297 
298  // Load the old "current" settings
299  if (gPrefs->Exists(base))
300  {
301  double dTemp;
302  gPrefs->Read(base + wxT("Order"), &mOrder, 1);
303  mOrder = wxMax (1, mOrder);
304  mOrder = wxMin (MAX_Order, mOrder);
305  gPrefs->Read(base + wxT("FilterType"), &mFilterType, 0);
306  mFilterType = wxMax (0, mFilterType);
307  mFilterType = wxMin (2, mFilterType);
308  gPrefs->Read(base + wxT("FilterSubtype"), &mFilterSubtype, 0);
309  mFilterSubtype = wxMax (0, mFilterSubtype);
310  mFilterSubtype = wxMin (1, mFilterSubtype);
311  gPrefs->Read(base + wxT("Cutoff"), &dTemp, 1000.0);
312  mCutoff = (float)dTemp;
313  mCutoff = wxMax (1, mCutoff);
314  mCutoff = wxMin (100000, mCutoff);
315  gPrefs->Read(base + wxT("Ripple"), &dTemp, 1.0);
316  mRipple = dTemp;
317  mRipple = wxMax (0, mRipple);
318  mRipple = wxMin (100, mRipple);
319  gPrefs->Read(base + wxT("StopbandRipple"), &dTemp, 30.0);
320  mStopbandRipple = dTemp;
321  mStopbandRipple = wxMax (0, mStopbandRipple);
322  mStopbandRipple = wxMin (100, mStopbandRipple);
323 
325 
326  // Do not migrate again
327  gPrefs->Write(base + wxT("Migrated"), true);
328  gPrefs->Flush();
329  }
330 
331  return true;
332 }

References FileConfig::Flush(), Effect::GetCurrentSettingsGroup(), gPrefs, mCutoff, mFilterSubtype, mFilterType, mOrder, mRipple, mStopbandRipple, and Effect::SaveUserPreset().

Here is the call graph for this function:

◆ TransferDataFromWindow()

bool EffectScienFilter::TransferDataFromWindow ( )
overridevirtual

Reimplemented from Effect.

Definition at line 565 of file ScienFilter.cpp.

566 {
567  if (!mUIParent->Validate() || !mUIParent->TransferDataFromWindow())
568  {
569  return false;
570  }
571 
572  mOrder = mOrderIndex + 1;
573 
574  CalcFilter();
575 
576  return true;
577 }

References CalcFilter(), mOrder, mOrderIndex, and Effect::mUIParent.

Here is the call graph for this function:

◆ TransferDataToWindow()

bool EffectScienFilter::TransferDataToWindow ( )
overridevirtual

Reimplemented from Effect.

Definition at line 545 of file ScienFilter.cpp.

546 {
547  mOrderIndex = mOrder - 1;
548 
549  if (!mUIParent->TransferDataToWindow())
550  {
551  return false;
552  }
553 
554  mdBMinSlider->SetValue((int) mdBMin);
555  mdBMin = 0.0; // force refresh in TransferGraphLimitsFromWindow()
556 
557  mdBMaxSlider->SetValue((int) mdBMax);
558  mdBMax = 0.0; // force refresh in TransferGraphLimitsFromWindow()
559 
561 
563 }

References EnableDisableRippleCtl(), mdBMax, mdBMaxSlider, mdBMin, mdBMinSlider, mFilterType, mOrder, mOrderIndex, Effect::mUIParent, and TransferGraphLimitsFromWindow().

Here is the call graph for this function:

◆ TransferGraphLimitsFromWindow()

bool EffectScienFilter::TransferGraphLimitsFromWindow ( )
private

Definition at line 584 of file ScienFilter.cpp.

585 {
586  // Read the sliders and send to the panel
587  wxString tip;
588 
589  bool rr = false;
590  int dB = mdBMinSlider->GetValue();
591  if (dB != mdBMin) {
592  rr = true;
593  mdBMin = dB;
594  tip.Printf(_("%d dB"), (int)mdBMin);
595  mdBMinSlider->SetToolTip(tip);
596  }
597 
598  dB = mdBMaxSlider->GetValue();
599  if (dB != mdBMax) {
600  rr = true;
601  mdBMax = dB;
602  tip.Printf(_("%d dB"),(int)mdBMax);
603  mdBMaxSlider->SetToolTip(tip);
604  }
605 
606  if (rr) {
608  }
609 
610  // Refresh ruler if values have changed
611  if (rr) {
612  int w1, w2, h;
613  mdBRuler->ruler.GetMaxSize(&w1, &h);
615  mdBRuler->ruler.GetMaxSize(&w2, &h);
616  if( w1 != w2 ) // Reduces flicker
617  {
618  mdBRuler->SetSize(wxSize(w2,h));
619  mUIParent->Layout();
620  mfreqRuler->Refresh(false);
621  }
622  mdBRuler->Refresh(false);
623  }
624 
625  mPanel->Refresh(false);
626 
627  return true;
628 }

References _, Ruler::GetMaxSize(), mdBMax, mdBMaxSlider, mdBMin, mdBMinSlider, mdBRuler, mfreqRuler, mPanel, Effect::mUIParent, RulerPanel::ruler, EffectScienFilterPanel::SetDbRange(), and Ruler::SetRange().

Referenced by OnSliderDBMAX(), OnSliderDBMIN(), and TransferDataToWindow().

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

Friends And Related Function Documentation

◆ EffectScienFilterPanel

friend class EffectScienFilterPanel
friend

Definition at line 129 of file ScienFilter.h.

Referenced by PopulateOrExchange().

Member Data Documentation

◆ mCutoff

float EffectScienFilter::mCutoff
private

◆ mCutoffCtl

wxTextCtrl* EffectScienFilter::mCutoffCtl
private

Definition at line 114 of file ScienFilter.h.

Referenced by PopulateOrExchange().

◆ mdBMax

double EffectScienFilter::mdBMax
private

Definition at line 99 of file ScienFilter.h.

Referenced by TransferDataToWindow(), and TransferGraphLimitsFromWindow().

◆ mdBMaxSlider

wxSlider* EffectScienFilter::mdBMaxSlider
private

◆ mdBMin

double EffectScienFilter::mdBMin
private

Definition at line 100 of file ScienFilter.h.

Referenced by TransferDataToWindow(), and TransferGraphLimitsFromWindow().

◆ mdBMinSlider

wxSlider* EffectScienFilter::mdBMinSlider
private

◆ mdBRuler

RulerPanel* EffectScienFilter::mdBRuler
private

◆ mEditingBatchParams

bool EffectScienFilter::mEditingBatchParams
private

Definition at line 101 of file ScienFilter.h.

◆ mFilterOrderCtl

wxChoice* EffectScienFilter::mFilterOrderCtl
private

Definition at line 122 of file ScienFilter.h.

Referenced by OnOrder(), and PopulateOrExchange().

◆ mFilterSubtype

int EffectScienFilter::mFilterSubtype
private

◆ mFilterSubTypeCtl

wxChoice* EffectScienFilter::mFilterSubTypeCtl
private

Definition at line 121 of file ScienFilter.h.

Referenced by OnFilterSubtype(), and PopulateOrExchange().

◆ mFilterType

int EffectScienFilter::mFilterType
private

◆ mFilterTypeCtl

wxChoice* EffectScienFilter::mFilterTypeCtl
private

Definition at line 120 of file ScienFilter.h.

Referenced by OnFilterType(), and PopulateOrExchange().

◆ mfreqRuler

RulerPanel* EffectScienFilter::mfreqRuler
private

◆ mLoFreq

double EffectScienFilter::mLoFreq
private

Definition at line 103 of file ScienFilter.h.

Referenced by PopulateOrExchange().

◆ mNyquist

double EffectScienFilter::mNyquist
private

Definition at line 104 of file ScienFilter.h.

Referenced by CalcFilter(), FilterMagnAtFreq(), Init(), and PopulateOrExchange().

◆ mOrder

int EffectScienFilter::mOrder
private

◆ mOrderIndex

int EffectScienFilter::mOrderIndex
private

◆ mPanel

EffectScienFilterPanel* EffectScienFilter::mPanel
private

◆ mpBiquad

ArrayOf<Biquad> EffectScienFilter::mpBiquad
private

Definition at line 97 of file ScienFilter.h.

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

◆ mRipple

float EffectScienFilter::mRipple
private

◆ mRippleCtl

wxTextCtrl* EffectScienFilter::mRippleCtl
private

Definition at line 111 of file ScienFilter.h.

Referenced by EnableDisableRippleCtl(), and PopulateOrExchange().

◆ mRippleCtlP

wxStaticText* EffectScienFilter::mRippleCtlP
private

Definition at line 110 of file ScienFilter.h.

Referenced by EnableDisableRippleCtl(), and PopulateOrExchange().

◆ mRippleCtlU

wxStaticText* EffectScienFilter::mRippleCtlU
private

Definition at line 112 of file ScienFilter.h.

Referenced by EnableDisableRippleCtl(), and PopulateOrExchange().

◆ mStopbandRipple

float EffectScienFilter::mStopbandRipple
private

◆ mStopbandRippleCtl

wxTextCtrl* EffectScienFilter::mStopbandRippleCtl
private

Definition at line 117 of file ScienFilter.h.

Referenced by EnableDisableRippleCtl(), and PopulateOrExchange().

◆ mStopbandRippleCtlP

wxStaticText* EffectScienFilter::mStopbandRippleCtlP
private

Definition at line 116 of file ScienFilter.h.

Referenced by EnableDisableRippleCtl(), and PopulateOrExchange().

◆ mStopbandRippleCtlU

wxStaticText* EffectScienFilter::mStopbandRippleCtlU
private

Definition at line 118 of file ScienFilter.h.

Referenced by EnableDisableRippleCtl(), and PopulateOrExchange().

◆ Symbol

const ComponentInterfaceSymbol EffectScienFilter::Symbol { XO("Classic Filters") }
static

Definition at line 35 of file ScienFilter.h.

Referenced by GetSymbol().


The documentation for this class was generated from the following files:
ShuttleGuiBase::StartVerticalLay
void StartVerticalLay(int iProp=1)
Definition: ShuttleGui.cpp:1184
WaveTrack
A Track that contains audio waveform data.
Definition: WaveTrack.h:69
EffectTypeProcess
@ EffectTypeProcess
Definition: EffectInterface.h:59
ShuttleGui::Focus
ShuttleGui & Focus(bool focused=true)
Definition: ShuttleGui.h:644
kHighPass
@ kHighPass
Definition: ScienFilter.cpp:110
Effect::SetLinearEffectFlag
void SetLinearEffectFlag(bool linearEffectFlag)
Definition: Effect.cpp:2001
RulerPanel
RulerPanel class allows you to work with a Ruler like any other wxWindow.
Definition: Ruler.h:228
Effect::EnableApply
virtual bool EnableApply(bool enable=true)
Definition: Effect.cpp:1926
EffectScienFilter::mdBMax
double mdBMax
Definition: ScienFilter.h:99
EffectScienFilter::mLoFreq
double mLoFreq
Definition: ScienFilter.h:103
Ruler::LinearDBFormat
@ LinearDBFormat
Definition: Ruler.h:34
EffectScienFilter::mOrderIndex
int mOrderIndex
Definition: ScienFilter.h:96
EffectScienFilter::mRippleCtlU
wxStaticText * mRippleCtlU
Definition: ScienFilter.h:112
gPrefs
FileConfig * gPrefs
Definition: Prefs.cpp:70
EffectScienFilter::mFilterType
int mFilterType
Definition: ScienFilter.h:93
ID_Cutoff
@ ID_Cutoff
Definition: ScienFilter.cpp:85
TranslatableStrings
std::vector< TranslatableString > TranslatableStrings
Definition: TranslatableString.h:295
Effect::MessageBox
int MessageBox(const TranslatableString &message, long style=DefaultMessageBoxStyle, const TranslatableString &titleStr={})
Definition: Effect.cpp:2482
kChebyshevTypeII
@ kChebyshevTypeII
Definition: ScienFilter.cpp:93
EffectScienFilter::mpBiquad
ArrayOf< Biquad > mpBiquad
Definition: ScienFilter.h:97
square
#define square(a)
Definition: ScienFilter.cpp:74
ID_dBMax
@ ID_dBMax
Definition: ScienFilter.cpp:79
EffectScienFilter::mCutoff
float mCutoff
Definition: ScienFilter.h:90
EffectScienFilter::mNyquist
double mNyquist
Definition: ScienFilter.h:104
Validator
A Validator is an object which checks whether a wxVariant satisfies a certain criterion....
Definition: Validators.h:53
ShuttleGui::AddSpace
wxSizerItem * AddSpace(int width, int height, int prop=0)
Definition: ShuttleGui.cpp:2459
kSubTypeStrings
static const EnumValueSymbol kSubTypeStrings[nSubTypes]
Definition: ScienFilter.cpp:114
EffectScienFilter::EnableDisableRippleCtl
void EnableDisableRippleCtl(int FilterType)
Definition: ScienFilter.cpp:784
ShuttleGui::MinSize
ShuttleGui & MinSize()
Definition: ShuttleGui.h:733
XO
#define XO(s)
Definition: Internat.h:31
ShuttleGuiBase::EndMultiColumn
void EndMultiColumn()
Definition: ShuttleGui.cpp:1238
ID_SubType
@ ID_SubType
Definition: ScienFilter.cpp:82
CommandParameters::WriteFloat
bool WriteFloat(const wxString &key, float f)
Definition: EffectAutomationParameters.h:155
nTypes
@ nTypes
Definition: ScienFilter.cpp:94
Effect::SaveUserPreset
bool SaveUserPreset(const RegistryPath &name) override
Definition: Effect.cpp:570
ID_dBMin
@ ID_dBMin
Definition: ScienFilter.cpp:80
EffectScienFilter::CalcFilter
void CalcFilter()
Definition: ScienFilter.cpp:630
ShuttleGui::Id
ShuttleGui & Id(int id)
Definition: ShuttleGui.cpp:2274
EffectScienFilter::mFilterOrderCtl
wxChoice * mFilterOrderCtl
Definition: ScienFilter.h:122
EffectScienFilter::mfreqRuler
RulerPanel * mfreqRuler
Definition: ScienFilter.h:125
kTypeStrings
static const EnumValueSymbol kTypeStrings[nTypes]
Definition: ScienFilter.cpp:97
Ruler::GetMaxSize
void GetMaxSize(wxCoord *width, wxCoord *height)
Definition: Ruler.cpp:1603
RulerPanel::Range
std::pair< double, double > Range
Definition: Ruler.h:232
ShuttleGui::Style
ShuttleGui & Style(long iStyle)
Definition: ShuttleGui.h:727
PI
#define PI
Definition: ScienFilter.cpp:70
Effect::mProjectRate
double mProjectRate
Definition: Effect.h:458
ReadAndVerifyEnum
#define ReadAndVerifyEnum(name, list, listSize)
Definition: Effect.h:621
ShuttleGuiBase::SetSizerProportion
void SetSizerProportion(int iProp)
Definition: ShuttleGui.h:491
ReadAndVerifyInt
#define ReadAndVerifyInt(name)
Definition: Effect.h:632
XXO
#define XXO(s)
Definition: Internat.h:44
Effect::inputTracks
const TrackList * inputTracks() const
Definition: Effect.h:463
EffectScienFilter::mdBMaxSlider
wxSlider * mdBMaxSlider
Definition: ScienFilter.h:108
ShuttleGuiBase::StartMultiColumn
void StartMultiColumn(int nCols, int PositionFlags=wxALIGN_LEFT)
Definition: ShuttleGui.cpp:1229
kChebyshevTypeI
@ kChebyshevTypeI
Definition: ScienFilter.cpp:92
ShuttleGuiBase::EndVerticalLay
void EndVerticalLay()
Definition: ShuttleGui.cpp:1203
EffectScienFilter::mStopbandRippleCtl
wxTextCtrl * mStopbandRippleCtl
Definition: ScienFilter.h:117
ShuttleGuiBase::AddUnits
void AddUnits(const TranslatableString &Prompt, int wrapWidth=0)
Left aligned text string.
Definition: ShuttleGui.cpp:263
EffectScienFilter::mFilterSubtype
int mFilterSubtype
Definition: ScienFilter.h:94
EffectScienFilter::mFilterSubTypeCtl
wxChoice * mFilterSubTypeCtl
Definition: ScienFilter.h:121
ShuttleGuiBase::GetParent
wxWindow * GetParent()
Definition: ShuttleGui.h:496
ShuttleGui::Validator
ShuttleGui & Validator(const Factory &f)
Definition: ShuttleGui.h:678
ID_Type
@ ID_Type
Definition: ScienFilter.cpp:81
ShuttleGuiBase::AddWindow
wxWindow * AddWindow(wxWindow *pWindow, int PositionFlags=wxALIGN_CENTRE)
Definition: ShuttleGui.cpp:299
Ruler::SetRange
void SetRange(double min, double max)
Definition: Ruler.cpp:188
Ruler::IntFormat
@ IntFormat
Definition: Ruler.h:30
ID_StopbandRipple
@ ID_StopbandRipple
Definition: ScienFilter.cpp:86
EffectScienFilter::Symbol
static const ComponentInterfaceSymbol Symbol
Definition: ScienFilter.h:35
EffectScienFilter::mStopbandRippleCtlP
wxStaticText * mStopbandRippleCtlP
Definition: ScienFilter.h:116
Msgids
TranslatableStrings Msgids(const EnumValueSymbol strings[], size_t nStrings)
Convenience function often useful when adding choice controls.
Definition: ShuttleGui.cpp:2522
ShuttleGui::Prop
ShuttleGui & Prop(int iProp)
Definition: ShuttleGui.h:725
ShuttleGuiBase::AddSlider
wxSlider * AddSlider(const TranslatableString &Prompt, int pos, int Max, int Min=0)
Definition: ShuttleGui.cpp:589
RulerPanel::Options::LabelEdges
Options & LabelEdges(bool l)
Definition: Ruler.h:250
Effect::GetCurrentSettingsGroup
RegistryPath GetCurrentSettingsGroup() override
Definition: Effect.cpp:866
RulerPanel::Options::Flip
Options & Flip(bool f)
Definition: Ruler.h:247
EffectScienFilter::mdBMin
double mdBMin
Definition: ScienFilter.h:100
Biquad::CalcChebyshevType1Filter
static ArrayOf< Biquad > CalcChebyshevType1Filter(int order, double fn, double fc, double ripple, int type)
Definition: Biquad.cpp:146
kButterworth
@ kButterworth
Definition: ScienFilter.cpp:91
ShuttleGui::Name
ShuttleGui & Name(const TranslatableString &name)
Definition: ShuttleGui.h:663
EffectScienFilter::mPanel
EffectScienFilterPanel * mPanel
Definition: ScienFilter.h:106
ID_Ripple
@ ID_Ripple
Definition: ScienFilter.cpp:84
FileConfig::Flush
virtual bool Flush(bool bCurrentOnly=false) wxOVERRIDE
Definition: FileConfig.cpp:143
EffectScienFilterPanel::SetDbRange
void SetDbRange(double min, double max)
Definition: ScienFilter.cpp:852
EffectScienFilter::mdBMinSlider
wxSlider * mdBMinSlider
Definition: ScienFilter.h:107
EffectScienFilter::mRipple
float mRipple
Definition: ScienFilter.h:91
ShuttleGui::Position
ShuttleGui & Position(int flags)
Definition: ShuttleGui.h:712
Effect::mUIParent
wxWindow * mUIParent
Definition: Effect.h:478
_
#define _(s)
Definition: Internat.h:75
EffectScienFilter::mCutoffCtl
wxTextCtrl * mCutoffCtl
Definition: ScienFilter.h:114
nSubTypes
@ nSubTypes
Definition: ScienFilter.cpp:111
RulerPanel::Options
Definition: Ruler.h:234
EffectScienFilter::mRippleCtlP
wxStaticText * mRippleCtlP
Definition: ScienFilter.h:110
EffectScienFilter::mOrder
int mOrder
Definition: ScienFilter.h:95
Verbatim
TranslatableString Verbatim(wxString str)
Require calls to the one-argument constructor to go through this distinct global function name.
Definition: TranslatableString.h:321
RulerPanel::ruler
Ruler ruler
Definition: Ruler.h:288
ExceptionType::Internal
@ Internal
Indicates internal failure from Audacity.
kLowPass
@ kLowPass
Definition: ScienFilter.cpp:109
EffectScienFilter::mStopbandRippleCtlU
wxStaticText * mStopbandRippleCtlU
Definition: ScienFilter.h:118
EffectScienFilter::mStopbandRipple
float mStopbandRipple
Definition: ScienFilter.h:92
Biquad::ChebyPoly
static double ChebyPoly(int Order, double NormFreq)
Definition: Biquad.cpp:329
ShuttleGuiBase::SetBorder
void SetBorder(int Border)
Definition: ShuttleGui.h:489
TranslatableString::Format
TranslatableString & Format(Args &&...args) &
Capture variadic format arguments (by copy) when there is no plural.
Definition: TranslatableString.h:103
ShuttleGuiBase::AddVariableText
wxStaticText * AddVariableText(const TranslatableString &Str, bool bCenter=false, int PositionFlags=0, int wrapWidth=0)
Definition: ShuttleGui.cpp:463
Biquad::CalcButterworthFilter
static ArrayOf< Biquad > CalcButterworthFilter(int order, double fn, double fc, int type)
Definition: Biquad.cpp:64
EffectScienFilter::EffectScienFilterPanel
friend class EffectScienFilterPanel
Definition: ScienFilter.h:129
safenew
#define safenew
Definition: MemoryX.h:10
Biquad::CalcChebyshevType2Filter
static ArrayOf< Biquad > CalcChebyshevType2Filter(int order, double fn, double fc, double ripple, int type)
Definition: Biquad.cpp:228
ShuttleGuiBase::SetStretchyCol
void SetStretchyCol(int i)
Used to modify an already placed FlexGridSizer to make a column stretchy.
Definition: ShuttleGui.cpp:202
EffectScienFilter::mFilterTypeCtl
wxChoice * mFilterTypeCtl
Definition: ScienFilter.h:120
ID_Order
@ ID_Order
Definition: ScienFilter.cpp:83
TrackList::Selected
auto Selected() -> TrackIterRange< TrackType >
Definition: Track.h:1388
EffectScienFilter::TransferGraphLimitsFromWindow
bool TransferGraphLimitsFromWindow()
Definition: ScienFilter.cpp:584
ShuttleGuiBase::SetStretchyRow
void SetStretchyRow(int i)
Used to modify an already placed FlexGridSizer to make a row stretchy.
Definition: ShuttleGui.cpp:212
RulerPanel::Options::Log
Options & Log(bool l)
Definition: Ruler.h:244
ReadAndVerifyFloat
#define ReadAndVerifyFloat(name)
Definition: Effect.h:634
EffectScienFilter::mRippleCtl
wxTextCtrl * mRippleCtl
Definition: ScienFilter.h:111
EffectScienFilter::mdBRuler
RulerPanel * mdBRuler
Definition: ScienFilter.h:124