Audacity 3.2.0
MeterToolBar.h
Go to the documentation of this file.
1/**********************************************************************
2
3 Audacity: A Digital Audio Editor
4
5 MeterToolbar.h
6
7 Dominic Mazzoni
8 Leland Lucius
9
10 ToolBar to hold the VU Meter
11
12**********************************************************************/
13
14#ifndef __AUDACITY_METER_TOOLBAR__
15#define __AUDACITY_METER_TOOLBAR__
16
17#include <functional>
18#include <vector>
19#include "ToolBar.h"
20
21class wxDC;
22class wxGridBagSizer;
23class wxSizeEvent;
24class wxWindow;
25
26class AudacityProject;
27class MeterPanel;
28class MeterToolBar;
29
30using MeterToolBars = std::vector< std::reference_wrapper<MeterToolBar> >;
31using ConstMeterToolBars = std::vector< std::reference_wrapper<const MeterToolBar> >;
32
33// Constants used as bit pattern
34const int kWithRecordMeter = 1;
35const int kWithPlayMeter = 2;
36
37class MeterToolBar final : public ToolBar {
38
39 public:
40
41 MeterToolBar(AudacityProject &project, int type);
42 virtual ~MeterToolBar();
43
45 static ConstMeterToolBars GetToolBars(const AudacityProject &project);
46
47 static MeterToolBar & Get(AudacityProject &project, bool forPlayMeterToolBar);
48 static const MeterToolBar & Get(const AudacityProject &project, bool forPlayMeterToolBar);
49
50 void Create(wxWindow *parent) override;
51
52 void Populate() override;
53 void ReCreateButtons() override;
54 void Repaint(wxDC * WXUNUSED(dc)) override {};
55 void EnableDisableButtons() override {};
56 void UpdatePrefs() override;
57 void UpdateControls();
58
59 void OnSize(wxSizeEvent & event);
60 bool Expose(bool show) override;
61
62 int GetInitialWidth() override {return (mWhichMeters ==
63 (kWithRecordMeter + kWithPlayMeter)) ? 338 : 460;} // Separate bars used to be smaller.
64 int GetMinToolbarWidth() override { return 150; }
65 wxSize GetDockedSize() override {
66 return GetSmartDockedSize();
67 };
68 virtual void SetDocked(ToolDock *dock, bool pushed)override;
69
72
73 void AdjustOutputGain(int adj);
74 void AdjustInputGain(int adj);
75
76 private:
77 void RegenerateTooltips() override;
78
80 wxGridBagSizer *mSizer;
83
84 public:
85
86 DECLARE_CLASS(MeterToolBar)
87 DECLARE_EVENT_TABLE()
88
89};
90
91#endif
92
std::vector< std::reference_wrapper< const MeterToolBar > > ConstMeterToolBars
Definition: MeterToolBar.h:31
std::vector< std::reference_wrapper< MeterToolBar > > MeterToolBars
Definition: MeterToolBar.h:30
const int kWithRecordMeter
Definition: MeterToolBar.h:34
const int kWithPlayMeter
Definition: MeterToolBar.h:35
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
Definition: Project.h:89
MeterPanel is a panel that paints the meter used for monitoring or playback.
Definition: MeterPanel.h:104
A ToolBar that holds the VU Meter.
Definition: MeterToolBar.h:37
virtual ~MeterToolBar()
void UpdatePrefs() override
void AdjustOutputGain(int adj)
void RegenerateTooltips() override
MeterToolBar(AudacityProject &project, int type)
Methods for MeterToolBar.
void ShowInputGainDialog()
void EnableDisableButtons() override
Definition: MeterToolBar.h:55
int GetMinToolbarWidth() override
Definition: MeterToolBar.h:64
static MeterToolBars GetToolBars(AudacityProject &project)
void ShowOutputGainDialog()
wxSize GetDockedSize() override
Definition: MeterToolBar.h:65
void OnSize(wxSizeEvent &event)
void AdjustInputGain(int adj)
void ReCreateButtons() override
void Create(wxWindow *parent) override
void Populate() override
void Repaint(wxDC *WXUNUSED(dc)) override
Definition: MeterToolBar.h:54
MeterPanel * mPlayMeter
Definition: MeterToolBar.h:81
MeterPanel * mRecordMeter
Definition: MeterToolBar.h:82
void UpdateControls()
static MeterToolBar & Get(AudacityProject &project, bool forPlayMeterToolBar)
int GetInitialWidth() override
Resizable toolbars should implement these.
Definition: MeterToolBar.h:62
virtual void SetDocked(ToolDock *dock, bool pushed) override
bool Expose(bool show) override
wxGridBagSizer * mSizer
Definition: MeterToolBar.h:80
Works with ToolManager and ToolDock to provide a dockable window in which buttons can be placed.
Definition: ToolBar.h:98
wxSize GetSmartDockedSize()
Definition: ToolBar.cpp:503
A dynamic panel where a ToolBar can be docked.
Definition: ToolDock.h:290