Audacity 3.2.0
SBSMSBase.h
Go to the documentation of this file.
1/**********************************************************************
2
3 Audacity: A Digital Audio Editor
4
5 SBSMSBase.h
6
7 ClaytonOtey
8
9 This abstract class contains all of the common code for an
10 effect that uses SBSMS to do its processing (TimeScale)
11
12**********************************************************************/
13
14#ifndef __AUDACITY_EFFECT_SBSMS__
15#define __AUDACITY_EFFECT_SBSMS__
16
17
18
19#if USE_SBSMS
20
21#include "StatefulEffect.h"
22#include <sbsms.h>
23
24using namespace _sbsms_;
25
26class LabelTrack;
27class TimeWarper;
28
29class BUILTIN_EFFECTS_API SBSMSBase /* not final */ : public StatefulEffect
30{
31public:
32 bool Process(EffectInstance &instance, EffectSettings &settings) override;
33 void setParameters(double rateStart, double rateEnd, double pitchStart, double pitchEnd,
34 SlideType rateSlideType, SlideType pitchSlideType,
35 bool bLinkRatePitch, bool bRateReferenceInput, bool bPitchReferenceInput);
36 void setParameters(double tempoRatio, double pitchRatio); // Constant ratio (tempoRatio, pitchRatio)
37 static double getInvertedStretchedTime(double rateStart, double rateEnd, SlideType slideType, double outputTime);
38 static double getRate(double rateStart, double rateEnd, SlideType slideType, double t);
39
40protected:
41 TranslatableString mProxyEffectName { XO("SBSMS Time / Pitch Stretch") };
42 // This supplies the abstract virtual function, but in fact this symbol
43 // does not get used: this class is either a temporary helper, or else
44 // GetSymbol() is overridden further in derived classes.
45 ComponentInterfaceSymbol GetSymbol() const override { return mProxyEffectName; }
46
47private:
48 EffectType GetType() const override;
49
50 bool ProcessLabelTrack(LabelTrack *track);
54 void Finalize(
55 WaveTrack &orig, const WaveTrack &out, const TimeWarper &warper);
56
57 double rateStart, rateEnd, pitchStart, pitchEnd;
58 bool bLinkRatePitch, bRateReferenceInput, bPitchReferenceInput;
59 SlideType rateSlideType;
60 SlideType pitchSlideType;
63
64 friend class ChangeTempoBase;
65 friend class ChangePitchBase;
66};
67
68#endif
69
70#endif
EffectType
XO("Cut/Copy/Paste")
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.
Performs effect computation.
A LabelTrack is a Track that holds labels (LabelStruct).
Definition: LabelTrack.h:98
double pitchEnd
Definition: SBSMSBase.h:57
SlideType pitchSlideType
Definition: SBSMSBase.h:60
ComponentInterfaceSymbol GetSymbol() const override
Definition: SBSMSBase.h:45
bool bLinkRatePitch
Definition: SBSMSBase.h:58
float mTotalStretch
Definition: SBSMSBase.h:62
SlideType rateSlideType
Definition: SBSMSBase.h:59
int mCurTrackNum
Definition: SBSMSBase.h:61
virtual bool Process(EffectInstance &instance, EffectSettings &settings)=0
Transforms one point in time to another point. For example, a time stretching effect might use one to...
Definition: TimeWarper.h:62
Holds a msgid for the translation catalog; may also bind format arguments.
A Track that contains audio waveform data.
Definition: WaveTrack.h:203
Externalized state of a plug-in.