11#ifndef __AUDACITY_EFFECT_NYQUIST__
12#define __AUDACITY_EFFECT_NYQUIST__
14#include "../StatefulEffect.h"
26#define NYQUISTEFFECTS_VERSION wxT("1.0.0.0")
90 wxString GetVersion()
const override;
101 bool IsInteractive()
const override;
102 bool IsDefault()
const override;
103 bool EnablesDebug()
const override;
121 bool Init()
override;
123 int ShowHostInterface(
EffectPlugin &plugin, wxWindow &parent,
126 bool forceModal =
false)
override;
127 std::unique_ptr<EffectEditor> PopulateOrExchange(
135 void RedirectOutput();
136 void SetCommand(
const wxString &cmd);
142 wxWeakRef<wxWindow> mUIParent{};
152 bool TransferDataToPromptWindow();
153 bool TransferDataToEffectWindow();
155 bool TransferDataFromPromptWindow();
156 bool TransferDataFromEffectWindow();
163 static wxString NyquistToWxString(
const char *nyqString);
164 wxString EscapeString(
const wxString & inStr);
165 static std::vector<EnumValueSymbol> ParseChoice(
const wxString & text);
171 static int StaticGetCallback(
float *buffer,
int channel,
172 int64_t start, int64_t len, int64_t totlen,
174 static int StaticPutCallback(
float *buffer,
int channel,
175 int64_t start, int64_t len, int64_t totlen,
177 static void StaticOutputCallback(
int c,
void *userdata);
178 static void StaticOSCallback(
void *userdata);
180 int GetCallback(
float *buffer,
int channel,
181 int64_t start, int64_t len, int64_t totlen);
182 int PutCallback(
float *buffer,
int channel,
183 int64_t start, int64_t len, int64_t totlen);
184 void OutputCallback(
int c);
188 bool ParseCommand(
const wxString & cmd);
189 bool ParseProgram(wxInputStream & stream);
198 const wxString &line,
bool eof,
199 size_t trimStart,
size_t trimEnd);
201 bool Parse(
Tokenizer &tokenizer,
const wxString &line,
bool eof,
bool first);
204 wxString *pExtraString =
nullptr);
205 static wxString UnQuote(
const wxString &s,
bool allowParens =
true,
206 wxString *pExtraString =
nullptr);
207 static double GetCtrlValue(
const wxString &s);
209 void OnLoad(wxCommandEvent & evt);
210 void OnSave(wxCommandEvent & evt);
213 void OnText(wxCommandEvent & evt);
214 void OnSlider(wxCommandEvent & evt);
215 void OnChoice(wxCommandEvent & evt);
216 void OnTime(wxCommandEvent & evt);
217 void OnFileButton(wxCommandEvent & evt);
219 static void resolveFilePath(wxString & path,
FileExtension extension = {});
220 bool validatePath(wxString path);
221 wxString ToTimeFormat(
double t);
223 std::pair<bool, FilePath> CheckHelpPage()
const;
300 size_t mCurBufferLen[2];
314 std::exception_ptr mpException {};
316 DECLARE_EVENT_TABLE()
330 void OnOk(wxCommandEvent & event);
333 DECLARE_EVENT_TABLE()
std::function< DialogFactoryResults(wxWindow &parent, EffectPlugin &, EffectUIServices &, 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.
Hold values to send to effect output meters.
Factory of instances of an effect.
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.
static RegisteredToolbarFactory factory
Externalized state of a plug-in.
std::vector< NyqControl > controls
EffectSettings proxySettings