Audacity  3.2.0
Classes | Public Member Functions | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | Friends | List of all members
NyquistEffect Class Referencefinal

An Effect that calls up a Nyquist (XLISP) plug-in, i.e. many possible effects from this one class. More...

#include <Nyquist.h>

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

Classes

struct  Tokenizer
 

Public Member Functions

 NyquistEffect (const wxString &fName)
 
virtual ~NyquistEffect ()
 
PluginPath GetPath () override
 
ComponentInterfaceSymbol GetSymbol () override
 
VendorSymbol GetVendor () override
 
wxString GetVersion () override
 
TranslatableString GetDescription () override
 
ManualPageID ManualPage () override
 Name of a page in the Audacity alpha manual, default is empty. More...
 
FilePath HelpPage () override
 Fully qualified local help file name, default is empty. More...
 
EffectType GetType () override
 Type determines how it behaves. More...
 
EffectType GetClassification () override
 Determines which menu it appears in; default same as GetType(). More...
 
EffectFamilySymbol GetFamily () override
 Report identifier and user-visible name of the effect protocol. More...
 
bool IsInteractive () override
 Whether the effect needs a dialog for entry of settings. More...
 
bool IsDefault () override
 Whether the effect sorts "above the line" in the menus. More...
 
bool EnablesDebug () override
 Whether the effect dialog should have a Debug button; default, always false. More...
 
bool GetAutomationParameters (CommandParameters &parms) override
 Save current settings into parms. More...
 
bool SetAutomationParameters (CommandParameters &parms) override
 Change settings to those stored in parms. More...
 
bool DefineParams (ShuttleParams &S) override
 
int SetLispVarsFromParameters (CommandParameters &parms, bool bTestOnly)
 
bool Init () override
 
bool CheckWhetherSkipEffect () override
 
bool Process () override
 
int ShowHostInterface (wxWindow &parent, const EffectDialogFactory &factory, bool forceModal=false) override
 
void PopulateOrExchange (ShuttleGui &S) override
 
bool TransferDataToWindow () override
 
bool TransferDataFromWindow () override
 
void RedirectOutput ()
 
void SetCommand (const wxString &cmd)
 
void Continue ()
 
void Break ()
 
void Stop ()
 
- Public Member Functions inherited from Effect
 Effect ()
 
virtual ~Effect ()
 
bool IsLegacy () override
 
bool SupportsRealtime () override
 Whether the effect supports realtime previewing (while audio is playing). More...
 
bool SupportsAutomation () override
 Whether the effect can be used without the UI, in a macro. More...
 
bool LoadUserPreset (const RegistryPath &name) override
 Change settings to a user-named preset. More...
 
bool SaveUserPreset (const RegistryPath &name) override
 Save current settings as a user-named preset. More...
 
RegistryPaths GetFactoryPresets () override
 Report names of factory presets. More...
 
bool LoadFactoryPreset (int id) override
 Change settings to the preset whose name is GetFactoryPresets()[id] More...
 
bool LoadFactoryDefaults () override
 Change settings back to "factory default". More...
 
bool SetHost (EffectHostInterface *host) override
 
unsigned GetAudioInCount () override
 
unsigned GetAudioOutCount () override
 
int GetMidiInCount () override
 
int GetMidiOutCount () override
 
sampleCount GetLatency () override
 Called for destructive, non-realtime effect computation. More...
 
size_t GetTailSize () override
 
void SetSampleRate (double rate) override
 
size_t SetBlockSize (size_t maxBlockSize) override
 
size_t GetBlockSize () const override
 
bool ProcessInitialize (sampleCount totalLen, ChannelNames chanMap=NULL) override
 Called for destructive, non-realtime effect computation. More...
 
bool ProcessFinalize () override
 Called for destructive, non-realtime effect computation. More...
 
size_t ProcessBlock (float **inBlock, float **outBlock, size_t blockLen) override
 Called for destructive, non-realtime effect computation. More...
 
bool RealtimeInitialize () override
 
bool RealtimeAddProcessor (unsigned numChannels, float sampleRate) override
 
bool RealtimeFinalize () override
 
bool RealtimeSuspend () override
 
bool RealtimeResume () noexcept override
 
bool RealtimeProcessStart () override
 
size_t RealtimeProcess (int group, float **inbuf, float **outbuf, size_t numSamples) override
 
bool RealtimeProcessEnd () noexcept override
 
int ShowClientInterface (wxWindow &parent, wxDialog &dialog, bool forceModal=false) override
 
bool PopulateUI (ShuttleGui &S) final
 Adds controls to a panel that is given as the parent window of S More...
 
bool IsGraphicalUI () override
 
bool ValidateUI () override
 
bool HideUI () override
 
bool CloseUI () override
 
bool CanExportPresets () override
 
void ExportPresets () override
 
void ImportPresets () override
 
bool HasOptions () override
 
void ShowOptions () override
 
EffectDefinitionInterfaceGetDefinition () override
 
double GetDuration () override
 
NumericFormatSymbol GetDurationFormat () override
 
virtual NumericFormatSymbol GetSelectionFormat ()
 
void SetDuration (double duration) override
 
RegistryPath GetUserPresetsGroup (const RegistryPath &name) override
 
RegistryPath GetCurrentSettingsGroup () override
 
RegistryPath GetFactoryDefaultsGroup () override
 
virtual wxString GetSavedStateGroup ()
 
unsigned TestUIFlags (unsigned mask)
 
void SetPresetParameters (const wxArrayString *Names, const wxArrayString *Values)
 
virtual bool Startup (EffectUIClientInterface *client)
 
virtual bool GetAutomationParametersAsString (wxString &parms)
 
virtual bool SetAutomationParametersFromString (const wxString &parms)
 
virtual bool IsBatchProcessing ()
 
virtual void SetBatchProcessing (bool start)
 
bool DoEffect (double projectRate, TrackList *list, WaveTrackFactory *factory, NotifyingSelectedRegion &selectedRegion, unsigned flags, wxWindow *pParent=nullptr, const EffectDialogFactory &dialogFactory={})
 
bool Delegate (Effect &delegate, wxWindow &parent, const EffectDialogFactory &factory)
 
int MessageBox (const TranslatableString &message, long style=DefaultMessageBoxStyle, const TranslatableString &titleStr={})
 
virtual bool Startup ()
 
- Public Member Functions inherited from EffectUIClientInterface
virtual ~EffectUIClientInterface ()
 
- Public Member Functions inherited from EffectProcessor
virtual ~EffectProcessor ()
 
- Public Member Functions inherited from EffectDefinitionInterface
virtual ~EffectDefinitionInterface ()
 
virtual bool IsHiddenFromMenus ()
 Default is false. More...
 
- Public Member Functions inherited from ComponentInterface
virtual ~ComponentInterface ()
 
TranslatableString GetName ()
 
virtual bool DefineParams (ShuttleParams &WXUNUSED(S))
 
- Public Member Functions inherited from EffectUIHostInterface
virtual ~EffectUIHostInterface ()
 
- Public Member Functions inherited from EffectHostInterface
virtual ~EffectHostInterface ()
 

Private Types

using Buffer = std::unique_ptr< float[]>
 

Private Member Functions

bool ProcessOne ()
 
void BuildPromptWindow (ShuttleGui &S)
 
void BuildEffectWindow (ShuttleGui &S)
 
bool TransferDataToPromptWindow ()
 
bool TransferDataToEffectWindow ()
 
bool TransferDataFromPromptWindow ()
 
bool TransferDataFromEffectWindow ()
 
bool IsOk ()
 
const TranslatableStringInitializationError () const
 
wxString EscapeString (const wxString &inStr)
 
FileExtensions ParseFileExtensions (const wxString &text)
 
FileNames::FileType ParseFileType (const wxString &text)
 
FileNames::FileTypes ParseFileTypes (const wxString &text)
 
int GetCallback (float *buffer, int channel, int64_t start, int64_t len, int64_t totlen)
 
int PutCallback (float *buffer, int channel, int64_t start, int64_t len, int64_t totlen)
 
void OutputCallback (int c)
 
void OSCallback ()
 
void ParseFile ()
 
bool ParseCommand (const wxString &cmd)
 
bool ParseProgram (wxInputStream &stream)
 
bool Parse (Tokenizer &tokenizer, const wxString &line, bool eof, bool first)
 
double GetCtrlValue (const wxString &s)
 
void OnLoad (wxCommandEvent &evt)
 
void OnSave (wxCommandEvent &evt)
 
void OnDebug (wxCommandEvent &evt)
 
void OnText (wxCommandEvent &evt)
 
void OnSlider (wxCommandEvent &evt)
 
void OnChoice (wxCommandEvent &evt)
 
void OnTime (wxCommandEvent &evt)
 
void OnFileButton (wxCommandEvent &evt)
 
void resolveFilePath (wxString &path, FileExtension extension={})
 
bool validatePath (wxString path)
 
wxString ToTimeFormat (double t)
 

Static Private Member Functions

static FilePaths GetNyquistSearchPath ()
 
static wxString NyquistToWxString (const char *nyqString)
 
static std::vector< EnumValueSymbolParseChoice (const wxString &text)
 
static int StaticGetCallback (float *buffer, int channel, int64_t start, int64_t len, int64_t totlen, void *userdata)
 
static int StaticPutCallback (float *buffer, int channel, int64_t start, int64_t len, int64_t totlen, void *userdata)
 
static void StaticOutputCallback (int c, void *userdata)
 
static void StaticOSCallback (void *userdata)
 
static TranslatableString UnQuoteMsgid (const wxString &s, bool allowParens=true, wxString *pExtraString=nullptr)
 
static wxString UnQuote (const wxString &s, bool allowParens=true, wxString *pExtraString=nullptr)
 

Private Attributes

wxString mXlispPath
 
wxFileName mFileName
 Name of the Nyquist script file this effect is loaded from. More...
 
wxDateTime mFileModified
 When the script was last modified on disk. More...
 
bool mStop
 
bool mBreak
 
bool mCont
 
bool mFoundType
 
bool mCompiler
 
bool mTrace
 
bool mIsSal
 
bool mExternal
 
bool mIsSpectral
 
bool mIsTool
 
bool mIsPrompt
 
bool mOK
 
TranslatableString mInitError
 
wxString mInputCmd
 
wxString mParameters
 
wxString mCmd
 
TranslatableString mName
 Name of the Effect (untranslated) More...
 
TranslatableString mPromptName
 
TranslatableString mAction
 
TranslatableString mInfo
 
TranslatableString mAuthor
 
TranslatableString mReleaseVersion
 
TranslatableString mCopyright
 
wxString mManPage
 
wxString mHelpFile
 
bool mHelpFileExists
 
EffectType mType
 
EffectType mPromptType
 
bool mEnablePreview
 
bool mDebugButton
 
bool mDebug
 
bool mRedirectOutput
 
bool mProjectChanged
 
wxString mDebugOutputStr
 
TranslatableString mDebugOutput
 
int mVersion
 
std::vector< NyqControlmControls
 
unsigned mCurNumChannels
 
WaveTrackmCurTrack [2]
 
sampleCount mCurStart [2]
 
sampleCount mCurLen
 
sampleCount mMaxLen
 
int mTrackIndex
 
bool mFirstInGroup
 
double mOutputTime
 
unsigned mCount
 
unsigned mNumSelectedChannels
 
double mProgressIn
 
double mProgressOut
 
double mProgressTot
 
double mScale
 
Buffer mCurBuffer [2]
 
sampleCount mCurBufferStart [2]
 
size_t mCurBufferLen [2]
 
WaveTrackmOutputTrack [2]
 
wxArrayString mCategories
 
wxString mProps
 
wxString mPerTrackProps
 
bool mRestoreSplits
 
int mMergeClips
 
wxTextCtrl * mCommandText
 
std::exception_ptr mpException {}
 

Static Private Attributes

static int mReentryCount = 0
 

Friends

class NyquistEffectsModule
 

Additional Inherited Members

- Public Types inherited from Effect
enum  : long { DefaultMessageBoxStyle = wxOK | wxCENTRE }
 
- Static Public Member Functions inherited from Effect
static void IncEffectCounter ()
 
- Static Public Member Functions inherited from EffectDefinitionInterface
static Identifier GetSquashedName (const Identifier &ident)
 A utility that strips spaces and CamelCases a name. More...
 
- Static Public Attributes inherited from Effect
static const wxString kUserPresetIdent = wxT("User Preset:")
 
static const wxString kFactoryPresetIdent = wxT("Factory Preset:")
 
static const wxString kCurrentSettingsIdent = wxT("<Current Settings>")
 
static const wxString kFactoryDefaultsIdent = wxT("<Factory Defaults>")
 
- Protected Member Functions inherited from Effect
bool EnableApply (bool enable=true)
 
bool EnablePreview (bool enable=true)
 
virtual bool ProcessPass ()
 
virtual bool InitPass1 ()
 
virtual bool InitPass2 ()
 
virtual void End ()
 
virtual double CalcPreviewInputLength (double previewLength)
 
virtual void Preview (bool dryOnly)
 
bool TotalProgress (double frac, const TranslatableString &={})
 
bool TrackProgress (int whichTrack, double frac, const TranslatableString &={})
 
bool TrackGroupProgress (int whichGroup, double frac, const TranslatableString &={})
 
int GetNumWaveTracks ()
 
int GetNumWaveGroups ()
 
void GetBounds (const WaveTrack &track, const WaveTrack *pRight, sampleCount *start, sampleCount *len)
 
void SetLinearEffectFlag (bool linearEffectFlag)
 
void SetPreviewFullSelectionFlag (bool previewDurationFlag)
 
bool IsPreviewing ()
 
void IncludeNotSelectedPreviewTracks (bool includeNotSelected)
 
void CopyInputTracks (bool allSyncLockSelected=false)
 
std::shared_ptr< AddedAnalysisTrackAddAnalysisTrack (const wxString &name=wxString())
 
ModifiedAnalysisTrack ModifyAnalysisTrack (const LabelTrack *pOrigTrack, const wxString &name=wxString())
 
void ReplaceProcessedTracks (const bool bGoodResult)
 
TrackAddToOutputTracks (const std::shared_ptr< Track > &t)
 
const TrackListinputTracks () const
 
const AudacityProjectFindProject () const
 
- Protected Attributes inherited from Effect
BasicUI::ProgressDialogmProgress = nullptr
 
double mProjectRate
 
double mSampleRate
 
WaveTrackFactorymFactory
 
std::shared_ptr< TrackListmOutputTracks
 
double mT0
 
double mT1
 
wxArrayString mPresetNames
 
wxArrayString mPresetValues
 
int mPass
 
wxWeakRef< wxDialog > mHostUIDialog
 This smart pointer tracks the lifetime of the dialog. More...
 
wxWeakRef< wxDialog > mUIDialog
 This weak pointer may be the same as the above, or null. More...
 
wxWindow * mUIParent
 
unsigned mUIFlags { 0 }
 
sampleCount mSampleCnt
 
- Static Protected Attributes inherited from Effect
static int nEffectsDone =0
 

Detailed Description

An Effect that calls up a Nyquist (XLISP) plug-in, i.e. many possible effects from this one class.

Definition at line 64 of file Nyquist.h.

Member Typedef Documentation

◆ Buffer

using NyquistEffect::Buffer = std::unique_ptr<float[]>
private

Definition at line 272 of file Nyquist.h.

Constructor & Destructor Documentation

◆ NyquistEffect()

NyquistEffect::NyquistEffect ( const wxString &  fName)
Parameters
fNameFile name of the Nyquist script defining this effect. If an empty string, then prompt the user for the Nyquist code to interpret.

◆ ~NyquistEffect()

NyquistEffect::~NyquistEffect ( )
virtual

Definition at line 200 of file Nyquist.cpp.

201 {
202 }

Member Function Documentation

◆ Break()

void NyquistEffect::Break ( )

Definition at line 1791 of file Nyquist.cpp.

1792 {
1793  mBreak = true;
1794 }

References mBreak.

◆ BuildEffectWindow()

void NyquistEffect::BuildEffectWindow ( ShuttleGui S)
private

Definition at line 2834 of file Nyquist.cpp.

2835 {
2836  wxScrolledWindow *scroller = S.Style(wxVSCROLL | wxTAB_TRAVERSAL)
2837  .StartScroller(2);
2838  {
2839  S.StartMultiColumn(4);
2840  {
2841  for (size_t i = 0; i < mControls.size(); i++)
2842  {
2843  NyqControl & ctrl = mControls[i];
2844 
2845  if (ctrl.type == NYQ_CTRL_TEXT)
2846  {
2847  S.EndMultiColumn();
2848  S.StartHorizontalLay(wxALIGN_LEFT, 0);
2849  {
2850  S.AddSpace(0, 10);
2851  S.AddFixedText( Verbatim( ctrl.label ), false );
2852  }
2853  S.EndHorizontalLay();
2854  S.StartMultiColumn(4);
2855  }
2856  else
2857  {
2858  auto prompt = XXO("%s:").Format( ctrl.name );
2859  S.AddPrompt( prompt );
2860 
2861  if (ctrl.type == NYQ_CTRL_STRING)
2862  {
2863  S.AddSpace(10, 10);
2864 
2865  auto item = S.Id(ID_Text + i)
2866  .Validator<wxGenericValidator>(&ctrl.valStr)
2867  .Name( prompt )
2868  .AddTextBox( {}, wxT(""), 50);
2869  }
2870  else if (ctrl.type == NYQ_CTRL_CHOICE)
2871  {
2872  S.AddSpace(10, 10);
2873 
2874  S.Id(ID_Choice + i).AddChoice( {},
2875  Msgids( ctrl.choices.data(), ctrl.choices.size() ) );
2876  }
2877  else if (ctrl.type == NYQ_CTRL_TIME)
2878  {
2879  S.AddSpace(10, 10);
2880 
2881  const auto options = NumericTextCtrl::Options{}
2882  .AutoPos(true)
2883  .MenuEnabled(true)
2884  .ReadOnly(false);
2885 
2886  NumericTextCtrl *time = safenew
2887  NumericTextCtrl(S.GetParent(), (ID_Time + i),
2890  ctrl.val,
2891  mProjectRate,
2892  options);
2893  S
2894  .Name( prompt )
2895  .Position(wxALIGN_LEFT | wxALL)
2896  .AddWindow(time);
2897  }
2898  else if (ctrl.type == NYQ_CTRL_FILE)
2899  {
2900  S.AddSpace(10, 10);
2901 
2902  // Get default file extension if specified in wildcards
2903  FileExtension defaultExtension;
2904  if (!ctrl.fileTypes.empty()) {
2905  const auto &type = ctrl.fileTypes[0];
2906  if ( !type.extensions.empty() )
2907  defaultExtension = type.extensions[0];
2908  }
2909  resolveFilePath(ctrl.valStr, defaultExtension);
2910 
2911  wxTextCtrl *item = S.Id(ID_Text+i)
2912  .Name( prompt )
2913  .AddTextBox( {}, wxT(""), 40);
2914  item->SetValidator(wxGenericValidator(&ctrl.valStr));
2915 
2916  if (ctrl.label.empty())
2917  // We'd expect wxFileSelectorPromptStr to already be translated, but apparently not.
2918  ctrl.label = wxGetTranslation( wxFileSelectorPromptStr );
2919  S.Id(ID_FILE + i).AddButton(
2920  Verbatim(ctrl.label), wxALIGN_LEFT);
2921  }
2922  else
2923  {
2924  // Integer or Real
2925  if (ctrl.type == NYQ_CTRL_INT_TEXT || ctrl.type == NYQ_CTRL_FLOAT_TEXT)
2926  {
2927  S.AddSpace(10, 10);
2928  }
2929 
2930  S.Id(ID_Text+i);
2931  if (ctrl.type == NYQ_CTRL_FLOAT || ctrl.type == NYQ_CTRL_FLOAT_TEXT)
2932  {
2933  double range = ctrl.high - ctrl.low;
2934  S.Validator<FloatingPointValidator<double>>(
2935  // > 12 decimal places can cause rounding errors in display.
2936  12, &ctrl.val,
2937  // Set number of decimal places
2938  (range < 10
2939  ? NumValidatorStyle::THREE_TRAILING_ZEROES
2940  : range < 100
2941  ? NumValidatorStyle::TWO_TRAILING_ZEROES
2942  : NumValidatorStyle::ONE_TRAILING_ZERO),
2943  ctrl.low, ctrl.high
2944  );
2945  }
2946  else
2947  {
2948  S.Validator<IntegerValidator<double>>(
2949  &ctrl.val, NumValidatorStyle::DEFAULT,
2950  (int) ctrl.low, (int) ctrl.high);
2951  }
2952  wxTextCtrl *item = S
2953  .Name( prompt )
2954  .AddTextBox( {}, wxT(""),
2955  (ctrl.type == NYQ_CTRL_INT_TEXT ||
2956  ctrl.type == NYQ_CTRL_FLOAT_TEXT) ? 25 : 12);
2957 
2958  if (ctrl.type == NYQ_CTRL_INT || ctrl.type == NYQ_CTRL_FLOAT)
2959  {
2960  S.Id(ID_Slider + i)
2961  .Style(wxSL_HORIZONTAL)
2962  .MinSize( { 150, -1 } )
2963  .AddSlider( {}, 0, ctrl.ticks, 0);
2964  }
2965  }
2966 
2967  if (ctrl.type != NYQ_CTRL_FILE)
2968  {
2969  if (ctrl.type == NYQ_CTRL_CHOICE || ctrl.label.empty())
2970  {
2971  S.AddSpace(10, 10);
2972  }
2973  else
2974  {
2975  S.AddUnits( Verbatim( ctrl.label ) );
2976  }
2977  }
2978  }
2979  }
2980  }
2981  S.EndMultiColumn();
2982  }
2983  S.EndScroller();
2984 
2985  scroller->SetScrollRate(0, 20);
2986 
2987  // This fools NVDA into not saying "Panel" when the dialog gets focus
2988  scroller->SetName(wxT("\a"));
2989  scroller->SetLabel(wxT("\a"));
2990 }

References NumericTextCtrl::Options::AutoPos(), NyqControl::choices, NyqControl::fileTypes, Effect::GetSelectionFormat(), NyqControl::high, ID_Choice, ID_FILE, ID_Slider, ID_Text, ID_Time, NyqControl::label, NyqControl::low, mControls, NumericTextCtrl::Options::MenuEnabled(), Effect::mProjectRate, Msgids(), NyqControl::name, NYQ_CTRL_CHOICE, NYQ_CTRL_FILE, NYQ_CTRL_FLOAT, NYQ_CTRL_FLOAT_TEXT, NYQ_CTRL_INT, NYQ_CTRL_INT_TEXT, NYQ_CTRL_STRING, NYQ_CTRL_TEXT, NYQ_CTRL_TIME, NumericTextCtrl::Options::ReadOnly(), resolveFilePath(), S, safenew, NyqControl::ticks, NumericConverter::TIME, NyqControl::type, NyqControl::val, NyqControl::valStr, Verbatim(), and XXO.

Referenced by PopulateOrExchange().

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

◆ BuildPromptWindow()

void NyquistEffect::BuildPromptWindow ( ShuttleGui S)
private

Definition at line 2802 of file Nyquist.cpp.

2803 {
2804  S.StartVerticalLay();
2805  {
2806  S.StartMultiColumn(3, wxEXPAND);
2807  {
2808  S.SetStretchyCol(1);
2809 
2810  S.AddVariableText(XO("Enter Nyquist Command: "));
2811 
2812  S.AddSpace(1, 1);
2813  }
2814  S.EndMultiColumn();
2815 
2816  S.StartHorizontalLay(wxEXPAND, 1);
2817  {
2818  mCommandText = S.Focus()
2819  .MinSize( { 500, 200 } )
2820  .AddTextWindow(wxT(""));
2821  }
2822  S.EndHorizontalLay();
2823 
2824  S.StartHorizontalLay(wxALIGN_CENTER, 0);
2825  {
2826  S.Id(ID_Load).AddButton(XXO("&Load"));
2827  S.Id(ID_Save).AddButton(XXO("&Save"));
2828  }
2829  S.EndHorizontalLay();
2830  }
2831  S.EndVerticalLay();
2832 }

References ID_Load, ID_Save, mCommandText, S, XO, and XXO.

Referenced by PopulateOrExchange().

Here is the caller graph for this function:

◆ CheckWhetherSkipEffect()

bool NyquistEffect::CheckWhetherSkipEffect ( )
overridevirtual

Reimplemented from Effect.

Definition at line 635 of file Nyquist.cpp.

636 {
637  // If we're a prompt and we have controls, then we've already processed
638  // the audio, so skip further processing.
639  return (mIsPrompt && mControls.size() > 0 && !IsBatchProcessing());
640 }

References Effect::IsBatchProcessing(), mControls, and mIsPrompt.

