Audacity  3.2.0
Effect.h
Go to the documentation of this file.
1 /**********************************************************************
2 
3  Audacity: A Digital Audio Editor
4 
5  Effect.h
6 
7  Dominic Mazzoni
8  Vaughan Johnson
9 
10 **********************************************************************/
11 
12 #ifndef __AUDACITY_EFFECT__
13 #define __AUDACITY_EFFECT__
14 
15 
16 
17 #include <functional>
18 #include <set>
19 
20 #include <wx/defs.h>
21 
22 class wxButton;
23 class wxCheckBox;
24 class wxChoice;
25 class wxListBox;
26 class wxWindow;
27 
28 #include "ConfigInterface.h"
29 #include "EffectHostInterface.h" // to inherit
30 #include "EffectInterface.h" // to inherit
31 #include "PluginInterface.h"
32 
33 #include "SampleCount.h"
34 #include "SelectedRegion.h"
35 
36 #include "Track.h"
37 
38 #include "../widgets/wxPanelWrapper.h" // to inherit
39 #include <wx/windowptr.h>
40 
41 class wxArrayString;
42 class ShuttleGui;
43 class AudacityCommand;
44 
45 #define BUILTIN_EFFECT_PREFIX wxT("Built-in Effect: ")
46 
47 namespace BasicUI { class ProgressDialog; }
48 
49 class AudacityProject;
50 class LabelTrack;
52 class SelectedRegion;
53 class EffectUIHost;
54 class Track;
55 class TrackList;
56 class WaveTrackFactory;
57 class WaveTrack;
58 
60 
61 /* i18n-hint: "Nyquist" is an embedded interpreted programming language in
62  Audacity, named in honor of the Swedish-American Harry Nyquist (or Nyqvist).
63  In the translations of this and other strings, you may transliterate the
64  name into another alphabet. */
65 #define NYQUISTEFFECTS_FAMILY ( EffectFamilySymbol{ XO("Nyquist") } )
66 
67 #define NYQUIST_WORKER_ID wxT("Nyquist Worker")
68 
69 // TODO: Apr-06-2015
70 // TODO: Much more cleanup of old methods and variables is needed, but
71 // TODO: can't be done until after all effects are using the NEW API.
72 
74 class AUDACITY_DLL_API Effect /* not final */ : public wxEvtHandler,
77 {
78  //
79  // public methods
80  //
81  // Used by the outside program to determine properties of an effect and
82  // apply the effect to one or more tracks.
83  //
84  public:
85  // The constructor is called once by each subclass at the beginning of the program.
86  // Avoid allocating memory or doing time-consuming processing here.
87  Effect();
88  virtual ~Effect();
89 
90  // ComponentInterface implementation
91 
92  PluginPath GetPath() override;
93 
95 
96  VendorSymbol GetVendor() override;
97  wxString GetVersion() override;
99 
100  // EffectDefinitionInterface implementation
101 
102  EffectType GetType() override;
103  EffectFamilySymbol GetFamily() override;
104  bool IsInteractive() override;
105  bool IsDefault() override;
106  bool IsLegacy() override;
107  bool SupportsRealtime() override;
108  bool SupportsAutomation() override;
109 
110  bool GetAutomationParameters(CommandParameters & parms) override;
111  bool SetAutomationParameters(CommandParameters & parms) override;
112 
113  bool LoadUserPreset(const RegistryPath & name) override;
114  bool SaveUserPreset(const RegistryPath & name) override;
115 
116  RegistryPaths GetFactoryPresets() override;
117  bool LoadFactoryPreset(int id) override;
118  bool LoadFactoryDefaults() override;
119 
120  // EffectProcessor implementation
121 
122  bool SetHost(EffectHostInterface *host) override;
123 
124  unsigned GetAudioInCount() override;
125  unsigned GetAudioOutCount() override;
126 
127  int GetMidiInCount() override;
128  int GetMidiOutCount() override;
129 
130  sampleCount GetLatency() override;
131  size_t GetTailSize() override;
132 
133  void SetSampleRate(double rate) override;
134  size_t SetBlockSize(size_t maxBlockSize) override;
135  size_t GetBlockSize() const override;
136 
137  bool ProcessInitialize(sampleCount totalLen, ChannelNames chanMap = NULL) override;
138  bool ProcessFinalize() override;
139  size_t ProcessBlock(float **inBlock, float **outBlock, size_t blockLen) override;
140 
141  bool RealtimeInitialize() override;
142  bool RealtimeAddProcessor(unsigned numChannels, float sampleRate) override;
143  bool RealtimeFinalize() override;
144  bool RealtimeSuspend() override;
145  bool RealtimeResume() noexcept override;
146  bool RealtimeProcessStart() override;
147  size_t RealtimeProcess(int group,
148  float **inbuf,
149  float **outbuf,
150  size_t numSamples) override;
151  bool RealtimeProcessEnd() noexcept override;
152 
154  wxWindow &parent, wxDialog &dialog, bool forceModal = false) override;
155 
156 
157  // EffectUIClientInterface implementation
158 
159  bool PopulateUI(ShuttleGui &S) final;
160  bool IsGraphicalUI() override;
161  bool ValidateUI() override;
162  bool HideUI() override;
163  bool CloseUI() override;
164 
165  bool CanExportPresets() override;
166  void ExportPresets() override;
167  void ImportPresets() override;
168 
169  bool HasOptions() override;
170  void ShowOptions() override;
171 
172  // EffectHostInterface implementation
173 
175  double GetDuration() override;
177  virtual NumericFormatSymbol GetSelectionFormat() /* not override? */; // time format in Selection toolbar
178  void SetDuration(double duration) override;
179 
183 
184  virtual wxString GetSavedStateGroup() /* not override? */;
185 
186  // EffectUIHostInterface implementation
187 
188  int ShowHostInterface( wxWindow &parent,
189  const EffectDialogFactory &factory, bool forceModal = false) override;
190 
191  // Effect implementation
192 
193  unsigned TestUIFlags(unsigned mask);
194 
195  void SetPresetParameters( const wxArrayString * Names, const wxArrayString * Values ) {
196  if( Names ) mPresetNames = *Names;
197  if( Values ) mPresetValues = *Values;
198  }
199 
200  // NEW virtuals
201  virtual bool Startup(EffectUIClientInterface *client);
202 
203  virtual bool GetAutomationParametersAsString(wxString & parms);
204  virtual bool SetAutomationParametersFromString(const wxString & parms);
205 
206  virtual bool IsBatchProcessing();
207  virtual void SetBatchProcessing(bool start);
208 
209  // Returns true on success. Will only operate on tracks that
210  // have the "selected" flag set to true, which is consistent with
211  // Audacity's standard UI.
212  // Create a user interface only if the supplied function is not null.
213  /* not virtual */ bool DoEffect( double projectRate, TrackList *list,
215  // Prompt the user for input only if these arguments are both not null.
216  unsigned flags,
217  wxWindow *pParent = nullptr,
218  const EffectDialogFactory &dialogFactory = {} );
219 
220  bool Delegate( Effect &delegate,
221  wxWindow &parent, const EffectDialogFactory &factory );
222 
223  // Display a message box, using effect's (translated) name as the prefix
224  // for the title.
225  enum : long { DefaultMessageBoxStyle = wxOK | wxCENTRE };
226  int MessageBox(const TranslatableString& message,
227  long style = DefaultMessageBoxStyle,
228  const TranslatableString& titleStr = {});
229 
230  static void IncEffectCounter(){ nEffectsDone++;};
231 
232  protected:
233  bool EnableApply(bool enable = true);
234  bool EnablePreview(bool enable = true);
235 
236  public:
237  // NEW virtuals
238  virtual bool Startup();
239 
240 //
241 // protected virtual methods
242 //
243 // Each subclass of Effect overrides one or more of these methods to
244 // do its processing.
245 //
246 protected:
247 
248  // Called once each time an effect is called. Perform any initialization;
249  // make sure that the effect can be performed on the selected tracks and
250  // return false otherwise
251  virtual bool Init();
252 
253  // Check whether effect should be skipped
254  // Typically this is only useful in automation, for example
255  // detecting that zero noise reduction is to be done,
256  // or that normalisation is being done without Dc bias shift
257  // or amplitude modification
258  virtual bool CheckWhetherSkipEffect() { return false; }
259 
260  // Actually do the effect here.
265  virtual bool Process();
266  virtual bool ProcessPass();
267  virtual bool InitPass1();
268  virtual bool InitPass2();
269 
270  // clean up any temporary memory, needed only per invocation of the
271  // effect, after either successful or failed or exception-aborted processing.
272  // Invoked inside a "finally" block so it must be no-throw.
273  virtual void End();
274 
275  // Most effects just use the previewLength, but time-stretching/compressing
276  // effects need to use a different input length, so override this method.
277  virtual double CalcPreviewInputLength(double previewLength);
278 
279  // The Effect class fully implements the Preview method for you.
280  // Only override it if you need to do preprocessing or cleanup.
281  virtual void Preview(bool dryOnly);
282 
283  virtual void PopulateOrExchange(ShuttleGui & S);
284  virtual bool TransferDataToWindow() /* not override */;
285  virtual bool TransferDataFromWindow() /* not override */;
286 
287  // No more virtuals!
288 
289  // The Progress methods all return true if the user has cancelled;
290  // you should exit immediately if this happens (cleaning up memory
291  // is okay, but don't try to undo).
292 
293  // Pass a fraction between 0.0 and 1.0
294  bool TotalProgress(double frac, const TranslatableString & = {});
295 
296  // Pass a fraction between 0.0 and 1.0, for the current track
297  // (when doing one track at a time)
298  bool TrackProgress(int whichTrack, double frac, const TranslatableString & = {});
299 
300  // Pass a fraction between 0.0 and 1.0, for the current track group
301  // (when doing stereo groups at a time)
302  bool TrackGroupProgress(int whichGroup, double frac, const TranslatableString & = {});
303 
304  int GetNumWaveTracks() { return mNumTracks; }
305  int GetNumWaveGroups() { return mNumGroups; }
306 
307  // Calculates the start time and length in samples for one or two channels
308  void GetBounds(
309  const WaveTrack &track, const WaveTrack *pRight,
310  sampleCount *start, sampleCount *len);
311 
312  // Previewing linear effect can be optimised by pre-mixing. However this
313  // should not be used for non-linear effects such as dynamic processors
314  // To allow pre-mixing before Preview, set linearEffectFlag to true.
315  void SetLinearEffectFlag(bool linearEffectFlag);
316 
317  // Most effects only need to preview a short selection. However some
318  // (such as fade effects) need to know the full selection length.
319  void SetPreviewFullSelectionFlag(bool previewDurationFlag);
320 
321  // Use this if the effect needs to know if it is previewing
322  bool IsPreviewing() { return mIsPreview; }
323 
324  // Most effects only require selected tracks to be copied for Preview.
325  // If IncludeNotSelectedPreviewTracks(true), then non-linear effects have
326  // preview copies of all wave tracks.
327  void IncludeNotSelectedPreviewTracks(bool includeNotSelected);
328 
329  // Use this method to copy the input tracks to mOutputTracks, if
330  // doing the processing on them, and replacing the originals only on success (and not cancel).
331  // If not all sync-locked selected, then only selected wave tracks.
332  void CopyInputTracks(bool allSyncLockSelected = false);
333 
334  // A global counter of all the successful Effect invocations.
335  static int nEffectsDone;
336 
337  // For the use of analyzers, which don't need to make output wave tracks,
338  // but may need to add label tracks.
339  class AUDACITY_DLL_API AddedAnalysisTrack {
340  friend Effect;
341  AddedAnalysisTrack(Effect *pEffect, const wxString &name);
343 
344  public:
345 
347 
348  // So you can have a vector of them
350 
351  LabelTrack *get() const { return mpTrack; }
352 
353  // Call this to indicate successful completion of the analyzer.
354  void Commit();
355 
356  // Destructor undoes the addition of the analysis track if not committed.
358 
359  private:
360  Effect *mpEffect{};
361  LabelTrack *mpTrack{};
362  };
363 
364  // Set name to given value if that is not empty, else use default name
365  std::shared_ptr<AddedAnalysisTrack> AddAnalysisTrack(const wxString &name = wxString());
366 
367  // For the use of analyzers, which don't need to make output wave tracks,
368  // but may need to modify label tracks.
369  class AUDACITY_DLL_API ModifiedAnalysisTrack {
370  friend Effect;
372  (Effect *pEffect, const LabelTrack *pOrigTrack, const wxString &name);
374 
375  public:
376 
378 
379  // So you can have a vector of them
381 
382  LabelTrack *get() const { return mpTrack; }
383 
384  // Call this to indicate successful completion of the analyzer.
385  void Commit();
386 
387  // Destructor undoes the modification of the analysis track if not committed.
389 
390  private:
391  Effect *mpEffect{};
392  LabelTrack *mpTrack{};
393  std::shared_ptr<Track> mpOrigTrack{};
394  };
395 
396  // Set name to given value if that is not empty, else use default name
397  ModifiedAnalysisTrack ModifyAnalysisTrack
398  (const LabelTrack *pOrigTrack, const wxString &name = wxString());
399 
400  // If bGoodResult, replace mWaveTracks tracks in mTracks with successfully processed
401  // mOutputTracks copies, get rid of old mWaveTracks, and set mWaveTracks to mOutputTracks.
402  // Else clear and DELETE mOutputTracks copies.
403  void ReplaceProcessedTracks(const bool bGoodResult);
404 
405  // Use this to append a NEW output track.
406  Track *AddToOutputTracks(const std::shared_ptr<Track> &t);
407 
408 //
409 // protected data
410 //
411 // The Effect base class will set these variables, some or all of which
412 // may be needed by any particular subclass of Effect.
413 //
414 protected:
415  BasicUI::ProgressDialog *mProgress = nullptr; // Temporary pointer, NOT deleted in destructor.
416  double mProjectRate; // Sample rate of the project - NEW tracks should
417  // be created with this rate...
418  double mSampleRate;
420  const TrackList *inputTracks() const { return mTracks; }
421  const AudacityProject *FindProject() const;
422  std::shared_ptr<TrackList> mOutputTracks; // used only if CopyInputTracks() is called.
423  double mT0;
424  double mT1;
425 #ifdef EXPERIMENTAL_SPECTRAL_EDITING
426  double mF0;
427  double mF1;
428 #endif
429  wxArrayString mPresetNames;
430  wxArrayString mPresetValues;
431  int mPass;
432 
433  // UI
435  wxWeakRef<wxDialog> mHostUIDialog;
437  wxWeakRef<wxDialog> mUIDialog;
438  wxWindow *mUIParent;
439  unsigned mUIFlags{ 0 };
440 
442 
443  // Used only by the base Effect class
444  //
445  private:
446  double GetDefaultDuration();
447 
448  void CountWaveTracks();
449 
450  // Driver for client effects
451  bool ProcessTrack(int count,
452  ChannelNames map,
453  WaveTrack *left,
454  WaveTrack *right,
455  sampleCount start,
456  sampleCount len,
457  FloatBuffers &inBuffer,
458  FloatBuffers &outBuffer,
459  ArrayOf< float * > &inBufPos,
460  ArrayOf< float *> &outBufPos);
461 
462  //
463  // private data
464  //
465  // Used only by the base Effect class
466  //
467 private:
468  TrackList *mTracks; // the complete list of all tracks
469 
470  bool mIsBatch;
474 
475  double mDuration;
477 
479 
480  std::vector<Track*> mIMap;
481  std::vector<Track*> mOMap;
482 
483  int mNumTracks; //v This is really mNumWaveTracks, per CountWaveTracks() and GetNumWaveTracks().
485 
486  // For client driver
488  size_t mNumAudioIn;
489  size_t mNumAudioOut;
490 
491  size_t mBufferSize;
492  size_t mBlockSize;
493  unsigned mNumChannels;
494 
495 public:
496  const static wxString kUserPresetIdent;
497  const static wxString kFactoryPresetIdent;
498  const static wxString kCurrentSettingsIdent;
499  const static wxString kFactoryDefaultsIdent;
500 
501  friend class EffectUIHost;
502 };
503 
504 // FIXME:
505 // FIXME: Remove this once all effects are using the NEW dialog
506 // FIXME:
507 
508 #define ID_EFFECT_PREVIEW ePreviewID
509 
510 // Utility functions
511 
512 inline float TrapFloat(float x, float min, float max)
513 {
514  if (x <= min)
515  return min;
516 
517  if (x >= max)
518  return max;
519 
520  return x;
521 }
522 
523 inline double TrapDouble(double x, double min, double max)
524 {
525  if (x <= min)
526  return min;
527 
528  if (x >= max)
529  return max;
530 
531  return x;
532 }
533 
534 inline long TrapLong(long x, long min, long max)
535 {
536  if (x <= min)
537  return min;
538 
539  if (x >= max)
540  return max;
541 
542  return x;
543 }
544 
545 // Helper macros for defining, reading and verifying effect parameters
546 
547 #define Param(name, type, key, def, min, max, scale) \
548  static const wxChar * KEY_ ## name = (key); \
549  static const type DEF_ ## name = (def); \
550  static const type MIN_ ## name = (min); \
551  static const type MAX_ ## name = (max); \
552  static const type SCL_ ## name = (scale);
553 
554 #define PBasic(name, type, key, def) \
555  static const wxChar * KEY_ ## name = (key); \
556  static const type DEF_ ## name = (def);
557 
558 #define PRange(name, type, key, def, min, max) \
559  PBasic(name, type, key, def); \
560  static const type MIN_ ## name = (min); \
561  static const type MAX_ ## name = (max);
562 
563 #define PScale(name, type, key, def, min, max, scale) \
564  PRange(name, type, key, def, min, max); \
565  static const type SCL_ ## name = (scale);
566 
567 #define ReadParam(type, name) \
568  type name = DEF_ ## name; \
569  if (!parms.ReadAndVerify(KEY_ ## name, &name, DEF_ ## name, MIN_ ## name, MAX_ ## name)) \
570  return false;
571 
572 #define ReadBasic(type, name) \
573  type name; \
574  wxUnusedVar(MIN_ ##name); \
575  wxUnusedVar(MAX_ ##name); \
576  wxUnusedVar(SCL_ ##name); \
577  if (!parms.ReadAndVerify(KEY_ ## name, &name, DEF_ ## name)) \
578  return false;
579 
580 #define ReadAndVerifyEnum(name, list, listSize) \
581  int name; \
582  if (!parms.ReadAndVerify(KEY_ ## name, &name, DEF_ ## name, list, listSize)) \
583  return false;
584 
585 #define ReadAndVerifyEnumWithObsoletes(name, list, listSize, obsoleteList, nObsolete) \
586  int name; \
587  if (!parms.ReadAndVerify(KEY_ ## name, &name, DEF_ ## name, \
588  list, listSize, obsoleteList, nObsolete)) \
589  return false;
590 
591 #define ReadAndVerifyInt(name) ReadParam(int, name)
592 #define ReadAndVerifyDouble(name) ReadParam(double, name)
593 #define ReadAndVerifyFloat(name) ReadParam(float, name)
594 #define ReadAndVerifyBool(name) ReadBasic(bool, name)
595 #define ReadAndVerifyString(name) ReadBasic(wxString, name)
596 
597 #endif
Effect::IsPreviewing
bool IsPreviewing()
Definition: Effect.h:322
Effect::mSampleCnt
sampleCount mSampleCnt
Definition: Effect.h:441
EffectUIClientInterface
EffectUIClientInterface is an abstract base class to populate a UI and validate UI values....
Definition: EffectInterface.h:251
Effect::AddedAnalysisTrack::AddedAnalysisTrack
AddedAnalysisTrack()
Definition: Effect.h:346
Init
Definition: ModuleManager.h:154
EffectProcessor::GetMidiOutCount
virtual int GetMidiOutCount()=0
TranslatableString
Holds a msgid for the translation catalog; may also bind format arguments.
Definition: TranslatableString.h:32
EffectUIClientInterface::HideUI
virtual bool HideUI()=0
CommandParameters
CommandParameters, derived from wxFileConfig, is essentially doing the same things as the Shuttle cla...
Definition: EffectAutomationParameters.h:67
Effect::ModifiedAnalysisTrack::ModifiedAnalysisTrack
ModifiedAnalysisTrack()
EffectDefinitionInterface::LoadUserPreset
virtual bool LoadUserPreset(const RegistryPath &name)=0
Change settings to a user-named preset.
Effect::mUIDialog
wxWeakRef< wxDialog > mUIDialog
This weak pointer may be the same as the above, or null.
Definition: Effect.h:437
Effect::mNumTracks
int mNumTracks
Definition: Effect.h:483
WaveTrack
A Track that contains audio waveform data.
Definition: WaveTrack.h:75
EffectDialogFactory
std::function< wxDialog *(wxWindow &parent, EffectHostInterface &, EffectUIClientInterface &) > EffectDialogFactory
Definition: EffectHostInterface.h:55
Effect::AddedAnalysisTrack
Definition: Effect.h:339
EffectProcessor::RealtimeResume
virtual bool RealtimeResume() noexcept=0
EffectProcessor::RealtimeProcessStart
virtual bool RealtimeProcessStart()=0
Effect::mClient
EffectUIClientInterface * mClient
Definition: Effect.h:487
S
#define S(N)
Definition: ToChars.cpp:64
EffectHostInterface
EffectHostInterface is a decorator of a EffectUIClientInterface. It adds virtual (abstract) functions...
Definition: EffectHostInterface.h:32
EffectDefinitionInterface::SaveUserPreset
virtual bool SaveUserPreset(const RegistryPath &name)=0
Save current settings as a user-named preset.
EffectDefinitionInterface::LoadFactoryPreset
virtual bool LoadFactoryPreset(int id)=0
Change settings to the preset whose name is GetFactoryPresets()[id]
ComponentInterface::GetSymbol
virtual ComponentInterfaceSymbol GetSymbol()=0
EffectProcessor::GetMidiInCount
virtual int GetMidiInCount()=0
EffectProcessor::ProcessFinalize
virtual bool ProcessFinalize()=0
Called for destructive, non-realtime effect computation.
EffectProcessor::RealtimeProcess
virtual size_t RealtimeProcess(int group, float **inBuf, float **outBuf, size_t numSamples)=0
Effect::AddedAnalysisTrack::get
LabelTrack * get() const
Definition: Effect.h:351
Effect::mDuration
double mDuration
Definition: Effect.h:475
EffectProcessor::RealtimeSuspend
virtual bool RealtimeSuspend()=0
EffectInterface.h
Effect
An Effect object is at once host and client: it is self-hosting.
Definition: Effect.h:77
RegistryPaths
std::vector< RegistryPath > RegistryPaths
Definition: Identifier.h:219
EffectUIClientInterface::ImportPresets
virtual void ImportPresets()=0
PluginPath
wxString PluginPath
type alias for identifying a Plugin supplied by a module, each module defining its own interpretation...
Definition: Identifier.h:214
TrackList
A flat linked list of tracks supporting Add, Remove, Clear, and Contains, serialization of the list o...
Definition: Track.h:1288
EffectProcessor::RealtimeInitialize
virtual bool RealtimeInitialize()=0
Effect::mT1
double mT1
Definition: Effect.h:424
Effect::ModifiedAnalysisTrack::Effect
friend Effect
Definition: Effect.h:370
EffectDefinitionInterface::IsInteractive
virtual bool IsInteractive()=0
Whether the effect needs a dialog for entry of settings.
SelectedRegion.h
Effect::mDurationFormat
NumericFormatSymbol mDurationFormat
Definition: Effect.h:476
EffectDefinitionInterface::LoadFactoryDefaults
virtual bool LoadFactoryDefaults()=0
Change settings back to "factory default".
Effect::mTracks
TrackList * mTracks
Definition: Effect.h:468
EffectHostInterface::GetCurrentSettingsGroup
virtual RegistryPath GetCurrentSettingsGroup()=0
Effect::mNumAudioIn
size_t mNumAudioIn
Definition: Effect.h:488
EffectDefinitionInterface::SetAutomationParameters
virtual bool SetAutomationParameters(CommandParameters &parms)=0
Change settings to those stored in parms.
LabelTrack
A LabelTrack is a Track that holds labels (LabelStruct).
Definition: LabelTrack.h:89
Effect::AddedAnalysisTrack::AddedAnalysisTrack
AddedAnalysisTrack(const AddedAnalysisTrack &) PROHIBITED
Effect::mPass
int mPass
Definition: Effect.h:431
EffectDefinitionInterface::SupportsRealtime
virtual bool SupportsRealtime()=0
Whether the effect supports realtime previewing (while audio is playing).
Effect::mPreviewFullSelection
bool mPreviewFullSelection
Definition: Effect.h:473
EffectProcessor::GetTailSize
virtual size_t GetTailSize()=0
EffectDefinitionInterface::SupportsAutomation
virtual bool SupportsAutomation()=0
Whether the effect can be used without the UI, in a macro.
Effect::IncEffectCounter
static void IncEffectCounter()
Definition: Effect.h:230
EffectUIHostInterface::ShowHostInterface
virtual int ShowHostInterface(wxWindow &parent, const EffectDialogFactory &factory, bool forceModal=false)=0
ComponentInterfaceSymbol
ComponentInterfaceSymbol pairs a persistent string identifier used internally with an optional,...
Definition: ComponentInterfaceSymbol.h:27
Effect::mFactory
WaveTrackFactory * mFactory
Definition: Effect.h:419
ComponentInterface::GetVendor
virtual VendorSymbol GetVendor()=0
EffectProcessor::SetBlockSize
virtual size_t SetBlockSize(size_t maxBlockSize)=0
Effect::mIsBatch
bool mIsBatch
Definition: Effect.h:470
EffectProcessor::RealtimeProcessEnd
virtual bool RealtimeProcessEnd() noexcept=0
SampleCount.h
Effect::mProjectRate
double mProjectRate
Definition: Effect.h:416
Effect::mBufferSize
size_t mBufferSize
Definition: Effect.h:491
EffectUIClientInterface::ShowOptions
virtual void ShowOptions()=0
Effect::inputTracks
const TrackList * inputTracks() const
Definition: Effect.h:420
EffectHostInterface::GetDuration
virtual double GetDuration()=0
Effect::mT0
double mT0
Definition: Effect.h:423
factory
static RegisteredToolbarFactory factory
Definition: ControlToolBar.cpp:820
EffectProcessor::GetAudioOutCount
virtual unsigned GetAudioOutCount()=0
ArraysOf< float >
Effect::mIsLinearEffect
bool mIsLinearEffect
Definition: Effect.h:471
ComponentInterface::GetPath
virtual PluginPath GetPath()=0
EffectProcessor::ProcessBlock
virtual size_t ProcessBlock(float **inBlock, float **outBlock, size_t blockLen)=0
Called for destructive, non-realtime effect computation.
EffectProcessor::SetSampleRate
virtual void SetSampleRate(double rate)=0
Effect::CheckWhetherSkipEffect
virtual bool CheckWhetherSkipEffect()
Definition: Effect.h:258
AudacityCommand
Base class for command in Audacity.
Definition: AudacityCommand.h:40
Effect::kCurrentSettingsIdent
static const wxString kCurrentSettingsIdent
Definition: Effect.h:498
name
const TranslatableString name
Definition: Distortion.cpp:98
Effect::mNumAudioOut
size_t mNumAudioOut
Definition: Effect.h:489
EffectHostInterface.h
Effect::kUserPresetIdent
static const wxString kUserPresetIdent
Definition: Effect.h:496
EffectDefinitionInterface::GetType
virtual EffectType GetType()=0
Type determines how it behaves.
EffectHostInterface::GetDurationFormat
virtual NumericFormatSymbol GetDurationFormat()=0
EffectHostInterface::GetDefinition
virtual EffectDefinitionInterface & GetDefinition()=0
Effect::mNumChannels
unsigned mNumChannels
Definition: Effect.h:493
ComponentInterface::GetDescription
virtual TranslatableString GetDescription()=0
ChannelNames
enum ChannelName * ChannelNames
Effect::mOutputTracks
std::shared_ptr< TrackList > mOutputTracks
Definition: Effect.h:422
EffectProcessor::RealtimeFinalize
virtual bool RealtimeFinalize()=0
EffectDefinitionInterface::GetFactoryPresets
virtual RegistryPaths GetFactoryPresets()=0
Report names of factory presets.
EffectUIHostInterface
extends EffectHostInterface with UI-related services
Definition: EffectHostInterface.h:63
WaveTrackFactory
Used to create or clone a WaveTrack, with appropriate context from the project that will own the trac...
Definition: WaveTrack.h:609
RegistryPath
wxString RegistryPath
Definition: Identifier.h:218
Effect::mBlockSize
size_t mBlockSize
Definition: Effect.h:492
ConfigInterface.h
Effect::ModifiedAnalysisTrack
Definition: Effect.h:369
min
int min(int a, int b)
Definition: CompareAudioCommand.cpp:106
Effect::mIsPreview
bool mIsPreview
Definition: Effect.h:478
Effect::mSampleRate
double mSampleRate
Definition: Effect.h:418
Effect::GetNumWaveGroups
int GetNumWaveGroups()
Definition: Effect.h:305
EffectHostInterface::GetUserPresetsGroup
virtual RegistryPath GetUserPresetsGroup(const RegistryPath &name)=0
Effect::ModifiedAnalysisTrack::get
LabelTrack * get() const
Definition: Effect.h:382
Effect::mOMap
std::vector< Track * > mOMap
Definition: Effect.h:481
EffectProcessor::GetLatency
virtual sampleCount GetLatency()=0
Called for destructive, non-realtime effect computation.
BasicUI
Definition: Effect.h:47
EffectDefinitionInterface
EffectDefinitionInterface is a ComponentInterface that adds some basic read-only information about ef...
Definition: EffectInterface.h:74
EffectUIClientInterface::PopulateUI
virtual bool PopulateUI(ShuttleGui &S)=0
Adds controls to a panel that is given as the parent window of S
EffectProcessor::RealtimeAddProcessor
virtual bool RealtimeAddProcessor(unsigned numChannels, float sampleRate)=0
Effect::SetPresetParameters
void SetPresetParameters(const wxArrayString *Names, const wxArrayString *Values)
Definition: Effect.h:195
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:438
sampleCount
Positions or offsets within audio files need a wide type.
Definition: SampleCount.h:18
Effect::mNumGroups
int mNumGroups
Definition: Effect.h:484
BasicUI::ProgressDialog
Abstraction of a progress dialog with well defined time-to-completion estimate.
Definition: BasicUI.h:154
AudacityProject
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
Definition: Project.h:89
EffectUIClientInterface::CloseUI
virtual bool CloseUI()=0
EffectProcessor::GetAudioInCount
virtual unsigned GetAudioInCount()=0
EffectUIHost
Definition: EffectUI.h:39
Effect::nEffectsDone
static int nEffectsDone
Definition: Effect.h:335
EffectUIClientInterface::SetHost
virtual bool SetHost(EffectHostInterface *host)=0
Effect::ModifiedAnalysisTrack::ModifiedAnalysisTrack
ModifiedAnalysisTrack(const ModifiedAnalysisTrack &) PROHIBITED
EffectDefinitionInterface::IsLegacy
virtual bool IsLegacy()=0
EffectProcessor::ProcessInitialize
virtual bool ProcessInitialize(sampleCount totalLen, ChannelNames chanMap=NULL)=0
Called for destructive, non-realtime effect computation.
TrapLong
long TrapLong(long x, long min, long max)
Definition: Effect.h:534
EffectUI::DoEffect
AUDACITY_DLL_API bool DoEffect(const PluginID &ID, const CommandContext &context, unsigned flags)
'Repeat Last Effect'.
Definition: EffectUI.cpp:1230
Track.h
declares abstract base class Track, TrackList, and iterators over TrackList
EffectDefinitionInterface::GetAutomationParameters
virtual bool GetAutomationParameters(CommandParameters &parms)=0
Save current settings into parms.
Effect::GetNumWaveTracks
int GetNumWaveTracks()
Definition: Effect.h:304
PluginInterface.h
TrapDouble
double TrapDouble(double x, double min, double max)
Definition: Effect.h:523
Effect::mPresetNames
wxArrayString mPresetNames
Definition: Effect.h:429
EffectUIClientInterface::CanExportPresets
virtual bool CanExportPresets()=0
Effect::mHostUIDialog
wxWeakRef< wxDialog > mHostUIDialog
This smart pointer tracks the lifetime of the dialog.
Definition: Effect.h:435
Effect::kFactoryDefaultsIdent
static const wxString kFactoryDefaultsIdent
Definition: Effect.h:499
ComponentInterface::GetVersion
virtual wxString GetVersion()=0
EffectUIClientInterface::IsGraphicalUI
virtual bool IsGraphicalUI()=0
EffectType
EffectType
Definition: EffectInterface.h:52
Effect::kFactoryPresetIdent
static const wxString kFactoryPresetIdent
Definition: Effect.h:497
EffectUIClientInterface::ExportPresets
virtual void ExportPresets()=0
EffectUIClientInterface::HasOptions
virtual bool HasOptions()=0
EffectDefinitionInterface::GetFamily
virtual EffectFamilySymbol GetFamily()=0
Report identifier and user-visible name of the effect protocol.
Effect::mPresetValues
wxArrayString mPresetValues
Definition: Effect.h:430
Effect::mIMap
std::vector< Track * > mIMap
Definition: Effect.h:480
EffectProcessor::GetBlockSize
virtual size_t GetBlockSize() const =0
Effect::AddedAnalysisTrack::Effect
friend Effect
Definition: Effect.h:340
TrapFloat
float TrapFloat(float x, float min, float max)
Definition: Effect.h:512
EffectUIClientInterface::ShowClientInterface
virtual int ShowClientInterface(wxWindow &parent, wxDialog &dialog, bool forceModal=false)=0
ArrayOf
Memory.h template class for making an array of float, bool, etc.
Definition: MemoryX.h:27
Effect::mPreviewWithNotSelected
bool mPreviewWithNotSelected
Definition: Effect.h:472
EffectUIClientInterface::ValidateUI
virtual bool ValidateUI()=0
EffectDefinitionInterface::IsDefault
virtual bool IsDefault()=0
Whether the effect sorts "above the line" in the menus.
EffectHostInterface::SetDuration
virtual void SetDuration(double seconds)=0
ShuttleGui
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.
Definition: ShuttleGui.h:631
EffectHostInterface::GetFactoryDefaultsGroup
virtual RegistryPath GetFactoryDefaultsGroup()=0
NotifyingSelectedRegion
Definition: ViewInfo.h:31
SelectedRegion
Defines a selected portion of a project.
Definition: SelectedRegion.h:38