1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-08-02 17:09:26 +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; wxArrayString files;
wxString ignoredErrMsg; wxString ignoredErrMsg;
if (!pm.IsPluginRegistered(NYQUIST_PROMPT_ID)) if (!pm.IsPluginRegistered(NYQUIST_EFFECTS_PROMPT_ID))
{ {
// No checking of error ? // No checking of error ?
DiscoverPluginsAtPath(NYQUIST_PROMPT_ID, ignoredErrMsg, DiscoverPluginsAtPath(NYQUIST_EFFECTS_PROMPT_ID, ignoredErrMsg,
PluginManagerInterface::DefaultRegistrationCallback); PluginManagerInterface::DefaultRegistrationCallback);
} }
if (!pm.IsPluginRegistered(NYQUIST_TOOLS_PROMPT_ID)) if (!pm.IsPluginRegistered(NYQUIST_TOOLS_PROMPT_ID))
@ -212,8 +212,8 @@ wxArrayString NyquistEffectsModule::FindPluginPaths(PluginManagerInterface & pm)
wxArrayString pathList = NyquistEffect::GetNyquistSearchPath(); wxArrayString pathList = NyquistEffect::GetNyquistSearchPath();
wxArrayString files; wxArrayString files;
// Add the Nyquist prompt effect // Add the Nyquist prompt effect and tool.
files.Add(NYQUIST_PROMPT_ID); files.Add(NYQUIST_EFFECTS_PROMPT_ID);
files.Add(NYQUIST_TOOLS_PROMPT_ID); files.Add(NYQUIST_TOOLS_PROMPT_ID);
// Load .ny plug-ins // 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 // Ignores bFast parameter, since checking file exists is fast enough for
// the small number of Nyquist plug-ins that we have. // the small number of Nyquist plug-ins that we have.
static_cast<void>(bFast); 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 true;
return wxFileName::FileExists(path); return wxFileName::FileExists(path);

View File

@ -151,9 +151,11 @@ NyquistEffect::NyquistEffect(const wxString &fName)
mMaxLen = NYQ_MAX_LEN; mMaxLen = NYQ_MAX_LEN;
// Interactive Nyquist (for effects) // Interactive Nyquist (for effects)
if (fName == NYQUIST_PROMPT_ID) { if (fName == NYQUIST_EFFECTS_PROMPT_ID) {
mName = XO("Nyquist Effects Prompt"); mName = XO("Nyquist Effects Prompt");
mType = EffectTypeProcess; mType = EffectTypeProcess;
mPromptName = mName;
mPromptType = mType;
mOK = true; mOK = true;
mIsPrompt = true; mIsPrompt = true;
return; return;
@ -163,6 +165,8 @@ NyquistEffect::NyquistEffect(const wxString &fName)
if (fName == NYQUIST_TOOLS_PROMPT_ID) { if (fName == NYQUIST_TOOLS_PROMPT_ID) {
mName = XO("Nyquist Tools Prompt"); mName = XO("Nyquist Tools Prompt");
mType = EffectTypeTool; mType = EffectTypeTool;
mPromptName = mName;
mPromptType = mType;
mOK = true; mOK = true;
mIsPrompt = true; mIsPrompt = true;
return; return;
@ -195,7 +199,7 @@ wxString NyquistEffect::GetPath()
if (mIsPrompt) if (mIsPrompt)
return (mType == EffectTypeTool) ? return (mType == EffectTypeTool) ?
NYQUIST_TOOLS_PROMPT_ID : NYQUIST_TOOLS_PROMPT_ID :
NYQUIST_PROMPT_ID; NYQUIST_EFFECTS_PROMPT_ID;
return mFileName.GetFullPath(); return mFileName.GetFullPath();
} }
@ -512,9 +516,9 @@ bool NyquistEffect::Init()
// EffectType may not be defined in script, so // EffectType may not be defined in script, so
// reset each time we call the Nyquist Prompt. // reset each time we call the Nyquist Prompt.
if (mIsPrompt) { if (mIsPrompt) {
mName = XO("Nyquist Effects Prompt"); mName = mPromptName;
// Reset effect type each time we call the Nyquist Prompt. // Reset effect type each time we call the Nyquist Prompt.
mType = EffectTypeProcess; mType = mPromptType;
mIsSpectral = false; mIsSpectral = false;
mDebugButton = true; // Debug button always enabled for Nyquist Prompt. mDebugButton = true; // Debug button always enabled for Nyquist Prompt.
mEnablePreview = true; // Preview 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. */ name into another alphabet. */
#define NYQUISTEFFECTS_FAMILY ( IdentInterfaceSymbol{ XO("Nyquist") } ) #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_TOOLS_PROMPT_ID wxT("Nyquist Tools Prompt")
#define NYQUIST_WORKER_ID wxT("Nyquist Worker") #define NYQUIST_WORKER_ID wxT("Nyquist Worker")
@ -228,6 +228,7 @@ private:
wxString mInputCmd; // history: exactly what the user typed wxString mInputCmd; // history: exactly what the user typed
wxString mCmd; // the command to be processed wxString mCmd; // the command to be processed
wxString mName; ///< Name of the Effect (untranslated) wxString mName; ///< Name of the Effect (untranslated)
wxString mPromptName; // If a prompt, we need to remember original name.
wxString mAction; // translatable wxString mAction; // translatable
wxString mInfo; // translatable wxString mInfo; // translatable
wxString mAuthor; wxString mAuthor;
@ -240,6 +241,7 @@ private:
wxString mHelpFile; wxString mHelpFile;
bool mHelpFileExists; bool mHelpFileExists;
EffectType mType; EffectType mType;
EffectType mPromptType; // If a prompt, need ot remember original type.
bool mEnablePreview; bool mEnablePreview;
bool mDebugButton; // Set to false to disable Debug button. bool mDebugButton; // Set to false to disable Debug button.