Here is the call graph for this function:

◆ Continue()

void NyquistEffect::Continue ( )

Definition at line 1796 of file Nyquist.cpp.

1797 {
1798  mCont = true;
1799 }

References mCont.

◆ DefineParams()

bool NyquistEffect::DefineParams ( ShuttleParams S)
override

Definition at line 301 of file Nyquist.cpp.

302 {
303  // For now we assume Nyquist can do get and set better than DefineParams can,
304  // And so we ONLY use it for getting the signature.
305  auto pGa = dynamic_cast<ShuttleGetAutomation*>(&S);
306  if( pGa ){
307  GetAutomationParameters( *(pGa->mpEap) );
308  return true;
309  }
310  auto pSa = dynamic_cast<ShuttleSetAutomation*>(&S);
311  if( pSa ){
312  SetAutomationParameters( *(pSa->mpEap) );
313  return true;
314  }
315  auto pSd = dynamic_cast<ShuttleGetDefinition*>(&S);
316  if( pSd == nullptr )
317  return true;
318  //wxASSERT( pSd );
319 
320  if (mExternal)
321  return true;
322 
323  if (mIsPrompt)
324  {
325  S.Define( mInputCmd, KEY_Command, "" );
326  S.Define( mParameters, KEY_Parameters, "" );
327  return true;
328  }
329 
330  for (size_t c = 0, cnt = mControls.size(); c < cnt; c++)
331  {
332  NyqControl & ctrl = mControls[c];
333  double d = ctrl.val;
334 
335  if (d == UNINITIALIZED_CONTROL && ctrl.type != NYQ_CTRL_STRING)
336  {
337  d = GetCtrlValue(ctrl.valStr);
338  }
339 
340  if (ctrl.type == NYQ_CTRL_FLOAT || ctrl.type == NYQ_CTRL_FLOAT_TEXT ||
341  ctrl.type == NYQ_CTRL_TIME)
342  {
343  S.Define( d, static_cast<const wxChar*>( ctrl.var.c_str() ), (double)0.0, ctrl.low, ctrl.high, 1.0);
344  }
345  else if (ctrl.type == NYQ_CTRL_INT || ctrl.type == NYQ_CTRL_INT_TEXT)
346  {
347  int x=d;
348  S.Define( x, static_cast<const wxChar*>( ctrl.var.c_str() ), 0, ctrl.low, ctrl.high, 1);
349  //parms.Write(ctrl.var, (int) d);
350  }
351  else if (ctrl.type == NYQ_CTRL_CHOICE)
352  {
353  // untranslated
354  int x=d;
355  //parms.WriteEnum(ctrl.var, (int) d, choices);
356  S.DefineEnum( x, static_cast<const wxChar*>( ctrl.var.c_str() ), 0,
357  ctrl.choices.data(), ctrl.choices.size() );
358  }
359  else if (ctrl.type == NYQ_CTRL_STRING || ctrl.type == NYQ_CTRL_FILE)
360  {
361  S.Define( ctrl.valStr, ctrl.var, "" , ctrl.lowStr, ctrl.highStr );
362  //parms.Write(ctrl.var, ctrl.valStr);
363  }
364  }
365  return true;
366 }

References NyqControl::choices, GetAutomationParameters(), GetCtrlValue(), NyqControl::high, NyqControl::highStr, KEY_Command, KEY_Parameters, NyqControl::low, NyqControl::lowStr, mControls, mExternal, mInputCmd, mIsPrompt, mParameters, NYQ_CTRL_CHOICE, NYQ_CTRL_FILE, NYQ_CTRL_FLOAT, NYQ_CTRL_FLOAT_TEXT, NYQ_CTRL_INT, NYQ_CTRL_INT_TEXT, NYQ_CTRL_STRING, NYQ_CTRL_TIME, S, SetAutomationParameters(), NyqControl::type, UNINITIALIZED_CONTROL, NyqControl::val, NyqControl::valStr, and NyqControl::var.

Here is the call graph for this function:

◆ EnablesDebug()

bool NyquistEffect::EnablesDebug ( )
overridevirtual

Whether the effect dialog should have a Debug button; default, always false.

Reimplemented from EffectDefinitionInterface.

Definition at line 1083 of file Nyquist.cpp.

1084 {
1085  return mDebugButton;
1086 }

References mDebugButton.

◆ EscapeString()

wxString NyquistEffect::EscapeString ( const wxString &  inStr)
private

Definition at line 1669 of file Nyquist.cpp.

1670 {
1671  wxString str = inStr;
1672 
1673  str.Replace(wxT("\\"), wxT("\\\\"));
1674  str.Replace(wxT("\""), wxT("\\\""));
1675 
1676  return str;
1677 }

References str.

Referenced by Process(), and ProcessOne().

Here is the caller graph for this function:

◆ GetAutomationParameters()

bool NyquistEffect::GetAutomationParameters ( CommandParameters parms)
overridevirtual

Save current settings into parms.

Reimplemented from Effect.

Definition at line 368 of file Nyquist.cpp.

369 {
370  if (mIsPrompt)
371  {
372  parms.Write(KEY_Command, mInputCmd);
373  parms.Write(KEY_Parameters, mParameters);
374 
375  return true;
376  }
377 
378  for (size_t c = 0, cnt = mControls.size(); c < cnt; c++)
379  {
380  NyqControl & ctrl = mControls[c];
381  double d = ctrl.val;
382 
383  if (d == UNINITIALIZED_CONTROL && ctrl.type != NYQ_CTRL_STRING)
384  {
385  d = GetCtrlValue(ctrl.valStr);
386  }
387 
388  if (ctrl.type == NYQ_CTRL_FLOAT || ctrl.type == NYQ_CTRL_FLOAT_TEXT ||
389  ctrl.type == NYQ_CTRL_TIME)
390  {
391  parms.Write(ctrl.var, d);
392  }
393  else if (ctrl.type == NYQ_CTRL_INT || ctrl.type == NYQ_CTRL_INT_TEXT)
394  {
395  parms.Write(ctrl.var, (int) d);
396  }
397  else if (ctrl.type == NYQ_CTRL_CHOICE)
398  {
399  // untranslated
400  parms.WriteEnum(ctrl.var, (int) d,
401  ctrl.choices.data(), ctrl.choices.size());
402  }
403  else if (ctrl.type == NYQ_CTRL_STRING)
404  {
405  parms.Write(ctrl.var, ctrl.valStr);
406  }
407  else if (ctrl.type == NYQ_CTRL_FILE)
408  {
409  resolveFilePath(ctrl.valStr);
410  parms.Write(ctrl.var, ctrl.valStr);
411  }
412  }
413 
414  return true;
415 }

References NyqControl::choices, GetCtrlValue(), KEY_Command, KEY_Parameters, mControls, mInputCmd, mIsPrompt, mParameters, NYQ_CTRL_CHOICE, NYQ_CTRL_FILE, NYQ_CTRL_FLOAT, NYQ_CTRL_FLOAT_TEXT, NYQ_CTRL_INT, NYQ_CTRL_INT_TEXT, NYQ_CTRL_STRING, NYQ_CTRL_TIME, resolveFilePath(), NyqControl::type, UNINITIALIZED_CONTROL, NyqControl::val, NyqControl::valStr, NyqControl::var, and CommandParameters::WriteEnum().

Referenced by DefineParams(), and ShowHostInterface().

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

◆ GetCallback()

int NyquistEffect::GetCallback ( float *  buffer,
int  channel,
int64_t  start,
int64_t  len,
int64_t  totlen 
)
private

Definition at line 2442 of file Nyquist.cpp.

2444 {
2445  if (mCurBuffer[ch]) {
2446  if ((mCurStart[ch] + start) < mCurBufferStart[ch] ||
2447  (mCurStart[ch] + start)+len >
2448  mCurBufferStart[ch]+mCurBufferLen[ch]) {
2449  mCurBuffer[ch].reset();
2450  }
2451  }
2452 
2453  if (!mCurBuffer[ch]) {
2454  mCurBufferStart[ch] = (mCurStart[ch] + start);
2456 
2457  if (mCurBufferLen[ch] < (size_t) len) {
2459  }
2460 
2461  mCurBufferLen[ch] =
2463  mCurStart[ch] + mCurLen - mCurBufferStart[ch] );
2464 
2465  // C++20
2466  // mCurBuffer[ch] = std::make_unique_for_overwrite(mCurBufferLen[ch]);
2467  mCurBuffer[ch] = Buffer{ safenew float[ mCurBufferLen[ch] ] };
2468  try {
2469  mCurTrack[ch]->GetFloats( mCurBuffer[ch].get(),
2470  mCurBufferStart[ch], mCurBufferLen[ch]);
2471  }
2472  catch ( ... ) {
2473  // Save the exception object for re-throw when out of the library
2474  mpException = std::current_exception();
2475  return -1;
2476  }
2477  }
2478 
2479  // We have guaranteed above that this is nonnegative and bounded by
2480  // mCurBufferLen[ch]:
2481  auto offset = ( mCurStart[ch] + start - mCurBufferStart[ch] ).as_size_t();
2482  const void *src = &mCurBuffer[ch][offset];
2483  std::memcpy(buffer, src, len * sizeof(float));
2484 
2485  if (ch == 0) {
2486  double progress = mScale *
2487  ( (start+len)/ mCurLen.as_double() );
2488 
2489  if (progress > mProgressIn) {
2490  mProgressIn = progress;
2491  }
2492 
2494  return -1;
2495  }
2496  }
2497 
2498  return 0;
2499 }

References sampleCount::as_double(), WaveTrack::GetBestBlockSize(), SampleTrack::GetFloats(), WaveTrack::GetIdealBlockSize(), limitSampleBufferSize(), mCurBuffer, mCurBufferLen, mCurBufferStart, mCurLen, mCurStart, mCurTrack, mpException, mProgressIn, mProgressOut, mProgressTot, mScale, safenew, and Effect::TotalProgress().

Referenced by StaticGetCallback().

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

◆ GetClassification()

EffectType NyquistEffect::GetClassification ( )
overridevirtual

Determines which menu it appears in; default same as GetType().

Reimplemented from EffectDefinitionInterface.

Definition at line 273 of file Nyquist.cpp.

274 {
275  if (mIsTool)
276  return EffectTypeTool;
277  return mType;
278 }

References EffectTypeTool, mIsTool, and mType.

◆ GetCtrlValue()

double NyquistEffect::GetCtrlValue ( const wxString &  s)
private

Definition at line 1853 of file Nyquist.cpp.

1854 {
1855  /* For this to work correctly requires that the plug-in header is
1856  * parsed on each run so that the correct value for "half-srate" may
1857  * be determined.
1858  *
1859  auto project = FindProject();
1860  if (project && s.IsSameAs(wxT("half-srate"), false)) {
1861  auto rate =
1862  TrackList::Get( *project ).Selected< const WaveTrack >()
1863  .min( &WaveTrack::GetRate );
1864  return (rate / 2.0);
1865  }
1866  */
1867 
1868  return Internat::CompatibleToDouble(s);
1869 }

References Internat::CompatibleToDouble().

Referenced by DefineParams(), GetAutomationParameters(), Parse(), SetLispVarsFromParameters(), and TransferDataFromEffectWindow().

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

◆ GetDescription()

TranslatableString NyquistEffect::GetDescription ( )
overridevirtual

Reimplemented from Effect.

Definition at line 239 of file Nyquist.cpp.

240 {
241  return mCopyright;
242 }

References mCopyright.

◆ GetFamily()

EffectFamilySymbol NyquistEffect::GetFamily ( )
overridevirtual

Report identifier and user-visible name of the effect protocol.

Reimplemented from Effect.

Definition at line 280 of file Nyquist.cpp.

281 {
282  return NYQUISTEFFECTS_FAMILY;
283 }

References NYQUISTEFFECTS_FAMILY.

◆ GetNyquistSearchPath()

FilePaths NyquistEffect::GetNyquistSearchPath ( )
staticprivate

Definition at line 2583 of file Nyquist.cpp.

2584 {
2585  const auto &audacityPathList = FileNames::AudacityPathList();
2586  FilePaths pathList;
2587 
2588  for (size_t i = 0; i < audacityPathList.size(); i++)
2589  {
2590  wxString prefix = audacityPathList[i] + wxFILE_SEP_PATH;
2591  FileNames::AddUniquePathToPathList(prefix + wxT("nyquist"), pathList);
2592  FileNames::AddUniquePathToPathList(prefix + wxT("plugins"), pathList);
2593  FileNames::AddUniquePathToPathList(prefix + wxT("plug-ins"), pathList);
2594  }
2595  pathList.push_back(FileNames::PlugInDir());
2596 
2597  return pathList;
2598 }

References FileNames::AddUniquePathToPathList(), FileNames::AudacityPathList(), and FileNames::PlugInDir().

Referenced by NyquistEffectsModule::AutoRegisterPlugins(), NyquistEffectsModule::FindPluginPaths(), HelpPage(), and Process().

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

◆ GetPath()

PluginPath NyquistEffect::GetPath ( )
overridevirtual

Reimplemented from Effect.

Definition at line 206 of file Nyquist.cpp.

207 {
208  if (mIsPrompt)
209  return NYQUIST_PROMPT_ID;
210 
211  return mFileName.GetFullPath();
212 }

References mFileName, mIsPrompt, and NYQUIST_PROMPT_ID.

◆ GetSymbol()

ComponentInterfaceSymbol NyquistEffect::GetSymbol ( )
overridevirtual

Reimplemented from Effect.

Definition at line 214 of file Nyquist.cpp.

215 {
216  if (mIsPrompt)
218 
219  return mName;
220 }

References mIsPrompt, mName, NYQUIST_PROMPT_ID, and NYQUIST_PROMPT_NAME.

◆ GetType()

EffectType NyquistEffect::GetType ( )
overridevirtual

Type determines how it behaves.

Reimplemented from Effect.

Definition at line 268 of file Nyquist.cpp.

269 {
270  return mType;
271 }

References mType.

Referenced by Process(), and ProcessOne().

Here is the caller graph for this function:

◆ GetVendor()

VendorSymbol NyquistEffect::GetVendor ( )
overridevirtual

Reimplemented from Effect.

Definition at line 222 of file Nyquist.cpp.

223 {
224  if (mIsPrompt)
225  {
226  return XO("Audacity");
227  }
228 
229  return mAuthor;
230 }

References mAuthor, mIsPrompt, and XO.

◆ GetVersion()

wxString NyquistEffect::GetVersion ( )
overridevirtual

Reimplemented from Effect.

Definition at line 232 of file Nyquist.cpp.

233 {
234  // Are Nyquist version strings really supposed to be translatable?
235  // See commit a06e561 which used XO for at least one of them
236  return mReleaseVersion.Translation();
237 }

References mReleaseVersion, and TranslatableString::Translation().

Here is the call graph for this function:

◆ HelpPage()

FilePath NyquistEffect::HelpPage ( )
overridevirtual

Fully qualified local help file name, default is empty.

Reimplemented from EffectDefinitionInterface.

Definition at line 251 of file Nyquist.cpp.

252 {
254  wxString fileName;
255 
256  for (size_t i = 0, cnt = paths.size(); i < cnt; i++) {
257  fileName = wxFileName(paths[i] + wxT("/") + mHelpFile).GetFullPath();
258  if (wxFileExists(fileName)) {
259  mHelpFileExists = true;
260  return fileName;
261  }
262  }
263  return wxEmptyString;
264 }

References GetNyquistSearchPath(), mHelpFile, and mHelpFileExists.

Here is the call graph for this function:

◆ Init()

bool NyquistEffect::Init ( )
overridevirtual

Reimplemented from Effect.

Definition at line 545 of file Nyquist.cpp.

546 {
547  // When Nyquist Prompt spawns an effect GUI, Init() is called for Nyquist Prompt,
548  // and then again for the spawned (mExternal) effect.
549 
550  // EffectType may not be defined in script, so
551  // reset each time we call the Nyquist Prompt.
552  if (mIsPrompt) {
553  mName = mPromptName;
554  // Reset effect type each time we call the Nyquist Prompt.
555  mType = mPromptType;
556  mIsSpectral = false;
557  mDebugButton = true; // Debug button always enabled for Nyquist Prompt.
558  mEnablePreview = true; // Preview button always enabled for Nyquist Prompt.
559  mVersion = 4;
560  }
561 
562  // As of Audacity 2.1.2 rc1, 'spectral' effects are allowed only if
563  // the selected track(s) are in a spectrogram view, and there is at
564  // least one frequency bound and Spectral Selection is enabled for the
565  // selected track(s) - (but don't apply to Nyquist Prompt).
566 
567  if (!mIsPrompt && mIsSpectral) {
568  auto *project = FindProject();
569  bool bAllowSpectralEditing = false;
570  bool hasSpectral = false;
571 
572  for ( auto t :
573  TrackList::Get( *project ).Selected< const WaveTrack >() ) {
574  // Find() not Get() to avoid creation-on-demand of views in case we are
575  // only previewing
576  auto pView = WaveTrackView::Find( t );
577  if ( pView ) {
578  const auto displays = pView->GetDisplays();
579  if (displays.end() != std::find(
580  displays.begin(), displays.end(),
581  WaveTrackSubView::Type{ WaveTrackViewConstants::Spectrum, {} }))
582  hasSpectral = true;
583  }
584  if ( hasSpectral &&
585  (t->GetSpectrogramSettings().SpectralSelectionEnabled())) {
586  bAllowSpectralEditing = true;
587  break;
588  }
589  }
590 
591  if (!bAllowSpectralEditing || ((mF0 < 0.0) && (mF1 < 0.0))) {
592  if (!hasSpectral) {
594  XO("Enable track spectrogram view before\n"
595  "applying 'Spectral' effects."),
596  wxOK | wxICON_EXCLAMATION | wxCENTRE,
597  XO("Error") );
598  } else {
600  XO("To use 'Spectral effects', enable 'Spectral Selection'\n"
601  "in the track Spectrogram settings and select the\n"
602  "frequency range for the effect to act on."),
603  wxOK | wxICON_EXCLAMATION | wxCENTRE,
604  XO("Error") );
605  }
606  return false;
607  }
608  }
609 
610  if (!mIsPrompt && !mExternal)
611  {
612  //TODO: (bugs):
613  // 1) If there is more than one plug-in with the same name, GetModificationTime may pick the wrong one.
614  // 2) If the ;type is changed after the effect has been registered, the plug-in will appear in the wrong menu.
615 
616  //TODO: If we want to auto-add parameters from spectral selection,
617  //we will need to modify this test.
618  //Note that removing it stops the caching of parameter values,
619  //(during this session).
620  if (mFileName.GetModificationTime().IsLaterThan(mFileModified))
621  {
623 
625  ParseFile();
626  mFileModified = mFileName.GetModificationTime();
627 
629  }
630  }
631 
632  return true;
633 }

References WaveTrackView::Find(), Effect::FindProject(), TrackList::Get(), mDebugButton, mEnablePreview, Effect::MessageBox(), mIsPrompt, mIsSpectral, mName, mPromptName, mPromptType, mType, mVersion, TrackList::Selected(), and XO.

Here is the call graph for this function:

◆ InitializationError()

const TranslatableString& NyquistEffect::InitializationError ( ) const
inlineprivate

Definition at line 137 of file Nyquist.h.

137 { return mInitError; }

Referenced by NyquistEffectsModule::DiscoverPluginsAtPath().

Here is the caller graph for this function:

◆ IsDefault()

bool NyquistEffect::IsDefault ( )
overridevirtual

Whether the effect sorts "above the line" in the menus.

Reimplemented from Effect.

Definition at line 295 of file Nyquist.cpp.

296 {
297  return mIsPrompt;
298 }

References mIsPrompt.

◆ IsInteractive()

bool NyquistEffect::IsInteractive ( )
overridevirtual

Whether the effect needs a dialog for entry of settings.

Reimplemented from Effect.

Definition at line 285 of file Nyquist.cpp.

286 {
287  if (mIsPrompt)
288  {
289  return true;
290  }
291 
292  return mControls.size() != 0;
293 }

References mControls, and mIsPrompt.

◆ IsOk()

bool NyquistEffect::IsOk ( )
private

Definition at line 2994 of file Nyquist.cpp.

2995 {
2996  return mOK;
2997 }

References mOK.

Referenced by NyquistEffectsModule::DiscoverPluginsAtPath().

Here is the caller graph for this function:

◆ ManualPage()

ManualPageID NyquistEffect::ManualPage ( )
overridevirtual

Name of a page in the Audacity alpha manual, default is empty.

Reimplemented from EffectDefinitionInterface.

Definition at line 244 of file Nyquist.cpp.

245 {
246  return mIsPrompt
247  ? wxString("Nyquist_Prompt")
248  : mManPage;
249 }

References mIsPrompt, and mManPage.

◆ NyquistToWxString()

wxString NyquistEffect::NyquistToWxString ( const char *  nyqString)
staticprivate

Definition at line 1656 of file Nyquist.cpp.

1657 {
1658  wxString str(nyqString, wxConvUTF8);
1659  if (nyqString != NULL && nyqString[0] && str.empty()) {
1660  // invalid UTF-8 string, convert as Latin-1
1661  str = _("[Warning: Nyquist returned invalid UTF-8 string, converted here as Latin-1]");
1662  // TODO: internationalization of strings from Nyquist effects, at least
1663  // from those shipped with Audacity
1664  str += LAT1CTOWX(nyqString);
1665  }
1666  return str;
1667 }

References _, LAT1CTOWX, and str.

Referenced by ProcessOne().

Here is the caller graph for this function:

◆ OnChoice()

void NyquistEffect::OnChoice ( wxCommandEvent &  evt)
private

Definition at line 3103 of file Nyquist.cpp.

3104 {
3105  mControls[evt.GetId() - ID_Choice].val = (double) evt.GetInt();
3106 }

References ID_Choice, and mControls.

◆ OnDebug()

void NyquistEffect::OnDebug ( wxCommandEvent &  evt)
private

◆ OnFileButton()

void NyquistEffect::OnFileButton ( wxCommandEvent &  evt)
private

Definition at line 3139 of file Nyquist.cpp.

3140 {
3141  int i = evt.GetId() - ID_FILE;
3142  NyqControl & ctrl = mControls[i];
3143 
3144  // Get style flags:
3145  // Ensure legal combinations so that wxWidgets does not throw an assert error.
3146  unsigned int flags = 0;
3147  if (!ctrl.highStr.empty())
3148  {
3149  wxStringTokenizer tokenizer(ctrl.highStr, ",");
3150  while ( tokenizer.HasMoreTokens() )
3151  {
3152  wxString token = tokenizer.GetNextToken().Trim(true).Trim(false);
3153  if (token.IsSameAs("open", false))
3154  {
3155  flags |= wxFD_OPEN;
3156  flags &= ~wxFD_SAVE;
3157  flags &= ~wxFD_OVERWRITE_PROMPT;
3158  }
3159  else if (token.IsSameAs("save", false))
3160  {
3161  flags |= wxFD_SAVE;
3162  flags &= ~wxFD_OPEN;
3163  flags &= ~wxFD_MULTIPLE;
3164  flags &= ~wxFD_FILE_MUST_EXIST;
3165  }
3166  else if (token.IsSameAs("overwrite", false) && !(flags & wxFD_OPEN))
3167  {
3168  flags |= wxFD_OVERWRITE_PROMPT;
3169  }
3170  else if (token.IsSameAs("exists", false) && !(flags & wxFD_SAVE))
3171  {
3172  flags |= wxFD_FILE_MUST_EXIST;
3173  }
3174  else if (token.IsSameAs("multiple", false) && !(flags & wxFD_SAVE))
3175  {
3176  flags |= wxFD_MULTIPLE;
3177  }
3178  }
3179  }
3180 
3181  resolveFilePath(ctrl.valStr);
3182 
3183  wxFileName fname = ctrl.valStr;
3184  wxString defaultDir = fname.GetPath();
3185  wxString defaultFile = fname.GetName();
3186  auto message = XO("Select a file");
3187 
3188  if (flags & wxFD_MULTIPLE)
3189  message = XO("Select one or more files");
3190  else if (flags & wxFD_SAVE)
3191  message = XO("Save file as");
3192 
3193  FileDialogWrapper openFileDialog(mUIParent->FindWindow(ID_FILE + i),
3194  message,
3195  defaultDir,
3196  defaultFile,
3197  ctrl.fileTypes,
3198  flags); // styles
3199 
3200  if (openFileDialog.ShowModal() == wxID_CANCEL)
3201  {
3202  return;
3203  }
3204 
3205  wxString path;
3206  // When multiple files selected, return file paths as a list of quoted strings.
3207  if (flags & wxFD_MULTIPLE)
3208  {
3209  wxArrayString selectedFiles;
3210  openFileDialog.GetPaths(selectedFiles);
3211 
3212  for (size_t sf = 0; sf < selectedFiles.size(); sf++) {
3213  path += "\"";
3214  path += selectedFiles[sf];
3215  path += "\"";
3216  }
3217  ctrl.valStr = path;
3218  }
3219  else
3220  {
3221  ctrl.valStr = openFileDialog.GetPath();
3222  }
3223 
3224  mUIParent->FindWindow(ID_Text + i)->GetValidator()->TransferToWindow();
3225 }

