11#ifndef __AUDACITY_EFFECT_NYQUIST__
12#define __AUDACITY_EFFECT_NYQUIST__
16#include "../../widgets/wxPanelWrapper.h"
25#define NYQUISTEFFECTS_VERSION wxT("1.0.0.0")
88 wxString GetVersion()
const override;
99 bool IsInteractive()
const override;
100 bool IsDefault()
const override;
101 bool EnablesDebug()
const override;
119 bool Init()
override;
121 int ShowHostInterface( wxWindow &parent,
124 bool forceModal =
false)
override;
125 std::unique_ptr<EffectUIValidator> PopulateOrExchange(
133 void RedirectOutput();
134 void SetCommand(
const wxString &cmd);
148 bool TransferDataToPromptWindow();
149 bool TransferDataToEffectWindow();
151 bool TransferDataFromPromptWindow();
152 bool TransferDataFromEffectWindow();
159 static wxString NyquistToWxString(
const char *nyqString);
160 wxString EscapeString(
const wxString & inStr);
161 static std::vector<EnumValueSymbol> ParseChoice(
const wxString & text);
167 static int StaticGetCallback(
float *buffer,
int channel,
168 int64_t start, int64_t len, int64_t totlen,
170 static int StaticPutCallback(
float *buffer,
int channel,
171 int64_t start, int64_t len, int64_t totlen,
173 static void StaticOutputCallback(
int c,
void *userdata);
174 static void StaticOSCallback(
void *userdata);
176 int GetCallback(
float *buffer,
int channel,
177 int64_t start, int64_t len, int64_t totlen);
178 int PutCallback(
float *buffer,
int channel,
179 int64_t start, int64_t len, int64_t totlen);
180 void OutputCallback(
int c);
184 bool ParseCommand(
const wxString & cmd);
185 bool ParseProgram(wxInputStream & stream);
194 const wxString &line,
bool eof,
195 size_t trimStart,
size_t trimEnd);
197 bool Parse(
Tokenizer &tokenizer,
const wxString &line,
bool eof,
bool first);
200 wxString *pExtraString =
nullptr);
201 static wxString UnQuote(
const wxString &s,
bool allowParens =
true,
202 wxString *pExtraString =
nullptr);
203 static double GetCtrlValue(
const wxString &s);
205 void OnLoad(wxCommandEvent & evt);
206 void OnSave(wxCommandEvent & evt);
209 void OnText(wxCommandEvent & evt);
210 void OnSlider(wxCommandEvent & evt);
211 void OnChoice(wxCommandEvent & evt);
212 void OnTime(wxCommandEvent & evt);
213 void OnFileButton(wxCommandEvent & evt);
215 static void resolveFilePath(wxString & path,
FileExtension extension = {});
216 bool validatePath(wxString path);
217 wxString ToTimeFormat(
double t);
219 std::pair<bool, FilePath> CheckHelpPage()
const;
296 size_t mCurBufferLen[2];
310 std::exception_ptr mpException {};
312 DECLARE_EVENT_TABLE()
326 void OnOk(wxCommandEvent & event);
329 DECLARE_EVENT_TABLE()
std::function< wxDialog *(wxWindow &parent, EffectPlugin &, EffectUIClientInterface &, std::shared_ptr< EffectInstance > &, EffectSettingsAccess &) > EffectDialogFactory
Type of function that creates a dialog for an effect.
wxString FileExtension
File extension, not including any leading dot.
wxString PluginPath
type alias for identifying a Plugin supplied by a module, each module defining its own interpretation...
static Settings & settings()
CommandParameters, derived from wxFileConfig, is essentially doing the same things as the SettingsVis...
ComponentInterfaceSymbol pairs a persistent string identifier used internally with an optional,...
Performs effect computation.
std::vector< FileType > FileTypes
A control on a NyquistDialog.
NyqControl & operator=(const NyqControl &)=default
NyqControl(const NyqControl &)=default
std::vector< EnumValueSymbol > choices
FileNames::FileTypes fileTypes
An Effect that calls up a Nyquist (XLISP) plug-in, i.e. many possible effects from this one class.
wxTextCtrl * mCommandText
TranslatableString mDebugOutput
TranslatableString mCopyright
TranslatableString mPromptName
const TranslatableString & InitializationError() const
wxDateTime mFileModified
When the script was last modified on disk.
TranslatableString mAuthor
std::unique_ptr< float[]> Buffer
unsigned mNumSelectedChannels
wxFileName mFileName
Name of the Nyquist script file this effect is loaded from.
TranslatableString mName
Name of the Effect (untranslated)
NyquistEffect(const wxString &fName)
TranslatableString mAction
std::vector< NyqControl > mControls
wxArrayString mCategories
TranslatableString mReleaseVersion
void OnDebug(wxCommandEvent &evt)
TranslatableString mInitError
Dialog used with NyquistEffect.
Visitor of effect or command parameters. This is a base class with lots of virtual functions that do ...
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.
Holds a msgid for the translation catalog; may also bind format arguments.
A Track that contains audio waveform data.
Positions or offsets within audio files need a wide type.
Extend wxArrayString with move operations and construction and insertion fromstd::initializer_list.
void OnSave(wxCommandEvent &e)
Externalized state of a plug-in.
EffectSettings proxySettings