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