1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-07-31 07:59:27 +02:00

Make title of Nyquist Prompt dialog change appropriately.

Previously it was being overwritten each Init() by the string suitable for the Nyquist Effects Prompt.
This commit is contained in:
James Crook 2018-07-14 17:38:57 +01:00
parent 2739020342
commit 848b66f4fa
3 changed files with 16 additions and 10 deletions

View File

@ -175,10 +175,10 @@ bool NyquistEffectsModule::AutoRegisterPlugins(PluginManagerInterface & pm)
wxArrayString files;
wxString ignoredErrMsg;
if (!pm.IsPluginRegistered(NYQUIST_PROMPT_ID))
if (!pm.IsPluginRegistered(NYQUIST_EFFECTS_PROMPT_ID))
{
// No checking of error ?
DiscoverPluginsAtPath(NYQUIST_PROMPT_ID, ignoredErrMsg,
DiscoverPluginsAtPath(NYQUIST_EFFECTS_PROMPT_ID, ignoredErrMsg,
PluginManagerInterface::DefaultRegistrationCallback);
}
if (!pm.IsPluginRegistered(NYQUIST_TOOLS_PROMPT_ID))
@ -212,8 +212,8 @@ wxArrayString NyquistEffectsModule::FindPluginPaths(PluginManagerInterface & pm)
wxArrayString pathList = NyquistEffect::GetNyquistSearchPath();
wxArrayString files;
// Add the Nyquist prompt effect
files.Add(NYQUIST_PROMPT_ID);
// Add the Nyquist prompt effect and tool.
files.Add(NYQUIST_EFFECTS_PROMPT_ID);
files.Add(NYQUIST_TOOLS_PROMPT_ID);
// Load .ny plug-ins
@ -246,7 +246,7 @@ bool NyquistEffectsModule::IsPluginValid(const wxString & path, bool bFast)
// Ignores bFast parameter, since checking file exists is fast enough for
// the small number of Nyquist plug-ins that we have.
static_cast<void>(bFast);
if((path == NYQUIST_PROMPT_ID) || (path == NYQUIST_TOOLS_PROMPT_ID))
if((path == NYQUIST_EFFECTS_PROMPT_ID) || (path == NYQUIST_TOOLS_PROMPT_ID))
return true;
return wxFileName::FileExists(path);

View File

@ -151,9 +151,11 @@ NyquistEffect::NyquistEffect(const wxString &fName)
mMaxLen = NYQ_MAX_LEN;
// Interactive Nyquist (for effects)
if (fName == NYQUIST_PROMPT_ID) {
if (fName == NYQUIST_EFFECTS_PROMPT_ID) {
mName = XO("Nyquist Effects Prompt");
mType = EffectTypeProcess;
mPromptName = mName;
mPromptType = mType;
mOK = true;
mIsPrompt = true;
return;
@ -163,6 +165,8 @@ NyquistEffect::NyquistEffect(const wxString &fName)
if (fName == NYQUIST_TOOLS_PROMPT_ID) {
mName = XO("Nyquist Tools Prompt");
mType = EffectTypeTool;
mPromptName = mName;
mPromptType = mType;
mOK = true;
mIsPrompt = true;
return;
@ -195,7 +199,7 @@ wxString NyquistEffect::GetPath()
if (mIsPrompt)
return (mType == EffectTypeTool) ?
NYQUIST_TOOLS_PROMPT_ID :
NYQUIST_PROMPT_ID;
NYQUIST_EFFECTS_PROMPT_ID;
return mFileName.GetFullPath();
}
@ -512,9 +516,9 @@ bool NyquistEffect::Init()
// EffectType may not be defined in script, so
// reset each time we call the Nyquist Prompt.
if (mIsPrompt) {
mName = XO("Nyquist Effects Prompt");
mName = mPromptName;
// Reset effect type each time we call the Nyquist Prompt.
mType = EffectTypeProcess;
mType = mPromptType;
mIsSpectral = false;
mDebugButton = true; // Debug button always enabled for Nyquist Prompt.
mEnablePreview = true; // Preview button always enabled for Nyquist Prompt.

View File

@ -34,7 +34,7 @@
name into another alphabet. */
#define NYQUISTEFFECTS_FAMILY ( IdentInterfaceSymbol{ XO("Nyquist") } )
#define NYQUIST_PROMPT_ID wxT("Nyquist Effects Prompt")
#define NYQUIST_EFFECTS_PROMPT_ID wxT("Nyquist Effects Prompt")
#define NYQUIST_TOOLS_PROMPT_ID wxT("Nyquist Tools Prompt")
#define NYQUIST_WORKER_ID wxT("Nyquist Worker")
@ -228,6 +228,7 @@ private:
wxString mInputCmd; // history: exactly what the user typed
wxString mCmd; // the command to be processed
wxString mName; ///< Name of the Effect (untranslated)
wxString mPromptName; // If a prompt, we need to remember original name.
wxString mAction; // translatable
wxString mInfo; // translatable
wxString mAuthor;
@ -240,6 +241,7 @@ private:
wxString mHelpFile;
bool mHelpFileExists;
EffectType mType;
EffectType mPromptType; // If a prompt, need ot remember original type.
bool mEnablePreview;
bool mDebugButton; // Set to false to disable Debug button.