References NyqControl::fileTypes, FileDialog::GetPath(), FileDialog::GetPaths(), NyqControl::highStr, ID_FILE, ID_Text, mControls, Effect::mUIParent, resolveFilePath(), FileDialog::ShowModal(), NyqControl::valStr, and XO.

Here is the call graph for this function:

◆ OnLoad()

void NyquistEffect::OnLoad ( wxCommandEvent &  evt)
private

Definition at line 3006 of file Nyquist.cpp.

3007 {
3008  if (mCommandText->IsModified())
3009  {
3010  if (wxNO == Effect::MessageBox(
3011  XO("Current program has been modified.\nDiscard changes?"),
3012  wxYES_NO ) )
3013  {
3014  return;
3015  }
3016  }
3017 
3018  FileDialogWrapper dlog(
3019  mUIParent,
3020  XO("Load Nyquist script"),
3021  mFileName.GetPath(),
3022  wxEmptyString,
3023  {
3024  NyquistScripts,
3025  LispScripts,
3026  FileNames::TextFiles,
3027  FileNames::AllFiles
3028  },
3029  wxFD_OPEN | wxRESIZE_BORDER);
3030 
3031  if (dlog.ShowModal() != wxID_OK)
3032  {
3033  return;
3034  }
3035 
3036  mFileName = dlog.GetPath();
3037 
3038  if (!mCommandText->LoadFile(mFileName.GetFullPath()))
3039  {
3040  Effect::MessageBox( XO("File could not be loaded") );
3041  }
3042 }

References FileDialog::GetPath(), mCommandText, Effect::MessageBox(), mFileName, Effect::mUIParent, FileDialog::ShowModal(), and XO.

Here is the call graph for this function:

◆ OnSave()

void NyquistEffect::OnSave ( wxCommandEvent &  evt)
private

Definition at line 3044 of file Nyquist.cpp.

3045 {
3046  FileDialogWrapper dlog(
3047  mUIParent,
3048  XO("Save Nyquist script"),
3049  mFileName.GetPath(),
3050  mFileName.GetFullName(),
3051  {
3052  NyquistScripts,
3053  LispScripts,
3054  FileNames::AllFiles
3055  },
3056  wxFD_SAVE | wxFD_OVERWRITE_PROMPT | wxRESIZE_BORDER);
3057 
3058  if (dlog.ShowModal() != wxID_OK)
3059  {
3060  return;
3061  }
3062 
3063  mFileName = dlog.GetPath();
3064 
3065  if (!mCommandText->SaveFile(mFileName.GetFullPath()))
3066  {
3067  Effect::MessageBox( XO("File could not be saved") );
3068  }
3069 }

References FileDialog::GetPath(), mCommandText, Effect::MessageBox(), mFileName, Effect::mUIParent, FileDialog::ShowModal(), and XO.

Here is the call graph for this function:

◆ OnSlider()

void NyquistEffect::OnSlider ( wxCommandEvent &  evt)
private

Definition at line 3071 of file Nyquist.cpp.

3072 {
3073  int i = evt.GetId() - ID_Slider;
3074  NyqControl & ctrl = mControls[i];
3075 
3076  int val = evt.GetInt();
3077  double range = ctrl.high - ctrl.low;
3078  double newVal = (val / (double)ctrl.ticks) * range + ctrl.low;
3079 
3080  // Determine precision for displayed number
3081  int precision = range < 1.0 ? 3 :
3082  range < 10.0 ? 2 :
3083  range < 100.0 ? 1 :
3084  0;
3085 
3086  // If the value is at least one tick different from the current value
3087  // change it (this prevents changes from manually entered values unless
3088  // the slider actually moved)
3089  if (fabs(newVal - ctrl.val) >= (1 / (double)ctrl.ticks) * range &&
3090  fabs(newVal - ctrl.val) >= pow(0.1, precision) / 2)
3091  {
3092  // First round to the appropriate precision
3093  newVal *= pow(10.0, precision);
3094  newVal = floor(newVal + 0.5);
3095  newVal /= pow(10.0, precision);
3096 
3097  ctrl.val = newVal;
3098 
3099  mUIParent->FindWindow(ID_Text + i)->GetValidator()->TransferToWindow();
3100  }
3101 }

References NyqControl::high, ID_Slider, ID_Text, NyqControl::low, mControls, Effect::mUIParent, NyqControl::ticks, and NyqControl::val.

◆ OnText()

void NyquistEffect::OnText ( wxCommandEvent &  evt)
private

Definition at line 3306 of file Nyquist.cpp.

3307 {
3308  int i = evt.GetId() - ID_Text;
3309 
3310  NyqControl & ctrl = mControls[i];
3311 
3312  if (wxDynamicCast(evt.GetEventObject(), wxWindow)->GetValidator()->TransferFromWindow())
3313  {
3314  if (ctrl.type == NYQ_CTRL_FLOAT || ctrl.type == NYQ_CTRL_INT)
3315  {
3316  int pos = (int)floor((ctrl.val - ctrl.low) /
3317  (ctrl.high - ctrl.low) * ctrl.ticks + 0.5);
3318 
3319  wxSlider *slider = (wxSlider *)mUIParent->FindWindow(ID_Slider + i);
3320  slider->SetValue(pos);
3321  }
3322  }
3323 }

References NyqControl::high, ID_Slider, ID_Text, NyqControl::low, mControls, Effect::mUIParent, NYQ_CTRL_FLOAT, NYQ_CTRL_INT, NyqControl::ticks, NyqControl::type, and NyqControl::val.

◆ OnTime()

void NyquistEffect::OnTime ( wxCommandEvent &  evt)
private

Definition at line 3108 of file Nyquist.cpp.

3109 {
3110  int i = evt.GetId() - ID_Time;
3111  static double value = 0.0;
3112  NyqControl & ctrl = mControls[i];
3113 
3114  NumericTextCtrl *n = (NumericTextCtrl *) mUIParent->FindWindow(ID_Time + i);
3115  double val = n->GetValue();
3116 
3117  // Observed that two events transmitted on each control change (Linux)
3118  // so skip if value has not changed.
3119  if (val != value) {
3120  if (val < ctrl.low || val > ctrl.high) {
3121  const auto message = XO("Value range:\n%s to %s")
3122  .Format( ToTimeFormat(ctrl.low), ToTimeFormat(ctrl.high) );
3124  message,
3125  wxOK | wxCENTRE,
3126  XO("Value Error") );
3127  }
3128 
3129  if (val < ctrl.low)
3130  val = ctrl.low;
3131  else if (val > ctrl.high)
3132  val = ctrl.high;
3133 
3134  n->SetValue(val);
3135  value = val;
3136  }
3137 }

References NumericConverter::GetValue(), NyqControl::high, ID_Time, NyqControl::low, mControls, Effect::MessageBox(), Effect::mUIParent, NumericTextCtrl::SetValue(), ToTimeFormat(), and XO.

Here is the call graph for this function:

◆ OSCallback()

void NyquistEffect::OSCallback ( )
private

Definition at line 2553 of file Nyquist.cpp.

2554 {
2555  if (mStop) {
2556  mStop = false;
2557  nyx_stop();
2558  }
2559  else if (mBreak) {
2560  mBreak = false;
2561  nyx_break();
2562  }
2563  else if (mCont) {
2564  mCont = false;
2565  nyx_continue();
2566  }
2567 
2568  // LLL: STF figured out that yielding while the effect is being applied
2569  // produces an EXTREME slowdown. It appears that yielding is not
2570  // really necessary on Linux and Windows.
2571  //
2572  // However, on the Mac, the spinning cursor appears during longer
2573  // Nyquist processing and that may cause the user to think Audacity
2574  // has crashed or hung. In addition, yielding or not on the Mac
2575  // doesn't seem to make much of a difference in execution time.
2576  //
2577  // So, yielding on the Mac only...
2578 #if defined(__WXMAC__)
2579  wxYieldIfNeeded();
2580 #endif
2581 }

References mBreak, mCont, and mStop.

◆ OutputCallback()

void NyquistEffect::OutputCallback ( int  c)
private

Definition at line 2537 of file Nyquist.cpp.

2538 {
2539  // Always collect Nyquist error messages for normal plug-ins
2540  if (!mRedirectOutput) {
2541  mDebugOutputStr += (wxChar)c;
2542  return;
2543  }
2544 
2545  std::cout << (char)c;
2546 }

References mDebugOutputStr, and mRedirectOutput.

◆ Parse()

bool NyquistEffect::Parse ( Tokenizer tokenizer,
const wxString &  line,
bool  eof,
bool  first 
)
private

Definition at line 1970 of file Nyquist.cpp.

1972 {
1973  if ( !tzer.Tokenize(line, eof, first ? 1 : 0, 0) )
1974  return false;
1975 
1976  const auto &tokens = tzer.tokens;
1977  int len = tokens.size();
1978  if (len < 1) {
1979  return true;
1980  }
1981 
1982  // Consistency decision is for "plug-in" as the correct spelling
1983  // "plugin" (deprecated) is allowed as an undocumented convenience.
1984  if (len == 2 && tokens[0] == wxT("nyquist") &&
1985  (tokens[1] == wxT("plug-in") || tokens[1] == wxT("plugin"))) {
1986  mOK = true;
1987  return true;
1988  }
1989 
1990  if (len >= 2 && tokens[0] == wxT("type")) {
1991  wxString tok = tokens[1];
1992  mIsTool = false;
1993  if (tok == wxT("tool")) {
1994  mIsTool = true;
1996  // we allow
1997  // ;type tool
1998  // ;type tool process
1999  // ;type tool generate
2000  // ;type tool analyze
2001  // The last three are placed in the tool menu, but are processed as
2002  // process, generate or analyze.
2003  if (len >= 3)
2004  tok = tokens[2];
2005  }
2006 
2007  if (tok == wxT("process")) {
2009  }
2010  else if (tok == wxT("generate")) {
2012  }
2013  else if (tok == wxT("analyze")) {
2015  }
2016 
2017  if (len >= 3 && tokens[2] == wxT("spectral")) {;
2018  mIsSpectral = true;
2019  }
2020  return true;
2021  }
2022 
2023  if (len == 2 && tokens[0] == wxT("codetype")) {
2024  // This will stop ParseProgram() from doing a best guess as program type.
2025  if (tokens[1] == wxT("lisp")) {
2026  mIsSal = false;
2027  mFoundType = true;
2028  }
2029  else if (tokens[1] == wxT("sal")) {
2030  mIsSal = true;
2031  mFoundType = true;
2032  }
2033  return true;
2034  }
2035 
2036  if (len >= 2 && tokens[0] == wxT("debugflags")) {
2037  for (int i = 1; i < len; i++) {
2038  // "trace" sets *tracenable* (LISP) or *sal-traceback* (SAL)
2039  // and displays debug window IF there is anything to show.
2040  if (tokens[i] == wxT("trace")) {
2041  mTrace = true;
2042  }
2043  else if (tokens[i] == wxT("notrace")) {
2044  mTrace = false;
2045  }
2046  else if (tokens[i] == wxT("compiler")) {
2047  mCompiler = true;
2048  }
2049  else if (tokens[i] == wxT("nocompiler")) {
2050  mCompiler = false;
2051  }
2052  }
2053  return true;
2054  }
2055 
2056  // We support versions 1, 2 and 3
2057  // (Version 2 added support for string parameters.)
2058  // (Version 3 added support for choice parameters.)
2059  // (Version 4 added support for project/track/selection information.)
2060  if (len >= 2 && tokens[0] == wxT("version")) {
2061  long v;
2062  tokens[1].ToLong(&v);
2063  if (v < 1 || v > 4) {
2064  // This is an unsupported plug-in version
2065  mOK = false;
2066  mInitError = XO(
2067 "This version of Audacity does not support Nyquist plug-in version %ld")
2068  .Format( v );
2069  return true;
2070  }
2071  mVersion = (int) v;
2072  }
2073 
2074  if (len >= 2 && tokens[0] == wxT("name")) {
2075  // Names do not yet support context strings for translations, or
2076  // internal names distinct from visible English names.
2077  // (See also comments in NyquistEffectsModule::AutoRegisterPlugins)
2078  auto name = UnQuote(tokens[1]);
2079  // Strip ... from name if it's present, perhaps in third party plug-ins
2080  // Menu system puts ... back if there are any controls
2081  // This redundant naming convention must NOT be followed for
2082  // shipped Nyquist effects with internationalization. Else the msgid
2083  // later looked up will lack the ... and will not be found.
2084  if (name.EndsWith(wxT("...")))
2085  name = name.RemoveLast(3);
2086  mName = TranslatableString{ name, {} };
2087  return true;
2088  }
2089 
2090  if (len >= 2 && tokens[0] == wxT("action")) {
2091  mAction = TranslatableString{ UnQuote(tokens[1]), {} };
2092  return true;
2093  }
2094 
2095  if (len >= 2 && tokens[0] == wxT("info")) {
2096  mInfo = TranslatableString{ UnQuote(tokens[1]), {} };
2097  return true;
2098  }
2099 
2100  if (len >= 2 && tokens[0] == wxT("preview")) {
2101  if (tokens[1] == wxT("enabled") || tokens[1] == wxT("true")) {
2102  mEnablePreview = true;
2103  SetLinearEffectFlag(false);
2104  }
2105  else if (tokens[1] == wxT("linear")) {
2106  mEnablePreview = true;
2107  SetLinearEffectFlag(true);
2108  }
2109  else if (tokens[1] == wxT("selection")) {
2110  mEnablePreview = true;
2112  }
2113  else if (tokens[1] == wxT("disabled") || tokens[1] == wxT("false")) {
2114  mEnablePreview = false;
2115  }
2116  return true;
2117  }
2118 
2119  // Maximum number of samples to be processed. This can help the
2120  // progress bar if effect does not process all of selection.
2121  if (len >= 2 && tokens[0] == wxT("maxlen")) {
2122  long long v; // Note that Nyquist may overflow at > 2^31 samples (bug 439)
2123  tokens[1].ToLongLong(&v);
2124  mMaxLen = (sampleCount) v;
2125  }
2126 
2127 #if defined(EXPERIMENTAL_NYQUIST_SPLIT_CONTROL)
2128  if (len >= 2 && tokens[0] == wxT("mergeclips")) {
2129  long v;
2130  // -1 = auto (default), 0 = don't merge clips, 1 = do merge clips
2131  tokens[1].ToLong(&v);
2132  mMergeClips = v;
2133  return true;
2134  }
2135 
2136  if (len >= 2 && tokens[0] == wxT("restoresplits")) {
2137  long v;
2138  // Splits are restored by default. Set to 0 to prevent.
2139  tokens[1].ToLong(&v);
2140  mRestoreSplits = !!v;
2141  return true;
2142  }
2143 #endif
2144 
2145  if (len >= 2 && tokens[0] == wxT("author")) {
2146  mAuthor = TranslatableString{ UnQuote(tokens[1]), {} };
2147  return true;
2148  }
2149 
2150  if (len >= 2 && tokens[0] == wxT("release")) {
2151  // Value must be quoted if the release version string contains spaces.
2152  mReleaseVersion =
2153  TranslatableString{ UnQuote(tokens[1]), {} };
2154  return true;
2155  }
2156 
2157  if (len >= 2 && tokens[0] == wxT("copyright")) {
2158  mCopyright = TranslatableString{ UnQuote(tokens[1]), {} };
2159  return true;
2160  }
2161 
2162  // Page name in Audacity development manual
2163  if (len >= 2 && tokens[0] == wxT("manpage")) {
2164  // do not translate
2165  mManPage = UnQuote(tokens[1], false);
2166  return true;
2167  }
2168 
2169  // Local Help file
2170  if (len >= 2 && tokens[0] == wxT("helpfile")) {
2171  // do not translate
2172  mHelpFile = UnQuote(tokens[1], false);
2173  return true;
2174  }
2175 
2176  // Debug button may be disabled for release plug-ins.
2177  if (len >= 2 && tokens[0] == wxT("debugbutton")) {
2178  if (tokens[1] == wxT("disabled") || tokens[1] == wxT("false")) {
2179  mDebugButton = false;
2180  }
2181  return true;
2182  }
2183 
2184 
2185  if (len >= 3 && tokens[0] == wxT("control")) {
2186  NyqControl ctrl;
2187 
2188  if (len == 3 && tokens[1] == wxT("text")) {
2189  ctrl.var = tokens[1];
2190  ctrl.label = UnQuote( tokens[2] );
2191  ctrl.type = NYQ_CTRL_TEXT;
2192  }
2193  else if (len >= 5)
2194  {
2195  ctrl.var = tokens[1];
2196  ctrl.name = UnQuote( tokens[2] );
2197  // 3 is type, below
2198  ctrl.label = tokens[4];
2199 
2200  // valStr may or may not be a quoted string
2201  ctrl.valStr = len > 5 ? tokens[5] : wxString{};
2202  ctrl.val = GetCtrlValue(ctrl.valStr);
2203  if (ctrl.valStr.length() > 0 &&
2204  (ctrl.valStr[0] == wxT('(') ||
2205  ctrl.valStr[0] == wxT('"')))
2206  ctrl.valStr = UnQuote( ctrl.valStr );
2207 
2208  // 6 is minimum, below
2209  // 7 is maximum, below
2210 
2211  if (tokens[3] == wxT("string")) {
2212  ctrl.type = NYQ_CTRL_STRING;
2213  ctrl.label = UnQuote( ctrl.label );
2214  }
2215  else if (tokens[3] == wxT("choice")) {
2216  ctrl.type = NYQ_CTRL_CHOICE;
2217  ctrl.choices = ParseChoice(ctrl.label);
2218  ctrl.label = wxT("");
2219  }
2220  else if (tokens[3] == wxT("file")) {
2221  ctrl.type = NYQ_CTRL_FILE;
2222  ctrl.fileTypes = ParseFileTypes(tokens[6]);
2223  // will determine file dialog styles:
2224  ctrl.highStr = UnQuote( tokens[7] );
2225  ctrl.label = UnQuote(ctrl.label);
2226  }
2227  else {
2228  ctrl.label = UnQuote( ctrl.label );
2229 
2230  if (len < 8) {
2231  return true;
2232  }
2233 
2234  if ((tokens[3] == wxT("float")) ||
2235  (tokens[3] == wxT("real"))) // Deprecated
2236  ctrl.type = NYQ_CTRL_FLOAT;
2237  else if (tokens[3] == wxT("int"))
2238  ctrl.type = NYQ_CTRL_INT;
2239  else if (tokens[3] == wxT("float-text"))
2240  ctrl.type = NYQ_CTRL_FLOAT_TEXT;
2241  else if (tokens[3] == wxT("int-text"))
2242  ctrl.type = NYQ_CTRL_INT_TEXT;
2243  else if (tokens[3] == wxT("time"))
2244  ctrl.type = NYQ_CTRL_TIME;
2245  else
2246  {
2247  wxString str;
2248  str.Printf(wxT("Bad Nyquist 'control' type specification: '%s' in plug-in file '%s'.\nControl not created."),
2249  tokens[3], mFileName.GetFullPath());
2250 
2251  // Too disturbing to show alert before Audacity frame is up.
2252  // Effect::MessageBox(
2253  // str,
2254  // wxOK | wxICON_EXCLAMATION,
2255  // XO("Nyquist Warning") );
2256 
2257  // Note that the AudacityApp's mLogger has not yet been created,
2258  // so this brings up an alert box, but after the Audacity frame is up.
2259  wxLogWarning(str);
2260  return true;
2261  }
2262 
2263  ctrl.lowStr = UnQuote( tokens[6] );
2264  if (ctrl.type == NYQ_CTRL_INT_TEXT && ctrl.lowStr.IsSameAs(wxT("nil"), false)) {
2265  ctrl.low = INT_MIN;
2266  }
2267  else if (ctrl.type == NYQ_CTRL_FLOAT_TEXT && ctrl.lowStr.IsSameAs(wxT("nil"), false)) {
2268  ctrl.low = -(FLT_MAX);
2269  }
2270  else if (ctrl.type == NYQ_CTRL_TIME && ctrl.lowStr.IsSameAs(wxT("nil"), false)) {
2271  ctrl.low = 0.0;
2272  }
2273  else {
2274  ctrl.low = GetCtrlValue(ctrl.lowStr);
2275  }
2276 
2277  ctrl.highStr = UnQuote( tokens[7] );
2278  if (ctrl.type == NYQ_CTRL_INT_TEXT && ctrl.highStr.IsSameAs(wxT("nil"), false)) {
2279  ctrl.high = INT_MAX;
2280  }
2281  else if ((ctrl.type == NYQ_CTRL_FLOAT_TEXT || ctrl.type == NYQ_CTRL_TIME) &&
2282  ctrl.highStr.IsSameAs(wxT("nil"), false))
2283  {
2284  ctrl.high = FLT_MAX;
2285  }
2286  else {
2287  ctrl.high = GetCtrlValue(ctrl.highStr);
2288  }
2289 
2290  if (ctrl.high < ctrl.low) {
2291  ctrl.high = ctrl.low;
2292  }
2293 
2294  if (ctrl.val < ctrl.low) {
2295  ctrl.val = ctrl.low;
2296  }
2297 
2298  if (ctrl.val > ctrl.high) {
2299  ctrl.val = ctrl.high;
2300  }
2301 
2302  ctrl.ticks = 1000;
2303  if (ctrl.type == NYQ_CTRL_INT &&
2304  (ctrl.high - ctrl.low < ctrl.ticks)) {
2305  ctrl.ticks = (int)(ctrl.high - ctrl.low);
2306  }
2307  }
2308  }
2309 
2310  if( ! make_iterator_range( mPresetNames ).contains( ctrl.var ) )
2311  {
2312  mControls.push_back(ctrl);
2313  }
2314  }
2315 
2316  // Deprecated
2317  if (len >= 2 && tokens[0] == wxT("categories")) {
2318  for (size_t i = 1; i < tokens.size(); ++i) {
2319  mCategories.push_back(tokens[i]);
2320  }
2321  }
2322  return true;
2323 }

References NyqControl::choices, EffectTypeAnalyze, EffectTypeGenerate, EffectTypeProcess, EffectTypeTool, NyqControl::fileTypes, GetCtrlValue(), NyqControl::high, NyqControl::highStr, NyqControl::label, NyqControl::low, NyqControl::lowStr, mAction, make_iterator_range(), mAuthor, mCategories, mCompiler, mControls, mCopyright, mDebugButton, mEnablePreview, mFileName, mFoundType, mHelpFile, mInfo, mInitError, mIsSal, mIsSpectral, mIsTool, mManPage, mMaxLen, mMergeClips, mName, mOK, Effect::mPresetNames, mReleaseVersion, mRestoreSplits, mTrace, mType, mVersion, name, NyqControl::name, NYQ_CTRL_CHOICE, NYQ_CTRL_FILE, NYQ_CTRL_FLOAT, NYQ_CTRL_FLOAT_TEXT, NYQ_CTRL_INT, NYQ_CTRL_INT_TEXT, NYQ_CTRL_STRING, NYQ_CTRL_TEXT, NYQ_CTRL_TIME, ParseChoice(), ParseFileTypes(), Effect::SetLinearEffectFlag(), Effect::SetPreviewFullSelectionFlag(), str, NyqControl::ticks, NyquistEffect::Tokenizer::Tokenize(), NyquistEffect::Tokenizer::tokens, NyqControl::type, UnQuote(), NyqControl::val, NyqControl::valStr, NyqControl::var, and XO.

Referenced by ParseProgram().

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

◆ ParseChoice()

std::vector< EnumValueSymbol > NyquistEffect::ParseChoice ( const wxString &  text)
staticprivate

Definition at line 1679 of file Nyquist.cpp.

1680 {
1681  std::vector<EnumValueSymbol> results;
1682  if (text[0] == wxT('(')) {
1683  // New style: expecting a Lisp-like list of strings
1684  Tokenizer tzer;
1685  tzer.Tokenize(text, true, 1, 1);
1686  auto &choices = tzer.tokens;
1687  wxString extra;
1688  for (auto &choice : choices) {
1689  auto label = UnQuote(choice, true, &extra);
1690  if (extra.empty())
1691  results.push_back( TranslatableString{ label, {} } );
1692  else
1693  results.push_back(
1694  { extra, TranslatableString{ label, {} } } );
1695  }
1696  }
1697  else {
1698  // Old style: expecting a comma-separated list of
1699  // un-internationalized names, ignoring leading and trailing spaces
1700  // on each; and the whole may be quoted
1701  auto choices = wxStringTokenize(
1702  text[0] == wxT('"') ? text.Mid(1, text.length() - 2) : text,
1703  wxT(",")
1704  );
1705  for (auto &choice : choices)
1706  results.push_back( { choice.Trim(true).Trim(false) } );
1707  }
1708  return results;
1709 }

