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

Method Populate

src/toolbars/MeterToolBar.cpp:241–358  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

239}
240
241void MeterToolBar::Populate()
242{
243 MakeButtonBackgroundsSmall();
244 SetBackgroundColour( theTheme.Colour( clrMedium ) );
245
246 if( mWhichMeters & kWithRecordMeter ){
247 //JKC: Record on left, playback on right. Left to right flow
248 //(maybe we should do it differently for Arabic language :-) )
249 mRecordSetupButton = safenew AButton(this);
250 mRecordSetupButton->SetButtonType(AButton::FrameButton);
251 mRecordSetupButton->SetFrameMid(3);
252 mRecordSetupButton->SetLabel({});
253 mRecordSetupButton->SetName(_("Record Meter"));
254 mRecordSetupButton->SetToolTip(XO("Record Meter"));
255 mRecordSetupButton->SetImages(
256 theTheme.Image(bmpRecoloredUpSmall),
257 theTheme.Image(bmpRecoloredUpHiliteSmall),
258 theTheme.Image(bmpRecoloredDownSmall),
259 theTheme.Image(bmpRecoloredHiliteSmall),
260 theTheme.Image(bmpRecoloredUpSmall));
261 mRecordSetupButton->SetIcon(theTheme.Image(bmpMic));
262 mRecordSetupButton->SetButtonType(AButton::Type::FrameButton);
263 mRecordSetupButton->SetMinSize({25, 25});
264 mRecordSetupButton->SetMaxSize({25, 25});
265
266 mRecordMeter = safenew MeterPanel( &mProject,
267 this,
268 wxID_ANY,
269 true,
270 wxDefaultPosition,
271 wxSize( 260, 25) );
272 /* i18n-hint: (noun) The meter that shows the loudness of the audio being recorded.*/
273 mRecordMeter->SetName( XO("Recording Level"));
274 /* i18n-hint: (noun) The meter that shows the loudness of the audio being recorded.
275 This is the name used in screen reader software, where having 'Meter' first
276 apparently is helpful to partially sighted people. */
277 mRecordMeter->SetLabel( XO("Meter-Record") );
278
279#if wxUSE_ACCESSIBILITY
280 auto meterButtonAcc = safenew MeterButtonAx(*mRecordSetupButton, *mRecordMeter);
281#endif
282 mRecordSetupButton->Bind(wxEVT_BUTTON, [=](wxCommandEvent&)
283 {
284#if wxUSE_ACCESSIBILITY
285 meterButtonAcc->SetSilent(true);
286#endif
287 mRecordMeter->ShowMenu(
288 mRecordMeter->ScreenToClient(
289 ClientToScreen(mRecordSetupButton->GetClientRect().GetBottomLeft())
290 )
291 );
292#if wxUSE_ACCESSIBILITY
293 /* if stop/start monitoring was chosen in the menu, then by this point
294 OnMonitoring has been called and variables which affect the accessibility
295 name have been updated so it's now ok for screen readers to read the name of
296 the button */
297 meterButtonAcc->SetSilent(false);
298#endif

Callers

nothing calls this directly

Calls 14

MeterButtonAxClass · 0.85
SetButtonTypeMethod · 0.80
SetFrameMidMethod · 0.80
SetImagesMethod · 0.80
SetIconMethod · 0.80
BindMethod · 0.80
SetSilentMethod · 0.80
AButtonClass · 0.70
MeterPanelClass · 0.70
wxSizeClass · 0.70
SetLabelMethod · 0.45
SetNameMethod · 0.45

Tested by

no test coverage detected