Commit Graph

299 Commits

Author SHA1 Message Date
Paul Licameli 618fee21ec TranslatableString for ComponentInterface::GetDescription() 2019-12-16 14:21:57 -05:00
Paul Licameli 53ee9c9800 TranslatableString for titles, names, labels of wxDialogWrappers...
... Found one missed translation in CommandTargets.cpp
2019-12-16 10:58:05 -05:00
Paul Licameli 0cf90d65e6 S.GetParent() for all windows passed to ShuttleGui::AddWindow()...
... Verified that this makes no real change.
2019-12-10 09:58:38 -05:00
James Crook 5a3e9cd063 Fix dialog naming
For nicer Doxygen results, we need consistency in naming of classes.
Dialag classes are now called SomethingDialog.
2019-12-06 10:39:07 +00:00
Paul Licameli 15260c2c95 TranslatableString can store a context and format arguments...
... Format arguments are substituted into the translation of the msgid, which
may not be known at the time the format arguments are captured (because locale
may change).  This allows TranslatableString with arguments to be constructed
at static initialization time.

There is also a special "verbatim" or null context which makes no translations
of msgids.

There is not yet any use of other contexts besides default or null.
2019-12-05 11:34:06 -05:00
Paul Licameli 930c21dc2a Define and use ShuttleGui::Size 2019-12-02 22:02:46 -05:00
Paul Licameli 3aef0f4eef Don't directly create wxPanel in Equalization 2019-12-02 22:01:27 -05:00
Paul Licameli 96291c5476 Remove second argument of AddWindow(), use Position() instead 2019-12-02 22:01:22 -05:00
Paul Licameli b5ee7676fd Rename ShuttleGui::SetSizeHints, chain-call it like other methods...
... And rewrite some other existing calls to SetMinSize
2019-12-02 19:35:06 -05:00
Paul Licameli 64a96e6f01 Define and use ShuttleGui::ConnectRoot...
... And corrected improper connections in HistoryWindow and ContrastDialog,
improper because they got called with the wrong this pointer, to
the control instead of the dialog.  But that was harmless anyway because the
handlers did not use this.
2019-12-02 19:35:01 -05:00
Paul Licameli d98e41aad1 Define and use ShuttleGui::Disable; remove EnableCtrl 2019-12-02 17:54:07 -05:00
Paul Licameli 1bfbfb9640 ShuttleGui::Style analogous to other functions 2019-12-02 17:23:34 -05:00
Paul Licameli 9eeef4713d Define and use ShuttleGui::Name and NameSuffix...
... For radio buttons, the name will default to the same as the prompt if not
otherwise specified
2019-12-02 16:55:46 -05:00
Paul Licameli 72df562c4a Conversion of TranslatableString to wxString is private 2019-12-01 18:17:57 -05:00
Paul Licameli f846c25806 Rewrite AddChoice and TieChoice calls...
... either lifting or inlining array-of-string computations, so fewer statements
are mixed among ShuttleGui method calls
2019-11-29 15:16:48 -05:00
Paul Licameli ae353fe61f Specify list control columns and styles all in one call 2019-11-28 14:24:44 -05:00
Paul Licameli 089b46ab64 Specify initial radio button state in ShuttleGui method arguments 2019-11-28 14:24:44 -05:00
Paul Licameli 7ccd35d219 wxWidgets docs recommend: don't SetSizeHints on non-top-level windows 2019-11-28 14:24:43 -05:00
Paul Licameli eb2161d3aa Fix (again) TAB key navigation to graphic EQ sliders on Mac...
... original fix was at c8d95e1

regression was at 3e98a10
2019-11-14 23:28:15 +00:00
James Crook eb00470042 Bug 2231 - Graphic Eq may create wrong effect 2019-11-08 20:12:13 +00:00
James Crook a3eaf7d46e Fix Graphic EQ slider height tiny on Linux.
Thanks to Steve for alerting to the problem.
2019-09-04 20:07:26 +01:00
James Crook 45ddc8c413 Rename EQ effects and lose 'extra knobs'
Team agreed on new names, and to remove redundant controls that are (mostly) just confusing.  Also retired EQ effect.
2019-08-27 19:38:32 +01:00
James Crook 569028268d Bug 2207 - Filter Curve and Graphic EQ have no factory presets (available in 2.3.2 and earlier) 2019-08-24 13:55:54 +01:00
James Crook 83ddabc895 Bug 1750 - Equalization: EQ control points can disappear if the points are at the same frequency 2019-08-23 19:28:35 +01:00
James Crook a1f0a70ddd EQ Tweaks for Independence
Added:
- Independent Help pages
- Independent Curves

