Audacity 3.2.0
|
#include <EffectAndCommandPluginManager.h>
Classes | |
struct | UnsetBatchProcessing |
A custom deleter for std::unique_ptr. More... | |
Public Types | |
using | DialogInvoker = std::function< bool(Effect &, EffectSettings &, std::shared_ptr< EffectInstance > &)> |
Public Member Functions | |
bool | DoAudacityCommand (const PluginID &ID, const CommandContext &, bool shouldPrompt=true) |
void | GetCommandDefinition (const PluginID &ID, const CommandContext &context, int flags) |
wxString | GetEffectParameters (const PluginID &ID) |
bool | SetEffectParameters (const PluginID &ID, const wxString ¶ms) |
bool | PromptUser (const PluginID &ID, AudacityProject &project, DialogInvoker dialogInvoker) |
Shows an effect or command dialog so the user can specify settings for later. More... | |
BatchProcessingScope | SetBatchProcessing (const PluginID &ID) |
Begin a scope that ends when the returned object is destroyed. More... | |
Static Public Member Functions | |
static EffectAndCommandPluginManager & | Get () |
Private Types | |
using | BatchProcessingScope = std::unique_ptr< EffectAndCommandPluginManager, UnsetBatchProcessing > |
using | AudacityCommandMap = std::unordered_map< wxString, AudacityCommand * > |
Private Member Functions | |
void | BatchProcessingOn (const PluginID &ID) |
void | BatchProcessingOff (const PluginID &ID) |
ManualPageID | GetCommandUrl (const PluginID &ID) |
TranslatableString | GetCommandTip (const PluginID &ID) |
AudacityCommand * | GetAudacityCommand (const PluginID &ID) |
Private Attributes | |
AudacityCommandMap | mCommands |
Definition at line 35 of file EffectAndCommandPluginManager.h.
|
private |
Definition at line 89 of file EffectAndCommandPluginManager.h.
|
private |
Definition at line 72 of file EffectAndCommandPluginManager.h.
using EffectAndCommandPluginManager::DialogInvoker = std::function<bool( Effect&, EffectSettings&, std::shared_ptr<EffectInstance>&)> |
Definition at line 40 of file EffectAndCommandPluginManager.h.
|
private |
Definition at line 160 of file EffectAndCommandPluginManager.cpp.
References EffectManager::Get(), and GetAudacityCommand().
Referenced by EffectAndCommandPluginManager::UnsetBatchProcessing::operator()().
|
private |
Definition at line 152 of file EffectAndCommandPluginManager.cpp.
References EffectManager::Get(), and GetAudacityCommand().
Referenced by SetBatchProcessing().
bool EffectAndCommandPluginManager::DoAudacityCommand | ( | const PluginID & | ID, |
const CommandContext & | context, | ||
bool | shouldPrompt = true |
||
) |
Run a command given the plugin ID
Definition at line 26 of file EffectAndCommandPluginManager.cpp.
References AudacityCommand::DoAudacityCommand(), EffectManager::Get(), GetAudacityCommand(), and EffectManager::SetSkipStateFlag().
Referenced by CommandDispatch::DoAudacityCommand().
|
static |
Definition at line 20 of file EffectAndCommandPluginManager.cpp.
Referenced by MacroCommands::ApplyEffectCommand(), HelpCommand::ApplyInner(), CommandDispatch::DoAudacityCommand(), MacroCommands::GetCurrentParamsFor(), MacroCommands::PromptForParamsFor(), and GetInfoCommand::SendCommands().
|
private |
Definition at line 45 of file EffectAndCommandPluginManager.cpp.
References BasicUI::MessageBoxOptions::Caption(), PluginManager::Get(), AudacityCommand::Init(), PluginManager::Load(), mCommands, BasicUI::ShowMessageBox(), and XO().
Referenced by BatchProcessingOff(), BatchProcessingOn(), DoAudacityCommand(), GetCommandDefinition(), GetCommandTip(), GetCommandUrl(), GetEffectParameters(), PromptUser(), and SetEffectParameters().
void EffectAndCommandPluginManager::GetCommandDefinition | ( | const PluginID & | ID, |
const CommandContext & | context, | ||
int | flags | ||
) |
Definition at line 100 of file EffectAndCommandPluginManager.cpp.
References EffectManager::Get(), PluginManager::Get(), GetAudacityCommand(), GetCommandTip(), GetCommandUrl(), CommandContext::pOutput, S, settings(), AudacityCommand::VisitSettings(), and EffectSettingsManager::VisitSettings().
Referenced by HelpCommand::ApplyInner(), and GetInfoCommand::SendCommands().
|
private |
Definition at line 89 of file EffectAndCommandPluginManager.cpp.
References EffectManager::Get(), GetAudacityCommand(), and AudacityCommand::GetDescription().
Referenced by GetCommandDefinition().
|
private |
Definition at line 77 of file EffectAndCommandPluginManager.cpp.
References EffectManager::Get(), GetAudacityCommand(), and AudacityCommand::ManualPage().
Referenced by GetCommandDefinition().
wxString EffectAndCommandPluginManager::GetEffectParameters | ( | const PluginID & | ID | ) |
Support for batch commands
Definition at line 169 of file EffectAndCommandPluginManager.cpp.
References EffectManager::Get(), GetAudacityCommand(), EffectManager::GetDefaultPreset(), EffectManager::GetEffectAndDefaultSettings(), and AudacityCommand::SaveSettingsAsString().
Referenced by MacroCommands::GetCurrentParamsFor(), and MacroCommands::PromptForParamsFor().
bool EffectAndCommandPluginManager::PromptUser | ( | const PluginID & | ID, |
AudacityProject & | project, | ||
DialogInvoker | dialogInvoker | ||
) |
Shows an effect or command dialog so the user can specify settings for later.
It is used when defining a macro. It does not invoke the effect or command.
Show the effect dialog, only so that the user can choose settings, for instance to define a macro.
Definition at line 253 of file EffectAndCommandPluginManager.cpp.
References TrackList::Create(), EffectManager::Get(), GetAudacityCommand(), project, AudacityCommand::PromptUser(), and EffectBase::SetTracks().
Referenced by MacroCommands::PromptForParamsFor().
|
inline |
Begin a scope that ends when the returned object is destroyed.
Within this scope, "batch" (i.e. macro) processing happens, and Effects that are not yet stateless may change their state temporarily, but it is restored afterward
Definition at line 82 of file EffectAndCommandPluginManager.h.
References BatchProcessingOn().
Referenced by MacroCommands::ApplyEffectCommand(), and MacroCommands::PromptForParamsFor().
bool EffectAndCommandPluginManager::SetEffectParameters | ( | const PluginID & | ID, |
const wxString & | params | ||
) |
Definition at line 210 of file EffectAndCommandPluginManager.cpp.
References EffectManager::Get(), GetAudacityCommand(), EffectManager::GetEffectAndDefaultSettings(), CommandParameters::HasEntry(), AudacityCommand::Init(), AudacityCommand::LoadSettingsFromString(), params, settings(), and wxT().
|
private |
Definition at line 96 of file EffectAndCommandPluginManager.h.
Referenced by GetAudacityCommand().