Remove Effect::PromptUser...

... it was only a thin wrapper of ShowInterface when not overridden, not
clearly serving a distinct purpose.
This commit is contained in:
Paul Licameli 2019-07-24 15:08:59 -04:00
parent fb678c0eb8
commit 738c5c5e90
8 changed files with 13 additions and 19 deletions

View File

@ -1200,7 +1200,9 @@ bool Effect::DoEffect(wxWindow *parent,
// Prompting will be bypassed when applying an effect that has already
// been configured, e.g. repeating the last effect on a different selection.
// Prompting may call Effect::Preview
if (shouldPrompt && IsInteractive() && !PromptUser(parent))
if ( shouldPrompt &&
IsInteractive() &&
!ShowInterface(parent, IsBatchProcessing()) )
{
return false;
}
@ -1244,12 +1246,6 @@ bool Effect::Init()
return true;
}
// Remove this method once NoiseReduction gets migrated
bool Effect::PromptUser(wxWindow *parent)
{
return ShowInterface(parent, IsBatchProcessing());
}
int Effect::GetPass()
{
return mPass;

View File

@ -287,12 +287,6 @@ protected:
// return false otherwise
virtual bool Init();
// If necessary, open a dialog to get parameters from the user.
// This method will not always be called (for example if a user
// repeats an effect) but if it is called, it will be called
// after Init.
virtual bool PromptUser(wxWindow *parent);
// Check whether effect should be skipped
// Typically this is only useful in automation, for example
// detecting that zero noise reduction is to be done,

View File

@ -523,7 +523,7 @@ bool EffectManager::PromptUser(const PluginID & ID, wxWindow *parent)
if (effect)
{
result = effect->PromptUser(parent);
result = effect->ShowInterface( parent, effect->IsBatchProcessing() );
return result;
}

View File

@ -375,7 +375,8 @@ void EffectRack::OnEditor(wxCommandEvent & evt)
return;
}
mEffects[index]->PromptUser(GetParent());
auto pEffect = mEffects[index];
pEffect->ShowInterface( GetParent(), pEffect->IsBatchProcessing() );
}
void EffectRack::OnUp(wxCommandEvent & evt)

View File

@ -459,8 +459,10 @@ bool EffectNoiseReduction::CheckWhetherSkipEffect()
return false;
}
bool EffectNoiseReduction::PromptUser(wxWindow *parent)
bool EffectNoiseReduction::ShowInterface( wxWindow *parent, bool )
{
// to do: use forceModal correctly
// We may want to twiddle the levels if we are setting
// from an automation dialog, the only case in which we can
// get here without any wavetracks.

View File

@ -38,7 +38,7 @@ public:
// using Effect::TrackProgress;
bool PromptUser(wxWindow *parent) override;
bool ShowInterface( wxWindow *parent, bool forceModal ) override;
bool Init() override;
bool CheckWhetherSkipEffect() override;

View File

@ -149,8 +149,9 @@ bool EffectNoiseRemoval::CheckWhetherSkipEffect()
return (mLevel == 0);
}
bool EffectNoiseRemoval::PromptUser(wxWindow *parent)
bool EffectNoiseRemoval::ShowInterface( wxWindow *parent, bool /* forceModal */ )
{
// to do: use forceModal correctly
NoiseRemovalDialog dlog(this, parent);
dlog.mSensitivity = mSensitivity;
dlog.mGain = -mNoiseGain;

View File

@ -53,7 +53,7 @@ public:
// Effect implementation
bool PromptUser(wxWindow *parent) override;
bool ShowInterface( wxWindow *parent, bool forceModal ) override;
bool Init() override;
bool CheckWhetherSkipEffect() override;
bool Process() override;