Audacity  3.0.3
Classes | Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | Static Protected Attributes | Private Member Functions | Private Attributes | Friends | List of all members
Effect Class Reference

An Effect object is at once host and client: it is self-hosting. More...

#include <Effect.h>

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

Classes

class  AddedAnalysisTrack
 
class  ModifiedAnalysisTrack
 

Public Types

enum  : long { DefaultMessageBoxStyle = wxOK | wxCENTRE }
 
using VetoDialogHook = bool(*)(wxDialog *)
 

Public Member Functions

 Effect ()
 
virtual ~Effect ()
 
PluginPath GetPath () override
 
ComponentInterfaceSymbol GetSymbol () override
 
VendorSymbol GetVendor () override
 
wxString GetVersion () override
 
TranslatableString GetDescription () override
 
EffectType GetType () override
 
EffectFamilySymbol GetFamily () override
 
bool IsInteractive () override
 
bool IsDefault () override
 
bool IsLegacy () override
 
bool SupportsRealtime () override
 
bool SupportsAutomation () override
 
bool SetHost (EffectHostInterface *host) override
 
unsigned GetAudioInCount () override
 
unsigned GetAudioOutCount () 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 ProcessInitialize (sampleCount totalLen, ChannelNames chanMap=NULL) override
 
bool ProcessFinalize () 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
 
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
 
int ShowClientInterface (wxWindow &parent, wxDialog &dialog, bool forceModal=false) override
 
bool GetAutomationParameters (CommandParameters &parms) override
 
bool SetAutomationParameters (CommandParameters &parms) override
 
bool LoadUserPreset (const RegistryPath &name) override
 
bool SaveUserPreset (const RegistryPath &name) override
 
RegistryPaths GetFactoryPresets () override
 
bool LoadFactoryPreset (int id) override
 
bool LoadFactoryDefaults () override
 
bool PopulateUI (ShuttleGui &S) final
 Adds controls to a panel that is given as the parent window of S More...
 
bool IsGraphicalUI () override
 
bool ValidateUI () override
 
bool HideUI () override
 
bool CloseUI () override
 
bool CanExportPresets () override
 
void ExportPresets () override
 
void ImportPresets () override
 
bool HasOptions () override
 
void ShowOptions () override
 
EffectDefinitionInterfaceGetDefinition () override
 
double 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 ()
 
int ShowHostInterface (wxWindow &parent, const EffectDialogFactory &factory, bool forceModal=false) override
 
virtual bool Startup (EffectUIClientInterface *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 ManualPageID ManualPage ()
 
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 EffectUIClientInterface
virtual ~EffectUIClientInterface ()
 
- Public Member Functions inherited from EffectClientInterface
virtual ~EffectClientInterface ()
 
- Public Member Functions inherited from EffectDefinitionInterface
virtual ~EffectDefinitionInterface ()
 
virtual EffectType GetClassification ()
 
virtual bool EnablesDebug ()
 Whether the effect dialog should have a Debug button; default, always false. More...
 
- Public Member Functions inherited from ComponentInterface
virtual ~ComponentInterface ()
 
TranslatableString GetName ()
 
virtual bool DefineParams (ShuttleParams &WXUNUSED(S))
 
- Public Member Functions inherited from EffectUIHostInterface
virtual ~EffectUIHostInterface ()
 
- Public Member Functions inherited from EffectHostInterface
virtual ~EffectHostInterface ()
 

Static Public Member Functions

static VetoDialogHook SetVetoDialogHook (VetoDialogHook hook)
 
static CommandID GetSquashedName (wxString name)
 
static void IncEffectCounter ()
 

Static Public Attributes

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

Protected Member Functions

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 void PopulateOrExchange (ShuttleGui &S)
 
virtual bool TransferDataToWindow ()
 
virtual bool TransferDataFromWindow ()
 
virtual bool EnableApply (bool enable=true)
 
virtual bool EnablePreview (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

ProgressDialogmProgress
 
double mProjectRate
 
double mSampleRate
 
wxWeakRef< NotifyingSelectedRegionmpSelectedRegion {}
 
WaveTrackFactorymFactory
 
std::shared_ptr< TrackListmOutputTracks
 
double mT0
 
double mT1
 
wxArrayString mPresetNames
 
wxArrayString mPresetValues
 
int mPass
 
wxWindowPtr< wxDialog > mHostUIDialog
 This smart pointer controls the lifetime of the dialog. More...
 
wxWeakRef< wxDialog > mUIDialog
 This weak pointer may be the same as the above, or null. More...
 
wxWindow * mUIParent
 
unsigned mUIFlags
 
sampleCount mSampleCnt
 

Static Protected Attributes

static int nEffectsDone =0
 

Private Member Functions

void CountWaveTracks ()
 
bool ProcessTrack (int count, ChannelNames map, WaveTrack *left, WaveTrack *right, sampleCount start, sampleCount len, FloatBuffers &inBuffer, FloatBuffers &outBuffer, ArrayOf< float * > &inBufPos, ArrayOf< float * > &outBufPos)
 

Private Attributes

TrackListmTracks
 
bool mIsBatch
 
bool mIsLinearEffect
 
bool mPreviewWithNotSelected
 
bool mPreviewFullSelection
 
double mDuration
 
NumericFormatSymbol mDurationFormat
 
bool mIsPreview
 
std::vector< Track * > mIMap
 
std::vector< Track * > mOMap
 
int mNumTracks
 
int mNumGroups
 
EffectUIClientInterfacemClient
 
size_t mNumAudioIn
 
size_t mNumAudioOut
 
size_t mBufferSize
 
size_t mBlockSize
 
unsigned mNumChannels
 

Friends

class EffectUIHost
 

Detailed Description

An Effect object is at once host and client: it is self-hosting.

Base class for many of the effects in Audacity.

Definition at line 73 of file Effect.h.

Member Typedef Documentation

◆ VetoDialogHook

using Effect::VetoDialogHook = bool (*) ( wxDialog* )

Definition at line 91 of file Effect.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum : long
Enumerator
DefaultMessageBoxStyle 

Definition at line 244 of file Effect.h.

244 : long { DefaultMessageBoxStyle = wxOK | wxCENTRE };

Constructor & Destructor Documentation

◆ Effect()

Effect::Effect ( )

Definition at line 86 of file Effect.cpp.

87 {
88  mClient = NULL;
89 
90  mTracks = NULL;
91  mT0 = 0.0;
92  mT1 = 0.0;
93  mDuration = 0.0;
94  mIsPreview = false;
95  mIsLinearEffect = false;
97  mPreviewFullSelection = false;
98  mNumTracks = 0;
99  mNumGroups = 0;
100  mProgress = NULL;
101 
102  mUIParent = NULL;
103  mUIFlags = 0;
104 
105  mNumAudioIn = 0;
106  mNumAudioOut = 0;
107 
108  mBufferSize = 0;
109  mBlockSize = 0;
110  mNumChannels = 0;
111 
112  // PRL: I think this initialization of mProjectRate doesn't matter
113  // because it is always reassigned in DoEffect before it is used
114  // STF: but can't call AudioIOBase::GetOptimalSupportedSampleRate() here.
115  // (Which is called to compute the default-default value.) (Bug 2280)
117 
118  mIsBatch = false;
119 }

References QualitySettings::DefaultSampleRate, mBlockSize, mBufferSize, mClient, mDuration, mIsBatch, mIsLinearEffect, mIsPreview, mNumAudioIn, mNumAudioOut, mNumChannels, mNumGroups, mNumTracks, mPreviewFullSelection, mPreviewWithNotSelected, mProgress, mProjectRate, mT0, mT1, mTracks, mUIFlags, mUIParent, and Setting< T >::ReadWithDefault().

Here is the call graph for this function:

◆ ~Effect()

Effect::~Effect ( )
virtual

Definition at line 121 of file Effect.cpp.

122 {
123  // Destroying what is usually the unique Effect object of its subclass,
124  // which lasts until the end of the session.
125  // Maybe there is a non-modal realtime dialog still open.
126  if (mHostUIDialog)
127  mHostUIDialog->Close();
128 }

References mHostUIDialog.

Member Function Documentation

◆ AddAnalysisTrack()

auto Effect::AddAnalysisTrack ( const wxString &  name = wxString())
protected

Definition at line 1996 of file Effect.cpp.

1997 {
1998  return std::shared_ptr<AddedAnalysisTrack>
1999  { safenew AddedAnalysisTrack{ this, name } };
2000 }

References name, and safenew.

Referenced by EffectFindClipping::Process(), and VampEffect::Process().

Here is the caller graph for this function:

◆ AddToOutputTracks()

Track * Effect::AddToOutputTracks ( const std::shared_ptr< Track > &  t)
protected

Definition at line 1959 of file Effect.cpp.

1960 {
1961  mIMap.push_back(NULL);
1962  mOMap.push_back(t.get());
1963  return mOutputTracks->Add(t);
1964 }

References mIMap, mOMap, and mOutputTracks.

Referenced by NyquistEffect::ProcessOne().

Here is the caller graph for this function:

◆ CalcPreviewInputLength()

double Effect::CalcPreviewInputLength ( double  previewLength)
protectedvirtual

Reimplemented in EffectTruncSilence, EffectTimeScale, EffectPaulstretch, and EffectChangeSpeed.

Definition at line 2146 of file Effect.cpp.

2147 {
2148  return previewLength;
2149 }

Referenced by Preview(), and ProcessTrack().

Here is the caller graph for this function:

◆ CanExportPresets()

bool Effect::CanExportPresets ( )
overridevirtual

Implements EffectUIClientInterface.

Definition at line 667 of file Effect.cpp.

668 {
669  return true;
670 }

◆ CheckWhetherSkipEffect()

virtual bool Effect::CheckWhetherSkipEffect ( )
inlineprotectedvirtual

Reimplemented in NyquistEffect, EffectNormalize, EffectNoiseRemoval, EffectNoiseReduction, EffectLoudness, EffectClickRemoval, EffectChangeSpeed, and EffectBassTreble.

Definition at line 269 of file Effect.h.

269 { return false; }

Referenced by DoEffect().

Here is the caller graph for this function:

◆ CloseUI()

bool Effect::CloseUI ( )
overridevirtual

Implements EffectUIClientInterface.

Reimplemented in EffectEqualization.

Definition at line 656 of file Effect.cpp.

657 {
658  if (mUIParent)
659  mUIParent->RemoveEventHandler(this);
660 
661  mUIParent = NULL;
662  mUIDialog = NULL;
663 
664  return true;
665 }

References mUIDialog, and mUIParent.

Referenced by EffectEqualization::CloseUI().

Here is the caller graph for this function:

◆ CopyInputTracks()

void Effect::CopyInputTracks ( bool  allSyncLockSelected = false)
protected

Definition at line 1932 of file Effect.cpp.

1933 {
1934  // Reset map
1935  mIMap.clear();
1936  mOMap.clear();
1937 
1939  const_cast<AudacityProject*>( FindProject() ) // how to remove this const_cast?
1940  );
1941 
1942  auto trackRange = mTracks->Any() +
1943  [&] (const Track *pTrack) {
1944  return allSyncLockSelected
1946  : track_cast<const WaveTrack*>( pTrack ) && pTrack->GetSelected();
1947  };
1948 
1949  t2bHash added;
1950 
1951  for (auto aTrack : trackRange)
1952  {
1953  Track *o = mOutputTracks->Add(aTrack->Duplicate());
1954  mIMap.push_back(aTrack);
1955  mOMap.push_back(o);
1956  }
1957 }

References TrackList::Any(), TrackList::Create(), FindProject(), SyncLock::IsSelectedOrSyncLockSelected(), mIMap, mOMap, mOutputTracks, and mTracks.

Referenced by Process(), EffectAutoDuck::Process(), EffectChangeSpeed::Process(), EffectClickRemoval::Process(), EffectEqualization::Process(), Generator::Process(), EffectLoudness::Process(), EffectNoiseReduction::Process(), EffectNoiseRemoval::Process(), EffectNormalize::Process(), NyquistEffect::Process(), EffectPaulstretch::Process(), EffectRepair::Process(), EffectRepeat::Process(), EffectReverse::Process(), EffectSBSMS::Process(), EffectSimpleMono::Process(), EffectStereoToMono::Process(), EffectTwoPassSimpleMono::Process(), EffectTruncSilence::ProcessAll(), and EffectTruncSilence::ProcessIndependently().

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

◆ CountWaveTracks()

void Effect::CountWaveTracks ( )
private

Definition at line 2140 of file Effect.cpp.

2141 {
2142  mNumTracks = mTracks->Selected< const WaveTrack >().size();
2144 }

References mNumGroups, mNumTracks, mTracks, TrackList::Selected(), TrackList::SelectedLeaders(), and size.

Referenced by DoEffect(), and Preview().

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

◆ Delegate()

bool Effect::Delegate ( Effect delegate,
wxWindow &  parent,
const EffectDialogFactory factory 
)

Definition at line 1206 of file Effect.cpp.

1208 {
1209  NotifyingSelectedRegion region;
1210  region.setTimes( mT0, mT1 );
1211 
1212  return delegate.DoEffect( mProjectRate, mTracks, mFactory,
1213  region, &parent, factory );
1214 }

References DoEffect(), factory, mFactory, mProjectRate, mT0, mT1, mTracks, and NotifyingSelectedRegion::setTimes().

Referenced by NyquistEffect::ShowHostInterface().

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

◆ DoEffect()

bool Effect::DoEffect ( double  projectRate,
TrackList list,
WaveTrackFactory factory,
NotifyingSelectedRegion selectedRegion,
wxWindow *  pParent = nullptr,
const EffectDialogFactory dialogFactory = {} 
)

Definition at line 1073 of file Effect.cpp.

1079 {
1080  wxASSERT(selectedRegion.duration() >= 0.0);
1081 
1082  mOutputTracks.reset();
1083 
1084  mpSelectedRegion = &selectedRegion;
1085  mFactory = factory;
1086  mProjectRate = projectRate;
1087  mTracks = list;
1088 
1089  // This is for performance purposes only, no additional recovery implied
1090  auto &pProject = *const_cast<AudacityProject*>(FindProject()); // how to remove this const_cast?
1091  auto &pIO = ProjectFileIO::Get(pProject);
1092  TransactionScope trans(pIO.GetConnection(), "Effect");
1093 
1094  // Update track/group counts
1095  CountWaveTracks();
1096 
1097  bool isSelection = false;
1098 
1099  mDuration = 0.0;
1100  if (GetType() == EffectTypeGenerate)
1101  {
1104  wxT("LastUsedDuration"), mDuration, GetDefaultDuration());
1105  }
1106 
1107  WaveTrack *newTrack{};
1108  bool success = false;
1109  auto oldDuration = mDuration;
1110 
1111  auto cleanup = finally( [&] {
1112  if (!success) {
1113  if (newTrack) {
1114  mTracks->Remove(newTrack);
1115  }
1116  // LastUsedDuration may have been modified by Preview.
1117  SetDuration(oldDuration);
1118  }
1119  else
1120  trans.Commit();
1121 
1122  End();
1123  ReplaceProcessedTracks( false );
1124  } );
1125 
1126  // We don't yet know the effect type for code in the Nyquist Prompt, so
1127  // assume it requires a track and handle errors when the effect runs.
1128  if ((GetType() == EffectTypeGenerate || GetPath() == NYQUIST_PROMPT_ID) && (mNumTracks == 0)) {
1129  newTrack = mTracks->Add(mFactory->NewWaveTrack());
1130  newTrack->SetSelected(true);
1131  }
1132 
1133  mT0 = selectedRegion.t0();
1134  mT1 = selectedRegion.t1();
1135  if (mT1 > mT0)
1136  {
1137  // there is a selection: let's fit in there...
1138  // MJS: note that this is just for the TTC and is independent of the track rate
1139  // but we do need to make sure we have the right number of samples at the project rate
1140  double quantMT0 = QUANTIZED_TIME(mT0, mProjectRate);
1141  double quantMT1 = QUANTIZED_TIME(mT1, mProjectRate);
1142  mDuration = quantMT1 - quantMT0;
1143  isSelection = true;
1144  mT1 = mT0 + mDuration;
1145  }
1146 
1147  mDurationFormat = isSelection
1149  : NumericConverter::DefaultSelectionFormat();
1150 
1151 #ifdef EXPERIMENTAL_SPECTRAL_EDITING
1152  mF0 = selectedRegion.f0();
1153  mF1 = selectedRegion.f1();
1154  wxArrayString Names;
1156  Names.push_back(wxT("control-f0"));
1158  Names.push_back(wxT("control-f1"));
1159  SetPresetParameters( &Names, NULL );
1160 
1161 #endif
1162  CountWaveTracks();
1163 
1164  // Note: Init may read parameters from preferences
1165  if (!Init())
1166  {
1167  return false;
1168  }
1169 
1170  // Prompting will be bypassed when applying an effect that has already
1171  // been configured, e.g. repeating the last effect on a different selection.
1172  // Prompting may call Effect::Preview
1173  if ( pParent && dialogFactory &&
1174  IsInteractive() &&
1175  !ShowHostInterface( *pParent, dialogFactory, IsBatchProcessing() ) )
1176  {
1177  return false;
1178  }
1179 
1180  bool returnVal = true;
1181  bool skipFlag = CheckWhetherSkipEffect();
1182  if (skipFlag == false)
1183  {
1184  auto name = GetName();
1185  ProgressDialog progress{
1186  name,
1187  XO("Applying %s...").Format( name ),
1189  };
1190  auto vr = valueRestorer( mProgress, &progress );
1191 
1192  {
1193  returnVal = Process();
1194  }
1195  }
1196 
1197  if (returnVal && (mT1 >= mT0 ))
1198  {
1199  selectedRegion.setTimes(mT0, mT1);
1200  }
1201 
1202  success = returnVal;
1203  return returnVal;
1204 }

References TrackList::Add(), CheckWhetherSkipEffect(), TransactionScope::Commit(), CountWaveTracks(), NumericConverter::DefaultSelectionFormat(), NotifyingSelectedRegion::duration(), EffectTypeGenerate, End(), NotifyingSelectedRegion::f0(), NotifyingSelectedRegion::f1(), factory, FindProject(), ProjectFileIO::Get(), PluginSettings::GetConfig(), GetCurrentSettingsGroup(), GetDefaultDuration(), GetDefinition(), ComponentInterface::GetName(), GetPath(), GetType(), Init(), IsBatchProcessing(), IsInteractive(), mDuration, mDurationFormat, mFactory, mNumTracks, mOutputTracks, mProgress, mProjectRate, mpSelectedRegion, mT0, mT1, mTracks, name, WaveTrackFactory::NewWaveTrack(), NYQUIST_PROMPT_ID, pdlgHideStopButton, PluginSettings::Private, Process(), QUANTIZED_TIME, TrackList::Remove(), ReplaceProcessedTracks(), SetDuration(), SetPresetParameters(), NotifyingSelectedRegion::setTimes(), ShowHostInterface(), NotifyingSelectedRegion::t0(), NotifyingSelectedRegion::t1(), NumericConverter::TimeAndSampleFormat(), SelectedRegion::UndefinedFrequency, valueRestorer(), and XO.

Referenced by Delegate(), and EffectUI::DoEffect().

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

◆ EnableApply()

