1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-10-16 15:41:11 +02:00

Accessibility: AutoDuck and Truncate silence effects.

Problem:
Screen readers don't automatically read the units of the values in text boxes.

Fix:
Add units the the accessibility name of the text boxes.

Thanks to Paul for providing ShuttleGui::NameSuffix(), which makes the code neat and readable.
This commit is contained in:
David Bailes
2020-02-21 14:55:15 +00:00
parent 952ff1f61e
commit f5b8b4028b
2 changed files with 11 additions and 0 deletions

View File

@@ -441,6 +441,7 @@ void EffectAutoDuck::PopulateOrExchange(ShuttleGui & S)
1, &mDuckAmountDb, NumValidatorStyle::NO_TRAILING_ZEROES, 1, &mDuckAmountDb, NumValidatorStyle::NO_TRAILING_ZEROES,
MIN_DuckAmountDb, MAX_DuckAmountDb MIN_DuckAmountDb, MAX_DuckAmountDb
) )
.NameSuffix(XO("db"))
.AddTextBox(XO("Duck amount:"), wxT(""), 10); .AddTextBox(XO("Duck amount:"), wxT(""), 10);
S.AddUnits(XO("dB")); S.AddUnits(XO("dB"));
@@ -448,6 +449,7 @@ void EffectAutoDuck::PopulateOrExchange(ShuttleGui & S)
2, &mMaximumPause, NumValidatorStyle::NO_TRAILING_ZEROES, 2, &mMaximumPause, NumValidatorStyle::NO_TRAILING_ZEROES,
MIN_MaximumPause, MAX_MaximumPause MIN_MaximumPause, MAX_MaximumPause
) )
.NameSuffix(XO("seconds"))
.AddTextBox(XO("Maximum pause:"), wxT(""), 10); .AddTextBox(XO("Maximum pause:"), wxT(""), 10);
S.AddUnits(XO("seconds")); S.AddUnits(XO("seconds"));
@@ -455,6 +457,7 @@ void EffectAutoDuck::PopulateOrExchange(ShuttleGui & S)
2, &mOuterFadeDownLen, NumValidatorStyle::NO_TRAILING_ZEROES, 2, &mOuterFadeDownLen, NumValidatorStyle::NO_TRAILING_ZEROES,
MIN_OuterFadeDownLen, MAX_OuterFadeDownLen MIN_OuterFadeDownLen, MAX_OuterFadeDownLen
) )
.NameSuffix(XO("seconds"))
.AddTextBox(XO("Outer fade down length:"), wxT(""), 10); .AddTextBox(XO("Outer fade down length:"), wxT(""), 10);
S.AddUnits(XO("seconds")); S.AddUnits(XO("seconds"));
@@ -462,6 +465,7 @@ void EffectAutoDuck::PopulateOrExchange(ShuttleGui & S)
2, &mOuterFadeUpLen, NumValidatorStyle::NO_TRAILING_ZEROES, 2, &mOuterFadeUpLen, NumValidatorStyle::NO_TRAILING_ZEROES,
MIN_OuterFadeUpLen, MAX_OuterFadeUpLen MIN_OuterFadeUpLen, MAX_OuterFadeUpLen
) )
.NameSuffix(XO("seconds"))
.AddTextBox(XO("Outer fade up length:"), wxT(""), 10); .AddTextBox(XO("Outer fade up length:"), wxT(""), 10);
S.AddUnits(XO("seconds")); S.AddUnits(XO("seconds"));
@@ -469,6 +473,7 @@ void EffectAutoDuck::PopulateOrExchange(ShuttleGui & S)
2, &mInnerFadeDownLen, NumValidatorStyle::NO_TRAILING_ZEROES, 2, &mInnerFadeDownLen, NumValidatorStyle::NO_TRAILING_ZEROES,
MIN_InnerFadeDownLen, MAX_InnerFadeDownLen MIN_InnerFadeDownLen, MAX_InnerFadeDownLen
) )
.NameSuffix(XO("seconds"))
.AddTextBox(XO("Inner fade down length:"), wxT(""), 10); .AddTextBox(XO("Inner fade down length:"), wxT(""), 10);
S.AddUnits(XO("seconds")); S.AddUnits(XO("seconds"));
@@ -476,6 +481,7 @@ void EffectAutoDuck::PopulateOrExchange(ShuttleGui & S)
2, &mInnerFadeUpLen, NumValidatorStyle::NO_TRAILING_ZEROES, 2, &mInnerFadeUpLen, NumValidatorStyle::NO_TRAILING_ZEROES,
MIN_InnerFadeUpLen, MAX_InnerFadeUpLen MIN_InnerFadeUpLen, MAX_InnerFadeUpLen
) )
.NameSuffix(XO("seconds"))
.AddTextBox(XO("Inner fade up length:"), wxT(""), 10); .AddTextBox(XO("Inner fade up length:"), wxT(""), 10);
S.AddUnits(XO("seconds")); S.AddUnits(XO("seconds"));
} }
@@ -487,6 +493,7 @@ void EffectAutoDuck::PopulateOrExchange(ShuttleGui & S)
2, &mThresholdDb, NumValidatorStyle::NO_TRAILING_ZEROES, 2, &mThresholdDb, NumValidatorStyle::NO_TRAILING_ZEROES,
MIN_ThresholdDb, MAX_ThresholdDb MIN_ThresholdDb, MAX_ThresholdDb
) )
.NameSuffix(XO("db"))
.AddTextBox(XO("Threshold:"), wxT(""), 10); .AddTextBox(XO("Threshold:"), wxT(""), 10);
S.AddUnits(XO("dB")); S.AddUnits(XO("dB"));
} }

