MCPcopy Create free account
hub / github.com/audacity/audacity / UpdateRuler

Method UpdateRuler

src/tracks/timetrack/ui/TimeTrackVRulerControls.cpp:113–141  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

111}
112
113void TimeTrackVRulerControls::UpdateRuler(const wxRect &rect)
114{
115 const auto tt = FindTimeTrack();
116 if (!tt)
117 return;
118 auto vruler = &ruler();
119
120 float min, max;
121 min = tt->GetRangeLower() * 100.0;
122 max = tt->GetRangeUpper() * 100.0;
123
124 vruler->SetDbMirrorValue( 0.0 );
125 vruler->SetBounds(
126 rect.x, rect.y, rect.x + rect.width, rect.y + rect.height - 1);
127 vruler->SetOrientation(wxVERTICAL);
128 vruler->SetRange(max, min);
129 vruler->SetFormat(tt->GetDisplayLog()
130 ? &RealFormat::LogInstance()
131 : &RealFormat::LinearInstance());
132 vruler->SetUnits({});
133 vruler->SetLabelEdges(false);
134 if (tt->GetDisplayLog())
135 vruler->SetUpdater(&LogarithmicUpdater::Instance());
136 else
137 vruler->SetUpdater(&LinearUpdater::Instance());
138
139 auto &size = ChannelView::Get(*tt).vrulerSize;
140 vruler->GetMaxSize(&size.first, &size.second);
141}

Callers

nothing calls this directly

Calls 13

GetFunction · 0.85
SetDbMirrorValueMethod · 0.80
SetOrientationMethod · 0.80
SetUnitsMethod · 0.80
SetLabelEdgesMethod · 0.80
SetUpdaterMethod · 0.80
InstanceClass · 0.50
GetRangeLowerMethod · 0.45
GetRangeUpperMethod · 0.45
SetBoundsMethod · 0.45
SetRangeMethod · 0.45
SetFormatMethod · 0.45

Tested by

no test coverage detected