bool Effect::EnableApply ( bool  enable = true)
protectedvirtual

Definition at line 1792 of file Effect.cpp.

1793 {
1794  // May be called during initialization, so try to find the dialog
1795  wxWindow *dlg = mUIDialog;
1796  if (!dlg && mUIParent)
1797  {
1798  dlg = wxGetTopLevelParent(mUIParent);
1799  }
1800 
1801  if (dlg)
1802  {
1803  wxWindow *apply = dlg->FindWindow(wxID_APPLY);
1804 
1805  // Don't allow focus to get trapped
1806  if (!enable)
1807  {
1808  wxWindow *focus = dlg->FindFocus();
1809  if (focus == apply)
1810  {
1811  dlg->FindWindow(wxID_CLOSE)->SetFocus();
1812  }
1813  }
1814 
1815  apply->Enable(enable);
1816  }
1817 
1818  EnablePreview(enable);
1819 
1820  return enable;
1821 }

References EnablePreview(), mUIDialog, and mUIParent.

Referenced by EffectAmplify::CheckClip(), EffectRepeat::DisplayNewTime(), EffectAmplify::OnAmpText(), EffectBassTreble::OnBassSlider(), EffectBassTreble::OnBassText(), EffectTruncSilence::OnControlChange(), EffectToneGen::OnControlUpdate(), EffectScienFilter::OnCutoff(), EffectPhaser::OnDepthSlider(), EffectWahwah::OnDepthSlider(), EffectPhaser::OnDepthText(), EffectWahwah::OnDepthText(), EffectPhaser::OnDryWetSlider(), EffectPhaser::OnDryWetText(), EffectPhaser::OnFeedbackSlider(), EffectPhaser::OnFeedbackText(), EffectWahwah::OnFreqOffSlider(), EffectWahwah::OnFreqOffText(), EffectPhaser::OnFreqSlider(), EffectWahwah::OnFreqSlider(), EffectPhaser::OnFreqText(), EffectWahwah::OnFreqText(), EffectBassTreble::OnGainSlider(), EffectPhaser::OnGainSlider(), EffectWahwah::OnGainSlider(), EffectBassTreble::OnGainText(), EffectPhaser::OnGainText(), EffectWahwah::OnGainText(), EffectAmplify::OnPeakText(), EffectPhaser::OnPhaseSlider(), EffectWahwah::OnPhaseSlider(), EffectPhaser::OnPhaseText(), EffectWahwah::OnPhaseText(), EffectWahwah::OnResonanceSlider(), EffectWahwah::OnResonanceText(), EffectScienFilter::OnRipple(), EffectPhaser::OnStagesSlider(), EffectPhaser::OnStagesText(), EffectScienFilter::OnStopbandRipple(), EffectPaulstretch::OnText(), EffectTimeScale::OnText_PitchHalfStepsEnd(), EffectTimeScale::OnText_PitchHalfStepsStart(), EffectTimeScale::OnText_PitchPercentChangeEnd(), EffectTimeScale::OnText_PitchPercentChangeStart(), EffectTimeScale::OnText_RatePercentChangeEnd(), EffectTimeScale::OnText_RatePercentChangeStart(), EffectBassTreble::OnTrebleSlider(), EffectBassTreble::OnTrebleText(), EffectChangeSpeed::UpdateUI(), EffectLoudness::UpdateUI(), and EffectNormalize::UpdateUI().

Here is the call graph for this function:

◆ EnablePreview()

bool Effect::EnablePreview ( bool  enable = true)
protectedvirtual

Definition at line 1823 of file Effect.cpp.

1824 {
1825  // May be called during initialization, so try to find the dialog
1826  wxWindow *dlg = mUIDialog;
1827  if (!dlg && mUIParent)
1828  {
1829  dlg = wxGetTopLevelParent(mUIParent);
1830  }
1831 
1832  if (dlg)
1833  {
1834  wxWindow *play = dlg->FindWindow(kPlayID);
1835  if (play)
1836  {
1837  wxWindow *rewind = dlg->FindWindow(kRewindID);
1838  wxWindow *ffwd = dlg->FindWindow(kFFwdID);
1839 
1840  // Don't allow focus to get trapped
1841  if (!enable)
1842  {
1843  wxWindow *focus = dlg->FindFocus();
1844  if (focus && (focus == play || focus == rewind || focus == ffwd))
1845  {
1846  dlg->FindWindow(wxID_CLOSE)->SetFocus();
1847  }
1848  }
1849 
1850  play->Enable(enable);
1851  if (SupportsRealtime())
1852  {
1853  rewind->Enable(enable);
1854  ffwd->Enable(enable);
1855  }
1856  }
1857  }
1858 
1859  return enable;
1860 }

References kFFwdID, kPlayID, kRewindID, mUIDialog, mUIParent, and SupportsRealtime().

Referenced by EnableApply(), and NyquistEffect::TransferDataToWindow().

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

◆ End()

void Effect::End ( )
protectedvirtual

Reimplemented in VampEffect, EffectNoiseRemoval, and EffectAutoDuck.

Definition at line 1773 of file Effect.cpp.

1774 {
1775 }

Referenced by DoEffect(), and Preview().

Here is the caller graph for this function:

◆ ExportPresets()

void Effect::ExportPresets ( )
overridevirtual

Implements EffectUIClientInterface.

Definition at line 681 of file Effect.cpp.

682 {
683  wxString params;
685  wxString commandId = GetSquashedName(GetSymbol().Internal()).GET();
686  params = commandId + ":" + params;
687 
688  auto path = SelectFile(FileNames::Operation::Presets,
689  XO("Export Effect Parameters"),
690  wxEmptyString,
691  wxEmptyString,
692  wxEmptyString,
693  PresetTypes(),
694  wxFD_SAVE | wxFD_OVERWRITE_PROMPT | wxRESIZE_BORDER,
695  nullptr);
696  if (path.empty()) {
697  return;
698  }
699 
700  // Create/Open the file
701  wxFFile f(path, wxT("wb"));
702  if (!f.IsOpened())
703  {
705  XO("Could not open file: \"%s\"").Format( path ),
706  XO("Error Saving Effect Presets"),
707  wxICON_EXCLAMATION,
708  NULL);
709  return;
710  }
711 
712  f.Write(params);
713  if (f.Error())
714  {
716  XO("Error writing to file: \"%s\"").Format( path ),
717  XO("Error Saving Effect Presets"),
718  wxICON_EXCLAMATION,
719  NULL);
720  }
721 
722  f.Close();
723 
724 
725  //SetWindowTitle();
726 
727 }

References AudacityMessageBox(), Identifier::GET(), GetAutomationParameters(), GetSquashedName(), GetSymbol(), Internal, params, PresetTypes(), SelectFile(), and XO.

Here is the call graph for this function:

◆ FindProject()

const AudacityProject * Effect::FindProject ( ) const
protected

Definition at line 2133 of file Effect.cpp.

2134 {
2135  if (!inputTracks())
2136  return nullptr;
2137  return inputTracks()->GetOwner();
2138 }

References TrackList::GetOwner(), and inputTracks().

Referenced by CopyInputTracks(), DoEffect(), GetSelectionFormat(), EffectEqualization::Init(), NyquistEffect::Init(), Generator::Process(), NyquistEffect::Process(), EffectTwoPassSimpleMono::Process(), EffectTruncSilence::ProcessIndependently(), ProcessTrack(), and EffectToneGen::SetAutomationParameters().

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

◆ GetAudioInCount()

unsigned Effect::GetAudioInCount ( )
overridevirtual

Implements EffectClientInterface.

Reimplemented in EffectWahwah, VampEffect, EffectStereoToMono, EffectScienFilter, EffectReverb, EffectPhaser, EffectInvert, and EffectFade.

Definition at line 266 of file Effect.cpp.

267 {
268  if (mClient)
269  {
270  return mClient->GetAudioInCount();
271  }
272 
273  return 0;
274 }

References EffectClientInterface::GetAudioInCount(), and mClient.

Referenced by Process(), and Startup().

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

◆ GetAudioOutCount()

unsigned Effect::GetAudioOutCount ( )
overridevirtual

Implements EffectClientInterface.

Reimplemented in EffectWahwah, EffectToneGen, EffectStereoToMono, EffectScienFilter, EffectReverb, EffectPhaser, EffectNoise, EffectInvert, and EffectFade.

Definition at line 276 of file Effect.cpp.

277 {
278  if (mClient)
279  {
280  return mClient->GetAudioOutCount();
281  }
282 
283  return 0;
284 }

References EffectClientInterface::GetAudioOutCount(), and mClient.

Referenced by Process(), and Startup().

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

◆ GetAutomationParameters() [1/2]

bool Effect::GetAutomationParameters ( CommandParameters parms)
overridevirtual

Implements EffectClientInterface.

Reimplemented in EffectWahwah, VampEffect, EffectTruncSilence, EffectToneGen, EffectTimeScale, EffectScienFilter, EffectReverb, EffectRepeat, EffectPhaser, EffectPaulstretch, NyquistEffect, EffectNormalize, EffectNoise, EffectLoudness, EffectFindClipping, and EffectEqualization.

Definition at line 540 of file Effect.cpp.

541 {
542  if (mClient)
543  {
544  return mClient->GetAutomationParameters(parms);
545  }
546 
547  return true;
548 }

References EffectClientInterface::GetAutomationParameters(), and mClient.

Referenced by ExportPresets(), GetAutomationParameters(), EffectManager::GetEffectParameters(), and SaveUserPreset().

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

◆ GetAutomationParameters() [2/2]

bool Effect::GetAutomationParameters ( wxString &  parms)
virtual

Definition at line 928 of file Effect.cpp.

929 {
930  CommandParameters eap;
931 
933  {
934  return false;
935  }
936 
938  S.mpEap = &eap;
939  if( DefineParams( S ) ){
940  ;// got eap value using DefineParams.
941  }
942  // Won't be needed in future
943  else if (!GetAutomationParameters(eap))
944  {
945  return false;
946  }
947 
948  return eap.GetParameters(parms);
949 }

References ComponentInterface::DefineParams(), GetAutomationParameters(), CommandParameters::GetParameters(), mUIDialog, S, and TransferDataFromWindow().

Here is the call graph for this function:

◆ GetBlockSize()

size_t Effect::GetBlockSize ( ) const
overridevirtual

Implements EffectClientInterface.

Definition at line 328 of file Effect.cpp.

329 {
330  if (mClient)
331  {
332  return mClient->GetBlockSize();
333  }
334 
335  return mBlockSize;
336 }

References EffectClientInterface::GetBlockSize(), mBlockSize, and mClient.

Here is the call graph for this function:

◆ GetBounds()

void Effect::GetBounds ( const WaveTrack track,
const WaveTrack pRight,
sampleCount start,
sampleCount len 
)
protected

Definition at line 1902 of file Effect.cpp.

1905 {
1906  auto t0 = std::max( mT0, track.GetStartTime() );
1907  auto t1 = std::min( mT1, track.GetEndTime() );
1908 
1909  if ( pRight ) {
1910  t0 = std::min( t0, std::max( mT0, pRight->GetStartTime() ) );
1911  t1 = std::max( t1, std::min( mT1, pRight->GetEndTime() ) );
1912  }
1913 
1914  if (t1 > t0) {
1915  *start = track.TimeToLongSamples(t0);
1916  auto end = track.TimeToLongSamples(t1);
1917  *len = end - *start;
1918  }
1919  else {
1920  *start = 0;
1921  *len = 0;
1922  }
1923 }

References WaveTrack::GetEndTime(), WaveTrack::GetStartTime(), min(), mT0, mT1, and WaveTrack::TimeToLongSamples().

Referenced by VampEffect::Process(), and ProcessPass().

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

◆ GetCurrentSettingsGroup()

RegistryPath Effect::GetCurrentSettingsGroup ( )
overridevirtual

◆ GetDefaultDuration()

double Effect::GetDefaultDuration ( )
overridevirtual

Implements EffectHostInterface.

Definition at line 820 of file Effect.cpp.

821 {
822  return 30.0;
823 }

Referenced by DoEffect().

Here is the caller graph for this function:

◆ GetDefinition()

EffectDefinitionInterface & Effect::GetDefinition ( )
overridevirtual

◆ GetDescription()

TranslatableString Effect::GetDescription ( )
overridevirtual

Implements ComponentInterface.

Reimplemented in EffectWahwah, VampEffect, EffectTruncSilence, EffectToneGen, EffectTimeScale, EffectStereoToMono, EffectSilence, EffectScienFilter, EffectReverse, EffectReverb, EffectRepeat, EffectRepair, EffectPhaser, EffectPaulstretch, NyquistEffect, EffectNormalize, EffectNoiseRemoval, EffectNoiseReduction, EffectNoise, EffectLoudness, EffectInvert, EffectFindClipping, EffectFade, and EffectEqualization.

Definition at line 182 of file Effect.cpp.

183 {
184  if (mClient)
185  {
186  return mClient->GetDescription();
187  }
188 
189  return {};
190 }

References ComponentInterface::GetDescription(), and mClient.

Referenced by EffectManager::GetCommandTip(), and EffectUIHost::OnMenu().

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

◆ GetDuration()

double Effect::GetDuration ( )
overridevirtual

◆ GetDurationFormat()

NumericFormatSymbol Effect::GetDurationFormat ( )
overridevirtual

Implements EffectHostInterface.

Definition at line 835 of file Effect.cpp.

836 {
837  return mDurationFormat;
838 }

References mDurationFormat.

Referenced by EffectDtmf::PopulateOrExchange(), EffectNoise::PopulateOrExchange(), EffectSilence::PopulateOrExchange(), and EffectToneGen::PopulateOrExchange().

Here is the caller graph for this function:

◆ GetFactoryDefaultsGroup()

RegistryPath Effect::GetFactoryDefaultsGroup ( )
overridevirtual

Implements EffectHostInterface.

Definition at line 881 of file Effect.cpp.

882 {
883  return wxT("FactoryDefaults");
884 }

Referenced by HasFactoryDefaults(), LoadFactoryDefaults(), SetAutomationParameters(), and Startup().

Here is the caller graph for this function:

◆ GetFactoryPresets()

RegistryPaths Effect::GetFactoryPresets ( )
overridevirtual

Implements EffectClientInterface.

Reimplemented in EffectReverb, and EffectEqualization.

Definition at line 594 of file Effect.cpp.

595 {
596  if (mClient)
597  {
598  return mClient->GetFactoryPresets();
599  }
600 
601  return {};
602 }

References EffectClientInterface::GetFactoryPresets(), and mClient.

Referenced by EffectManager::HasPresets(), EffectUIHost::OnMenu(), and SetAutomationParameters().

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

◆ GetFamily()

EffectFamilySymbol Effect::GetFamily ( )
overridevirtual

Implements EffectDefinitionInterface.

Reimplemented in VampEffect, and NyquistEffect.

Definition at line 192 of file Effect.cpp.

193 {
194  if (mClient)
195  {
196  return mClient->GetFamily();
197  }
198 
199  // Unusually, the internal and visible strings differ for the built-in
200  // effect family.
201  return { wxT("Audacity"), XO("Built-in") };
202 }

References EffectDefinitionInterface::GetFamily(), mClient, and XO.

Referenced by EffectUIHost::OnHelp(), EffectUIHost::OnMenu(), and Preview().

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

◆ GetLatency()

sampleCount Effect::GetLatency ( )
overridevirtual

Implements EffectClientInterface.

Definition at line 338 of file Effect.cpp.

339 {
340  if (mClient)
341  {
342  return mClient->GetLatency();
343  }
344 
345  return 0;
346 }

References EffectClientInterface::GetLatency(), and mClient.

Referenced by ProcessTrack().

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

◆ GetMidiInCount()

int Effect::GetMidiInCount ( )
overridevirtual

Implements EffectClientInterface.

Definition at line 286 of file Effect.cpp.

287 {
288  if (mClient)
289  {
290  return mClient->GetMidiInCount();
291  }
292 
293  return 0;
294 }

References EffectClientInterface::GetMidiInCount(), and mClient.

Here is the call graph for this function:

◆ GetMidiOutCount()

int Effect::GetMidiOutCount ( )
overridevirtual

Implements EffectClientInterface.

Definition at line 296 of file Effect.cpp.

297 {
298  if (mClient)
299  {
300  return mClient->GetMidiOutCount();
301  }
302 
303  return 0;
304 }

References EffectClientInterface::GetMidiOutCount(), and mClient.

Here is the call graph for this function:

◆ GetNumWaveGroups()

int Effect::GetNumWaveGroups ( )
inlineprotected

Definition at line 315 of file Effect.h.

315 { return mNumGroups; }

Referenced by NyquistEffect::Process(), and VampEffect::Process().

Here is the caller graph for this function:

◆ GetNumWaveTracks()

int Effect::GetNumWaveTracks ( )
inlineprotected

Definition at line 314 of file Effect.h.

314 { return mNumTracks; }

Referenced by EffectNormalize::AnalyseTrackData(), EffectTruncSilence::Analyze(), EffectAutoDuck::ApplyDuckFade(), EffectAutoDuck::Process(), EffectNormalize::ProcessOne(), EffectTwoPassSimpleMono::ProcessOne(), EffectNoiseRemoval::ShowHostInterface(), and EffectLoudness::UpdateProgress().

Here is the caller graph for this function:

◆ GetPass()

int Effect::GetPass ( )
protectedvirtual

Definition at line 1222 of file Effect.cpp.

1223 {
1224  return mPass;
1225 }

References mPass.

◆ GetPath()

PluginPath Effect::GetPath ( )
overridevirtual

Implements ComponentInterface.

Reimplemented in VampEffect, and NyquistEffect.

Definition at line 142 of file Effect.cpp.

143 {
144  if (mClient)
145  {
146  return mClient->GetPath();
147  }
148 
150 }

References BUILTIN_EFFECT_PREFIX, ComponentInterface::GetPath(), GetSymbol(), ComponentInterfaceSymbol::Internal(), and mClient.

Referenced by DoEffect().

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

◆ GetSavedStateGroup()

wxString Effect::GetSavedStateGroup ( )
virtual

Definition at line 886 of file Effect.cpp.

887 {
888  return wxT("SavedState");
889 }

Referenced by SetBatchProcessing().

Here is the caller graph for this function:

◆ GetSelectionFormat()

NumericFormatSymbol Effect::GetSelectionFormat ( )
virtual

Definition at line 840 of file Effect.cpp.

841 {
842  if( !IsBatchProcessing() && FindProject() )
845 }

References FindProject(), ProjectSettings::Get(), ProjectSettings::GetSelectionFormat(), NumericConverter::HoursMinsSecondsFormat(), and IsBatchProcessing().

Referenced by NyquistEffect::BuildEffectWindow(), and EffectRepeat::DisplayNewTime().

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

◆ GetSquashedName()

CommandID Effect::GetSquashedName ( wxString  name)
static

Definition at line 780 of file Effect.cpp.

781 {
782  // Get rid of leading and trailing white space
783  name.Trim(true).Trim(false);
784 
785  if (name.empty())
786  {
787  return name;
788  }
789 
790  wxStringTokenizer st(name, wxT(" "));
791  wxString id;
792 
793  // CamelCase the name
794  while (st.HasMoreTokens())
795  {
796  wxString tok = st.GetNextToken();
797 
798  id += tok.Left(1).MakeUpper() + tok.Mid(1).MakeLower();
799  }
800 
801  return id;
802 }