View File

@@ -767,6 +767,7 @@ void EffectTruncSilence::PopulateOrExchange(ShuttleGui & S)
3, &mThresholdDB, NumValidatorStyle::NO_TRAILING_ZEROES, 3, &mThresholdDB, NumValidatorStyle::NO_TRAILING_ZEROES,
MIN_Threshold, MAX_Threshold MIN_Threshold, MAX_Threshold
) )
.NameSuffix(XO("db"))
.AddTextBox(XO("Threshold:"), wxT(""), 0); .AddTextBox(XO("Threshold:"), wxT(""), 0);
S.AddUnits(XO("dB")); S.AddUnits(XO("dB"));
@@ -775,6 +776,7 @@ void EffectTruncSilence::PopulateOrExchange(ShuttleGui & S)
3, &mInitialAllowedSilence, 3, &mInitialAllowedSilence,
NumValidatorStyle::NO_TRAILING_ZEROES, NumValidatorStyle::NO_TRAILING_ZEROES,
MIN_Minimum, MAX_Minimum) MIN_Minimum, MAX_Minimum)
.NameSuffix(XO("seconds"))
.AddTextBox(XO("Duration:"), wxT(""), 12); .AddTextBox(XO("Duration:"), wxT(""), 12);
S.AddUnits(XO("seconds")); S.AddUnits(XO("seconds"));
} }
@@ -803,6 +805,7 @@ void EffectTruncSilence::PopulateOrExchange(ShuttleGui & S)
NumValidatorStyle::NO_TRAILING_ZEROES, NumValidatorStyle::NO_TRAILING_ZEROES,
MIN_Truncate, MAX_Truncate MIN_Truncate, MAX_Truncate
) )
.NameSuffix(XO("seconds"))
.AddTextBox(XO("Truncate to:"), wxT(""), 12); .AddTextBox(XO("Truncate to:"), wxT(""), 12);
S.AddUnits(XO("seconds")); S.AddUnits(XO("seconds"));
@@ -811,6 +814,7 @@ void EffectTruncSilence::PopulateOrExchange(ShuttleGui & S)
NumValidatorStyle::NO_TRAILING_ZEROES, NumValidatorStyle::NO_TRAILING_ZEROES,
MIN_Compress, MAX_Compress MIN_Compress, MAX_Compress
) )
.NameSuffix(XO("%"))
.AddTextBox(XO("Compress to:"), wxT(""), 12); .AddTextBox(XO("Compress to:"), wxT(""), 12);
S.AddUnits(XO("%")); S.AddUnits(XO("%"));
} }