References label, NyquistEffect::Tokenizer::Tokenize(), NyquistEffect::Tokenizer::tokens, and UnQuote().

Referenced by Parse().

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

◆ ParseCommand()

bool NyquistEffect::ParseCommand ( const wxString &  cmd)
private

Definition at line 2427 of file Nyquist.cpp.

2428 {
2429  wxStringInputStream stream(cmd + wxT(" "));
2430 
2431  return ParseProgram(stream);
2432 }

References ParseProgram().

Referenced by SetAutomationParameters(), SetCommand(), and TransferDataFromPromptWindow().

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

◆ ParseFile()

void NyquistEffect::ParseFile ( )
private

Definition at line 2419 of file Nyquist.cpp.

2420 {
2421  wxFileInputStream rawStream(mFileName.GetFullPath());
2422  wxBufferedInputStream stream(rawStream, 10000);
2423 
2424  ParseProgram(stream);
2425 }

References mFileName, and ParseProgram().

Here is the call graph for this function:

◆ ParseFileExtensions()

FileExtensions NyquistEffect::ParseFileExtensions ( const wxString &  text)
private

Definition at line 1711 of file Nyquist.cpp.

1712 {
1713  // todo: error handling
1714  FileExtensions results;
1715  if (text[0] == wxT('(')) {
1716  Tokenizer tzer;
1717  tzer.Tokenize(text, true, 1, 1);
1718  for (const auto &token : tzer.tokens)
1719  results.push_back( UnQuote( token ) );
1720  }
1721  return results;
1722 }

References NyquistEffect::Tokenizer::Tokenize(), NyquistEffect::Tokenizer::tokens, and UnQuote().

Referenced by ParseFileType().

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

◆ ParseFileType()

FileNames::FileType NyquistEffect::ParseFileType ( const wxString &  text)
private

Definition at line 1724 of file Nyquist.cpp.

1725 {
1726  // todo: error handling
1727  FileNames::FileType result;
1728  if (text[0] == wxT('(')) {
1729  Tokenizer tzer;
1730  tzer.Tokenize(text, true, 1, 1);
1731  auto &tokens = tzer.tokens;
1732  if ( tokens.size() == 2 )
1733  result =
1734  { UnQuoteMsgid( tokens[0] ), ParseFileExtensions( tokens[1] ) };
1735  }
1736  return result;
1737 }

References ParseFileExtensions(), NyquistEffect::Tokenizer::Tokenize(), NyquistEffect::Tokenizer::tokens, and UnQuoteMsgid().

Referenced by ParseFileTypes().

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

◆ ParseFileTypes()

FileNames::FileTypes NyquistEffect::ParseFileTypes ( const wxString &  text)
private

Definition at line 1739 of file Nyquist.cpp.

1740 {
1741  // todo: error handling
1742  FileNames::FileTypes results;
1743  if (text[0] == wxT('(')) {
1744  Tokenizer tzer;
1745  tzer.Tokenize(text, true, 1, 1);
1746  auto &types = tzer.tokens;
1747  if ( !types.empty() && types[0][0] == wxT('(') )
1748  for (auto &type : types)
1749  results.push_back( ParseFileType( type ) );
1750  }
1751  if ( results.empty() ) {
1752  // Old-style is a specially formatted string, maybe translated
1753  // Parse it for compatibility
1754  auto str = UnQuote( text );
1755  auto pieces = wxSplit( str, '|' );
1756  // Should have an even number
1757  auto size = pieces.size();
1758  if ( size % 2 == 1 )
1759  --size, pieces.pop_back();
1760  for ( size_t ii = 0; ii < size; ii += 2 ) {
1761  FileExtensions extensions;
1762  auto extensionStrings = wxSplit( pieces[ii + 1], ';' );
1763  for ( const auto &extensionString : extensionStrings )
1764  if ( extensionString.StartsWith( wxT("*.") ) ) {
1765  auto ext = extensionString.substr( 2 );
1766  if (ext == wxT("*"))
1767  // "*.*" to match all
1768  ext.clear();
1769  extensions.push_back( ext );
1770  }
1771  results.push_back( { Verbatim( pieces[ii] ), extensions } );
1772  }
1773  }
1774  return results;
1775 }

References ParseFileType(), size, str, NyquistEffect::Tokenizer::Tokenize(), NyquistEffect::Tokenizer::tokens, UnQuote(), and Verbatim().

Referenced by Parse().

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

◆ ParseProgram()

bool NyquistEffect::ParseProgram ( wxInputStream &  stream)
private

Definition at line 2325 of file Nyquist.cpp.

2326 {
2327  if (!stream.IsOk())
2328  {
2329  mInitError = XO("Could not open file");
2330  return false;
2331  }
2332 
2333  wxTextInputStream pgm(stream, wxT(" \t"), wxConvAuto());
2334 
2335  mCmd = wxT("");
2336  mCmd.Alloc(10000);
2337  mIsSal = false;
2338  mControls.clear();
2339  mCategories.clear();
2340  mIsSpectral = false;
2341  mManPage = wxEmptyString; // If not wxEmptyString, must be a page in the Audacity manual.
2342  mHelpFile = wxEmptyString; // If not wxEmptyString, must be a valid HTML help file.
2343  mHelpFileExists = false;
2344  mDebug = false;
2345  mTrace = false;
2346  mDebugButton = true; // Debug button enabled by default.
2347  mEnablePreview = true; // Preview button enabled by default.
2348 
2349  // Bug 1934.
2350  // All Nyquist plug-ins should have a ';type' field, but if they don't we default to
2351  // being an Effect.
2353 
2354  mFoundType = false;
2355  while (!stream.Eof() && stream.IsOk())
2356  {
2357  wxString line = pgm.ReadLine();
2358  if (line.length() > 1 &&
2359  // New in 2.3.0: allow magic comment lines to start with $
2360  // The trick is that xgettext will not consider such lines comments
2361  // and will extract the strings they contain
2362  (line[0] == wxT(';') || line[0] == wxT('$')) )
2363  {
2364  Tokenizer tzer;
2365  unsigned nLines = 1;
2366  bool done;
2367  // Allow continuations within control lines.
2368  bool control =
2369  line[0] == wxT('$') || line.StartsWith( wxT(";control") );
2370  do
2371  done = Parse(tzer, line, !control || stream.Eof(), nLines == 1);
2372  while(!done &&
2373  (line = pgm.ReadLine(), ++nLines, true));
2374 
2375  // Don't pass these lines to the interpreter, so it doesn't get confused
2376  // by $, but pass blanks,
2377  // so that SAL effects compile with proper line numbers
2378  while (nLines --)
2379  mCmd += wxT('\n');
2380  }
2381  else
2382  {
2383  if(!mFoundType && line.length() > 0) {
2384  if (line[0] == wxT('(') ||
2385  (line[0] == wxT('#') && line.length() > 1 && line[1] == wxT('|')))
2386  {
2387  mIsSal = false;
2388  mFoundType = true;
2389  }
2390  else if (line.Upper().Find(wxT("RETURN")) != wxNOT_FOUND)
2391  {
2392  mIsSal = true;
2393  mFoundType = true;
2394  }
2395  }
2396  mCmd += line + wxT("\n");
2397  }
2398  }
2399  if (!mFoundType && mIsPrompt)
2400  {
2401  /* i1n-hint: SAL and LISP are names for variant syntaxes for the
2402  Nyquist programming language. Leave them, and 'return', untranslated. */
2404  XO(
2405 "Your code looks like SAL syntax, but there is no \'return\' statement.\n\
2406 For SAL, use a return statement such as:\n\treturn *track* * 0.1\n\
2407 or for LISP, begin with an open parenthesis such as:\n\t(mult *track* 0.1)\n ."),
2409  XO("Error in Nyquist code") );
2410  /* i18n-hint: refers to programming "languages" */
2411  mInitError = XO("Could not determine language");
2412  return false;
2413  // Else just throw it at Nyquist to see what happens
2414  }
2415 
2416  return true;
2417 }

References Effect::DefaultMessageBoxStyle, EffectTypeProcess, mCategories, mCmd, mControls, mDebug, mDebugButton, mEnablePreview, Effect::MessageBox(), mFoundType, mHelpFile, mHelpFileExists, mInitError, mIsPrompt, mIsSal, mIsSpectral, mManPage, mTrace, mType, Parse(), and XO.

Referenced by ParseCommand(), and ParseFile().

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

◆ PopulateOrExchange()

void NyquistEffect::PopulateOrExchange ( ShuttleGui S)
overridevirtual

Reimplemented from Effect.

Definition at line 1071 of file Nyquist.cpp.

1072 {
1073  if (mIsPrompt)
1074  {
1076  }
1077  else
1078  {
1080  }
1081 }

References BuildEffectWindow(), BuildPromptWindow(), mIsPrompt, and S.

Here is the call graph for this function:

◆ Process()

bool NyquistEffect::Process ( )
overridevirtual

If Process() is not overridden, it uses ProcessInitialize(), ProcessBlock(), and ProcessFinalize() methods of EffectProcessor, and also GetLatency() to determine how many leading output samples to discard and how many extra samples to produce.

Reimplemented from Effect.

Definition at line 644 of file Nyquist.cpp.

645 {
646  // Check for reentrant Nyquist commands.
647  // I'm choosing to mark skipped Nyquist commands as successful even though
648  // they are skipped. The reason is that when Nyquist calls out to a chain,
649  // and that chain contains Nyquist, it will be clearer if the chain completes
650  // skipping Nyquist, rather than doing nothing at all.
651  if( mReentryCount > 0 )
652  return true;
653 
654  // Restore the reentry counter (to zero) when we exit.
655  auto countRestorer = valueRestorer( mReentryCount);
656  mReentryCount++;
658 
659  bool success = true;
660  int nEffectsSoFar = nEffectsDone;
661  mProjectChanged = false;
663  em.SetSkipStateFlag(false);
664 
665  // This code was added in a fix for bug 2392 (no preview for Nyquist)
666  // It was commented out in a fix for bug 2428 (no progress dialog from a macro)
667  //if (mExternal) {
668  // mProgress->Hide();
669  //}
670 
671  mOutputTime = 0;
672  mCount = 0;
673  mProgressIn = 0;
674  mProgressOut = 0;
675  mProgressTot = 0;
676  mScale = (GetType() == EffectTypeProcess ? 0.5 : 1.0) / GetNumWaveGroups();
677 
678  mStop = false;
679  mBreak = false;
680  mCont = false;
681 
682  mTrackIndex = 0;
683 
684  // If in tool mode, then we don't do anything with the track and selection.
685  const bool bOnePassTool = (GetType() == EffectTypeTool);
686 
687  // We must copy all the tracks, because Paste needs label tracks to ensure
688  // correct sync-lock group behavior when the timeline is affected; then we just want
689  // to operate on the selected wave tracks
690  if ( !bOnePassTool )
691  CopyInputTracks(true);
692 
693  mNumSelectedChannels = bOnePassTool
694  ? 0
695  : mOutputTracks->Selected< const WaveTrack >().size();
696 
697  mDebugOutput = {};
698  if (!mHelpFile.empty() && !mHelpFileExists) {
699  mDebugOutput = XO(
700 "error: File \"%s\" specified in header but not found in plug-in path.\n")
701  .Format( mHelpFile );
702  }
703 
704  if (mVersion >= 4)
705  {
706  auto project = FindProject();
707 
708  mProps = wxEmptyString;
709 
710  mProps += wxString::Format(wxT("(putprop '*AUDACITY* (list %d %d %d) 'VERSION)\n"), AUDACITY_VERSION, AUDACITY_RELEASE, AUDACITY_REVISION);
711  wxString lang = gPrefs->Read(wxT("/Locale/Language"), wxT(""));
712  lang = (lang.empty())
714  : lang;
715  mProps += wxString::Format(wxT("(putprop '*AUDACITY* \"%s\" 'LANGUAGE)\n"), lang);
716 
717  mProps += wxString::Format(wxT("(setf *DECIMAL-SEPARATOR* #\\%c)\n"), wxNumberFormatter::GetDecimalSeparator());
718 
719  mProps += wxString::Format(wxT("(putprop '*SYSTEM-DIR* \"%s\" 'BASE)\n"), EscapeString(FileNames::BaseDir()));
720  mProps += wxString::Format(wxT("(putprop '*SYSTEM-DIR* \"%s\" 'DATA)\n"), EscapeString(FileNames::DataDir()));
721  mProps += wxString::Format(wxT("(putprop '*SYSTEM-DIR* \"%s\" 'HELP)\n"), EscapeString(FileNames::HtmlHelpDir().RemoveLast()));
722  mProps += wxString::Format(wxT("(putprop '*SYSTEM-DIR* \"%s\" 'TEMP)\n"), EscapeString(TempDirectory::TempDir()));
723  mProps += wxString::Format(wxT("(putprop '*SYSTEM-DIR* \"%s\" 'SYS-TEMP)\n"), EscapeString(wxStandardPaths::Get().GetTempDir()));
724  mProps += wxString::Format(wxT("(putprop '*SYSTEM-DIR* \"%s\" 'DOCUMENTS)\n"), EscapeString(wxStandardPaths::Get().GetDocumentsDir()));
725  mProps += wxString::Format(wxT("(putprop '*SYSTEM-DIR* \"%s\" 'HOME)\n"), EscapeString(wxGetHomeDir()));
726 
728  wxString list;
729  for (size_t i = 0, cnt = paths.size(); i < cnt; i++)
730  {
731  list += wxT("\"") + EscapeString(paths[i]) + wxT("\" ");
732  }
733  list = list.RemoveLast();
734 
735  mProps += wxString::Format(wxT("(putprop '*SYSTEM-DIR* (list %s) 'PLUGIN)\n"), list);
736  mProps += wxString::Format(wxT("(putprop '*SYSTEM-DIR* (list %s) 'PLUG-IN)\n"), list);
737  mProps += wxString::Format(wxT("(putprop '*SYSTEM-DIR* \"%s\" 'USER-PLUG-IN)\n"),
739 
740  // Date and time:
741  wxDateTime now = wxDateTime::Now();
742  int year = now.GetYear();
743  int doy = now.GetDayOfYear();
744  int dom = now.GetDay();
745  // enumerated constants
746  wxDateTime::Month month = now.GetMonth();
747  wxDateTime::WeekDay day = now.GetWeekDay();
748 
749  // Date/time as a list: year, day of year, hour, minute, seconds
750  mProps += wxString::Format(wxT("(setf *SYSTEM-TIME* (list %d %d %d %d %d))\n"),
751  year, doy, now.GetHour(), now.GetMinute(), now.GetSecond());
752 
753  mProps += wxString::Format(wxT("(putprop '*SYSTEM-TIME* \"%s\" 'DATE)\n"), now.FormatDate());
754  mProps += wxString::Format(wxT("(putprop '*SYSTEM-TIME* \"%s\" 'TIME)\n"), now.FormatTime());
755  mProps += wxString::Format(wxT("(putprop '*SYSTEM-TIME* \"%s\" 'ISO-DATE)\n"), now.FormatISODate());
756  mProps += wxString::Format(wxT("(putprop '*SYSTEM-TIME* \"%s\" 'ISO-TIME)\n"), now.FormatISOTime());
757  mProps += wxString::Format(wxT("(putprop '*SYSTEM-TIME* %d 'YEAR)\n"), year);
758  mProps += wxString::Format(wxT("(putprop '*SYSTEM-TIME* %d 'DAY)\n"), dom); // day of month
759  mProps += wxString::Format(wxT("(putprop '*SYSTEM-TIME* %d 'MONTH)\n"), month);
760  mProps += wxString::Format(wxT("(putprop '*SYSTEM-TIME* \"%s\" 'MONTH-NAME)\n"), now.GetMonthName(month));
761  mProps += wxString::Format(wxT("(putprop '*SYSTEM-TIME* \"%s\" 'DAY-NAME)\n"), now.GetWeekDayName(day));
762 
763  mProps += wxString::Format(wxT("(putprop '*PROJECT* %d 'PROJECTS)\n"),
764  (int) AllProjects{}.size());
765  mProps += wxString::Format(wxT("(putprop '*PROJECT* \"%s\" 'NAME)\n"), EscapeString(project->GetProjectName()));
766 
767  int numTracks = 0;
768  int numWave = 0;
769  int numLabel = 0;
770  int numMidi = 0;
771  int numTime = 0;
772  wxString waveTrackList; // track positions of selected audio tracks.
773 
774  {
775  auto countRange = TrackList::Get( *project ).Leaders();
776  for (auto t : countRange) {
777  t->TypeSwitch( [&](const WaveTrack *) {
778  numWave++;
779  if (t->GetSelected())
780  waveTrackList += wxString::Format(wxT("%d "), 1 + numTracks);
781  });
782  numTracks++;
783  }
784  numLabel = countRange.Filter<const LabelTrack>().size();
785  #if defined(USE_MIDI)
786  numMidi = countRange.Filter<const NoteTrack>().size();
787  #endif
788  numTime = countRange.Filter<const TimeTrack>().size();
789  }
790 
791  // We use Internat::ToString() rather than "%g" here because we
792  // always have to use the dot as decimal separator when giving
793  // numbers to Nyquist, whereas using "%g" will use the user's
794  // decimal separator which may be a comma in some countries.
795  mProps += wxString::Format(wxT("(putprop '*PROJECT* (float %s) 'RATE)\n"),
797  mProps += wxString::Format(wxT("(putprop '*PROJECT* %d 'TRACKS)\n"), numTracks);
798  mProps += wxString::Format(wxT("(putprop '*PROJECT* %d 'WAVETRACKS)\n"), numWave);
799  mProps += wxString::Format(wxT("(putprop '*PROJECT* %d 'LABELTRACKS)\n"), numLabel);
800  mProps += wxString::Format(wxT("(putprop '*PROJECT* %d 'MIDITRACKS)\n"), numMidi);
801  mProps += wxString::Format(wxT("(putprop '*PROJECT* %d 'TIMETRACKS)\n"), numTime);
802 
803  double previewLen = 6.0;
804  gPrefs->Read(wxT("/AudioIO/EffectsPreviewLen"), &previewLen);
805  mProps += wxString::Format(wxT("(putprop '*PROJECT* (float %s) 'PREVIEW-DURATION)\n"),
806  Internat::ToString(previewLen));
807 
808  // *PREVIEWP* is true when previewing (better than relying on track view).
809  wxString isPreviewing = (this->IsPreviewing())? wxT("T") : wxT("NIL");
810  mProps += wxString::Format(wxT("(setf *PREVIEWP* %s)\n"), isPreviewing);
811 
812  mProps += wxString::Format(wxT("(putprop '*SELECTION* (float %s) 'START)\n"),
814  mProps += wxString::Format(wxT("(putprop '*SELECTION* (float %s) 'END)\n"),
816  mProps += wxString::Format(wxT("(putprop '*SELECTION* (list %s) 'TRACKS)\n"), waveTrackList);
817  mProps += wxString::Format(wxT("(putprop '*SELECTION* %d 'CHANNELS)\n"), mNumSelectedChannels);
818  }
819 
820  // Nyquist Prompt does not require a selection, but effects do.
821  if (!bOnePassTool && (mNumSelectedChannels == 0)) {
822  auto message = XO("Audio selection required.");
824  message,
825  wxOK | wxCENTRE | wxICON_EXCLAMATION,
826  XO("Nyquist Error") );
827  }
828 
829  std::optional<TrackIterRange<WaveTrack>> pRange;
830  if (!bOnePassTool)
831  pRange.emplace(mOutputTracks->Selected< WaveTrack >() + &Track::IsLeader);
832 
833  // Keep track of whether the current track is first selected in its sync-lock group
834  // (we have no idea what the length of the returned audio will be, so we have
835  // to handle sync-lock group behavior the "old" way).
836  mFirstInGroup = true;
837  Track *gtLast = NULL;
838 
839  for (;
840  bOnePassTool || pRange->first != pRange->second;
841  (void) (!pRange || (++pRange->first, true))
842  ) {
843  // Prepare to accumulate more debug output in OutputCallback
845  mDebugOutput = Verbatim( "%s" ).Format( std::cref( mDebugOutputStr ) );
846 
847  mCurTrack[0] = pRange ? *pRange->first : nullptr;
848  mCurNumChannels = 1;
849  if ( (mT1 >= mT0) || bOnePassTool ) {
850  if (bOnePassTool) {
851  }
852  else {
853  auto channels = TrackList::Channels(mCurTrack[0]);
854  if (channels.size() > 1) {
855  // TODO: more-than-two-channels
856  // Pay attention to consistency of mNumSelectedChannels
857  // with the running tally made by this loop!
858  mCurNumChannels = 2;
859 
860  mCurTrack[1] = * ++ channels.first;
861  if (mCurTrack[1]->GetRate() != mCurTrack[0]->GetRate()) {
863  XO(
864 "Sorry, cannot apply effect on stereo tracks where the tracks don't match."),
865  wxOK | wxCENTRE );
866  success = false;
867  goto finish;
868  }
870  }
871 
872  // Check whether we're in the same group as the last selected track
873  Track *gt = *SyncLock::Group(mCurTrack[0]).first;
874  mFirstInGroup = !gtLast || (gtLast != gt);
875  gtLast = gt;
876 
878  auto end = mCurTrack[0]->TimeToLongSamples(mT1);
879  mCurLen = end - mCurStart[0];
880 
881  if (mCurLen > NYQ_MAX_LEN) {
882  float hours = (float)NYQ_MAX_LEN / (44100 * 60 * 60);
883  const auto message =
884  XO(
885 "Selection too long for Nyquist code.\nMaximum allowed selection is %ld samples\n(about %.1f hours at 44100 Hz sample rate).")
886  .Format((long)NYQ_MAX_LEN, hours);
888  message,
889  wxOK | wxCENTRE,
890  XO("Nyquist Error") );
891  if (!mProjectChanged)
892  em.SetSkipStateFlag(true);
893  return false;
894  }
895 
897  }
898 
899  mProgressIn = 0.0;
900  mProgressOut = 0.0;
901 
902  // libnyquist breaks except in LC_NUMERIC=="C".
903  //
904  // Note that we must set the locale to "C" even before calling
905  // nyx_init() because otherwise some effects will not work!
906  //
907  // MB: setlocale is not thread-safe. Should use uselocale()
908  // if available, or fix libnyquist to be locale-independent.
909  // See also http://bugzilla.audacityteam.org/show_bug.cgi?id=642#c9
910  // for further info about this thread safety question.
911  wxString prevlocale = wxSetlocale(LC_NUMERIC, NULL);
912  wxSetlocale(LC_NUMERIC, wxString(wxT("C")));
913 
914  nyx_init();
915  nyx_set_os_callback(StaticOSCallback, (void *)this);
916  nyx_capture_output(StaticOutputCallback, (void *)this);
917 
918  auto cleanup = finally( [&] {
919  nyx_capture_output(NULL, (void *)NULL);
920  nyx_set_os_callback(NULL, (void *)NULL);
921  nyx_cleanup();
922  } );
923 
924 
925  if (mVersion >= 4)
926  {
927  mPerTrackProps = wxEmptyString;
928  wxString lowHz = wxT("nil");
929  wxString highHz = wxT("nil");
930  wxString centerHz = wxT("nil");
931  wxString bandwidth = wxT("nil");
932 
933 #if defined(EXPERIMENTAL_SPECTRAL_EDITING)
934  if (mF0 >= 0.0) {
935  lowHz.Printf(wxT("(float %s)"), Internat::ToString(mF0));
936  }
937 
938  if (mF1 >= 0.0) {
939  highHz.Printf(wxT("(float %s)"), Internat::ToString(mF1));
940  }
941 
942  if ((mF0 >= 0.0) && (mF1 >= 0.0)) {
943  centerHz.Printf(wxT("(float %s)"), Internat::ToString(sqrt(mF0 * mF1)));
944  }
945 
946  if ((mF0 > 0.0) && (mF1 >= mF0)) {
947  // with very small values, bandwidth calculation may be inf.
948  // (Observed on Linux)
949  double bw = log(mF1 / mF0) / log(2.0);
950  if (!std::isinf(bw)) {
951  bandwidth.Printf(wxT("(float %s)"), Internat::ToString(bw));
952  }
953  }
954 
955 #endif
956  mPerTrackProps += wxString::Format(wxT("(putprop '*SELECTION* %s 'LOW-HZ)\n"), lowHz);
957  mPerTrackProps += wxString::Format(wxT("(putprop '*SELECTION* %s 'CENTER-HZ)\n"), centerHz);
958  mPerTrackProps += wxString::Format(wxT("(putprop '*SELECTION* %s 'HIGH-HZ)\n"), highHz);
959  mPerTrackProps += wxString::Format(wxT("(putprop '*SELECTION* %s 'BANDWIDTH)\n"), bandwidth);
960  }
961 
962  success = ProcessOne();
963 
964  // Reset previous locale
965  wxSetlocale(LC_NUMERIC, prevlocale);
966 
967  if (!success || bOnePassTool) {
968  goto finish;
969  }
971  }
972 
974  }
975 
976  if (mOutputTime > 0.0) {
977  mT1 = mT0 + mOutputTime;
978  }
979 
980 finish:
981 
982  // Show debug window if trace set in plug-in header and something to show.
983  mDebug = (mTrace && !mDebugOutput.Translation().empty())? true : mDebug;
984 
985  if (mDebug && !mRedirectOutput) {
987  mName,
988  XO("Debug Output: "),
989  mDebugOutput);
990  dlog.CentreOnParent();
991  dlog.ShowModal();
992  }
993 
994  // Has rug been pulled from under us by some effect done within Nyquist??
995  if( !bOnePassTool && ( nEffectsSoFar == nEffectsDone ))
996  ReplaceProcessedTracks(success);
997  else{
998  ReplaceProcessedTracks(false); // Do not use the results.
999  // Selection is to be set to whatever it is in the project.
1000  auto project = FindProject();
1001  if (project) {
1002  auto &selectedRegion = ViewInfo::Get( *project ).selectedRegion;
1003  mT0 = selectedRegion.t0();
1004  mT1 = selectedRegion.t1();
1005  }
1006  else {
1007  mT0 = 0;
1008  mT1 = -1;
1009  }
1010 
1011  }
1012 
1013  if (!mProjectChanged)
1014  em.SetSkipStateFlag(true);
1015 
1016  return success;
1017 }

