1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-22 15:20:15 +02:00

383 Commits

Author SHA1 Message Date
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
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
67cec5ad83 Make many counts of tracks and channels unsigned...
... And in some places where a library uses signed types, assert that
the reported number is not negative.

What led me to this, is that there are many places where a size_t value for
an allocation is the product of a number of channels and some other number.
2016-09-07 10:11:41 -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
1281f1b14b Common function limits buffer size to sampleCount known to be small 2016-08-23 12:46:10 -04:00
Paul Licameli
a6de680cdb use std::min and std::max 2016-08-22 21:45:54 -04:00
Paul Licameli
1189cfd62a Identify the few unsafe narrowing conversions from sampleCount...
... I believe this list of four places is exhaustive.

There are many, many more safe narrowings that I examined.

This resulted from changing the definition of sampleCount in my builds so that
narrowing conversions failed to compile without some fixes, and I examined and
fixed every place.

The rest of that work is not yet shared.
2016-08-21 15:28:32 -04:00
James Crook
b1526fbdc8 Change strings for clarity/consistency.
Changes suggested by (translator) scootergrisen
2016-08-19 19:30:21 +01:00
Paul Licameli
e599cfa6fa Effect::mOutputTracks is managed by smart pointer 2016-08-13 10:37:51 -04:00
Paul Licameli
a400a7408c Distinguish whether clip ptr arrays own; vector; const-correctness 2016-08-12 20:53:38 -04: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
Benjamin Drung
9e78a41faf Use std::isinf() instead of isinf()
Audacity fails to build on Ubuntu 16.04 with g++ 5.3.1 (using C++11),
because isinf() is not defined. Thus use std::isinf() instead.
2016-05-15 09:04:35 +02:00
Paul Licameli
2d7e21536e Sweep for filename copying: prefs and effects 2016-04-10 22:25:49 -04:00
Paul Licameli
2696da89cb One more use of smart pointer object SampleBuffer, in Nyquist.h...
...Leaving no "naked" DeleteSamples.  Only SampleBuffer::Free now calls it
directly, and SampleBuffer calls Free in its destructor.
2016-04-10 00:07:21 -04:00
Paul Licameli
a6ca36cdab TrackList holds smart pointers to tracks, Add() only takes rvalue refs to such 2016-03-26 15:41:31 -04:00
Paul Licameli
5ef4dd46a5 TrackFactory functions return std::unique_ptr, although some callers...
... release() them for now.
2016-03-26 11:50:12 -04:00
Steve Daulton
919712e3f7 Fix default EffectTypeProcess for Nyquist Prompt
Nyquist Prompt did not default to process type if a previous script
in the current session set a different type.
2016-03-14 09:22:25 +00:00
Paul Licameli
c98b090182 Rename SyncLockTracksIterator::First to StartWith to be consistent 2016-02-24 12:59:28 -05:00
Paul Licameli
99f161c36c Sweep unnecessary wxString copies: effects 2016-02-22 22:31:47 -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
3f237daddc Use macro safenew for many allocations of wxWindow subclasses 2016-02-14 20:20:19 -05:00
Paul Licameli
97e8fe3864 include <algorithm> to fix Windows build 2016-01-21 10:41:03 -05:00
Steve Daulton
1d6d08c47d Don't push effects that can't be undone onto the Undo Stack 2016-01-21 02:07:28 +00:00
Steve Daulton
57d1f5583d Fix for bug 661
Introduce *DECIMAL-SEPARATOR* global for Nyquist.
Improvements to numeric validation error messages.
Fix *TRACK* START-TIME and END-TIME properties for tracks with different
length channels.
Update Adjustable Fade, Regular Interval Labels and Vocal Removal
to use numeric text inputs.
This does NOT fix bug 1020.
2016-01-21 01:29:56 +00:00
Steve Daulton
46055cde25 Fix effect preview issues
Fixes bug 1274 and unblocks bug 995.
2016-01-20 18:19:11 +00:00
Steve Daulton
6663f406d3 Bug 1275 - No preview in Spectral edit effects
Introduces a new type 'spectral' t Nyquist plug-ins
2015-12-26 19:26:39 +00:00
Paul Licameli
9c483e2e86 Add (redundant) #include "Experimental.h" in all .cpp files using the symbols 2015-08-31 17:56:10 -04:00
Steve Daulton
351a2a8528 Update Nyquist *TRACK* property list 2015-08-28 16:12:23 +01:00
Steve Daulton
8828ab50b7 Remove obsolete 'rate' keyword to prevent crash
and added numeric-text controls.
2015-08-23 18:37:18 +01:00
Steve Daulton
7ee8032f3c Limit selection length for Nyquist plug-ins
This can improve progress count for Nyquist effects
that do not process all of selection (bug 558) and provides some
protection against 2^31 overflow issues (bug 439).
2015-08-13 13:06:13 +01:00
Steve Daulton
2cb32c763f Fix for bug 558 2015-08-13 13:06:12 +01:00
Paul Licameli
5abbd463b2 Waveform dB is not a track type. Logarithmic is a Wavetrack scale type...
... Also removed one line from the track control drop-down, and changed
accelerators to more mnemonic choices.

