From 27390203429f25c71760a08f8dfc54e3ae0b55f1 Mon Sep 17 00:00:00 2001 From: James Crook Date: Sat, 14 Jul 2018 16:49:41 +0100 Subject: [PATCH] Bug 1902 - "Nyquist Prompt" confusingly shown only as "Nyquist" when "Grouped by Type" is active Now shown as "Nyquist Effects Prompt" (in Effects menu) and "Nyquist Tools Prompt" (in Tools Menu). These prompts will have slightly different behaviour, e.g. only tools allow aud-do. --- src/Menus.cpp | 19 ++++++++++--------- src/commands/ScreenshotCommand.cpp | 2 +- src/effects/nyquist/Nyquist.cpp | 10 +++++----- src/effects/nyquist/Nyquist.h | 4 ++-- 4 files changed, 18 insertions(+), 17 deletions(-) diff --git a/src/Menus.cpp b/src/Menus.cpp index e7a24ba4a..cea291c77 100644 --- a/src/Menus.cpp +++ b/src/Menus.cpp @@ -1788,7 +1788,8 @@ void AudacityProject::PopulateEffectsMenu(CommandManager* c, else if (plug->IsEffectDefault() #ifdef EXPERIMENTAL_DA // Move Nyquist prompt into nyquist group. - && (plug->GetName() != _("Nyquist Prompt")) + && (plug->GetSymbol() != IdentInterfaceSymbol("Nyquist Effects Prompt")) + && (plug->GetSymbol() != IdentInterfaceSymbol("Nyquist Tools Prompt")) #endif ) defplugs.push_back(plug); @@ -1885,18 +1886,15 @@ void AudacityProject::AddEffectMenuItems(CommandManager *c, if (current != last) { - if (!last.IsEmpty()) - { + bool bInSubmenu = !last.IsEmpty() && (groupNames.Count() > 1); + if( bInSubmenu) c->BeginSubMenu(last); - } AddEffectMenuItemGroup(c, groupNames, vHasDialog, groupPlugs, groupFlags, isDefault); - if (!last.IsEmpty()) - { + if (bInSubmenu) c->EndSubMenu(); - } groupNames.Clear(); vHasDialog.clear(); @@ -1913,11 +1911,14 @@ void AudacityProject::AddEffectMenuItems(CommandManager *c, if (groupNames.GetCount() > 0) { - c->BeginSubMenu(current); + bool bInSubmenu = groupNames.Count() > 1; + if (bInSubmenu) + c->BeginSubMenu(current); AddEffectMenuItemGroup(c, groupNames, vHasDialog, groupPlugs, groupFlags, isDefault); - c->EndSubMenu(); + if (bInSubmenu) + c->EndSubMenu(); } } else diff --git a/src/commands/ScreenshotCommand.cpp b/src/commands/ScreenshotCommand.cpp index 934785a5e..66bd05b71 100644 --- a/src/commands/ScreenshotCommand.cpp +++ b/src/commands/ScreenshotCommand.cpp @@ -502,7 +502,7 @@ void ScreenshotCommand::CaptureEffects( "Limiter...", "Low Pass Filter...", "Notch Filter...", - "Nyquist Prompt...", + "Nyquist Effects Prompt...", //"Studio Fade Out", "Tremolo...", "Vocal Reduction and Isolation...", diff --git a/src/effects/nyquist/Nyquist.cpp b/src/effects/nyquist/Nyquist.cpp index fe9244a53..1ff2f7615 100644 --- a/src/effects/nyquist/Nyquist.cpp +++ b/src/effects/nyquist/Nyquist.cpp @@ -150,16 +150,16 @@ NyquistEffect::NyquistEffect(const wxString &fName) mMaxLen = NYQ_MAX_LEN; - // Interactive Nyquist + // Interactive Nyquist (for effects) if (fName == NYQUIST_PROMPT_ID) { - mName = XO("Nyquist Prompt"); + mName = XO("Nyquist Effects Prompt"); mType = EffectTypeProcess; mOK = true; mIsPrompt = true; return; } - // Interactive Nyquist + // Interactive Nyquist (for general tools) if (fName == NYQUIST_TOOLS_PROMPT_ID) { mName = XO("Nyquist Tools Prompt"); mType = EffectTypeTool; @@ -205,7 +205,7 @@ IdentInterfaceSymbol NyquistEffect::GetSymbol() if (mIsPrompt) return (mType == EffectTypeTool) ? XO("Nyquist Tools Prompt") : - XO("Nyquist Prompt"); + XO("Nyquist Effects Prompt"); return mName; } @@ -512,7 +512,7 @@ bool NyquistEffect::Init() // EffectType may not be defined in script, so // reset each time we call the Nyquist Prompt. if (mIsPrompt) { - mName = XO("Nyquist Prompt"); + mName = XO("Nyquist Effects Prompt"); // Reset effect type each time we call the Nyquist Prompt. mType = EffectTypeProcess; mIsSpectral = false; diff --git a/src/effects/nyquist/Nyquist.h b/src/effects/nyquist/Nyquist.h index a1833a768..66ab99ced 100644 --- a/src/effects/nyquist/Nyquist.h +++ b/src/effects/nyquist/Nyquist.h @@ -34,7 +34,7 @@ name into another alphabet. */ #define NYQUISTEFFECTS_FAMILY ( IdentInterfaceSymbol{ XO("Nyquist") } ) -#define NYQUIST_PROMPT_ID wxT("Nyquist Prompt") +#define NYQUIST_PROMPT_ID wxT("Nyquist Effects Prompt") #define NYQUIST_TOOLS_PROMPT_ID wxT("Nyquist Tools Prompt") #define NYQUIST_WORKER_ID wxT("Nyquist Worker") @@ -219,7 +219,7 @@ private: bool mExternal; bool mIsSpectral; /** True if the code to execute is obtained interactively from the user via - * the "Nyquist Prompt", or "Nyquist Tools Prompt", false for all other effects (lisp code read from + * the "Nyquist Effect Prompt", or "Nyquist Tools Prompt", false for all other effects (lisp code read from * files) */ bool mIsPrompt;