Commit Graph

137 Commits

Author SHA1 Message Date
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
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 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 50074f2cfe Replace comparisons against "" with empty() 2019-03-14 13:23:41 -04: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 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 303553ae4e Take class AdornedRulerPanel out of src/widgets...
... It's not a utility widget like RulerPanel.  It has a lot of application
specific logic in it.
2018-10-24 15:04:41 -04:00
scootergrisen b4f7946e9b Remove some double space 2018-10-14 10:42:01 +01:00
Paul Licameli 968d63d5fd Rewrite many iterations over tracks and channels in various places 2018-10-01 13:35:51 -04:00
Paul Licameli 03dc815aee Pointer downcasts should use static_cast not reinterpret_cast 2018-09-29 12:46:19 -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
David Bailes 526606fc29 Fix more accessibility names after the move to wx 3.1.1
This is a follow up to commit f9ee3cd.
2018-04-10 13:43:50 +01: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 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
Paul Licameli ccb4bbac33 Translate "Message" as default title of message box...
... This required a sweeping change of all calls to wxMessageBox!  But it seems
safe to me, despite the great number of touched files.
2018-01-01 17:50:02 -05:00
Paul Licameli 1e1560d63c Fix missed translations in Plot Spectrum 2017-09-10 19:24:42 -04:00
James Crook ce9938787c Use alpha or released or local manual for "help on selection".
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.
2017-08-25 13:59:16 +01:00
James Crook db97feafd7 Bug 1654 - Enh: Analyze Contrast and Plot Spectrum don't have the new "Help" button
Missed a bit in previous commit.
2017-08-14 23:22:19 +01:00
James Crook 61e321fd43 Bug 1654 - Enh: Analyze Contrast and Plot Spectrum don't have the new "Help" button 2017-08-14 23:10:06 +01:00
Paul Licameli 5d48e96942 Where FileSelector was used, default to Documents not cwd; save prefs 2017-08-03 08:02:33 -04:00
James Crook cc38ba34a4 Bug 1607 - Some dialogs appear on primary monitor when Audacity is running on secondary monitor 2017-05-14 14:25:40 +01:00
James Crook 2a043c0b35 Add settable ruler colouring. 2017-04-26 22:32:09 +01:00
Paul Licameli 39b8d99a56 WaveTrack::Get, WaveClip::GetSamples take a mayThrow=true argument...
... and pass non-default in all needed places.

Don't throw, don't put up error dialogs, in drawing or hit-test code.
2017-03-21 17:23:34 -04:00
Paul Licameli 692a033968 Remove naked new[] in: various 2017-03-17 17:52:47 -04:00
Paul Licameli f993f1eadf Regularize casts as (int), so they are easier to find and review 2016-09-20 08:42:11 -04:00
Paul Licameli 54c993c4f5 Avoid unreachable code warning 2016-09-19 11:47:47 -04:00
Paul Licameli 078ff056e2 Make many conversions sampleCount->size_t are explicit and checked...
... with run-time assertions.

I examined each place and reasoned that the narrowing was safe, and commented
why so.

Again, there are places where the sampleCount variable will later be changed
to have a different type, and they are not changed here.
2016-09-15 21:02:32 -04:00
Paul Licameli ed21545c80 pixel column counts and sample window sizes use unsigned types 2016-09-11 20:28:13 -04:00
Paul Licameli 79c79f9cd3 Remove many mentions of sampleCount with auto and decltype...
... 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.
2016-08-24 14:50:45 -04:00
Paul Licameli 942c62b6f6 Remove some naked new amd delete in: various 2016-08-08 07:51:24 -04:00
James Crook 163063f516 Merge pull request #143 from RaphaelMarinier/remove-old-fft2
Code cleanup: removed the old real FFT code not used for a long time
2016-07-13 18:32:42 +01:00
Paul Licameli 84c0337aba Fix TAB key navigation on Mac for all dialogs (not only for panels) 2016-07-10 17:12:27 -04:00
Raphaël Marinier 6ac68db5be Code cleanup: removed the old real FFT code not used since at least 2009.
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
2016-06-25 20:40:16 +02:00
Paul Licameli cf562e37de Bug1353: Plot Spectrum assertion error and crash in Debug builds 2016-06-18 11:55:43 -04:00
Steve Daulton 1be7b0086f Consistent bit rates in MP3 export dialog
and update Plot Spectrum default.
2016-04-07 13:17:16 +01:00
Paul Licameli dbaa811577 Stack-allocate where possible! ...
... Removed many unnecessary naked news and deletes.
2016-02-17 18:15:57 -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
James Crook ae5d29a048 Bug 1226 - Plot Spectrum freezes first time in a project if insufficient samples selected
Guarding against mDataLen < mWindowSize, as per fix from Steve.
However, also must ensure mAnalyst was initialised, as we otherwise get a different crash when we paint a valid spectrum later, because we don't init mAnalyst when too few samples.  To do that init, we must call Recalc before we show the dialog.

