Audacity  2.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 "ToolBar.h"
18 #include "../Project.h"
19 
20 class wxDC;
21 class wxGridBagSizer;
22 class wxSizeEvent;
23 class wxWindow;
24 
25 class Meter;
26 
27 
28 // Constants used as bit pattern
29 const int kWithRecordMeter = 1;
30 const int kWithPlayMeter = 2;
31 
32 class MeterToolBar final : public ToolBar {
33 
34  public:
35 
36  MeterToolBar(AudacityProject *project, int type);
37  virtual ~MeterToolBar();
38 
39  void Create(wxWindow *parent) override;
40 
41  void Populate() override;
42  void ReCreateButtons() override;
43  void Repaint(wxDC * WXUNUSED(dc)) override {};
44  void EnableDisableButtons() override {};
45  void UpdatePrefs() override;
46 
47  void OnSize(wxSizeEvent & event);
48  bool Expose(bool show) override;
49 
50  int GetInitialWidth() override {return (mWhichMeters ==
51  (kWithRecordMeter + kWithPlayMeter)) ? 338 : 460;} // Separate bars used to be smaller.
52  int GetMinToolbarWidth() override { return 50; }
53  wxSize GetDockedSize() override;
54 
55  private:
56  void RegenerateTooltips() override;
57 
60  wxGridBagSizer *mSizer;
63 
64  public:
65 
66  DECLARE_CLASS(MeterToolBar)
67  DECLARE_EVENT_TABLE()
68 
69 };
70 
71 #endif
72 
A ToolBar that holds the VU Meter.
Definition: MeterToolBar.h:32
AudacityProject * mProject
Definition: MeterToolBar.h:58
void UpdatePrefs() override
Definition: MeterToolBar.cpp:155
int mWhichMeters
Definition: MeterToolBar.h:59
const int kWithRecordMeter
Definition: MeterToolBar.h:29
int GetInitialWidth() override
Resizable toolbars should implement these.
Definition: MeterToolBar.h:50
VU Meter, for displaying recording/playback level.
Definition: Meter.h:88
bool Expose(bool show) override
Definition: MeterToolBar.cpp:239
wxSize GetDockedSize() override
Definition: MeterToolBar.cpp:262
void RegenerateTooltips() override
Definition: MeterToolBar.cpp:180
wxGridBagSizer * mSizer
Definition: MeterToolBar.h:60
AudacityProject provides the main window, with tools and tracks contained within it.
Definition: Project.h:161
virtual ~MeterToolBar()
Definition: MeterToolBar.cpp:71
void Repaint(wxDC *WXUNUSED(dc)) override
Definition: MeterToolBar.h:43
void Create(wxWindow *parent) override
Definition: MeterToolBar.cpp:75
const int kWithPlayMeter
Definition: MeterToolBar.h:30
int GetMinToolbarWidth() override
Definition: MeterToolBar.h:52
void EnableDisableButtons() override
Definition: MeterToolBar.h:44
void ReCreateButtons() override
Definition: MeterToolBar.cpp:84
void OnSize(wxSizeEvent &event)
Definition: MeterToolBar.cpp:190
void Populate() override
Definition: MeterToolBar.cpp:112
Meter * mPlayMeter
Definition: MeterToolBar.h:61
Meter * mRecordMeter
Definition: MeterToolBar.h:62
MeterToolBar(AudacityProject *project, int type)
Methods for MeterToolBar.
Definition: MeterToolBar.cpp:50
Works with ToolManager and ToolDock to provide a dockable window in which buttons can be placed...
Definition: ToolBar.h:87