References TranslatableString::empty(), id, and name.

Referenced by ExportPresets(), EffectManager::GetCommandIdentifier(), and ImportPresets().

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

◆ GetSymbol()

ComponentInterfaceSymbol Effect::GetSymbol ( )
overridevirtual

Implements ComponentInterface.

Reimplemented in EffectWahwah, VampEffect, EffectTruncSilence, EffectToneGen, EffectTimeScale, EffectStereoToMono, EffectSilence, EffectScienFilter, EffectSBSMS, EffectReverse, EffectReverb, EffectRepeat, EffectRepair, EffectPhaser, EffectPaulstretch, NyquistEffect, EffectNormalize, EffectNoiseRemoval, EffectNoiseReduction, EffectNoise, EffectLoudness, EffectInvert, EffectFindClipping, EffectFade, and EffectEqualization.

Definition at line 152 of file Effect.cpp.

153 {
154  if (mClient)
155  {
156  return mClient->GetSymbol();
157  }
158 
159  return {};
160 }

References ComponentInterface::GetSymbol(), and mClient.

Referenced by ExportPresets(), GetPath(), and ImportPresets().

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

◆ GetTailSize()

size_t Effect::GetTailSize ( )
overridevirtual

Implements EffectClientInterface.

Definition at line 348 of file Effect.cpp.

349 {
350  if (mClient)
351  {
352  return mClient->GetTailSize();
353  }
354 
355  return 0;
356 }

References EffectClientInterface::GetTailSize(), and mClient.

Here is the call graph for this function:

◆ GetType()

EffectType Effect::GetType ( )
overridevirtual

Implements EffectDefinitionInterface.

Reimplemented in EffectWahwah, VampEffect, EffectTruncSilence, EffectToneGen, EffectTimeScale, EffectStereoToMono, EffectSilence, EffectScienFilter, EffectReverse, EffectReverb, EffectRepeat, EffectRepair, EffectPhaser, EffectPaulstretch, NyquistEffect, EffectNormalize, EffectNoiseRemoval, EffectNoiseReduction, EffectNoise, EffectLoudness, EffectInvert, EffectFindClipping, EffectFade, and EffectEqualization.

Definition at line 132 of file Effect.cpp.

133 {
134  if (mClient)
135  {
136  return mClient->GetType();
137  }
138 
139  return EffectTypeNone;
140 }

References EffectTypeNone, EffectDefinitionInterface::GetType(), and mClient.

Referenced by EffectUIHost::BuildButtonBar(), DoEffect(), EffectUIHost::OnApply(), Preview(), ProcessPass(), ProcessTrack(), SetDuration(), and EffectUIHost::UpdateControls().

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

◆ GetUserPresets()

RegistryPaths Effect::GetUserPresets ( )
virtual

Definition at line 1012 of file Effect.cpp.

1013 {
1014  RegistryPaths presets;
1015 
1017  GetUserPresetsGroup(wxEmptyString), presets);
1018 
1019  std::sort( presets.begin(), presets.end() );
1020 
1021  return presets;
1022 }

References PluginSettings::GetConfigSubgroups(), GetDefinition(), GetUserPresetsGroup(), and PluginSettings::Private.

Referenced by EffectManager::HasPresets().

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

◆ GetUserPresetsGroup()

RegistryPath Effect::GetUserPresetsGroup ( const RegistryPath name)
overridevirtual

Implements EffectHostInterface.

Definition at line 865 of file Effect.cpp.

866 {
867  RegistryPath group = wxT("UserPresets");
868  if (!name.empty())
869  {
870  group += wxCONFIG_PATH_SEPARATOR + name;
871  }
872 
873  return group;
874 }

References TranslatableString::empty(), and name.

Referenced by GetUserPresets(), EffectUIHost::LoadUserPresets(), EffectUIHost::OnDeletePreset(), EffectUIHost::OnSaveAs(), EffectUIHost::OnUserPreset(), SetAutomationParameters(), and EffectReverb::Startup().

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

◆ GetVendor()

VendorSymbol Effect::GetVendor ( )
overridevirtual

Implements ComponentInterface.

Reimplemented in VampEffect, and NyquistEffect.

Definition at line 162 of file Effect.cpp.

163 {
164  if (mClient)
165  {
166  return mClient->GetVendor();
167  }
168 
169  return XO("Audacity");
170 }

References ComponentInterface::GetVendor(), mClient, and XO.

Referenced by EffectUIHost::OnMenu().

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

◆ GetVersion()

wxString Effect::GetVersion ( )
overridevirtual

Implements ComponentInterface.

Reimplemented in VampEffect, and NyquistEffect.

Definition at line 172 of file Effect.cpp.

173 {
174  if (mClient)
175  {
176  return mClient->GetVersion();
177  }
178 
179  return AUDACITY_VERSION_STRING;
180 }

References ComponentInterface::GetVersion(), and mClient.

Referenced by EffectUIHost::OnMenu().

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

◆ HasCurrentSettings()

bool Effect::HasCurrentSettings ( )
virtual

Definition at line 1024 of file Effect.cpp.

1025 {
1026  return HasConfigGroup(GetDefinition(),
1028 }

References GetCurrentSettingsGroup(), GetDefinition(), PluginSettings::HasConfigGroup(), and PluginSettings::Private.

Referenced by EffectManager::GetDefaultPreset(), and EffectManager::HasPresets().

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

◆ HasFactoryDefaults()

bool Effect::HasFactoryDefaults ( )
virtual

Definition at line 1030 of file Effect.cpp.

1031 {
1032  return HasConfigGroup(GetDefinition(),
1034 }

References GetDefinition(), GetFactoryDefaultsGroup(), PluginSettings::HasConfigGroup(), and PluginSettings::Private.

Referenced by EffectManager::GetDefaultPreset(), and EffectManager::HasPresets().

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

◆ HasOptions()

bool Effect::HasOptions ( )
overridevirtual

Implements EffectUIClientInterface.

Definition at line 804 of file Effect.cpp.

805 {
806  return false;
807 }

◆ HelpPage()

FilePath Effect::HelpPage ( )
virtual

Reimplemented in NyquistEffect.

Definition at line 1041 of file Effect.cpp.

1042 {
1043  return {};
1044 }

Referenced by EffectUIHost::Initialize(), and EffectUIHost::OnHelp().

Here is the caller graph for this function:

◆ HideUI()

bool Effect::HideUI ( )
overridevirtual

Implements EffectUIClientInterface.

Definition at line 651 of file Effect.cpp.

652 {
653  return true;
654 }

◆ ImportPresets()

void Effect::ImportPresets ( )
overridevirtual

Implements EffectUIClientInterface.

Definition at line 729 of file Effect.cpp.

730 {
731  wxString params;
732 
733  auto path = SelectFile(FileNames::Operation::Presets,
734  XO("Import Effect Parameters"),
735  wxEmptyString,
736  wxEmptyString,
737  wxEmptyString,
738  PresetTypes(),
739  wxFD_OPEN | wxRESIZE_BORDER,
740  nullptr);
741  if (path.empty()) {
742  return;
743  }
744 
745  wxFFile f(path);
746  if (f.IsOpened()) {
747  if (f.ReadAll(&params)) {
748  wxString ident = params.BeforeFirst(':');
749  params = params.AfterFirst(':');
750 
751  wxString commandId = GetSquashedName(GetSymbol().Internal()).GET();
752 
753  if (ident != commandId) {
754  // effect identifiers are a sensible length!
755  // must also have some params.
756  if ((params.Length() < 2 ) || (ident.Length() < 2) || (ident.Length() > 30))
757  {
759  /* i18n-hint %s will be replaced by a file name */
760  XO("%s: is not a valid presets file.\n")
761  .Format(wxFileNameFromPath(path)));
762  }
763  else
764  {
766  /* i18n-hint %s will be replaced by a file name */
767  XO("%s: is for a different Effect, Generator or Analyzer.\n")
768  .Format(wxFileNameFromPath(path)));
769  }
770  return;
771  }
773  }
774  }
775 
776  //SetWindowTitle();
777 
778 }

References Identifier::GET(), GetSquashedName(), GetSymbol(), ident(), Internal, MessageBox(), params, PresetTypes(), SelectFile(), SetAutomationParameters(), and XO.

Here is the call graph for this function:

◆ IncEffectCounter()

static void Effect::IncEffectCounter ( )
inlinestatic

Definition at line 249 of file Effect.h.

249 { nEffectsDone++;};

Referenced by SelectTracksCommand::Apply().

Here is the caller graph for this function:

◆ IncludeNotSelectedPreviewTracks()

void Effect::IncludeNotSelectedPreviewTracks ( bool  includeNotSelected)
protected

Definition at line 1873 of file Effect.cpp.

1874 {
1875  mPreviewWithNotSelected = includeNotSelected;
1876 }

References mPreviewWithNotSelected.

◆ Init()

bool Effect::Init ( )
protectedvirtual

Reimplemented in VampEffect, EffectTimeScale, EffectScienFilter, NyquistEffect, EffectNoiseRemoval, EffectNoiseReduction, Generator, EffectEqualization, EffectDtmf, EffectChangeSpeed, EffectAutoDuck, and EffectAmplify.

Definition at line 1217 of file Effect.cpp.

1218 {
1219  return true;
1220 }

Referenced by DoEffect(), and Preview().

Here is the caller graph for this function:

◆ InitPass1()

bool Effect::InitPass1 ( )
protectedvirtual

Reimplemented in EffectTwoPassSimpleMono, and EffectCompressor.

Definition at line 1227 of file Effect.cpp.

1228 {
1229  return true;
1230 }

Referenced by Process().

Here is the caller graph for this function:

◆ InitPass2()

bool Effect::InitPass2 ( )
protectedvirtual

Reimplemented in EffectTwoPassSimpleMono, and EffectCompressor.

Definition at line 1232 of file Effect.cpp.

1233 {
1234  return false;
1235 }

Referenced by Process().

Here is the caller graph for this function:

◆ inputTracks()

const TrackList* Effect::inputTracks ( ) const
inlineprotected

Definition at line 431 of file Effect.h.

431 { return mTracks; }

Referenced by EffectTruncSilence::CalcPreviewInputLength(), FindProject(), EffectAmplify::Init(), EffectAutoDuck::Init(), EffectScienFilter::Init(), VampEffect::Init(), EffectCompressor::InitPass1(), EffectFindClipping::Process(), VampEffect::Process(), EffectTruncSilence::ProcessAll(), EffectTruncSilence::ProcessIndependently(), and EffectStereoToMono::ProcessOne().

Here is the caller graph for this function:

◆ IsBatchProcessing()

bool Effect::IsBatchProcessing ( )
virtual

◆ IsDefault()

bool Effect::IsDefault ( )
overridevirtual

Implements EffectDefinitionInterface.

Reimplemented in VampEffect, and NyquistEffect.

Definition at line 214 of file Effect.cpp.

215 {
216  if (mClient)
217  {
218  return mClient->IsDefault();
219  }
220 
221  return true;
222 }

References EffectDefinitionInterface::IsDefault(), and mClient.

Here is the call graph for this function:

◆ IsGraphicalUI()

bool Effect::IsGraphicalUI ( )
overridevirtual

Implements EffectUIClientInterface.

Definition at line 641 of file Effect.cpp.

642 {
643  return false;
644 }

◆ IsHidden()

bool Effect::IsHidden ( )
virtual

Reimplemented in EffectStereoToMono.

Definition at line 2151 of file Effect.cpp.

2152 {
2153  return false;
2154 }

Referenced by EffectManager::IsHidden().

Here is the caller graph for this function:

◆ IsInteractive()

bool Effect::IsInteractive ( )
overridevirtual

Implements EffectDefinitionInterface.

Reimplemented in VampEffect, EffectStereoToMono, EffectReverse, EffectRepair, NyquistEffect, EffectInvert, and EffectFade.

Definition at line 204 of file Effect.cpp.

205 {
206  if (mClient)
207  {
208  return mClient->IsInteractive();
209  }
210 
211  return true;
212 }

References EffectDefinitionInterface::IsInteractive(), and mClient.

Referenced by DoEffect(), and ShowHostInterface().

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

◆ IsLegacy()

bool Effect::IsLegacy ( )
overridevirtual

Implements EffectDefinitionInterface.

Definition at line 224 of file Effect.cpp.

225 {
226  if (mClient)
227  {
228  return false;
229  }
230 
231  return true;
232 }

References mClient.

◆ IsPreviewing()

bool Effect::IsPreviewing ( )
inlineprotected

Definition at line 332 of file Effect.h.

332 { return mIsPreview; }

Referenced by NyquistEffect::Process(), and EffectPaulstretch::ProcessOne().

Here is the caller graph for this function:

◆ IsReady()

bool Effect::IsReady ( )
overridevirtual

Implements EffectClientInterface.

Definition at line 358 of file Effect.cpp.

359 {
360  if (mClient)
361  {
362  return mClient->IsReady();
363  }
364 
365  return true;
366 }

References EffectClientInterface::IsReady(), and mClient.

Here is the call graph for this function:

◆ LoadFactoryDefaults()

bool Effect::LoadFactoryDefaults ( )
overridevirtual

Implements EffectClientInterface.

Reimplemented in EffectEqualization.

Definition at line 614 of file Effect.cpp.

615 {
616  if (mClient)
617  {
618  return mClient->LoadFactoryDefaults();
619  }
620 
622 }

References GetFactoryDefaultsGroup(), EffectClientInterface::LoadFactoryDefaults(), LoadUserPreset(), and mClient.

Referenced by EffectChangeSpeed::LoadFactoryDefaults(), EffectEqualization::LoadFactoryDefaults(), and EffectUIHost::OnDefaults().

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

◆ LoadFactoryPreset()

bool Effect::LoadFactoryPreset ( int  id)
overridevirtual

Implements EffectClientInterface.

Reimplemented in EffectReverb, and EffectEqualization.

Definition at line 604 of file Effect.cpp.

605 {
606  if (mClient)
607  {
608  return mClient->LoadFactoryPreset(id);
609  }
610 
611  return true;
612 }

References EffectClientInterface::LoadFactoryPreset(), and mClient.

Referenced by EffectUIHost::OnFactoryPreset(), and SetAutomationParameters().

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

◆ LoadUserPreset()

bool Effect::LoadUserPreset ( const RegistryPath name)
overridevirtual

Implements EffectClientInterface.

Definition at line 560 of file Effect.cpp.

561 {
562  if (mClient)
563  {
564  return mClient->LoadUserPreset(name);
565  }
566 
567  wxString parms;
569  name, wxT("Parameters"), parms))
570  {
571  return false;
572  }
573 
574  return SetAutomationParameters(parms);
575 }

References PluginSettings::GetConfig(), GetDefinition(), EffectClientInterface::LoadUserPreset(), mClient, name, PluginSettings::Private, and SetAutomationParameters().

Referenced by LoadFactoryDefaults(), EffectUIHost::OnUserPreset(), EffectEqualization::PopulateOrExchange(), SetAutomationParameters(), SetBatchProcessing(), and Startup().

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

◆ ManualPage()

ManualPageID Effect::ManualPage ( )
virtual

Reimplemented in EffectWahwah, EffectTruncSilence, EffectToneGen, EffectTimeScale, EffectSilence, EffectScienFilter, EffectReverb, EffectRepeat, EffectPhaser, EffectPaulstretch, NyquistEffect, EffectNormalize, EffectNoise, EffectLoudness, EffectFindClipping, EffectEqualization, EffectEcho, EffectDtmf, EffectDistortion, EffectCompressor, EffectClickRemoval, EffectChangeSpeed, EffectBassTreble, EffectAutoDuck, and EffectAmplify.

Definition at line 1036 of file Effect.cpp.

1037 {
1038  return {};
1039 }

Referenced by EffectManager::GetCommandUrl(), EffectUIHost::Initialize(), and EffectUIHost::OnHelp().

Here is the caller graph for this function:

◆ MessageBox()

int Effect::MessageBox ( const TranslatableString message,
long  style = DefaultMessageBoxStyle,
const TranslatableString titleStr = {} 
)

◆ ModifyAnalysisTrack()

auto Effect::ModifyAnalysisTrack ( const LabelTrack pOrigTrack,
const wxString &  name = wxString() 
)
protected

Definition at line 2046 of file Effect.cpp.

2048 {
2049  return{ this, pOrigTrack, name };
2050 }

References name.

Referenced by EffectFindClipping::Process().

Here is the caller graph for this function:

◆ PopulateOrExchange()

void Effect::PopulateOrExchange ( ShuttleGui S)
protectedvirtual

Reimplemented in EffectWahwah, VampEffect, EffectTruncSilence, EffectToneGen, EffectTimeScale, EffectSilence, EffectScienFilter, EffectReverb, EffectRepeat, EffectPhaser, EffectPaulstretch, NyquistEffect, EffectNormalize, EffectNoise, EffectLoudness, EffectFindClipping, EffectEqualization, EffectEcho, EffectDtmf, EffectDistortion, EffectCompressor, EffectClickRemoval, EffectChangeSpeed, EffectBassTreble, EffectAutoDuck, and EffectAmplify.

Definition at line 1777 of file Effect.cpp.

1778 {
1779  return;
1780 }

Referenced by PopulateUI().

Here is the caller graph for this function:

◆ PopulateUI()

bool Effect::PopulateUI ( ShuttleGui S)
finalvirtual

Adds controls to a panel that is given as the parent window of S

Implements EffectUIClientInterface.

Definition at line 626 of file Effect.cpp.

627 {
628  auto parent = S.GetParent();
629  mUIParent = parent;
630  mUIParent->PushEventHandler(this);
631 
632 // LoadUserPreset(GetCurrentSettingsGroup());
633 
635 
636  mUIParent->SetMinSize(mUIParent->GetSizer()->GetMinSize());
637 
638  return true;
639 }

References mUIParent, PopulateOrExchange(), and S.

Here is the call graph for this function:

◆ Preview()

void Effect::Preview ( bool  dryOnly)
protectedvirtual

Reimplemented in EffectTimeScale, and EffectAmplify.

Definition at line 2156 of file Effect.cpp.

