Audacity 3.2.0
Classes | Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
MeterPanelBase Class Referenceabstract

Inherits wxPanel and has a Meter; exposes shared_ptr to the Meter. More...

#include <MeterPanelBase.h>

Inheritance diagram for MeterPanelBase:
[legend]
Collaboration diagram for MeterPanelBase:
[legend]

Classes

struct  Forwarder
 
struct  Resetter
 

Public Member Functions

 ~MeterPanelBase () override
 
template<typename ... Args>
 MeterPanelBase (Args &&...args)
 
std::shared_ptr< MeterGetMeter () const
 
virtual void Clear ()=0
 
virtual void Reset (double sampleRate, bool resetClipping)=0
 
virtual void UpdateDisplay (unsigned numChannels, int numFrames, const float *sampleData)=0
 
virtual bool IsMeterDisabled () const =0
 
virtual float GetMaxPeak () const =0
 
virtual bool IsClipping () const =0
 
virtual int GetDBRange () const =0
 
 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"))
 
- 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
 
wxTabTraversalWrapperoperator= (const wxTabTraversalWrapper &)=delete
 
wxTabTraversalWrapperoperator= (wxTabTraversalWrapper &&)=delete
 

Static Public Member Functions

static TempAllowFocus TemporarilyAllowFocus ()
 

Private Types

using TempAllowFocus = std::unique_ptr< bool, Resetter >
 

Private Member Functions

bool AcceptsFocus () const override
 
bool AcceptsFocusFromKeyboard () const override
 
void Init ()
 

Private Attributes

std::shared_ptr< ForwardermForwarder
 

Static Private Attributes

static bool s_AcceptsFocus { false }
 

Detailed Description

Inherits wxPanel and has a Meter; exposes shared_ptr to the Meter.

Derived classes supply implementations of its pure virtual functions, and the Meter object forwards calls to them. This indirection is done so shared_ptr or weak_ptr to Meter may be used where such pointers to wxWindow classes don't work.

Definition at line 25 of file MeterPanelBase.h.

Member Typedef Documentation

◆ TempAllowFocus

using MeterPanelBase::TempAllowFocus = std::unique_ptr<bool, Resetter>
private

Definition at line 51 of file MeterPanelBase.h.

Constructor & Destructor Documentation

◆ ~MeterPanelBase()

MeterPanelBase::~MeterPanelBase ( )
overridedefault

◆ MeterPanelBase()

template<typename ... Args>
MeterPanelBase::MeterPanelBase ( Args &&...  args)
inline

Definition at line 33 of file MeterPanelBase.h.

34 : wxPanelWrapper( std::forward<Args>(args)... )
35 { Init(); }

Member Function Documentation

◆ AcceptsFocus()

bool MeterPanelBase::AcceptsFocus ( ) const
inlineoverrideprivate

Definition at line 53 of file MeterPanelBase.h.

53{ return s_AcceptsFocus; }
static bool s_AcceptsFocus

◆ AcceptsFocusFromKeyboard()

bool MeterPanelBase::AcceptsFocusFromKeyboard ( ) const
inlineoverrideprivate

Definition at line 54 of file MeterPanelBase.h.

54{ return true; }

◆ Clear()

virtual void MeterPanelBase::Clear ( )
pure virtual

Implemented in MeterPanel.

◆ GetDBRange()

virtual int MeterPanelBase::GetDBRange ( ) const
pure virtual

Implemented in MeterPanel.

◆ GetMaxPeak()

virtual float MeterPanelBase::GetMaxPeak ( ) const
pure virtual

Implemented in MeterPanel.

◆ GetMeter()

std::shared_ptr< Meter > MeterPanelBase::GetMeter ( ) const

Definition at line 85 of file MeterPanelBase.cpp.

86{
87 return mForwarder;
88}
std::shared_ptr< Forwarder > mForwarder

References mForwarder.

Referenced by MeterToolBar::Expose(), and MeterToolBar::ReCreateButtons().

Here is the caller graph for this function:

◆ Init()

void MeterPanelBase::Init ( )
private

Definition at line 80 of file MeterPanelBase.cpp.

81{
82 mForwarder = std::make_shared< Forwarder >( this );
83}

References mForwarder.

◆ IsClipping()

virtual bool MeterPanelBase::IsClipping ( ) const
pure virtual

Implemented in MeterPanel.

◆ IsMeterDisabled()

virtual bool MeterPanelBase::IsMeterDisabled ( ) const
pure virtual

Implemented in MeterPanel.

◆ Reset()

virtual void MeterPanelBase::Reset ( double  sampleRate,
bool  resetClipping 
)
pure virtual

Implemented in MeterPanel.

◆ TemporarilyAllowFocus()

auto MeterPanelBase::TemporarilyAllowFocus ( )
static

Definition at line 17 of file MeterPanelBase.cpp.

17 {
18 s_AcceptsFocus = true;
20}
std::unique_ptr< bool, Resetter > TempAllowFocus

Referenced by anonymous_namespace{NavigationMenus.cpp}::NextOrPrevFrame(), ToolManager::RestoreFocus(), and MeterPanel::SetFocusFromKbd().

Here is the caller graph for this function:

◆ UpdateDisplay()

virtual void MeterPanelBase::UpdateDisplay ( unsigned  numChannels,
int  numFrames,
const float *  sampleData 
)
pure virtual

Implemented in MeterPanel.

◆ wxPanelWrapper() [1/2]

wxPanelWrapper::wxPanelWrapper ( )
inline

Definition at line 43 of file wxPanelWrapper.h.

43{}

◆ wxPanelWrapper() [2/2]

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") 
)
inline

Definition at line 45 of file wxPanelWrapper.h.

Member Data Documentation

◆ mForwarder

std::shared_ptr<Forwarder> MeterPanelBase::mForwarder
private

Definition at line 63 of file MeterPanelBase.h.

Referenced by GetMeter(), and Init().

◆ s_AcceptsFocus

bool MeterPanelBase::s_AcceptsFocus { false }
staticprivate

Definition at line 49 of file MeterPanelBase.h.


The documentation for this class was generated from the following files: