1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-12-19 23:21:33 +01:00

Migrating the remaining effects

This brings the builtin, LV2, and VAMP effects inline with the
Audio Units, LADSPA, and VST effects.  All effects now share
a common UI.

This gives all effects (though not implemented for all):

User and factory preset capability
Preset import/export capability
Shared or private configuration options

Builtin effects can now be migrated to RTP, depending on algorithm.
LV2 effects now support graphical interfaces if the plugin supplies one.
Nyquist prompt enhanced to provide some features of the Nyquist Workbench.

It may not look like it, but this was a LOT of work, so trust me, there
WILL be problems and everything effect related should be suspect.  Keep
a sharp eye (or two) open.
This commit is contained in:
Leland Lucius
2015-04-16 22:53:42 -05:00
parent 40e6bcc56a
commit 8fbfa460c4
140 changed files with 17288 additions and 20367 deletions

View File

@@ -15,6 +15,7 @@
#if wxUSE_VALIDATORS
#include <wx/textctrl.h>
#include <wx/validate.h>
#include <limits>
@@ -43,19 +44,23 @@ public:
// Change the validator style. Usually it's specified during construction.
void SetStyle(int style) { m_style = style; }
// Called when the value in the window must be validated.
// This function can pop up an error message.
virtual bool Validate(wxWindow * parent);
// Called when the value in the window must be validated.
// This function can pop up an error message.
virtual bool Validate(wxWindow * parent);
protected:
NumValidatorBase(int style)
{
m_style = style;
m_minSet = false;
m_maxSet = false;
}
NumValidatorBase(const NumValidatorBase& other) : wxValidator()
{
m_style = other.m_style;
m_minSet = other.m_minSet;
m_maxSet = other.m_maxSet;
}
bool HasFlag(NumValidatorStyle style) const
@@ -85,6 +90,9 @@ protected:
return val;
}
bool m_minSet;
bool m_maxSet;
private:
// Check whether the specified character can be inserted in the control at
// the given position in the string representing the current controls
@@ -97,14 +105,15 @@ private:
// NormalizeString the contents of the string if it's a valid number, return
// empty string otherwise.
virtual wxString NormalizeString(const wxString& s) const = 0;
// Do all checks to ensure this is a valid value.
// Returns 'true' if the control has valid value.
// Otherwise the cause is indicated in 'errMsg'.
virtual bool DoValidateNumber(wxString * errMsg) const = 0;
// Do all checks to ensure this is a valid value.
// Returns 'true' if the control has valid value.
// Otherwise the cause is indicated in 'errMsg'.
virtual bool DoValidateNumber(wxString * errMsg) const = 0;
// Event handlers.
void OnChar(wxKeyEvent& event);
void OnPaste(wxClipboardTextEvent& event);
void OnKillFocus(wxFocusEvent& event);
@@ -115,7 +124,6 @@ private:
// Combination of wxVAL_NUM_XXX values.
int m_style;
DECLARE_EVENT_TABLE();
DECLARE_NO_ASSIGN_CLASS(NumValidatorBase);
@@ -158,11 +166,13 @@ public:
void SetMin(ValueType min)
{
this->DoSetMin(min);
BaseValidator::m_minSet = true;
}
void SetMax(ValueType max)
{
this->DoSetMax(max);
BaseValidator::m_maxSet = true;
}
void SetRange(ValueType min, ValueType max)
@@ -179,7 +189,7 @@ public:
if ( !control )
return false;
control->SetValue(NormalizeValue(*m_value));
control->ChangeValue(NormalizeValue(*m_value));
}
return true;
@@ -193,6 +203,10 @@ public:
if ( !control )
return false;
// If window is disabled, simply return
if ( !control->IsEnabled() )
return true;
const wxString s(control->GetValue());
LongestValueType value;
if ( s.empty() && BaseValidator::HasFlag(NUM_VAL_ZERO_AS_BLANK) )
@@ -397,9 +411,9 @@ protected:
// Implement NumValidatorBase pure virtual method.
virtual bool IsCharOk(const wxString& val, int pos, wxChar ch) const;
virtual bool DoValidateNumber(wxString * errMsg) const;
//Checks that it doesn't have too many decimal digits.
bool ValidatePrecision(const wxString& s) const;
//Checks that it doesn't have too many decimal digits.
bool ValidatePrecision(const wxString& s) const;
private:
// Maximum number of decimals digits after the decimal separator.