26#include "../widgets/valnum.h"
52{
wxT(
"Sliding Stretch"),
XO(
"Sliding Stretch") };
69 Parameters().Reset(*
this);
71 slideTypeRate = SlideLinearOutputRate;
72 slideTypePitch = SlideLinearOutputRate;
74 previewSelectedDuration = 0.0;
76 SetLinearEffectFlag(
true);
92 return XO(
"Allows continuous changes to the tempo and/or pitch");
97 return L
"Sliding_Stretch";
112 double inputLength =
settings.extra.GetDuration();
113 if(inputLength == 0.0) {
118 double tOut = previewLength/inputLength;
120 return t * inputLength;
156 S.StartMultiColumn(2, wxALIGN_CENTER);
159 S.StartStatic(
XO(
"Initial Tempo Change (%)"));
161 S.StartMultiColumn(1, wxCENTER);
164 .Validator<FloatingPointValidator<double>>(
166 NumValidatorStyle::NO_TRAILING_ZEROES,
168 .AddTextBox( {}, L
"", 12);
171 S.StartHorizontalLay(wxEXPAND, 0);
174 .Style(wxSL_HORIZONTAL)
177 S.EndHorizontalLay();
181 S.StartStatic(
XO(
"Final Tempo Change (%)"));
183 S.StartMultiColumn(1, wxCENTER);
186 .Validator<FloatingPointValidator<double>>(
188 NumValidatorStyle::NO_TRAILING_ZEROES,
190 .AddTextBox( {}, L
"", 12);
193 S.StartHorizontalLay(wxEXPAND, 0);
196 .Style(wxSL_HORIZONTAL)
199 S.EndHorizontalLay();
204 S.StartStatic(
XO(
"Initial Pitch Shift"));
206 S.StartMultiColumn(2, wxCENTER);
209 .Validator<FloatingPointValidator<double>>(
211 NumValidatorStyle::NO_TRAILING_ZEROES,
213 .AddTextBox(
XXO(
"(&semitones) [-12 to 12]:"), L
"", 12);
217 .Validator<FloatingPointValidator<double>>(
219 NumValidatorStyle::NO_TRAILING_ZEROES,
221 .AddTextBox(
XXO(
"(%) [-50 to 100]:"), L
"", 12);
228 S.StartStatic(
XO(
"Final Pitch Shift"));
230 S.StartMultiColumn(2, wxCENTER);
233 .Validator<FloatingPointValidator<double>>(
235 NumValidatorStyle::NO_TRAILING_ZEROES,
237 .AddTextBox(
XXO(
"(s&emitones) [-12 to 12]:"), L
"", 12);
240 .Validator<FloatingPointValidator<double>>(
242 NumValidatorStyle::NO_TRAILING_ZEROES,
244 .AddTextBox(
XXO(
"(%) [-50 to 100]:"), L
"", 12);
280 return 1.0 + percentChange / 100.0;
285 return 100.0 * (pow(2.0,halfSteps/12.0) - 1.0);
XXO("&Cut/Copy/Paste Toolbar")
@ ID_RatePercentChangeEnd
@ ID_RatePercentChangeStart
@ ID_PitchPercentChangeEnd
@ ID_PitchPercentChangeStart
static Settings & settings()
Generates EffectParameterMethods overrides from variadic template arguments.
ComponentInterfaceSymbol pairs a persistent string identifier used internally with an optional,...
static bool EnableApply(wxWindow *parent, bool enable=true)
Enable or disable the Apply button of the dialog that contains parent.
Performs effect computation.
Hold values to send to effect output meters.
Interface for manipulations of an Effect's settings.
void setParameters(double rateStart, double rateEnd, double pitchStart, double pitchEnd, SlideType rateSlideType, SlideType pitchSlideType, bool bLinkRatePitch, bool bRateReferenceInput, bool bPitchReferenceInput)
static double getInvertedStretchedTime(double rateStart, double rateEnd, SlideType slideType, double outputTime)
bool Process(EffectInstance &instance, EffectSettings &settings) override
static double getRate(double rateStart, double rateEnd, SlideType slideType, double t)
An EffectTimeScale does high quality sliding time scaling/pitch shifting.
static double PercentChangeToHalfSteps(double percentChange)
TranslatableString GetDescription() const override
double m_PitchPercentChangeStart
wxTextCtrl * m_pTextCtrl_PitchHalfStepsEnd
void Update_Slider_RatePercentChangeEnd()
double CalcPreviewInputLength(const EffectSettings &settings, double previewLength) const override
bool Process(EffectInstance &instance, EffectSettings &settings) override
void OnSlider_RatePercentChangeStart(wxCommandEvent &evt)
wxSlider * m_pSlider_RatePercentChangeStart
std::any BeginPreview(const EffectSettings &settings) override
Called when Preview() starts, to allow temporary effect state changes.
static constexpr EffectParameter RatePercentEnd
static constexpr EffectParameter RatePercentStart
void Update_Text_PitchHalfStepsEnd()
void Update_Text_PitchHalfStepsStart()
static double HalfStepsToPercentChange(double halfSteps)
wxTextCtrl * m_pTextCtrl_RatePercentChangeStart
void OnText_PitchPercentChangeEnd(wxCommandEvent &evt)
wxTextCtrl * m_pTextCtrl_RatePercentChangeEnd
void OnText_PitchHalfStepsStart(wxCommandEvent &evt)
static constexpr EffectParameter HalfStepsEnd
void OnText_PitchPercentChangeStart(wxCommandEvent &evt)
void Update_Slider_RatePercentChangeStart()
double previewSelectedDuration
static constexpr EffectParameter PitchPercentEnd
void OnSlider_RatePercentChangeEnd(wxCommandEvent &evt)
EffectType GetType() const override
Type determines how it behaves.
double m_PitchHalfStepsEnd
static const ComponentInterfaceSymbol Symbol
double m_PitchHalfStepsStart
void OnText_PitchHalfStepsEnd(wxCommandEvent &evt)
std::unique_ptr< EffectEditor > PopulateOrExchange(ShuttleGui &S, EffectInstance &instance, EffectSettingsAccess &access, const EffectOutputs *pOutputs) override
Add controls to effect panel; always succeeds.
static double PercentChangeToRatio(double percentChange)
void Update_Text_PitchPercentChangeStart()
wxSlider * m_pSlider_RatePercentChangeEnd
void Update_Text_RatePercentChangeEnd()
wxWeakRef< wxWindow > mUIParent
wxTextCtrl * m_pTextCtrl_PitchHalfStepsStart
double m_PitchPercentChangeEnd
void Update_Text_RatePercentChangeStart()
void OnText_RatePercentChangeStart(wxCommandEvent &evt)
double m_RatePercentChangeEnd
bool TransferDataFromWindow(EffectSettings &settings) override
void Update_Text_PitchPercentChangeEnd()
bool TransferDataToWindow(const EffectSettings &settings) override
const EffectParameterMethods & Parameters() const override
double m_RatePercentChangeStart
static constexpr EffectParameter PitchPercentStart
wxTextCtrl * m_pTextCtrl_PitchPercentChangeStart
virtual ~EffectTimeScale()
static constexpr EffectParameter HalfStepsStart
ManualPageID ManualPage() const override
Name of a page in the Audacity alpha manual, default is empty.
void OnText_RatePercentChangeEnd(wxCommandEvent &evt)
ComponentInterfaceSymbol GetSymbol() const override
wxTextCtrl * m_pTextCtrl_PitchPercentChangeEnd
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.
Holds a msgid for the translation catalog; may also bind format arguments.
BuiltinEffectsModule::Registration< EffectTimeScale > reg
const Type def
Default value.
const Type min
Minimum value.
const Type max
Maximum value.
Externalized state of a plug-in.