Audacity 3.2.0
ChangeSpeed.h
Go to the documentation of this file.
1/**********************************************************************
2
3 Audacity: A Digital Audio Editor
4
5 ChangeSpeed.h
6
7 Vaughan Johnson, Dominic Mazzoni
8
9 Change Speed effect, that affects both pitch & tempo.
10
11**********************************************************************/
12
13#ifndef __AUDACITY_EFFECT_CHANGESPEED__
14#define __AUDACITY_EFFECT_CHANGESPEED__
15
16#include "ChangeSpeedBase.h"
17#include "StatefulEffect.h"
19#include <wx/weakref.h>
20
21class wxSlider;
22class wxChoice;
23class wxTextCtrl;
24class NumericTextCtrl;
25class ShuttleGui;
26
28 public ChangeSpeedBase,
30{
31public:
32 std::unique_ptr<EffectEditor> PopulateOrExchange(
34 const EffectOutputs* pOutputs) override;
35 bool TransferDataToWindow(const EffectSettings& settings) override;
37
38 DECLARE_EVENT_TABLE()
39private:
40 // handlers
41 void OnText_PercentChange(wxCommandEvent& evt);
42 void OnText_Multiplier(wxCommandEvent& evt);
43 void OnSlider_PercentChange(wxCommandEvent& evt);
44 void OnChoice_Vinyl(wxCommandEvent& evt);
45 void OnTimeCtrl_ToLength(wxCommandEvent& evt);
46 void OnTimeCtrlUpdate(wxCommandEvent& evt);
47
48 // helper functions
49 void
50 Update_Text_PercentChange(); // Update control per current m_PercentChange.
51 void Update_Text_Multiplier(); // Update control per current m_PercentChange.
52 void
53 Update_Slider_PercentChange(); // Update control per current m_PercentChange.
54 void Update_Vinyl(); // Update Vinyl controls for NEW percent change.
55 void Update_TimeCtrl_ToLength(); // Update target length controls for NEW
56 // percent change.
57 void UpdateUI(); // Enable / disable OK / preview.
58
59 wxWeakRef<wxWindow> mUIParent {};
60
61 // controls
69};
70
71#endif // __AUDACITY_EFFECT_CHANGESPEED__
#define S(N)
Definition: ToChars.cpp:64
static Settings & settings()
Definition: TrackInfo.cpp:51
An Effect that affects both pitch & speed.
void OnText_PercentChange(wxCommandEvent &evt)
NumericTextCtrl * mpToLengthCtrl
Definition: ChangeSpeed.h:68
void OnChoice_Vinyl(wxCommandEvent &evt)
void OnText_Multiplier(wxCommandEvent &evt)
bool TransferDataToWindow(const EffectSettings &settings) override
void Update_Slider_PercentChange()
std::unique_ptr< EffectEditor > PopulateOrExchange(ShuttleGui &S, EffectInstance &instance, EffectSettingsAccess &access, const EffectOutputs *pOutputs) override
Add controls to effect panel; always succeeds.
Definition: ChangeSpeed.cpp:64
wxTextCtrl * mpTextCtrl_Multiplier
Definition: ChangeSpeed.h:63
void Update_TimeCtrl_ToLength()
wxChoice * mpChoice_ToVinyl
Definition: ChangeSpeed.h:66
wxTextCtrl * mpTextCtrl_PercentChange
Definition: ChangeSpeed.h:62
wxWeakRef< wxWindow > mUIParent
Definition: ChangeSpeed.h:59
void Update_Text_PercentChange()
wxChoice * mpChoice_FromVinyl
Definition: ChangeSpeed.h:65
void OnTimeCtrl_ToLength(wxCommandEvent &evt)
void Update_Text_Multiplier()
void OnSlider_PercentChange(wxCommandEvent &evt)
bool TransferDataFromWindow(EffectSettings &settings) override
void OnTimeCtrlUpdate(wxCommandEvent &evt)
wxSlider * mpSlider_PercentChange
Definition: ChangeSpeed.h:64
NumericTextCtrl * mpFromLengthCtrl
Definition: ChangeSpeed.h:67
Performs effect computation.
Hold values to send to effect output meters.
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.
Definition: ShuttleGui.h:640
Externalized state of a plug-in.