1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-17 08:30:06 +02:00

78 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
906e55f047 Experimental.h in all .h or .cpp files that directly use EXPERIMENTALs...
... except Audacity.h; and in no others.

Do so even if Experimental.h gets multiply included, as in both the .h and
.cpp files.

This makes it easier to do a text scan to be sure there are no unintended quiet
changes of meaning because of omission of Experimental.h when the flag is
an enabled one.

Also move inclusions of Experimental.h earlier.

Also don't require Experimental.h to be preceded by Audacity.h to define
EXPERIMENTAL_MIDI_OUT correctly.
2019-03-17 22:54:00 -04:00
Paul Licameli
173a300427 Include nothing before Audacity.h, as comments say we should...
... and remove some duplicated inclusions
2019-03-17 21:41:39 -04:00
Paul Licameli
dd86346156 ShuttlegGUI: const wxArrayStringEx & arguments, not wxArrayString *...
... for choice, combo, and listbox; reference allows passing temporaries,
eliminating need for some variables to hold the string arrays.
2019-03-16 07:17:21 -04:00
Paul Licameli
dcd82b8ef5 ShuttleGui::AddChoice takes int to specify selection, with a default...
... This makes things brief and where non-default avoids some repetition of
literal strings
2019-03-15 23:35:13 -04:00
Paul Licameli
dd8eb9e3d9 Less use of wxArrayString::Index() ...
... instead use the utility make_iterator_range and its index() or contains()
method.  This generic utility works with any container defining begin() and
end().

This further lessens dependency on wxWidgets container idioms.
2019-03-10 14:45:06 -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
Paul Licameli
a5e0b66d1f WrappedType is immutable (though it points to something mutable) 2019-03-10 12:38:35 -04:00
James Crook
466e9c179e Create ComponentInterface
It combines the old IdentInterface with the ParamsInterface, providing an identifier and parameters (if needed).
The main purpose of the change is to make the class hierarchy (as viewed via doxygen) much easier to follow.
2018-11-02 17:04:43 +00:00
David Bailes
42efe53884 Bug 1980: NVDA 2018.3 and check boxes with empty accessibility names
Problem. NVDA 2018.3 does not read buttons, check boxes or radio buttons which have empty accessibility names. In fact for Scriptable dialogs which start with a check box with an empty accessibility name, none of the controls in the dialog are read.

This problem is connected with the new Audacity appModule in NVDA 2018.3 which was supplied by Robert and myself. For reasons which aren't immediately obvious, it has a problem when the accessibility name of the object is empty.

Fix: for check boxes which have an empty label, set the accessibility name to "\a", which is non-empty, but not read by screen readers.

Note: If someone ever wanted to have buttons or radio buttons with empty labels, there could be a similar fix. But there is unlikely to be a demand for such controls.
2018-09-18 16:33:26 +01:00
David Bailes
8e71ebca87 Fix accessibility of Help button in dialogs
The name of the button was not being read as "help" by NVDA due to its built in appmodule for audacity. This meant that the empty label was being read rather than the accessibility name.

Fix: Call SetLabel. In addition, with the label being set, an accessible does not need to be set, because we can just let windows set the accessibility name from the label.
2018-04-12 08:56:14 +01:00
Steve Daulton
564e840d54 Fix background colour of Prefs
On Linux, it is not necessary to explicitly set the background colour
here, but left a comment in case it is required on other platforms.
2018-04-08 18:18:54 +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
0bc96c3831 Oops, Internal() was needed here, not Translation() 2018-03-26 01:06:24 -04:00
Paul Licameli
eb35d84092 GetInfo for Preferences lists internal enum names, not translated 2018-03-25 14:52:51 -04:00
Paul Licameli
17cc8a495f Define and use TieNumberAsChoice for Quality sample rate setting 2018-03-25 14:48:52 -04:00
Paul Licameli
872b4f430c New overload of TieChoice taking EnumSetting...
... and change misleading argument names
2018-03-25 14:05:05 -04:00
Paul Licameli
f7f721b52d Automatic setting size hints in all choice controls in ShuttleGui...
... excpet in a few places that populate the choice control late and then
do it explicitly
2018-03-20 14:42:36 -04:00
James Crook
2c57cd4344 Format dialogs more evenly. 2018-03-18 20:05:27 +00:00
James Crook
e978840044 Remove 'Set' from optional items.
This removes the text saying 'Set' beside an optional item.
It's a more far reaching change, as it allows the optional items to be
aware they are optional, paving the way for future nicer presentation.
2018-03-18 20:05:10 +00:00
James Crook
b1862d2b11 Rearrange Macros buttons
- Allows Macro dialogs to be smaller.
- Order is more logical.
- Layout is neater (better aligned).
- Height stays stable on Expand/Shrink.
2018-03-14 16:37:15 +00:00
Paul Licameli
bc773e02d3 Supply some missing translation in Macros dialogs...
... The "Set" prompt for checkboxes;

Strings in Choice controls, which had been declared translatable with XO, but
the translations not yet used.

