Audacity 3.2.0
Public Member Functions | Static Public Member Functions | Private Member Functions | List of all members
IntFormat Class Referencefinal

#include <IntFormat.h>

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

Public Member Functions

 ~IntFormat () override
 
void SetTickSizes (double units, double &major, double &minor, double &minorMinor, int &mDigits) const override
 
void SetLabelString (wxString &s, double d, double units, double minor, int mDigits, TickType tickType) const override
 
- Public Member Functions inherited from RulerFormat
 RulerFormat ()
 
virtual ~RulerFormat ()
 
virtual void SetTickSizes (double units, double &major, double &minor, double &minorMinor, int &mDigits) const =0
 
virtual void SetLabelString (wxString &s, double d, double units, double minor, int mDigits, TickType tickType) const =0
 

Static Public Member Functions

static const IntFormatInstance ()
 

Private Member Functions

 RulerFormat ()
 

Additional Inherited Members

- Public Types inherited from RulerFormat
enum  TickType { t_major , t_minor , t_minorMinor }
 

Detailed Description

Definition at line 17 of file IntFormat.h.

Constructor & Destructor Documentation

◆ ~IntFormat()

IntFormat::~IntFormat ( )
overridedefault

Member Function Documentation

◆ Instance()

const IntFormat & IntFormat::Instance ( )
static

Definition at line 14 of file IntFormat.cpp.

15{
16 static IntFormat instance;
17 return instance;
18}

Referenced by SpectrumVRulerControls::DoUpdateVRuler(), EqualizationUI::PopulateOrExchange(), EffectScienFilter::PopulateOrExchange(), and LogarithmicUpdater::Update().

Here is the caller graph for this function:

◆ RulerFormat()

RulerFormat::RulerFormat ( )
inlineexplicitprivate

Definition at line 22 of file RulerFormat.h.

22{}

◆ SetLabelString()

void IntFormat::SetLabelString ( wxString &  s,
double  d,
double  units,
double  minor,
int  mDigits,
TickType  tickType 
) const
overridevirtual

Implements RulerFormat.

Definition at line 43 of file IntFormat.cpp.

46{
47 // Replace -0 with 0
48 if (d < 0.0 && (d + minor > 0.0))
49 d = 0.0;
50 s.Printf(wxT("%d"), (int)floor(d + 0.5));
51}
wxT("CloseDown"))

References wxT().

Here is the call graph for this function:

◆ SetTickSizes()

void IntFormat::SetTickSizes ( double  units,
double &  major,
double &  minor,
double &  minorMinor,
int &  mDigits 
) const
overridevirtual

Implements RulerFormat.

Definition at line 20 of file IntFormat.cpp.

24{
25 double d;
26 d = 1.0;
27 for (;;) {
28 if (units < d) {
29 minor = d;
30 major = d * 5.0;
31 return;
32 }
33 d *= 5.0;
34 if (units < d) {
35 minor = d;
36 major = d * 2.0;
37 return;
38 }
39 d *= 2.0;
40 }
41}

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