Audacity 3.2.0
PaulstretchBase.h
Go to the documentation of this file.
1/**********************************************************************
2
3 Audacity: A Digital Audio Editor
4 PaulstretchBase.h
5
6 Nasca Octavian Paul (Paul Nasca)
7
8 **********************************************************************/
9#pragma once
10
11#include "ShuttleAutomation.h"
12#include "StatefulEffect.h"
13#include <cfloat>
14
15class WaveChannel;
16
17class BUILTIN_EFFECTS_API PaulstretchBase : public StatefulEffect
18{
19public:
20 static inline PaulstretchBase*
22 {
23 return &e;
24 }
26
28 virtual ~PaulstretchBase();
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
43 const EffectSettings& settings, double previewLength) const override;
44 bool Process(EffectInstance& instance, EffectSettings& settings) override;
45
46protected:
47 // PaulstretchBase implementation
48
49 size_t GetBufferSize(double rate) const;
50
51 bool ProcessOne(
52 const WaveChannel& track, WaveChannel& outputTrack, double t0, double t1,
53 int count);
54
55 float mAmount;
56 float mTime_resolution; // seconds
57
58 const EffectParameterMethods& Parameters() const override;
59
60 static constexpr EffectParameter Amount {
61 &PaulstretchBase::mAmount, L"Stretch Factor", 10.0f, 1.0, FLT_MAX, 1
62 };
64 L"Time Resolution",
65 0.25f,
66 0.00099f,
67 FLT_MAX,
68 1 };
69};
EffectType
static Settings & settings()
Definition: TrackInfo.cpp:51
ComponentInterfaceSymbol pairs a persistent string identifier used internally with an optional,...
virtual EffectType GetType() const =0
Type determines how it behaves.
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
ComponentInterfaceSymbol GetSymbol() const override
Definition: Effect.cpp:49
Performs effect computation.
Interface for manipulations of an Effect's settings.
An Extreme Time Stretch and Time Smear effect.
static PaulstretchBase * FetchParameters(PaulstretchBase &e, EffectSettings &)
static const ComponentInterfaceSymbol Symbol
virtual bool Process(EffectInstance &instance, EffectSettings &settings)=0
Holds a msgid for the translation catalog; may also bind format arguments.
LV2_API bool GetBufferSize(const EffectDefinitionInterface &effect, int &bufferSize)
Externalized state of a plug-in.