Audacity 3.2.0
CustomUpdater.cpp
Go to the documentation of this file.
1/**********************************************************************
2
3 Audacity: A Digital Audio Editor
4
5 CustomUpdater.cpp
6
7 Dominic Mazzoni
8 Michael Papadopoulos split from Ruler.cpp
9
10**********************************************************************/
11
12
13#include "CustomUpdater.h"
14
16 wxDC& dc, const Envelope* envelope,
17 UpdateOutputs& allOutputs, const RulerStruct& context) const
18{
19 const int mLength = context.mLength;
20 const RulerStruct::Fonts& mFonts = *context.mpFonts;
21
22 allOutputs.majorLabels = mMajorLabels;
23 allOutputs.minorLabels = mMinorLabels;
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}
42
virtual bool TickCustom(wxDC &dc, int labelIdx, wxFont font, TickOutputs outputs, const RulerStruct &context) const =0
RulerUpdater::Labels mMajorLabels
Definition: CustomUpdater.h:44
~CustomUpdater() override
RulerUpdater::Labels mMinorLabels
Definition: CustomUpdater.h:44
RulerUpdater::Labels mMinorMinorLabels
Definition: CustomUpdater.h:44
void Update(wxDC &dc, const Envelope *envelope, UpdateOutputs &allOutputs, const RulerStruct &context) const final
Piecewise linear or piecewise exponential function from double to double.
Definition: Envelope.h:72
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