... 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.
... Replacing:
Insert => insert
RemoveAt => erase
Remove => erase
IsSameAs => operator == or operator !=
(but only when second argument was true or default)
... 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
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.
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.
... 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.
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.
... 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.
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
... 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.
... See commit 3b90538b84 which removed the
only use of the untranslated strings.
Also follows better i18n guidelines for composing the VSTEffect description.
... 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.
- 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.
... The keys are only ever used as internal identifiers in wxConfigFile
objects. So they are often space-less and camel-cased.
I have noticed a couple instances of translators confused by these.
Previously this was hard coded to use the online alphamanual.
Some other help-on-errors paths were hardcoded to use the online manual, and did not use local help even if available, so these were changed too.
Also two naming changes in the code:
ShowHelpDialog() became ShowHelp() because it typically shows the help in your browser, only showing the help in a dialog under certain circumstances.
The helpURL parameter became helpPage since it is usually a page name that is then elaborated into a url.
The Link() function became InnerLink().
Some careful http -> https changes made too.
Moved one ASSERT that was in the wrong place and added a new one. This might give a little more information in mac debug builds about Bug 1636 - (Mac) Equalization: Crash selecting the "RIAA" or "Telephone" curves. This is NOT a fix.
... The return codes were mostly ignored anyway, and exceptions will be thrown
instead.
It seems there was also confusion whether the return values of Track::Paste
and Track::SyncLockAdjust were to indicate success or indicate whether there
was any change. No matter now.
... Strong, meaning that the file at the specified path is created or modified
only if all write operations complete without exceptions, barring one very
unlikely possibility that a final file rename fails, but even in that case the
output is successfully written to some path.
This commit does not add throws, but changes the type thrown to a subclass of
AudacityException, so that GuardedCall will cause the user to see an error
dialog in all cases.
Duplicated logic for making temporary files and backups is now all in one
place, the class XMLWriter.
There may be more new GuardedCalls than necessary -- the catch-all for the
event loop, AudacityApp::OnExceptionInMainLoop, might be trusted instead in
some cases -- but they are sufficient.
On windows the capitalisation does not matter.
On Mac/Windows we use 'audacity' in path names, even if the directories wxWidgets suggests have 'Audacity'.
The bug was that when the Equalization effect opens in Graphics mode, the sliders are set to zero, and don't do the right thing. This was caused by my incorrect fix for bug #1346.
Fix is to call UpdateGraphic to set the sliders up. Call to UpdateDraw also added, which includes the appropriate calls to Show, rather than have these in PopulateOrExchange.
... 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.
... This makes much code agnostic about how other things (functions and
arguments) are typed.
Many of these neeed to become size_t instead of sampleCount.
I confirmed that the currently used real FFT code in RealFFTf.cpp is faster
than the old one with a quick benchmark that calls PowerSpectrum() on 4-minute
audio file, with different sizes of computation windows:
Window_size: 256 method: new FFT time_s: 0.393
Window_size: 256 method: old FFT time_s: 1.065
Window_size: 1024 method: new FFT time_s: 0.38
Window_size: 1024 method: old FFT time_s: 0.958
Window_size: 4096 method: new FFT time_s: 0.413
Window_size: 4096 method: old FFT time_s: 1.084
Window_size: 16384 method: new FFT time_s: 0.518
Window_size: 16384 method: old FFT time_s: 1.338
Window_size: 65536 method: new FFT time_s: 0.655
Window_size: 65536 method: old FFT time_s: 1.524
Window_size: 262144 method: new FFT time_s: 0.735
Window_size: 262144 method: old FFT time_s: 1.873
... the preference is independent of those in Interface and Recording
preferences, which affect meters, sound activated recordings, time track,
and Plot Spectrum
... and SelectedRegion, and not ViewInfo or zoom level as a double.
Also some leftOffset arguments.
Assumptions of uniform zoom level persist in TrackArtist::DrawClipSpectrum and
in TrackArtist::DrawClipWaveform but no longer in the rest.
Non-linear effects now process tracks before mixing.
This will be slower when multiple tracks are selected
but the preview should now match the applied effect.
SetLinearEffectFlag(true) allows linear effects to
preview more quickly when multiple tracks selected, by
pre-mixing selected tracks.
Simple generators like Tone and Noise may be marked as
'linear' so that they only preview a few seconds.
Generators that vary over time (such as Chirp) must use
the full duration that is set. As this currently
requires calculating the full duration, preview for
'non-linear' generators are not limited to the preview
length.
As this is a reversal of change committed in 2007 with no real
explanation or history behind that change other than it was
done for Export, we should probably give exporting a bit of a
workout.
This brings the builtin, LV2, and VAMP effects inline with the
Audio Units, LADSPA, and VST effects. All effects now share
a common UI.
This gives all effects (though not implemented for all):
User and factory preset capability
Preset import/export capability
Shared or private configuration options
Builtin effects can now be migrated to RTP, depending on algorithm.
LV2 effects now support graphical interfaces if the plugin supplies one.
Nyquist prompt enhanced to provide some features of the Nyquist Workbench.
It may not look like it, but this was a LOT of work, so trust me, there
WILL be problems and everything effect related should be suspect. Keep
a sharp eye (or two) open.