Also tweaked for the new namings
2019-08-23 18:41:26 +01:00
James Crook 8031bf7c14 Bug 2206 - Filter Curve (and Graphic EQ) corrupt saved curves (on the right)
Frequency range was set too narrow.
2019-08-23 16:39:05 +01:00
James Crook bbc202807f EQ: Don't Load XML data any more
Also abolished use of nPoints, making parameters easier to set up.
This also fixes an issue where more points than are there could be read, if cfg file bad.
2019-08-23 12:12:07 +01:00
David Bailes 889bf7c191 Graphic equalization: fix accessibility name
Overlooked this change which should have been done when we moved to wxWidgets 3.1.1
2019-08-23 11:10:15 +01:00
James Crook 3e98a109c9 Make Graphic EQ vertically stretchable
Drag to enlarge the window, and the length of the graphic sliders.
This was part of splitting EQ.  The split effect would look strange if we did not do this.

Graphic EQ sliders are now in a sizer, and so we no longer lay them out 'by hand' in the way we previously did.
2019-08-22 20:08:52 +01:00
James Crook c9fbd283b7 Fix release build EQ functions.
Uninitialized variable was 0 in debug builds, but could be very high value in release.
2019-08-21 23:46:31 +01:00
James Crook c1c7d5f0a0 Graphic EQ / Filter Curve mods
This is part of the work of fixing Equalization by splitting it into two effects.

The Graphic EQ effect now does not show the curve or 'grid on/off' checkbox.
Screenshot Commands now include Graphic EQ and Filter Curve in the captures (and not EQ anymore).
Menu items now have a space in them.
2019-08-21 22:22:13 +01:00
James Crook 23063511d9 Bug 2031 - Equalization: presets under the Manage button do not save custom EQ curves
Further work needed, and a tidy up to bring arrays into ShuttleGui would be nice, but this gets us most of the way.
2019-08-21 17:56:31 +01:00
Paul Licameli 5797637528 Bug2112: Crash opening Equalization settings for Macro...
... It was introduced at 2e11844f6a, so since
2.3.1

A null check on inputTracks() was needed.

This appears to be the only effect where inputTracks() was called while
populating its dialog, so there should not be any similar crashes with other
effects.
2019-07-14 11:24:30 -04:00
Paul Licameli 7e1c469d7f Remove some unnecessary #include directives 2019-07-09 12:45:50 -04:00
Paul Licameli 7ed99c6e8f Split EnvelopeEditor.cpp from Envelope.cpp...
... Envelope drops down out of the big strongly connected component, the new
piece stays behind
2019-06-10 20:48:38 -04:00
Paul Licameli 05efeeb5bd New files for ProjectSettings 2019-06-03 01:13:13 -04:00
Paul Licameli dd10e00a2d New attached structure ProjectSettings stores rate, snap-to, et al. 2019-06-02 14:42:00 -04:00
Paul Licameli 116ff70756 static TrackFactory::Get()...
... not member functions of AudacityProject
2019-05-23 13:55:14 -04:00
Paul Licameli b5a57682b6 static ViewInfo::Get() and ZoomInfo::Get()...
... not member functions of AudacityProject
2019-05-23 12:58:47 -04:00
Paul Licameli 14ab93a01f static TrackList::Get()...
... not member function of AudacityProject
2019-05-23 12:58:47 -04:00
Paul Licameli 6c57948d8f Remove unnecessary #include-s from .cpp files...
... Unnecessary because transitively included.

But each .cpp file still includes its own .h file near the top to ensure
that it compiles indenendently, even if it is reincluded transitively later.
2019-05-16 17:21:00 -04:00
Paul Licameli c8d95e1117 Bug2105: Enable TAB to sliders on Mac...
... I think this is a defect in wxWidgets, but one we can work around with a
simple wrapper class around wxSlider overriding one method.