Needs to be tested on Mac, because the change from SendRecalcEvent() to Recalc() might conceivably upset the Mac.
2015-10-06 21:28:22 +01:00
Leland Lucius 2ae7fb18e9 Fix for bug #1105 part deux 2015-09-02 00:57:16 -05:00
Paul Licameli 9c483e2e86 Add (redundant) #include "Experimental.h" in all .cpp files using the symbols 2015-08-31 17:56:10 -04:00
Leland Lucius aa6fbf9814 Fix missing vertical ruler 2015-08-15 00:00:56 -05:00
Leland Lucius 97c3894a22 Fix for bug #1105 2015-08-02 00:58:46 -05:00
Leland Lucius 1e195ecea6 Fix many wx3.1.0 assertions now to prevent double testing 2015-07-30 02:05:23 -05:00
Leland Lucius 37168ebbf6 Merge remote-tracking branch 'upstream/master' into wx3 2015-07-28 15:06:25 -05:00
Paul Licameli e0621819ed Move ENV_DB_RANGE out of Envelope.h; that file can be included in fewer places. 2015-07-28 11:55:52 -04:00
Paul Licameli cab89f6fb4 Remove Envelope.h from other headers 2015-07-28 10:02:09 -04:00
Paul Licameli d39eaa4e65 Remove WaveTrack.h from other headers 2015-07-28 10:02:05 -04:00
Leland Lucius 3fe146f306 Merge remote-tracking branch 'upstream/master' into wx3 2015-07-19 18:00:02 -05:00
Paul Licameli e70f91c64e Removed ShuttleGui.h from other headers 2015-07-19 12:31:03 -04:00
Leland Lucius 9b9c8cc073 Round 5 of wx3 changes
FileDialog now complete on Linux.  Needs some fine tuning on
Windows and OSX.
Builds with wx3 and gtk2 or gtk3.
Still more effect work to do.
2015-07-14 23:33:53 -05:00
Leland Lucius 0ef7ccb1d1 Fix permissions...not sure why this was happening though 2015-05-29 19:49:28 -05:00
Leland Lucius f0d1dda3f9 Fix crash in FreqWindow when replotting without any tracks 2015-05-19 22:17:25 -05:00
Leland Lucius b0405d0450 More wx3 workarounds 2015-05-16 17:21:14 -05:00
David Bailes 66084b65ef Changes to a number of dialogs so that the nvda screen reader can read their titles. The accessibility name of the dialog is set to the title of the dialog. 2015-05-16 09:35:21 +01:00
Leland Lucius ebc125de72 Change tab order to be like 2.1.0 2015-05-16 02:39:57 -05:00
Leland Lucius 35c2e5d227 Set focus to algorithm choice on initial display 2015-05-04 23:39:53 -05:00
Leland Lucius 0c41583be1 Allow initial display to refresh 2015-05-03 16:51:11 -05:00
Leland Lucius 9212629945 Added zoom and pan plus fix for bug #884
It started out as just the fix for #884, but it went
a bit further.  Steve had the idea for the zoom and
pan addition, so I added it while I was working on
2015-05-03 15:23:33 -05:00
Daniel Winzen 92d522132e Variable cleanup 2015-04-23 18:30:38 +02:00
james.k.crook@gmail.com a6f9f6bc58 Spectral Editing: Using subroutines to shorten code, and more comments in the code. 2014-10-18 16:01:50 +00:00
james.k.crook@gmail.com 37608c2290 Paul Licameli's Spectral Editing Patch.
This relies on three new nyquist scripts to actually do the editing.  The peak-snapping code in FrequencyWindow has been extracted into a new class, SpectrumAnalyst, to provide peak-snapping in spectrogram too.
2014-10-18 14:19:38 +00:00
lllucius bdcefb4850 Preliminary changes for wxWidgets 3.0.1
We can't go to 3.0.1 yet as there are still build issues on
Linux and OSX.  You can get Windows to build, but there's
still some display issues.