Also the open page of View Settings... determines track view type after OK
2015-07-28 08:08:13 -04:00
Paul Licameli
adb4a534e8 Pitch is no longer a special view type... && bug fixes 1040, 1041
... It is a choice of algorithm in spectrogram settings, and any frequency
scale may be chosen with it.  Spectral selection works in it.
2015-07-27 23:01:20 -04:00
Paul Licameli
7d379cde13 Conditional compilation (disabled) to make Spectral selection choice global...
... not per track,
and the preferences or View Settings page has a separate static box for
global settings as opposed to track settings.  This is the only global setting
for now.
2015-07-27 23:01:06 -04:00
Paul Licameli
f74713f020 WaveTrack::WaveTrackDisplay does not encode scale or spectral selection...
... SpectrogramSettings does that instead, and Preferences or View Settings
are the user interface for changing it.

Handle invalidation of spectrogram pixel cache for scale type changes,
just as for other changes of settings.  No more
TrackArtist::InvalidateSpectrumCache().

View type of track now switches to Spectrum when applying or OKing the
View Settings... dialog and the Spectrogram page is open (and for now
it is still the only page)
2015-07-27 23:01:04 -04:00
Paul Licameli
65f1bbe449 Disable spectral editing effects in one place in Nyquist.cpp...
... by passing invalid frequency values,
rather than by checking the 'view property in each effect.

Spectral editing is now permitted only for appropriate track view types.

But I would suggest reconsideration of the exact conditions in which we do
this.
2015-07-25 15:12:18 -04:00
Paul Licameli
162418ff07 Fix compilation warnings 2015-06-10 02:04:07 -04:00
James Crook
88a9e434f5 Select Spectral Edit from Track DropDown 2015-05-30 11:04:45 +01:00
Leland Lucius
0ef7ccb1d1 Fix permissions...not sure why this was happening though 2015-05-29 19:49:28 -05:00
Steve Daulton
5378b0a951 Update to non-real-time preview.
Fixes and updates on top of some code clean-up from Leland.
2015-05-29 22:08:16 +01:00
Leland Lucius
b8ce7f6125 Fix for bug #981 2015-05-28 09:57:59 -05:00
Steve Daulton
c0763c3b4b Pass preview duration preference to Nyquist.
To get preview duration:
(get '*project* 'preview-duration)
2015-05-22 19:09:37 +01:00
Steve Daulton
4abd816c52 Restore hyphenation of plug-in as preferred form. 2015-05-21 16:57:12 +01:00
Steve Daulton
0dbaa76a7b Linear preview flag for Nyquist plug-ins. 2015-05-20 21:12:05 +01:00
David Bailes
f458df1c7b Changes to a number of dialogs so that the NVDA screen reader can read the titles. Missed these in my last patch. The accessibility name of the dialog is set to the title. 2015-05-18 13:57:05 +01:00
James Crook
4b2a2f710a Stub NyquistEffect::RedirectOutput() so mod_nyq_bench compiles
This function had somehow gone missing in other changes.  mod_nyq_bench now compiles loads and runs again.  Not tested beyond that.
2015-05-08 16:27:32 +01:00
Leland Lucius
b8fe0e6743 Fix escape issue causing SAL to fail
And don't uppercase the line...DOH!
2015-05-04 03:12:55 -05:00
Leland Lucius
4d0de66523 Fix for bug #387
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.
2015-05-03 23:36:30 -05:00