References FileNames::AudacityPathList(), FileNames::BaseDir(), TrackList::Channels(), Effect::CopyInputTracks(), FileNames::DataDir(), EffectTypeProcess, EffectTypeTool, EscapeString(), Effect::FindProject(), TranslatableString::Format(), BasicUI::Get(), EffectManager::Get(), ProjectRate::Get(), ViewInfo::Get(), TrackList::Get(), Effect::GetNumWaveGroups(), GetNyquistSearchPath(), anonymous_namespace{TimeTrack.cpp}::GetRate(), ProjectRate::GetRate(), Languages::GetSystemLanguageCode(), GetType(), gPrefs, SyncLock::Group(), FileNames::HtmlHelpDir(), Track::IsLeader(), Effect::IsPreviewing(), TrackList::Leaders(), mBreak, mCont, mCount, mCurLen, mCurNumChannels, mCurStart, mCurTrack, mDebug, mDebugOutput, mDebugOutputStr, Effect::MessageBox(), mFirstInGroup, mHelpFile, mHelpFileExists, min(), mMaxLen, mName, mNumSelectedChannels, mOutputTime, Effect::mOutputTracks, mPerTrackProps, mProgressIn, mProgressOut, mProgressTot, mProjectChanged, mProps, mRedirectOutput, mReentryCount, mScale, mStop, Effect::mT0, Effect::mT1, mTrace, mTrackIndex, Effect::mUIParent, mVersion, Effect::nEffectsDone, NYQ_MAX_LEN, FileNames::PlugInDir(), ProcessOne(), RegisterFunctions(), Effect::ReplaceProcessedTracks(), ViewInfo::selectedRegion, EffectManager::SetSkipStateFlag(), size, AllProjects::size(), StaticOSCallback(), StaticOutputCallback(), TempDirectory::TempDir(), SampleTrack::TimeToLongSamples(), Internat::ToString(), TranslatableString::Translation(), valueRestorer(), Verbatim(), and XO.

Here is the call graph for this function:

◆ ProcessOne()

bool NyquistEffect::ProcessOne ( )
private

Definition at line 1126 of file Nyquist.cpp.

1127 {
1128  mpException = {};
1129 
1130  nyx_rval rval;
1131 
1132  wxString cmd;
1133  cmd += wxT("(snd-set-latency 0.1)");
1134 
1135  // A tool may be using AUD-DO which will potentially invalidate *TRACK*
1136  // so tools do not get *TRACK*.
1137  if (GetType() == EffectTypeTool)
1138  cmd += wxT("(setf S 0.25)\n"); // No Track.
1139  else if (mVersion >= 4) {
1140  nyx_set_audio_name("*TRACK*");
1141  cmd += wxT("(setf S 0.25)\n");
1142  }
1143  else {
1144  nyx_set_audio_name("S");
1145  cmd += wxT("(setf *TRACK* '*unbound*)\n");
1146  }
1147 
1148  if(mVersion >= 4) {
1149  cmd += mProps;
1150  cmd += mPerTrackProps;
1151  }
1152 
1153  if( (mVersion >= 4) && (GetType() != EffectTypeTool) ) {
1154  // Set the track TYPE and VIEW properties
1155  wxString type;
1156  wxString view;
1157  wxString bitFormat;
1158  wxString spectralEditp;
1159 
1160  mCurTrack[0]->TypeSwitch(
1161  [&](const WaveTrack *wt) {
1162  type = wxT("wave");
1163  spectralEditp = mCurTrack[0]->GetSpectrogramSettings().SpectralSelectionEnabled()? wxT("T") : wxT("NIL");
1164  view = wxT("NIL");
1165  // Find() not Get() to avoid creation-on-demand of views in case we are
1166  // only previewing
1167  if ( const auto pView = WaveTrackView::Find( wt ) ) {
1168  auto displays = pView->GetDisplays();
1169  auto format = [&]( decltype(displays[0]) display ) {
1170  // Get the English name of the view type, without menu codes,
1171  // as a string that Lisp can examine
1172  return wxString::Format( wxT("\"%s\""),
1173  display.name.Stripped().Debug() );
1174  };
1175  if (displays.empty())
1176  ;
1177  else if (displays.size() == 1)
1178  view = format( displays[0] );
1179  else {
1180  view = wxT("(list");
1181  for ( auto display : displays )
1182  view += wxString(wxT(" ")) + format( display );
1183  view += wxT(")");
1184  }
1185  }
1186  },
1187 #if defined(USE_MIDI)
1188  [&](const NoteTrack *) {
1189  type = wxT("midi");
1190  view = wxT("\"Midi\"");
1191  },
1192 #endif
1193  [&](const LabelTrack *) {
1194  type = wxT("label");
1195  view = wxT("\"Label\"");
1196  },
1197  [&](const TimeTrack *) {
1198  type = wxT("time");
1199  view = wxT("\"Time\"");
1200  }
1201  );
1202 
1203  cmd += wxString::Format(wxT("(putprop '*TRACK* %d 'INDEX)\n"), ++mTrackIndex);
1204  cmd += wxString::Format(wxT("(putprop '*TRACK* \"%s\" 'NAME)\n"), EscapeString(mCurTrack[0]->GetName()));
1205  cmd += wxString::Format(wxT("(putprop '*TRACK* \"%s\" 'TYPE)\n"), type);
1206  // Note: "View" property may change when Audacity's choice of track views has stabilized.
1207  cmd += wxString::Format(wxT("(putprop '*TRACK* %s 'VIEW)\n"), view);
1208  cmd += wxString::Format(wxT("(putprop '*TRACK* %d 'CHANNELS)\n"), mCurNumChannels);
1209 
1210  //NOTE: Audacity 2.1.3 True if spectral selection is enabled regardless of track view.
1211  cmd += wxString::Format(wxT("(putprop '*TRACK* %s 'SPECTRAL-EDIT-ENABLED)\n"), spectralEditp);
1212 
1213  auto channels = TrackList::Channels( mCurTrack[0] );
1214  double startTime = channels.min( &Track::GetStartTime );
1215  double endTime = channels.max( &Track::GetEndTime );
1216 
1217  cmd += wxString::Format(wxT("(putprop '*TRACK* (float %s) 'START-TIME)\n"),
1218  Internat::ToString(startTime));
1219  cmd += wxString::Format(wxT("(putprop '*TRACK* (float %s) 'END-TIME)\n"),
1220  Internat::ToString(endTime));
1221  cmd += wxString::Format(wxT("(putprop '*TRACK* (float %s) 'GAIN)\n"),
1222  Internat::ToString(mCurTrack[0]->GetGain()));
1223  cmd += wxString::Format(wxT("(putprop '*TRACK* (float %s) 'PAN)\n"),
1224  Internat::ToString(mCurTrack[0]->GetPan()));
1225  cmd += wxString::Format(wxT("(putprop '*TRACK* (float %s) 'RATE)\n"),
1227 
1228  switch (mCurTrack[0]->GetSampleFormat())
1229  {
1230  case int16Sample:
1231  bitFormat = wxT("16");
1232  break;
1233  case int24Sample:
1234  bitFormat = wxT("24");
1235  break;
1236  case floatSample:
1237  bitFormat = wxT("32.0");
1238  break;
1239  }
1240  cmd += wxString::Format(wxT("(putprop '*TRACK* %s 'FORMAT)\n"), bitFormat);
1241 
1242  float maxPeakLevel = 0.0; // Deprecated as of 2.1.3
1243  wxString clips, peakString, rmsString;
1244  for (size_t i = 0; i < mCurNumChannels; i++) {
1245  auto ca = mCurTrack[i]->SortedClipArray();
1246  float maxPeak = 0.0;
1247 
1248  // A list of clips for mono, or an array of lists for multi-channel.
1249  if (mCurNumChannels > 1) {
1250  clips += wxT("(list ");
1251  }
1252  // Each clip is a list (start-time, end-time)
1253  // Limit number of clips added to avoid argument stack overflow error (bug 2300).
1254  for (size_t i=0; i<ca.size(); i++) {
1255  if (i < 1000) {
1256  clips += wxString::Format(wxT("(list (float %s) (float %s))"),
1257  Internat::ToString(ca[i]->GetPlayStartTime()),
1258  Internat::ToString(ca[i]->GetPlayEndTime()));
1259  } else if (i == 1000) {
1260  // If final clip is NIL, plug-in developer knows there are more than 1000 clips in channel.
1261  clips += "NIL";
1262  } else if (i > 1000) {
1263  break;
1264  }
1265  }
1266  if (mCurNumChannels > 1) clips += wxT(" )");
1267 
1268  float min, max;
1269  auto pair = mCurTrack[i]->GetMinMax(mT0, mT1); // may throw
1270  min = pair.first, max = pair.second;
1271  maxPeak = wxMax(wxMax(fabs(min), fabs(max)), maxPeak);
1272  maxPeakLevel = wxMax(maxPeakLevel, maxPeak);
1273 
1274  // On Debian, NaN samples give maxPeak = 3.40282e+38 (FLT_MAX)
1275  if (!std::isinf(maxPeak) && !std::isnan(maxPeak) && (maxPeak < FLT_MAX)) {
1276  peakString += wxString::Format(wxT("(float %s) "), Internat::ToString(maxPeak));
1277  } else {
1278  peakString += wxT("nil ");
1279  }
1280 
1281  float rms = mCurTrack[i]->GetRMS(mT0, mT1); // may throw
1282  if (!std::isinf(rms) && !std::isnan(rms)) {
1283  rmsString += wxString::Format(wxT("(float %s) "), Internat::ToString(rms));
1284  } else {
1285  rmsString += wxT("NIL ");
1286  }
1287  }
1288  // A list of clips for mono, or an array of lists for multi-channel.
1289  cmd += wxString::Format(wxT("(putprop '*TRACK* %s%s ) 'CLIPS)\n"),
1290  (mCurNumChannels == 1) ? wxT("(list ") : wxT("(vector "),
1291  clips);
1292 
1293  (mCurNumChannels > 1)?
1294  cmd += wxString::Format(wxT("(putprop '*SELECTION* (vector %s) 'PEAK)\n"), peakString) :
1295  cmd += wxString::Format(wxT("(putprop '*SELECTION* %s 'PEAK)\n"), peakString);
1296 
1297  if (!std::isinf(maxPeakLevel) && !std::isnan(maxPeakLevel) && (maxPeakLevel < FLT_MAX)) {
1298  cmd += wxString::Format(wxT("(putprop '*SELECTION* (float %s) 'PEAK-LEVEL)\n"),
1299  Internat::ToString(maxPeakLevel));
1300  }
1301 
1302  (mCurNumChannels > 1)?
1303  cmd += wxString::Format(wxT("(putprop '*SELECTION* (vector %s) 'RMS)\n"), rmsString) :
1304  cmd += wxString::Format(wxT("(putprop '*SELECTION* %s 'RMS)\n"), rmsString);
1305  }
1306 
1307  // If in tool mode, then we don't do anything with the track and selection.
1308  if (GetType() == EffectTypeTool) {
1309  nyx_set_audio_params(44100, 0);
1310  }
1311  else if (GetType() == EffectTypeGenerate) {
1312  nyx_set_audio_params(mCurTrack[0]->GetRate(), 0);
1313  }
1314  else {
1315  auto curLen = mCurLen.as_long_long();
1316  nyx_set_audio_params(mCurTrack[0]->GetRate(), curLen);
1317 
1318  nyx_set_input_audio(StaticGetCallback, (void *)this,
1319  (int)mCurNumChannels,
1320  curLen, mCurTrack[0]->GetRate());
1321  }
1322 
1323  // Restore the Nyquist sixteenth note symbol for Generate plug-ins.
1324  // See http://bugzilla.audacityteam.org/show_bug.cgi?id=490.
1325  if (GetType() == EffectTypeGenerate) {
1326  cmd += wxT("(setf s 0.25)\n");
1327  }
1328 
1329  if (mDebug || mTrace) {
1330  cmd += wxT("(setf *tracenable* T)\n");
1331  if (mExternal) {
1332  cmd += wxT("(setf *breakenable* T)\n");
1333  }
1334  }
1335  else {
1336  // Explicitly disable backtrace and prevent values
1337  // from being carried through to the output.
1338  // This should be the final command before evaluating the Nyquist script.
1339  cmd += wxT("(setf *tracenable* NIL)\n");
1340  }
1341 
1342  for (unsigned int j = 0; j < mControls.size(); j++) {
1343  if (mControls[j].type == NYQ_CTRL_FLOAT || mControls[j].type == NYQ_CTRL_FLOAT_TEXT ||
1344  mControls[j].type == NYQ_CTRL_TIME) {
1345  // We use Internat::ToString() rather than "%f" here because we
1346  // always have to use the dot as decimal separator when giving
1347  // numbers to Nyquist, whereas using "%f" will use the user's
1348  // decimal separator which may be a comma in some countries.
1349  cmd += wxString::Format(wxT("(setf %s %s)\n"),
1350  mControls[j].var,
1351  Internat::ToString(mControls[j].val, 14));
1352  }
1353  else if (mControls[j].type == NYQ_CTRL_INT ||
1354  mControls[j].type == NYQ_CTRL_INT_TEXT ||
1355  mControls[j].type == NYQ_CTRL_CHOICE) {
1356  cmd += wxString::Format(wxT("(setf %s %d)\n"),
1357  mControls[j].var,
1358  (int)(mControls[j].val));
1359  }
1360  else if (mControls[j].type == NYQ_CTRL_STRING || mControls[j].type == NYQ_CTRL_FILE) {
1361  cmd += wxT("(setf ");
1362  // restrict variable names to 7-bit ASCII:
1363  cmd += mControls[j].var;
1364  cmd += wxT(" \"");
1365  cmd += EscapeString(mControls[j].valStr); // unrestricted value will become quoted UTF-8
1366  cmd += wxT("\")\n");
1367  }
1368  }
1369 
1370  if (mIsSal) {
1371  wxString str = EscapeString(mCmd);
1372  // this is tricky: we need SAL to call main so that we can get a
1373  // SAL traceback in the event of an error (sal-compile catches the
1374  // error and calls sal-error-output), but SAL does not return values.
1375  // We will catch the value in a special global aud:result and if no
1376  // error occurs, we will grab the value with a LISP expression
1377  str += wxT("\nset aud:result = main()\n");
1378 
1379  if (mDebug || mTrace) {
1380  // since we're about to evaluate SAL, remove LISP trace enable and
1381  // break enable (which stops SAL processing) and turn on SAL stack
1382  // trace
1383  cmd += wxT("(setf *tracenable* nil)\n");
1384  cmd += wxT("(setf *breakenable* nil)\n");
1385  cmd += wxT("(setf *sal-traceback* t)\n");
1386  }
1387 
1388  if (mCompiler) {
1389  cmd += wxT("(setf *sal-compiler-debug* t)\n");
1390  }
1391 
1392  cmd += wxT("(setf *sal-call-stack* nil)\n");
1393  // if we do not set this here and an error occurs in main, another
1394  // error will be raised when we try to return the value of aud:result
1395  // which is unbound
1396  cmd += wxT("(setf aud:result nil)\n");
1397  cmd += wxT("(sal-compile-audacity \"") + str + wxT("\" t t nil)\n");
1398  // Capture the value returned by main (saved in aud:result), but
1399  // set aud:result to nil so sound results can be evaluated without
1400  // retaining audio in memory
1401  cmd += wxT("(prog1 aud:result (setf aud:result nil))\n");
1402  }
1403  else {
1404  cmd += mCmd;
1405  }
1406 
1407  // Put the fetch buffers in a clean initial state
1408  for (size_t i = 0; i < mCurNumChannels; i++)
1409  mCurBuffer[i].reset();
1410 
1411  // Guarantee release of memory when done
1412  auto cleanup = finally( [&] {
1413  for (size_t i = 0; i < mCurNumChannels; i++)
1414  mCurBuffer[i].reset();
1415  } );
1416 
1417  // Evaluate the expression, which may invoke the get callback, but often does
1418  // not, leaving that to delayed evaluation of the output sound
1419  rval = nyx_eval_expression(cmd.mb_str(wxConvUTF8));
1420 
1421  // If we're not showing debug window, log errors and warnings:
1422  const auto output = mDebugOutput.Translation();
1423  if (!output.empty() && !mDebug && !mTrace) {
1424  /* i18n-hint: An effect "returned" a message.*/
1425  wxLogMessage(wxT("\'%s\' returned:\n%s"),
1426  mName.Translation(), output);
1427  }
1428 
1429  // Audacity has no idea how long Nyquist processing will take, but
1430  // can monitor audio being returned.
1431  // Anything other than audio should be returned almost instantly
1432  // so notify the user that process has completed (bug 558)
1433  if ((rval != nyx_audio) && ((mCount + mCurNumChannels) == mNumSelectedChannels)) {
1434  if (mCurNumChannels == 1) {
1435  TrackProgress(mCount, 1.0, XO("Processing complete."));
1436  }
1437  else {
1438  TrackGroupProgress(mCount, 1.0, XO("Processing complete."));
1439  }
1440  }
1441 
1442  if ((rval == nyx_audio) && (GetType() == EffectTypeTool)) {
1443  // Catch this first so that we can also handle other errors.
1444  mDebugOutput =
1445  /* i18n-hint: Don't translate ';type tool'. */
1446  XO("';type tool' effects cannot return audio from Nyquist.\n")
1447  + mDebugOutput;
1448  rval = nyx_error;
1449  }
1450 
1451  if ((rval == nyx_labels) && (GetType() == EffectTypeTool)) {
1452  // Catch this first so that we can also handle other errors.
1453  mDebugOutput =
1454  /* i18n-hint: Don't translate ';type tool'. */
1455  XO("';type tool' effects cannot return labels from Nyquist.\n")
1456  + mDebugOutput;
1457  rval = nyx_error;
1458  }
1459 
1460  if (rval == nyx_error) {
1461  // Return value is not valid type.
1462  // Show error in debug window if trace enabled, otherwise log.
1463  if (mTrace) {
1464  /* i18n-hint: "%s" is replaced by name of plug-in.*/
1465  mDebugOutput = XO("nyx_error returned from %s.\n")
1466  .Format( mName.empty() ? XO("plug-in") : mName )
1467  + mDebugOutput;
1468  mDebug = true;
1469  }
1470  else {
1471  wxLogMessage(
1472  "Nyquist returned nyx_error:\n%s", mDebugOutput.Translation());
1473  }
1474  return false;
1475  }
1476 
1477  if (rval == nyx_list) {
1478  wxLogMessage("Nyquist returned nyx_list");
1479  if (GetType() == EffectTypeTool) {
1480  mProjectChanged = true;
1481  } else {
1482  Effect::MessageBox(XO("Nyquist returned a list.") );
1483  }
1484  return true;
1485  }
1486 
1487  if (rval == nyx_string) {
1488  // Assume the string has already been translated within the Lisp runtime
1489  // if necessary, by one of the gettext functions defined below, before it
1490  // is communicated back to C++
1491  auto msg = Verbatim( NyquistToWxString(nyx_get_string()) );
1492  if (!msg.empty()) { // Empty string may be used as a No-Op return value.
1493  Effect::MessageBox( msg );
1494  }
1495  else if (GetType() == EffectTypeTool) {
1496  // ;tools may change the project with aud-do commands so
1497  // it is essential that the state is added to history.
1498  mProjectChanged = true;
1499  return true;
1500  }
1501  else {
1502  // A true no-op.
1503  return true;
1504  }
1505 
1506  // True if not process type.
1507  // If not returning audio from process effect,
1508  // return first result then stop (disables preview)
1509  // but allow all output from Nyquist Prompt.
1510  return (GetType() != EffectTypeProcess || mIsPrompt);
1511  }
1512 
1513  if (rval == nyx_double) {
1514  auto str = XO("Nyquist returned the value: %f")
1515  .Format(nyx_get_double());
1517  return (GetType() != EffectTypeProcess || mIsPrompt);
1518  }
1519 
1520  if (rval == nyx_int) {
1521  auto str = XO("Nyquist returned the value: %d")
1522  .Format(nyx_get_int());
1524  return (GetType() != EffectTypeProcess || mIsPrompt);
1525  }
1526 
1527  if (rval == nyx_labels) {
1528  mProjectChanged = true;
1529  unsigned int numLabels = nyx_get_num_labels();
1530  unsigned int l;
1531  auto ltrack = * mOutputTracks->Any< LabelTrack >().begin();
1532  if (!ltrack) {
1533  ltrack = static_cast<LabelTrack*>(
1534  AddToOutputTracks(std::make_shared<LabelTrack>()));
1535  }
1536 
1537  for (l = 0; l < numLabels; l++) {
1538  double t0, t1;
1539  const char *str;
1540 
1541  // PRL: to do:
1542  // let Nyquist analyzers define more complicated selections
1543  nyx_get_label(l, &t0, &t1, &str);
1544 
1545  ltrack->AddLabel(SelectedRegion(t0 + mT0, t1 + mT0), UTF8CTOWX(str));
1546  }
1547  return (GetType() != EffectTypeProcess || mIsPrompt);
1548  }
1549 
1550  wxASSERT(rval == nyx_audio);
1551 
1552  int outChannels = nyx_get_audio_num_channels();
1553  if (outChannels > (int)mCurNumChannels) {
1554  Effect::MessageBox( XO("Nyquist returned too many audio channels.\n") );
1555  return false;
1556  }
1557 
1558  if (outChannels == -1) {
1560  XO("Nyquist returned one audio channel as an array.\n") );
1561  return false;
1562  }
1563 
1564  if (outChannels == 0) {
1565  Effect::MessageBox( XO("Nyquist returned an empty array.\n") );
1566  return false;
1567  }
1568 
1569  std::shared_ptr<WaveTrack> outputTrack[2];
1570 
1571  double rate = mCurTrack[0]->GetRate();
1572  for (int i = 0; i < outChannels; i++) {
1573  if (outChannels == (int)mCurNumChannels) {
1574  rate = mCurTrack[i]->GetRate();
1575  }
1576 
1577  outputTrack[i] = mCurTrack[i]->EmptyCopy();
1578  outputTrack[i]->SetRate( rate );
1579 
1580  // Clean the initial buffer states again for the get callbacks
1581  // -- is this really needed?
1582  mCurBuffer[i].reset();
1583  }
1584 
1585  // Now fully evaluate the sound
1586  int success;
1587  {
1588  auto vr0 = valueRestorer( mOutputTrack[0], outputTrack[0].get() );
1589  auto vr1 = valueRestorer( mOutputTrack[1], outputTrack[1].get() );
1590  success = nyx_get_audio(StaticPutCallback, (void *)this);
1591  }
1592 
1593  // See if GetCallback found read errors
1594  {
1595  auto pException = mpException;
1596  mpException = {};
1597  if (pException)
1598  std::rethrow_exception( pException );
1599  }
1600 
1601  if (!success)
1602  return false;
1603 
1604  for (int i = 0; i < outChannels; i++) {
1605  outputTrack[i]->Flush();
1606  mOutputTime = outputTrack[i]->GetEndTime();
1607 
1608  if (mOutputTime <= 0) {
1609  Effect::MessageBox( XO("Nyquist returned nil audio.\n") );
1610  return false;
1611  }
1612  }
1613 
1614  for (size_t i = 0; i < mCurNumChannels; i++) {
1615  WaveTrack *out;
1616 
1617  if (outChannels == (int)mCurNumChannels) {
1618  out = outputTrack[i].get();
1619  }
1620  else {
1621  out = outputTrack[0].get();
1622  }
1623 
1624  if (mMergeClips < 0) {
1625  // Use sample counts to determine default behaviour - times will rarely be equal.
1626  bool bMergeClips = (out->TimeToLongSamples(mT0) + out->TimeToLongSamples(mOutputTime) ==
1627  out->TimeToLongSamples(mT1));
1628  mCurTrack[i]->ClearAndPaste(mT0, mT1, out, mRestoreSplits, bMergeClips);
1629  }
1630  else {
1632  }
1633 
1634  // If we were first in the group adjust non-selected group tracks
1635  if (mFirstInGroup) {
1636  for (auto t : SyncLock::Group(mCurTrack[i]))
1637  {
1638  if (!t->GetSelected() && SyncLock::IsSyncLockSelected(t)) {
1639  t->SyncLockAdjust(mT1, mT0 + out->GetEndTime());
1640  }
1641  }
1642  }
1643 
1644  // Only the first channel can be first in its group
1645  mFirstInGroup = false;
1646  }
1647 
1648  mProjectChanged = true;
1649  return true;
1650 }

