Audacity  3.0.3
TimeScale.h
Go to the documentation of this file.
1 /**********************************************************************
2 
3  Audacity: A Digital Audio Editor
4 
5  TimeScale.h
6 
7  Clayton Otey
8 
9 **********************************************************************/
10 
11 #ifndef __AUDACITY_EFFECT_TIMESCALE__
12 #define __AUDACITY_EFFECT_TIMESCALE__
13 
14 
15 
16 #if USE_SBSMS
17 
18 #include "SBSMSEffect.h"
19 
20 class wxSlider;
21 class wxTextCtrl;
22 class ShuttleGui;
23 
24 class EffectTimeScale final : public EffectSBSMS
25 {
26 public:
28 
30  virtual ~EffectTimeScale();
31 
32  // ComponentInterface implementation
33 
36  ManualPageID ManualPage() override;
37 
38  // EffectDefinitionInterface implementation
39 
40  EffectType GetType() override;
41 
42  // EffectClientInterface implementation
43 
44  bool DefineParams( ShuttleParams & S ) override;
45  bool GetAutomationParameters(CommandParameters & parms) override;
46  bool SetAutomationParameters(CommandParameters & parms) override;
47 
48  // Effect implementation
49 
50  bool Init() override;
51  void Preview(bool dryOnly) override;
52  bool Process() override;
53  void PopulateOrExchange(ShuttleGui & S) override;
54  bool TransferDataToWindow() override;
55  bool TransferDataFromWindow() override;
56  double CalcPreviewInputLength(double previewLength) override;
57 
58 private:
59  // EffectTimeScale implementation
60 
61  inline double PercentChangeToRatio(double percentChange);
62  inline double HalfStepsToPercentChange(double halfSteps);
63  inline double PercentChangeToHalfSteps(double percentChange);
64 
65  void OnText_RatePercentChangeStart(wxCommandEvent & evt);
66  void OnText_RatePercentChangeEnd(wxCommandEvent & evt);
67  void OnText_PitchPercentChangeStart(wxCommandEvent & evt);
68  void OnText_PitchPercentChangeEnd(wxCommandEvent & evt);
69  void OnText_PitchHalfStepsStart(wxCommandEvent & evt);
70  void OnText_PitchHalfStepsEnd(wxCommandEvent & evt);
71  void OnSlider_RatePercentChangeStart(wxCommandEvent & evt);
72  void OnSlider_RatePercentChangeEnd(wxCommandEvent & evt);
73  void OnCheckBox_PreAnalyze(wxCommandEvent & evt);
74 
83 
84 private:
85  bool bPreview;
87  SlideType slideTypeRate;
88  SlideType slideTypePitch;
95 
104 
105  DECLARE_EVENT_TABLE()
106 };
107 
108 #endif // __AUDACITY_EFFECT_TIMESCALE
109 
110 #endif // USE_SBSMS
EffectTimeScale::~EffectTimeScale
virtual ~EffectTimeScale()
Definition: TimeScale.cpp:88
TranslatableString
Holds a msgid for the translation catalog; may also bind format arguments.
Definition: TranslatableString.h:32
CommandParameters
CommandParameters, derived from wxFileConfig, is essentially doing the same things as the Shuttle cla...
Definition: EffectAutomationParameters.h:67
EffectSBSMS
Definition: SBSMSEffect.h:30
EffectTimeScale::Init
bool Init() override
Definition: TimeScale.cpp:160
EffectTimeScale
An EffectTimeScale does high quality sliding time scaling/pitch shifting.
Definition: TimeScale.h:25
EffectTimeScale::OnText_PitchHalfStepsEnd
void OnText_PitchHalfStepsEnd(wxCommandEvent &evt)
Definition: TimeScale.cpp:435
EffectTimeScale::Update_Text_PitchHalfStepsStart
void Update_Text_PitchHalfStepsStart()
Definition: TimeScale.cpp:370
EffectTimeScale::Update_Text_PitchHalfStepsEnd
void Update_Text_PitchHalfStepsEnd()
Definition: TimeScale.cpp:375
EffectTimeScale::m_pTextCtrl_RatePercentChangeEnd
wxTextCtrl * m_pTextCtrl_RatePercentChangeEnd
Definition: TimeScale.h:97
EffectTimeScale::OnSlider_RatePercentChangeStart
void OnSlider_RatePercentChangeStart(wxCommandEvent &evt)
Definition: TimeScale.cpp:410
EffectTimeScale::OnText_PitchHalfStepsStart
void OnText_PitchHalfStepsStart(wxCommandEvent &evt)
Definition: TimeScale.cpp:424
SBSMSEffect.h
EffectTimeScale::OnText_PitchPercentChangeEnd
void OnText_PitchPercentChangeEnd(wxCommandEvent &evt)
Definition: TimeScale.cpp:457
EffectTimeScale::ManualPage
ManualPageID ManualPage() override
Definition: TimeScale.cpp:104
EffectTimeScale::OnCheckBox_PreAnalyze
void OnCheckBox_PreAnalyze(wxCommandEvent &evt)
EffectTimeScale::m_pTextCtrl_PitchHalfStepsEnd
wxTextCtrl * m_pTextCtrl_PitchHalfStepsEnd
Definition: TimeScale.h:101
ShuttleParams
Shuttle that deals with parameters. This is a base class with lots of virtual functions that do nothi...
Definition: Shuttle.h:62
EffectTimeScale::Preview
void Preview(bool dryOnly) override
Definition: TimeScale.cpp:179
EffectTimeScale::previewSelectedDuration
double previewSelectedDuration
Definition: TimeScale.h:86
EffectTimeScale::PercentChangeToRatio
double PercentChangeToRatio(double percentChange)
Definition: TimeScale.cpp:335
EffectTimeScale::CalcPreviewInputLength
double CalcPreviewInputLength(double previewLength) override
Definition: TimeScale.cpp:165
EffectTimeScale::OnText_RatePercentChangeEnd
void OnText_RatePercentChangeEnd(wxCommandEvent &evt)
Definition: TimeScale.cpp:400
ComponentInterfaceSymbol
ComponentInterfaceSymbol pairs a persistent string identifier used internally with an optional,...
Definition: ComponentInterfaceSymbol.h:27
EffectTimeScale::OnText_RatePercentChangeStart
void OnText_RatePercentChangeStart(wxCommandEvent &evt)
Definition: TimeScale.cpp:390
EffectTimeScale::SetAutomationParameters
bool SetAutomationParameters(CommandParameters &parms) override
Definition: TimeScale.cpp:139
EffectTimeScale::m_pSlider_RatePercentChangeStart
wxSlider * m_pSlider_RatePercentChangeStart
Definition: TimeScale.h:98
EffectTimeScale::m_PitchHalfStepsEnd
double m_PitchHalfStepsEnd
Definition: TimeScale.h:92
EffectTimeScale::m_PitchPercentChangeStart
double m_PitchPercentChangeStart
Definition: TimeScale.h:93
EffectTimeScale::TransferDataToWindow
bool TransferDataToWindow() override
Definition: TimeScale.cpp:312
EffectTimeScale::Update_Text_PitchPercentChangeStart
void Update_Text_PitchPercentChangeStart()
Definition: TimeScale.cpp:380
EffectTimeScale::PopulateOrExchange
void PopulateOrExchange(ShuttleGui &S) override
Definition: TimeScale.cpp:203
EffectTimeScale::TransferDataFromWindow
bool TransferDataFromWindow() override
Definition: TimeScale.cpp:325
EffectTimeScale::OnSlider_RatePercentChangeEnd
void OnSlider_RatePercentChangeEnd(wxCommandEvent &evt)
Definition: TimeScale.cpp:417
EffectTimeScale::EffectTimeScale
EffectTimeScale()
Definition: TimeScale.cpp:71
EffectTimeScale::DefineParams
bool DefineParams(ShuttleParams &S) override
Definition: TimeScale.cpp:117
EffectTimeScale::GetType
EffectType GetType() override
Definition: TimeScale.cpp:111
EffectTimeScale::m_PitchHalfStepsStart
double m_PitchHalfStepsStart
Definition: TimeScale.h:91
EffectTimeScale::Process
bool Process() override
Definition: TimeScale.cpp:186
EffectTimeScale::Update_Text_RatePercentChangeStart
void Update_Text_RatePercentChangeStart()
Definition: TimeScale.cpp:350
EffectTimeScale::m_pTextCtrl_PitchPercentChangeStart
wxTextCtrl * m_pTextCtrl_PitchPercentChangeStart
Definition: TimeScale.h:102
EffectTimeScale::Update_Slider_RatePercentChangeEnd
void Update_Slider_RatePercentChangeEnd()
Definition: TimeScale.cpp:365
EffectTimeScale::slideTypeRate
SlideType slideTypeRate
Definition: TimeScale.h:87
TaggedIdentifier< ManualPageIDTag >
EffectTimeScale::GetSymbol
ComponentInterfaceSymbol GetSymbol() override
Definition: TimeScale.cpp:94
EffectTimeScale::slideTypePitch
SlideType slideTypePitch
Definition: TimeScale.h:88
EffectTimeScale::m_RatePercentChangeEnd
double m_RatePercentChangeEnd
Definition: TimeScale.h:90
EffectTimeScale::m_pTextCtrl_PitchHalfStepsStart
wxTextCtrl * m_pTextCtrl_PitchHalfStepsStart
Definition: TimeScale.h:100
EffectTimeScale::PercentChangeToHalfSteps
double PercentChangeToHalfSteps(double percentChange)
Definition: TimeScale.cpp:345
EffectTimeScale::m_RatePercentChangeStart
double m_RatePercentChangeStart
Definition: TimeScale.h:89
EffectTimeScale::m_pTextCtrl_PitchPercentChangeEnd
wxTextCtrl * m_pTextCtrl_PitchPercentChangeEnd
Definition: TimeScale.h:103
EffectTimeScale::m_pSlider_RatePercentChangeEnd
wxSlider * m_pSlider_RatePercentChangeEnd
Definition: TimeScale.h:99
EffectTimeScale::m_PitchPercentChangeEnd
double m_PitchPercentChangeEnd
Definition: TimeScale.h:94
EffectTimeScale::Update_Text_RatePercentChangeEnd
void Update_Text_RatePercentChangeEnd()
Definition: TimeScale.cpp:355
EffectTimeScale::GetAutomationParameters
bool GetAutomationParameters(CommandParameters &parms) override
Definition: TimeScale.cpp:127
EffectTimeScale::OnText_PitchPercentChangeStart
void OnText_PitchPercentChangeStart(wxCommandEvent &evt)
Definition: TimeScale.cpp:446
EffectTimeScale::bPreview
bool bPreview
Definition: TimeScale.h:85
EffectType
EffectType
Definition: EffectInterface.h:55
EffectTimeScale::GetDescription
TranslatableString GetDescription() override
Definition: TimeScale.cpp:99
EffectTimeScale::Symbol
static const ComponentInterfaceSymbol Symbol
Definition: TimeScale.h:27
EffectTimeScale::HalfStepsToPercentChange
double HalfStepsToPercentChange(double halfSteps)
Definition: TimeScale.cpp:340
ShuttleGui
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.
Definition: ShuttleGui.h:631
EffectTimeScale::Update_Text_PitchPercentChangeEnd
void Update_Text_PitchPercentChangeEnd()
Definition: TimeScale.cpp:385
EffectTimeScale::Update_Slider_RatePercentChangeStart
void Update_Slider_RatePercentChangeStart()
Definition: TimeScale.cpp:360
EffectTimeScale::m_pTextCtrl_RatePercentChangeStart
wxTextCtrl * m_pTextCtrl_RatePercentChangeStart
Definition: TimeScale.h:96