| 228 | IMPLEMENT_CLASS(MeterPanel, wxPanelWrapper) |
| 229 | |
| 230 | MeterPanel::MeterPanel(AudacityProject *project, |
| 231 | wxWindow* parent, wxWindowID id, |
| 232 | bool isInput, |
| 233 | const wxPoint& pos /*= wxDefaultPosition*/, |
| 234 | const wxSize& size /*= wxDefaultSize*/, |
| 235 | Style style /*= HorizontalStereo*/, |
| 236 | float fDecayRate /*= 60.0f*/) |
| 237 | : MeterPanelBase(parent, id, pos, size, wxTAB_TRAVERSAL | wxNO_BORDER | wxWANTS_CHARS), |
| 238 | mProject(project), |
| 239 | mQueue{ 1024 }, |
| 240 | mWidth(size.x), |
| 241 | mHeight(size.y), |
| 242 | mIsInput(isInput), |
| 243 | mDesiredStyle(style), |
| 244 | mGradient(true), |
| 245 | mDB(true), |
| 246 | mDBRange(DecibelScaleCutoff.Read()), |
| 247 | mDecay(true), |
| 248 | mDecayRate(fDecayRate), |
| 249 | mClip(true), |
| 250 | mNumPeakSamplesToClip(3), |
| 251 | mPeakHoldDuration(3), |
| 252 | mT(0), |
| 253 | mRate(0), |
| 254 | mMonitoring(false), |
| 255 | mActive(false), |
| 256 | mNumBars(0), |
| 257 | mLayoutValid(false), |
| 258 | mBitmap{}, |
| 259 | mRuler{ LinearUpdater::Instance(), LinearDBFormat::Instance() } |
| 260 | { |
| 261 | // i18n-hint: Noun (the meter is used for playback or record level monitoring) |
| 262 | SetName( XO("Meter") ); |
| 263 | // Suppress warnings about the header file |
| 264 | wxUnusedVar(SpeakerMenu_xpm); |
| 265 | wxUnusedVar(MicMenu_xpm); |
| 266 | wxUnusedVar(PrefStyles); |
| 267 | |
| 268 | mStyle = mDesiredStyle; |
| 269 | |
| 270 | mIsFocused = false; |
| 271 | |
| 272 | #if wxUSE_ACCESSIBILITY |
| 273 | SetAccessible(safenew MeterAx(this)); |
| 274 | #endif |
| 275 | |
| 276 | // Do this BEFORE UpdatePrefs()! |
| 277 | mRuler.SetFonts(GetFont(), GetFont(), GetFont()); |
| 278 | mRuler.SetFlip(mStyle != MixerTrackCluster); |
| 279 | mRuler.SetLabelEdges(true); |
| 280 | //mRuler.SetTickColour( wxColour( 0,0,255 ) ); |
| 281 | |
| 282 | if (mStyle != MixerTrackCluster) |
| 283 | { |
| 284 | mSlider = std::make_unique<LWSlider>(this, XO(""), |
| 285 | pos, |
| 286 | size, |
| 287 | PERCENT_SLIDER, |
nothing calls this directly
no test coverage detected