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 "ToolBar.h"
17
18class wxChoice;
19class wxComboBox;
20class wxCommandEvent;
21class wxDC;
22class wxSizeEvent;
23
24class AudacityProject;
26class NumericTextCtrl;
27
28class SpectralSelectionBar final : public ToolBar {
29
30public:
31
32 static Identifier ID();
33
36
37 bool ShownByDefault() const override;
38 DockID DefaultDockID() const override;
39
41 static const SpectralSelectionBar &Get( const AudacityProject &project );
42
43 void Create(wxWindow *parent) override;
44
45 void Populate() override;
46 void Repaint(wxDC * WXUNUSED(dc)) override {};
47 void EnableDisableButtons() override {};
48 void UpdatePrefs() override;
49
50 void SetFrequencies(double bottom, double top);
54
55 void RegenerateTooltips() override {};
56
57private:
58
60 void SetBounds();
61 void OnUpdate(wxCommandEvent &evt);
62 void OnCtrl(wxCommandEvent &evt);
63 void OnChoice(wxCommandEvent &evt);
64 void OnIdle( wxIdleEvent &evt );
65
66 void OnSize(wxSizeEvent &evt);
67
68 void ModifySpectralSelection(bool done = false);
69
71
73
74 double mCenter; // hertz
75 double mWidth; // logarithm of ratio of hertz
76 double mLow; // hertz
77 double mHigh; // hertz
78
80 wxChoice *mChoice;
81
82 int mHeight; // height of main sizer after creation - used by OnChoice()
83
84public:
85
86 DECLARE_CLASS(SpectralSelectionBar)
87 DECLARE_EVENT_TABLE()
88};
89
90#endif
91
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
Definition: Project.h:90
ComponentInterfaceSymbol pairs a persistent string identifier used internally with an optional,...
An explicitly nonlocalized string, not meant for the user to see.
Definition: Identifier.h:22
(not quite a Toolbar) at foot of screen for setting and viewing the frequency selection range.
void UpdatePrefs() override
NumericTextCtrl * mCenterCtrl
void SetBandwidthSelectionFormatName(const NumericFormatSymbol &formatName)
NumericTextCtrl * mWidthCtrl
void Repaint(wxDC *WXUNUSED(dc)) override
SpectralSelectionBar(AudacityProject &project)
static const SpectralSelectionBar & Get(const AudacityProject &project)
DockID DefaultDockID() const override
Which dock the toolbar defaults into. Default implementation chooses the top dock.
void SetFrequencies(double bottom, double top)
NumericTextCtrl * mLowCtrl
void OnChoice(wxCommandEvent &evt)
void OnSize(wxSizeEvent &evt)
void Create(wxWindow *parent) override
void Populate() override
void OnUpdate(wxCommandEvent &evt)
void OnIdle(wxIdleEvent &evt)
void RegenerateTooltips() override
SpectralSelectionBarListener * mListener
bool ShownByDefault() const override
Whether the toolbar should be shown by default. Default implementation returns true.
static SpectralSelectionBar & Get(AudacityProject &project)
static Identifier ID()
NumericTextCtrl * mHighCtrl
virtual ~SpectralSelectionBar()
void OnCtrl(wxCommandEvent &evt)
void ModifySpectralSelection(bool done=false)
void EnableDisableButtons() override
void SetFrequencySelectionFormatName(const NumericFormatSymbol &formatName)
void SetListener(SpectralSelectionBarListener *l)
A class used to forward events to do with changes in the SpectralSelectionBar.
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