Audacity  3.0.3
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 
30 
31 #include "../SelectedRegion.h"
32 
33 #include "../Track.h"
34 
35 #include "../widgets/wxPanelWrapper.h" // to inherit
36 
37 class wxArrayString;
38 class ShuttleGui;
39 class AudacityCommand;
40 
41 #define BUILTIN_EFFECT_PREFIX wxT("Built-in Effect: ")
42 
43 class AudacityProject;
44 class LabelTrack;
46 class ProgressDialog;
47 class SelectedRegion;
48 class EffectUIHost;
49 class Track;
50 class TrackList;
51 class WaveTrackFactory;
52 class WaveTrack;
53 
54 /* i18n-hint: "Nyquist" is an embedded interpreted programming language in
55  Audacity, named in honor of the Swedish-American Harry Nyquist (or Nyqvist).
56  In the translations of this and other strings, you may transliterate the
57  name into another alphabet. */
58 #define NYQUISTEFFECTS_FAMILY ( EffectFamilySymbol{ XO("Nyquist") } )
59 
60 #define NYQUIST_PROMPT_ID wxT("Nyquist Prompt")
61 #define NYQUIST_WORKER_ID wxT("Nyquist Worker")
62 
63 // TODO: Apr-06-2015
64 // TODO: Much more cleanup of old methods and variables is needed, but
65 // TODO: can't be done until after all effects are using the NEW API.
66 
67 class AUDACITY_DLL_API Effect /* not final */ : public wxEvtHandler,
68  public EffectClientInterface,
70  public EffectHostInterface
71 {
72  //
73  // public methods
74  //
75  // Used by the outside program to determine properties of an effect and
76  // apply the effect to one or more tracks.
77  //
78  public:
79  // The constructor is called once by each subclass at the beginning of the program.
80  // Avoid allocating memory or doing time-consuming processing here.
81  Effect();
82  virtual ~Effect();
83 
84  // Type of a registered function that, if it returns true,
85  // causes ShowInterface to return early without making any dialog
86  using VetoDialogHook = bool (*) ( wxDialog* );
87  static VetoDialogHook SetVetoDialogHook( VetoDialogHook hook );
88 
89  // ComponentInterface implementation
90 
91  PluginPath GetPath() override;
92 
94 
95  VendorSymbol GetVendor() override;
96  wxString GetVersion() override;
98 
99  // EffectDefinitionInterface implementation
100 
101  EffectType GetType() override;
102  EffectFamilySymbol GetFamily() override;
103  bool IsInteractive() override;
104  bool IsDefault() override;
105  bool IsLegacy() override;
106  bool SupportsRealtime() override;
107  bool SupportsAutomation() override;
108 
109  // EffectClientInterface implementation
110 
111  bool SetHost(EffectHostInterface *host) override;
112 
113  unsigned GetAudioInCount() override;
114  unsigned GetAudioOutCount() override;
115 
116  int GetMidiInCount() override;
117  int GetMidiOutCount() override;
118 
119  sampleCount GetLatency() override;
120  size_t GetTailSize() override;
121 
122  void SetSampleRate(double rate) override;
123  size_t SetBlockSize(size_t maxBlockSize) override;
124  size_t GetBlockSize() const override;
125 
126  bool IsReady() override;
127  bool ProcessInitialize(sampleCount totalLen, ChannelNames chanMap = NULL) override;
128  bool ProcessFinalize() override;
129  size_t ProcessBlock(float **inBlock, float **outBlock, size_t blockLen) override;
130 
131  bool RealtimeInitialize() override;
132  bool RealtimeAddProcessor(unsigned numChannels, float sampleRate) override;
133  bool RealtimeFinalize() override;
134  bool RealtimeSuspend() override;
135  bool RealtimeResume() override;
136  bool RealtimeProcessStart() override;
137  size_t RealtimeProcess(int group,
138  float **inbuf,
139  float **outbuf,
140  size_t numSamples) override;
141  bool RealtimeProcessEnd() override;
142 
143  bool ShowInterface( wxWindow &parent,
144  const EffectDialogFactory &factory, bool forceModal = false) override;
145 
146  bool GetAutomationParameters(CommandParameters & parms) override;
147  bool SetAutomationParameters(CommandParameters & parms) override;
148 
149  bool LoadUserPreset(const RegistryPath & name) override;
150  bool SaveUserPreset(const RegistryPath & name) override;
151 
152  RegistryPaths GetFactoryPresets() override;
153  bool LoadFactoryPreset(int id) override;
154  bool LoadFactoryDefaults() override;
155 
156  // EffectUIClientInterface implementation
157 
158  void SetHostUI(EffectUIHostInterface *host) override;
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  static CommandID GetSquashedName(wxString name);
170 
171  bool HasOptions() override;
172  void ShowOptions() override;
173 
174  // EffectHostInterface implementation
175 
176  double GetDefaultDuration() override;
177  double GetDuration() override;
179  virtual NumericFormatSymbol GetSelectionFormat() /* not override? */; // time format in Selection toolbar
180  void SetDuration(double duration) override;
181 
185  virtual wxString GetSavedStateGroup() /* not override? */;
186 
187  // ConfigClientInterface implementation
188 
189  bool HasSharedConfigGroup(const RegistryPath & group) override;
190  bool GetSharedConfigSubgroups(const RegistryPath & group, RegistryPaths &subgroups) override;
191 
192  bool GetSharedConfig(const RegistryPath & group, const RegistryPath & key, wxString & value, const wxString & defval = {}) override;
193  bool GetSharedConfig(const RegistryPath & group, const RegistryPath & key, int & value, int defval = 0) override;
194  bool GetSharedConfig(const RegistryPath & group, const RegistryPath & key, bool & value, bool defval = false) override;
195  bool GetSharedConfig(const RegistryPath & group, const RegistryPath & key, float & value, float defval = 0.0) override;
196  bool GetSharedConfig(const RegistryPath & group, const RegistryPath & key, double & value, double defval = 0.0) override;
197 
198  bool SetSharedConfig(const RegistryPath & group, const RegistryPath & key, const wxString & value) override;
199  bool SetSharedConfig(const RegistryPath & group, const RegistryPath & key, const int & value) override;
200  bool SetSharedConfig(const RegistryPath & group, const RegistryPath & key, const bool & value) override;
201  bool SetSharedConfig(const RegistryPath & group, const RegistryPath & key, const float & value) override;
202  bool SetSharedConfig(const RegistryPath & group, const RegistryPath & key, const double & value) override;
203 
204  bool RemoveSharedConfigSubgroup(const RegistryPath & group) override;
205  bool RemoveSharedConfig(const RegistryPath & group, const RegistryPath & key) override;
206 
207  bool HasPrivateConfigGroup(const RegistryPath & group) override;
208  bool GetPrivateConfigSubgroups(const RegistryPath & group, RegistryPaths &paths) override;
209 
210  bool GetPrivateConfig(const RegistryPath & group, const RegistryPath & key, wxString & value, const wxString & defval = {}) override;
211  bool GetPrivateConfig(const RegistryPath & group, const RegistryPath & key, int & value, int defval = 0) override;
212  bool GetPrivateConfig(const RegistryPath & group, const RegistryPath & key, bool & value, bool defval = false) override;
213  bool GetPrivateConfig(const RegistryPath & group, const RegistryPath & key, float & value, float defval = 0.0) override;
214  bool GetPrivateConfig(const RegistryPath & group, const RegistryPath & key, double & value, double defval = 0.0) override;
215 
216  bool SetPrivateConfig(const RegistryPath & group, const RegistryPath & key, const wxString & value) override;
217  bool SetPrivateConfig(const RegistryPath & group, const RegistryPath & key, const int & value) override;
218  bool SetPrivateConfig(const RegistryPath & group, const RegistryPath & key, const bool & value) override;
219  bool SetPrivateConfig(const RegistryPath & group, const RegistryPath & key, const float & value) override;
220  bool SetPrivateConfig(const RegistryPath & group, const RegistryPath & key, const double & value) override;
221 
222  bool RemovePrivateConfigSubgroup(const RegistryPath & group) override;
223  bool RemovePrivateConfig(const RegistryPath & group, const RegistryPath & key) override;
224 
225  // Effect implementation
226 
227  // NEW virtuals
228  virtual PluginID GetID();
229 
230  virtual bool Startup(EffectClientInterface *client);
231  virtual bool Startup();
232 
233  virtual bool GetAutomationParameters(wxString & parms);
234  virtual bool SetAutomationParameters(const wxString & parms);
235 
236  virtual RegistryPaths GetUserPresets();
237  virtual bool HasCurrentSettings();
238  virtual bool HasFactoryDefaults();
239 
240  // Name of page in the Audacity alpha manual
241  virtual wxString ManualPage();
242  // Fully qualified local help file name
243  virtual wxString HelpPage();
244 
245  virtual void SetUIFlags(unsigned flags);
246  virtual unsigned TestUIFlags(unsigned mask);
247  virtual bool IsBatchProcessing();
248  virtual void SetBatchProcessing(bool start);
249 
250  /* not virtual */ void SetPresetParameters( const wxArrayString * Names, const wxArrayString * Values ) {
251  if( Names ) mPresetNames = *Names;
252  if( Values ) mPresetValues = *Values;
253  }
254 
255  // Returns true on success. Will only operate on tracks that
256  // have the "selected" flag set to true, which is consistent with
257  // Audacity's standard UI.
258  // Create a user interface only if the supplied function is not null.
259  /* not virtual */ bool DoEffect( double projectRate, TrackList *list,
261  // Prompt the user for input only if these arguments are both not null.
262  wxWindow *pParent = nullptr,
263  const EffectDialogFactory &dialogFactory = {} );
264 
265  bool Delegate( Effect &delegate,
266  wxWindow &parent, const EffectDialogFactory &factory );
267 
268  virtual bool IsHidden();
269 
270  // Nonvirtual
271  // Display a message box, using effect's (translated) name as the prefix
272  // for the title.
273  enum : long { DefaultMessageBoxStyle = wxOK | wxCENTRE };
274  int MessageBox(const TranslatableString& message,
275  long style = DefaultMessageBoxStyle,
276  const TranslatableString& titleStr = {});
277 
278  static void IncEffectCounter(){ nEffectsDone++;};
279 
280 //
281 // protected virtual methods
282 //
283 // Each subclass of Effect overrides one or more of these methods to
284 // do its processing.
285 //
286 protected:
287 
288  // Called once each time an effect is called. Perform any initialization;
289  // make sure that the effect can be performed on the selected tracks and
290  // return false otherwise
291  virtual bool Init();
292 
293  // Check whether effect should be skipped
294  // Typically this is only useful in automation, for example
295  // detecting that zero noise reduction is to be done,
296  // or that normalisation is being done without Dc bias shift
297  // or amplitude modification
298  virtual bool CheckWhetherSkipEffect() { return false; }
299 
300  // Actually do the effect here.
301  virtual bool Process();
302  virtual bool ProcessPass();
303  virtual bool InitPass1();
304  virtual bool InitPass2();
305  virtual int GetPass();
306 
307  // clean up any temporary memory, needed only per invocation of the
308  // effect, after either successful or failed or exception-aborted processing.
309  // Invoked inside a "finally" block so it must be no-throw.
310  virtual void End();
311 
312  // Most effects just use the previewLength, but time-stretching/compressing
313  // effects need to use a different input length, so override this method.
314  virtual double CalcPreviewInputLength(double previewLength);
315 
316  // The Effect class fully implements the Preview method for you.
317  // Only override it if you need to do preprocessing or cleanup.
318  virtual void Preview(bool dryOnly);
319 
320  virtual void PopulateOrExchange(ShuttleGui & S);
321  virtual bool TransferDataToWindow() /* not override */;
322  virtual bool TransferDataFromWindow() /* not override */;
323  virtual bool EnableApply(bool enable = true);
324  virtual bool EnablePreview(bool enable = true);
325  virtual void EnableDebug(bool enable = true);
326 
327  // No more virtuals!
328 
329  // The Progress methods all return true if the user has cancelled;
330  // you should exit immediately if this happens (cleaning up memory
331  // is okay, but don't try to undo).
332 
333  // Pass a fraction between 0.0 and 1.0
334  bool TotalProgress(double frac, const TranslatableString & = {});
335 
336  // Pass a fraction between 0.0 and 1.0, for the current track
337  // (when doing one track at a time)
338  bool TrackProgress(int whichTrack, double frac, const TranslatableString & = {});
339 
340  // Pass a fraction between 0.0 and 1.0, for the current track group
341  // (when doing stereo groups at a time)
342  bool TrackGroupProgress(int whichGroup, double frac, const TranslatableString & = {});
343 
344  int GetNumWaveTracks() { return mNumTracks; }
345  int GetNumWaveGroups() { return mNumGroups; }
346 
347  // Calculates the start time and length in samples for one or two channels
348  void GetBounds(
349  const WaveTrack &track, const WaveTrack *pRight,
350  sampleCount *start, sampleCount *len);
351 
352  // Previewing linear effect can be optimised by pre-mixing. However this
353  // should not be used for non-linear effects such as dynamic processors
354  // To allow pre-mixing before Preview, set linearEffectFlag to true.
355  void SetLinearEffectFlag(bool linearEffectFlag);
356 
357  // Most effects only need to preview a short selection. However some
358  // (such as fade effects) need to know the full selection length.
359  void SetPreviewFullSelectionFlag(bool previewDurationFlag);
360 
361  // Use this if the effect needs to know if it is previewing
362  bool IsPreviewing() { return mIsPreview; }
363 
364  // Most effects only require selected tracks to be copied for Preview.
365  // If IncludeNotSelectedPreviewTracks(true), then non-linear effects have
366  // preview copies of all wave tracks.
367  void IncludeNotSelectedPreviewTracks(bool includeNotSelected);
368 
369  // Use this method to copy the input tracks to mOutputTracks, if
370  // doing the processing on them, and replacing the originals only on success (and not cancel).
371  // If not all sync-locked selected, then only selected wave tracks.
372  void CopyInputTracks(bool allSyncLockSelected = false);
373 
374  // A global counter of all the successful Effect invocations.
375  static int nEffectsDone;
376 
377  // For the use of analyzers, which don't need to make output wave tracks,
378  // but may need to add label tracks.
379  class AUDACITY_DLL_API AddedAnalysisTrack {
380  friend Effect;
381  AddedAnalysisTrack(Effect *pEffect, const wxString &name);
383 
384  public:
385 
387 
388  // So you can have a vector of them
390 
391  LabelTrack *get() const { return mpTrack; }
392 
393  // Call this to indicate successful completion of the analyzer.
394  void Commit();
395 
396  // Destructor undoes the addition of the analysis track if not committed.
398 
399  private:
400  Effect *mpEffect{};
401  LabelTrack *mpTrack{};
402  };
403 
404  // Set name to given value if that is not empty, else use default name
405  std::shared_ptr<AddedAnalysisTrack> AddAnalysisTrack(const wxString &name = wxString());
406 
407  // For the use of analyzers, which don't need to make output wave tracks,
408  // but may need to modify label tracks.
409  class AUDACITY_DLL_API ModifiedAnalysisTrack {
410  friend Effect;
412  (Effect *pEffect, const LabelTrack *pOrigTrack, const wxString &name);
414 
415  public:
416 
418 
419  // So you can have a vector of them
421 
422  LabelTrack *get() const { return mpTrack; }
423 
424  // Call this to indicate successful completion of the analyzer.
425  void Commit();
426 
427  // Destructor undoes the modification of the analysis track if not committed.
429 
430  private:
431  Effect *mpEffect{};
432  LabelTrack *mpTrack{};
433  std::shared_ptr<Track> mpOrigTrack{};
434  };
435 
436  // Set name to given value if that is not empty, else use default name
437  ModifiedAnalysisTrack ModifyAnalysisTrack
438  (const LabelTrack *pOrigTrack, const wxString &name = wxString());
439 
440  // If bGoodResult, replace mWaveTracks tracks in mTracks with successfully processed
441  // mOutputTracks copies, get rid of old mWaveTracks, and set mWaveTracks to mOutputTracks.
442  // Else clear and DELETE mOutputTracks copies.
443  void ReplaceProcessedTracks(const bool bGoodResult);
444 
445  // Use this to append a NEW output track.
446  Track *AddToOutputTracks(const std::shared_ptr<Track> &t);
447 
448 //
449 // protected data
450 //
451 // The Effect base class will set these variables, some or all of which
452 // may be needed by any particular subclass of Effect.
453 //
454 protected:
455 
456  ProgressDialog *mProgress; // Temporary pointer, NOT deleted in destructor.
457  double mProjectRate; // Sample rate of the project - NEW tracks should
458  // be created with this rate...
459  double mSampleRate;
460  wxWeakRef<NotifyingSelectedRegion> mpSelectedRegion{};
462  const TrackList *inputTracks() const { return mTracks; }
463  const AudacityProject *FindProject() const;
464  std::shared_ptr<TrackList> mOutputTracks; // used only if CopyInputTracks() is called.
465  double mT0;
466  double mT1;
467 #ifdef EXPERIMENTAL_SPECTRAL_EDITING
468  double mF0;
469  double mF1;
470 #endif
471  wxArrayString mPresetNames;
472  wxArrayString mPresetValues;
473  int mPass;
474 
475  // UI
476  wxDialog *mUIDialog;
477  wxWindow *mUIParent;
479  unsigned mUIFlags;
480 
482 
483  // Used only by the base Effect class
484  //
485  private:
486  void CountWaveTracks();
487 
488  // Driver for client effects
489  bool ProcessTrack(int count,
490  ChannelNames map,
491  WaveTrack *left,
492  WaveTrack *right,
493  sampleCount start,
494  sampleCount len,
495  FloatBuffers &inBuffer,
496  FloatBuffers &outBuffer,
497  ArrayOf< float * > &inBufPos,
498  ArrayOf< float *> &outBufPos);
499 
500  //
501  // private data
502  //
503  // Used only by the base Effect class
504  //
505 private:
506  TrackList *mTracks; // the complete list of all tracks
507 
508  bool mIsBatch;
512 
513  double mDuration;
515 
517 
518  bool mUIDebug;
519 
520  std::vector<Track*> mIMap;
521  std::vector<Track*> mOMap;
522 
523  int mNumTracks; //v This is really mNumWaveTracks, per CountWaveTracks() and GetNumWaveTracks().
525 
526  // For client driver
528  size_t mNumAudioIn;
529  size_t mNumAudioOut;
530 
531  size_t mBufferSize;
532  size_t mBlockSize;
533  unsigned mNumChannels;
534 
535 public:
536  const static wxString kUserPresetIdent;
537  const static wxString kFactoryPresetIdent;
538  const static wxString kCurrentSettingsIdent;
539  const static wxString kFactoryDefaultsIdent;
540 
541  friend class EffectUIHost;
542 };
543 
544 // FIXME:
545 // FIXME: Remove this once all effects are using the NEW dialog
546 // FIXME:
547 
548 #define ID_EFFECT_PREVIEW ePreviewID
549 
550 // Utility functions
551 
552 inline float TrapFloat(float x, float min, float max)
553 {
554  if (x <= min)
555  return min;
556 
557  if (x >= max)
558  return max;
559 
560  return x;
561 }
562 
563 inline double TrapDouble(double x, double min, double max)
564 {
565  if (x <= min)
566  return min;
567 
568  if (x >= max)
569  return max;
570 
571  return x;
572 }
573 
574 inline long TrapLong(long x, long min, long max)
575 {
576  if (x <= min)
577  return min;
578 
579  if (x >= max)
580  return max;
581 
582  return x;
583 }
584 
585 // Helper macros for defining, reading and verifying effect parameters
586 
587 #define Param(name, type, key, def, min, max, scale) \
588  static const wxChar * KEY_ ## name = (key); \
589  static const type DEF_ ## name = (def); \
590  static const type MIN_ ## name = (min); \
591  static const type MAX_ ## name = (max); \
592  static const type SCL_ ## name = (scale);
593 
594 #define PBasic(name, type, key, def) \
595  static const wxChar * KEY_ ## name = (key); \
596  static const type DEF_ ## name = (def);
597 
598 #define PRange(name, type, key, def, min, max) \
599  PBasic(name, type, key, def); \
600  static const type MIN_ ## name = (min); \
601  static const type MAX_ ## name = (max);
602 
603 #define PScale(name, type, key, def, min, max, scale) \
604  PRange(name, type, key, def, min, max); \
605  static const type SCL_ ## name = (scale);
606 
607 #define ReadParam(type, name) \
608  type name = DEF_ ## name; \
609  if (!parms.ReadAndVerify(KEY_ ## name, &name, DEF_ ## name, MIN_ ## name, MAX_ ## name)) \
610  return false;
611 
612 #define ReadBasic(type, name) \
613  type name; \
614  wxUnusedVar(MIN_ ##name); \
615  wxUnusedVar(MAX_ ##name); \
616  wxUnusedVar(SCL_ ##name); \
617  if (!parms.ReadAndVerify(KEY_ ## name, &name, DEF_ ## name)) \
618  return false;
619 
620 #define ReadAndVerifyEnum(name, list, listSize) \
621  int name; \
622  if (!parms.ReadAndVerify(KEY_ ## name, &name, DEF_ ## name, list, listSize)) \
623  return false;
624 
625 #define ReadAndVerifyEnumWithObsoletes(name, list, listSize, obsoleteList, nObsolete) \
626  int name; \
627  if (!parms.ReadAndVerify(KEY_ ## name, &name, DEF_ ## name, \
628  list, listSize, obsoleteList, nObsolete)) \
629  return false;
630 
631 #define ReadAndVerifyInt(name) ReadParam(int, name)
632 #define ReadAndVerifyDouble(name) ReadParam(double, name)
633 #define ReadAndVerifyFloat(name) ReadParam(float, name)
634 #define ReadAndVerifyBool(name) ReadBasic(bool, name)
635 #define ReadAndVerifyString(name) ReadBasic(wxString, name)
636 
637 #endif
Effect::IsPreviewing
bool IsPreviewing()
Definition: Effect.h:362
Effect::mSampleCnt
sampleCount mSampleCnt
Definition: Effect.h:481
EffectUIClientInterface
EffectUIClientInterface is an abstract base class to populate a UI and validate UI values....
Definition: EffectInterface.h:230
Effect::AddedAnalysisTrack::AddedAnalysisTrack
AddedAnalysisTrack()
Definition: Effect.h:386
RegistryPaths
std::vector< RegistryPath > RegistryPaths
Definition: Types.h:262
TranslatableString
Definition: Types.h:290
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()
Effect::mNumTracks
int mNumTracks
Definition: Effect.h:523
EffectClientInterface::SetBlockSize
virtual size_t SetBlockSize(size_t maxBlockSize)=0
WaveTrack
A Track that contains audio waveform data.
Definition: WaveTrack.h:68
Effect::mUIDialog
wxDialog * mUIDialog
Definition: Effect.h:476
EffectClientInterface::RealtimeAddProcessor
virtual bool RealtimeAddProcessor(unsigned numChannels, float sampleRate)=0
Effect::AddedAnalysisTrack
Definition: Effect.h:379
Effect::mProgress
ProgressDialog * mProgress
Definition: Effect.h:456
EffectClientInterface::RealtimeInitialize
virtual bool RealtimeInitialize()=0
ConfigClientInterface::GetSharedConfigSubgroups
virtual bool GetSharedConfigSubgroups(const RegistryPath &group, RegistryPaths &subgroups)=0
EffectHostInterface
EffectHostInterface is a decorator of a EffectUIClientInterface. It adds virtual (abstract) functions...
Definition: EffectInterface.h:119
ComponentInterface::GetSymbol
virtual ComponentInterfaceSymbol GetSymbol()=0
EffectClientInterface::SetSampleRate
virtual void SetSampleRate(double rate)=0
Effect::AddedAnalysisTrack::get
LabelTrack * get() const
Definition: Effect.h:391
Effect::mDuration
double mDuration
Definition: Effect.h:513
EffectInterface.h
Effect
Base class for many of the effects in Audacity.
Definition: Effect.h:71
Effect::VetoDialogHook
bool(*)(wxDialog *) VetoDialogHook
Definition: Effect.h:86
EffectClientInterface::RealtimeFinalize
virtual bool RealtimeFinalize()=0
Effect::mUIResultID
int mUIResultID
Definition: Effect.h:478
EffectUIClientInterface::ImportPresets
virtual void ImportPresets()=0
EffectClientInterface::ProcessFinalize
virtual bool ProcessFinalize()=0
TrackList
A flat linked list of tracks supporting Add, Remove, Clear, and Contains, serialization of the list o...
Definition: Track.h:1263
EffectClientInterface::RealtimeProcessEnd
virtual bool RealtimeProcessEnd()=0
Effect::mT1
double mT1
Definition: Effect.h:466
Effect::ModifiedAnalysisTrack::Effect
friend Effect
Definition: Effect.h:410
EffectDefinitionInterface::IsInteractive
virtual bool IsInteractive()=0
ConfigClientInterface::HasSharedConfigGroup
virtual bool HasSharedConfigGroup(const RegistryPath &group)=0
Effect::mDurationFormat
NumericFormatSymbol mDurationFormat
Definition: Effect.h:514
Effect::mTracks
TrackList * mTracks
Definition: Effect.h:506
EffectHostInterface::GetCurrentSettingsGroup
virtual RegistryPath GetCurrentSettingsGroup()=0
Effect::mNumAudioIn
size_t mNumAudioIn
Definition: Effect.h:528
LabelTrack
A LabelTrack is a Track that holds labels (LabelStruct).
Definition: LabelTrack.h:88
Effect::AddedAnalysisTrack::AddedAnalysisTrack
AddedAnalysisTrack(const AddedAnalysisTrack &) PROHIBITED
Effect::mPass
int mPass
Definition: Effect.h:473
EffectClientInterface::ProcessBlock
virtual size_t ProcessBlock(float **inBlock, float **outBlock, size_t blockLen)=0
EffectDefinitionInterface::SupportsRealtime
virtual bool SupportsRealtime()=0
Effect::mPreviewFullSelection
bool mPreviewFullSelection
Definition: Effect.h:511
EffectClientInterface::ShowInterface
virtual bool ShowInterface(wxWindow &parent, const EffectDialogFactory &factory, bool forceModal=false)=0
EffectClientInterface::GetFactoryPresets
virtual RegistryPaths GetFactoryPresets()=0
EffectDefinitionInterface::SupportsAutomation
virtual bool SupportsAutomation()=0
Effect::IncEffectCounter
static void IncEffectCounter()
Definition: Effect.h:278
ComponentInterfaceSymbol
ComponentInterfaceSymbol pairs a persistent string identifier used internally with an optional,...
Definition: ComponentInterface.h:60
Effect::mFactory
WaveTrackFactory * mFactory
Definition: Effect.h:461
ComponentInterface::GetVendor
virtual VendorSymbol GetVendor()=0
Effect::mIsBatch
bool mIsBatch
Definition: Effect.h:508
EffectHostInterface::GetDefaultDuration
virtual double GetDefaultDuration()=0
Effect::mProjectRate
double mProjectRate
Definition: Effect.h:457
Effect::mBufferSize
size_t mBufferSize
Definition: Effect.h:531
EffectClientInterface::RealtimeSuspend
virtual bool RealtimeSuspend()=0
EffectClientInterface::GetAudioOutCount
virtual unsigned GetAudioOutCount()=0
EffectClientInterface::GetMidiOutCount
virtual int GetMidiOutCount()=0
EffectUIClientInterface::ShowOptions
virtual void ShowOptions()=0
ConfigClientInterface::RemoveSharedConfigSubgroup
virtual bool RemoveSharedConfigSubgroup(const RegistryPath &group)=0
Effect::inputTracks
const TrackList * inputTracks() const
Definition: Effect.h:462
EffectHostInterface::GetDuration
virtual double GetDuration()=0
EffectClientInterface::SetAutomationParameters
virtual bool SetAutomationParameters(CommandParameters &parms)=0
ProgressDialog
ProgressDialog Class.
Definition: ProgressDialog.h:56
Effect::mT0
double mT0
Definition: Effect.h:465
factory
static RegisteredToolbarFactory factory
Definition: ControlToolBar.cpp:804
ConfigClientInterface::RemovePrivateConfigSubgroup
virtual bool RemovePrivateConfigSubgroup(const RegistryPath &group)=0
ArraysOf< float >
EffectClientInterface::LoadFactoryDefaults
virtual bool LoadFactoryDefaults()=0
Effect::mIsLinearEffect
bool mIsLinearEffect
Definition: Effect.h:509
ComponentInterface::GetPath
virtual PluginPath GetPath()=0
EffectClientInterface::GetMidiInCount
virtual int GetMidiInCount()=0
EffectClientInterface::LoadFactoryPreset
virtual bool LoadFactoryPreset(int id)=0
EffectClientInterface::SetHost
virtual bool SetHost(EffectHostInterface *host)=0
ChannelNames
enum ChannelName * ChannelNames
EffectClientInterface::GetTailSize
virtual size_t GetTailSize()=0
PluginID
wxString PluginID
Definition: EffectManager.h:30
Effect::CheckWhetherSkipEffect
virtual bool CheckWhetherSkipEffect()
Definition: Effect.h:298
AudacityCommand
Base class for command in Audacity.
Definition: AudacityCommand.h:41
Effect::kCurrentSettingsIdent
static const wxString kCurrentSettingsIdent
Definition: Effect.h:538
name
const TranslatableString name
Definition: Distortion.cpp:98
PluginPath
wxString PluginPath
type alias for identifying a Plugin supplied by a module, each module defining its own interpretation...
Definition: Types.h:257
Effect::mNumAudioOut
size_t mNumAudioOut
Definition: Effect.h:529
Effect::kUserPresetIdent
static const wxString kUserPresetIdent
Definition: Effect.h:536
EffectDefinitionInterface::GetType
virtual EffectType GetType()=0
Effect::mUIFlags
unsigned mUIFlags
Definition: Effect.h:479
EffectClientInterface::EffectDialogFactory
std::function< wxDialog *(wxWindow &parent, EffectHostInterface *, EffectUIClientInterface *) > EffectDialogFactory
Definition: EffectInterface.h:149
EffectClientInterface::ProcessInitialize
virtual bool ProcessInitialize(sampleCount totalLen, ChannelNames chanMap=NULL)=0
EffectHostInterface::GetDurationFormat
virtual NumericFormatSymbol GetDurationFormat()=0
Effect::mNumChannels
unsigned mNumChannels
Definition: Effect.h:533
ComponentInterface::GetDescription
virtual TranslatableString GetDescription()=0
Effect::mUIDebug
bool mUIDebug
Definition: Effect.h:518
ConfigClientInterface::GetSharedConfig
virtual bool GetSharedConfig(const RegistryPath &group, const RegistryPath &key, wxString &value, const wxString &defval)=0
Effect::mOutputTracks
std::shared_ptr< TrackList > mOutputTracks
Definition: Effect.h:464
EffectUIClientInterface::SetHostUI
virtual void SetHostUI(EffectUIHostInterface *host)=0
EffectUIHostInterface
EffectUIHostInterface has nothing in it. It is provided so that an Effect can call SetHostUI passing ...
Definition: EffectInterface.h:216
WaveTrackFactory
Used to create or clone a WaveTrack, with appropriate context from the project that will own the trac...
Definition: WaveTrack.h:675
Effect::mBlockSize
size_t mBlockSize
Definition: Effect.h:532
EffectClientInterface::GetLatency
virtual sampleCount GetLatency()=0
ConfigInterface.h
EffectClientInterface
EffectClientInterface provides the ident interface to Effect, and is what makes Effect into a plug-in...
Definition: EffectInterface.h:144
Effect::ModifiedAnalysisTrack
Definition: Effect.h:409
min
int min(int a, int b)
Definition: CompareAudioCommand.cpp:106
Effect::mIsPreview
bool mIsPreview
Definition: Effect.h:516
Effect::mSampleRate
double mSampleRate
Definition: Effect.h:459
ConfigClientInterface::RemovePrivateConfig
virtual bool RemovePrivateConfig(const RegistryPath &group, const RegistryPath &key)=0
Effect::GetNumWaveGroups
int GetNumWaveGroups()
Definition: Effect.h:345
EffectClientInterface::LoadUserPreset
virtual bool LoadUserPreset(const RegistryPath &name)=0
EffectHostInterface::GetUserPresetsGroup
virtual RegistryPath GetUserPresetsGroup(const RegistryPath &name)=0
Effect::ModifiedAnalysisTrack::get
LabelTrack * get() const
Definition: Effect.h:422
Effect::mOMap
std::vector< Track * > mOMap
Definition: Effect.h:521
ConfigClientInterface::HasPrivateConfigGroup
virtual bool HasPrivateConfigGroup(const RegistryPath &group)=0
key
static const AudacityProject::AttachedObjects::RegisteredFactory key
Definition: CommandManager.cpp:196
EffectUIClientInterface::PopulateUI
virtual bool PopulateUI(ShuttleGui &S)=0
ConfigClientInterface::SetPrivateConfig
virtual bool SetPrivateConfig(const RegistryPath &group, const RegistryPath &key, const wxString &value)=0
EffectClientInterface::IsReady
virtual bool IsReady()=0
Effect::SetPresetParameters
void SetPresetParameters(const wxArrayString *Names, const wxArrayString *Values)
Definition: Effect.h:250
Track
Abstract base class for an object holding data associated with points on a time axis.
Definition: Track.h:238
Effect::mUIParent
wxWindow * mUIParent
Definition: Effect.h:477
TaggedIdentifier< CommandIdTag, false >
sampleCount
Definition: Types.h:589
Effect::mNumGroups
int mNumGroups
Definition: Effect.h:524
AudacityProject
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
Definition: Project.h:112
EffectUIClientInterface::CloseUI
virtual bool CloseUI()=0
ConfigClientInterface::SetSharedConfig
virtual bool SetSharedConfig(const RegistryPath &group, const RegistryPath &key, const wxString &value)=0
EffectClientInterface::GetAudioInCount
virtual unsigned GetAudioInCount()=0
EffectUIHost
Definition: EffectUI.h:119
Effect::nEffectsDone
static int nEffectsDone
Definition: Effect.h:375
EffectClientInterface::GetBlockSize
virtual size_t GetBlockSize() const =0
Effect::ModifiedAnalysisTrack::ModifiedAnalysisTrack
ModifiedAnalysisTrack(const ModifiedAnalysisTrack &) PROHIBITED
EffectDefinitionInterface::IsLegacy
virtual bool IsLegacy()=0
TrapLong
long TrapLong(long x, long min, long max)
Definition: Effect.h:574
EffectUI::DoEffect
AUDACITY_DLL_API bool DoEffect(const PluginID &ID, const CommandContext &context, unsigned flags)
'Repeat Last Effect'.
Definition: EffectUI.cpp:1859
EffectClientInterface::RealtimeProcess
virtual size_t RealtimeProcess(int group, float **inBuf, float **outBuf, size_t numSamples)=0
Effect::GetNumWaveTracks
int GetNumWaveTracks()
Definition: Effect.h:344
TrapDouble
double TrapDouble(double x, double min, double max)
Definition: Effect.h:563
Effect::mPresetNames
wxArrayString mPresetNames
Definition: Effect.h:471
EffectUIClientInterface::CanExportPresets
virtual bool CanExportPresets()=0
Effect::kFactoryDefaultsIdent
static const wxString kFactoryDefaultsIdent
Definition: Effect.h:539
RegistryPath
wxString RegistryPath
Definition: Types.h:261
EffectClientInterface::GetAutomationParameters
virtual bool GetAutomationParameters(CommandParameters &parms)=0
ConfigClientInterface::GetPrivateConfigSubgroups
virtual bool GetPrivateConfigSubgroups(const RegistryPath &group, RegistryPaths &subgroups)=0
ConfigClientInterface::GetPrivateConfig
virtual bool GetPrivateConfig(const RegistryPath &group, const RegistryPath &key, wxString &value, const wxString &defval)=0
EffectClientInterface::RealtimeResume
virtual bool RealtimeResume()=0
ComponentInterface::GetVersion
virtual wxString GetVersion()=0
EffectUIClientInterface::IsGraphicalUI
virtual bool IsGraphicalUI()=0
EffectClientInterface::RealtimeProcessStart
virtual bool RealtimeProcessStart()=0
EffectType
EffectType
Definition: EffectInterface.h:55
Effect::kFactoryPresetIdent
static const wxString kFactoryPresetIdent
Definition: Effect.h:537
EffectUIClientInterface::ExportPresets
virtual void ExportPresets()=0
EffectUIClientInterface::HasOptions
virtual bool HasOptions()=0
EffectDefinitionInterface::GetFamily
virtual EffectFamilySymbol GetFamily()=0
Effect::mPresetValues
wxArrayString mPresetValues
Definition: Effect.h:472
Effect::mIMap
std::vector< Track * > mIMap
Definition: Effect.h:520
ConfigClientInterface::RemoveSharedConfig
virtual bool RemoveSharedConfig(const RegistryPath &group, const RegistryPath &key)=0
Effect::AddedAnalysisTrack::Effect
friend Effect
Definition: Effect.h:380
TrapFloat
float TrapFloat(float x, float min, float max)
Definition: Effect.h:552
ArrayOf
This simplifies arrays of arrays, each array separately allocated with NEW[] But it might be better t...
Definition: MemoryX.h:82
Effect::mPreviewWithNotSelected
bool mPreviewWithNotSelected
Definition: Effect.h:510
EffectClientInterface::SaveUserPreset
virtual bool SaveUserPreset(const RegistryPath &name)=0
EffectUIClientInterface::ValidateUI
virtual bool ValidateUI()=0
Effect::mClient
EffectClientInterface * mClient
Definition: Effect.h:527
EffectDefinitionInterface::IsDefault
virtual bool IsDefault()=0
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:638
EffectHostInterface::GetFactoryDefaultsGroup
virtual RegistryPath GetFactoryDefaultsGroup()=0
NotifyingSelectedRegion
Definition: ViewInfo.h:42
SelectedRegion
Defines a selected portion of a project.
Definition: SelectedRegion.h:38