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

Method SetActiveStyle

src/widgets/MeterPanel.cpp:1148–1187  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1146}
1147
1148void MeterPanel::SetActiveStyle(Style newStyle)
1149{
1150 mStyle = newStyle;
1151
1152 // Set dummy ruler bounds so width/height can be retrieved
1153 // NOTE: Make sure the Right and Bottom values are large enough to
1154 // ensure full width/height of digits get calculated.
1155 mRuler.SetBounds(0, 0, 500, 500);
1156
1157 if (mDB)
1158 {
1159 mRuler.SetFormat(&LinearDBFormat::Instance());
1160 if (mStyle == HorizontalStereo || mStyle == HorizontalStereoCompact)
1161 {
1162 mRuler.SetOrientation(wxHORIZONTAL);
1163 mRuler.SetRange(-mDBRange, 0);
1164 }
1165 else
1166 {
1167 mRuler.SetOrientation(wxVERTICAL);
1168 mRuler.SetRange(0, -mDBRange);
1169 }
1170 }
1171 else
1172 {
1173 mRuler.SetFormat(&RealFormat::LinearInstance());
1174 if (mStyle == HorizontalStereo || mStyle == HorizontalStereoCompact)
1175 {
1176 mRuler.SetOrientation(wxHORIZONTAL);
1177 mRuler.SetRange(0, 1);
1178 }
1179 else
1180 {
1181 mRuler.SetOrientation(wxVERTICAL);
1182 mRuler.SetRange(1, 0);
1183 }
1184 }
1185
1186 mRuler.GetMaxSize(&mRulerWidth, &mRulerHeight);
1187}
1188
1189void MeterPanel::SetBarAndClip(int iBar, bool vert)
1190{

Callers

nothing calls this directly

Calls 6

SetOrientationMethod · 0.80
InstanceClass · 0.50
SetBoundsMethod · 0.45
SetFormatMethod · 0.45
SetRangeMethod · 0.45
GetMaxSizeMethod · 0.45

Tested by

no test coverage detected