diff --git a/src/effects/nyquist/LoadNyquist.cpp b/src/effects/nyquist/LoadNyquist.cpp index a4e1c8588..00e6ca5aa 100644 --- a/src/effects/nyquist/LoadNyquist.cpp +++ b/src/effects/nyquist/LoadNyquist.cpp @@ -219,6 +219,7 @@ bool NyquistEffectsModule::RegisterPlugin(PluginManagerInterface & pm, return true; } + errMsg = effect.InitializationError(); return false; } diff --git a/src/effects/nyquist/Nyquist.cpp b/src/effects/nyquist/Nyquist.cpp index ca310c05b..af4f842c4 100644 --- a/src/effects/nyquist/Nyquist.cpp +++ b/src/effects/nyquist/Nyquist.cpp @@ -170,6 +170,9 @@ NyquistEffect::NyquistEffect(const wxString &fName) mName = mFileName.GetName(); mFileModified = mFileName.GetModificationTime(); ParseFile(); + + if (!mOK && mInitError.empty()) + mInitError = _("Ill-formed Nyquist plug-in header"); } NyquistEffect::~NyquistEffect() @@ -1595,6 +1598,10 @@ void NyquistEffect::Parse(const wxString &line) if (v < 1 || v > 4) { // This is an unsupported plug-in version mOK = false; + mInitError.Format( + _("This version of Audacity does not support Nyquist plug-in version %ld"), + v + ); return; } mVersion = (int) v; @@ -1799,6 +1806,7 @@ bool NyquistEffect::ParseProgram(wxInputStream & stream) { if (!stream.IsOk()) { + mInitError = _("Could not open file"); return false; } @@ -1851,6 +1859,8 @@ For SAL, use a return statement such as:\n\treturn *track* * 0.1\n\ or for LISP, begin with an open parenthesis such as:\n\t(mult *track* 0.1)\n ."), _("Error in Nyquist code"), wxOK | wxCENTRE); + /* i18n-hint: refers to programming "languages" */ + mInitError = _("Could not determine language"); return false; // Else just throw it at Nyquist to see what happens } diff --git a/src/effects/nyquist/Nyquist.h b/src/effects/nyquist/Nyquist.h index 5123de117..d916f7ea3 100644 --- a/src/effects/nyquist/Nyquist.h +++ b/src/effects/nyquist/Nyquist.h @@ -129,6 +129,7 @@ private: bool TransferDataFromEffectWindow(); bool IsOk(); + const wxString &InitializationError() const { return mInitError; } static wxArrayString GetNyquistSearchPath(); @@ -191,6 +192,7 @@ private: */ bool mIsPrompt; bool mOK; + wxString mInitError; wxString mInputCmd; // history: exactly what the user typed wxString mCmd; // the command to be processed wxString mName; ///< Name of the Effect (untranslated)