Audacity 3.2.0
SpectralSelectionBar.h
Go to the documentation of this file.
1/**********************************************************************
2
3Audacity: A Digital Audio Editor
4
5SpectralSelectionBar.h
6
7Paul Licameli
8
9**********************************************************************/
10
11#ifndef __AUDACITY_SPECTRAL_SELECTION_BAR__
12#define __AUDACITY_SPECTRAL_SELECTION_BAR__
13
14#include <wx/defs.h>
15
16#include "Observer.h"
17#include "ToolBar.h"
18
19class wxChoice;
20class wxComboBox;
21class wxCommandEvent;
22class wxDC;
23class wxSizeEvent;
24
25class AudacityProject;
26class NumericTextCtrl;
28
29class SpectralSelectionBar final : public ToolBar {
30
31public:
32
33 static Identifier ID();
34
36 virtual ~SpectralSelectionBar();
37
38 bool ShownByDefault() const override;
39 DockID DefaultDockID() const override;
40
42 static const SpectralSelectionBar &Get( const AudacityProject &project );
43
44 void Create(wxWindow *parent) override;
45
46 void Populate() override;
47 void Repaint(wxDC * WXUNUSED(dc)) override {};
48 void EnableDisableButtons() override {};
49 void UpdatePrefs() override;
50
51 void SetFrequencies(double bottom, double top);
52 void SetFrequencySelectionFormatName(const NumericFormatID & formatName);
53 void SetBandwidthSelectionFormatName(const NumericFormatID & formatName);
54
55 void RegenerateTooltips() override {};
56
57private:
58
59 void ValuesToControls();
60 void SetBounds();
62 void OnUpdate(wxCommandEvent &evt);
63 void OnCtrl(wxCommandEvent &evt);
64 void OnChoice(wxCommandEvent &evt);
65 void OnIdle( wxIdleEvent &evt );
66
67 void OnSize(wxSizeEvent &evt);
68
69 void ModifySpectralSelection(bool done = false);
70
72
74
75 double mCenter; // hertz
76 double mWidth; // logarithm of ratio of hertz
77 double mLow; // hertz
78 double mHigh; // hertz
79
81 wxChoice *mChoice;
82
83 int mHeight; // height of main sizer after creation - used by OnChoice()
84
85public:
86
87 DECLARE_CLASS(SpectralSelectionBar)
88 DECLARE_EVENT_TABLE()
89};
90
91#endif
92
const auto project
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
Definition: Project.h:90
An explicitly nonlocalized string, not meant for the user to see.
Definition: Identifier.h:22
A move-only handle representing a connection to a Publisher.
Definition: Observer.h:70
(not quite a Toolbar) at foot of screen for setting and viewing the frequency selection range.
NumericTextCtrl * mCenterCtrl
NumericTextCtrl * mWidthCtrl
void Repaint(wxDC *WXUNUSED(dc)) override
SpectralSelectionBar(AudacityProject &project)
void SetBandwidthSelectionFormatName(const NumericFormatID &formatName)
void SetFrequencies(double bottom, double top)
NumericTextCtrl * mLowCtrl
void SetFrequencySelectionFormatName(const NumericFormatID &formatName)
void OnChoice(wxCommandEvent &evt)
void OnSize(wxSizeEvent &evt)
void Create(wxWindow *parent) override
void OnUpdate(wxCommandEvent &evt)
static Identifier ID()
Observer::Subscription mFormatsSubscription
void OnIdle(wxIdleEvent &evt)
void RegenerateTooltips() override
bool ShownByDefault() const override
Whether the toolbar should be shown by default. Default implementation returns true.
DockID DefaultDockID() const override
Which dock the toolbar defaults into. Default implementation chooses the top dock.
NumericTextCtrl * mHighCtrl
void OnCtrl(wxCommandEvent &evt)
void ModifySpectralSelection(bool done=false)
static SpectralSelectionBar & Get(AudacityProject &project)
void EnableDisableButtons() override
void OnFormatsChanged(ProjectNumericFormatsEvent)
Works with ToolManager and ToolDock to provide a dockable window in which buttons can be placed.
Definition: ToolBar.h:74
DockID
Identifies one of the docking areas for toolbars.
Definition: ToolBar.h:92