Audacity 3.2.0
TimeSignatureToolBar.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: GPL-2.0-or-later */
2/**********************************************************************
3
4 Audacity: A Digital Audio Editor
5
6 TimeSignatureToolBar.h
7
8 Dmitry Vedenko
9
10**********************************************************************/
11
12#pragma once
13
14#include <type_traits>
15#include <wx/weakref.h>
16
17#include <array>
18
19#include "ToolBar.h"
21
22#include "Observer.h"
23
24class wxComboBox;
25class wxSizeEvent;
26class SpinControl;
27
28class AudacityProject;
29
30struct AudioIOEvent;
31
32class TimeSignatureToolBar final : public ToolBar
33{
34
35 public:
36 static Identifier ID();
37
40
41 bool ShownByDefault() const override;
42 DockID DefaultDockID() const override;
43
45 static const TimeSignatureToolBar& Get(const AudacityProject& project);
46
47 void Create(wxWindow *parent) override;
48
49 void Populate() override;
50 void Repaint(wxDC * WXUNUSED(dc)) override {};
51 void EnableDisableButtons() override {};
52 void UpdatePrefs() override;
53
54 void RegenerateTooltips() override;
55
56 private:
57 void OnSize(wxSizeEvent& evt);
58
59 void OnAudioIOEvent(const AudioIOEvent& event);
60
61 void AddTitle(
62 const TranslatableString& Title, wxSizer* pSizer,
63 int flags = wxEXPAND | wxRIGHT, int border = 5,
64 double fontMultiplier = 1.0);
65
68
69 wxWeakRef<SpinControl> mTempoControl;
70 wxWeakRef<SpinControl> mUpperSignatureControl;
71 wxWeakRef<wxComboBox> mLowerSignatureControl;
72
73 public:
74
75
76 DECLARE_CLASS(TimeSignatureToolBar)
77 DECLARE_EVENT_TABLE()
78};
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
DockID DefaultDockID() const override
Which dock the toolbar defaults into. Default implementation chooses the top dock.
wxWeakRef< wxComboBox > mLowerSignatureControl
bool ShownByDefault() const override
Whether the toolbar should be shown by default. Default implementation returns true.
void EnableDisableButtons() override
void AddTitle(const TranslatableString &Title, wxSizer *pSizer, int flags=wxEXPAND|wxRIGHT, int border=5, double fontMultiplier=1.0)
wxWeakRef< SpinControl > mTempoControl
void Create(wxWindow *parent) override
void RegenerateTooltips() override
static Identifier ID()
Observer::Subscription mTimeSignatureChangedSubscription
Observer::Subscription mPlaybackStateChangedSubscription
static TimeSignatureToolBar & Get(AudacityProject &project)
virtual ~TimeSignatureToolBar()
void OnAudioIOEvent(const AudioIOEvent &event)
TimeSignatureToolBar(AudacityProject &project)
void OnSize(wxSizeEvent &evt)
void Repaint(wxDC *WXUNUSED(dc)) override
wxWeakRef< SpinControl > mUpperSignatureControl
Works with ToolManager and ToolDock to provide a dockable window in which buttons can be placed.
Definition: ToolBar.h:73
DockID
Identifies one of the docking areas for toolbars.
Definition: ToolBar.h:91
Holds a msgid for the translation catalog; may also bind format arguments.