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

#include <GeneratedUpdater.h>

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

Public Member Functions

virtual ~GeneratedUpdater () override=0
 
 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

bool Tick (wxDC &dc, int pos, double d, const TickSizes &tickSizes, wxFont font, TickOutputs outputs, const RulerStruct &context) const
 
double ComputeWarpedLength (const Envelope &env, double t0, double t1) const
 
- Protected Member Functions inherited from RulerUpdater
void BoxAdjust (UpdateOutputs &allOutputs, const RulerStruct &context) const
 

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 GeneratedUpdater.h.

Constructor & Destructor Documentation

◆ ~GeneratedUpdater()

GeneratedUpdater::~GeneratedUpdater ( )
overridepure virtualdefault

Member Function Documentation

◆ ComputeWarpedLength()

double GeneratedUpdater::ComputeWarpedLength ( const Envelope env,
double  t0,
double  t1 
) const
inlineprotected

Definition at line 29 of file GeneratedUpdater.h.

30 {
31 return env.IntegralOfInverse(t0, t1);
32 }
double IntegralOfInverse(double t0, double t1) const
Definition: Envelope.cpp:1245

References Envelope::IntegralOfInverse().

Referenced by LinearUpdater::Update().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ RulerUpdater()

RulerUpdater::RulerUpdater ( )
inline

Definition at line 84 of file RulerUpdater.h.

84{}

◆ Tick()

bool GeneratedUpdater::Tick ( wxDC &  dc,
int  pos,
double  d,
const TickSizes tickSizes,
wxFont  font,
TickOutputs  outputs,
const RulerStruct context 
) const
protected

Definition at line 15 of file GeneratedUpdater.cpp.

20{
21 const double mDbMirrorValue = context.mDbMirrorValue;
22 const int mLength = context.mLength;
23
24 const int mLeft = context.mLeft;
25 const int mTop = context.mTop;
26 const int mBottom = context.mBottom;
27 const int mRight = context.mRight;
28 const int mOrientation = context.mOrientation;
29
30 const RulerStruct::Fonts& mFonts = *context.mpFonts;
31 const TranslatableString mUnits = context.mUnits;
32 const int spacing = (mOrientation == wxHORIZONTAL) ? 6 : 2;
33 const bool mFlip = context.mFlip;
34
35 // Bug 521. dB view for waveforms needs a 2-sided scale.
36 if ((mDbMirrorValue > 1.0) && (-d > mDbMirrorValue))
37 d = -2 * mDbMirrorValue - d;
38
39 // FIXME: We don't draw a tick if off end of our label arrays
40 // But we shouldn't have an array of labels.
41 if (outputs.labels.size() >= mLength)
42 return false;
43
44 Label lab;
45 lab.value = d;
46 lab.pos = pos;
47 lab.text = tickSizes.LabelString(d, context.mpRulerFormat);
48 lab.units = mUnits;
49
50 const auto result = RulerUpdater::MakeTick(
51 lab,
52 dc, font,
53 outputs.bits,
54 mLeft, mTop, spacing, mFonts.lead,
55 mFlip,
56 mOrientation);
57
58 auto& rect = result.first;
59 outputs.box.Union(rect);
60 outputs.labels.emplace_back(result.second);
61 return !rect.IsEmpty();
62}
static std::pair< wxRect, Label > MakeTick(RulerUpdater::Label lab, wxDC &dc, wxFont font, std::vector< bool > &bits, int left, int top, int spacing, int lead, bool flip, int orientation)
Holds a msgid for the translation catalog; may also bind format arguments.
std::unique_ptr< Fonts > mpFonts
Definition: RulerUpdater.h:52
TranslatableString mUnits
Definition: RulerUpdater.h:53
double mDbMirrorValue
Definition: RulerUpdater.h:49
int mOrientation
Definition: RulerUpdater.h:37
const RulerFormat * mpRulerFormat
Definition: RulerUpdater.h:41

References RulerUpdater::TickOutputs::bits, RulerUpdater::TickOutputs::box, RulerUpdater::TickOutputs::labels, RulerUpdater::TickSizes::LabelString(), RulerStruct::Fonts::lead, RulerUpdater::MakeTick(), RulerStruct::mBottom, RulerStruct::mDbMirrorValue, RulerStruct::mFlip, RulerStruct::mLeft, RulerStruct::mLength, RulerStruct::mOrientation, RulerStruct::mpFonts, RulerStruct::mpRulerFormat, RulerStruct::mRight, RulerStruct::mTop, RulerStruct::mUnits, RulerUpdater::Label::pos, RulerUpdater::Label::text, RulerUpdater::Label::units, and RulerUpdater::Label::value.

Referenced by LinearUpdater::Update(), and LogarithmicUpdater::Update().

Here is the call graph for this function:
Here is the caller graph for this function:

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