Audacity 3.2.0
TimeScaleBase.h
Go to the documentation of this file.
1/**********************************************************************
2
3 Audacity: A Digital Audio Editor
4
5 TimeScaleBase.h
6
7 Clayton Otey
8
9**********************************************************************/
10#pragma once
11
12#if USE_SBSMS
13
14#include "SBSMSBase.h"
15#include "ShuttleAutomation.h"
16
17class BUILTIN_EFFECTS_API TimeScaleBase : public SBSMSBase
18{
19public:
20 static inline TimeScaleBase*
22 {
23 return &e;
24 }
26
28 virtual ~TimeScaleBase();
29
30 // ComponentInterface implementation
31
32 ComponentInterfaceSymbol GetSymbol() const override;
33 TranslatableString GetDescription() const override;
34 ManualPageID ManualPage() const override;
35
36 // EffectDefinitionInterface implementation
37
38 EffectType GetType() const override;
39
40 // Effect implementation
41
42 std::any BeginPreview(const EffectSettings& settings) override;
43 bool Process(EffectInstance& instance, EffectSettings& settings) override;
45 const EffectSettings& settings, double previewLength) const override;
46
47protected:
48 // TimeScaleBase implementation
49
50 static double PercentChangeToRatio(double percentChange);
51 static double HalfStepsToPercentChange(double halfSteps);
52 static double PercentChangeToHalfSteps(double percentChange);
53
56 SlideType slideTypeRate;
57 SlideType slideTypePitch;
64
65 const EffectParameterMethods& Parameters() const override;
66
67 static constexpr EffectParameter RatePercentStart {
69 L"RatePercentChangeStart",
70 0.0,
71 -90.0,
72 500,
73 1
74 };
75 static constexpr EffectParameter RatePercentEnd {
77 L"RatePercentChangeEnd",
78 0.0,
79 -90.0,
80 500,
81 1
82 };
83 static constexpr EffectParameter HalfStepsStart {
85 L"PitchHalfStepsStart",
86 0.0,
87 -12.0,
88 12.0,
89 1
90 };
91 static constexpr EffectParameter HalfStepsEnd {
93 L"PitchHalfStepsEnd",
94 0.0,
95 -12.0,
96 12.0,
97 1
98 };
99 static constexpr EffectParameter PitchPercentStart {
101 L"PitchPercentChangeStart",
102 0.0,
103 -50.0,
104 100.0,
105 1
106 };
107 static constexpr EffectParameter PitchPercentEnd {
109 L"PitchPercentChangeEnd",
110 0.0,
111 -50.0,
112 100.0,
113 1
114 };
115};
116
117#endif // USE_SBSMS
EffectType
static Settings & settings()
Definition: TrackInfo.cpp:51
ComponentInterfaceSymbol pairs a persistent string identifier used internally with an optional,...
virtual std::any BeginPreview(const EffectSettings &settings)
Called when Preview() starts, to allow temporary effect state changes.
Definition: EffectBase.cpp:234
virtual ManualPageID ManualPage() const
Name of a page in the Audacity alpha manual, default is empty.
virtual const EffectParameterMethods & Parameters() const
Definition: Effect.cpp:96
TranslatableString GetDescription() const override
Definition: Effect.cpp:64
double CalcPreviewInputLength(const EffectSettings &settings, double previewLength) const override
Default implementation returns previewLength
Definition: Effect.cpp:384
Performs effect computation.
Interface for manipulations of an Effect's settings.
ComponentInterfaceSymbol GetSymbol() const override
Definition: SBSMSBase.h:45
bool Process(EffectInstance &instance, EffectSettings &settings) override
Definition: SBSMSBase.cpp:226
EffectType GetType() const override
Type determines how it behaves.
Definition: SBSMSBase.cpp:198
An TimeScaleBase does high quality sliding time scaling/pitch shifting.
Definition: TimeScaleBase.h:18
double m_PitchHalfStepsStart
Definition: TimeScaleBase.h:60
double m_RatePercentChangeStart
Definition: TimeScaleBase.h:58
double m_PitchPercentChangeStart
Definition: TimeScaleBase.h:62
double m_RatePercentChangeEnd
Definition: TimeScaleBase.h:59
SlideType slideTypePitch
Definition: TimeScaleBase.h:57
double m_PitchPercentChangeEnd
Definition: TimeScaleBase.h:63
static TimeScaleBase * FetchParameters(TimeScaleBase &e, EffectSettings &)
Definition: TimeScaleBase.h:21
static const ComponentInterfaceSymbol Symbol
Definition: TimeScaleBase.h:25
double previewSelectedDuration
Definition: TimeScaleBase.h:55
double m_PitchHalfStepsEnd
Definition: TimeScaleBase.h:61
SlideType slideTypeRate
Definition: TimeScaleBase.h:56
Holds a msgid for the translation catalog; may also bind format arguments.
Externalized state of a plug-in.