| 239 | } |
| 240 | |
| 241 | void 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 |
nothing calls this directly
no test coverage detected