Audacity  3.0.3
SBSMSEffect.h
Go to the documentation of this file.
1 /**********************************************************************
2 
3  Audacity: A Digital Audio Editor
4 
5  SBSMSEffect.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 "Effect.h"
22 #include <sbsms.h>
23 
24 using namespace _sbsms_;
25 
26 class LabelTrack;
27 class TimeWarper;
28 
29 class EffectSBSMS /* not final */ : public Effect
30 {
31 public:
32  bool Process() 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 
40 protected:
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() override { return mProxyEffectName; }
46 
47 private:
48  bool ProcessLabelTrack(LabelTrack *track);
49  void Finalize(WaveTrack* orig, WaveTrack* out, const TimeWarper *warper);
50 
51  double rateStart, rateEnd, pitchStart, pitchEnd;
52  bool bLinkRatePitch, bRateReferenceInput, bPitchReferenceInput;
53  SlideType rateSlideType;
54  SlideType pitchSlideType;
56  double mCurT0;
57  double mCurT1;
59 
60  friend class EffectChangeTempo;
61  friend class EffectChangePitch;
62 };
63 
64 #endif
65 
66 #endif
TranslatableString
Holds a msgid for the translation catalog; may also bind format arguments.
Definition: TranslatableString.h:32
EffectSBSMS
Definition: SBSMSEffect.h:30
WaveTrack
A Track that contains audio waveform data.
Definition: WaveTrack.h:69
EffectSBSMS::mTotalStretch
float mTotalStretch
Definition: SBSMSEffect.h:58
EffectSBSMS::GetSymbol
ComponentInterfaceSymbol GetSymbol() override
Definition: SBSMSEffect.h:45
TimeWarper
Transforms one point in time to another point. For example, a time stretching effect might use one to...
Definition: TimeWarper.h:62
Effect.h
EffectSBSMS::mCurT1
double mCurT1
Definition: SBSMSEffect.h:57
Effect
Base class for many of the effects in Audacity.
Definition: Effect.h:72
XO
#define XO(s)
Definition: Internat.h:31
LabelTrack
A LabelTrack is a Track that holds labels (LabelStruct).
Definition: LabelTrack.h:88
ComponentInterfaceSymbol
ComponentInterfaceSymbol pairs a persistent string identifier used internally with an optional,...
Definition: ComponentInterfaceSymbol.h:27
EffectChangeTempo
An EffectSoundTouch provides speeding up or slowing down tempo without changing pitch.
EffectSBSMS::mCurTrackNum
int mCurTrackNum
Definition: SBSMSEffect.h:55
EffectSBSMS::bRateReferenceInput
bool bRateReferenceInput
Definition: SBSMSEffect.h:52
EffectSBSMS::rateStart
double rateStart
Definition: SBSMSEffect.h:51
EffectSBSMS::pitchSlideType
SlideType pitchSlideType
Definition: SBSMSEffect.h:54
EffectSBSMS::mCurT0
double mCurT0
Definition: SBSMSEffect.h:56
EffectSBSMS::rateSlideType
SlideType rateSlideType
Definition: SBSMSEffect.h:53