Audacity 3.2.0
CommandDispatch.cpp
Go to the documentation of this file.
1/**********************************************************************
2
3 Audacity: A Digital Audio Editor
4
5 @file CommandDispatch.cpp
6 @brief implements function HandleTextualCommand
7
8 Paul Licameli split from BatchCommands.cpp
9
10**********************************************************************/
11
12#include "CommandDispatch.h"
13
14#include "CommandManager.h"
15#include "PluginManager.h"
16#include "../effects/EffectManager.h"
17#include "../effects/EffectUI.h"
18
20 const CommandID & Str,
21 const CommandContext & context, CommandFlag flags, bool alwaysEnabled)
22{
23 switch ( commandManager.HandleTextualCommand(
24 Str, context, flags, alwaysEnabled) ) {
26 return true;
28 return false;
30 default:
31 break;
32 }
33
34 // Not one of the singleton commands.
35 // We could/should try all the list-style commands.
36 // instead we only try the effects.
38 for (auto &plug : PluginManager::Get().PluginsOfType(PluginTypeEffect))
39 if (em.GetCommandIdentifier(plug.GetID()) == Str)
40 return EffectUI::DoEffect(
41 plug.GetID(), context,
43
44 return false;
45}
bool HandleTextualCommand(CommandManager &commandManager, const CommandID &Str, const CommandContext &context, CommandFlag flags, bool alwaysEnabled)
std::bitset< NCommandFlags > CommandFlag
Definition: CommandFlag.h:31
@ PluginTypeEffect
CommandContext provides additional information to an 'Apply()' command. It provides the project,...
CommandManager implements a system for organizing all user-callable commands.
TextualCommandResult HandleTextualCommand(const CommandID &Str, const CommandContext &context, CommandFlag flags, bool alwaysEnabled)
EffectManager is the class that handles effects and effect categories.
Definition: EffectManager.h:48
CommandID GetCommandIdentifier(const PluginID &ID)
static EffectManager & Get()
static PluginManager & Get()
AUDACITY_DLL_API bool DoEffect(const PluginID &ID, const CommandContext &context, unsigned flags)
'Repeat Last Effect'.
Definition: EffectUI.cpp:1329