To make the fix complete, change all occurrences of "safenew wxSlider"
but the one in ShuttleGui.cpp covers most cases
2019-04-30 21:50:22 +01:00
James Crook d1ce307974 Remove extra controls from Graph EQ and Filter Curves effects 2019-04-01 19:19:30 +01:00
Paul Licameli 5d7584e91a cut WindowAccessible, PopupMenuTable, LinkingHtmlWindow from .h files 2019-03-31 15:14:34 -04:00
Paul Licameli 10568f8a46 Move class SliderAx into WindowAccessible.* ...
... so ScienFilter.cpp doesn't depend on Equalization.h
2019-03-31 13:27:18 -04:00
Paul Licameli 34f318cd41 Remove wx/{imaglist,generic/dragimgg,gauge,dynarray}.h from *.h 2019-03-30 12:51:12 -04:00
Paul Licameli 08c16b6eb7 Remove wx/{html/htmlwin,fileconf,dragimag,debug,dcclient}.h from *.h 2019-03-30 10:53:22 -04:00
Paul Licameli bcc2e0d13b Remove wx/frame.h, wx/sizer.h, wx/access.h from headers 2019-03-28 11:21:15 -04:00
Paul Licameli 7766d9a192 AddCheckBox takes a bool for initial state, not string 2019-03-27 12:58:40 -04:00
Paul Licameli b18f825ee8 Remove wx/slider.h from headers 2019-03-27 10:35:59 -04:00
Paul Licameli a915a510bd include <wx/setup.h> in all files where wxUSE* macros are used...
... even if it's redundant; improving on what was done at b47e2f9
2019-03-23 14:56:02 -04:00
James Crook de427da4c8 Split Equalization into GraphicEq and FilterCurve effects.
First step in https://wiki.audacityteam.org/wiki/Proposal_Equalization
We still have Equalization as an effect, but if the split works well, will remove it for 2.3.2
2019-03-22 11:11:56 +00:00
Paul Licameli b4ce681867 WaveTrack.h does not include WaveClip.h 2019-03-18 01:44:42 -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 3ff61f3e10 Remove Shuttle.h from other headers 2019-03-17 15:03:05 -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 06b3b42794 Remove unnecessary initializers for empty wxString 2019-03-15 15:18:11 -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 50074f2cfe Replace comparisons against "" with empty() 2019-03-14 13:23:41 -04:00
Steve Daulton 2673e28f4a Correct "Hanning window" to "Hann window"
Updated in user facing text and comments. Variable names left as is.
2019-03-14 10:11:16 +00:00
Paul Licameli 6d5bc21d50 Define and use wxArrayStringEx...
reducing verbosity where there were repeated calls of Add(), and defining
move construction and assignment for efficient returns from functions
2019-03-10 16:23:44 -04:00
Paul Licameli 795b6a2e42 More std:: style for wxString and wxArrayString...
... Replacing:

Insert => insert
RemoveAt => erase
Remove => erase
IsSameAs => operator == or operator !=
   (but only when second argument was true or default)
2019-03-10 14:45:12 -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
Steve Daulton cc34abea61
bug 2018 - Equalization does not retain settings
Thanks to David Bailes for the fix.
2018-11-13 15:52:18 +00:00
Paul Licameli 50cf2e9a1f Give TrackArtist a back-pointer to TrackPanel 2018-11-05 10:54:58 -05:00
Paul Licameli 99106e3ed3 Carry more information in TrackPanelDrawingContext; fewer arguments 2018-11-05 09:12:45 -05: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
Paul Licameli aee4005044 Rewrite many iterations over tracks and channels in src/effects 2018-10-01 11:24:04 -04:00
Paul Licameli 2e11844f6a Effect::inputTracks() now gives only const access 2018-10-01 10:59:48 -04:00
James Crook 4318cb6780 Bug 1886 - Sluggish behaviour caused by the large time taken to draw the Track Control Panel
All backing bitmaps (not just the one in track panel) now are set to 24 bits.
Big thanks to David Bailes for tracking down the root cause of slow BitBlts, and the comments at https://trac.wxwidgets.org/ticket/14403 which led to the fix.

