mirror of
https://github.com/cookiengineer/audacity
synced 2025-09-15 07:50:22 +02:00
EffectUIClientInterface::PopulateUI takes ShuttleGui &
This commit is contained in:
parent
eff5b2ef92
commit
1c84932dfa
@ -49,6 +49,8 @@
|
||||
#include "audacity/ConfigInterface.h"
|
||||
#include "audacity/EffectAutomationParameters.h" // for command automation
|
||||
|
||||
class ShuttleGui;
|
||||
|
||||
typedef enum EffectType : int
|
||||
{
|
||||
EffectTypeNone,
|
||||
@ -231,7 +233,7 @@ public:
|
||||
|
||||
virtual void SetHostUI(EffectUIHostInterface *host) = 0;
|
||||
virtual bool IsGraphicalUI() = 0;
|
||||
virtual bool PopulateUI(wxWindow *parent) = 0;
|
||||
virtual bool PopulateUI(ShuttleGui &S) = 0;
|
||||
virtual bool ValidateUI() = 0;
|
||||
virtual bool HideUI() = 0;
|
||||
virtual bool CloseUI() = 0;
|
||||
|
@ -615,14 +615,14 @@ void Effect::SetHostUI(EffectUIHostInterface *WXUNUSED(host))
|
||||
{
|
||||
}
|
||||
|
||||
bool Effect::PopulateUI(wxWindow *parent)
|
||||
bool Effect::PopulateUI(ShuttleGui &S)
|
||||
{
|
||||
auto parent = S.GetParent();
|
||||
mUIParent = parent;
|
||||
mUIParent->PushEventHandler(this);
|
||||
|
||||
// LoadUserPreset(GetCurrentSettingsGroup());
|
||||
|
||||
ShuttleGui S(mUIParent, eIsCreating);
|
||||
PopulateOrExchange(S);
|
||||
|
||||
mUIParent->SetMinSize(mUIParent->GetSizer()->GetMinSize());
|
||||
|
@ -158,7 +158,7 @@ class AUDACITY_DLL_API Effect /* not final */ : public wxEvtHandler,
|
||||
// EffectUIClientInterface implementation
|
||||
|
||||
void SetHostUI(EffectUIHostInterface *host) override;
|
||||
bool PopulateUI(wxWindow *parent) final;
|
||||
bool PopulateUI(ShuttleGui &S) final;
|
||||
bool IsGraphicalUI() override;
|
||||
bool ValidateUI() override;
|
||||
bool HideUI() override;
|
||||
|
@ -858,15 +858,17 @@ int EffectUIHost::ShowModal()
|
||||
|
||||
bool EffectUIHost::Initialize()
|
||||
{
|
||||
EffectPanel *w = safenew EffectPanel(this);
|
||||
RTL_WORKAROUND(w);
|
||||
EffectPanel *w {};
|
||||
{
|
||||
auto vs = std::make_unique<wxBoxSizer>(wxVERTICAL);
|
||||
{
|
||||
auto hs = std::make_unique<wxBoxSizer>(wxHORIZONTAL);
|
||||
|
||||
Destroy_ptr<EffectPanel> uw{ safenew EffectPanel(this) };
|
||||
RTL_WORKAROUND(uw.get());
|
||||
|
||||
// Try to give the window a sensible default/minimum size
|
||||
w->SetMinSize(wxSize(wxMax(600, mParent->GetSize().GetWidth() * 2 / 3),
|
||||
uw->SetMinSize(wxSize(wxMax(600, mParent->GetSize().GetWidth() * 2 / 3),
|
||||
mParent->GetSize().GetHeight() / 2));
|
||||
|
||||
auto gAudioIO = AudioIO::Get();
|
||||
@ -874,12 +876,13 @@ bool EffectUIHost::Initialize()
|
||||
mPlaying = gAudioIO->IsStreamActive(); // not exactly right, but will suffice
|
||||
mCapturing = gAudioIO->IsStreamActive() && gAudioIO->GetNumCaptureChannels() > 0;
|
||||
|
||||
if (!mClient->PopulateUI(w))
|
||||
ShuttleGui S1{ uw.get(), eIsCreating };
|
||||
if (!mClient->PopulateUI(S1))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
hs->Add(w, 1, wxEXPAND);
|
||||
hs->Add((w = uw.release()), 1, wxEXPAND);
|
||||
vs->Add(hs.release(), 1, wxEXPAND);
|
||||
}
|
||||
|
||||
|
@ -1761,8 +1761,9 @@ void VSTEffect::SetHostUI(EffectUIHostInterface *host)
|
||||
mUIHost = host;
|
||||
}
|
||||
|
||||
bool VSTEffect::PopulateUI(wxWindow *parent)
|
||||
bool VSTEffect::PopulateUI(ShuttleGui &S)
|
||||
{
|
||||
auto parent = S.GetParent();
|
||||
mDialog = static_cast<wxDialog *>(wxGetTopLevelParent(parent));
|
||||
mParent = parent;
|
||||
|
||||
|
@ -167,7 +167,7 @@ class VSTEffect final : public wxEvtHandler,
|
||||
// EffectUIClientInterface implementation
|
||||
|
||||
void SetHostUI(EffectUIHostInterface *host) override;
|
||||
bool PopulateUI(wxWindow *parent) override;
|
||||
bool PopulateUI(ShuttleGui &S) override;
|
||||
bool IsGraphicalUI() override;
|
||||
bool ValidateUI() override;
|
||||
bool HideUI() override;
|
||||
|
@ -1717,10 +1717,11 @@ void AudioUnitEffect::SetHostUI(EffectUIHostInterface *host)
|
||||
mUIHost = host;
|
||||
}
|
||||
|
||||
bool AudioUnitEffect::PopulateUI(wxWindow *parent)
|
||||
bool AudioUnitEffect::PopulateUI(ShuttleGui &S)
|
||||
{
|
||||
// OSStatus result;
|
||||
|
||||
auto parent = S.GetParent();
|
||||
mDialog = static_cast<wxDialog *>(wxGetTopLevelParent(parent));
|
||||
mParent = parent;
|
||||
|
||||
|
@ -117,7 +117,7 @@ public:
|
||||
// EffectUIClientInterface implementation
|
||||
|
||||
void SetHostUI(EffectUIHostInterface *host) override;
|
||||
bool PopulateUI(wxWindow *parent) override;
|
||||
bool PopulateUI(ShuttleGui &S) override;
|
||||
bool IsGraphicalUI() override;
|
||||
bool ValidateUI() override;
|
||||
bool HideUI() override;
|
||||
|
@ -1195,8 +1195,10 @@ void LadspaEffect::SetHostUI(EffectUIHostInterface *host)
|
||||
mUIHost = host;
|
||||
}
|
||||
|
||||
bool LadspaEffect::PopulateUI(wxWindow *parent)
|
||||
bool LadspaEffect::PopulateUI(ShuttleGui &S)
|
||||
{
|
||||
auto parent = S.GetParent();
|
||||
|
||||
mParent = parent;
|
||||
|
||||
mParent->PushEventHandler(this);
|
||||
|
@ -115,7 +115,7 @@ public:
|
||||
// EffectUIClientInterface implementation
|
||||
|
||||
void SetHostUI(EffectUIHostInterface *host) override;
|
||||
bool PopulateUI(wxWindow *parent) override;
|
||||
bool PopulateUI(ShuttleGui &S) override;
|
||||
bool IsGraphicalUI() override;
|
||||
bool ValidateUI() override;
|
||||
bool HideUI() override;
|
||||
|
@ -1548,8 +1548,9 @@ void LV2Effect::SetHostUI(EffectUIHostInterface *host)
|
||||
mUIHost = host;
|
||||
}
|
||||
|
||||
bool LV2Effect::PopulateUI(wxWindow *parent)
|
||||
bool LV2Effect::PopulateUI(ShuttleGui &S)
|
||||
{
|
||||
auto parent = S.GetParent();
|
||||
mParent = parent;
|
||||
|
||||
mParent->PushEventHandler(this);
|
||||
|
@ -314,7 +314,7 @@ public:
|
||||
// EffectUIClientInterface implementation
|
||||
|
||||
void SetHostUI(EffectUIHostInterface *host) override;
|
||||
bool PopulateUI(wxWindow *parent) override;
|
||||
bool PopulateUI(ShuttleGui &S) override;
|
||||
bool IsGraphicalUI() override;
|
||||
bool ValidateUI() override;
|
||||
bool HideUI() override;
|
||||
|
Loading…
x
Reference in New Issue
Block a user