References Effect::AddToOutputTracks(), sampleCount::as_long_long(), TrackList::Channels(), WaveTrack::ClearAndPaste(), EffectTypeGenerate, EffectTypeProcess, EffectTypeTool, TranslatableString::empty(), WaveTrack::EmptyCopy(), EscapeString(), WaveTrackView::Find(), floatSample, WaveTrack::Flush(), format, Track::GetEndTime(), WaveTrack::GetEndTime(), WaveTrack::GetMinMax(), ComponentInterface::GetName(), anonymous_namespace{TimeTrack.cpp}::GetRate(), WaveTrack::GetRate(), WaveTrack::GetRMS(), WaveTrack::GetSpectrogramSettings(), Track::GetStartTime(), GetType(), SyncLock::Group(), int16Sample, int24Sample, SyncLock::IsSyncLockSelected(), mCmd, mCompiler, mControls, mCount, mCurBuffer, mCurLen, mCurNumChannels, mCurTrack, mDebug, mDebugOutput, Effect::MessageBox(), mExternal, mFirstInGroup, min(), mIsPrompt, mIsSal, mMergeClips, mName, mNumSelectedChannels, mOutputTime, mOutputTrack, Effect::mOutputTracks, mPerTrackProps, mpException, mProjectChanged, mProps, mRestoreSplits, Effect::mT0, Effect::mT1, mTrace, mTrackIndex, mVersion, NYQ_CTRL_CHOICE, NYQ_CTRL_FILE, NYQ_CTRL_FLOAT, NYQ_CTRL_FLOAT_TEXT, NYQ_CTRL_INT, NYQ_CTRL_INT_TEXT, NYQ_CTRL_STRING, NYQ_CTRL_TIME, NyquistToWxString(), WaveTrack::SetRate(), WaveTrack::SortedClipArray(), SpectrogramSettings::SpectralSelectionEnabled(), StaticGetCallback(), StaticPutCallback(), str, SampleTrack::TimeToLongSamples(), Internat::ToString(), Effect::TrackGroupProgress(), Effect::TrackProgress(), TranslatableString::Translation(), Track::TypeSwitch(), UTF8CTOWX, valueRestorer(), Verbatim(), and XO.

Referenced by Process().

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

◆ PutCallback()

int NyquistEffect::PutCallback ( float *  buffer,
int  channel,
int64_t  start,
int64_t  len,
int64_t  totlen 
)
private

Definition at line 2509 of file Nyquist.cpp.

2511 {
2512  // Don't let C++ exceptions propagate through the Nyquist library
2513  return GuardedCall<int>( [&] {
2514  if (channel == 0) {
2515  double progress = mScale*((float)(start+len)/totlen);
2516 
2517  if (progress > mProgressOut) {
2518  mProgressOut = progress;
2519  }
2520 
2522  return -1;
2523  }
2524  }
2525 
2526  mOutputTrack[channel]->Append((samplePtr)buffer, floatSample, len);
2527 
2528  return 0; // success
2529  }, MakeSimpleGuard( -1 ) ); // translate all exceptions into failure
2530 }

References WaveTrack::Append(), floatSample, MakeSimpleGuard(), mOutputTrack, mProgressIn, mProgressOut, mProgressTot, mScale, and Effect::TotalProgress().

Referenced by StaticPutCallback().

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

◆ RedirectOutput()

void NyquistEffect::RedirectOutput ( )

Definition at line 1777 of file Nyquist.cpp.

1778 {
1779  mRedirectOutput = true;
1780 }

References mRedirectOutput.

Referenced by NyqBench::OnGo().

Here is the caller graph for this function:

◆ resolveFilePath()

void NyquistEffect::resolveFilePath ( wxString &  path,
FileExtension  extension = {} 
)
private

Definition at line 3227 of file Nyquist.cpp.

3228 {
3229 #if defined(__WXMSW__)
3230  path.Replace("/", wxFileName::GetPathSeparator());
3231 #endif
3232 
3233  path.Trim(true).Trim(false);
3234 
3235  typedef std::unordered_map<wxString, FilePath> map;
3236  map pathKeys = {
3237  {"*home*", wxGetHomeDir()},
3238  {"~", wxGetHomeDir()},
3239  {"*default*", FileNames::DefaultToDocumentsFolder("").GetPath()},
3240  {"*export*", FileNames::FindDefaultPath(FileNames::Operation::Export)},
3241  {"*save*", FileNames::FindDefaultPath(FileNames::Operation::Save)},
3242  {"*config*", FileNames::DataDir()}
3243  };
3244 
3245  int characters = path.Find(wxFileName::GetPathSeparator());
3246  if(characters == wxNOT_FOUND) // Just a path or just a file name
3247  {
3248  if (path.empty())
3249  path = "*default*";
3250 
3251  if (pathKeys.find(path) != pathKeys.end())
3252  {
3253  // Keyword found, so assume this is the intended directory.
3254  path = pathKeys[path] + wxFileName::GetPathSeparator();
3255  }
3256  else // Just a file name
3257  {
3258  path = pathKeys["*default*"] + wxFileName::GetPathSeparator() + path;
3259  }
3260  }
3261  else // path + file name
3262  {
3263  wxString firstDir = path.Left(characters);
3264  wxString rest = path.Mid(characters);
3265 
3266  if (pathKeys.find(firstDir) != pathKeys.end())
3267  {
3268  path = pathKeys[firstDir] + rest;
3269  }
3270  }
3271 
3272  wxFileName fname = path;
3273 
3274  // If the directory is invalid, better to leave it as is (invalid) so that
3275  // the user sees the error rather than an unexpected file path.
3276  if (fname.wxFileName::IsOk() && fname.GetFullName().empty())
3277  {
3278  path = fname.GetPathWithSep() + _("untitled");
3279  if (!extension.empty())
3280  path = path + '.' + extension;
3281  }
3282 }

References _, FileNames::DataDir(), FileNames::DefaultToDocumentsFolder(), and FileNames::FindDefaultPath().

Referenced by BuildEffectWindow(), GetAutomationParameters(), OnFileButton(), and TransferDataFromEffectWindow().

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

◆ SetAutomationParameters()

bool NyquistEffect::SetAutomationParameters ( CommandParameters parms)
overridevirtual

Change settings to those stored in parms.

Reimplemented from Effect.

Definition at line 417 of file Nyquist.cpp.

418 {
419  if (mIsPrompt)
420  {
421  parms.Read(KEY_Command, &mInputCmd, wxEmptyString);
422  parms.Read(KEY_Parameters, &mParameters, wxEmptyString);
423 
424  if (!mInputCmd.empty())
425  {
427  }
428 
429  if (!mParameters.empty())
430  {
431  parms.SetParameters(mParameters);
432  }
433 
434  if (!IsBatchProcessing())
435  {
437  }
438 
439  mPromptType = mType;
441  mExternal = true;
442 
443  if (!IsBatchProcessing())
444  {
445  return true;
446  }
447  }
448 
449  // Constants to document what the true/false values mean.
450  const auto kTestOnly = true;
451  const auto kTestAndSet = false;
452 
453  // badCount will encompass both actual bad values and missing values.
454  // We probably never actually have bad values when using the dialogs
455  // since the dialog validation will catch them.
456  int badCount;
457  // When batch processing, we just ignore missing/bad parameters.
458  // We'll end up using defaults in those cases.
459  if (!IsBatchProcessing()) {
460  badCount = SetLispVarsFromParameters(parms, kTestOnly);
461  if (badCount > 0)
462  return false;
463  }
464 
465  badCount = SetLispVarsFromParameters(parms, kTestAndSet);
466  // We never do anything with badCount here.
467  // It might be non zero, for missing parameters, and we allow that,
468  // and don't distinguish that from an out-of-range value.
469  return true;
470 }

References EffectTypeTool, Effect::IsBatchProcessing(), KEY_Command, KEY_Parameters, mExternal, mInputCmd, mIsPrompt, mIsTool, mParameters, mPromptType, mType, ParseCommand(), SetLispVarsFromParameters(), and CommandParameters::SetParameters().

Referenced by DefineParams(), and ShowHostInterface().

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

◆ SetCommand()

void NyquistEffect::SetCommand ( const wxString &  cmd)

Definition at line 1782 of file Nyquist.cpp.

1783 {
1784  mExternal = true;
1785 
1786  if (cmd.size()) {
1787  ParseCommand(cmd);
1788  }
1789 }

References mExternal, and ParseCommand().

Referenced by NyqBench::OnGo(), and ShowHostInterface().

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

◆ SetLispVarsFromParameters()

int NyquistEffect::SetLispVarsFromParameters ( CommandParameters parms,
bool  bTestOnly 
)

Definition at line 476 of file Nyquist.cpp.

477 {
478  int badCount = 0;
479  // First pass verifies values
480  for (size_t c = 0, cnt = mControls.size(); c < cnt; c++)
481  {
482  NyqControl & ctrl = mControls[c];
483  bool good = false;
484 
485  // This GetCtrlValue code is preserved from former code,
486  // but probably is pointless. The value d isn't used later,
487  // and GetCtrlValue does not appear to have important needed
488  // side effects.
489  if (!bTestOnly) {
490  double d = ctrl.val;
491  if (d == UNINITIALIZED_CONTROL && ctrl.type != NYQ_CTRL_STRING)
492  {
493  d = GetCtrlValue(ctrl.valStr);
494  }
495  }
496 
497  if (ctrl.type == NYQ_CTRL_FLOAT || ctrl.type == NYQ_CTRL_FLOAT_TEXT ||
498  ctrl.type == NYQ_CTRL_TIME)
499  {
500  double val;
501  good = parms.Read(ctrl.var, &val) &&
502  val >= ctrl.low &&
503  val <= ctrl.high;
504  if (good && !bTestOnly)
505  ctrl.val = val;
506  }
507  else if (ctrl.type == NYQ_CTRL_INT || ctrl.type == NYQ_CTRL_INT_TEXT)
508  {
509  int val;
510  good = parms.Read(ctrl.var, &val) &&
511  val >= ctrl.low &&
512  val <= ctrl.high;
513  if (good && !bTestOnly)
514  ctrl.val = (double)val;
515  }
516  else if (ctrl.type == NYQ_CTRL_CHOICE)
517  {
518  int val;
519  // untranslated
520  good = parms.ReadEnum(ctrl.var, &val,
521  ctrl.choices.data(), ctrl.choices.size()) &&
522  val != wxNOT_FOUND;
523  if (good && !bTestOnly)
524  ctrl.val = (double)val;
525  }
526  else if (ctrl.type == NYQ_CTRL_STRING || ctrl.type == NYQ_CTRL_FILE)
527  {
528  wxString val;
529  good = parms.Read(ctrl.var, &val);
530  if (good && !bTestOnly)
531  ctrl.valStr = val;
532  }
533  else if (ctrl.type == NYQ_CTRL_TEXT)
534  {
535  // This "control" is just fixed text (nothing to save or restore),
536  // Does not count for good/bad counting.
537  good = true;
538  }
539  badCount += !good ? 1 : 0;
540  }
541  return badCount;
542 }

References NyqControl::choices, GetCtrlValue(), NyqControl::high, NyqControl::low, mControls, NYQ_CTRL_CHOICE, NYQ_CTRL_FILE, NYQ_CTRL_FLOAT, NYQ_CTRL_FLOAT_TEXT, NYQ_CTRL_INT, NYQ_CTRL_INT_TEXT, NYQ_CTRL_STRING, NYQ_CTRL_TEXT, NYQ_CTRL_TIME, CommandParameters::ReadEnum(), NyqControl::type, UNINITIALIZED_CONTROL, NyqControl::val, NyqControl::valStr, and NyqControl::var.

Referenced by SetAutomationParameters().

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

◆ ShowHostInterface()

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

Reimplemented from Effect.

Definition at line 1019 of file Nyquist.cpp.

1021 {
1022  int res = wxID_APPLY;
1024  // Show the normal (prompt or effect) interface
1025  res = Effect::ShowHostInterface(parent, factory, forceModal);
1026  }
1027 
1028 
1029  // Remember if the user clicked debug
1030  mDebug = (res == eDebugID);
1031 
1032  // We're done if the user clicked "Close", we are not the Nyquist Prompt,
1033  // or the program currently loaded into the prompt doesn't have a UI.
1034  if (!res || !mIsPrompt || mControls.size() == 0)
1035  {
1036  return res;
1037  }
1038 
1040 
1041  if (IsBatchProcessing())
1042  {
1043  effect.SetBatchProcessing(true);
1044  effect.SetCommand(mInputCmd);
1045 
1046  CommandParameters cp;
1048  effect.SetAutomationParameters(cp);
1049 
1050  // Show the normal (prompt or effect) interface
1051  res = effect.ShowHostInterface(parent, factory, forceModal);
1052  if (res)
1053  {
1054  CommandParameters cp;
1055  effect.GetAutomationParameters(cp);
1057  }
1058  }
1059  else
1060  {
1061  effect.SetCommand(mInputCmd);
1062  effect.mDebug = (res == eDebugID);
1063  res = Delegate(effect, parent, factory);
1064  mT0 = effect.mT0;
1065  mT1 = effect.mT1;
1066  }
1067 
1068  return res;
1069 }

References Effect::Delegate(), eDebugID, factory, GetAutomationParameters(), CommandParameters::GetParameters(), Effect::IsBatchProcessing(), EffectManager::kRepeatNyquistPrompt, mControls, mDebug, mInputCmd, mIsPrompt, mParameters, Effect::mT0, Effect::mT1, NYQUIST_WORKER_ID, SetAutomationParameters(), Effect::SetBatchProcessing(), SetCommand(), CommandParameters::SetParameters(), Effect::ShowHostInterface(), ShowHostInterface(), and Effect::TestUIFlags().

Referenced by ShowHostInterface().

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

◆ StaticGetCallback()

int NyquistEffect::StaticGetCallback ( float *  buffer,
int  channel,
int64_t  start,
int64_t  len,
int64_t  totlen,
void *  userdata 
)
staticprivate

Definition at line 2434 of file Nyquist.cpp.

2437 {
2438  NyquistEffect *This = (NyquistEffect *)userdata;
2439  return This->GetCallback(buffer, channel, start, len, totlen);
2440 }

References GetCallback().

Referenced by ProcessOne().

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

◆ StaticOSCallback()

void NyquistEffect::StaticOSCallback ( void *  userdata)
staticprivate

Definition at line 2548 of file Nyquist.cpp.

2549 {
2550  ((NyquistEffect *)This)->OSCallback();
2551 }

Referenced by Process().

Here is the caller graph for this function:

◆ StaticOutputCallback()

void NyquistEffect::StaticOutputCallback ( int  c,
void *  userdata 
)
staticprivate

Definition at line 2532 of file Nyquist.cpp.

2533 {
2534  ((NyquistEffect *)This)->OutputCallback(c);
2535 }

Referenced by Process().

Here is the caller graph for this function:

◆ StaticPutCallback()

int NyquistEffect::StaticPutCallback ( float *  buffer,
int  channel,
int64_t  start,
int64_t  len,
int64_t  totlen,
void *  userdata 
)
staticprivate

Definition at line 2501 of file Nyquist.cpp.

2504 {
2505  NyquistEffect *This = (NyquistEffect *)userdata;
2506  return This->PutCallback(buffer, channel, start, len, totlen);
2507 }

References PutCallback().

Referenced by ProcessOne().

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

◆ Stop()

void NyquistEffect::Stop ( )

Definition at line 1801 of file Nyquist.cpp.

1802 {
1803  mStop = true;
1804 }

References mStop.

Referenced by NyqBench::OnStop().

Here is the caller graph for this function:

◆ ToTimeFormat()

wxString NyquistEffect::ToTimeFormat ( double  t)
private

Definition at line 3296 of file Nyquist.cpp.

3297 {
3298  int seconds = static_cast<int>(t);
3299  int hh = seconds / 3600;
3300  int mm = seconds % 3600;
3301  mm = mm / 60;
3302  return wxString::Format("%d:%d:%.3f", hh, mm, t - (hh * 3600 + mm * 60));
3303 }

Referenced by OnTime().

Here is the caller graph for this function:

◆ TransferDataFromEffectWindow()

bool NyquistEffect::TransferDataFromEffectWindow ( )
private

Definition at line 2662 of file Nyquist.cpp.

2663 {
2664  if (mControls.size() == 0)
2665  {
2666  return true;
2667  }
2668 
2669  for (unsigned int i = 0; i < mControls.size(); i++)
2670  {
2671  NyqControl *ctrl = &mControls[i];
2672 
2673  if (ctrl->type == NYQ_CTRL_STRING || ctrl->type == NYQ_CTRL_TEXT)
2674  {
2675  continue;
2676  }
2677 
2678  if (ctrl->val == UNINITIALIZED_CONTROL)
2679  {
2680  ctrl->val = GetCtrlValue(ctrl->valStr);
2681  }
2682 
2683  if (ctrl->type == NYQ_CTRL_CHOICE)
2684  {
2685  continue;
2686  }
2687 
2688  if (ctrl->type == NYQ_CTRL_FILE)
2689  {
2690  resolveFilePath(ctrl->valStr);
2691 
2692  wxString path;
2693  if (ctrl->valStr.StartsWith("\"", &path))
2694  {
2695  // Validate if a list of quoted paths.
2696  if (path.EndsWith("\"", &path))
2697  {
2698  path.Replace("\"\"", "\"");
2699  wxStringTokenizer tokenizer(path, "\"");
2700  while (tokenizer.HasMoreTokens())
2701  {
2702  wxString token = tokenizer.GetNextToken();
2703  if(!validatePath(token))
2704  {
2705  const auto message =
2706  XO("\"%s\" is not a valid file path.").Format( token );
2708  message,
2709  wxOK | wxICON_EXCLAMATION | wxCENTRE,
2710  XO("Error") );
2711  return false;
2712  }
2713  }
2714  continue;
2715  }
2716  else
2717  {
2718  const auto message =
2719  /* i18n-hint: Warning that there is one quotation mark rather than a pair.*/
2720  XO("Mismatched quotes in\n%s").Format( ctrl->valStr );
2722  message,
2723  wxOK | wxICON_EXCLAMATION | wxCENTRE,
2724  XO("Error") );
2725  return false;
2726  }
2727  }
2728  // Validate a single path.
2729  else if (validatePath(ctrl->valStr))
2730  {
2731  continue;
2732  }
2733 
2734  // Validation failed
2735  const auto message =
2736  XO("\"%s\" is not a valid file path.").Format( ctrl->valStr );
2738  message,
2739  wxOK | wxICON_EXCLAMATION | wxCENTRE,
2740  XO("Error") );
2741  return false;
2742  }
2743 
2744  if (ctrl->type == NYQ_CTRL_TIME)
2745  {
2746  NumericTextCtrl *n = (NumericTextCtrl *) mUIParent->FindWindow(ID_Time + i);
2747  ctrl->val = n->GetValue();
2748  }
2749 
2750  if (ctrl->type == NYQ_CTRL_INT_TEXT && ctrl->lowStr.IsSameAs(wxT("nil"), false)) {
2751  ctrl->low = INT_MIN;
2752  }
2753  else if ((ctrl->type == NYQ_CTRL_FLOAT_TEXT || ctrl->type == NYQ_CTRL_TIME) &&
2754  ctrl->lowStr.IsSameAs(wxT("nil"), false))
2755  {
2756  ctrl->low = -(FLT_MAX);
2757  }
2758  else
2759  {
2760  ctrl->low = GetCtrlValue(ctrl->lowStr);
2761  }
2762 
2763  if (ctrl->type == NYQ_CTRL_INT_TEXT && ctrl->highStr.IsSameAs(wxT("nil"), false)) {
2764  ctrl->high = INT_MAX;
2765  }
2766  else if ((ctrl->type == NYQ_CTRL_FLOAT_TEXT || ctrl->type == NYQ_CTRL_TIME) &&
2767  ctrl->highStr.IsSameAs(wxT("nil"), false))
2768  {
2769  ctrl->high = FLT_MAX;
2770  }
2771  else
2772  {
2773  ctrl->high = GetCtrlValue(ctrl->highStr);
2774  }
2775 
2776  if (ctrl->high < ctrl->low)
2777  {
2778  ctrl->high = ctrl->low + 1;
2779  }
2780 
2781  if (ctrl->val < ctrl->low)
2782  {
2783  ctrl->val = ctrl->low;
2784  }
2785 
2786  if (ctrl->val > ctrl->high)
2787  {
2788  ctrl->val = ctrl->high;
2789  }
2790 
2791  ctrl->ticks = 1000;
2792  if (ctrl->type == NYQ_CTRL_INT &&
2793  (ctrl->high - ctrl->low < ctrl->ticks))
2794  {
2795  ctrl->ticks = (int)(ctrl->high - ctrl->low);
2796  }
2797  }
2798 
2799  return true;
2800 }

References GetCtrlValue(), NumericConverter::GetValue(), NyqControl::high, NyqControl::highStr, ID_Time, NyqControl::low, NyqControl::lowStr, mControls, Effect::MessageBox(), Effect::mUIParent, NYQ_CTRL_CHOICE, NYQ_CTRL_FILE, NYQ_CTRL_FLOAT_TEXT, NYQ_CTRL_INT, NYQ_CTRL_INT_TEXT, NYQ_CTRL_STRING, NYQ_CTRL_TEXT, NYQ_CTRL_TIME, resolveFilePath(), NyqControl::ticks, NyqControl::type, UNINITIALIZED_CONTROL, NyqControl::val, validatePath(), NyqControl::valStr, and XO.

Referenced by TransferDataFromWindow().

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

◆ TransferDataFromPromptWindow()

bool NyquistEffect::TransferDataFromPromptWindow ( )
private

Definition at line 2644 of file Nyquist.cpp.

2645 {
2646  mInputCmd = mCommandText->GetValue();
2647 
2648  // Un-correct smart quoting, bothersomely applied in wxTextCtrl by
2649  // the native widget of MacOS 10.9 SDK
2650  const wxString left = wxT("\u201c"), right = wxT("\u201d"), dumb = '"';
2651  mInputCmd.Replace(left, dumb, true);
2652  mInputCmd.Replace(right, dumb, true);
2653 
2654  const wxString leftSingle = wxT("\u2018"), rightSingle = wxT("\u2019"),
2655  dumbSingle = '\'';
2656  mInputCmd.Replace(leftSingle, dumbSingle, true);
2657  mInputCmd.Replace(rightSingle, dumbSingle, true);
2658 
2659  return ParseCommand(mInputCmd);
2660 }

References mCommandText, mInputCmd, and ParseCommand().

Referenced by TransferDataFromWindow().

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

◆ TransferDataFromWindow()

bool NyquistEffect::TransferDataFromWindow ( )
overridevirtual

Reimplemented from Effect.

Definition at line 1110 of file Nyquist.cpp.

1111 {
1112  if (!mUIParent->Validate() || !mUIParent->TransferDataFromWindow())
1113  {
1114  return false;
1115  }
1116 
1117  if (mIsPrompt)
1118  {
1120  }
1122 }