In testing the bitmaps, I also fixed the sizer errors reported for Export.cpp that wxWidgets now reports as ASSERTS when running in debug builds.
2018-08-03 18:29:49 +01:00
Paul Licameli e432883dec Fix deprecation warnings with wxFont, wxPen, wxBrush ctors...
... Replace some enum constants with the equivalent values from the more
special-purpose enums, as the wx header files recommend, so overloading
selects the ctors with non-int arguments.

In a full rebuild of the debug project on Mac, this reduces the count of
warnings from 264 to 274.
2018-07-23 13:21:15 -04:00
Steve Daulton 95ef41413c Better fix for bug 1891
Also reverts previous fix attempts.
2018-06-21 23:54:38 +01:00
Steve Daulton f145574dd6 Fix for 1891 is specific to Mac / Linux
This is only really a temporary fix - we should be using the
standard "Manage" button, but imo Equalization require a
thorough overhaul.
2018-06-21 15:55:20 +01:00
Steve Daulton 6cff61535b Fix bug 1891 (EQ crash)
This fixes only the crash bug. This effect needs substantial attention.
2018-06-19 11:58:45 +01:00
James Crook 6d96ec1e52 Fix sizer ASSERT with equalization dialog. 2018-04-13 19:25:19 +01:00
Paul Licameli b200819f75 Use IdentInterfaceSymbol to identify commands and effects 2018-04-11 11:51:10 -04:00
David Bailes f027708fe1 Fix an issue caused by the accessibility changes in wxWidgets 3.1.1
The main change in wx accessibility is this:
7dab555f71 (diff-04f5191d86f95b1c4d5d9c979da65878)

However wxWindowAccessible has not been updated to take into account of that change. In particular wxWindowAccessible::GetParent() was always wrong, but it was consistent with the rest of the framework. Now it's wrong and inconsistent. This function should return an object with role window, and which has the same name.

The fix is to introduce class WindowAccessible, which is effectively our own version of wxWindowAccessible. This class does not override GetParent(), and so just relies on a standard accessible object to to the right thing in wxIAccessible::get_accParent() (which is does). This class also allows us to have our own version of GetName(), which allows us to set the accessibility names of buttons.

These changes will break the accessibility of Audacity if it is built with wxWidgets 3.0.X. If this is a problem, then there could be some #if stuff in WindowAccessible.h to turn the WindowAccessible class into one which simply inherits from wxWindowAccessible, and doesn't override anything.
2018-04-03 14:57:59 +01:00
Paul Licameli e1b60916b7 More consistent naming conventions for choice control items...
... This commit leaves at least a comment for all choice controls of all
built-in effects and commands.

Use CamelCase with no spaces for the internal identifiers, given in
wxT("...")

Use more idiomatic English with spaces in the user-visible names, given in
XO("..."); these strings go to the message catalog for internationalization

Do not use underscores

In case these strings are the same, give it just once in XO("..."), but if in
a future version it is decided to change the name in XO("..."), then the
original should be kept also in a distinct wxT("...") string, so that
saved configuration or plugin settings or macro files don't become gratuitously
incompatible just because of that user-visible name change.

Left TruncateSilence alone for now -- I think that choice demands a rewrite
as a slider instead.
2018-03-27 15:57:48 -04:00
Paul Licameli 2065eebff6 IdentInterfaceSymbol to distinguish internal vs visible enum settings 2018-03-27 07:51:44 -04:00
Paul Licameli 595cf05d42 More uses if LocalizedStrings 2018-03-27 07:51:44 -04:00
Paul Licameli 81dd580c57 Pass array and count separately to read/write/define enum 2018-03-27 07:51:43 -04:00
James Crook cb8e35574d Fix half sized equalization dB ruler. 2018-03-26 11:52:12 +01:00
Paul Licameli 05ef58753a Substitute, don't concatenate in internationalized strings 2018-03-24 15:24:15 -04:00
James Crook cd06f86619 Remove spaces before question marks (scootergrisen)
Requested by translation team.
2018-03-24 11:01:29 +00:00
James Crook 205b7d6a02 Rename 'chain' to 'macro' in history and comments. 2018-03-16 18:47:39 +00:00
Steve Daulton 814322a793 Fix Equalization crash in debug build 2018-03-15 17:50:09 +00:00
James Crook 0ad533a740 Automation -> Scripting. 2018-02-24 14:20:30 -05:00
James Crook 1d9477a455 SetClip, SetLabel, SetProject added
- SetTrack also updated with more options.
2018-02-24 14:20:24 -05:00
James Crook 1c988b4e3a Automation: AudacityCommand
This is a squash of 50 commits.