This can be tested in Ukrainian locale now, for editing parameters of
commands like Select or Drag, but be aware that even uk.po is not up to date
for all recent changes in the Manage Macros dialog itself.
2018-03-07 15:06:55 -05:00
andheh
726f33e802 fixed an initalization order warning in ShuttleGui.cpp 2018-03-06 22:24:58 +00:00
James Crook
6f8d27208f Remove Apply-Macro from Tools menu.
Done by giving Macros... dialog an Expand / Shrink button
so that we can use it as just an apply-to-projects dialog, if we want.
The dialog is modal, and can be kept open whilst we work.  So for example
we could put useful presets into it as macros.
2018-03-03 22:20:25 +00:00
James Crook
ea4968e094 Add GetInfo Preferences. 2018-02-27 22:26:28 +00:00
James Crook
2180379a18 Optional parameters now working. 2018-02-24 14:20:24 -05:00
Paul Licameli
8be1e8fdad Remove wxArray(Int|Long|Double) except where wxWidgets fns need it 2018-02-21 19:33:31 -05:00
Paul Licameli
9612e3d971 indentation, final newlines, spelling, remove unused members 2017-11-05 21:01:38 -05:00
Paul Licameli
f0de38dec1 Scanned for bad naked new; found none; changed comments, used safenew 2017-07-23 09:35:01 -04:00
James Crook
60405eb7fe Theme Tweaks
- Highlighting of Buttons in TCP and Sliders
- No crinkly Help Icon anymore
- Invisible numbers in NoteTrack fixed
- Better visibility of label track dragger elements
- Theme rearranged more logically, and dead images culled
2017-07-19 15:27:00 +01:00
James Crook
52caef9775 Add tooltip for iconic help button. 2017-05-15 21:52:30 +01:00
Steve Daulton
e16f6f9221 Add small help button to Prefs pages 2017-05-14 19:02:36 +01:00
David Bailes
a17966609f Fix for bug 1480
Baselines of text produces by ShuttleGuiBase::AddPrompt and ShuttleGuiBase:AddUnits are different.

Simple fix of changing a style. Presumably this was a typo.
2016-08-17 10:35:40 +01:00
Paul Licameli
13e056de43 More uses of safenew 2016-08-08 10:07:37 -04:00
Paul Licameli
942c62b6f6 Remove some naked new amd delete in: various 2016-08-08 07:51:24 -04:00
Paul Licameli
4739f3e27b Compensate for wxW 3 tab navigation deficiencies on Mac...
... using char hook event handlers.  We don't need to go the extreme length
of patching wxWidgets source.
2016-06-25 19:14:05 -04:00
David Bailes
85e928de73 Making access keys for preview buttons consistent
In std::unique_ptr<wxSizer> CreateStdButtonSizer(wxWindow *parent, long buttons, wxWindow *extra)
changed access key of preview button from v to P, so that it's consistent Preview buttons created elsewhere.
2016-04-11 13:48:13 +01:00
tip2tail
aa5ffe99a7 Timer Recording Enhancements to allow Automatic Save and Export after
recording.  Also allows for additional options to be carried out after a
successful timer recording such as Exit, Retsrat and Shutdown.
2016-03-30 20:42:59 +01:00
Paul Licameli
0c9deb398c Fix mac build. No standard headers in Audacity.h. 2016-03-01 12:22:37 -05:00
Paul Licameli
7824e94030 Harmlessly qualify classes as final (or explicitly comment not)...
... Should have no effect on generated code, except perhaps some slight faster
virtual function calls.  Mostly useful as documentation of design intent.

Tried to mark every one of our classes that inherits from another, or is a
base for others, or has abstract virtual functions, and a few others besides.
2016-02-24 20:58:30 -05:00
Paul Licameli
cf3daebff6 Reviewed allocations of wxMenuBar items. 2016-02-20 20:23:54 -05:00
Paul Licameli
1c07741d57 Sizers are owned by wxWindow objects when added, so use safenew, or...
... use unique_ptr in the interim between building them and adding.

This checks eliminates some naked news, which were not paired with deletes.
2016-02-18 18:58:38 -05:00
Paul Licameli
4d78e353c3 Revert "sizers"
This reverts commit 84c0a0b6663a1210be502a76ab9c48dd330b3919.
2016-02-18 14:50:52 -05:00
Paul Licameli
84c0a0b666 sizers 2016-02-18 02:54:50 -05:00
Paul Licameli
df6a7c5464 More uses of safenew for classes we derive from wxWindow classes...
... Also removed some unnecessary deletes of widgets that are managed by parent
windows
2016-02-14 20:39:28 -05:00
Paul Licameli
3f237daddc Use macro safenew for many allocations of wxWindow subclasses 2016-02-14 20:20:19 -05:00
Paul Licameli
7c4c45a0d5 "new"->"NEW" in comments, easier to find remaining naked operator new 2016-02-14 18:52:41 -05:00
Paul Licameli
1278b9644a Uniform naming of symbols in Experimental.h 2015-08-31 17:55:56 -04:00
Leland Lucius
6a9dae20f5 Appearance on OSX is now back to normal or better
Some additional wx3 cleanup as well.
2015-08-23 20:25:01 -05:00
Leland Lucius
1e195ecea6 Fix many wx3.1.0 assertions now to prevent double testing 2015-07-30 02:05:23 -05:00