Audacity 3.2.0
Functions
EffectUI Namespace Reference

Functions

bool DoEffect (const PluginID &ID, AudacityProject &project, unsigned flags)
 
AUDACITY_DLL_API DialogFactoryResults DialogFactory (wxWindow &parent, EffectBase &host, EffectUIServices &client, EffectSettingsAccess &access)
 

Function Documentation

◆ DialogFactory()

DialogFactoryResults EffectUI::DialogFactory ( wxWindow &  parent,
EffectBase host,
EffectUIServices client,
EffectSettingsAccess access 
)

Definition at line 1112 of file EffectUI.cpp.

1115{
1116 // Make sure there is an associated project, whose lifetime will
1117 // govern the lifetime of the dialog, even when the dialog is
1118 // non-modal, as for realtime effects
1119 auto project = FindProjectFromWindow(&parent);
1120 if ( !project )
1121 return {};
1122 std::shared_ptr<EffectInstance> pInstance;
1124 *project, host, client, pInstance, access } };
1125 if (!pInstance) {
1126 dlg->SetClosed();
1127 return {};
1128 }
1129 if (dlg->Initialize()) {
1130 auto pEditor = dlg->GetEditor();
1131 // release() is safe because parent will own it
1132 return { dlg.release(), pInstance, pEditor };
1133 }
1134 return {};
1135}
#define safenew
Definition: MemoryX.h:10
std::unique_ptr< T, Destroyer< T > > Destroy_ptr
a convenience for using Destroyer
Definition: MemoryX.h:164
AudacityProject * FindProjectFromWindow(wxWindow *pWindow)
const auto project

References FindProjectFromWindow(), project, and safenew.

Referenced by DoEffect(), and MacroCommands::PromptForParamsFor().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ DoEffect()

bool EffectUI::DoEffect ( const PluginID ID,
AudacityProject project,
unsigned  flags 
)

Definition at line 30 of file DoEffect.cpp.

32{
33 auto getShowEffectHostInterfaceCb =
34 [window = &GetProjectFrame(project)](
35 Effect& effect, std::shared_ptr<EffectInstance>& pInstance,
37 const auto pServices = dynamic_cast<EffectUIServices*>(&effect);
38 return pServices && pServices->ShowHostInterface(
39 effect, *window, EffectUI::DialogFactory,
40 pInstance, access, true);
41 };
42 auto selectAllIfNoneCb = [&]() {
44 };
46 ID, project, flags, std::move(getShowEffectHostInterfaceCb),
47 StopPlaybackCb(project), std::move(selectAllIfNoneCb));
48}
AUDACITY_DLL_API wxFrame & GetProjectFrame(AudacityProject &project)
Get the top-level window associated with the project (as a wxFrame only, when you do not need to use ...
Base class for many of the effects in Audacity.
Definition: Effect.h:26
virtual int ShowHostInterface(EffectBase &plugin, wxWindow &parent, const EffectDialogFactory &factory, std::shared_ptr< EffectInstance > &pInstance, EffectSettingsAccess &access, bool forceModal=false)
Implementation of EffectSettings for cases where there is only one thread.
AUDACITY_APPLICATION_LOGIC_API bool DoEffect(const PluginID &ID, AudacityProject &project, unsigned flags, ShowEffectHostInterfaceCb, StopPlaybackCb, SelectAllIfNoneCb)
'Repeat Last Effect'.
AUDACITY_DLL_API DialogFactoryResults DialogFactory(wxWindow &parent, EffectBase &host, EffectUIServices &client, EffectSettingsAccess &access)
Definition: EffectUI.cpp:1112
void SelectAllIfNone(AudacityProject &project)
AudacityApplicationLogic::StopPlaybackCb StopPlaybackCb(AudacityProject &project)
Definition: DoEffect.cpp:24

References DialogFactory(), AudacityApplicationLogic::DoEffect(), GetProjectFrame(), project, SelectUtilities::SelectAllIfNone(), EffectUIServices::ShowHostInterface(), and anonymous_namespace{DoEffect.cpp}::StopPlaybackCb().

Referenced by MacroCommands::ApplyEffectCommand(), CommandDispatch::HandleTextualCommand(), EffectUIHost::OnApply(), anonymous_namespace{PluginMenus.cpp}::OnEffect(), NyqBench::OnGo(), anonymous_namespace{PluginMenus.cpp}::OnRepeatLastAnalyzer(), anonymous_namespace{PluginMenus.cpp}::OnRepeatLastEffect(), anonymous_namespace{PluginMenus.cpp}::OnRepeatLastGenerator(), anonymous_namespace{BatchProcessDialog.cpp}::OnRepeatLastTool(), and anonymous_namespace{TrackMenus.cpp}::OnStereoToMono().

Here is the call graph for this function:
Here is the caller graph for this function: