mirror of
https://github.com/cookiengineer/audacity
synced 2025-10-11 17:13:37 +02:00
Error messages for failing to load Nyquist effects
This commit is contained in:
@@ -219,6 +219,7 @@ bool NyquistEffectsModule::RegisterPlugin(PluginManagerInterface & pm,
|
||||
return true;
|
||||
}
|
||||
|
||||
errMsg = effect.InitializationError();
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@@ -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
|
||||
}
|
||||
|
@@ -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)
|
||||
|
Reference in New Issue
Block a user