-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Meter toolbar navigation & accessibility #3696
Meter toolbar navigation & accessibility #3696
Conversation
I'm not sure what the current design spec is for this, but what is read by screen readers is different from my initial suggestion: #2779 (comment) However, what gets read by nvda when tabbing to the button and slider is: There are also some issues to do which how the slider is read when its value is changed, but these are secondary to the above issue. |
@LWinterberg . Given that the scale for the recording volume slider presented visually is wrong (#3690), |
EDIT: ignore my previous comment. Actually, I think we should still display the meter the way it is for recording. However, we should display a % value while dragging the slider - and I think this should be passed to the screen reader too. |
@DavidBailes @Tantacrul I've updated a PR, can you please tell if it's alright now? |
src/toolbars/MeterToolBar.cpp
Outdated
@@ -187,7 +188,7 @@ void MeterToolBar::Populate() | |||
if( mWhichMeters & kWithPlayMeter ){ | |||
mPlaySetupButton = safenew AButton(this); | |||
mPlaySetupButton->SetLabel({}); | |||
mPlaySetupButton->SetName(_("Playback")); | |||
mPlaySetupButton->SetName(wxString::Format(_("Playback meter peak %d db"), -DecibelScaleCutoff.GetDefault())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you confirm that the buttons reformat after the value is changed and the Preferences dialog is dismissed?
If that doesn't work, then I maybe commit 3598fe4 added enough calls to Invalidate().
Just to let you know that I've started to have a look at this. It clearly isn't complete, and I'll add detailed comments soon. |
ed6550f
to
521d500
Compare
Some comments on the volume sliders:
Comments on the class MeterAx:
I'll add some comments on the meter buttons shortly. |
/* i18n-hint: (noun) The meter that shows the loudness of the audio being recorded.*/ | ||
mRecordMeter->SetName( XO("Record Meter")); | ||
/* i18n-hint: (noun) The meter that shows the loudness of the audio being recorded. | ||
This is the name used in screen reader software, where having 'Meter' first | ||
apparently is helpful to partially sighted people. */ | ||
mRecordMeter->SetLabel( XO("Meter-Record") ); | ||
mSizer->Add( mRecordMeter, wxGBPosition( 0, 0 ), wxDefaultSpan, wxEXPAND ); | ||
} | ||
|
||
if( mWhichMeters & kWithPlayMeter ){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does mWhichMeters still need to be a bitwise or of non-exclusive choices?
There was old, old code for an alternative combined play & record meter toolbar in one, instead of the separate ones. I forget when that was removed, but it appears the program is still constructing this third, combined meter toolbar, and yet never showing it and giving you no user interface to turn it on!
@@ -530,6 +530,7 @@ LWSlider::LWSlider(wxWindow *parent, | |||
speed = 0.5; | |||
break; | |||
case FRAC_SLIDER: | |||
case PERCENT_SLIDER: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The commit that adds PERCENT_SLIDER for the play and record meters is perhaps incomplete.
I can double-click on the slider thumb and get a dialog to enter a value. But it must be a fraction from 0 to 1, not a percentage value. Is that acceptable? A design question @Tantacrul
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also see that not all calls to SendUpdate() are followed by ShowTip() -- the dialog has some of those calls. Should ShowTip() be added?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At this commit, at least in macOS, I do not yet get the hover texts over these two slider thumbs. But I do get them for track pan and gain and the mixer board gain slider. Maybe a later commit will fix this. I haven't built them all yet.
@@ -346,11 +346,11 @@ MeterPanel::MeterPanel(AudacityProject *project, | |||
mSlider = std::make_unique<LWSlider>(this, XO(""), | |||
pos, | |||
size, | |||
FRAC_SLIDER, | |||
PERCENT_SLIDER, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, after another commit that changes this default, I do see tooltips, on macOS -- but only if I click the thumb, not when I just hover the mouse over it. This is different from the pan and gain sliders.
The text I see is like ": 47%" suggesting something was supposed to be formatted before the ":" but is left empty.
I think that is mName being empty at these lines of ASlider.cpp:
/* i18n-hint: An item name followed by a value, with appropriate separating punctuation */
label = XO("%s: %s").Format( mName, val );
With pan and gain sliders, I see a hover text, but when I press the mouse, I see the same text, but it moves and is drawn in a bordered, rounded rectangle. That's a little strange.
src/toolbars/MeterToolBar.cpp
Outdated
@@ -183,6 +183,7 @@ void MeterToolBar::Populate() | |||
This is the name used in screen reader software, where having 'Meter' first | |||
apparently is helpful to partially sighted people. */ | |||
mRecordMeter->SetLabel( XO("Meter-Record") ); | |||
mRecordMeter->SetSliderName(XO("Recording Level")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, at another commit, now I see the problems of previous commits corrected. Names before the :, and a nice hover text with a rounded border.
In fact, now the old behavior of the pan and gain sliders looks worse! There should be a minor issue I think to fix them to be consistent with the volume sliders. Which is not part of the scope of this PR. @LWinterberg @Tantacrul
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is still the case, however, that when double clicking the volume slider thumb to get a dialog, I'm still not entering a percentage value, but instead a fraction in the range 0.0 to 1.0.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, dialog now shows values in range 0..100
src/toolbars/MeterToolBar.cpp
Outdated
@@ -150,7 +151,7 @@ void MeterToolBar::Populate() | |||
//(maybe we should do it differently for Arabic language :-) ) | |||
mRecordSetupButton = safenew AButton(this); | |||
mRecordSetupButton->SetLabel({}); | |||
mRecordSetupButton->SetName(_("Record")); | |||
mRecordSetupButton->SetName(wxString::Format(_("Record meter peak %d db"), -DecibelScaleCutoff.GetDefault())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why GetDefault() and not just Read()?
Now if I change interface preferences so the bottom of scale is not -60 dB, the drawing updates for it correctly, but the name spoken for the button still says -60, inconsistently with the display.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DecibelScaleCutoff.GetDefault()
also occurs in the constructor of MeterPanel. I put it there at commit 01a53e7. As a behavior-preserving code transformation, it was correct as I did it, eliminating the use of the constant ENV_DB_RANGE. But was old behavior correct? Perhaps not, and that other line should also be corrected to use Read().
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, fixed
I'm done with this round of review. |
Some comments on the meter buttons. The names of these buttons read by screen readers does not get updated to reflect the updated peak, whether their is monitoring, and whether there has been clipping.
With respect to fully transferring the fix in commit 3d420e0, once the accessibility names of the buttons are correct, I can check whether anything further needs doing about this. There may need to be a minor modification to AButtonAx to give it a silent mode. |
Another way of fixing it would be:
Again, there may need to be some minor fixes to fully transfer the fix in commit 3d420e0. |
8130718
to
37e7f12
Compare
Testing on W19 with @vsverchinsky Vitaly's branch: audacity-win-3.2.2-alpha-20221018+915aba6-x64 In this branch build: a) the sliders on the Meter Toolbars now have the value of the current position b) the tool-tip nicely updates when the slider is moved @DavidBailes David, are these readable by screen readers? My tests with NVDA seems to indicate that this is OK, but I am no accessibility expert. |
Comments on the meter buttons in the latest commit:
|
@vsverchinsky and @crsib since Vitaly's branch build audacity-win-3.2.2-alpha-20221018+915aba6-x64 at least fixes: #3810 Hovertext tooltips for recording and playback sliders no longer show the values is there any chance that we could pull this fix right now (for 3.2.2) while the further important accessibility issues that @DavidBailes raises can be dealt with separately - leaving this PR thread and #3230 still open - while closing off #3810. Bearing in mind that #3810 is a recent regression issue introduced in 3.2.0 with the new combined Meter/Mixer toolbars. ? |
You may well be aware of this already, but there's a comment in void MeterPanel::OnKeyDown(wxKeyEvent &evt) about avoiding a beep. |
@DavidBailes Do I understand correctly that button name should include peak hold value and the slider should include peak value ( |
|
37e7f12
to
93bf92d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reading by screen readers of the meter toolbar is now fine.
Glad to see that you got rid of the unwanted "beep", and that your fix also fixes the issue: #3484
@Paul-Licameli . I know you're busy, but could you review this. I may want to submit a fix for another bug, and want to avoid conflicts when it's merged. |
Very nearly done |
// been added to ensure at least one space, and stop | ||
// words from being merged | ||
if(panel->IsMonitoring()) | ||
*name += wxT(" ") + _(" Monitoring "); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you add the space yourself, for the special reasons explained in the comment, then do not include the spaces in the strings to be translated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This applies to five translatable strings in this function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see the minor fault was in copy-pasted code and not introduced here. So it's just a recommendation.
So now this has been approved by @Paul-Licameli and @DavidBailes - how does this get pulled so it can be tested in a 2.3.3 alpha or beta? |
@dozzzzer did yet complete testing it, right? |
Not yet. |
93bf92d
to
8c07740
Compare
Note that latest 3.3.0 alpha: audacity-win-3.3.0-alpha-20221109+fe50013-x64-msvc2022 does not yet have thus merged in. Looks good on latest 3.2.2.beta: audacity-win-3.2.2-beta-20221109+f0bb347-x64-msvc2022 |
Resolves: #3230
Resolves: #3810
Resolves: #3484
Recommended: