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

82 Commits

Author SHA1 Message Date
Paul Licameli
5e7d41ec07 Each .cpp/.mm file includes corresponding header before any other...
... except Audacity.h

This forces us to make each header contain all forward declarations or nested
headers that it requires, rather than depend on context.
2019-03-17 22:54:52 -04:00
Paul Licameli
dfeb7e18aa Type aliases for some uses of ComponentInterfaceSymbol...
... to be replaced later with distinct types

Also changing FamilyId => Family in function names

Also NumericFormatId => NumericFormatSymbol
2019-03-14 17:26:20 -04:00
Paul Licameli
c68e336247 More use of std:: style members of wxString...
... replacing:

Length => length
Len => length
2019-03-10 14:44:54 -04:00
Paul Licameli
2db49dc1f0 Use standard library style members of wxArrayString (and wxString) ...
... which will make it easier to change the types of those containers to
std::vectors of other string-like classes

for wxString,

IsEmpty => empty
Clear => clear
Alloc => reserve

for wxArrayString,

Count => size
GetCount => size
IsEmpty => empty
Add => push_back
Clear => clear
Empty => clear
Sort => std::sort (only with default comparator)
SetCount => resize
Last => back
Item => operator []
Alloc => reserve
2019-03-10 14:43:57 -04:00
scootergrisen
b4f7946e9b Remove some double space 2018-10-14 10:42:01 +01:00
James Crook
cbe778adb5 Bug 1977 - Simpler rule for 'Default sample rate' and 'Project rate'.
After discussion it was felt that only using 'Default sample rate' for new projects was better.
2018-09-13 10:48:11 +01:00
James Crook
993cea506d Revised fix for Bug 1977 - Using Spectrogram Settings in TCP causes Audacity to reset Project Rate to default 44100 Hz
This revised fix:
- No longer attempts to drive "Default sample rate" from the selection toolbar.
- No longer drives 'Project rate' direct from prefs.  It's usual it comes from the project.
- Instead 'Project rate' in the project might change if 'Default sample rate' pref is updated, but ONLY if the project has no tracks.
- When 'Project rate' in the project is updated, that is now always signaled to the selection toolbar.  Previously it wasn't.
2018-09-11 15:07:25 +01:00
James Crook
a66d7442a3 Bug 1977 - Using Spectrogram Settings in TCP causes Audacity to reset Project Rate to default 44100 Hz
The Project Rate in the Selection Toolbar and in the Preferences dialog are now the same thing.  They ALMOST were before, causing confusion, and this bug.
This means that the fancy mechanism to set 'other' rates in Preferences is moot, since the Selection Toolbar bar does not have that option.  49000 will be overridden by 48000 for example.
2018-09-10 20:23:22 +01:00
James Crook
c8a31324bc Remove dead code from SelectionBar
and add some comments.
2018-04-14 22:20:08 +01:00
David Bailes
f9ee3cdc45 Fix some of the accessibility names that disappeared with the move to WX 3.1.1
The main change in wxWidgets for the setting of accessibility names is:
7dab555f71 (diff-04f5191d86f95b1c4d5d9c979da65878)

Before this change, with wxUSE_ACCESSIBILITY set to 1, for wxWindow and all the classes derived from it, wxWidgets automatically created accessible objects to handle accessibility itself. Because the way wxWindowAccessible::GetName() was written, the accessibility names of lots of windows and controls had to be set using SetName().

After the change, by default, the accessibility of instances of these classes is handled by Windows. Where the accessibility of a control is handled by Windows, then the accessibility name is automatically set to so the appropriate value. However, an accessible can still be set using SetAccessible() then wxWidgets handles the accessibility for this object.

So for many controls we can just leave Windows to set the accessibility name. However, for controls which don't have any visible labels, or where we want to accessibility name to different from the visible text, then we have to set an accessible object for that control, and then call SetName(). The Class WindowAccessible can be used for this purpose. And for custom widgets, like the TrackPanel, and the NumericTextCtrl, SetAccessible() still has to be called, since they need bespoke accessible objects

So in the cases where we want the accessible name to be different from normal, we now need to explicitly set an accessible object. (Before, this wasn't needed, as accessible objects were automatically created.).

Some notes of the fixes included in this commit:
1. The fixes cover the main window, preferences, and built-in effects. Other fixes will follow.

2. In ShuttleGui, I've set accessible objects for wxTextCtrls and wxSliders. So all of these widgets still need the name set. This was done because there are a lot of instances where these controls need non standard accessibility names, and so it saves having to put lots of SetAccessibles throughout the code.

3. For wxPanel, Windows picks up the accessibility name from the label, and so SetLabel() can be used instead of SetName(). This is just as well, since for windows that contain other windows or controls, setting WindowAccessible as the accessibility object breaks the accessibility tree.

Note that at some stage a lot of calls to SetName() can be removed from the code as they are no longer needed, but it might be better to leave them there for the moment, just in case they are unexpectedly needed.
2018-04-06 17:24:40 +01:00
Paul Licameli
0fb02a8024 IdentInterfaceSymbol in NumericTextCtrl; don't persist translated 2018-03-28 14:00:17 -04:00
andheh
50901b9454 fixed initialization order warnings 2018-03-06 21:29:54 +00:00
David Bailes
1412f21f66 Make the name of a control in the selection bar less verbose
Make the name less verbose for the benefit of the users of screen readers.
2018-02-28 16:18:40 +00:00
Paul Licameli
2f3604bdea Rewrite many calls to Connect() with Bind()...
... it's the more modern way, and does better type checking, without the
dubious casts of pointers-to-member-functions.
2018-02-21 19:28:11 -05:00
Paul Licameli
5724780be9 NumericTextControl ctor arguments...
... follow wxWidgets conventions for first two arguments; add Options
2018-02-21 19:21:02 -05:00
James Crook
c0fceb3b66 Wording changes.
- Losing a ':' on a toolbar
- Clarity that we are fitting project/selection to width, not height.
2018-01-17 11:15:32 +00:00
Paul Licameli
7fd78183d2 Remove needless uses of wxString::c_str() in wxString::Format...
... and similar wx "variadics," which all treat wxString smartly enough that
you don't need this.

Don't need c_str either to convert wxString to const wxChar * because
wxString has a conversion operator that does the same.
2018-01-01 20:34:33 -05:00
James Crook
db45280695 Add names to some windows.
This is mainly for automation, so that when exploring the windows we have a name for
each.
2017-12-22 14:03:32 +00:00
James Crook
f463eda36c Clean up some dead code and MSVC warnings.
- Dead code from experiments in SelectionBar removed.
- Many warnings about unused parameters fixed with WXUNUSED()
- Many warnings about signed / unsigned comparisons cleaned up.
- Several 'local variable declared but not used' warnings fixed.
2017-12-08 15:20:39 +00:00
Paul Licameli
9612e3d971 indentation, final newlines, spelling, remove unused members 2017-11-05 21:01:38 -05:00
James Crook
dc05b94fd1 Bug 1701 - Mac: Text descriptors in Selection Toolbar become invisible after Open command
Problem was that on mac enable/disable clears the colour back to black.
The easiest workaround was to create a new class auStaticText that does all that we
need for wxStaticText.
2017-08-13 23:04:13 +01:00
James Crook
6cb6652464 Fix Linux: triple height Selection Toolbars 2017-07-29 17:39:33 +01:00
Paul Licameli
f0de38dec1 Scanned for bad naked new; found none; changed comments, used safenew 2017-07-23 09:35:01 -04:00
David Bailes
7591a65e56 Bug 1693: partial fix.
Problem: When selection details set to start and end in selection bar, start cannot be increased higher than end, and end cannot be decreased to be less than start. These restrictions are not present in previous versions of Audacity, and are not desirable.

Fixed.
2017-07-21 10:43:27 +01:00
James Crook
c4a1787bb9 Improve source for generation of .pot file.
"clang " is the name of a compiler and should not be translated.
Other changes here from seeing how translation was actually being done.
2017-07-20 18:55:07 +01:00
David Bailes
2185b42d84 Selection bar drop down list box: Fix name read by Jaws screen reader
Problem: If the accessibility name of a control is empty, Jaws may use nearly text for the name - in this case Audio position.

Fix: Set the accessibility name to "\a".
2017-07-14 16:35:37 +01:00
James Crook
f418de2f60 Rearrange Selection Toolbar fields, and fix spacings.
The layout of SelectionToolbar and SpectralSelction Tollbar now match, and they can be placed nicely side by side.
The borders around controls have been tweaked.
Extra vertical spacer lines have been added into the title row.
2017-06-01 16:48:28 +01:00
James Crook
c43a6408d9 Lose hyphen on selection toolbar 2017-06-01 15:03:47 +01:00
James Crook
1c6c608c13 Use same format for choice in Selection Toolbar as in SpectralSelection Toolbar
I've deliberately not given the choice a title, and deliberately put the word 'selection' at the end, so as to be better/faster for Screen Reader users.
The look of Selection Toolbar and Spectral Selection Toolbar is now consistent.  In dark themes both could have better looking choice boxes.
2017-05-31 19:48:46 +01:00
James Crook
7122877269 Fix crash from bad SelectionToolbarMode
When out of range, it was indexing outside an array.  Now forced to be in range.
2017-05-30 12:38:25 +01:00
James Crook
389335d761 Clickable Start - Length and stable position of '<' and '>'
Minor tweaks to Selection Toolbar field chooser.
2017-05-27 19:32:47 +01:00
James Crook
ca01b55d1b Add clickable < and > alternative to RadioButtons for start/length
This is a step towards the intended eventual interface.
It's a temporary step back for VI users.
2017-05-27 18:46:44 +01:00
James Crook
b3a70b5993 Add hyphen between fields and tooltips.
Tooltips tell users what the abbreviated names in the radio button group mean.  The hyphen helps a little in relating the title , which has a hyphen in it, to the two fields.
2017-05-25 11:39:30 +01:00
James Crook
01356f9e3e Add i18n hints for selection toolbar 2017-05-24 19:37:29 +01:00
James Crook
59a9539ba0 Fix Radio Buttons on SelectionToolbar for Dark Theme
The workaround for Dark Theme can require static text boxes for the radio labels to be able to colour the text.  These have been added back.
2017-05-24 19:26:59 +01:00
James Crook
3761ae3fe5 Replace dummy checkbox by vertical line.
Fortunately a vertical line works just as well as a checkbox in working around the bug where radio buttons change to the first field.  It is better for screen readers too as it is not included in the tab order.
2017-05-24 18:55:20 +01:00
James Crook
552a69df72 Add radio buttons for Start-End, Start-Length e.t.c.
The checkbox on the selection toolbar is a temporary work around for a bug in windows with tabbing.  Tabbing into a radio button will set the first item of the radio button group without it.  Still looking for a better workaround.
2017-05-24 16:56:49 +01:00
James Crook
655fc9d9dc Smarter VoiceOver text for Selection controls. 2017-05-22 23:01:32 +01:00
James Crook
7a6dda19e4 Add title-clicking to SelectionToolbar
This is a convenience for sighted users.  If they are showing start, center, length, end, they can click on the title 'Center' to preserve it, and then modify length.  Similarly for the other controls.  This makes working with more than two controls much more intuitive.
2017-05-22 16:01:49 +01:00
James Crook
6a9e0ffe28 Fix Travis Build
Missing wx includes.
2017-05-22 14:10:56 +01:00
James Crook
7d31691fd3 Allow selected controls on SelectionToolbar
The toolbar can now show subsets of the start, center, length and end numeric controls.  The choice is made using a button with a pop-up menu.  The two most recently modified controls 'drive' the other two, whether they are visible or not.  If shown, the driven controls are indicated in the name above (also for screen readers).

Most users will opt to just show two of the controls, e.g. start and end.

The menu button (Classic theme) has three dots on it.  Other themes don't yet have the icon and will show as black.
2017-05-22 13:46:06 +01:00
James Crook
f859bf62c7 Remember Start/Center setting on SelectionToolbar
I mistakenly had it always set to ShowStart = true
Also tidied up a hastily written comment.
2017-05-09 13:29:15 +01:00
James Crook
52509d4bbd Add option of Start/Center to SelectionBar
We now have Start/Center and End/Length, per Robert and Martyn's suggestion
I've also tidied up the code here that was repetitive/messy.
2017-05-09 12:37:55 +01:00
James Crook
6102c774ee Bug 1630 - Accessibility of the length/end radio buttons
For Light and Classic themes that use black text, we'll use the length/end buttons because Windows uses black for text.
For Dark and HiContrast themes that use a light colour for text, we'll use the length/end buttons IF the OS is set to use the exact same colour for text.
That for example happens if we use Microsoft's HiContrast2 and our HiContrast theme.

If the OS and theme text colour differ, then if we set blend theme colours option, which is the default, we might still use the OS colour for text in Audacity.  That will happen if the OS colour has decent contrast to our theme's background colour.   Decent is defined as more than 250 difference in RGB values.  If we use the OS colour for text, then we get the proper length/end buttons.

Note that this adds a new feature to the theme blending, in that the text colour will often adapt.  Useful when using custom text colours with HiContrast2.  When the text colour adapts, we will continue to get proper length/end buttons.

Advice to users is to match OS and Audacity themes, and use the blend option.  When themes don't match, it may be desirable to disable blending.
2017-04-28 15:49:02 +01:00
James Crook
6bcbe417e9 Make SelectionBar end/length radio buttons behave normally
They had lost the focus/voice-over functionality because I added code to draw them in the
theme colour.  Now I disable that code, IF recolouring is both set and active.  This will happen
for example, if Hi-Contrast is used with the Hi-Contrast system theme.
2017-04-26 15:58:50 +01:00
James Crook
c17a7f535e Improve repainting after a theme change.
Now most things repaint properly after a theme change.  The sliders on the tracks don't yet.
2017-04-04 14:43:47 +01:00
James Crook
028ed19d90 Sync with DarkAudacity 2017-04-02 23:07:13 +01:00
Paul Licameli
78be459fa1 Convert sampleCount <-> floating or -> long long explicitly ...
... A non-narrowing conversion out to long long is a necessity, but the
conversions to float and double are simply conveniences.

Conversion from floating is explicit, to avoid unintended consequences with
arithmetic operators, when later sampleCount ceases to be an alias for an
integral type.

Some conversions are not made explicit, where I expect to change the type of
the variable later to have mere size_t width.
2016-09-15 21:02:31 -04:00
Paul Licameli
de9579dbe9 Bug1193: Mac font sizes as in 2.1.1 for ruler, sel toolbars 2016-06-22 14:21:04 -04:00
Paul Licameli
d6187f6972 Ensure correct update of Selection bar tooptips for language change 2016-06-21 00:15:37 -04:00