mirror of
https://github.com/cookiengineer/audacity
synced 2025-07-11 22:27:42 +02:00
Eliminate GetActiveProject in EffectUI.cpp, with some behavior changes
This commit is contained in:
commit
79bc14b2cf
@ -142,7 +142,8 @@ class AUDACITY_DLL_API EffectClientInterface /* not final */ : public EffectDef
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
using EffectDialogFactory = std::function<
|
using EffectDialogFactory = std::function<
|
||||||
wxDialog* ( wxWindow*, EffectHostInterface*, EffectUIClientInterface* )
|
wxDialog* ( wxWindow &parent,
|
||||||
|
EffectHostInterface*, EffectUIClientInterface* )
|
||||||
>;
|
>;
|
||||||
|
|
||||||
virtual ~EffectClientInterface() {};
|
virtual ~EffectClientInterface() {};
|
||||||
@ -179,7 +180,7 @@ public:
|
|||||||
virtual bool RealtimeProcessEnd() = 0;
|
virtual bool RealtimeProcessEnd() = 0;
|
||||||
|
|
||||||
virtual bool ShowInterface(
|
virtual bool ShowInterface(
|
||||||
wxWindow *parent, const EffectDialogFactory &factory,
|
wxWindow &parent, const EffectDialogFactory &factory,
|
||||||
bool forceModal = false
|
bool forceModal = false
|
||||||
) = 0;
|
) = 0;
|
||||||
// Some effects will use define params to define what parameters they take.
|
// Some effects will use define params to define what parameters they take.
|
||||||
|
@ -218,7 +218,7 @@ void MacroCommandDialog::OnEditParams(wxCommandEvent & WXUNUSED(event))
|
|||||||
auto command = mInternalCommandName;
|
auto command = mInternalCommandName;
|
||||||
wxString params = mParameters->GetValue();
|
wxString params = mParameters->GetValue();
|
||||||
|
|
||||||
params = MacroCommands::PromptForParamsFor(command, params, this).Trim();
|
params = MacroCommands::PromptForParamsFor(command, params, *this).Trim();
|
||||||
|
|
||||||
mParameters->SetValue(params);
|
mParameters->SetValue(params);
|
||||||
mParameters->Refresh();
|
mParameters->Refresh();
|
||||||
|
@ -438,7 +438,8 @@ wxString MacroCommands::GetCurrentParamsFor(const CommandID & command)
|
|||||||
return EffectManager::Get().GetEffectParameters(ID);
|
return EffectManager::Get().GetEffectParameters(ID);
|
||||||
}
|
}
|
||||||
|
|
||||||
wxString MacroCommands::PromptForParamsFor(const CommandID & command, const wxString & params, wxWindow *parent)
|
wxString MacroCommands::PromptForParamsFor(
|
||||||
|
const CommandID & command, const wxString & params, wxWindow &parent)
|
||||||
{
|
{
|
||||||
const PluginID & ID =
|
const PluginID & ID =
|
||||||
EffectManager::Get().GetEffectByIdentifier(command);
|
EffectManager::Get().GetEffectByIdentifier(command);
|
||||||
|
@ -95,7 +95,8 @@ class MacroCommands final {
|
|||||||
static wxArrayStringEx GetNamesOfDefaultMacros();
|
static wxArrayStringEx GetNamesOfDefaultMacros();
|
||||||
|
|
||||||
static wxString GetCurrentParamsFor(const CommandID & command);
|
static wxString GetCurrentParamsFor(const CommandID & command);
|
||||||
static wxString PromptForParamsFor(const CommandID & command, const wxString & params, wxWindow *parent);
|
static wxString PromptForParamsFor(
|
||||||
|
const CommandID & command, const wxString & params, wxWindow &parent);
|
||||||
static wxString PromptForPresetFor(const CommandID & command, const wxString & params, wxWindow *parent);
|
static wxString PromptForPresetFor(const CommandID & command, const wxString & params, wxWindow *parent);
|
||||||
|
|
||||||
// These commands do depend on the command list.
|
// These commands do depend on the command list.
|
||||||
|
@ -1104,7 +1104,7 @@ void MacrosWindow::OnEditCommandParams(wxCommandEvent & WXUNUSED(event))
|
|||||||
auto command = mMacroCommands.GetCommand(item);
|
auto command = mMacroCommands.GetCommand(item);
|
||||||
wxString params = mMacroCommands.GetParams(item);
|
wxString params = mMacroCommands.GetParams(item);
|
||||||
|
|
||||||
params = MacroCommands::PromptForParamsFor(command, params, this).Trim();
|
params = MacroCommands::PromptForParamsFor(command, params, *this).Trim();
|
||||||
Raise();
|
Raise();
|
||||||
|
|
||||||
mMacroCommands.DeleteFromMacro(item);
|
mMacroCommands.DeleteFromMacro(item);
|
||||||
|
@ -215,7 +215,7 @@ bool EffectChangePitch::Process()
|
|||||||
proxy.mProxyEffectName = XO("High Quality Pitch Change");
|
proxy.mProxyEffectName = XO("High Quality Pitch Change");
|
||||||
proxy.setParameters(1.0, pitchRatio);
|
proxy.setParameters(1.0, pitchRatio);
|
||||||
|
|
||||||
return Delegate(proxy, mUIParent, nullptr);
|
return Delegate(proxy, *mUIParent, nullptr);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
|
@ -200,7 +200,7 @@ bool EffectChangeTempo::Process()
|
|||||||
EffectSBSMS proxy;
|
EffectSBSMS proxy;
|
||||||
proxy.mProxyEffectName = XO("High Quality Tempo Change");
|
proxy.mProxyEffectName = XO("High Quality Tempo Change");
|
||||||
proxy.setParameters(tempoRatio, 1.0);
|
proxy.setParameters(tempoRatio, 1.0);
|
||||||
success = Delegate(proxy, mUIParent, nullptr);
|
success = Delegate(proxy, *mUIParent, nullptr);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
|
@ -478,7 +478,7 @@ bool Effect::RealtimeProcessEnd()
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Effect::ShowInterface(wxWindow *parent,
|
bool Effect::ShowInterface(wxWindow &parent,
|
||||||
const EffectDialogFactory &factory, bool forceModal)
|
const EffectDialogFactory &factory, bool forceModal)
|
||||||
{
|
{
|
||||||
if (!IsInteractive())
|
if (!IsInteractive())
|
||||||
@ -1091,7 +1091,7 @@ void Effect::SetBatchProcessing(bool start)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Effect::DoEffect(wxWindow *parent,
|
bool Effect::DoEffect(wxWindow &parent,
|
||||||
double projectRate,
|
double projectRate,
|
||||||
TrackList *list,
|
TrackList *list,
|
||||||
TrackFactory *factory,
|
TrackFactory *factory,
|
||||||
@ -1214,7 +1214,7 @@ bool Effect::DoEffect(wxWindow *parent,
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool Effect::Delegate(
|
bool Effect::Delegate(
|
||||||
Effect &delegate, wxWindow *parent, const EffectDialogFactory &factory )
|
Effect &delegate, wxWindow &parent, const EffectDialogFactory &factory )
|
||||||
{
|
{
|
||||||
NotifyingSelectedRegion region;
|
NotifyingSelectedRegion region;
|
||||||
region.setTimes( mT0, mT1 );
|
region.setTimes( mT0, mT1 );
|
||||||
|
@ -142,7 +142,7 @@ class AUDACITY_DLL_API Effect /* not final */ : public wxEvtHandler,
|
|||||||
size_t numSamples) override;
|
size_t numSamples) override;
|
||||||
bool RealtimeProcessEnd() override;
|
bool RealtimeProcessEnd() override;
|
||||||
|
|
||||||
bool ShowInterface( wxWindow *parent,
|
bool ShowInterface( wxWindow &parent,
|
||||||
const EffectDialogFactory &factory, bool forceModal = false) override;
|
const EffectDialogFactory &factory, bool forceModal = false) override;
|
||||||
|
|
||||||
bool GetAutomationParameters(CommandParameters & parms) override;
|
bool GetAutomationParameters(CommandParameters & parms) override;
|
||||||
@ -255,12 +255,12 @@ class AUDACITY_DLL_API Effect /* not final */ : public wxEvtHandler,
|
|||||||
// have the "selected" flag set to true, which is consistent with
|
// have the "selected" flag set to true, which is consistent with
|
||||||
// Audacity's standard UI.
|
// Audacity's standard UI.
|
||||||
// Create a user interface only if the supplied function is not null.
|
// Create a user interface only if the supplied function is not null.
|
||||||
/* not virtual */ bool DoEffect(wxWindow *parent, double projectRate, TrackList *list,
|
/* not virtual */ bool DoEffect(wxWindow &parent, double projectRate, TrackList *list,
|
||||||
TrackFactory *factory, NotifyingSelectedRegion &selectedRegion,
|
TrackFactory *factory, NotifyingSelectedRegion &selectedRegion,
|
||||||
const EffectDialogFactory &dialogFactory );
|
const EffectDialogFactory &dialogFactory );
|
||||||
|
|
||||||
bool Delegate( Effect &delegate,
|
bool Delegate( Effect &delegate,
|
||||||
wxWindow *parent, const EffectDialogFactory &factory );
|
wxWindow &parent, const EffectDialogFactory &factory );
|
||||||
|
|
||||||
virtual bool IsHidden();
|
virtual bool IsHidden();
|
||||||
|
|
||||||
|
@ -326,7 +326,7 @@ bool EffectManager::SetEffectParameters(const PluginID & ID, const wxString & pa
|
|||||||
|
|
||||||
bool EffectManager::PromptUser(
|
bool EffectManager::PromptUser(
|
||||||
const PluginID & ID,
|
const PluginID & ID,
|
||||||
const EffectClientInterface::EffectDialogFactory &factory, wxWindow *parent)
|
const EffectClientInterface::EffectDialogFactory &factory, wxWindow &parent)
|
||||||
{
|
{
|
||||||
bool result = false;
|
bool result = false;
|
||||||
Effect *effect = GetEffect(ID);
|
Effect *effect = GetEffect(ID);
|
||||||
@ -342,7 +342,7 @@ bool EffectManager::PromptUser(
|
|||||||
|
|
||||||
if (command)
|
if (command)
|
||||||
{
|
{
|
||||||
result = command->PromptUser(parent);
|
result = command->PromptUser(&parent);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -107,7 +107,7 @@ public:
|
|||||||
bool SetEffectParameters(const PluginID & ID, const wxString & params);
|
bool SetEffectParameters(const PluginID & ID, const wxString & params);
|
||||||
bool PromptUser( const PluginID & ID,
|
bool PromptUser( const PluginID & ID,
|
||||||
const EffectClientInterface::EffectDialogFactory &factory,
|
const EffectClientInterface::EffectDialogFactory &factory,
|
||||||
wxWindow *parent );
|
wxWindow &parent );
|
||||||
bool HasPresets(const PluginID & ID);
|
bool HasPresets(const PluginID & ID);
|
||||||
wxString GetPreset(const PluginID & ID, const wxString & params, wxWindow * parent);
|
wxString GetPreset(const PluginID & ID, const wxString & params, wxWindow * parent);
|
||||||
wxString GetDefaultPreset(const PluginID & ID);
|
wxString GetDefaultPreset(const PluginID & ID);
|
||||||
|
@ -19,6 +19,7 @@
|
|||||||
#include "Effect.h"
|
#include "Effect.h"
|
||||||
#include "EffectManager.h"
|
#include "EffectManager.h"
|
||||||
#include "../ProjectHistory.h"
|
#include "../ProjectHistory.h"
|
||||||
|
#include "../ProjectWindowBase.h"
|
||||||
#include "../TrackPanelAx.h"
|
#include "../TrackPanelAx.h"
|
||||||
#include "RealtimeEffectManager.h"
|
#include "RealtimeEffectManager.h"
|
||||||
|
|
||||||
@ -377,7 +378,7 @@ void EffectRack::OnEditor(wxCommandEvent & evt)
|
|||||||
}
|
}
|
||||||
|
|
||||||
auto pEffect = mEffects[index];
|
auto pEffect = mEffects[index];
|
||||||
pEffect->ShowInterface( GetParent(), EffectUI::DialogFactory,
|
pEffect->ShowInterface( *GetParent(), EffectUI::DialogFactory,
|
||||||
pEffect->IsBatchProcessing() );
|
pEffect->IsBatchProcessing() );
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -716,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(),
|
||||||
@ -735,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;
|
||||||
@ -749,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()*/,
|
||||||
@ -768,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;
|
||||||
@ -1128,6 +1131,8 @@ void EffectUIHost::OnClose(wxCloseEvent & WXUNUSED(evt))
|
|||||||
|
|
||||||
void EffectUIHost::OnApply(wxCommandEvent & evt)
|
void EffectUIHost::OnApply(wxCommandEvent & evt)
|
||||||
{
|
{
|
||||||
|
auto &project = *mProject;
|
||||||
|
|
||||||
// On wxGTK (wx2.8.12), the default action is still executed even if
|
// On wxGTK (wx2.8.12), the default action is still executed even if
|
||||||
// the button is disabled. This appears to affect all wxDialogs, not
|
// the button is disabled. This appears to affect all wxDialogs, not
|
||||||
// just our Effects dialogs. So, this is a only temporary workaround
|
// just our Effects dialogs. So, this is a only temporary workaround
|
||||||
@ -1143,14 +1148,14 @@ void EffectUIHost::OnApply(wxCommandEvent & evt)
|
|||||||
mEffect &&
|
mEffect &&
|
||||||
mEffect->GetType() != EffectTypeGenerate &&
|
mEffect->GetType() != EffectTypeGenerate &&
|
||||||
mEffect->GetType() != EffectTypeTool &&
|
mEffect->GetType() != EffectTypeTool &&
|
||||||
ViewInfo::Get( *mProject ).selectedRegion.isPoint())
|
ViewInfo::Get( project ).selectedRegion.isPoint())
|
||||||
{
|
{
|
||||||
auto flags = AlwaysEnabledFlag;
|
auto flags = AlwaysEnabledFlag;
|
||||||
bool allowed =
|
bool allowed =
|
||||||
MenuManager::Get(*mProject).ReportIfActionNotAllowed(
|
MenuManager::Get( project ).ReportIfActionNotAllowed(
|
||||||
mEffect->GetName(),
|
mEffect->GetName(),
|
||||||
flags,
|
flags,
|
||||||
WaveTracksSelectedFlag | TimeSelectedFlag);
|
WaveTracksSelectedFlag | TimeSelectedFlag);
|
||||||
if (!allowed)
|
if (!allowed)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -1191,7 +1196,6 @@ void EffectUIHost::OnApply(wxCommandEvent & evt)
|
|||||||
auto cleanup = finally( [&] { mApplyBtn->Enable(); } );
|
auto cleanup = finally( [&] { mApplyBtn->Enable(); } );
|
||||||
|
|
||||||
if( mEffect ) {
|
if( mEffect ) {
|
||||||
auto &project = *GetActiveProject();
|
|
||||||
CommandContext context( project );
|
CommandContext context( project );
|
||||||
// This is absolute hackage...but easy and I can't think of another way just now.
|
// This is absolute hackage...but easy and I can't think of another way just now.
|
||||||
//
|
//
|
||||||
@ -1203,7 +1207,7 @@ void EffectUIHost::OnApply(wxCommandEvent & evt)
|
|||||||
if( mCommand )
|
if( mCommand )
|
||||||
// PRL: I don't like the global and would rather pass *mProject!
|
// PRL: I don't like the global and would rather pass *mProject!
|
||||||
// But I am preserving old behavior
|
// But I am preserving old behavior
|
||||||
mCommand->Apply( CommandContext{ *GetActiveProject() } );
|
mCommand->Apply( CommandContext{ project } );
|
||||||
}
|
}
|
||||||
|
|
||||||
void EffectUIHost::DoCancel()
|
void EffectUIHost::DoCancel()
|
||||||
@ -1812,15 +1816,22 @@ void EffectUIHost::CleanupRealtime()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
wxDialog *EffectUI::DialogFactory( wxWindow *parent, EffectHostInterface *pHost,
|
wxDialog *EffectUI::DialogFactory( wxWindow &parent, EffectHostInterface *pHost,
|
||||||
EffectUIClientInterface *client)
|
EffectUIClientInterface *client)
|
||||||
{
|
{
|
||||||
auto pEffect = dynamic_cast< Effect* >( pHost );
|
auto pEffect = dynamic_cast< Effect* >( pHost );
|
||||||
if ( ! pEffect )
|
if ( ! pEffect )
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|
||||||
|
// Make sure there is an associated project, whose lifetime will
|
||||||
|
// govern the lifetime of the dialog, even when the dialog is
|
||||||
|
// non-modal, as for realtime effects
|
||||||
|
auto project = FindProjectFromWindow(&parent);
|
||||||
|
if ( !project )
|
||||||
|
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())
|
||||||
{
|
{
|
||||||
@ -1913,7 +1924,7 @@ wxDialog *EffectUI::DialogFactory( wxWindow *parent, EffectHostInterface *pHost,
|
|||||||
EffectRack::Get( context.project ).Add(effect);
|
EffectRack::Get( context.project ).Add(effect);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
success = effect->DoEffect(&window,
|
success = effect->DoEffect(window,
|
||||||
rate,
|
rate,
|
||||||
&tracks,
|
&tracks,
|
||||||
&trackFactory,
|
&trackFactory,
|
||||||
|
@ -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();
|
||||||
@ -216,7 +218,7 @@ class CommandContext;
|
|||||||
|
|
||||||
namespace EffectUI {
|
namespace EffectUI {
|
||||||
|
|
||||||
wxDialog *DialogFactory( wxWindow *parent, EffectHostInterface *pHost,
|
wxDialog *DialogFactory( wxWindow &parent, EffectHostInterface *pHost,
|
||||||
EffectUIClientInterface *client);
|
EffectUIClientInterface *client);
|
||||||
|
|
||||||
/** Run an effect given the plugin ID */
|
/** Run an effect given the plugin ID */
|
||||||
|
@ -210,7 +210,7 @@ public:
|
|||||||
~Settings() {}
|
~Settings() {}
|
||||||
|
|
||||||
bool PromptUser(EffectNoiseReduction *effect,
|
bool PromptUser(EffectNoiseReduction *effect,
|
||||||
wxWindow *parent, bool bHasProfile, bool bAllowTwiddleSettings);
|
wxWindow &parent, bool bHasProfile, bool bAllowTwiddleSettings);
|
||||||
bool PrefsIO(bool read);
|
bool PrefsIO(bool read);
|
||||||
bool Validate(EffectNoiseReduction *effect) const;
|
bool Validate(EffectNoiseReduction *effect) const;
|
||||||
|
|
||||||
@ -460,7 +460,7 @@ bool EffectNoiseReduction::CheckWhetherSkipEffect()
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool EffectNoiseReduction::ShowInterface(
|
bool EffectNoiseReduction::ShowInterface(
|
||||||
wxWindow *parent, const EffectDialogFactory &, bool forceModal)
|
wxWindow &parent, const EffectDialogFactory &, bool forceModal)
|
||||||
{
|
{
|
||||||
// to do: use forceModal correctly
|
// to do: use forceModal correctly
|
||||||
|
|
||||||
@ -474,11 +474,11 @@ bool EffectNoiseReduction::ShowInterface(
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool EffectNoiseReduction::Settings::PromptUser
|
bool EffectNoiseReduction::Settings::PromptUser
|
||||||
(EffectNoiseReduction *effect, wxWindow *parent,
|
(EffectNoiseReduction *effect, wxWindow &parent,
|
||||||
bool bHasProfile, bool bAllowTwiddleSettings)
|
bool bHasProfile, bool bAllowTwiddleSettings)
|
||||||
{
|
{
|
||||||
EffectNoiseReduction::Dialog dlog
|
EffectNoiseReduction::Dialog dlog
|
||||||
(effect, this, parent, bHasProfile, bAllowTwiddleSettings);
|
(effect, this, &parent, bHasProfile, bAllowTwiddleSettings);
|
||||||
|
|
||||||
dlog.CentreOnParent();
|
dlog.CentreOnParent();
|
||||||
dlog.ShowModal();
|
dlog.ShowModal();
|
||||||
|
@ -38,7 +38,7 @@ public:
|
|||||||
|
|
||||||
// using Effect::TrackProgress;
|
// using Effect::TrackProgress;
|
||||||
|
|
||||||
bool ShowInterface( wxWindow *parent,
|
bool ShowInterface( wxWindow &parent,
|
||||||
const EffectDialogFactory &factory, bool forceModal = false) override;
|
const EffectDialogFactory &factory, bool forceModal = false) override;
|
||||||
|
|
||||||
bool Init() override;
|
bool Init() override;
|
||||||
|
@ -150,10 +150,10 @@ bool EffectNoiseRemoval::CheckWhetherSkipEffect()
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool EffectNoiseRemoval::ShowInterface(
|
bool EffectNoiseRemoval::ShowInterface(
|
||||||
wxWindow *parent, const EffectDialogFactory &, bool forceModal /* forceModal */ )
|
wxWindow &parent, const EffectDialogFactory &, bool forceModal /* forceModal */ )
|
||||||
{
|
{
|
||||||
// to do: use forceModal correctly
|
// to do: use forceModal correctly
|
||||||
NoiseRemovalDialog dlog(this, parent);
|
NoiseRemovalDialog dlog(this, &parent);
|
||||||
dlog.mSensitivity = mSensitivity;
|
dlog.mSensitivity = mSensitivity;
|
||||||
dlog.mGain = -mNoiseGain;
|
dlog.mGain = -mNoiseGain;
|
||||||
dlog.mFreq = mFreqSmoothingHz;
|
dlog.mFreq = mFreqSmoothingHz;
|
||||||
|
@ -53,7 +53,7 @@ public:
|
|||||||
|
|
||||||
// Effect implementation
|
// Effect implementation
|
||||||
|
|
||||||
bool ShowInterface( wxWindow *parent,
|
bool ShowInterface( wxWindow &parent,
|
||||||
const EffectDialogFactory &factory, bool forceModal = false) override;
|
const EffectDialogFactory &factory, bool forceModal = false) override;
|
||||||
bool Init() override;
|
bool Init() override;
|
||||||
bool CheckWhetherSkipEffect() override;
|
bool CheckWhetherSkipEffect() override;
|
||||||
|
@ -1602,7 +1602,7 @@ bool VSTEffect::RealtimeProcessEnd()
|
|||||||
/// all provide the information (kn0ck0ut is one).
|
/// all provide the information (kn0ck0ut is one).
|
||||||
///
|
///
|
||||||
bool VSTEffect::ShowInterface(
|
bool VSTEffect::ShowInterface(
|
||||||
wxWindow *parent, const EffectDialogFactory &factory, bool forceModal)
|
wxWindow &parent, const EffectDialogFactory &factory, bool forceModal)
|
||||||
{
|
{
|
||||||
if (mDialog)
|
if (mDialog)
|
||||||
{
|
{
|
||||||
|
@ -151,7 +151,7 @@ class VSTEffect final : public wxEvtHandler,
|
|||||||
size_t numSamples) override;
|
size_t numSamples) override;
|
||||||
bool RealtimeProcessEnd() override;
|
bool RealtimeProcessEnd() override;
|
||||||
|
|
||||||
bool ShowInterface( wxWindow *parent,
|
bool ShowInterface( wxWindow &parent,
|
||||||
const EffectDialogFactory &factory, bool forceModal = false) override;
|
const EffectDialogFactory &factory, bool forceModal = false) override;
|
||||||
|
|
||||||
bool GetAutomationParameters(CommandParameters & parms) override;
|
bool GetAutomationParameters(CommandParameters & parms) override;
|
||||||
|
@ -1429,7 +1429,7 @@ bool AudioUnitEffect::RealtimeProcessEnd()
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool AudioUnitEffect::ShowInterface(
|
bool AudioUnitEffect::ShowInterface(
|
||||||
wxWindow *parent, const EffectDialogFactory &factory, bool forceModal)
|
wxWindow &parent, const EffectDialogFactory &factory, bool forceModal)
|
||||||
{
|
{
|
||||||
if (mDialog)
|
if (mDialog)
|
||||||
{
|
{
|
||||||
|
@ -101,7 +101,7 @@ public:
|
|||||||
size_t numSamples) override;
|
size_t numSamples) override;
|
||||||
bool RealtimeProcessEnd() override;
|
bool RealtimeProcessEnd() override;
|
||||||
|
|
||||||
bool ShowInterface( wxWindow *parent,
|
bool ShowInterface( wxWindow &parent,
|
||||||
const EffectDialogFactory &factory, bool forceModal = false) override;
|
const EffectDialogFactory &factory, bool forceModal = false) override;
|
||||||
|
|
||||||
bool GetAutomationParameters(CommandParameters & parms) override;
|
bool GetAutomationParameters(CommandParameters & parms) override;
|
||||||
|
@ -1071,7 +1071,7 @@ bool LadspaEffect::RealtimeProcessEnd()
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool LadspaEffect::ShowInterface(
|
bool LadspaEffect::ShowInterface(
|
||||||
wxWindow *parent, const EffectDialogFactory &factory, bool forceModal)
|
wxWindow &parent, const EffectDialogFactory &factory, bool forceModal)
|
||||||
{
|
{
|
||||||
if (mDialog)
|
if (mDialog)
|
||||||
{
|
{
|
||||||
|
@ -99,7 +99,7 @@ public:
|
|||||||
size_t numSamples) override;
|
size_t numSamples) override;
|
||||||
bool RealtimeProcessEnd() override;
|
bool RealtimeProcessEnd() override;
|
||||||
|
|
||||||
bool ShowInterface( wxWindow *parent,
|
bool ShowInterface( wxWindow &parent,
|
||||||
const EffectDialogFactory &factory, bool forceModal = false) override;
|
const EffectDialogFactory &factory, bool forceModal = false) override;
|
||||||
|
|
||||||
bool GetAutomationParameters(CommandParameters & parms) override;
|
bool GetAutomationParameters(CommandParameters & parms) override;
|
||||||
|
@ -1440,7 +1440,7 @@ bool LV2Effect::RealtimeProcessEnd()
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool LV2Effect::ShowInterface(
|
bool LV2Effect::ShowInterface(
|
||||||
wxWindow *parent, const EffectDialogFactory &factory, bool forceModal)
|
wxWindow &parent, const EffectDialogFactory &factory, bool forceModal)
|
||||||
{
|
{
|
||||||
if (mDialog)
|
if (mDialog)
|
||||||
{
|
{
|
||||||
|
@ -305,7 +305,7 @@ public:
|
|||||||
size_t RealtimeProcess(int group, float **inbuf, float **outbuf, size_t numSamples) override;
|
size_t RealtimeProcess(int group, float **inbuf, float **outbuf, size_t numSamples) override;
|
||||||
bool RealtimeProcessEnd() override;
|
bool RealtimeProcessEnd() override;
|
||||||
|
|
||||||
bool ShowInterface( wxWindow *parent,
|
bool ShowInterface( wxWindow &parent,
|
||||||
const EffectDialogFactory &factory, bool forceModal = false) override;
|
const EffectDialogFactory &factory, bool forceModal = false) override;
|
||||||
|
|
||||||
bool GetAutomationParameters(CommandParameters & parms) override;
|
bool GetAutomationParameters(CommandParameters & parms) override;
|
||||||
|
@ -977,7 +977,7 @@ finish:
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool NyquistEffect::ShowInterface(
|
bool NyquistEffect::ShowInterface(
|
||||||
wxWindow *parent, const EffectDialogFactory &factory, bool forceModal)
|
wxWindow &parent, const EffectDialogFactory &factory, bool forceModal)
|
||||||
{
|
{
|
||||||
// Show the normal (prompt or effect) interface
|
// Show the normal (prompt or effect) interface
|
||||||
bool res = Effect::ShowInterface(parent, factory, forceModal);
|
bool res = Effect::ShowInterface(parent, factory, forceModal);
|
||||||
|
@ -99,7 +99,7 @@ public:
|
|||||||
bool Init() override;
|
bool Init() override;
|
||||||
bool CheckWhetherSkipEffect() override;
|
bool CheckWhetherSkipEffect() override;
|
||||||
bool Process() override;
|
bool Process() override;
|
||||||
bool ShowInterface( wxWindow *parent,
|
bool ShowInterface( wxWindow &parent,
|
||||||
const EffectDialogFactory &factory, bool forceModal = false) override;
|
const EffectDialogFactory &factory, bool forceModal = false) override;
|
||||||
void PopulateOrExchange(ShuttleGui & S) override;
|
void PopulateOrExchange(ShuttleGui & S) override;
|
||||||
bool TransferDataToWindow() override;
|
bool TransferDataToWindow() override;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user