References mIsPrompt, Effect::mUIParent, TransferDataFromEffectWindow(), and TransferDataFromPromptWindow().

Here is the call graph for this function:

◆ TransferDataToEffectWindow()

bool NyquistEffect::TransferDataToEffectWindow ( )
private

Definition at line 2607 of file Nyquist.cpp.

2608 {
2609  for (size_t i = 0, cnt = mControls.size(); i < cnt; i++)
2610  {
2611  NyqControl & ctrl = mControls[i];
2612 
2613  if (ctrl.type == NYQ_CTRL_CHOICE)
2614  {
2615  const auto count = ctrl.choices.size();
2616 
2617  int val = (int)ctrl.val;
2618  if (val < 0 || val >= (int)count)
2619  {
2620  val = 0;
2621  }
2622 
2623  wxChoice *c = (wxChoice *) mUIParent->FindWindow(ID_Choice + i);
2624  c->SetSelection(val);
2625  }
2626  else if (ctrl.type == NYQ_CTRL_INT || ctrl.type == NYQ_CTRL_FLOAT)
2627  {
2628  // wxTextCtrls are handled by the validators
2629  double range = ctrl.high - ctrl.low;
2630  int val = (int)(0.5 + ctrl.ticks * (ctrl.val - ctrl.low) / range);
2631  wxSlider *s = (wxSlider *) mUIParent->FindWindow(ID_Slider + i);
2632  s->SetValue(val);
2633  }
2634  else if (ctrl.type == NYQ_CTRL_TIME)
2635  {
2636  NumericTextCtrl *n = (NumericTextCtrl *) mUIParent->FindWindow(ID_Time + i);
2637  n->SetValue(ctrl.val);
2638  }
2639  }
2640 
2641  return true;
2642 }

References NyqControl::choices, NyqControl::high, ID_Choice, ID_Slider, ID_Time, NyqControl::low, mControls, Effect::mUIParent, NYQ_CTRL_CHOICE, NYQ_CTRL_FLOAT, NYQ_CTRL_INT, NYQ_CTRL_TIME, NumericTextCtrl::SetValue(), NyqControl::ticks, NyqControl::type, and NyqControl::val.

Referenced by TransferDataToWindow().

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

◆ TransferDataToPromptWindow()

bool NyquistEffect::TransferDataToPromptWindow ( )
private

Definition at line 2600 of file Nyquist.cpp.

2601 {
2602  mCommandText->ChangeValue(mInputCmd);
2603 
2604  return true;
2605 }

References mCommandText, and mInputCmd.

Referenced by TransferDataToWindow().

Here is the caller graph for this function:

◆ TransferDataToWindow()

bool NyquistEffect::TransferDataToWindow ( )
overridevirtual

Reimplemented from Effect.

Definition at line 1088 of file Nyquist.cpp.

1089 {
1090  mUIParent->TransferDataToWindow();
1091 
1092  bool success;
1093  if (mIsPrompt)
1094  {
1095  success = TransferDataToPromptWindow();
1096  }
1097  else
1098  {
1099  success = TransferDataToEffectWindow();
1100  }
1101 
1102  if (success)
1103  {
1105  }
1106 
1107  return success;
1108 }

References Effect::EnablePreview(), mEnablePreview, mIsPrompt, Effect::mUIParent, TransferDataToEffectWindow(), and TransferDataToPromptWindow().

Here is the call graph for this function:

◆ UnQuote()

wxString NyquistEffect::UnQuote ( const wxString &  s,
bool  allowParens = true,
wxString *  pExtraString = nullptr 
)
staticprivate

Definition at line 1847 of file Nyquist.cpp.

1849 {
1850  return UnQuoteMsgid( s, allowParens, pExtraString ).Translation();
1851 }

References TranslatableString::Translation(), and UnQuoteMsgid().

Referenced by Parse(), ParseChoice(), ParseFileExtensions(), ParseFileTypes(), and UnQuoteMsgid().

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

◆ UnQuoteMsgid()

TranslatableString NyquistEffect::UnQuoteMsgid ( const wxString &  s,
bool  allowParens = true,
wxString *  pExtraString = nullptr 
)
staticprivate

Definition at line 1806 of file Nyquist.cpp.

1808 {
1809  if (pExtraString)
1810  *pExtraString = wxString{};
1811 
1812  int len = s.length();
1813  if (len >= 2 && s[0] == wxT('\"') && s[len - 1] == wxT('\"')) {
1814  auto unquoted = s.Mid(1, len - 2);
1815  // Sorry, no context strings, yet
1816  // (See also comments in NyquistEffectsModule::AutoRegisterPlugins)
1817  return TranslatableString{ unquoted, {} };
1818  }
1819  else if (allowParens &&
1820  len >= 2 && s[0] == wxT('(') && s[len - 1] == wxT(')')) {
1821  Tokenizer tzer;
1822  tzer.Tokenize(s, true, 1, 1);
1823  auto &tokens = tzer.tokens;
1824  if (tokens.size() > 1) {
1825  if (pExtraString && tokens[1][0] == '(') {
1826  // A choice with a distinct internal string form like
1827  // ("InternalString" (_ "Visible string"))
1828  // Recur to find the two strings
1829  *pExtraString = UnQuote(tokens[0], false);
1830  return UnQuoteMsgid(tokens[1]);
1831  }
1832  else {
1833  // Assume the first token was _ -- we don't check that
1834  // And the second is the string, which is internationalized
1835  // Sorry, no context strings, yet
1836  return UnQuoteMsgid( tokens[1], false );
1837  }
1838  }
1839  else
1840  return {};
1841  }
1842  else
1843  // If string was not quoted, assume no translation exists
1844  return Verbatim( s );
1845 }

References NyquistEffect::Tokenizer::Tokenize(), NyquistEffect::Tokenizer::tokens, UnQuote(), and Verbatim().

Referenced by ParseFileType(), and UnQuote().

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

◆ validatePath()

bool NyquistEffect::validatePath ( wxString  path)
private

Definition at line 3285 of file Nyquist.cpp.

3286 {
3287  wxFileName fname = path;
3288  wxString dir = fname.GetPath();
3289 
3290  return (fname.wxFileName::IsOk() &&
3291  wxFileName::DirExists(dir) &&
3292  !fname.GetFullName().empty());
3293 }

Referenced by TransferDataFromEffectWindow().

Here is the caller graph for this function:

Friends And Related Function Documentation

◆ NyquistEffectsModule

friend class NyquistEffectsModule
friend

Definition at line 293 of file Nyquist.h.

Member Data Documentation

◆ mAction

TranslatableString NyquistEffect::mAction
private

Definition at line 231 of file Nyquist.h.

Referenced by Parse().

◆ mAuthor

TranslatableString NyquistEffect::mAuthor
private

Definition at line 233 of file Nyquist.h.

Referenced by GetVendor(), and Parse().

◆ mBreak

bool NyquistEffect::mBreak
private

Definition at line 209 of file Nyquist.h.

Referenced by Break(), OSCallback(), and Process().

◆ mCategories

wxArrayString NyquistEffect::mCategories
private

Definition at line 279 of file Nyquist.h.

Referenced by Parse(), and ParseProgram().

◆ mCmd

wxString NyquistEffect::mCmd
private

Definition at line 228 of file Nyquist.h.

Referenced by ParseProgram(), and ProcessOne().

◆ mCommandText

wxTextCtrl* NyquistEffect::mCommandText
private

◆ mCompiler

bool NyquistEffect::mCompiler
private

Definition at line 213 of file Nyquist.h.

Referenced by Parse(), and ProcessOne().

◆ mCont

bool NyquistEffect::mCont
private

Definition at line 210 of file Nyquist.h.

Referenced by Continue(), OSCallback(), and Process().

◆ mControls

std::vector<NyqControl> NyquistEffect::mControls
private

◆ mCopyright

TranslatableString NyquistEffect::mCopyright
private

Definition at line 238 of file Nyquist.h.

Referenced by GetDescription(), and Parse().

◆ mCount

unsigned NyquistEffect::mCount
private

Definition at line 265 of file Nyquist.h.

Referenced by Process(), and ProcessOne().

◆ mCurBuffer

Buffer NyquistEffect::mCurBuffer[2]
private

Definition at line 273 of file Nyquist.h.

Referenced by GetCallback(), and ProcessOne().

◆ mCurBufferLen

size_t NyquistEffect::mCurBufferLen[2]
private

Definition at line 275 of file Nyquist.h.

Referenced by GetCallback().

◆ mCurBufferStart

sampleCount NyquistEffect::mCurBufferStart[2]
private

Definition at line 274 of file Nyquist.h.

Referenced by GetCallback().

◆ mCurLen

sampleCount NyquistEffect::mCurLen
private

Definition at line 260 of file Nyquist.h.

Referenced by GetCallback(), Process(), and ProcessOne().

◆ mCurNumChannels

unsigned NyquistEffect::mCurNumChannels
private

Definition at line 257 of file Nyquist.h.

Referenced by Process(), and ProcessOne().

◆ mCurStart

sampleCount NyquistEffect::mCurStart[2]
private

Definition at line 259 of file Nyquist.h.

Referenced by GetCallback(), and Process().

◆ mCurTrack

WaveTrack* NyquistEffect::mCurTrack[2]
private

Definition at line 258 of file Nyquist.h.

Referenced by GetCallback(), Process(), and ProcessOne().

◆ mDebug

bool NyquistEffect::mDebug
private

Definition at line 248 of file Nyquist.h.

Referenced by ParseProgram(), Process(), ProcessOne(), and ShowHostInterface().

◆ mDebugButton

bool NyquistEffect::mDebugButton
private

Definition at line 246 of file Nyquist.h.

Referenced by EnablesDebug(), Init(), Parse(), and ParseProgram().

◆ mDebugOutput

TranslatableString NyquistEffect::mDebugOutput
private

Definition at line 252 of file Nyquist.h.

Referenced by Process(), and ProcessOne().

◆ mDebugOutputStr

wxString NyquistEffect::mDebugOutputStr
private

Definition at line 251 of file Nyquist.h.

Referenced by OutputCallback(), and Process().

◆ mEnablePreview

bool NyquistEffect::mEnablePreview
private

Definition at line 245 of file Nyquist.h.

Referenced by Init(), Parse(), ParseProgram(), and TransferDataToWindow().

◆ mExternal

bool NyquistEffect::mExternal
private

Definition at line 216 of file Nyquist.h.

Referenced by DefineParams(), ProcessOne(), SetAutomationParameters(), and SetCommand().

◆ mFileModified

wxDateTime NyquistEffect::mFileModified
private

When the script was last modified on disk.

Definition at line 206 of file Nyquist.h.

◆ mFileName

wxFileName NyquistEffect::mFileName
private

Name of the Nyquist script file this effect is loaded from.

Definition at line 205 of file Nyquist.h.

Referenced by GetPath(), OnLoad(), OnSave(), Parse(), and ParseFile().

◆ mFirstInGroup

bool NyquistEffect::mFirstInGroup
private

Definition at line 263 of file Nyquist.h.

Referenced by Process(), and ProcessOne().

◆ mFoundType

bool NyquistEffect::mFoundType
private

Definition at line 212 of file Nyquist.h.

Referenced by Parse(), and ParseProgram().

◆ mHelpFile

wxString NyquistEffect::mHelpFile
private

Definition at line 240 of file Nyquist.h.

Referenced by HelpPage(), Parse(), ParseProgram(), and Process().

◆ mHelpFileExists

bool NyquistEffect::mHelpFileExists
private

Definition at line 241 of file Nyquist.h.

Referenced by HelpPage(), ParseProgram(), and Process().

◆ mInfo

TranslatableString NyquistEffect::mInfo
private

Definition at line 232 of file Nyquist.h.

Referenced by Parse().

◆ mInitError

TranslatableString NyquistEffect::mInitError
private

Definition at line 225 of file Nyquist.h.

Referenced by Parse(), and ParseProgram().

◆ mInputCmd

wxString NyquistEffect::mInputCmd
private

◆ mIsPrompt

bool NyquistEffect::mIsPrompt
private

True if the code to execute is obtained interactively from the user via the "Nyquist Effect Prompt", or "Nyquist Prompt", false for all other effects (lisp code read from files)

Definition at line 223 of file Nyquist.h.

Referenced by CheckWhetherSkipEffect(), DefineParams(), GetAutomationParameters(), GetPath(), GetSymbol(), GetVendor(), Init(), IsDefault(), IsInteractive(), ManualPage(), ParseProgram(), PopulateOrExchange(), ProcessOne(), SetAutomationParameters(), ShowHostInterface(), TransferDataFromWindow(), and TransferDataToWindow().

◆ mIsSal

bool NyquistEffect::mIsSal
private

Definition at line 215 of file Nyquist.h.

Referenced by Parse(), ParseProgram(), and ProcessOne().

◆ mIsSpectral

bool NyquistEffect::mIsSpectral
private

Definition at line 217 of file Nyquist.h.

Referenced by Init(), Parse(), and ParseProgram().

◆ mIsTool

bool NyquistEffect::mIsTool
private

Definition at line 218 of file Nyquist.h.

Referenced by GetClassification(), Parse(), and SetAutomationParameters().

◆ mManPage

wxString NyquistEffect::mManPage
private

Definition at line 239 of file Nyquist.h.

Referenced by ManualPage(), Parse(), and ParseProgram().

◆ mMaxLen

sampleCount NyquistEffect::mMaxLen
private

Definition at line 261 of file Nyquist.h.

Referenced by Parse(), and Process().

◆ mMergeClips

int NyquistEffect::mMergeClips
private

Definition at line 285 of file Nyquist.h.

Referenced by Parse(), and ProcessOne().

◆ mName

TranslatableString NyquistEffect::mName
private

Name of the Effect (untranslated)

Definition at line 229 of file Nyquist.h.

Referenced by GetSymbol(), Init(), Parse(), Process(), and ProcessOne().

◆ mNumSelectedChannels

unsigned NyquistEffect::mNumSelectedChannels
private

Definition at line 266 of file Nyquist.h.

Referenced by Process(), and ProcessOne().

◆ mOK

bool NyquistEffect::mOK
private

Definition at line 224 of file Nyquist.h.

Referenced by IsOk(), and Parse().

◆ mOutputTime

double NyquistEffect::mOutputTime
private

Definition at line 264 of file Nyquist.h.

Referenced by Process(), and ProcessOne().

◆ mOutputTrack

WaveTrack* NyquistEffect::mOutputTrack[2]
private

Definition at line 277 of file Nyquist.h.

Referenced by ProcessOne(), and PutCallback().

◆ mParameters

wxString NyquistEffect::mParameters
private

◆ mPerTrackProps

wxString NyquistEffect::mPerTrackProps
private

Definition at line 282 of file Nyquist.h.

Referenced by Process(), and ProcessOne().

◆ mpException

std::exception_ptr NyquistEffect::mpException {}
private

Definition at line 289 of file Nyquist.h.

Referenced by GetCallback(), and ProcessOne().

◆ mProgressIn

double NyquistEffect::mProgressIn
private

Definition at line 267 of file Nyquist.h.

Referenced by GetCallback(), Process(), and PutCallback().

◆ mProgressOut

double NyquistEffect::mProgressOut
private

Definition at line 268 of file Nyquist.h.

Referenced by GetCallback(), Process(), and PutCallback().

◆ mProgressTot

double NyquistEffect::mProgressTot
private

Definition at line 269 of file Nyquist.h.

Referenced by GetCallback(), Process(), and PutCallback().

◆ mProjectChanged

bool NyquistEffect::mProjectChanged
private

Definition at line 250 of file Nyquist.h.

Referenced by Process(), and ProcessOne().

◆ mPromptName

TranslatableString NyquistEffect::mPromptName
private

Definition at line 230 of file Nyquist.h.

Referenced by Init().

◆ mPromptType

EffectType NyquistEffect::mPromptType
private

Definition at line 243 of file Nyquist.h.

Referenced by Init(), and SetAutomationParameters().

◆ mProps

wxString NyquistEffect::mProps
private

Definition at line 281 of file Nyquist.h.

Referenced by Process(), and ProcessOne().

◆ mRedirectOutput

bool NyquistEffect::mRedirectOutput
private

Definition at line 249 of file Nyquist.h.

Referenced by OutputCallback(), Process(), and RedirectOutput().

◆ mReentryCount

int NyquistEffect::mReentryCount = 0
staticprivate

Definition at line 122 of file Nyquist.h.

Referenced by Process().

◆ mReleaseVersion

TranslatableString NyquistEffect::mReleaseVersion
private

Definition at line 237 of file Nyquist.h.

Referenced by GetVersion(), and Parse().

◆ mRestoreSplits

bool NyquistEffect::mRestoreSplits
private

Definition at line 284 of file Nyquist.h.

Referenced by Parse(), and ProcessOne().

◆ mScale

double NyquistEffect::mScale
private

Definition at line 270 of file Nyquist.h.

Referenced by GetCallback(), Process(), and PutCallback().

◆ mStop

bool NyquistEffect::mStop
private

Definition at line 208 of file Nyquist.h.

Referenced by OSCallback(), Process(), and Stop().

◆ mTrace

bool NyquistEffect::mTrace
private

Definition at line 214 of file Nyquist.h.

Referenced by Parse(), ParseProgram(), Process(), and ProcessOne().

◆ mTrackIndex

int NyquistEffect::mTrackIndex
private

Definition at line 262 of file Nyquist.h.

Referenced by Process(), and ProcessOne().

◆ mType

EffectType NyquistEffect::mType
private

◆ mVersion

int NyquistEffect::mVersion
private

Definition at line 254 of file Nyquist.h.

Referenced by Init(), Parse(), Process(), and ProcessOne().

◆ mXlispPath

wxString NyquistEffect::mXlispPath
private

Definition at line 203 of file Nyquist.h.


