Audacity 3.2.0
ToneGen.h
Go to the documentation of this file.
1/**********************************************************************
2
3 Audacity: A Digital Audio Editor
4
5 ToneGen.h
6
7 Steve Jolly
8
9 This class implements a tone generator effect.
10
11**********************************************************************/
12
13#ifndef __AUDACITY_EFFECT_TONEGEN__
14#define __AUDACITY_EFFECT_TONEGEN__
15
16#include "ShuttleAutomation.h"
19#include "ToneGenBase.h"
20#include <float.h> // for DBL_MAX
21#include <wx/weakref.h>
22
23class NumericTextCtrl;
24class ShuttleGui;
25
27{
28public:
29 EffectToneGen(bool isChirp)
30 : ToneGenBase { isChirp }
31 {
32 }
33
34 // ComponentInterface implementation
35
36 ComponentInterfaceSymbol GetSymbol() const override;
37 TranslatableString GetDescription() const override;
38 ManualPageID ManualPage() const override;
39
40 // Effect implementation
41
42 std::unique_ptr<EffectEditor> PopulateOrExchange(
43 ShuttleGui & S, EffectInstance &instance,
44 EffectSettingsAccess &access, const EffectOutputs *pOutputs) override;
45 bool TransferDataToWindow(const EffectSettings &settings) override;
47
48protected:
49 DECLARE_EVENT_TABLE()
50
51private:
52 // ToneGenBase implementation
53
54 void OnControlUpdate(wxCommandEvent & evt);
55
56 wxWeakRef<wxWindow> mUIParent{};
58};
59
60class EffectChirp final : public EffectToneGen
61{
62public:
64
66 ~EffectChirp() override = default;
67};
68
69
70class EffectTone final : public EffectToneGen
71{
72public:
74
75 EffectTone() : EffectToneGen{ false } {}
76 ~EffectTone() override = default;
77};
78
79#endif
#define S(N)
Definition: ToChars.cpp:64
static Settings & settings()
Definition: TrackInfo.cpp:51
ComponentInterfaceSymbol pairs a persistent string identifier used internally with an optional,...
static const ComponentInterfaceSymbol Symbol
Definition: ToneGen.h:63
~EffectChirp() override=default
EffectChirp()
Definition: ToneGen.h:65
Performs effect computation.
Hold values to send to effect output meters.
An Effect that can generate a sine, square or sawtooth wave. An extended mode of EffectToneGen suppor...
Definition: ToneGen.h:27
TranslatableString GetDescription() const override
Definition: ToneGen.cpp:57
std::unique_ptr< EffectEditor > PopulateOrExchange(ShuttleGui &S, EffectInstance &instance, EffectSettingsAccess &access, const EffectOutputs *pOutputs) override
Add controls to effect panel; always succeeds.
Definition: ToneGen.cpp:71
ComponentInterfaceSymbol GetSymbol() const override
Definition: ToneGen.cpp:52
void OnControlUpdate(wxCommandEvent &evt)
Definition: ToneGen.cpp:225
wxWeakRef< wxWindow > mUIParent
Definition: ToneGen.h:56
ManualPageID ManualPage() const override
Name of a page in the Audacity alpha manual, default is empty.
Definition: ToneGen.cpp:64
NumericTextCtrl * mToneDurationT
Definition: ToneGen.h:57
bool TransferDataToWindow(const EffectSettings &settings) override
Definition: ToneGen.cpp:194
EffectToneGen(bool isChirp)
Definition: ToneGen.h:29
bool TransferDataFromWindow(EffectSettings &settings) override
Definition: ToneGen.cpp:205
EffectTone()
Definition: ToneGen.h:75
~EffectTone() override=default
static const ComponentInterfaceSymbol Symbol
Definition: ToneGen.h:73
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.
Definition: ShuttleGui.h:640
An Effect that can generate a sine, square or sawtooth wave. An extended mode of ToneGenBase supports...
Definition: ToneGenBase.h:22
Holds a msgid for the translation catalog; may also bind format arguments.
Externalized state of a plug-in.