2157 {
2158  if (mNumTracks == 0) { // nothing to preview
2159  return;
2160  }
2161 
2162  auto gAudioIO = AudioIO::Get();
2163  if (gAudioIO->IsBusy()) {
2164  return;
2165  }
2166 
2167  wxWindow *FocusDialog = wxWindow::FindFocus();
2168 
2169  double previewDuration;
2170  bool isNyquist = GetFamily() == NYQUISTEFFECTS_FAMILY;
2171  bool isGenerator = GetType() == EffectTypeGenerate;
2172 
2173  // Mix a few seconds of audio from all of the tracks
2174  double previewLen;
2175  gPrefs->Read(wxT("/AudioIO/EffectsPreviewLen"), &previewLen, 6.0);
2176 
2177  const double rate = mProjectRate;
2178 
2179  if (isNyquist && isGenerator) {
2180  previewDuration = CalcPreviewInputLength(previewLen);
2181  }
2182  else {
2183  previewDuration = wxMin(mDuration, CalcPreviewInputLength(previewLen));
2184  }
2185 
2186  double t1 = mT0 + previewDuration;
2187 
2188  if ((t1 > mT1) && !isGenerator) {
2189  t1 = mT1;
2190  }
2191 
2192  if (t1 <= mT0)
2193  return;
2194 
2195  bool success = true;
2196 
2197  auto cleanup = finally( [&] {
2198 
2199  // Effect is already inited; we will call Process, End, and then Init
2200  // again, so the state is exactly the way it was before Preview
2201  // was called.
2202  if (!dryOnly) {
2203  End();
2204  GuardedCall( [&]{ Init(); } );
2205  }
2206 
2207  // In case any dialog control depends on mT1 or mDuration:
2208  if ( mUIDialog )
2209  mUIDialog->TransferDataToWindow();
2210  } );
2211 
2212  auto vr0 = valueRestorer( mT0 );
2213  auto vr1 = valueRestorer( mT1 );
2214  // Most effects should stop at t1.
2215  if (!mPreviewFullSelection)
2216  mT1 = t1;
2217 
2218  // In case any dialog control depends on mT1 or mDuration:
2219  if ( mUIDialog ) {
2220  mUIDialog->TransferDataToWindow();
2221  }
2222 
2223  // Save the original track list
2224  TrackList *saveTracks = mTracks;
2225 
2226  auto cleanup2 = finally( [&] {
2227  mTracks = saveTracks;
2228  if (FocusDialog) {
2229  FocusDialog->SetFocus();
2230  }
2231 
2232  // In case of failed effect, be sure to free memory.
2233  ReplaceProcessedTracks( false );
2234  } );
2235 
2236  // Build NEW tracklist from rendering tracks
2237  // Set the same owning project, so FindProject() can see it within Process()
2238  const auto pProject = saveTracks->GetOwner();
2239  auto uTracks = TrackList::Create( pProject );
2240  mTracks = uTracks.get();
2241 
2242  // Linear Effect preview optimised by pre-mixing to one track.
2243  // Generators need to generate per track.
2244  if (mIsLinearEffect && !isGenerator) {
2245  WaveTrack::Holder mixLeft, mixRight;
2246  MixAndRender(saveTracks, mFactory, rate, floatSample, mT0, t1, mixLeft, mixRight);
2247  if (!mixLeft)
2248  return;
2249 
2250  mixLeft->Offset(-mixLeft->GetStartTime());
2251  mixLeft->SetSelected(true);
2252  WaveTrackView::Get( *mixLeft )
2254  auto pLeft = mTracks->Add( mixLeft );
2255  Track *pRight{};
2256  if (mixRight) {
2257  mixRight->Offset(-mixRight->GetStartTime());
2258  mixRight->SetSelected(true);
2259  pRight = mTracks->Add( mixRight );
2260  mTracks->MakeMultiChannelTrack(*pLeft, 2, true);
2261  }
2262  }
2263  else {
2264  for (auto src : saveTracks->Any< const WaveTrack >()) {
2265  if (src->GetSelected() || mPreviewWithNotSelected) {
2266  auto dest = src->Copy(mT0, t1);
2267  dest->SetSelected(src->GetSelected());
2268  WaveTrackView::Get( *static_cast<WaveTrack*>(dest.get()) )
2270  mTracks->Add( dest );
2271  }
2272  }
2273  }
2274 
2275  // NEW tracks start at time zero.
2276  // Adjust mT0 and mT1 to be the times to process, and to
2277  // play back in these tracks
2278  mT1 -= mT0;
2279  mT0 = 0.0;
2280 
2281  // Update track/group counts
2282  CountWaveTracks();
2283 
2284  // Apply effect
2285  if (!dryOnly) {
2286  ProgressDialog progress{
2287  GetName(),
2288  XO("Preparing preview"),
2290  }; // Have only "Stop" button.
2291  auto vr = valueRestorer( mProgress, &progress );
2292 
2293  auto vr2 = valueRestorer( mIsPreview, true );
2294 
2295  success = Process();
2296  }
2297 
2298  if (success)
2299  {
2300  auto tracks = ProjectAudioManager::GetAllPlaybackTracks(*mTracks, true);
2301 
2302  // Some effects (Paulstretch) may need to generate more
2303  // than previewLen, so take the min.
2304  t1 = std::min(mT0 + previewLen, mT1);
2305 
2306  // Start audio playing
2307  auto options = DefaultPlayOptions(*pProject);
2308  int token = gAudioIO->StartStream(tracks, mT0, t1, t1, options);
2309 
2310  if (token) {
2311  auto previewing = ProgressResult::Success;
2312  // The progress dialog must be deleted before stopping the stream
2313  // to allow events to flow to the app during StopStream processing.
2314  // The progress dialog blocks these events.
2315  {
2316  ProgressDialog progress
2317  (GetName(), XO("Previewing"), pdlgHideCancelButton);
2318 
2319  while (gAudioIO->IsStreamActive(token) && previewing == ProgressResult::Success) {
2320  ::wxMilliSleep(100);
2321  previewing = progress.Update(gAudioIO->GetStreamTime() - mT0, t1 - mT0);
2322  }
2323  }
2324 
2325  gAudioIO->StopStream();
2326 
2327  while (gAudioIO->IsBusy()) {
2328  ::wxMilliSleep(100);
2329  }
2330  }
2331  else {
2332  using namespace BasicUI;
2334  wxWidgetsWindowPlacement{ FocusDialog }, XO("Error"),
2335  XO("Error opening sound device.\nTry changing the audio host, playback device and the project sample rate."),
2336  wxT("Error_opening_sound_device"),
2337  ErrorDialogOptions{ ErrorDialogType::ModalErrorReport } );
2338  }
2339  }
2340 }

References TrackList::Add(), TrackList::Any(), CalcPreviewInputLength(), CountWaveTracks(), TrackList::Create(), DefaultPlayOptions(), EffectTypeGenerate, End(), floatSample, AudioIO::Get(), WaveTrackView::Get(), ProjectAudioManager::GetAllPlaybackTracks(), GetFamily(), ComponentInterface::GetName(), TrackList::GetOwner(), GetType(), gPrefs, GuardedCall(), Init(), TrackList::MakeMultiChannelTrack(), mDuration, mFactory, min(), mIsLinearEffect, mIsPreview, MixAndRender(), mNumTracks, mPreviewFullSelection, mPreviewWithNotSelected, mProgress, mProjectRate, mT0, mT1, mTracks, mUIDialog, WaveTrackViewConstants::NoDisplay, NYQUISTEFFECTS_FAMILY, Track::Offset(), pdlgHideCancelButton, Process(), ReplaceProcessedTracks(), WaveTrackView::SetDisplay(), BasicUI::ShowErrorDialog(), BasicUI::Success, ProgressDialog::Update(), valueRestorer(), and XO.

Referenced by EffectUIHost::OnPlay(), NoiseRemovalDialog::OnPreview(), EffectAmplify::Preview(), and EffectTimeScale::Preview().

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

◆ Process()

bool Effect::Process ( )
protectedvirtual

Reimplemented in VampEffect, EffectTwoPassSimpleMono, EffectTruncSilence, EffectTimeScale, EffectStereoToMono, EffectSimpleMono, EffectSBSMS, EffectReverse, EffectRepeat, EffectRepair, EffectPaulstretch, NyquistEffect, EffectNormalize, EffectNoiseRemoval, EffectNoiseReduction, EffectLoudness, Generator, EffectFindClipping, EffectEqualization, EffectClickRemoval, EffectChangeSpeed, and EffectAutoDuck.

Definition at line 1237 of file Effect.cpp.

1238 {
1239  CopyInputTracks(true);
1240  bool bGoodResult = true;
1241 
1242  // It's possible that the number of channels the effect expects changed based on
1243  // the parameters (the Audacity Reverb effect does when the stereo width is 0).
1246 
1247  mPass = 1;
1248  if (InitPass1())
1249  {
1250  bGoodResult = ProcessPass();
1251  mPass = 2;
1252  if (bGoodResult && InitPass2())
1253  {
1254  bGoodResult = ProcessPass();
1255  }
1256  }
1257 
1258  ReplaceProcessedTracks(bGoodResult);
1259 
1260  return bGoodResult;
1261 }

References CopyInputTracks(), GetAudioInCount(), GetAudioOutCount(), InitPass1(), InitPass2(), mNumAudioIn, mNumAudioOut, mPass, ProcessPass(), and ReplaceProcessedTracks().

Referenced by DoEffect(), and Preview().

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

◆ ProcessBlock()

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

Implements EffectClientInterface.

Reimplemented in EffectWahwah, EffectToneGen, EffectScienFilter, EffectReverb, EffectPhaser, EffectNoise, EffectInvert, and EffectFade.

Definition at line 388 of file Effect.cpp.

389 {
390  if (mClient)
391  {
392  return mClient->ProcessBlock(inBlock, outBlock, blockLen);
393  }
394 
395  return 0;
396 }

References mClient, and EffectClientInterface::ProcessBlock().

Referenced by ProcessTrack().

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

◆ ProcessFinalize()

bool Effect::ProcessFinalize ( )
overridevirtual

Implements EffectClientInterface.

Reimplemented in EffectReverb.

Definition at line 378 of file Effect.cpp.

379 {
380  if (mClient)
381  {
382  return mClient->ProcessFinalize();
383  }
384 
385  return true;
386 }

References mClient, and EffectClientInterface::ProcessFinalize().

Referenced by ProcessTrack().

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

◆ ProcessInitialize()

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

Implements EffectClientInterface.

Reimplemented in EffectWahwah, EffectToneGen, EffectScienFilter, EffectReverb, EffectPhaser, and EffectFade.

Definition at line 368 of file Effect.cpp.

369 {
370  if (mClient)
371  {
372  return mClient->ProcessInitialize(totalLen, chanMap);
373  }
374 
375  return true;
376 }

References mClient, and EffectClientInterface::ProcessInitialize().

Referenced by ProcessTrack().

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

◆ ProcessPass()

bool Effect::ProcessPass ( )
protectedvirtual

Reimplemented in EffectTwoPassSimpleMono.

Definition at line 1263 of file Effect.cpp.

1264 {
1265  bool bGoodResult = true;
1266  bool isGenerator = GetType() == EffectTypeGenerate;
1267 
1268  FloatBuffers inBuffer, outBuffer;
1269  ArrayOf<float *> inBufPos, outBufPos;
1270 
1271  ChannelName map[3];
1272 
1273  mBufferSize = 0;
1274  mBlockSize = 0;
1275 
1276  int count = 0;
1277  bool clear = false;
1278 
1279  const bool multichannel = mNumAudioIn > 1;
1280  auto range = multichannel
1281  ? mOutputTracks->Leaders()
1282  : mOutputTracks->Any();
1283  range.VisitWhile( bGoodResult,
1284  [&](WaveTrack *left, const Track::Fallthrough &fallthrough) {
1285  if (!left->GetSelected())
1286  return fallthrough();
1287 
1288  sampleCount len = 0;
1289  sampleCount start = 0;
1290 
1291  mNumChannels = 0;
1292  WaveTrack *right{};
1293 
1294  // Iterate either over one track which could be any channel,
1295  // or if multichannel, then over all channels of left,
1296  // which is a leader.
1297  for (auto channel :
1298  TrackList::Channels(left).StartingWith(left)) {
1299  if (channel->GetChannel() == Track::LeftChannel)
1301  else if (channel->GetChannel() == Track::RightChannel)
1303  else
1305 
1306  ++ mNumChannels;
1308 
1309  if (! multichannel)
1310  break;
1311 
1312  if (mNumChannels == 2) {
1313  // TODO: more-than-two-channels
1314  right = channel;
1315  clear = false;
1316  // Ignore other channels
1317  break;
1318  }
1319  }
1320 
1321  if (!isGenerator)
1322  {
1323  GetBounds(*left, right, &start, &len);
1324  mSampleCnt = len;
1325  }
1326  else
1328 
1329  // Let the client know the sample rate
1330  SetSampleRate(left->GetRate());
1331 
1332  // Get the block size the client wants to use
1333  auto max = left->GetMaxBlockSize() * 2;
1334  mBlockSize = SetBlockSize(max);
1335 
1336  // Calculate the buffer size to be at least the max rounded up to the clients
1337  // selected block size.
1338  const auto prevBufferSize = mBufferSize;
1339  mBufferSize = ((max + (mBlockSize - 1)) / mBlockSize) * mBlockSize;
1340 
1341  // If the buffer size has changed, then (re)allocate the buffers
1342  if (prevBufferSize != mBufferSize)
1343  {
1344  // Always create the number of input buffers the client expects even if we don't have
1345  // the same number of channels.
1346  inBufPos.reinit( mNumAudioIn );
1347  inBuffer.reinit( mNumAudioIn, mBufferSize );
1348 
1349  // We won't be using more than the first 2 buffers, so clear the rest (if any)
1350  for (size_t i = 2; i < mNumAudioIn; i++)
1351  {
1352  for (size_t j = 0; j < mBufferSize; j++)
1353  {
1354  inBuffer[i][j] = 0.0;
1355  }
1356  }
1357 
1358  // Always create the number of output buffers the client expects even if we don't have
1359  // the same number of channels.
1360  outBufPos.reinit( mNumAudioOut );
1361  // Output buffers get an extra mBlockSize worth to give extra room if
1362  // the plugin adds latency
1363  outBuffer.reinit( mNumAudioOut, mBufferSize + mBlockSize );
1364  }
1365 
1366  // (Re)Set the input buffer positions
1367  for (size_t i = 0; i < mNumAudioIn; i++)
1368  {
1369  inBufPos[i] = inBuffer[i].get();
1370  }
1371 
1372  // (Re)Set the output buffer positions
1373  for (size_t i = 0; i < mNumAudioOut; i++)
1374  {
1375  outBufPos[i] = outBuffer[i].get();
1376  }
1377 
1378  // Clear unused input buffers
1379  if (!right && !clear && mNumAudioIn > 1)
1380  {
1381  for (size_t j = 0; j < mBufferSize; j++)
1382  {
1383  inBuffer[1][j] = 0.0;
1384  }
1385  clear = true;
1386  }
1387 
1388  // Go process the track(s)
1389  bGoodResult = ProcessTrack(
1390  count, map, left, right, start, len,
1391  inBuffer, outBuffer, inBufPos, outBufPos);
1392  if (!bGoodResult)
1393  return;
1394 
1395  count++;
1396  },
1397  [&](Track *t) {
1399  t->SyncLockAdjust(mT1, mT0 + mDuration);
1400  }
1401  );
1402 
1403  if (bGoodResult && GetType() == EffectTypeGenerate)
1404  {
1405  mT1 = mT0 + mDuration;
1406  }
1407 
1408  return bGoodResult;
1409 }

References ChannelNameEOL, ChannelNameFrontLeft, ChannelNameFrontRight, ChannelNameMono, TrackList::Channels(), EffectTypeGenerate, GetBounds(), WaveTrack::GetMaxBlockSize(), WaveTrack::GetRate(), Track::GetSelected(), GetType(), SyncLock::IsSyncLockSelected(), Track::LeftChannel, mBlockSize, mBufferSize, mDuration, mNumAudioIn, mNumAudioOut, mNumChannels, mOutputTracks, mSampleCnt, mT0, mT1, ProcessTrack(), ArraysOf< X >::reinit(), ArrayOf< X >::reinit(), Track::RightChannel, SetBlockSize(), SetSampleRate(), and WaveTrack::TimeToLongSamples().

Referenced by Process().

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

◆ ProcessTrack()

bool Effect::ProcessTrack ( int  count,
ChannelNames  map,
WaveTrack left,
WaveTrack right,
sampleCount  start,
sampleCount  len,
FloatBuffers inBuffer,
FloatBuffers outBuffer,
ArrayOf< float * > &  inBufPos,
ArrayOf< float * > &  outBufPos 
)
private

Definition at line 1411 of file Effect.cpp.

