1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-10-11 09:03:36 +02:00

Enh2049 residual: do it without making a new dependency cycle...

... Do not include CommonCommandFlags in Menus.cpp, but PluginMenus is
high-level enough to do the special case changing of flags.

see commit 0bd1beae9a
This commit is contained in:
Paul Licameli
2019-07-29 15:24:29 -04:00
parent 39f054cac3
commit 22f21b3245
2 changed files with 12 additions and 7 deletions

View File

@@ -38,7 +38,6 @@
#include "ProjectSettings.h"
#include "UndoManager.h"
#include "commands/CommandManager.h"
#include "CommonCommandFlags.h"
#include "prefs/TracksPrefs.h"
#include "toolbars/ToolManager.h"
#include "widgets/ErrorDialog.h"
@@ -306,10 +305,6 @@ void MenuCreator::CreateMenusAndCommands(AudacityProject &project)
wxASSERT(menubar);
VisitItem( project, menuTree.get() );
commandManager.SetCommandFlags(
wxT("Noise Reduction..."),
AudioIONotBusyFlag | NoiseReductionTimeSelectedFlag | WaveTracksSelectedFlag
);
GetProjectFrame( project ).SetMenuBar(menubar.release());
mLastFlags = AlwaysEnabledFlag;

View File

@@ -203,6 +203,15 @@ void AddEffectMenuItems(
grouped = true;
}
// Some weird special case stuff just for Noise Reduction so that there is
// more informative help
const auto getBatchFlags = [&]( const PluginDescriptor *plug ){
if ( plug->GetSymbol().Msgid() == wxT( "Noise Reduction" ) )
return
( batchflags | NoiseReductionTimeSelectedFlag ) & ~TimeSelectedFlag;
return batchflags;
};
std::vector<bool> vHasDialog;
wxArrayString groupNames;
PluginIDs groupPlugs;
@@ -266,7 +275,7 @@ void AddEffectMenuItems(
vHasDialog.push_back(hasDialog);
groupPlugs.push_back(plug->GetID());
groupFlags.push_back(
plug->IsEffectRealtime() ? realflags : batchflags);
plug->IsEffectRealtime() ? realflags : getBatchFlags( plug ) );
}
if (groupNames.size() > 0)
@@ -320,7 +329,8 @@ void AddEffectMenuItems(
groupNames.push_back(group + name);
vHasDialog.push_back(hasDialog);
groupPlugs.push_back(plug->GetID());
groupFlags.push_back(plug->IsEffectRealtime() ? realflags : batchflags);
groupFlags.push_back(
plug->IsEffectRealtime() ? realflags : getBatchFlags( plug ) );
}
if (groupNames.size() > 0)