These changes should work with wxWidgets 2.8.12 as well, so
we can take our time to get things working properly before
switching over.
2014-10-06 08:10:50 +00:00
james.k.crook@gmail.com f5e593cc4c Paul L's new SelectedRegion class replacing use of t0 and t1. Also LabelTrack.h no longer in TrackPanel.h includes.
This change is believed to be a direct refactoring that does not change functionality.  It paves the way for more complex kinds of selection, such as selections involving frequency as well as time.  It also reduces risk of left and right edges being swapped in future code using SelectedRegion, as the default is to swap on assignment if needed.
2014-10-05 17:10:09 +00:00
benjamin.drung@gmail.com 277932dccb Remove trailing spaces. 2014-06-03 20:30:19 +00:00
lllucius 8a260f33d0 Fix for bug #662
http://bugzilla.audacityteam.org/show_bug.cgi?id=662
2013-10-11 20:01:41 +00:00
v.audacity 40254b1796 simplified version of Steve's patch for bug 357 -- Never need to update array size in two places again. 2013-06-30 04:09:56 +00:00
v.audacity b327e510b0 Improvements in Change Pitch effect.
* from and to octave spin controls and cross-updating

* new conversion utilities in PitchName.*

* code simplification, new documentation

* stop a few compiler warnings in FreqWindow.cpp on unused params
2013-06-18 04:35:35 +00:00
martynshaw99 7696ba4602 Steve's fix for a somewhat obscure (non-Bugzilla) bug. 2013-04-22 23:19:34 +00:00
v.audacity ebb4f530bb Apparently, wxConfigBase::Write() does not update values for next access on all platforms unless Flush() method is called. Added many calls to wxConfigBase::Flush() to make sure the Rad() calls get the right values. 2012-08-02 06:03:19 +00:00
james.k.crook@gmail.com cd54a2728b Fixed some smart quotes that can cause problems for .po file generation. 2012-03-20 21:59:30 +00:00
james.k.crook@gmail.com 69476e785c Fixed more internationalisation hints. 2012-03-20 15:36:02 +00:00
v.audacity 5ff55f989a Change the name of the "Drawing Spectrum" progress dialog from "FreqWindow" to "Plot Spectrum". I don't think this needs re-translation because that string already exists elsewhere, but "FreqWindow" doesn't mean anything in standard English, so shouldn't be a dialog title, and can't be translated anyway. 2012-02-11 01:28:05 +00:00
james.k.crook@gmail.com de02dc01c8 More removal of redundant variables (xLast). 2012-02-09 13:21:47 +00:00
james.k.crook@gmail.com ee6b9b855d Redundant variable removed, and xpos variable created later. 2012-02-09 13:17:49 +00:00
v.audacity 5f5b9778de Fixes per Vigilant Sentry (http://www.vigilantsw.com/)
* Fix memory leaks.

* Add comments about initializations and checking for successful results.

* Add checks for NULL deref.

* Consistency in "TODO" vs "TO-DO" comments!
2012-02-08 05:09:14 +00:00
mchinen 1b77d5608c Bug 149 (P3) Fix transparency issues in the spectrum plotting in FreqWindow.cpp. Patch by Norm C. 2012-01-16 00:50:38 +00:00
martynshaw99 205df6040f Don't normalise on the number of tracks, which previously meant that a signal's spectrum would get lower in amplitude if analysed with silence in another track. Thanks to Mike Walmsley for this. 2011-07-23 00:18:07 +00:00
v.audacity 0ae919f656 Make better discrimination of wxLogMessage, wxLogDebug, and wxLogError usage so user doesn't see lots of irrelevant info in log window, only messages and errors they should need to see. For example, user doesn't need to see every step of loading FFmpeg in release build, only errors, if they occur.
Comment out in FreqWindow.cpp the wxLog* stuff that can just be done with breakpoints ("Starting FreqWindow::Plot()" et al).
2010-08-10 05:13:28 +00:00
ra e74978ba77 Locate and position the current Audacity source code, and clear a variety of old junk out of the way into junk-branches 2010-01-23 19:44:49 +00:00