Audacity 3.2.0
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
CustomUpdater Class Referenceabstract

#include <CustomUpdater.h>

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

Public Member Functions

 ~CustomUpdater () override
 
void Update (wxDC &dc, const Envelope *envelope, UpdateOutputs &allOutputs, const RulerStruct &context) const final
 
void SetData (RulerUpdater::Labels majorLabels, RulerUpdater::Labels minorLabels, RulerUpdater::Labels minorMinorLabels)
 
 RulerUpdater ()
 
- Public Member Functions inherited from RulerUpdater
 RulerUpdater ()
 
virtual ~RulerUpdater ()=0
 
virtual void Update (wxDC &dc, const Envelope *envelope, UpdateOutputs &allOutputs, const RulerStruct &context) const =0
 

Protected Member Functions

virtual bool TickCustom (wxDC &dc, int labelIdx, wxFont font, TickOutputs outputs, const RulerStruct &context) const =0
 
- Protected Member Functions inherited from RulerUpdater
void BoxAdjust (UpdateOutputs &allOutputs, const RulerStruct &context) const
 

Protected Attributes

RulerUpdater::Labels mMajorLabels
 
RulerUpdater::Labels mMinorLabels
 
RulerUpdater::Labels mMinorMinorLabels
 

Additional Inherited Members

- Public Types inherited from RulerUpdater
using Labels = std::vector< Label >
 
using Bits = std::vector< bool >
 
- Static Protected Member Functions inherited from RulerUpdater
static std::pair< wxRect, LabelMakeTick (RulerUpdater::Label lab, wxDC &dc, wxFont font, std::vector< bool > &bits, int left, int top, int spacing, int lead, bool flip, int orientation)
 

Detailed Description

Definition at line 17 of file CustomUpdater.h.

Constructor & Destructor Documentation

◆ ~CustomUpdater()

CustomUpdater::~CustomUpdater ( )
overridedefault

Member Function Documentation

◆ RulerUpdater()

RulerUpdater::RulerUpdater ( )
inline

Definition at line 84 of file RulerUpdater.h.

84{}

◆ SetData()

void CustomUpdater::SetData ( RulerUpdater::Labels  majorLabels,
RulerUpdater::Labels  minorLabels,
RulerUpdater::Labels  minorMinorLabels 
)
inline

Definition at line 27 of file CustomUpdater.h.

32 {
33 mMajorLabels = move(majorLabels);
34 mMinorLabels = move(minorLabels);
35 mMinorMinorLabels = move(minorMinorLabels);
36 }
RulerUpdater::Labels mMajorLabels
Definition: CustomUpdater.h:44
RulerUpdater::Labels mMinorLabels
Definition: CustomUpdater.h:44
RulerUpdater::Labels mMinorMinorLabels
Definition: CustomUpdater.h:44

References mMajorLabels, mMinorLabels, and mMinorMinorLabels.

Referenced by WaveformVRulerControls::DoUpdateVRuler(), and TimeTrackView::Draw().

Here is the caller graph for this function:

◆ TickCustom()

virtual bool CustomUpdater::TickCustom ( wxDC &  dc,
int  labelIdx,
wxFont  font,
TickOutputs  outputs,
const RulerStruct context 
) const
protectedpure virtual

Implemented in CustomUpdaterPosition, and CustomUpdaterValue.

Referenced by Update().

Here is the caller graph for this function:

◆ Update()

void CustomUpdater::Update ( wxDC &  dc,
const Envelope envelope,
UpdateOutputs allOutputs,
const RulerStruct context 
) const
finalvirtual

Implements RulerUpdater.

Definition at line 15 of file CustomUpdater.cpp.

18{
19 const int mLength = context.mLength;
20 const RulerStruct::Fonts& mFonts = *context.mpFonts;
21
22 allOutputs.majorLabels = mMajorLabels;
23 allOutputs.minorLabels = mMinorLabels;
24 allOutputs.minorMinorLabels = mMinorMinorLabels;
25
26 for (int ii = 0; ii < 3; ii++) {
27 Labels& labs = (ii == 0) ? allOutputs.majorLabels :
28 (ii == 1) ? allOutputs.minorLabels : allOutputs.minorMinorLabels;
29
30 wxFont font = (ii == 0) ? mFonts.major :
31 (ii == 1) ? mFonts.minor : mFonts.minorMinor;
32
33 TickOutputs outputs{ labs, allOutputs.bits, allOutputs.box };
34 int numLabel = labs.size();
35
36 for (int i = 0; (i < numLabel) && (i <= mLength); ++i)
37 TickCustom(dc, i, font, outputs, context);
38 }
39
40 BoxAdjust(allOutputs, context);
41}
virtual bool TickCustom(wxDC &dc, int labelIdx, wxFont font, TickOutputs outputs, const RulerStruct &context) const =0
std::vector< Label > Labels
Definition: RulerUpdater.h:74
void BoxAdjust(UpdateOutputs &allOutputs, const RulerStruct &context) const
std::unique_ptr< Fonts > mpFonts
Definition: RulerUpdater.h:52

References RulerUpdater::UpdateOutputs::bits, RulerUpdater::UpdateOutputs::box, RulerUpdater::BoxAdjust(), RulerStruct::Fonts::major, RulerUpdater::UpdateOutputs::majorLabels, RulerStruct::Fonts::minor, RulerUpdater::UpdateOutputs::minorLabels, RulerStruct::Fonts::minorMinor, RulerUpdater::UpdateOutputs::minorMinorLabels, RulerStruct::mLength, mMajorLabels, mMinorLabels, mMinorMinorLabels, RulerStruct::mpFonts, and TickCustom().

Here is the call graph for this function:

Member Data Documentation

◆ mMajorLabels

RulerUpdater::Labels CustomUpdater::mMajorLabels
protected

Definition at line 44 of file CustomUpdater.h.

Referenced by SetData(), and Update().

◆ mMinorLabels

RulerUpdater::Labels CustomUpdater::mMinorLabels
protected

Definition at line 44 of file CustomUpdater.h.

Referenced by SetData(), and Update().

◆ mMinorMinorLabels

RulerUpdater::Labels CustomUpdater::mMinorMinorLabels
protected

Definition at line 44 of file CustomUpdater.h.

Referenced by SetData(), and Update().


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