mirror of
https://github.com/cookiengineer/audacity
synced 2025-12-19 23:21:33 +01:00
Don't call GetActiveProject when constructing EffectUIHost...
... relying on guarantees in the previous commit
This commit is contained in:
@@ -717,6 +717,7 @@ EVT_MENU_RANGE(kFactoryPresetsID, kFactoryPresetsID + 999, EffectUIHost::OnFacto
|
|||||||
END_EVENT_TABLE()
|
END_EVENT_TABLE()
|
||||||
|
|
||||||
EffectUIHost::EffectUIHost(wxWindow *parent,
|
EffectUIHost::EffectUIHost(wxWindow *parent,
|
||||||
|
AudacityProject &project,
|
||||||
Effect *effect,
|
Effect *effect,
|
||||||
EffectUIClientInterface *client)
|
EffectUIClientInterface *client)
|
||||||
: wxDialogWrapper(parent, wxID_ANY, effect->GetName(),
|
: wxDialogWrapper(parent, wxID_ANY, effect->GetName(),
|
||||||
@@ -736,7 +737,7 @@ EffectUIHost::EffectUIHost(wxWindow *parent,
|
|||||||
mCommand = NULL;
|
mCommand = NULL;
|
||||||
mClient = client;
|
mClient = client;
|
||||||
|
|
||||||
mProject = GetActiveProject();
|
mProject = &project;
|
||||||
|
|
||||||
mInitialized = false;
|
mInitialized = false;
|
||||||
mSupportsRealtime = false;
|
mSupportsRealtime = false;
|
||||||
@@ -750,6 +751,7 @@ EffectUIHost::EffectUIHost(wxWindow *parent,
|
|||||||
}
|
}
|
||||||
|
|
||||||
EffectUIHost::EffectUIHost(wxWindow *parent,
|
EffectUIHost::EffectUIHost(wxWindow *parent,
|
||||||
|
AudacityProject &project,
|
||||||
AudacityCommand *command,
|
AudacityCommand *command,
|
||||||
EffectUIClientInterface *client)
|
EffectUIClientInterface *client)
|
||||||
: wxDialogWrapper(parent, wxID_ANY, XO("Some Command") /*command->GetName()*/,
|
: wxDialogWrapper(parent, wxID_ANY, XO("Some Command") /*command->GetName()*/,
|
||||||
@@ -769,7 +771,7 @@ EffectUIHost::EffectUIHost(wxWindow *parent,
|
|||||||
mCommand = command;
|
mCommand = command;
|
||||||
mClient = client;
|
mClient = client;
|
||||||
|
|
||||||
mProject = GetActiveProject();
|
mProject = &project;
|
||||||
|
|
||||||
mInitialized = false;
|
mInitialized = false;
|
||||||
mSupportsRealtime = false;
|
mSupportsRealtime = false;
|
||||||
@@ -1828,7 +1830,7 @@ wxDialog *EffectUI::DialogFactory( wxWindow &parent, EffectHostInterface *pHost,
|
|||||||
return nullptr;
|
return nullptr;
|
||||||
|
|
||||||
Destroy_ptr<EffectUIHost> dlg{
|
Destroy_ptr<EffectUIHost> dlg{
|
||||||
safenew EffectUIHost{ &parent, pEffect, client} };
|
safenew EffectUIHost{ &parent, *project, pEffect, client} };
|
||||||
|
|
||||||
if (dlg->Initialize())
|
if (dlg->Initialize())
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -120,9 +120,11 @@ class EffectUIHost final : public wxDialogWrapper,
|
|||||||
public:
|
public:
|
||||||
// constructors and destructors
|
// constructors and destructors
|
||||||
EffectUIHost(wxWindow *parent,
|
EffectUIHost(wxWindow *parent,
|
||||||
|
AudacityProject &project,
|
||||||
Effect *effect,
|
Effect *effect,
|
||||||
EffectUIClientInterface *client);
|
EffectUIClientInterface *client);
|
||||||
EffectUIHost(wxWindow *parent,
|
EffectUIHost(wxWindow *parent,
|
||||||
|
AudacityProject &project,
|
||||||
AudacityCommand *command,
|
AudacityCommand *command,
|
||||||
EffectUIClientInterface *client);
|
EffectUIClientInterface *client);
|
||||||
virtual ~EffectUIHost();
|
virtual ~EffectUIHost();
|
||||||
|
|||||||
Reference in New Issue
Block a user