1421 {
1422  bool rc = true;
1423 
1424  // Give the plugin a chance to initialize
1425  if (!ProcessInitialize(len, map))
1426  {
1427  return false;
1428  }
1429 
1430  { // Start scope for cleanup
1431  auto cleanup = finally( [&] {
1432  // Allow the plugin to cleanup
1433  if (!ProcessFinalize())
1434  {
1435  // In case of non-exceptional flow of control, set rc
1436  rc = false;
1437  }
1438  } );
1439 
1440  // For each input block of samples, we pass it to the effect along with a
1441  // variable output location. This output location is simply a pointer into a
1442  // much larger buffer. This reduces the number of calls required to add the
1443  // samples to the output track.
1444  //
1445  // Upon return from the effect, the output samples are "moved to the left" by
1446  // the number of samples in the current latency setting, effectively removing any
1447  // delay introduced by the effect.
1448  //
1449  // At the same time the total number of delayed samples are gathered and when
1450  // there is no further input data to process, the loop continues to call the
1451  // effect with an empty input buffer until the effect has had a chance to
1452  // return all of the remaining delayed samples.
1453  auto inPos = start;
1454  auto outPos = start;
1455 
1456  auto inputRemaining = len;
1457  decltype(GetLatency()) curDelay = 0, delayRemaining = 0;
1458  decltype(mBlockSize) curBlockSize = 0;
1459 
1460  decltype(mBufferSize) inputBufferCnt = 0;
1461  decltype(mBufferSize) outputBufferCnt = 0;
1462  bool cleared = false;
1463 
1464  auto chans = std::min<unsigned>(mNumAudioOut, mNumChannels);
1465 
1466  std::shared_ptr<WaveTrack> genLeft, genRight;
1467 
1468  decltype(len) genLength = 0;
1469  bool isGenerator = GetType() == EffectTypeGenerate;
1470  bool isProcessor = GetType() == EffectTypeProcess;
1471  double genDur = 0;
1472  if (isGenerator)
1473  {
1474  if (mIsPreview) {
1475  gPrefs->Read(wxT("/AudioIO/EffectsPreviewLen"), &genDur, 6.0);
1476  genDur = wxMin(mDuration, CalcPreviewInputLength(genDur));
1477  }
1478  else {
1479  genDur = mDuration;
1480  }
1481 
1482  genLength = sampleCount((left->GetRate() * genDur) + 0.5); // round to nearest sample
1483  delayRemaining = genLength;
1484  cleared = true;
1485 
1486  // Create temporary tracks
1487  genLeft = left->EmptyCopy();
1488 
1489  if (right)
1490  genRight = right->EmptyCopy();
1491  }
1492 
1493  // Call the effect until we run out of input or delayed samples
1494  while (inputRemaining != 0 || delayRemaining != 0)
1495  {
1496  // Still working on the input samples
1497  if (inputRemaining != 0)
1498  {
1499  // Need to refill the input buffers
1500  if (inputBufferCnt == 0)
1501  {
1502  // Calculate the number of samples to get
1503  inputBufferCnt =
1504  limitSampleBufferSize( mBufferSize, inputRemaining );
1505 
1506  // Fill the input buffers
1507  left->GetFloats(inBuffer[0].get(), inPos, inputBufferCnt);
1508  if (right)
1509  {
1510  right->GetFloats(inBuffer[1].get(), inPos, inputBufferCnt);
1511  }
1512 
1513  // Reset the input buffer positions
1514  for (size_t i = 0; i < mNumChannels; i++)
1515  {
1516  inBufPos[i] = inBuffer[i].get();
1517  }
1518  }
1519 
1520  // Calculate the number of samples to process
1521  curBlockSize = mBlockSize;
1522  if (curBlockSize > inputRemaining)
1523  {
1524  // We've reached the last block...set current block size to what's left
1525  // inputRemaining is positive and bounded by a size_t
1526  curBlockSize = inputRemaining.as_size_t();
1527  inputRemaining = 0;
1528 
1529  // Clear the remainder of the buffers so that a full block can be passed
1530  // to the effect
1531  auto cnt = mBlockSize - curBlockSize;
1532  for (size_t i = 0; i < mNumChannels; i++)
1533  {
1534  for (decltype(cnt) j = 0 ; j < cnt; j++)
1535  {
1536  inBufPos[i][j + curBlockSize] = 0.0;
1537  }
1538  }
1539 
1540  // Might be able to use up some of the delayed samples
1541  if (delayRemaining != 0)
1542  {
1543  // Don't use more than needed
1544  cnt = limitSampleBufferSize(cnt, delayRemaining);
1545  delayRemaining -= cnt;
1546  curBlockSize += cnt;
1547  }
1548  }
1549  }
1550  // We've exhausted the input samples and are now working on the delay
1551  else if (delayRemaining != 0)
1552  {
1553  // Calculate the number of samples to process
1554  curBlockSize = limitSampleBufferSize( mBlockSize, delayRemaining );
1555  delayRemaining -= curBlockSize;
1556 
1557  // From this point on, we only want to feed zeros to the plugin
1558  if (!cleared)
1559  {
1560  // Reset the input buffer positions
1561  for (size_t i = 0; i < mNumChannels; i++)
1562  {
1563  inBufPos[i] = inBuffer[i].get();
1564 
1565  // And clear
1566  for (size_t j = 0; j < mBlockSize; j++)
1567  {
1568  inBuffer[i][j] = 0.0;
1569  }
1570  }
1571  cleared = true;
1572  }
1573  }
1574 
1575  // Finally call the plugin to process the block
1576  decltype(curBlockSize) processed;
1577  try
1578  {
1579  processed = ProcessBlock(inBufPos.get(), outBufPos.get(), curBlockSize);
1580  }
1581  catch( const AudacityException & WXUNUSED(e) )
1582  {
1583  // PRL: Bug 437:
1584  // Pass this along to our application-level handler
1585  throw;
1586  }
1587  catch(...)
1588  {
1589  // PRL:
1590  // Exceptions for other reasons, maybe in third-party code...
1591  // Continue treating them as we used to, but I wonder if these
1592  // should now be treated the same way.
1593  return false;
1594  }
1595  wxASSERT(processed == curBlockSize);
1596  wxUnusedVar(processed);
1597 
1598  // Bump to next input buffer position
1599  if (inputRemaining != 0)
1600  {
1601  for (size_t i = 0; i < mNumChannels; i++)
1602  {
1603  inBufPos[i] += curBlockSize;
1604  }
1605  inputRemaining -= curBlockSize;
1606  inputBufferCnt -= curBlockSize;
1607  }
1608 
1609  // "ls" and "rs" serve as the input sample index for the left and
1610  // right channels when processing the input samples. If we flip
1611  // over to processing delayed samples, they simply become counters
1612  // for the progress display.
1613  inPos += curBlockSize;
1614 
1615  // Get the current number of delayed samples and accumulate
1616  if (isProcessor)
1617  {
1618  {
1619  auto delay = GetLatency();
1620  curDelay += delay;
1621  delayRemaining += delay;
1622  }
1623 
1624  // If the plugin has delayed the output by more samples than our current
1625  // block size, then we leave the output pointers alone. This effectively
1626  // removes those delayed samples from the output buffer.
1627  if (curDelay >= curBlockSize)
1628  {
1629  curDelay -= curBlockSize;
1630  curBlockSize = 0;
1631  }
1632  // We have some delayed samples, at the beginning of the output samples,
1633  // so overlay them by shifting the remaining output samples.
1634  else if (curDelay > 0)
1635  {
1636  // curDelay is bounded by curBlockSize:
1637  auto delay = curDelay.as_size_t();
1638  curBlockSize -= delay;
1639  for (size_t i = 0; i < chans; i++)
1640  {
1641  memmove(outBufPos[i], outBufPos[i] + delay, sizeof(float) * curBlockSize);
1642  }
1643  curDelay = 0;
1644  }
1645  }
1646 
1647  // Adjust the number of samples in the output buffers
1648  outputBufferCnt += curBlockSize;
1649 
1650  // Still have room in the output buffers
1651  if (outputBufferCnt < mBufferSize)
1652  {
1653  // Bump to next output buffer position
1654  for (size_t i = 0; i < chans; i++)
1655  {
1656  outBufPos[i] += curBlockSize;
1657  }
1658  }
1659  // Output buffers have filled
1660  else
1661  {
1662  if (isProcessor)
1663  {
1664  // Write them out
1665  left->Set((samplePtr) outBuffer[0].get(), floatSample, outPos, outputBufferCnt);
1666  if (right)
1667  {
1668  if (chans >= 2)
1669  {
1670  right->Set((samplePtr) outBuffer[1].get(), floatSample, outPos, outputBufferCnt);
1671  }
1672  else
1673  {
1674  right->Set((samplePtr) outBuffer[0].get(), floatSample, outPos, outputBufferCnt);
1675  }
1676  }
1677  }
1678  else if (isGenerator)
1679  {
1680  genLeft->Append((samplePtr) outBuffer[0].get(), floatSample, outputBufferCnt);
1681  if (genRight)
1682  {
1683  genRight->Append((samplePtr) outBuffer[1].get(), floatSample, outputBufferCnt);
1684  }
1685  }
1686 
1687  // Reset the output buffer positions
1688  for (size_t i = 0; i < chans; i++)
1689  {
1690  outBufPos[i] = outBuffer[i].get();
1691  }
1692 
1693  // Bump to the next track position
1694  outPos += outputBufferCnt;
1695  outputBufferCnt = 0;
1696  }
1697 
1698  if (mNumChannels > 1)
1699  {
1700  if (TrackGroupProgress(count,
1701  (inPos - start).as_double() /
1702  (isGenerator ? genLength : len).as_double()))
1703  {
1704  rc = false;
1705  break;
1706  }
1707  }
1708  else
1709  {
1710  if (TrackProgress(count,
1711  (inPos - start).as_double() /
1712  (isGenerator ? genLength : len).as_double()))
1713  {
1714  rc = false;
1715  break;
1716  }
1717  }
1718  }
1719 
1720  // Put any remaining output
1721  if (rc && outputBufferCnt)
1722  {
1723  if (isProcessor)
1724  {
1725  left->Set((samplePtr) outBuffer[0].get(), floatSample, outPos, outputBufferCnt);
1726  if (right)
1727  {
1728  if (chans >= 2)
1729  {
1730  right->Set((samplePtr) outBuffer[1].get(), floatSample, outPos, outputBufferCnt);
1731  }
1732  else
1733  {
1734  right->Set((samplePtr) outBuffer[0].get(), floatSample, outPos, outputBufferCnt);
1735  }
1736  }
1737  }
1738  else if (isGenerator)
1739  {
1740  genLeft->Append((samplePtr) outBuffer[0].get(), floatSample, outputBufferCnt);
1741  if (genRight)
1742  {
1743  genRight->Append((samplePtr) outBuffer[1].get(), floatSample, outputBufferCnt);
1744  }
1745  }
1746  }
1747 
1748  if (rc && isGenerator)
1749  {
1750  auto pProject = FindProject();
1751 
1752  // Transfer the data from the temporary tracks to the actual ones
1753  genLeft->Flush();
1754  // mT1 gives us the NEW selection. We want to replace up to GetSel1().
1755  auto &selectedRegion = ViewInfo::Get( *pProject ).selectedRegion;
1756  auto t1 = selectedRegion.t1();
1757  PasteTimeWarper warper{ t1, mT0 + genLeft->GetEndTime() };
1758  left->ClearAndPaste(mT0, t1, genLeft.get(), true, true,
1759  &warper);
1760 
1761  if (genRight)
1762  {
1763  genRight->Flush();
1764  right->ClearAndPaste(mT0, selectedRegion.t1(),
1765  genRight.get(), true, true, nullptr /* &warper */);
1766  }
1767  }
1768 
1769  } // End scope for cleanup
1770  return rc;
1771 }

References WaveTrack::Append(), CalcPreviewInputLength(), WaveTrack::ClearAndPaste(), EffectTypeGenerate, EffectTypeProcess, WaveTrack::EmptyCopy(), FindProject(), floatSample, WaveTrack::Flush(), ViewInfo::Get(), WaveTrack::GetEndTime(), WaveTrack::GetFloats(), GetLatency(), WaveTrack::GetRate(), GetType(), gPrefs, limitSampleBufferSize(), mBlockSize, mBufferSize, mDuration, mIsPreview, mNumAudioOut, mNumChannels, mT0, ProcessBlock(), ProcessFinalize(), ProcessInitialize(), ViewInfo::selectedRegion, WaveTrack::Set(), NotifyingSelectedRegion::t1(), TrackGroupProgress(), and TrackProgress().

Referenced by ProcessPass().

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

◆ RealtimeAddProcessor()

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

Implements EffectClientInterface.

Reimplemented in EffectWahwah, and EffectPhaser.

Definition at line 411 of file Effect.cpp.

412 {
413  if (mClient)
414  {
415  return mClient->RealtimeAddProcessor(numChannels, sampleRate);
416  }
417 
418  return true;
419 }

References mClient, and EffectClientInterface::RealtimeAddProcessor().

Here is the call graph for this function:

◆ RealtimeFinalize()

bool Effect::RealtimeFinalize ( )
overridevirtual

Implements EffectClientInterface.

Reimplemented in EffectWahwah, and EffectPhaser.

Definition at line 421 of file Effect.cpp.

422 {
423  if (mClient)
424  {
425  return mClient->RealtimeFinalize();
426  }
427 
428  return false;
429 }

References mClient, and EffectClientInterface::RealtimeFinalize().

Here is the call graph for this function:

◆ RealtimeInitialize()

bool Effect::RealtimeInitialize ( )
overridevirtual

Implements EffectClientInterface.

Reimplemented in EffectWahwah, and EffectPhaser.

Definition at line 398 of file Effect.cpp.

399 {
400  if (mClient)
401  {
403  return mClient->RealtimeInitialize();
404  }
405 
406  mBlockSize = 512;
407 
408  return false;
409 }

References mBlockSize, mClient, EffectClientInterface::RealtimeInitialize(), and EffectClientInterface::SetBlockSize().

Here is the call graph for this function:

◆ RealtimeProcess()

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

Implements EffectClientInterface.

Reimplemented in EffectWahwah, and EffectPhaser.

Definition at line 457 of file Effect.cpp.

461 {
462  if (mClient)
463  {
464  return mClient->RealtimeProcess(group, inbuf, outbuf, numSamples);
465  }
466 
467  return 0;
468 }

References mClient, and EffectClientInterface::RealtimeProcess().

Here is the call graph for this function:

◆ RealtimeProcessEnd()

bool Effect::RealtimeProcessEnd ( )
overridevirtual

Implements EffectClientInterface.

Definition at line 470 of file Effect.cpp.

471 {
472  if (mClient)
473  {
474  return mClient->RealtimeProcessEnd();
475  }
476 
477  return true;
478 }

References mClient, and EffectClientInterface::RealtimeProcessEnd().

Here is the call graph for this function:

◆ RealtimeProcessStart()

bool Effect::RealtimeProcessStart ( )
overridevirtual

Implements EffectClientInterface.

Definition at line 447 of file Effect.cpp.

448 {
449  if (mClient)
450  {
451  return mClient->RealtimeProcessStart();
452  }
453 
454  return true;
455 }

References mClient, and EffectClientInterface::RealtimeProcessStart().

Here is the call graph for this function:

◆ RealtimeResume()

bool Effect::RealtimeResume ( )
overridevirtual

Implements EffectClientInterface.

Definition at line 439 of file Effect.cpp.

440 {
441  if (mClient)
442  return mClient->RealtimeResume();
443 
444  return true;
445 }

References mClient, and EffectClientInterface::RealtimeResume().

Here is the call graph for this function:

◆ RealtimeSuspend()

bool Effect::RealtimeSuspend ( )
overridevirtual

Implements EffectClientInterface.

Definition at line 431 of file Effect.cpp.

432 {
433  if (mClient)
434  return mClient->RealtimeSuspend();
435 
436  return true;
437 }

References mClient, and EffectClientInterface::RealtimeSuspend().

Here is the call graph for this function:

◆ ReplaceProcessedTracks()

void Effect::ReplaceProcessedTracks ( const bool  bGoodResult)
protected

Definition at line 2054 of file Effect.cpp.

2055 {
2056  if (!bGoodResult) {
2057  // Free resources, unless already freed.
2058 
2059  // Processing failed or was cancelled so throw away the processed tracks.
2060  if ( mOutputTracks )
2061  mOutputTracks->Clear();
2062 
2063  // Reset map
2064  mIMap.clear();
2065  mOMap.clear();
2066 
2067  //TODO:undo the non-gui ODTask transfer
2068  return;
2069  }
2070 
2071  // Assume resources need to be freed.
2072  wxASSERT(mOutputTracks); // Make sure we at least did the CopyInputTracks().
2073 
2074  auto iterOut = mOutputTracks->ListOfTracks::begin(),
2075  iterEnd = mOutputTracks->ListOfTracks::end();
2076 
2077  size_t cnt = mOMap.size();
2078  size_t i = 0;
2079 
2080  for (; iterOut != iterEnd; ++i) {
2081  ListOfTracks::value_type o = *iterOut;
2082  // If tracks were removed from mOutputTracks, then there will be
2083  // tracks in the map that must be removed from mTracks.
2084  while (i < cnt && mOMap[i] != o.get()) {
2085  const auto t = mIMap[i];
2086  if (t) {
2087  mTracks->Remove(t);
2088  }
2089  i++;
2090  }
2091 
2092  // This should never happen
2093  wxASSERT(i < cnt);
2094 
2095  // Remove the track from the output list...don't DELETE it
2096  iterOut = mOutputTracks->erase(iterOut);
2097 
2098  const auto t = mIMap[i];
2099  if (t == NULL)
2100  {
2101  // This track is a NEW addition to output tracks; add it to mTracks
2102  mTracks->Add( o );
2103  }
2104  else
2105  {
2106  // Replace mTracks entry with the NEW track
2107  mTracks->Replace(t, o);
2108  }
2109  }
2110 
2111  // If tracks were removed from mOutputTracks, then there may be tracks
2112  // left at the end of the map that must be removed from mTracks.
2113  while (i < cnt) {
2114  const auto t = mIMap[i];
2115  if (t) {
2116  mTracks->Remove(t);
2117  }
2118  i++;
2119  }
2120 
2121  // Reset map
2122  mIMap.clear();
2123  mOMap.clear();
2124 
2125  // Make sure we processed everything
2126  wxASSERT(mOutputTracks->empty());
2127 
2128  // The output list is no longer needed
2129  mOutputTracks.reset();
2130  nEffectsDone++;
2131 }

References TrackList::Add(), mIMap, mOMap, mOutputTracks, mTracks, nEffectsDone, TrackList::Remove(), and TrackList::Replace().

Referenced by DoEffect(), EffectTruncSilence::DoRemoval(), EffectTruncSilence::FindSilences(), Preview(), Process(), EffectAutoDuck::Process(), EffectChangeSpeed::Process(), EffectClickRemoval::Process(), EffectEqualization::Process(), Generator::Process(), EffectLoudness::Process(), EffectNoiseReduction::Process(), EffectNoiseRemoval::Process(), EffectNormalize::Process(), NyquistEffect::Process(), EffectPaulstretch::Process(), EffectRepair::Process(), EffectRepeat::Process(), EffectReverse::Process(), EffectSBSMS::Process(), EffectSimpleMono::Process(), EffectStereoToMono::Process(), EffectTruncSilence::Process(), and EffectTwoPassSimpleMono::Process().

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

◆ SaveUserPreset()

bool Effect::SaveUserPreset ( const RegistryPath name)
overridevirtual

Implements EffectClientInterface.

Definition at line 577 of file Effect.cpp.

578 {
579  if (mClient)
580  {
581  return mClient->SaveUserPreset(name);
582  }
583 
584  wxString parms;
585  if (!GetAutomationParameters(parms))
586  {
587  return false;
588  }
589 
591  name, wxT("Parameters"), parms);
592 }

References GetAutomationParameters(), GetDefinition(), mClient, name, PluginSettings::Private, EffectClientInterface::SaveUserPreset(), and PluginSettings::SetConfig().

Referenced by EffectUIHost::OnApply(), EffectUIHost::OnSaveAs(), SetBatchProcessing(), EffectAutoDuck::Startup(), EffectChangeSpeed::Startup(), EffectClickRemoval::Startup(), EffectCompressor::Startup(), EffectDtmf::Startup(), EffectEqualization::Startup(), EffectLoudness::Startup(), EffectNoise::Startup(), EffectNormalize::Startup(), EffectReverb::Startup(), EffectScienFilter::Startup(), EffectTruncSilence::Startup(), and Startup().

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

◆ SetAutomationParameters() [1/2]

bool Effect::SetAutomationParameters ( CommandParameters parms)
overridevirtual

Implements EffectClientInterface.

Reimplemented in EffectWahwah, VampEffect, EffectTruncSilence, EffectToneGen, EffectTimeScale, EffectScienFilter, EffectReverb, EffectRepeat, EffectPhaser, EffectPaulstretch, NyquistEffect, EffectNormalize, EffectNoise, EffectLoudness, EffectFindClipping, and EffectEqualization.

Definition at line 550 of file Effect.cpp.

551 {
552  if (mClient)
553  {
554  return mClient->SetAutomationParameters(parms);
555  }
556 
557  return true;
558 }

References mClient, and EffectClientInterface::SetAutomationParameters().

Referenced by ImportPresets(), LoadUserPreset(), SetAutomationParameters(), and EffectManager::SetEffectParameters().

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

◆ SetAutomationParameters() [2/2]

bool Effect::SetAutomationParameters ( const wxString &  parms)
virtual

Definition at line 951 of file Effect.cpp.

952 {
953  wxString preset = parms;
954  bool success = false;
955  if (preset.StartsWith(kUserPresetIdent))
956  {
957  preset.Replace(kUserPresetIdent, wxEmptyString, false);
958  success = LoadUserPreset(GetUserPresetsGroup(preset));
959  }
960  else if (preset.StartsWith(kFactoryPresetIdent))
961  {
962  preset.Replace(kFactoryPresetIdent, wxEmptyString, false);
963  auto presets = GetFactoryPresets();
964  success = LoadFactoryPreset( make_iterator_range( presets ).index( preset ) );
965  }
966  else if (preset.StartsWith(kCurrentSettingsIdent))
967  {
968  preset.Replace(kCurrentSettingsIdent, wxEmptyString, false);
970  }
971  else if (preset.StartsWith(kFactoryDefaultsIdent))
972  {
973  preset.Replace(kFactoryDefaultsIdent, wxEmptyString, false);
975  }
976  else
977  {
978  CommandParameters eap(parms);
980  S.SetForValidating( &eap );
981  // DefineParams returns false if not defined for this effect.
982  if( !DefineParams( S ) )
983  // the old method...
984  success = SetAutomationParameters(eap);
985  else if( !S.bOK )
986  success = false;
987  else{
988  success = true;
989  S.SetForWriting( &eap );
990  DefineParams( S );
991  }
992  }
993 
994  if (!success)
995  {
997  XO("%s: Could not load settings below. Default settings will be used.\n\n%s")
998  .Format( GetName(), preset ) );
999  // We are using default settings and we still wish to continue.
1000  return true;
1001  //return false;
1002  }
1003 
1004  if (!mUIDialog)
1005  {
1006  return true;
1007  }
1008 
1009  return TransferDataToWindow();
1010 }

References ComponentInterface::DefineParams(), GetCurrentSettingsGroup(), GetFactoryDefaultsGroup(), GetFactoryPresets(), ComponentInterface::GetName(), GetUserPresetsGroup(), kCurrentSettingsIdent, kFactoryDefaultsIdent, kFactoryPresetIdent, kUserPresetIdent, LoadFactoryPreset(), LoadUserPreset(), make_iterator_range(), MessageBox(), mUIDialog, S, SetAutomationParameters(), TransferDataToWindow(), and XO.

Here is the call graph for this function:

◆ SetBatchProcessing()

void Effect::SetBatchProcessing ( bool  start)
virtual

Definition at line 1059 of file Effect.cpp.

1060 {
1061  mIsBatch = start;
1062 
1063  if (start)
1064  {
1066  }
1067  else
1068  {
1070  }
1071 }

References GetSavedStateGroup(), LoadUserPreset(), mIsBatch, and SaveUserPreset().

Referenced by EffectManager::SetBatchProcessing(), and NyquistEffect::ShowHostInterface().

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

◆ SetBlockSize()

size_t Effect::SetBlockSize ( size_t  maxBlockSize)
overridevirtual

Implements EffectClientInterface.

Definition at line 316 of file Effect.cpp.

317 {
318  if (mClient)
319  {
320  return mClient->SetBlockSize(maxBlockSize);
321  }
322 
323  mBlockSize = maxBlockSize;
324 
325  return mBlockSize;
326 }

References mBlockSize, mClient, and EffectClientInterface::SetBlockSize().

Referenced by ProcessPass(), EffectBassTreble::RealtimeInitialize(), EffectDistortion::RealtimeInitialize(), EffectPhaser::RealtimeInitialize(), and EffectWahwah::RealtimeInitialize().

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

◆ SetDuration()

void Effect::SetDuration ( double  duration)
overridevirtual

Implements EffectHostInterface.

Definition at line 847 of file Effect.cpp.

848 {
849  if (seconds < 0.0)
850  {
851  seconds = 0.0;
852  }
853 
854  if (GetType() == EffectTypeGenerate)
855  {
857  GetCurrentSettingsGroup(), wxT("LastUsedDuration"), seconds);
858  }
859 
860  mDuration = seconds;
861 
862  return;
863 }

References EffectTypeGenerate, GetCurrentSettingsGroup(), GetDefinition(), GetType(), mDuration, PluginSettings::Private, and PluginSettings::SetConfig().

Referenced by DoEffect(), EffectDtmf::OnDuration(), EffectDtmf::Recalculate(), EffectDtmf::TransferDataFromWindow(), EffectNoise::TransferDataFromWindow(), EffectSilence::TransferDataFromWindow(), and EffectToneGen::TransferDataFromWindow().

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

◆ SetHost()

bool Effect::SetHost ( EffectHostInterface host)
overridevirtual

Implements EffectUIClientInterface.

Definition at line 256 of file Effect.cpp.

257 {
258  if (mClient)
259  {
260  return mClient->SetHost(host);
261  }
262 
263  return true;
264 }

References mClient, and EffectUIClientInterface::SetHost().

Referenced by Startup().

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

◆ SetLinearEffectFlag()

void Effect::SetLinearEffectFlag ( bool  linearEffectFlag)
protected

Definition at line 1862 of file Effect.cpp.

1863 {
1864  mIsLinearEffect = linearEffectFlag;
1865 }

References mIsLinearEffect.

Referenced by EffectEcho::EffectEcho(), EffectLoudness::EffectLoudness(), EffectNoise::EffectNoise(), EffectSilence::EffectSilence(), and NyquistEffect::Parse().

Here is the caller graph for this function:

◆ SetPresetParameters()

void Effect::SetPresetParameters ( const wxArrayString *  Names,
const wxArrayString *  Values 
)
inline

Definition at line 221 of file Effect.h.

221  {
222  if( Names ) mPresetNames = *Names;
223  if( Values ) mPresetValues = *Values;
224  }

Referenced by DoEffect().

Here is the caller graph for this function:

◆ SetPreviewFullSelectionFlag()

void Effect::SetPreviewFullSelectionFlag ( bool  previewDurationFlag)
protected

Definition at line 1867 of file Effect.cpp.

1868 {
1869  mPreviewFullSelection = previewDurationFlag;
1870 }

References mPreviewFullSelection.

Referenced by NyquistEffect::Parse().

Here is the caller graph for this function:

◆ SetSampleRate()

void Effect::SetSampleRate ( double  rate)
overridevirtual

Implements EffectClientInterface.

Definition at line 306 of file Effect.cpp.

307 {
308  if (mClient)
309  {
310  mClient->SetSampleRate(rate);
311  }
312 
313  mSampleRate = rate;
314 }

Referenced by ProcessPass().

Here is the caller graph for this function:

◆ SetUIFlags()

void Effect::SetUIFlags ( unsigned  flags)
virtual

Definition at line 1046 of file Effect.cpp.

1046  {
1047  mUIFlags = flags;
1048 }

References mUIFlags.

Referenced by EffectUI::DoEffect().

Here is the caller graph for this function:

◆ SetVetoDialogHook()

auto Effect::SetVetoDialogHook ( VetoDialogHook  hook)
static

Definition at line 77 of file Effect.cpp.

79 {
80  auto &theHook = GetVetoDialogHook();
81  auto result = theHook;
82  theHook = hook;
83  return result;
84 }

References anonymous_namespace{Effect.cpp}::GetVetoDialogHook().

Referenced by ScreenshotCommand::ScreenshotCommand().

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

◆ ShowClientInterface()

int Effect::ShowClientInterface ( wxWindow &  parent,
wxDialog &  dialog,
bool  forceModal = false 
)
overridevirtual
Returns
0 if destructive effect processing should not proceed (and there may be a non-modal dialog still opened); otherwise, modal dialog return code

Implements EffectUIClientInterface.

Definition at line 480 of file Effect.cpp.

482 {
483  // Remember the dialog with a weak pointer, but don't control its lifetime
484  mUIDialog = &dialog;
485  mUIDialog->Layout();
486  mUIDialog->Fit();
487  mUIDialog->SetMinSize(mUIDialog->GetSize());
488 
489  auto hook = GetVetoDialogHook();
490  if( hook && hook( mUIDialog ) )
491  return 0;
492 
493  if( SupportsRealtime() && !forceModal )
494  {
495  mUIDialog->Show();
496  // Return false to bypass effect processing
497  return 0;
498  }
499 
500  return mUIDialog->ShowModal();
501 }

References anonymous_namespace{Effect.cpp}::GetVetoDialogHook(), mUIDialog, and SupportsRealtime().

Here is the call graph for this function:

◆ ShowHostInterface()

int Effect::ShowHostInterface ( wxWindow &  parent,
const EffectDialogFactory factory,
bool  forceModal = false 
)
overridevirtual
Returns
0 if destructive effect processing should not proceed (and there may be a non-modal dialog still opened); otherwise, modal dialog return code

Implements EffectUIHostInterface.

Reimplemented in NyquistEffect, EffectNoiseRemoval, and EffectNoiseReduction.

Definition at line 503 of file Effect.cpp.

505 {
506  if (!IsInteractive())
507  // Effect without UI just proceeds quietly to apply it destructively.
508  return wxID_APPLY;
509 
510  if (mHostUIDialog)
511  {
512  // Realtime effect has shown its nonmodal dialog, now hides it, and does
513  // nothing else.
514  if ( mHostUIDialog->Close(true) )
515  mHostUIDialog = nullptr;
516  return 0;
517  }
518 
519  // Create the dialog
520  // Host, not client, is responsible for invoking the factory and managing
521  // the lifetime of the dialog.
522  // The usual factory lets the client (which is this, when self-hosting)
523  // populate it. That factory function is called indirectly through a
524  // std::function to avoid source code dependency cycles.
525  const auto client = mClient ? mClient : this;
526  mHostUIDialog = factory(parent, *this, *client);
527  if (!mHostUIDialog)
528  return 0;
529 
530  // Let the client show the dialog and decide whether to keep it open
531  auto result = client->ShowClientInterface(parent, *mHostUIDialog, forceModal);
532  if (!mHostUIDialog->IsShown())
533  // Client didn't show it, or showed it modally and closed it
534  // So destroy it
535  mHostUIDialog.reset();
536 
537  return result;
538 }

References factory, IsInteractive(), mClient, and mHostUIDialog.

Referenced by DoEffect(), EffectManager::PromptUser(), and NyquistEffect::ShowHostInterface().

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

◆ ShowOptions()

void Effect::ShowOptions ( )
overridevirtual

Implements EffectUIClientInterface.

Definition at line 809 of file Effect.cpp.

810 {
811 }

◆ Startup() [1/2]

bool Effect::Startup ( )
virtual

Reimplemented in EffectTruncSilence, EffectScienFilter, EffectReverb, EffectNormalize, EffectNoise, EffectLoudness, EffectEqualization, EffectDtmf, EffectCompressor, EffectClickRemoval, EffectChangeSpeed, and EffectAutoDuck.

Definition at line 923 of file Effect.cpp.

924 {
925  return true;
926 }

Referenced by Startup().

Here is the caller graph for this function:

◆ Startup() [2/2]

bool Effect::Startup ( EffectUIClientInterface client)
virtual

Definition at line 893 of file Effect.cpp.

894 {
895  // Let destructor know we need to be shutdown
896  mClient = client;
897 
898  // Set host so client startup can use our services
899  if (!SetHost(this))
900  {
901  // Bail if the client startup fails
902  mClient = NULL;
903  return false;
904  }
905 
908 
909  bool haveDefaults;
911  wxT("Initialized"), haveDefaults, false);
912  if (!haveDefaults)
913  {
916  wxT("Initialized"), true);
917  }
919 
920  return Startup();
921 }

References GetAudioInCount(), GetAudioOutCount(), PluginSettings::GetConfig(), GetCurrentSettingsGroup(), GetDefinition(), GetFactoryDefaultsGroup(), LoadUserPreset(), mClient, mNumAudioIn, mNumAudioOut, PluginSettings::Private, SaveUserPreset(), PluginSettings::SetConfig(), SetHost(), and Startup().

Here is the call graph for this function:

◆ SupportsAutomation()

bool Effect::SupportsAutomation ( )
overridevirtual

Implements EffectDefinitionInterface.

Reimplemented in EffectNoiseRemoval.

Definition at line 244 of file Effect.cpp.

245 {
246  if (mClient)
247  {
248  return mClient->SupportsAutomation();
249  }
250 
251  return true;
252 }

References mClient, and EffectDefinitionInterface::SupportsAutomation().

Here is the call graph for this function:

◆ SupportsRealtime()

bool Effect::SupportsRealtime ( )
overridevirtual

Implements EffectDefinitionInterface.

Reimplemented in EffectWahwah, and EffectPhaser.

Definition at line 234 of file Effect.cpp.

235 {
236  if (mClient)
237  {
238  return mClient->SupportsRealtime();
239  }
240 
241  return false;
242 }

References mClient, and EffectDefinitionInterface::SupportsRealtime().

Referenced by EffectUIHost::BuildButtonBar(), EffectUI::DoEffect(), EnablePreview(), and ShowClientInterface().

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

◆ TestUIFlags()

unsigned Effect::TestUIFlags ( unsigned  mask)
virtual

Definition at line 1050 of file Effect.cpp.

1050  {
1051  return mask & mUIFlags;
1052 }

References mUIFlags.

Referenced by NyquistEffect::ShowHostInterface().

Here is the caller graph for this function:

◆ TotalProgress()

bool Effect::TotalProgress ( double  frac,
const TranslatableString msg = {} 
)
protected

Definition at line 1878 of file Effect.cpp.