This merges the capabilities of BatchCommands and Effects using a new
AudacityCommand class.  AudacityCommand provides one function to specify the
parameters, and then we leverage that one function in automation, whether by chains,
mod-script-pipe or (future) Nyquist.

- Now have AudacityCommand which is using the same mechanism as Effect
- Has configurable parameters
- Has data-entry GUI (built using shuttle GUI)
- Registers with PluginManager.
- Menu commands now provided in chains, and to python batch.
   - Tested with Zoom Toggle.

- ShuttleParams now can set, get, set defaults, validate and specify
the parameters.
- Bugfix: Don't overwrite values with defaults first time out.
- Add DefineParams function for all built-in effects.
- Extend CommandContext to carry output channels for results.

We abuse EffectsManager.  It handles both Effects and
AudacityCommands now.  In time an Effect should become a special case of
AudacityCommand and we'll split and rename the EffectManager class.

- Don't use 'default' as a parameter name.
- Massive renaming for CommandDefinitionInterface
- EffectIdentInterface becomes EffectDefinitionInterface
- EffectAutomationParameters becomes CommandAutomationParameters
- PluginType is now a bit field.

This way we can search for related types at the same time.

- Most old batch commands made into AudacityCommands.
The ones that weren't are for a reason.  They are used by mod-script-pipe
to carry commands and responses across from a non-GUI thread to the GUI
thread.

- Major tidy up of ScreenshotCommand
- Reworking of SelectCommand
- GetPreferenceCommand and SetPreferenceCommand
- GetTrackInfo and SetTrackInfo
- GetInfoCommand
- Help, Open, Save, Import and Export commands.
- Removed obsolete commands ExecMenu, GetProjectInfo and SetProjectInfo
  which are now better handled by other commands.

- JSONify "GetInfo: Commands" output, i.e. commas in the right places.

- General work on better Doxygen.
    - Lyrics -> LyricsPanel
    - Meter -> MeterPanel
- Updated Linux makefile.
- Scripting commands added into Extra menu.
- Distinct names for previously duplicated find-clipping parameters.
- Fixed longstanding error with erroneous status field number which
  previously caused an ASSERT in debug.
- Sensible formatting of numbers in Chains, 0.1 not 0.1000000000137
2018-02-24 14:20:22 -05:00
Paul Licameli 080dd34e61 Get rid of wx object arrays, use std::vector 2018-02-21 19:33:27 -05:00
Paul Licameli e6e8e3251c Rewrite more Connect() with Bind(), which were type incorrect...
... though harmlessly so.  They called to nonstatic member functions of classes
with improper this pointers; though the functions did not use this.

Bind events to nonmember funtions instead.  Sometimes just to empty lambdas to
consume the event and ignore it, blocking other handlers.
2018-02-21 19:28:12 -05:00
Paul Licameli 151cbb1305 Follow wxWidgets argument conventions for other ctors 2018-02-21 19:21:03 -05:00
Paul Licameli ab5ff9060b More constructor arguments for RulerPanel 2018-02-21 19:21:03 -05:00
Paul Licameli c40b254626 while -> if 2018-01-26 10:12:14 -05:00
Paul Licameli 8e0cffb7f2 Simplify GuardedCall and default its return type to void 2018-01-13 01:32:41 -05:00
Paul Licameli 8a074770e8 IdentInterface::GetDescription() returns a translated string...
... See commit 3b90538b84 which removed the
only use of the untranslated strings.

Also follows better i18n guidelines for composing the VSTEffect description.
2018-01-07 21:16:26 -05:00
Paul Licameli def1d52505 Substitute, don't concatenate, when composing localized strings...
... Avoid English syntax bias.
2018-01-04 04:30:46 -05:00
Paul Licameli 80a958f8a4 Rewrite empty prompts to ShuttleGUI functions as {} ...
... so we might more easily redefine the type of the function argument,
some other day (not this release)
2018-01-01 22:51:25 -05: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