Audacity 3.2.0
|
A ToolBar that holds the VU Meter. More...
#include <MeterToolBar.h>
Public Member Functions | |
MeterToolBar (AudacityProject &project, unsigned whichMeters, const TranslatableString &label, Identifier ID) | |
virtual | ~MeterToolBar () |
bool | ShownByDefault () const override |
Whether the toolbar should be shown by default. Default implementation returns true. More... | |
void | Create (wxWindow *parent) override |
void | Populate () override |
void | ReCreateButtons () override |
void | Repaint (wxDC *WXUNUSED(dc)) override |
void | EnableDisableButtons () override |
void | UpdatePrefs () override |
void | UpdateControls () |
void | OnSize (wxSizeEvent &event) |
bool | Expose (bool show) override |
int | GetInitialWidth () override |
Resizable toolbars should implement these. More... | |
int | GetMinToolbarWidth () override |
wxSize | GetDockedSize () override |
void | ShowOutputGainDialog () |
void | ShowInputGainDialog () |
void | AdjustOutputGain (int adj) |
void | AdjustInputGain (int adj) |
Public Member Functions inherited from ToolBar | |
ToolBar (AudacityProject &project, const TranslatableString &label, const Identifier §ion, bool resizable=false) | |
virtual | ~ToolBar () |
virtual bool | ShownByDefault () const |
Whether the toolbar should be shown by default. Default implementation returns true. More... | |
virtual bool | HideAfterReset () const |
Default implementation returns false. More... | |
virtual DockID | DefaultDockID () const |
Which dock the toolbar defaults into. Default implementation chooses the top dock. More... | |
bool | AcceptsFocus () const override |
bool | AcceptsFocusFromKeyboard () const override |
virtual void | SetToDefaultSize () |
virtual void | Create (wxWindow *parent) |
virtual void | EnableDisableButtons ()=0 |
virtual void | ReCreateButtons () |
void | UpdatePrefs () override |
virtual void | RegenerateTooltips ()=0 |
int | GetIndex () const |
Get a value used for computing cascading positions of undocked bars. More... | |
void | SetIndex (int index) |
Set a value used for computing cascading positions of undocked bars. More... | |
TranslatableString | GetTitle () |
TranslatableString | GetLabel () |
Identifier | GetSection () |
ToolDock * | GetDock () |
void | SetPreferredNeighbors (Identifier left, Identifier top={}) |
void | SetLabel (const TranslatableString &label) |
virtual void | SetDocked (ToolDock *dock, bool pushed) |
std::pair< Identifier, Identifier > | PreferredNeighbors () const noexcept |
Defaults to (NoBarID, NoBarId) More... | |
virtual bool | Expose (bool show=true) |
bool | IsResizable () const |
bool | IsVisible () const |
bool | IsDocked () const |
bool | IsPositioned () |
void | SetVisible (bool bVisible) |
void | SetPositioned () |
virtual int | GetInitialWidth () |
Resizable toolbars should implement these. More... | |
virtual int | GetMinToolbarWidth () |
virtual wxSize | GetDockedSize () |
wxSize | GetSmartDockedSize () |
virtual void | ResizingDone () |
Public Member Functions inherited from wxPanelWrapper | |
wxPanelWrapper () | |
wxPanelWrapper (wxWindow *parent, wxWindowID winid=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxTAB_TRAVERSAL|wxNO_BORDER, const TranslatableString &name=XO("Panel")) | |
bool | Create (wxWindow *parent, wxWindowID winid=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxTAB_TRAVERSAL|wxNO_BORDER, const TranslatableString &name=XO("Panel")) |
void | SetLabel (const TranslatableString &label) |
void | SetName (const TranslatableString &name) |
void | SetToolTip (const TranslatableString &toolTip) |
void | SetName () |
Public Member Functions inherited from wxTabTraversalWrapper< wxPanel > | |
wxTabTraversalWrapper (Args &&... args) | |
wxTabTraversalWrapper (const wxTabTraversalWrapper &)=delete | |
wxTabTraversalWrapper (wxTabTraversalWrapper &&)=delete | |
wxTabTraversalWrapper & | operator= (const wxTabTraversalWrapper &)=delete |
wxTabTraversalWrapper & | operator= (wxTabTraversalWrapper &&)=delete |
Static Public Member Functions | |
static Identifier | ID () |
Methods for MeterToolBar. More... | |
static Identifier | PlayID () |
static Identifier | RecordID () |
static MeterToolBars | GetToolBars (AudacityProject &project) |
static ConstMeterToolBars | GetToolBars (const AudacityProject &project) |
static MeterToolBar & | Get (AudacityProject &project, bool forPlayMeterToolBar) |
static const MeterToolBar & | Get (const AudacityProject &project, bool forPlayMeterToolBar) |
Static Public Member Functions inherited from ToolBar | |
static AButton * | MakeButton (wxWindow *parent, teBmps eUp, teBmps eDown, teBmps eHilite, teBmps eDownHi, teBmps eStandardUp, teBmps eStandardDown, teBmps eDisabled, wxWindowID id, wxPoint placement, bool processdownevents, wxSize size) |
static AButton * | MakeButton (ToolBar *parent, teBmps eEnabledUp, teBmps eEnabledDown, teBmps eDisabled, int id, bool processdownevents, const TranslatableString &label) |
static void | MakeAlternateImages (AButton &button, int idx, teBmps eUp, teBmps eDown, teBmps eHilite, teBmps eDownHi, teBmps eStandardUp, teBmps eStandardDown, teBmps eDisabled, wxSize size) |
static void | SetButtonToolTip (AudacityProject &project, AButton &button, const ComponentInterfaceSymbol commands[], size_t nCommands) |
static void | MakeButtonBackgroundsSmall () |
static void | MakeButtonBackgroundsLarge () |
Private Member Functions | |
void | RegenerateTooltips () override |
void | RebuildLayout (bool force) |
Private Attributes | |
unsigned | mWhichMeters |
wxBoxSizer * | mRootSizer {nullptr} |
AButton * | mPlaySetupButton {nullptr} |
MeterPanel * | mPlayMeter {nullptr} |
AButton * | mRecordSetupButton {nullptr} |
MeterPanel * | mRecordMeter {nullptr} |
Additional Inherited Members | |
Public Types inherited from ToolBar | |
enum | DockID { TopDockID = 1 , BotDockID = 2 } |
Identifies one of the docking areas for toolbars. More... | |
using | Holder = wxWindowPtr< ToolBar > |
Protected Member Functions inherited from ToolBar | |
void | SetButton (bool down, AButton *button) |
wxBoxSizer * | GetSizer () |
void | Add (wxWindow *window, int proportion=0, int flag=wxALIGN_TOP, int border=0, wxObject *userData=NULL) |
void | Add (wxSizer *sizer, int proportion=0, int flag=0, int border=0, wxObject *userData=NULL) |
void | Add (int width, int height, int proportion=0, int flag=0, int border=0, wxObject *userData=NULL) |
void | AddSpacer (int size=14) |
void | AddStretchSpacer (int prop=1) |
void | Detach (wxWindow *window) |
void | Detach (wxSizer *sizer) |
void | Updated () |
int | GetResizeGrabberWidth () |
Returns the width in pixels of the resizer element. More... | |
virtual void | Populate ()=0 |
virtual void | Repaint (wxDC *dc)=0 |
void | OnErase (wxEraseEvent &event) |
void | OnPaint (wxPaintEvent &event) |
void | OnMouseEvents (wxMouseEvent &event) |
Protected Member Functions inherited from PrefsListener | |
virtual void | UpdateSelectedPrefs (int id) |
PrefsListener () | |
virtual | ~PrefsListener () |
virtual void | UpdatePrefs ()=0 |
Static Protected Member Functions inherited from ToolBar | |
static void | MakeMacRecoloredImage (teBmps eBmpOut, teBmps eBmpIn) |
static void | MakeMacRecoloredImageSize (teBmps eBmpOut, teBmps eBmpIn, const wxSize &size) |
static void | MakeRecoloredImage (teBmps eBmpOut, teBmps eBmpIn) |
static void | MakeRecoloredImageSize (teBmps eBmpOut, teBmps eBmpIn, const wxSize &size) |
Static Protected Member Functions inherited from PrefsListener | |
static void | Broadcast (int id=0) |
Call this static function to notify all PrefsListener objects. More... | |
Protected Attributes inherited from ToolBar | |
AudacityProject & | mProject |
TranslatableString | mLabel |
Identifier | mSection |
int | mIndex {0} |
A ToolBar that holds the VU Meter.
Definition at line 38 of file MeterToolBar.h.
MeterToolBar::MeterToolBar | ( | AudacityProject & | project, |
unsigned | whichMeters, | ||
const TranslatableString & | label, | ||
Identifier | ID | ||
) |
Definition at line 148 of file MeterToolBar.cpp.
|
virtual |
Definition at line 156 of file MeterToolBar.cpp.
void MeterToolBar::AdjustInputGain | ( | int | adj | ) |
Definition at line 496 of file MeterToolBar.cpp.
References MeterPanel::Decrease(), MeterPanel::Increase(), mRecordMeter, and MeterPanel::UpdateSliderControl().
void MeterToolBar::AdjustOutputGain | ( | int | adj | ) |
Definition at line 484 of file MeterToolBar.cpp.
References MeterPanel::Decrease(), MeterPanel::Increase(), mPlayMeter, and MeterPanel::UpdateSliderControl().
|
overridevirtual |
Reimplemented from ToolBar.
Definition at line 194 of file MeterToolBar.cpp.
References ToolBar::Create(), OnSize(), and UpdatePrefs().
|
inlineoverridevirtual |
|
overridevirtual |
Reimplemented from ToolBar.
Definition at line 440 of file MeterToolBar.cpp.
References ToolBar::Expose(), ProjectAudioIO::Get(), MeterPanelBase::GetMeter(), mPlayMeter, ToolBar::mProject, and mRecordMeter.
|
static |
Definition at line 176 of file MeterToolBar.cpp.
References ToolManager::Get(), PlayID(), project, and RecordID().
Referenced by Get(), GetToolBars(), anonymous_namespace{MeterToolBar.cpp}::OnInputGain(), anonymous_namespace{MeterToolBar.cpp}::OnInputGainDec(), anonymous_namespace{MeterToolBar.cpp}::OnInputGainInc(), anonymous_namespace{MeterToolBar.cpp}::OnOutputGain(), anonymous_namespace{MeterToolBar.cpp}::OnOutputGainDec(), and anonymous_namespace{MeterToolBar.cpp}::OnOutputGainInc().
|
static |
Definition at line 183 of file MeterToolBar.cpp.
References Get(), and project.
|
inlineoverridevirtual |
Reimplemented from ToolBar.
Definition at line 73 of file MeterToolBar.h.
References ToolBar::GetSmartDockedSize().
|
overridevirtual |
Resizable toolbars should implement these.
Reimplemented from ToolBar.
Definition at line 466 of file MeterToolBar.cpp.
References kWithPlayMeter, kWithRecordMeter, and mWhichMeters.
|
inlineoverridevirtual |
|
static |
Definition at line 160 of file MeterToolBar.cpp.
References Get(), and project.
Referenced by ProjectManager::OnTimer().
|
static |
Definition at line 168 of file MeterToolBar.cpp.
References Get(), and project.
|
static |
Methods for MeterToolBar.
Definition at line 132 of file MeterToolBar.cpp.
References wxT().
void MeterToolBar::OnSize | ( | wxSizeEvent & | event | ) |
Definition at line 431 of file MeterToolBar.cpp.
References mRootSizer, and RebuildLayout().
Referenced by Create().
|
static |
Definition at line 137 of file MeterToolBar.cpp.
References wxT().
Referenced by Get().
|
overridevirtual |
Implements ToolBar.
Definition at line 236 of file MeterToolBar.cpp.
References _, ThemeBase::Colour(), AButton::FrameButton, ThemeBase::Image(), kWithPlayMeter, kWithRecordMeter, ToolBar::MakeButtonBackgroundsSmall(), mPlayMeter, mPlaySetupButton, ToolBar::mProject, mRecordMeter, mRecordSetupButton, mWhichMeters, RebuildLayout(), RegenerateTooltips(), safenew, AButton::SetButtonType(), AButton::SetFrameMid(), AButton::SetIcon(), AButton::SetImages(), wxPanelWrapper::SetLabel(), AButton::SetLabel(), MeterPanel::SetName(), AButton::SetToolTip(), MeterPanel::ShowMenu(), theTheme, and XO().
|
private |
Definition at line 382 of file MeterToolBar.cpp.
References ToolBar::Add(), ToolBar::GetSizer(), kCombinedMeter, kWithPlayMeter, kWithRecordMeter, mPlayMeter, mPlaySetupButton, mRecordMeter, mRecordSetupButton, mRootSizer, mWhichMeters, safenew, and size.
Referenced by OnSize(), and Populate().
|
static |
Definition at line 142 of file MeterToolBar.cpp.
References wxT().
Referenced by Get().
|
overridevirtual |
Reimplemented from ToolBar.
Definition at line 205 of file MeterToolBar.cpp.
References ProjectAudioIO::Get(), MeterPanelBase::GetMeter(), mPlayMeter, ToolBar::mProject, mRecordMeter, ToolBar::ReCreateButtons(), MeterPanel::RestoreState(), and MeterPanel::SaveState().
|
inlineoverrideprivatevirtual |
Implements ToolBar.
Definition at line 84 of file MeterToolBar.h.
Referenced by Populate(), and UpdatePrefs().
|
inlineoverride |
Definition at line 63 of file MeterToolBar.h.
void MeterToolBar::ShowInputGainDialog | ( | ) |
Definition at line 478 of file MeterToolBar.cpp.
References mRecordMeter, MeterPanel::ShowDialog(), and MeterPanel::UpdateSliderControl().
|
overridevirtual |
Whether the toolbar should be shown by default. Default implementation returns true.
Reimplemented from ToolBar.
Definition at line 188 of file MeterToolBar.cpp.
References kWithPlayMeter, kWithRecordMeter, and mWhichMeters.
void MeterToolBar::ShowOutputGainDialog | ( | ) |
Definition at line 472 of file MeterToolBar.cpp.
References mPlayMeter, MeterPanel::ShowDialog(), and MeterPanel::UpdateSliderControl().
void MeterToolBar::UpdateControls | ( | ) |
Definition at line 373 of file MeterToolBar.cpp.
References mPlayMeter, mRecordMeter, and MeterPanel::UpdateSliderControl().
|
overridevirtual |
Implements PrefsListener.
Definition at line 355 of file MeterToolBar.cpp.
References kWithRecordMeter, label, mWhichMeters, RegenerateTooltips(), ToolBar::SetLabel(), ToolBar::UpdatePrefs(), and XO().
Referenced by Create().
|
private |
Definition at line 90 of file MeterToolBar.h.
Referenced by AdjustOutputGain(), Expose(), Populate(), RebuildLayout(), ReCreateButtons(), ShowOutputGainDialog(), and UpdateControls().
|
private |
Definition at line 89 of file MeterToolBar.h.
Referenced by Populate(), and RebuildLayout().
|
private |
Definition at line 92 of file MeterToolBar.h.
Referenced by AdjustInputGain(), Expose(), Populate(), RebuildLayout(), ReCreateButtons(), ShowInputGainDialog(), and UpdateControls().
|
private |
Definition at line 91 of file MeterToolBar.h.
Referenced by Populate(), and RebuildLayout().
|
private |
Definition at line 88 of file MeterToolBar.h.
Referenced by OnSize(), and RebuildLayout().
|
private |
Definition at line 87 of file MeterToolBar.h.
Referenced by GetInitialWidth(), Populate(), RebuildLayout(), ShownByDefault(), and UpdatePrefs().