1879 {
1880  auto updateResult = (mProgress ?
1881  mProgress->Update(frac, msg) :
1883  return (updateResult != ProgressResult::Success);
1884 }

References mProgress, BasicUI::Success, and ProgressDialog::Update().

Referenced by EffectNormalize::AnalyseTrackData(), EffectTruncSilence::Analyze(), EffectAutoDuck::ApplyDuckFade(), EffectTruncSilence::DoRemoval(), NyquistEffect::GetCallback(), EffectAutoDuck::Process(), EffectStereoToMono::ProcessOne(), EffectNormalize::ProcessOne(), EffectTwoPassSimpleMono::ProcessOne(), NyquistEffect::PutCallback(), and EffectLoudness::UpdateProgress().

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

◆ TrackGroupProgress()

bool Effect::TrackGroupProgress ( int  whichGroup,
double  frac,
const TranslatableString msg = {} 
)
protected

Definition at line 1894 of file Effect.cpp.

1895 {
1896  auto updateResult = (mProgress ?
1897  mProgress->Update(whichGroup + frac, (double) mNumGroups, msg) :
1899  return (updateResult != ProgressResult::Success);
1900 }

References mNumGroups, mProgress, BasicUI::Success, and ProgressDialog::Update().

Referenced by VampEffect::Process(), NyquistEffect::ProcessOne(), and ProcessTrack().

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

◆ TrackProgress()

bool Effect::TrackProgress ( int  whichTrack,
double  frac,
const TranslatableString msg = {} 
)
protected

Definition at line 1886 of file Effect.cpp.

1887 {
1888  auto updateResult = (mProgress ?
1889  mProgress->Update(whichTrack + frac, (double) mNumTracks, msg) :
1891  return (updateResult != ProgressResult::Success);
1892 }

References mNumTracks, mProgress, BasicUI::Success, and ProgressDialog::Update().

Referenced by BlockGenerator::GenerateTrack(), EffectRepeat::Process(), EffectSBSMS::Process(), VampEffect::Process(), NyquistEffect::ProcessOne(), EffectEqualization::ProcessOne(), EffectClickRemoval::ProcessOne(), EffectNoiseRemoval::ProcessOne(), EffectRepair::ProcessOne(), EffectFindClipping::ProcessOne(), EffectChangeSpeed::ProcessOne(), EffectSimpleMono::ProcessOne(), EffectPaulstretch::ProcessOne(), EffectReverse::ProcessOneClip(), and ProcessTrack().

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

◆ TransferDataFromWindow()

bool Effect::TransferDataFromWindow ( )
protectedvirtual

◆ TransferDataToWindow()

bool Effect::TransferDataToWindow ( )
protectedvirtual

Reimplemented in EffectWahwah, VampEffect, EffectTruncSilence, EffectToneGen, EffectTimeScale, EffectSilence, EffectScienFilter, EffectReverb, EffectRepeat, EffectPhaser, EffectPaulstretch, NyquistEffect, EffectNormalize, EffectNoise, EffectLoudness, EffectFindClipping, EffectEqualization, EffectEcho, EffectDtmf, EffectDistortion, EffectCompressor, EffectClickRemoval, EffectChangeSpeed, EffectBassTreble, EffectAutoDuck, and EffectAmplify.

Definition at line 1782 of file Effect.cpp.

1783 {
1784  return true;
1785 }

Referenced by SetAutomationParameters(), and EffectUIHost::TransferDataToWindow().

Here is the caller graph for this function:

◆ ValidateUI()

bool Effect::ValidateUI ( )
overridevirtual

Implements EffectUIClientInterface.

Reimplemented in EffectEqualization.

Definition at line 646 of file Effect.cpp.

647 {
648  return mUIParent->Validate();
649 }

References mUIParent.

Friends And Related Function Documentation

◆ EffectUIHost

friend class EffectUIHost
friend

Definition at line 510 of file Effect.h.

Member Data Documentation

◆ kCurrentSettingsIdent

const wxString Effect::kCurrentSettingsIdent = wxT("<Current Settings>")
static

◆ kFactoryDefaultsIdent

const wxString Effect::kFactoryDefaultsIdent = wxT("<Factory Defaults>")
static

◆ kFactoryPresetIdent

const wxString Effect::kFactoryPresetIdent = wxT("Factory Preset:")
static

◆ kUserPresetIdent

const wxString Effect::kUserPresetIdent = wxT("User Preset:")
static

◆ mBlockSize

size_t Effect::mBlockSize
private

◆ mBufferSize

size_t Effect::mBufferSize
private

Definition at line 500 of file Effect.h.

Referenced by Effect(), ProcessPass(), and ProcessTrack().

◆ mClient

EffectUIClientInterface* Effect::mClient
private

◆ mDuration

double Effect::mDuration
private

Definition at line 484 of file Effect.h.

Referenced by DoEffect(), Effect(), GetDuration(), Preview(), ProcessPass(), ProcessTrack(), and SetDuration().

◆ mDurationFormat

NumericFormatSymbol Effect::mDurationFormat
private

Definition at line 485 of file Effect.h.

Referenced by DoEffect(), and GetDurationFormat().

◆ mFactory

WaveTrackFactory* Effect::mFactory
protected

Definition at line 430 of file Effect.h.

Referenced by Delegate(), DoEffect(), and Preview().

◆ mHostUIDialog

wxWindowPtr<wxDialog> Effect::mHostUIDialog
protected

This smart pointer controls the lifetime of the dialog.

Definition at line 446 of file Effect.h.

Referenced by ShowHostInterface(), and ~Effect().

◆ mIMap

std::vector<Track*> Effect::mIMap
private

Definition at line 489 of file Effect.h.

Referenced by AddToOutputTracks(), CopyInputTracks(), and ReplaceProcessedTracks().

◆ mIsBatch

bool Effect::mIsBatch
private

Definition at line 479 of file Effect.h.

Referenced by Effect(), IsBatchProcessing(), and SetBatchProcessing().

◆ mIsLinearEffect

bool Effect::mIsLinearEffect
private

Definition at line 480 of file Effect.h.

Referenced by Effect(), Preview(), and SetLinearEffectFlag().

◆ mIsPreview

bool Effect::mIsPreview
private

Definition at line 487 of file Effect.h.

Referenced by Effect(), Preview(), and ProcessTrack().

◆ mNumAudioIn

size_t Effect::mNumAudioIn
private

Definition at line 497 of file Effect.h.

Referenced by Effect(), Process(), ProcessPass(), and Startup().

◆ mNumAudioOut

size_t Effect::mNumAudioOut
private

Definition at line 498 of file Effect.h.

Referenced by Effect(), Process(), ProcessPass(), ProcessTrack(), and Startup().

◆ mNumChannels

unsigned Effect::mNumChannels
private

Definition at line 502 of file Effect.h.

Referenced by Effect(), ProcessPass(), and ProcessTrack().

◆ mNumGroups

int Effect::mNumGroups
private

Definition at line 493 of file Effect.h.

Referenced by CountWaveTracks(), Effect(), and TrackGroupProgress().

◆ mNumTracks

int Effect::mNumTracks
private

Definition at line 492 of file Effect.h.

Referenced by CountWaveTracks(), DoEffect(), Effect(), Preview(), and TrackProgress().

◆ mOMap

std::vector<Track*> Effect::mOMap
private

Definition at line 490 of file Effect.h.

Referenced by AddToOutputTracks(), CopyInputTracks(), and ReplaceProcessedTracks().

◆ mOutputTracks

std::shared_ptr<TrackList> Effect::mOutputTracks
protected

◆ mPass

int Effect::mPass
protected

Definition at line 442 of file Effect.h.

Referenced by GetPass(), and Process().

◆ mPresetNames

wxArrayString Effect::mPresetNames
protected

Definition at line 440 of file Effect.h.

Referenced by NyquistEffect::Parse().

◆ mPresetValues

wxArrayString Effect::mPresetValues
protected

Definition at line 441 of file Effect.h.

◆ mPreviewFullSelection

bool Effect::mPreviewFullSelection
private

Definition at line 482 of file Effect.h.

Referenced by Effect(), Preview(), and SetPreviewFullSelectionFlag().

◆ mPreviewWithNotSelected

bool Effect::mPreviewWithNotSelected
private

Definition at line 481 of file Effect.h.

Referenced by Effect(), IncludeNotSelectedPreviewTracks(), and Preview().

◆ mProgress

ProgressDialog* Effect::mProgress
protected

◆ mProjectRate

double Effect::mProjectRate
protected

◆ mpSelectedRegion

wxWeakRef<NotifyingSelectedRegion> Effect::mpSelectedRegion {}
protected

Definition at line 429 of file Effect.h.

Referenced by DoEffect().

◆ mSampleCnt

sampleCount Effect::mSampleCnt
protected

Definition at line 452 of file Effect.h.

Referenced by EffectFade::ProcessBlock(), EffectToneGen::ProcessBlock(), and ProcessPass().

◆ mSampleRate

double Effect::mSampleRate
protected

◆ mT0

double Effect::mT0
protected

◆ mT1

double Effect::mT1
protected

◆ mTracks

TrackList* Effect::mTracks
private

◆ mUIDialog

wxWeakRef<wxDialog> Effect::mUIDialog
protected

◆ mUIFlags

unsigned Effect::mUIFlags
protected

Definition at line 450 of file Effect.h.

Referenced by Effect(), SetUIFlags(), and TestUIFlags().

◆ mUIParent

wxWindow* Effect::mUIParent
protected

Definition at line 449 of file Effect.h.

Referenced by CloseUI(), Effect(), EnableApply(), EnablePreview(), MessageBox(), EffectBassTreble::OnBassSlider(), EffectBassTreble::OnBassText(), EffectTruncSilence::OnControlChange(), EffectToneGen::OnControlUpdate(), EffectScienFilter::OnCutoff(), EffectPhaser::OnDepthSlider(), EffectWahwah::OnDepthSlider(), EffectPhaser::OnDepthText(), EffectWahwah::OnDepthText(), EffectPhaser::OnDryWetSlider(), EffectPhaser::OnDryWetText(), EffectPhaser::OnFeedbackSlider(), EffectPhaser::OnFeedbackText(), NyquistEffect::OnFileButton(), EffectWahwah::OnFreqOffSlider(), EffectWahwah::OnFreqOffText(), EffectPhaser::OnFreqSlider(), EffectWahwah::OnFreqSlider(), EffectPhaser::OnFreqText(), EffectWahwah::OnFreqText(), EffectBassTreble::OnGainSlider(), EffectPhaser::OnGainSlider(), EffectWahwah::OnGainSlider(), EffectBassTreble::OnGainText(), EffectPhaser::OnGainText(), EffectWahwah::OnGainText(), NyquistEffect::OnLoad(), EffectEqualization::OnManage(), EditCurvesDialog::OnOK(), EffectPhaser::OnPhaseSlider(), EffectWahwah::OnPhaseSlider(), EffectPhaser::OnPhaseText(), EffectWahwah::OnPhaseText(), EffectWahwah::OnResonanceSlider(), EffectWahwah::OnResonanceText(), EffectScienFilter::OnRipple(), NyquistEffect::OnSave(), EffectEqualization::OnSize(), EffectScienFilter::OnSize(), NyquistEffect::OnSlider(), EffectPhaser::OnStagesSlider(), EffectPhaser::OnStagesText(), EffectScienFilter::OnStopbandRipple(), NyquistEffect::OnText(), EffectPaulstretch::OnText(), EffectTimeScale::OnText_PitchHalfStepsEnd(), EffectTimeScale::OnText_PitchHalfStepsStart(), EffectTimeScale::OnText_PitchPercentChangeEnd(), EffectTimeScale::OnText_PitchPercentChangeStart(), EffectTimeScale::OnText_RatePercentChangeEnd(), EffectTimeScale::OnText_RatePercentChangeStart(), NyquistEffect::OnTime(), EffectBassTreble::OnTrebleSlider(), EffectBassTreble::OnTrebleText(), EffectEqualization::PopulateOrExchange(), PopulateUI(), NyquistEffect::Process(), NyquistEffect::TransferDataFromEffectWindow(), EffectAmplify::TransferDataFromWindow(), EffectAutoDuck::TransferDataFromWindow(), EffectBassTreble::TransferDataFromWindow(), EffectChangeSpeed::TransferDataFromWindow(), EffectClickRemoval::TransferDataFromWindow(), EffectCompressor::TransferDataFromWindow(), EffectDistortion::TransferDataFromWindow(), EffectDtmf::TransferDataFromWindow(), EffectEcho::TransferDataFromWindow(), EffectFindClipping::TransferDataFromWindow(), EffectLoudness::TransferDataFromWindow(), EffectNoise::TransferDataFromWindow(), EffectNormalize::TransferDataFromWindow(), NyquistEffect::TransferDataFromWindow(), EffectPaulstretch::TransferDataFromWindow(), EffectPhaser::TransferDataFromWindow(), EffectRepeat::TransferDataFromWindow(), EffectReverb::TransferDataFromWindow(), EffectScienFilter::TransferDataFromWindow(), EffectTimeScale::TransferDataFromWindow(), EffectToneGen::TransferDataFromWindow(), EffectTruncSilence::TransferDataFromWindow(), VampEffect::TransferDataFromWindow(), EffectWahwah::TransferDataFromWindow(), NyquistEffect::TransferDataToEffectWindow(), EffectAutoDuck::TransferDataToWindow(), EffectBassTreble::TransferDataToWindow(), EffectChangeSpeed::TransferDataToWindow(), EffectClickRemoval::TransferDataToWindow(), EffectDistortion::TransferDataToWindow(), EffectDtmf::TransferDataToWindow(), EffectEcho::TransferDataToWindow(), EffectEqualization::TransferDataToWindow(), EffectFindClipping::TransferDataToWindow(), EffectLoudness::TransferDataToWindow(), EffectNoise::TransferDataToWindow(), EffectNormalize::TransferDataToWindow(), NyquistEffect::TransferDataToWindow(), EffectPaulstretch::TransferDataToWindow(), EffectPhaser::TransferDataToWindow(), EffectScienFilter::TransferDataToWindow(), EffectTimeScale::TransferDataToWindow(), EffectToneGen::TransferDataToWindow(), EffectTruncSilence::TransferDataToWindow(), VampEffect::TransferDataToWindow(), EffectWahwah::TransferDataToWindow(), EffectScienFilter::TransferGraphLimitsFromWindow(), EffectEqualization::UpdateDraw(), EffectEqualization::UpdateGraphic(), EffectLoudness::UpdateUI(), EffectNormalize::UpdateUI(), and ValidateUI().

◆ nEffectsDone

int Effect::nEffectsDone =0
staticprotected

Definition at line 345 of file Effect.h.

Referenced by NyquistEffect::Process(), and ReplaceProcessedTracks().


The documentation for this class was generated from the following files:
size
size_t size
Definition: ffmpeg-2.3.6-single-header.h:412
Effect::mSampleCnt
sampleCount mSampleCnt
Definition: Effect.h:452
Effect::GetAutomationParameters
bool GetAutomationParameters(CommandParameters &parms) override
Definition: Effect.cpp:540
ShuttleSetAutomation
Shuttle that sets parameters to a value (from a string)
Definition: Shuttle.h:106
ViewInfo::Get
static ViewInfo & Get(AudacityProject &project)
Definition: ViewInfo.cpp:259
Effect::GetSquashedName
static CommandID GetSquashedName(wxString name)
Definition: Effect.cpp:780
CommandParameters
CommandParameters, derived from wxFileConfig, is essentially doing the same things as the Shuttle cla...
Definition: EffectAutomationParameters.h:67
Effect::DoEffect
bool DoEffect(double projectRate, TrackList *list, WaveTrackFactory *factory, NotifyingSelectedRegion &selectedRegion, wxWindow *pParent=nullptr, const EffectDialogFactory &dialogFactory={})
Definition: Effect.cpp:1073
NYQUIST_PROMPT_ID
#define NYQUIST_PROMPT_ID
Definition: PluginManager.h:335
TranslatableString::empty
bool empty() const
Definition: TranslatableString.h:72
valueRestorer
ValueRestorer< T > valueRestorer(T &var)
inline functions provide convenient parameter type deduction
Definition: MemoryX.h:354
Effect::mUIDialog
wxWeakRef< wxDialog > mUIDialog
This weak pointer may be the same as the above, or null.
Definition: Effect.h:448
Effect::mNumTracks
int mNumTracks
Definition: Effect.h:492
Effect::FindProject
const AudacityProject * FindProject() const
Definition: Effect.cpp:2133
EffectClientInterface::SetBlockSize
virtual size_t SetBlockSize(size_t maxBlockSize)=0
WaveTrack
A Track that contains audio waveform data.
Definition: WaveTrack.h:70
GuardedCall
R GuardedCall(const F1 &body, const F2 &handler=F2::Default(), std::function< void(AudacityException *)> delayedHandler=DefaultDelayedHandlerAction{})
Execute some code on any thread; catch any AudacityException; enqueue error report on the main thread...
Definition: AudacityException.h:202
EffectTypeProcess
@ EffectTypeProcess
Definition: EffectInterface.h:56
EffectClientInterface::RealtimeAddProcessor
virtual bool RealtimeAddProcessor(unsigned numChannels, float sampleRate)=0
BasicUI::ProgressResult::Success
@ Success
make_iterator_range
IteratorRange< Iterator > make_iterator_range(const Iterator &i1, const Iterator &i2)
Definition: MemoryX.h:551
Effect::mProgress
ProgressDialog * mProgress
Definition: Effect.h:425
EffectClientInterface::RealtimeInitialize
virtual bool RealtimeInitialize()=0
Effect::mClient
EffectUIClientInterface * mClient
Definition: Effect.h:496
WaveTrackViewConstants::NoDisplay
@ NoDisplay
Definition: WaveTrackViewConstants.h:40
S
#define S(N)
Definition: ToChars.cpp:64
Effect::IsInteractive
bool IsInteractive() override
Definition: Effect.cpp:204
NotifyingSelectedRegion::duration
double duration() const
Definition: ViewInfo.h:53
AudacityMessageBox
int AudacityMessageBox(const TranslatableString &message, const TranslatableString &caption, long style, wxWindow *parent, int x, int y)
Definition: AudacityMessageBox.cpp:17
ComponentInterface::GetSymbol
virtual ComponentInterfaceSymbol GetSymbol()=0
gPrefs
FileConfig * gPrefs
Definition: Prefs.cpp:70
EffectClientInterface::SetSampleRate
virtual void SetSampleRate(double rate)=0
Effect::MessageBox
int MessageBox(const TranslatableString &message, long style=DefaultMessageBoxStyle, const TranslatableString &titleStr={})
Definition: Effect.cpp:2342
ProjectAudioManager::GetAllPlaybackTracks
static TransportTracks GetAllPlaybackTracks(TrackList &trackList, bool selectedOnly, bool nonWaveToo=false)
Definition: ProjectAudioManager.cpp:1220
WaveTrack::GetEndTime
double GetEndTime() const override
Get the time at which the last clip in the track ends, plus recorded stuff.
Definition: WaveTrack.cpp:2013
BasicUI::ShowErrorDialog
void ShowErrorDialog(const WindowPlacement &placement, const TranslatableString &dlogTitle, const TranslatableString &message, const ManualPageID &helpPage, const ErrorDialogOptions &options={})
Show an error dialog with a link to the manual for further help.
Definition: BasicUI.h:233
Effect::TransferDataToWindow
virtual bool TransferDataToWindow()
Definition: Effect.cpp:1782
Effect::mDuration
double mDuration
Definition: Effect.h:484
Effect::CopyInputTracks
void CopyInputTracks(bool allSyncLockSelected=false)
Definition: Effect.cpp:1932
Effect::SupportsRealtime
bool SupportsRealtime() override
Definition: Effect.cpp:234
ident
static CommandHandlerObject & ident(AudacityProject &project)
Definition: ModNullCallback.cpp:65
ChannelNameFrontRight
@ ChannelNameFrontRight
Definition: EffectInterface.h:128
EffectTypeGenerate
@ EffectTypeGenerate
Definition: EffectInterface.h:55
SelectFile
FilePath SelectFile(FileNames::Operation op, const TranslatableString &message, const FilePath &default_path, const FilePath &default_filename, const FileExtension &default_extension, const FileTypes &fileTypes, int flags, wxWindow *parent)
Definition: SelectFile.cpp:17
EffectClientInterface::RealtimeFinalize
virtual bool RealtimeFinalize()=0
RegistryPaths
std::vector< RegistryPath > RegistryPaths
Definition: Identifier.h:219
pdlgHideStopButton
@ pdlgHideStopButton
Definition: ProgressDialog.h:38
TrackList::Channels
static auto Channels(TrackType *pTrack) -> TrackIterRange< TrackType >
Definition: Track.h:1505
EffectClientInterface::ProcessFinalize
virtual bool ProcessFinalize()=0
Format
Abstract base class used in importing a file.
TrackList
A flat linked list of tracks supporting Add, Remove, Clear, and Contains, serialization of the list o...
Definition: Track.h:1310
Effect::GetAudioInCount
unsigned GetAudioInCount() override
Definition: Effect.cpp:266
EffectClientInterface::RealtimeProcessEnd
virtual bool RealtimeProcessEnd()=0
Effect::mT1
double mT1
Definition: Effect.h:435
ArrayOf::reinit
void reinit(Integral count, bool initialize=false)
Definition: MemoryX.h:57
Effect::LoadUserPreset
bool LoadUserPreset(const RegistryPath &name) override
Definition: Effect.cpp:560
BUILTIN_EFFECT_PREFIX
#define BUILTIN_EFFECT_PREFIX
Definition: Effect.h:45
EffectTypeNone
@ EffectTypeNone
Definition: EffectInterface.h:53
EffectDefinitionInterface::IsInteractive
virtual bool IsInteractive()=0
Effect::mDurationFormat
NumericFormatSymbol mDurationFormat
Definition: Effect.h:485
DefaultPlayOptions
AudioIOStartStreamOptions DefaultPlayOptions(AudacityProject &project, bool newDefault)
Definition: ProjectAudioManager.cpp:1178
XO
#define XO(s)
Definition: Internat.h:31
Effect::EnablePreview
virtual bool EnablePreview(bool enable=true)
Definition: Effect.cpp:1823
ProjectFileIO::Get
static ProjectFileIO & Get(AudacityProject &project)
Definition: ProjectFileIO.cpp:479
Effect::SetAutomationParameters
bool SetAutomationParameters(CommandParameters &parms) override
Definition: Effect.cpp:550
Effect::mTracks
TrackList * mTracks
Definition: Effect.h:477
Effect::ProcessFinalize
bool ProcessFinalize() override
Definition: Effect.cpp:378
ProjectSettings::Get
static ProjectSettings & Get(AudacityProject &project)
Definition: ProjectSettings.cpp:45
TrackList::Add
TrackKind * Add(const std::shared_ptr< TrackKind > &t)
Definition: Track.h:1524
Effect::mNumAudioIn
size_t mNumAudioIn
Definition: Effect.h:497
CommandParameters::GetParameters
bool GetParameters(wxString &parms)
Definition: EffectAutomationParameters.h:258
NYQUISTEFFECTS_FAMILY
#define NYQUISTEFFECTS_FAMILY
Definition: Effect.h:64
Effect::IsBatchProcessing
virtual bool IsBatchProcessing()
Definition: Effect.cpp:1054
Effect::mPass
int mPass
Definition: Effect.h:442
ChannelNameFrontLeft
@ ChannelNameFrontLeft
Definition: EffectInterface.h:127
SelectedRegion::UndefinedFrequency
static const int UndefinedFrequency
Definition: SelectedRegion.h:44
EffectClientInterface::ProcessBlock
virtual size_t ProcessBlock(float **inBlock, float **outBlock, size_t blockLen)=0
Effect::SetHost
bool SetHost(EffectHostInterface *host) override
Definition: Effect.cpp:256
ChannelNameEOL
@ ChannelNameEOL
Definition: EffectInterface.h:123
ChannelName
ChannelName
Definition: EffectInterface.h:121
Effect::GetUserPresetsGroup
RegistryPath GetUserPresetsGroup(const RegistryPath &name) override
Definition: Effect.cpp:865
EffectDefinitionInterface::SupportsRealtime
virtual bool SupportsRealtime()=0
Effect::mPreviewFullSelection
bool mPreviewFullSelection
Definition: Effect.h:482
PluginSettings::GetConfigSubgroups
bool GetConfigSubgroups(EffectDefinitionInterface &ident, PluginSettings::ConfigurationType type, const RegistryPath &group, RegistryPaths &subgroups)
Definition: ConfigInterface.cpp:23
Effect::InitPass2
virtual bool InitPass2()
Definition: Effect.cpp:1232
EffectClientInterface::GetFactoryPresets
virtual RegistryPaths GetFactoryPresets()=0
EffectDefinitionInterface::SupportsAutomation
virtual bool SupportsAutomation()=0
Effect::DefaultMessageBoxStyle
@ DefaultMessageBoxStyle
Definition: Effect.h:244
WaveTrack::ClearAndPaste
void ClearAndPaste(double t0, double t1, const Track *src, bool preserve=true, bool merge=true, const TimeWarper *effectWarper=NULL)
Definition: WaveTrack.cpp:904
Effect::SaveUserPreset
bool SaveUserPreset(const RegistryPath &name) override
Definition: Effect.cpp:577
PluginSettings::SetConfig
bool SetConfig(EffectDefinitionInterface &ident, ConfigurationType type, const RegistryPath &group, const RegistryPath &key, const Value &value)
Definition: ConfigInterface.h:97
PresetTypes
static const FileNames::FileTypes & PresetTypes()
Definition: Effect.cpp:672
TrackList::SelectedLeaders
auto SelectedLeaders() -> TrackIterRange< TrackType >
Definition: Track.h:1452
Effect::TransferDataFromWindow
virtual bool TransferDataFromWindow()
Definition: Effect.cpp:1787
t2bHash
std::unordered_map< void *, bool > t2bHash
Definition: Effect.cpp:65
WaveTrack::EmptyCopy
Holder EmptyCopy(const SampleBlockFactoryPtr &pFactory={}) const
Definition: WaveTrack.cpp:696
Effect::mFactory
WaveTrackFactory * mFactory
Definition: Effect.h:430
NotifyingSelectedRegion::t1
double t1() const
Definition: ViewInfo.h:48
wxWidgetsWindowPlacement
Window placement information for wxWidgetsBasicUI can be constructed from a wxWindow pointer.
Definition: wxWidgetsWindowPlacement.h:22
Effect::ProcessPass
virtual bool ProcessPass()
Definition: Effect.cpp:1263
ComponentInterface::GetVendor
virtual VendorSymbol GetVendor()=0
Effect::mIsBatch
bool mIsBatch
Definition: Effect.h:479
NotifyingSelectedRegion::setTimes
bool setTimes(double t0, double t1)
Definition: ViewInfo.cpp:63
WaveTrack::Set
void Set(constSamplePtr buffer, sampleFormat format, sampleCount start, size_t len)
Definition: WaveTrack.cpp:2193
floatSample
@ floatSample
Definition: SampleFormat.h:34
NumericConverter::TimeAndSampleFormat
static NumericFormatSymbol TimeAndSampleFormat()
Definition: NumericTextCtrl.cpp:692
ArraysOf::reinit
void reinit(Integral count)
Definition: MemoryX.h:109
WaveTrack::Holder
std::shared_ptr< WaveTrack > Holder
Definition: WaveTrack.h:99
Effect::End
virtual void End()
Definition: Effect.cpp:1773
Effect::GetAudioOutCount
unsigned GetAudioOutCount() override
Definition: Effect.cpp:276
Effect::SetSampleRate
void SetSampleRate(double rate) override
Definition: Effect.cpp:306
Effect::ProcessBlock
size_t ProcessBlock(float **inBlock, float **outBlock, size_t blockLen) override
Definition: Effect.cpp:388
Effect::mProjectRate
double mProjectRate
Definition: Effect.h:426
Effect::mBufferSize
size_t mBufferSize
Definition: Effect.h:500
AudacityException
Base class for exceptions specially processed by the application.
Definition: AudacityException.h:33
EffectClientInterface::RealtimeSuspend
virtual bool RealtimeSuspend()=0
EffectClientInterface::GetAudioOutCount
virtual unsigned GetAudioOutCount()=0
EffectClientInterface::GetMidiOutCount
virtual int GetMidiOutCount()=0
ViewInfo::selectedRegion
NotifyingSelectedRegion selectedRegion
Definition: ViewInfo.h:238
Effect::inputTracks
const TrackList * inputTracks() const
Definition: Effect.h:431
Effect::PopulateOrExchange
virtual void PopulateOrExchange(ShuttleGui &S)
Definition: Effect.cpp:1777
EffectClientInterface::SetAutomationParameters
virtual bool SetAutomationParameters(CommandParameters &parms)=0
Effect::mT0
double mT0
Definition: Effect.h:434
factory
static RegisteredToolbarFactory factory
Definition: ControlToolBar.cpp:820
Track::Offset
void Offset(double t)
Definition: Track.h:441
anonymous_namespace{Effect.cpp}::GetVetoDialogHook
Effect::VetoDialogHook & GetVetoDialogHook()
Definition: Effect.cpp:69
ArraysOf< float >
Effect::mHostUIDialog
wxWindowPtr< wxDialog > mHostUIDialog
This smart pointer controls the lifetime of the dialog.
Definition: Effect.h:446
EffectClientInterface::LoadFactoryDefaults
virtual bool LoadFactoryDefaults()=0
ShuttleGetAutomation
Shuttle that gets parameter values into a string.
Definition: Shuttle.h:88
Effect::mpSelectedRegion
wxWeakRef< NotifyingSelectedRegion > mpSelectedRegion
Definition: Effect.h:429
Effect::mIsLinearEffect
bool mIsLinearEffect
Definition: Effect.h:480
SyncLock::IsSyncLockSelected
static bool IsSyncLockSelected(const Track *pTrack)
Definition: SyncLock.cpp:43
Effect::GetFactoryPresets
RegistryPaths GetFactoryPresets() override
Definition: Effect.cpp:594
ComponentInterface::GetPath
virtual PluginPath GetPath()=0
EffectClientInterface::GetMidiInCount
virtual int GetMidiInCount()=0
EffectClientInterface::LoadFactoryPreset
virtual bool LoadFactoryPreset(int id)=0
Effect::GetLatency
sampleCount GetLatency() override
Definition: Effect.cpp:338
Effect::GetDefaultDuration
double GetDefaultDuration() override
Definition: Effect.cpp:820
TrackList::MakeMultiChannelTrack
bool MakeMultiChannelTrack(Track &first, int nChannels, bool aligned)
Converts channels to a multichannel track.
Definition: Track.cpp:624
Effect::GetType
EffectType GetType() override
Definition: Effect.cpp:132
EffectClientInterface::GetTailSize
virtual size_t GetTailSize()=0
Effect::CheckWhetherSkipEffect
virtual bool CheckWhetherSkipEffect()
Definition: Effect.h:269
Effect::kCurrentSettingsIdent
static const wxString kCurrentSettingsIdent
Definition: Effect.h:507
Effect::ReplaceProcessedTracks
void ReplaceProcessedTracks(const bool bGoodResult)
Definition: Effect.cpp:2054
name
const TranslatableString name
Definition: Distortion.cpp:98
PluginSettings::GetConfig
bool GetConfig(EffectDefinitionInterface &ident, ConfigurationType type, const RegistryPath &group, const RegistryPath &key, Value &var, const Value &defval)
Definition: ConfigInterface.h:70
kPlayID
static const int kPlayID
Definition: Effect.cpp:56
Track::Fallthrough
Continuation<> Fallthrough
Type of arguments passed as optional second parameter to TypeSwitch<void>() cases.
Definition: Track.h:499
Track::RightChannel
@ RightChannel
Definition: Track.h:262
QualitySettings::DefaultSampleRate
PROJECT_RATE_API IntSetting DefaultSampleRate
Definition: QualitySettings.cpp:15
Effect::mNumAudioOut
size_t mNumAudioOut
Definition: Effect.h:498
track_cast
std::enable_if_t< std::is_pointer_v< T >, T > track_cast(Track *track)
Encapsulate the checked down-casting of track pointers.
Definition: Track.h:917
ProjectSettings::GetSelectionFormat
const NumericFormatSymbol & GetSelectionFormat() const
Definition: ProjectSettings.cpp:148
SyncLock::IsSelectedOrSyncLockSelected
static bool IsSelectedOrSyncLockSelected(const Track *pTrack)
Definition: SyncLock.cpp:73
Effect::kUserPresetIdent
static const wxString kUserPresetIdent
Definition: Effect.h:505
Effect::InitPass1
virtual bool InitPass1()
Definition: Effect.cpp:1227
TransactionScope
RAII for a database transaction, possibly nested.
Definition: DBConnection.h:137
Effect::GetSymbol
ComponentInterfaceSymbol GetSymbol() override
Definition: Effect.cpp:152
EffectDefinitionInterface::GetType
virtual EffectType GetType()=0
Effect::mUIFlags
unsigned mUIFlags
Definition: Effect.h:450
Effect::CalcPreviewInputLength
virtual double CalcPreviewInputLength(double previewLength)
Definition: Effect.cpp:2146
WaveTrack::GetStartTime
double GetStartTime() const override
Get the time at which the first clip in the track starts.
Definition: WaveTrack.cpp:1993
EffectClientInterface::ProcessInitialize
virtual bool ProcessInitialize(sampleCount totalLen, ChannelNames chanMap=NULL)=0
NumericConverter::HoursMinsSecondsFormat
static NumericFormatSymbol HoursMinsSecondsFormat()
Definition: NumericTextCtrl.cpp:696
Effect::mNumChannels
unsigned mNumChannels
Definition: Effect.h:502
ComponentInterface::GetDescription
virtual TranslatableString GetDescription()=0
Setting::ReadWithDefault
bool ReadWithDefault(T *pVar, const T &defaultValue) const
overload of ReadWithDefault returning a boolean that is true if the value was previously defined *‍/
Definition: Prefs.h:134
Effect::GetFactoryDefaultsGroup
RegistryPath GetFactoryDefaultsGroup() override
Definition: Effect.cpp:881
Effect::mOutputTracks
std::shared_ptr< TrackList > mOutputTracks
Definition: Effect.h:433
BasicUI::ErrorDialogOptions
Options for variations of error dialogs; the default is for modal dialogs.
Definition: BasicUI.h:49
NotifyingSelectedRegion::f0
double f0() const
Definition: ViewInfo.h:49
Effect::GetCurrentSettingsGroup
RegistryPath GetCurrentSettingsGroup() override
Definition: Effect.cpp:876
RegistryPath
wxString RegistryPath
Definition: Identifier.h:218
kFFwdID
static const int kFFwdID
Definition: Effect.cpp:58
Track::GetSelected
bool GetSelected() const
Definition: Track.h:428
Identifier::GET
const wxString & GET() const
Explicit conversion to wxString, meant to be ugly-looking and demanding of a comment why it's correct...
Definition: Identifier.h:66
Effect::mBlockSize
size_t mBlockSize
Definition: Effect.h:501
samplePtr
char * samplePtr
Definition: SampleFormat.h:49
EffectClientInterface::GetLatency
virtual sampleCount GetLatency()=0
Effect::Init
virtual bool Init()
Definition: Effect.cpp:1217
Effect::SetDuration
void SetDuration(double duration) override
Definition: Effect.cpp:847
TrackList::GetOwner
AudacityProject * GetOwner()
Definition: Track.h:1345
PluginSettings::HasConfigGroup
bool HasConfigGroup(EffectDefinitionInterface &ident, PluginSettings::ConfigurationType type, const RegistryPath &group)
Definition: ConfigInterface.cpp:14
id
int id
Definition: WaveTrackControls.cpp:577
WaveTrack::GetMaxBlockSize
size_t GetMaxBlockSize() const
Definition: WaveTrack.cpp:1800
min
int min(int a, int b)
Definition: CompareAudioCommand.cpp:106
NotifyingSelectedRegion::f1
double f1() const
Definition: ViewInfo.h:50
Effect::mIsPreview
bool mIsPreview
Definition: Effect.h:487
Effect::mSampleRate
double mSampleRate
Definition: Effect.h:428
EffectClientInterface::LoadUserPreset
virtual bool LoadUserPreset(const RegistryPath &name)=0
MixAndRender
void MixAndRender(TrackList *tracks, WaveTrackFactory *trackFactory, double rate, sampleFormat format, double startTime, double endTime, WaveTrack::Holder &uLeft, WaveTrack::Holder &uRight)
Mixes together all input tracks, applying any envelopes, amplitude gain, panning, and real-time effec...
Definition: Mix.cpp:43
Effect::mOMap
std::vector< Track * > mOMap
Definition: Effect.h:490
NumericConverter
NumericConverter provides the advanced formatting control used in the selection bar of Audacity.
Definition: NumericTextCtrl.h:48
BasicUI
Definition: Export.h:39
title
static const auto title
Definition: NoUpdatesAvailableDialog.cpp:22
Effect::GetFamily
EffectFamilySymbol GetFamily() override
Definition: Effect.cpp:192
WaveTrack::TimeToLongSamples
sampleCount TimeToLongSamples(double t0) const
Convert correctly between an (absolute) time in seconds and a number of samples.
Definition: WaveTrack.cpp:1983
EffectClientInterface::IsReady
virtual bool IsReady()=0
Effect::SetPresetParameters
void SetPresetParameters(const wxArrayString *Names, const wxArrayString *Values)
Definition: Effect.h:221
Track
Abstract base class for an object holding data associated with points on a time axis.
Definition: Track.h:224
Effect::mUIParent
wxWindow * mUIParent
Definition: Effect.h:449
Effect::CountWaveTracks
void CountWaveTracks()
Definition: Effect.cpp:2140
Effect::ProcessInitialize
bool ProcessInitialize(sampleCount totalLen, ChannelNames chanMap=NULL) override
Definition: Effect.cpp:368
sampleCount
Positions or offsets within audio files need a wide type.
Definition: SampleCount.h:18
Effect::mNumGroups
int mNumGroups
Definition: Effect.h:493
BasicUI::ProgressDialog
Abstraction of a progress dialog with well defined time-to-completion estimate.
Definition: BasicUI.h:154
Effect::GetPath
PluginPath GetPath() override
Definition: Effect.cpp:142
kRewindID
static const int kRewindID
Definition: Effect.cpp:57
AudacityProject
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
Definition: Project.h:92
Effect::GetBounds
void GetBounds(const WaveTrack &track, const WaveTrack *pRight, sampleCount *start, sampleCount *len)
Definition: Effect.cpp:1902
TrackList::Replace
ListOfTracks::value_type Replace(Track *t, const ListOfTracks::value_type &with)
Definition: Track.cpp:586
WaveTrackView::Get
static WaveTrackView & Get(WaveTrack &track)
Definition: WaveTrackView.cpp:858
EffectClientInterface::GetAudioInCount
virtual unsigned GetAudioInCount()=0
Effect::ProcessTrack
bool ProcessTrack(int count, ChannelNames map, WaveTrack *left, WaveTrack *right, sampleCount start, sampleCount len, FloatBuffers &inBuffer, FloatBuffers &outBuffer, ArrayOf< float * > &inBufPos, ArrayOf< float * > &outBufPos)
Definition: Effect.cpp:1411
ComponentInterfaceSymbol::Internal
const wxString & Internal() const
Definition: ComponentInterfaceSymbol.h:55
Effect::nEffectsDone
static int nEffectsDone
Definition: Effect.h:345
EffectUIClientInterface::SetHost
virtual bool SetHost(EffectHostInterface *host)=0
EffectClientInterface::GetBlockSize
virtual size_t GetBlockSize() const =0
ExceptionType::Internal
@ Internal
Indicates internal failure from Audacity.
TrackList::Create
static std::shared_ptr< TrackList > Create(AudacityProject *pOwner)
Definition: Track.cpp:400
EffectClientInterface::RealtimeProcess
virtual size_t RealtimeProcess(int group, float **inBuf, float **outBuf, size_t numSamples)=0
Effect::GetDefinition
EffectDefinitionInterface & GetDefinition() override
Definition: Effect.cpp:815
Effect::mPresetNames
wxArrayString mPresetNames
Definition: Effect.h:440
NotifyingSelectedRegion::t0
double t0() const
Definition: ViewInfo.h:47
params
EffectDistortion::Params params
Definition: Distortion.cpp:99
Effect::GetSavedStateGroup
virtual wxString GetSavedStateGroup()
Definition: Effect.cpp:886
Effect::kFactoryDefaultsIdent
static const wxString kFactoryDefaultsIdent
Definition: Effect.h:508
TrackList::Any
auto Any() -> TrackIterRange< TrackType >
Definition: Track.h:1401
Effect::Startup
virtual bool Startup()
Definition: Effect.cpp:923
TrackList::Remove
TrackNodePointer Remove(Track *t)
Remove the Track and return an iterator to what followed it.
Definition: Track.cpp:660
EffectClientInterface::GetAutomationParameters
virtual bool GetAutomationParameters(CommandParameters &parms)=0
ComponentInterface::GetName
TranslatableString GetName()
Definition: PluginManager.cpp:1835
ChannelNameMono
@ ChannelNameMono
Definition: EffectInterface.h:125
Effect::ShowHostInterface
int ShowHostInterface(wxWindow &parent, const EffectDialogFactory &factory, bool forceModal=false) override
Definition: Effect.cpp:503
EffectClientInterface::RealtimeResume
virtual bool RealtimeResume()=0
ComponentInterface::GetVersion
virtual wxString GetVersion()=0
AudioIO::Get
static AudioIO * Get()
Definition: AudioIO.cpp:141
EffectClientInterface::RealtimeProcessStart
virtual bool RealtimeProcessStart()=0
safenew
#define safenew
Definition: MemoryX.h:10
QUANTIZED_TIME
#define QUANTIZED_TIME(time, rate)
Definition: MemoryX.h:628
Effect::kFactoryPresetIdent
static const wxString kFactoryPresetIdent
Definition: Effect.h:506
WaveTrackView::SetDisplay
void SetDisplay(Display display, bool exclusive=true)
Definition: WaveTrackView.cpp:987
limitSampleBufferSize
size_t limitSampleBufferSize(size_t bufferSize, sampleCount limit)
Definition: SampleCount.cpp:23
ComponentInterface::DefineParams
virtual bool DefineParams(ShuttleParams &WXUNUSED(S))
Definition: ComponentInterface.h:85
EffectDefinitionInterface::GetFamily
virtual EffectFamilySymbol GetFamily()=0
Effect::TrackGroupProgress
bool TrackGroupProgress(int whichGroup, double frac, const TranslatableString &={})
Definition: Effect.cpp:1894
PasteTimeWarper
Unit slope but with either a jump (pasting more) or a flat interval (pasting less)
Definition: TimeWarper.h:181
Effect::SetBlockSize
size_t SetBlockSize(size_t maxBlockSize) override
Definition: Effect.cpp:316
WaveTrack::GetFloats
bool GetFloats(float *buffer, sampleCount start, size_t len, fillFormat fill=fillZero, bool mayThrow=true, sampleCount *pNumWithinClips=nullptr) const
Retrieve samples from a track in floating-point format, regardless of the storage format.
Definition: WaveTrack.h:269
Effect::mPresetValues
wxArrayString mPresetValues
Definition: Effect.h:441
Track::LeftChannel
@ LeftChannel
Definition: Track.h:261
Effect::mIMap
std::vector< Track * > mIMap
Definition: Effect.h:489
TrackList::Selected
auto Selected() -> TrackIterRange< TrackType >
Definition: Track.h:1418
WaveTrackFactory::NewWaveTrack
std::shared_ptr< WaveTrack > NewWaveTrack(sampleFormat format=(sampleFormat) 0, double rate=0)
Definition: WaveTrack.cpp:113
Effect::TrackProgress
bool TrackProgress(int whichTrack, double frac, const TranslatableString &={})
Definition: Effect.cpp:1886
ArrayOf
Memory.h template class for making an array of float, bool, etc.
Definition: MemoryX.h:27
Effect::Process
virtual bool Process()
Definition: Effect.cpp:1237
Effect::mPreviewWithNotSelected
bool mPreviewWithNotSelected
Definition: Effect.h:481
pdlgHideCancelButton
@ pdlgHideCancelButton
Definition: ProgressDialog.h:39
EffectClientInterface::SaveUserPreset
virtual bool SaveUserPreset(const RegistryPath &name)=0
PluginSettings::Private
@ Private
Definition: PluginInterface.h:56
EffectDefinitionInterface::IsDefault
virtual bool IsDefault()=0
Effect::LoadFactoryPreset
bool LoadFactoryPreset(int id) override
Definition: Effect.cpp:604
NotifyingSelectedRegion
Definition: ViewInfo.h:44
WaveTrack::GetRate
double GetRate() const
Definition: WaveTrack.cpp:482