The documentation for this class was generated from the following files:
size
size_t size
Definition: ffmpeg-2.3.6-single-header.h:412
Effect::IsPreviewing
bool IsPreviewing()
Definition: Effect.h:322
ShuttleSetAutomation
Shuttle that sets parameters to a value (from a string)
Definition: ShuttleAutomation.h:38
TranslatableString
Holds a msgid for the translation catalog; may also bind format arguments.
Definition: TranslatableString.h:32
ViewInfo::Get
static ViewInfo & Get(AudacityProject &project)
Definition: ViewInfo.cpp:235
NyquistEffect::GetCallback
int GetCallback(float *buffer, int channel, int64_t start, int64_t len, int64_t totlen)
Definition: Nyquist.cpp:2442
CommandParameters
CommandParameters, derived from wxFileConfig, is essentially doing the same things as the Shuttle cla...
Definition: EffectAutomationParameters.h:67
label
TranslatableString label
Definition: TagsEditor.cpp:163
CommandParameters::SetParameters
bool SetParameters(const wxString &parms)
Definition: EffectAutomationParameters.h:286
NYQUIST_PROMPT_ID
#define NYQUIST_PROMPT_ID
Definition: PluginManager.h:341
NyquistEffect::BuildPromptWindow
void BuildPromptWindow(ShuttleGui &S)
Definition: Nyquist.cpp:2802
NyquistEffect::mTrackIndex
int mTrackIndex
Definition: Nyquist.h:262
TranslatableString::empty
bool empty() const
Definition: TranslatableString.h:72
NyquistEffect::GetCtrlValue
double GetCtrlValue(const wxString &s)
Definition: Nyquist.cpp:1853
valueRestorer
ValueRestorer< T > valueRestorer(T &var)
inline functions provide convenient parameter type deduction
Definition: MemoryX.h:226
NyquistEffect::mMaxLen
sampleCount mMaxLen
Definition: Nyquist.h:261
Effect::FindProject
const AudacityProject * FindProject() const
Definition: Effect.cpp:2035
WaveTrack
A Track that contains audio waveform data.
Definition: WaveTrack.h:75
CommandParameters::WriteEnum
bool WriteEnum(const wxString &key, int value, const EnumValueSymbol choices[], size_t nChoices)
Definition: EffectAutomationParameters.h:202
EffectTypeProcess
@ EffectTypeProcess
Definition: EffectInterface.h:56
RegisterFunctions
static void RegisterFunctions()
Definition: Nyquist.cpp:3493
Effect::SetLinearEffectFlag
void SetLinearEffectFlag(bool linearEffectFlag)
Definition: Effect.cpp:1764
make_iterator_range
IteratorRange< Iterator > make_iterator_range(const Iterator &i1, const Iterator &i2)
Definition: MemoryX.h:423
NyquistEffect::GetType
EffectType GetType() override
Type determines how it behaves.
Definition: Nyquist.cpp:268
NyquistEffect::mProgressIn
double mProgressIn
Definition: Nyquist.h:267
S
#define S(N)
Definition: ToChars.cpp:64
NumericTextCtrl::Options::AutoPos
Options & AutoPos(bool enable)
Definition: NumericTextCtrl.h:190
Effect::GetSelectionFormat
virtual NumericFormatSymbol GetSelectionFormat()
Definition: Effect.cpp:784
NyquistEffect::mInputCmd
wxString mInputCmd
Definition: Nyquist.h:226
FileNames::FindDefaultPath
FILES_API FilePath FindDefaultPath(Operation op)
NyquistEffect::mStop
bool mStop
Definition: Nyquist.h:208
NyquistEffect::mTrace
bool mTrace
Definition: Nyquist.h:214
NyquistEffect::ToTimeFormat
wxString ToTimeFormat(double t)
Definition: Nyquist.cpp:3296
gPrefs
FileConfig * gPrefs
Definition: Prefs.cpp:71
NyquistEffect::TransferDataToPromptWindow
bool TransferDataToPromptWindow()
Definition: Nyquist.cpp:2600
NyquistEffect::mHelpFileExists
bool mHelpFileExists
Definition: Nyquist.h:241
Track::GetEndTime
virtual double GetEndTime() const =0
Effect::MessageBox
int MessageBox(const TranslatableString &message, long style=DefaultMessageBoxStyle, const TranslatableString &titleStr={})
Definition: Effect.cpp:2238
NYQ_CTRL_STRING
@ NYQ_CTRL_STRING
Definition: Nyquist.h:30
WaveTrack::GetEndTime
double GetEndTime() const override
Get the time at which the last clip in the track ends, plus recorded stuff.
Definition: WaveTrack.cpp:2014
NyquistEffect
An Effect that calls up a Nyquist (XLISP) plug-in, i.e. many possible effects from this one class.
Definition: Nyquist.h:65
Effect::CopyInputTracks
void CopyInputTracks(bool allSyncLockSelected=false)
Definition: Effect.cpp:1834
WaveTrack::Flush
void Flush() override
Definition: WaveTrack.cpp:1841
str
#define str(a)
Definition: DBConnection.cpp:30
NyquistEffect::mInitError
TranslatableString mInitError
Definition: Nyquist.h:225
NyquistEffect::mBreak
bool mBreak
Definition: Nyquist.h:209
NyquistEffect::mEnablePreview
bool mEnablePreview
Definition: Nyquist.h:245
UNINITIALIZED_CONTROL
#define UNINITIALIZED_CONTROL
Definition: Nyquist.cpp:113
ProjectRate::Get
static ProjectRate & Get(AudacityProject &project)
Definition: ProjectRate.cpp:28
NyqControl::lowStr
wxString lowStr
Definition: Nyquist.h:55
EffectTypeGenerate
@ EffectTypeGenerate
Definition: EffectInterface.h:55
NyquistEffect::mCurBuffer
Buffer mCurBuffer[2]
Definition: Nyquist.h:273
TrackList::Channels
static auto Channels(TrackType *pTrack) -> TrackIterRange< TrackType >
Definition: Track.h:1483
NyquistEffect::ParseCommand
bool ParseCommand(const wxString &cmd)
Definition: Nyquist.cpp:2427
Effect::SetPreviewFullSelectionFlag
void SetPreviewFullSelectionFlag(bool previewDurationFlag)
Definition: Effect.cpp:1769
Effect::mT1
double mT1
Definition: Effect.h:424
Effect::LoadUserPreset
bool LoadUserPreset(const RegistryPath &name) override
Change settings to a user-named preset.
Definition: Effect.cpp:530
Effect::Delegate
bool Delegate(Effect &delegate, wxWindow &parent, const EffectDialogFactory &factory)
Definition: Effect.cpp:1113
NyquistEffect::ParseFileTypes
FileNames::FileTypes ParseFileTypes(const wxString &text)
Definition: Nyquist.cpp:1739
NyquistEffect::mDebug
bool mDebug
Definition: Nyquist.h:248
NyquistEffect::mFirstInGroup
bool mFirstInGroup
Definition: Nyquist.h:263
NyquistEffect::mpException
std::exception_ptr mpException
Definition: Nyquist.h:289
XO
#define XO(s)
Definition: Internat.h:31
Effect::EnablePreview
bool EnablePreview(bool enable=true)
Definition: Effect.cpp:1725
WaveTrack::GetMinMax
std::pair< float, float > GetMinMax(double t0, double t1, bool mayThrow=true) const
Definition: WaveTrack.cpp:2039
FileNames::PlugInDir
FILES_API FilePath PlugInDir()
The user plug-in directory (not a system one)
WaveTrack::SetRate
void SetRate(double newRate)
Definition: WaveTrack.cpp:500
WaveTrack::GetBestBlockSize
size_t GetBestBlockSize(sampleCount t) const override
This returns a nonnegative number of samples meant to size a memory buffer.
Definition: WaveTrack.cpp:1793
int24Sample
@ int24Sample
Definition: SampleFormat.h:33
LabelTrack
A LabelTrack is a Track that holds labels (LabelStruct).
Definition: LabelTrack.h:89
NyquistEffect::mDebugOutput
TranslatableString mDebugOutput
Definition: Nyquist.h:252
NyquistEffect::validatePath
bool validatePath(wxString path)
Definition: Nyquist.cpp:3285
CommandParameters::GetParameters
bool GetParameters(wxString &parms)
Definition: EffectAutomationParameters.h:258
NYQUISTEFFECTS_FAMILY
#define NYQUISTEFFECTS_FAMILY
Definition: Effect.h:65
FileNames::DefaultToDocumentsFolder
FILES_API wxFileNameWrapper DefaultToDocumentsFolder(const wxString &preference)
NyquistEffect::mCont
bool mCont
Definition: Nyquist.h:210
NYQ_CTRL_FILE
@ NYQ_CTRL_FILE
Definition: Nyquist.h:36
Effect::IsBatchProcessing
virtual bool IsBatchProcessing()
Definition: Effect.cpp:960
NyquistEffect::ParseProgram
bool ParseProgram(wxInputStream &stream)
Definition: Nyquist.cpp:2325
NyquistEffect::mCategories
wxArrayString mCategories
Definition: Nyquist.h:279
NyquistEffect::BuildEffectWindow
void BuildEffectWindow(ShuttleGui &S)
Definition: Nyquist.cpp:2834
NyquistEffect::ParseFile
void ParseFile()
Definition: Nyquist.cpp:2419
NyqControl::choices
std::vector< EnumValueSymbol > choices
Definition: Nyquist.h:52
EffectManager::Get
static EffectManager & Get()
Definition: EffectManager.cpp:42
WaveTrack::GetRMS
float GetRMS(double t0, double t1, bool mayThrow=true) const
Definition: WaveTrack.cpp:2078
NyquistEffect::mParameters
wxString mParameters
Definition: Nyquist.h:227
WaveTrack::GetSpectrogramSettings
const SpectrogramSettings & GetSpectrogramSettings() const
Definition: WaveTrack.cpp:801
Effect::AddToOutputTracks
Track * AddToOutputTracks(const std::shared_ptr< Track > &t)
Definition: Effect.cpp:1861
Effect::DefaultMessageBoxStyle
@ DefaultMessageBoxStyle
Definition: Effect.h:225
WaveTrack::ClearAndPaste
void ClearAndPaste(double t0, double t1, const Track *src, bool preserve=true, bool merge=true, const TimeWarper *effectWarper=NULL)
Definition: WaveTrack.cpp:917
Effect::SaveUserPreset
bool SaveUserPreset(const RegistryPath &name) override
Save current settings as a user-named preset.
Definition: Effect.cpp:547
NumericTextCtrl
Definition: NumericTextCtrl.h:172
NyqControl::high
double high
Definition: Nyquist.h:59
NyquistEffect::mRestoreSplits
bool mRestoreSplits
Definition: Nyquist.h:284
wxArrayStringEx
Extend wxArrayString with move operations and construction and insertion fromstd::initializer_list.
Definition: wxArrayStringEx.h:18
NumericTextCtrl::SetValue
void SetValue(double newValue)
Definition: NumericTextCtrl.cpp:1474
NyquistEffect::mFileModified
wxDateTime mFileModified
When the script was last modified on disk.
Definition: Nyquist.h:206
NyquistEffect::resolveFilePath
void resolveFilePath(wxString &path, FileExtension extension={})
Definition: Nyquist.cpp:3227
NyquistEffect::Parse
bool Parse(Tokenizer &tokenizer, const wxString &line, bool eof, bool first)
Definition: Nyquist.cpp:1970
NyquistEffect::UnQuote
static wxString UnQuote(const wxString &s, bool allowParens=true, wxString *pExtraString=nullptr)
Definition: Nyquist.cpp:1847
NYQ_MAX_LEN
#define NYQ_MAX_LEN
Definition: Nyquist.cpp:111
WaveTrack::EmptyCopy
Holder EmptyCopy(const SampleBlockFactoryPtr &pFactory={}) const
Definition: WaveTrack.cpp:709
NyquistEffect::UnQuoteMsgid
static TranslatableString UnQuoteMsgid(const wxString &s, bool allowParens=true, wxString *pExtraString=nullptr)
Definition: Nyquist.cpp:1806
NyqControl::val
double val
Definition: Nyquist.h:57
NumericTextCtrl::Options
Definition: NumericTextCtrl.h:178
FileNames::AddUniquePathToPathList
FILES_API void AddUniquePathToPathList(const FilePath &path, FilePaths &pathList)
EffectManager::SetSkipStateFlag
void SetSkipStateFlag(bool flag)
Definition: EffectManager.cpp:214
WaveTrack::SortedClipArray
WaveClipPointers SortedClipArray()
Definition: WaveTrack.cpp:2722
NyquistEffect::mReleaseVersion
TranslatableString mReleaseVersion
Definition: Nyquist.h:237
NyquistEffect::mType
EffectType mType
Definition: Nyquist.h:242
NyquistEffect::mNumSelectedChannels
unsigned mNumSelectedChannels
Definition: Nyquist.h:266
ID_Time
NyquistEffect::OnText ID_Time
Definition: Nyquist.cpp:134
FileNames::DataDir
FILES_API FilePath DataDir()
Audacity user data directory.
NyquistEffect::mIsSpectral
bool mIsSpectral
Definition: Nyquist.h:217
NYQ_CTRL_TIME
@ NYQ_CTRL_TIME
Definition: Nyquist.h:35
floatSample
@ floatSample
Definition: SampleFormat.h:34
AllProjects::size
size_t size() const
Definition: Project.cpp:17
CommandParameters::ReadEnum
bool ReadEnum(const wxString &key, int *pi, const EnumValueSymbol choices[], size_t nChoices, const ObsoleteMap obsoletes[]=nullptr, size_t nObsoletes=0) const
Definition: EffectAutomationParameters.h:165
ID_Text
ID_Text
Definition: Nyquist.cpp:130
Track::GetStartTime
virtual double GetStartTime() const =0
NyquistEffect::mInfo
TranslatableString mInfo
Definition: Nyquist.h:232
NyqControl::highStr
wxString highStr
Definition: Nyquist.h:56
FileExtension
wxString FileExtension
File extension, not including any leading dot.
Definition: Identifier.h:224
ID_FILE
@ ID_FILE
Definition: Nyquist.cpp:107
Effect::mProjectRate
double mProjectRate
Definition: Effect.h:416
NyquistEffect::Buffer
std::unique_ptr< float[]> Buffer
Definition: Nyquist.h:272
NyquistEffect::mPerTrackProps
wxString mPerTrackProps
Definition: Nyquist.h:282
NyquistEffect::mName
TranslatableString mName
Name of the Effect (untranslated)
Definition: Nyquist.h:229
NyquistEffect::EscapeString
wxString EscapeString(const wxString &inStr)
Definition: Nyquist.cpp:1669
eDebugID
@ eDebugID
Definition: ShuttleGui.h:619
NyquistEffect::mScale
double mScale
Definition: Nyquist.h:270
ViewInfo::selectedRegion
NotifyingSelectedRegion selectedRegion
Definition: ViewInfo.h:215
XXO
#define XXO(s)
Definition: Internat.h:44
EffectManager
EffectManager is the class that handles effects and effect categories.
Definition: EffectManager.h:42
NyquistEffect::TransferDataFromEffectWindow
bool TransferDataFromEffectWindow()
Definition: Nyquist.cpp:2662
Effect::mT0
double mT0
Definition: Effect.h:423
factory
static RegisteredToolbarFactory factory
Definition: ControlToolBar.cpp:820
sampleCount::as_double
double as_double() const
Definition: SampleCount.h:45
NyquistEffect::mControls
std::vector< NyqControl > mControls
Definition: Nyquist.h:255
NyquistEffect::mProjectChanged
bool mProjectChanged
Definition: Nyquist.h:250
WaveTrackSubViewType
Definition: WaveTrackViewConstants.h:89
NyquistEffect::GetNyquistSearchPath
static FilePaths GetNyquistSearchPath()
Definition: Nyquist.cpp:2583
NYQ_CTRL_INT
@ NYQ_CTRL_INT
Definition: Nyquist.h:28
ShuttleGetAutomation
Shuttle that gets parameter values into a string.
Definition: ShuttleAutomation.h:20
SyncLock::IsSyncLockSelected
static bool IsSyncLockSelected(const Track *pTrack)
Definition: SyncLock.cpp:43
BasicUI::Get
Services * Get()
Fetch the global instance, or nullptr if none is yet installed.
Definition: BasicUI.cpp:26
WaveTrack::GetIdealBlockSize
size_t GetIdealBlockSize()
Definition: WaveTrack.cpp:1831
sampleCount::as_long_long
long long as_long_long() const
Definition: SampleCount.h:47
SampleTrack::GetFloats
bool GetFloats(float *buffer, sampleCount start, size_t len, fillFormat fill=fillZero, bool mayThrow=true, sampleCount *pNumWithinClips=nullptr) const
Retrieve samples from a track in floating-point format, regardless of the storage format.
Definition: SampleTrack.h:64
NyquistEffect::mProgressOut
double mProgressOut
Definition: Nyquist.h:268
int16Sample
@ int16Sample
Definition: SampleFormat.h:32
NYQUIST_PROMPT_NAME
#define NYQUIST_PROMPT_NAME
Definition: PluginManager.h:343
NyquistEffect::mCopyright
TranslatableString mCopyright
Definition: Nyquist.h:238
NyquistEffect::mCompiler
bool mCompiler
Definition: Nyquist.h:213
NyquistEffect::mIsSal
bool mIsSal
Definition: Nyquist.h:215
anonymous_namespace{TimeTrack.cpp}::GetRate
double GetRate()
Definition: TimeTrack.cpp:192
NyquistEffect::mPromptName
TranslatableString mPromptName
Definition: Nyquist.h:230
NyquistEffect::PutCallback
int PutCallback(float *buffer, int channel, int64_t start, int64_t len, int64_t totlen)
Definition: Nyquist.cpp:2509
Effect::ReplaceProcessedTracks
void ReplaceProcessedTracks(const bool bGoodResult)
Definition: Effect.cpp:1956
NyquistEffect::StaticOSCallback
static void StaticOSCallback(void *userdata)
Definition: Nyquist.cpp:2548
NyqControl::ticks
int ticks
Definition: Nyquist.h:60
name
const TranslatableString name
Definition: Distortion.cpp:98
UTF8CTOWX
#define UTF8CTOWX(X)
Definition: Internat.h:159
NyquistEffect::mPromptType
EffectType mPromptType
Definition: Nyquist.h:243
NyquistEffect::mAction
TranslatableString mAction
Definition: Nyquist.h:231
NumericConverter::TIME
@ TIME
Definition: NumericTextCtrl.h:52
NyquistEffect::mIsPrompt
bool mIsPrompt
Definition: Nyquist.h:223
EffectTypeTool
@ EffectTypeTool
Definition: EffectInterface.h:58
format
int format
Definition: ExportPCM.cpp:56
NyquistEffect::SetAutomationParameters
bool SetAutomationParameters(CommandParameters &parms) override
Change settings to those stored in parms.
Definition: Nyquist.cpp:417
NyquistEffect::TransferDataToEffectWindow
bool TransferDataToEffectWindow()
Definition: Nyquist.cpp:2607
NyqControl::type
int type
Definition: Nyquist.h:48
NumericTextCtrl::Options::MenuEnabled
Options & MenuEnabled(bool enable)
Definition: NumericTextCtrl.h:192
WaveTrackView::Find
static WaveTrackView * Find(WaveTrack *pTrack)
Definition: WaveTrackView.cpp:865
NyqControl
A control on a NyquistDialog.
Definition: Nyquist.h:40
NyquistEffect::mFileName
wxFileName mFileName
Name of the Nyquist script file this effect is loaded from.
Definition: Nyquist.h:205
ProjectRate::GetRate
double GetRate() const
Definition: ProjectRate.cpp:53
NYQ_CTRL_TEXT
@ NYQ_CTRL_TEXT
Definition: Nyquist.h:34
ID_Load
@ ID_Load
Definition: Nyquist.cpp:100
Effect::TestUIFlags
unsigned TestUIFlags(unsigned mask)
Definition: Effect.cpp:956
NyquistEffect::StaticGetCallback
static int StaticGetCallback(float *buffer, int channel, int64_t start, int64_t len, int64_t totlen, void *userdata)
Definition: Nyquist.cpp:2434
NyquistEffect::mIsTool
bool mIsTool
Definition: Nyquist.h:218
NYQUIST_WORKER_ID
#define NYQUIST_WORKER_ID
Definition: Effect.h:67
Effect::mOutputTracks
std::shared_ptr< TrackList > mOutputTracks
Definition: Effect.h:422
Msgids
TranslatableStrings Msgids(const EnumValueSymbol strings[], size_t nStrings)
Convenience function often useful when adding choice controls.
Definition: ShuttleGui.cpp:2523
SpectrogramSettings::SpectralSelectionEnabled
bool SpectralSelectionEnabled() const
Definition: SpectrogramSettings.cpp:648
NyquistEffect::StaticPutCallback
static int StaticPutCallback(float *buffer, int channel, int64_t start, int64_t len, int64_t totlen, void *userdata)
Definition: Nyquist.cpp:2501
NyquistEffect::ParseChoice
static std::vector< EnumValueSymbol > ParseChoice(const wxString &text)
Definition: Nyquist.cpp:1679
NyquistEffect::mHelpFile
wxString mHelpFile
Definition: Nyquist.h:240
NyquistEffect::mManPage
wxString mManPage
Definition: Nyquist.h:239
Effect::GetCurrentSettingsGroup
RegistryPath GetCurrentSettingsGroup() override
Definition: Effect.cpp:820
EffectManager::kRepeatNyquistPrompt
@ kRepeatNyquistPrompt
Definition: EffectManager.h:57
NyquistEffect::SetLispVarsFromParameters
int SetLispVarsFromParameters(CommandParameters &parms, bool bTestOnly)
Definition: Nyquist.cpp:476
NyquistEffect::mProgressTot
double mProgressTot
Definition: Nyquist.h:269
samplePtr
char * samplePtr
Definition: SampleFormat.h:49
NyquistEffect::NyquistToWxString
static wxString NyquistToWxString(const char *nyqString)
Definition: Nyquist.cpp:1656
NYQ_CTRL_FLOAT
@ NYQ_CTRL_FLOAT
Definition: Nyquist.h:29
LAT1CTOWX
#define LAT1CTOWX(X)
Definition: Internat.h:160
min
int min(int a, int b)
Definition: CompareAudioCommand.cpp:106
FileNames::BaseDir
FILES_API FilePath BaseDir()
NyquistEffect::GetAutomationParameters
bool GetAutomationParameters(CommandParameters &parms) override
Save current settings into parms.
Definition: Nyquist.cpp:368
NyquistEffect::mRedirectOutput
bool mRedirectOutput
Definition: Nyquist.h:249
Effect::GetNumWaveGroups
int GetNumWaveGroups()
Definition: Effect.h:305
NyquistEffect::mFoundType
bool mFoundType
Definition: Nyquist.h:212
Track::TypeSwitch
R TypeSwitch(const Functions &...functions)
Use this function rather than testing track type explicitly and making down-casts.
Definition: Track.h:790
ID_Choice
@ ID_Choice
Definition: Nyquist.cpp:105
FileNames::AudacityPathList
FILES_API const FilePaths & AudacityPathList()
A list of directories that should be searched for Audacity files (plug-ins, help files,...
TrackList::Get
static TrackList & Get(AudacityProject &project)
Definition: Track.cpp:377
TrackList::Leaders
auto Leaders() -> TrackIterRange< TrackType >
Definition: Track.h:1413
NyquistEffect::ProcessOne
bool ProcessOne()
Definition: Nyquist.cpp:1126
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
FileDialogWrapper
Definition: wxPanelWrapper.h:165
Track::IsLeader
bool IsLeader() const
Definition: Track.cpp:298
NyquistEffect::ParseFileType
FileNames::FileType ParseFileType(const wxString &text)
Definition: Nyquist.cpp:1724
NyqControl::name
wxString name
Definition: Nyquist.h:50
NyquistEffect::mMergeClips
int mMergeClips
Definition: Nyquist.h:285
_
#define _(s)
Definition: Internat.h:75
sampleCount
Positions or offsets within audio files need a wide type.
Definition: SampleCount.h:18
NyquistOutputDialog
Dialog used with NyquistEffect.
Definition: Nyquist.h:297
EffectTypeAnalyze
@ EffectTypeAnalyze
Definition: EffectInterface.h:57
NyqControl::low
double low
Definition: Nyquist.h:58
NyquistEffect::mCurBufferStart
sampleCount mCurBufferStart[2]
Definition: Nyquist.h:274
NYQ_CTRL_FLOAT_TEXT
@ NYQ_CTRL_FLOAT_TEXT
Definition: Nyquist.h:33
NyquistEffect::mCurLen
sampleCount mCurLen
Definition: Nyquist.h:260
NyqControl::fileTypes
FileNames::FileTypes fileTypes
Definition: Nyquist.h:53
WaveTrack::GetRate
double GetRate() const override
Definition: WaveTrack.cpp:495
NyquistEffect::mCurStart
sampleCount mCurStart[2]
Definition: Nyquist.h:259
FileNames::HtmlHelpDir
FILES_API FilePath HtmlHelpDir()
AllProjects
Definition: Project.h:35
NumericTextCtrl::Options::ReadOnly
Options & ReadOnly(bool enable)
Definition: NumericTextCtrl.h:191
NyquistEffect::mOK
bool mOK
Definition: Nyquist.h:224
NyquistEffect::mCurTrack
WaveTrack * mCurTrack[2]
Definition: Nyquist.h:258
NyqControl::valStr
wxString valStr
Definition: Nyquist.h:54
NyquistEffect::mProps
wxString mProps
Definition: Nyquist.h:281
Effect::nEffectsDone
static int nEffectsDone
Definition: Effect.h:335
MakeSimpleGuard
SimpleGuard< R > MakeSimpleGuard(R value) noexcept(noexcept(SimpleGuard< R >{ value }))
Convert a value to a handler function returning that value, suitable for GuardedCall<R>
Definition: AudacityException.h:167
NYQ_CTRL_CHOICE
@ NYQ_CTRL_CHOICE
Definition: Nyquist.h:31
NyqControl::label
wxString label
Definition: Nyquist.h:51
Verbatim
TranslatableString Verbatim(wxString str)
Require calls to the one-argument constructor to go through this distinct global function name.
Definition: TranslatableString.h:321
SyncLock::Group
static TrackIterRange< Track > Group(Track *pTrack)
Definition: SyncLock.cpp:122
NyquistEffect::mCount
unsigned mCount
Definition: Nyquist.h:265
Effect::TotalProgress
bool TotalProgress(double frac, const TranslatableString &={})
Definition: Effect.cpp:1780
SampleTrack::TimeToLongSamples
sampleCount TimeToLongSamples(double t0) const
Convert correctly between an (absolute) time in seconds and a number of samples.
Definition: SampleTrack.cpp:35
WaveTrack::Append
bool Append(constSamplePtr buffer, sampleFormat format, size_t len, unsigned int stride=1) override
Definition: WaveTrack.cpp:1771
FileNames::FileTypes
std::vector< FileType > FileTypes
Definition: FileNames.h:76
NyquistEffect::mExternal
bool mExternal
Definition: Nyquist.h:216
Effect::mPresetNames
wxArrayString mPresetNames
Definition: Effect.h:429
NyquistEffect::ParseFileExtensions
FileExtensions ParseFileExtensions(const wxString &text)
Definition: Nyquist.cpp:1711
ShuttleGetDefinition
Shuttle that retrieves a JSON format definition of a command's parameters.
Definition: ShuttleGetDefinition.h:22
TranslatableString::Translation
wxString Translation() const
Definition: TranslatableString.h:79
NyquistEffect::mCmd
wxString mCmd
Definition: Nyquist.h:228
Languages::GetSystemLanguageCode
wxString GetSystemLanguageCode(const FilePaths &pathList)
Definition: Languages.cpp:83
NyquistEffect::mCurBufferLen
size_t mCurBufferLen[2]
Definition: Nyquist.h:275
NyquistEffect::TransferDataFromPromptWindow
bool TransferDataFromPromptWindow()
Definition: Nyquist.cpp:2644
NyquistEffect::mAuthor
TranslatableString mAuthor
Definition: Nyquist.h:233
TranslatableString::Format
TranslatableString & Format(Args &&...args) &
Capture variadic format arguments (by copy) when there is no plural.
Definition: TranslatableString.h:103
ComponentInterface::GetName
TranslatableString GetName()
Definition: PluginManager.cpp:1838
NyquistEffect::StaticOutputCallback
static void StaticOutputCallback(int c, void *userdata)
Definition: Nyquist.cpp:2532
NyquistEffect::mOutputTrack
WaveTrack * mOutputTrack[2]
Definition: Nyquist.h:277
Effect::ShowHostInterface
int ShowHostInterface(wxWindow &parent, const EffectDialogFactory &factory, bool forceModal=false) override
Definition: Effect.cpp:470
NyquistEffect::mDebugOutputStr
wxString mDebugOutputStr
Definition: Nyquist.h:251
NyquistEffect::mVersion
int mVersion
Definition: Nyquist.h:254
safenew
#define safenew
Definition: MemoryX.h:10
NyqControl::var
wxString var
Definition: Nyquist.h:49
ID_Save
@ ID_Save
Definition: Nyquist.cpp:101
KEY_Command
static const wxChar * KEY_Command
Definition: Nyquist.cpp:115
limitSampleBufferSize
size_t limitSampleBufferSize(size_t bufferSize, sampleCount limit)
Definition: SampleCount.cpp:23
Effect::TrackGroupProgress
bool TrackGroupProgress(int whichGroup, double frac, const TranslatableString &={})
Definition: Effect.cpp:1796
NumericConverter::GetValue
double GetValue()
Definition: NumericTextCtrl.cpp:1174
TrackList::Selected
auto Selected() -> TrackIterRange< TrackType >
Definition: Track.h:1396
NyquistEffect::mCommandText
wxTextCtrl * mCommandText
Definition: Nyquist.h:287
Effect::TrackProgress
bool TrackProgress(int whichTrack, double frac, const TranslatableString &={})
Definition: Effect.cpp:1788
NyquistEffect::mDebugButton
bool mDebugButton
Definition: Nyquist.h:246
TimeTrack
A kind of Track used to 'warp time'.
Definition: TimeTrack.h:24
Internat::ToString
static wxString ToString(double numberToConvert, int digitsAfterDecimalPoint=-1)
Convert a number to a string, always uses the dot as decimal separator.
Definition: Internat.cpp:151
FileNames::FileType
Definition: FileNames.h:52
NoteTrack
A Track that is used for Midi notes. (Somewhat old code).
Definition: NoteTrack.h:67
NyquistEffect::mReentryCount
static int mReentryCount
Definition: Nyquist.h:122
ID_Slider
@ ID_Slider
Definition: Nyquist.cpp:103
Internat::CompatibleToDouble
static bool CompatibleToDouble(const wxString &stringToConvert, double *result)
Convert a string to a number.
Definition: Internat.cpp:134
KEY_Parameters
static const wxChar * KEY_Parameters
Definition: Nyquist.cpp:116
NyquistEffect::mCurNumChannels
unsigned mCurNumChannels
Definition: Nyquist.h:257
NyquistEffect::mOutputTime
double mOutputTime
Definition: Nyquist.h:264
NYQ_CTRL_INT_TEXT
@ NYQ_CTRL_INT_TEXT
Definition: Nyquist.h:32
SelectedRegion
Defines a selected portion of a project.
Definition: SelectedRegion.h:38
TempDirectory::TempDir
FILES_API wxString TempDir()
Definition: TempDirectory.cpp:26