Audacity 3.2.0
|
EffectManager is the class that handles effects and effect categories. More...
#include <EffectManager.h>
Public Types | |
enum | : unsigned { kNone = 0x00 , kConfigured = 0x01 , kSkipState = 0x02 , kDontRepeatLast = 0x04 , kRepeatGen = 0x08 , kRepeatNyquistPrompt = 0x10 } |
using | EffectPresetDialog = std::function< std::optional< wxString >(EffectPlugin &, const wxString &preset)> |
Public Member Functions | |
const PluginID & | RegisterEffect (std::unique_ptr< EffectPlugin > uEffect) |
Here solely for the purpose of Nyquist Workbench until a better solution is devised. More... | |
void | UnregisterEffect (const PluginID &ID) |
Used only by Nyquist Workbench module. More... | |
TranslatableString | GetEffectFamilyName (const PluginID &ID) |
TranslatableString | GetVendorName (const PluginID &ID) |
bool | IsHidden (const PluginID &ID) |
bool | HasPresets (const PluginID &ID) |
wxString | GetPreset (const PluginID &ID, const wxString ¶ms, EffectPresetDialog) |
wxString | GetDefaultPreset (const PluginID &ID) |
void | SetSkipStateFlag (bool flag) |
bool | GetSkipStateFlag () |
EffectPlugin * | GetEffect (const PluginID &ID) |
EffectSettings * | GetDefaultSettings (const PluginID &ID) |
std::pair< EffectPlugin *, EffectSettings * > | GetEffectAndDefaultSettings (const PluginID &ID) |
Static Public Member Functions | |
static const EffectInstanceFactory * | GetInstanceFactory (const PluginID &ID) |
static EffectManager & | Get () |
Private Member Functions | |
EffectAndDefaultSettings & | DoGetEffect (const PluginID &ID) |
Private Attributes | |
EffectMap | mEffects |
EffectOwnerMap | mHostEffects |
int | mNumEffects |
bool | mSkipStateFlag |
EffectManager is the class that handles effects and effect categories.
It maintains a graph of effect categories and subcategories, registers and unregisters effects and can return filtered lists of effects.
Definition at line 51 of file EffectManager.h.
using EffectManager::EffectPresetDialog = std::function<std::optional<wxString>( EffectPlugin&, const wxString& preset)> |
Definition at line 85 of file EffectManager.h.
anonymous enum : unsigned |
Enumerator | |
---|---|
kNone | |
kConfigured | |
kSkipState | |
kDontRepeatLast | |
kRepeatGen | |
kRepeatNyquistPrompt |
Definition at line 55 of file EffectManager.h.
|
private |
Definition at line 268 of file EffectManager.cpp.
References anonymous_namespace{EffectManager.cpp}::LoadComponent(), mEffects, and settings().
Referenced by GetEffect(), and GetEffectAndDefaultSettings().
|
static |
Get the singleton instance of the EffectManager. Probably not safe for multi-thread use.
Definition at line 33 of file EffectManager.cpp.
Referenced by anonymous_namespace{MenuHelper.cpp}::AddGroupedEffectMenuItems(), anonymous_namespace{MenuHelper.cpp}::AddSortedEffectMenuItems(), EffectAndCommandPluginManager::BatchProcessingOff(), EffectAndCommandPluginManager::BatchProcessingOn(), anonymous_namespace{MenuHelper.cpp}::ComapareEffectsByTypeAndPublisher(), anonymous_namespace{MenuHelper.cpp}::CompareEffectsByPublisher(), anonymous_namespace{MenuHelper.cpp}::CompareEffectsByPublisherAndName(), anonymous_namespace{MenuHelper.cpp}::CompareEffectsByType(), anonymous_namespace{MenuHelper.cpp}::CompareEffectsByTypeAndName(), EffectAndCommandPluginManager::DoAudacityCommand(), AudacityApplicationLogic::DoEffect(), EffectAndCommandPluginManager::GetCommandDefinition(), EffectAndCommandPluginManager::GetCommandTip(), EffectAndCommandPluginManager::GetCommandUrl(), EffectAndCommandPluginManager::GetEffectParameters(), GetInstanceFactory(), anonymous_namespace{MenuHelper.cpp}::IsEnabledPlugin(), MacroCommandsCatalog::MacroCommandsCatalog(), EffectNoiseReduction::Dialog::OnGetProfile(), NyqBench::OnGo(), MacroCommandDialog::OnItemSelected(), anonymous_namespace{RealtimeEffectPanel.cpp}::RealtimeEffectControl::OnOptionsClicked(), NyquistBase::Process(), MacroCommands::PromptForPresetFor(), EffectAndCommandPluginManager::PromptUser(), MacroCommandDialog::SetCommandAndParams(), EffectAndCommandPluginManager::SetEffectParameters(), RealtimeEffectStateUI::Show(), and RealtimeEffectStateUI::UpdateTitle().
wxString EffectManager::GetDefaultPreset | ( | const PluginID & | ID | ) |
Definition at line 175 of file EffectManager.cpp.
References GetEffect(), CommandParameters::GetParameters(), HasCurrentSettings(), HasFactoryDefaults(), EffectPlugin::kCurrentSettingsIdent, EffectPlugin::kFactoryDefaultsIdent, preset, and wxT().
Referenced by EffectAndCommandPluginManager::GetEffectParameters(), and MacroCommandDialog::OnItemSelected().
EffectSettings * EffectManager::GetDefaultSettings | ( | const PluginID & | ID | ) |
Get default settings by effect ID. May return nullptr
Definition at line 210 of file EffectManager.cpp.
References GetEffectAndDefaultSettings().
Referenced by AudacityApplicationLogic::DoEffect().
EffectPlugin * EffectManager::GetEffect | ( | const PluginID & | ID | ) |
Return an effect by its ID.
Definition at line 205 of file EffectManager.cpp.
References DoGetEffect(), and EffectAndDefaultSettings::effect.
Referenced by AudacityApplicationLogic::DoEffect(), GetDefaultPreset(), GetEffectFamilyName(), GetInstanceFactory(), GetPreset(), GetVendorName(), HasPresets(), IsHidden(), anonymous_namespace{RealtimeEffectPanel.cpp}::RealtimeEffectControl::OnOptionsClicked(), RealtimeEffectStateUI::Show(), and RealtimeEffectStateUI::UpdateTitle().
std::pair< EffectPlugin *, EffectSettings * > EffectManager::GetEffectAndDefaultSettings | ( | const PluginID & | ID | ) |
Get effect and default settings by effect ID.
result: !result.first || result.second
(if first member is not null, then the second is not null) Definition at line 216 of file EffectManager.cpp.
References DoGetEffect().
Referenced by GetDefaultSettings(), EffectAndCommandPluginManager::GetEffectParameters(), and EffectAndCommandPluginManager::SetEffectParameters().
TranslatableString EffectManager::GetEffectFamilyName | ( | const PluginID & | ID | ) |
Definition at line 60 of file EffectManager.cpp.
References PluginManager::Get(), GetEffect(), and anonymous_namespace{RealtimeEffectPanel.cpp}::GetPlugin().
Referenced by anonymous_namespace{MenuHelper.cpp}::AddSortedEffectMenuItems().
|
static |
Find the singleton EffectInstanceFactory for ID.
Definition at line 292 of file EffectManager.cpp.
References Get(), and GetEffect().
wxString EffectManager::GetPreset | ( | const PluginID & | ID, |
const wxString & | params, | ||
EffectPresetDialog | dialog | ||
) |
Definition at line 137 of file EffectManager.cpp.
References GetEffect(), CommandParameters::GetParameters(), CommandParameters::HasEntry(), params, preset, and wxT().
Referenced by MacroCommands::PromptForPresetFor().
bool EffectManager::GetSkipStateFlag | ( | ) |
Definition at line 95 of file EffectManager.cpp.
References mSkipStateFlag.
Referenced by AudacityApplicationLogic::DoEffect().
TranslatableString EffectManager::GetVendorName | ( | const PluginID & | ID | ) |
Definition at line 71 of file EffectManager.cpp.
References PluginManager::Get(), GetEffect(), and anonymous_namespace{RealtimeEffectPanel.cpp}::GetPlugin().
Referenced by anonymous_namespace{MenuHelper.cpp}::AddSortedEffectMenuItems().
bool EffectManager::HasPresets | ( | const PluginID & | ID | ) |
Definition at line 121 of file EffectManager.cpp.
References GetEffect(), GetUserPresets(), HasCurrentSettings(), and HasFactoryDefaults().
Referenced by MacroCommandDialog::OnItemSelected().
bool EffectManager::IsHidden | ( | const PluginID & | ID | ) |
Definition at line 83 of file EffectManager.cpp.
References GetEffect().
Referenced by anonymous_namespace{MenuHelper.cpp}::IsEnabledPlugin().
const PluginID & EffectManager::RegisterEffect | ( | std::unique_ptr< EffectPlugin > | uEffect | ) |
Here solely for the purpose of Nyquist Workbench until a better solution is devised.
Register an effect so it can be executed. uEffect is expected to be a self-hosting Nyquist effect
Definition at line 41 of file EffectManager.cpp.
References PluginManager::Get(), mEffects, PluginTypeEffect, and PluginManager::RegisterPlugin().
Referenced by NyqBench::OnGo().
void EffectManager::SetSkipStateFlag | ( | bool | flag | ) |
Allow effects to disable saving the state at run time
Definition at line 90 of file EffectManager.cpp.
References flag, and mSkipStateFlag.
Referenced by EffectAndCommandPluginManager::DoAudacityCommand(), AudacityApplicationLogic::DoEffect(), EffectNoiseReduction::Dialog::OnGetProfile(), and NyquistBase::Process().
void EffectManager::UnregisterEffect | ( | const PluginID & | ID | ) |
Used only by Nyquist Workbench module.
Definition at line 53 of file EffectManager.cpp.
References PluginManager::Get(), mEffects, and PluginManager::UnregisterPlugin().
Referenced by NyqBench::OnGo().
|
private |
Definition at line 126 of file EffectManager.h.
Referenced by DoGetEffect(), RegisterEffect(), and UnregisterEffect().
|
private |
Definition at line 127 of file EffectManager.h.
|
private |
Definition at line 129 of file EffectManager.h.
|
private |
Definition at line 133 of file EffectManager.h.
Referenced by GetSkipStateFlag(), and SetSkipStateFlag().