Commit Graph

54 Commits

Author SHA1 Message Date
Paul Licameli f369b5109b Change almost all uses of WaveTrack::Get() to GetFloats() ...
... A call graph browser easily shows that the extra generality of fetching
samples in some other format is only used in Benchmark -- where the format is
always the same as what the track is constructed with.

This makes re-verification of the claims in comments two commits ago easier.
2021-05-27 11:38:10 -04:00
James Crook d0ff48f3bd Bug 2754 - Change Tempo & Pitch and Sliding Stretch with selected audio in negative time crash Audacity on windows (error on Mac) 2021-05-15 11:36:53 +01:00
Paul Licameli c5ebc396eb Audacity.h has shrunk to nothing, now remove it! 2021-05-10 00:05:23 -05:00
Leland Lucius 0576d8c945 Bug 1215 - Incorrect splits produced by Change Tempo with leading whitespace 2021-01-29 23:23:54 -06:00
Leland Lucius 6749d5b6fa Bug 1215 - Incorrect splits produced by Change Tempo with leading whitespace 2020-09-18 09:24:45 -05:00
Paul Licameli c2feee6cea Bug2346: Complete fix...
... without making undesirable dependency cycles.

Eliminate calls to NewWaveTrack in effects, but in Edit>Copy too, which was
not mentioned in the bug report.  (Copying a track, deselecting all, and pasting
preserved CLIP colors, but not the TRACK color setting which applies to newly
generated clips.)

Instead, always use the new function WaveTrack::EmptyCopy from the track to be
later replaced, getting color information.

NewWaveTrack is still used in benchmark test, import, the Track menu
commands that make new tracks, recording to new tracks, and generators without
a selection, where there is no track to copy from.

Also when deserializing tracks from the .aup file, in which case the saved
color is later retrieved from the file.

Also, in mix-and-render, where other logic decides whether to copy colors
afterward.

See commit a9658e6ef7
2020-03-10 22:32:23 -04:00
Paul Licameli d5b2507af9 Remove unneeded inclusions of Project.h, no cycles broken 2019-05-22 10:02:24 -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 2de696b461 Bug2086: Mixer board behavior...
... and also fixed analogous mistakes in some effects (Vamp, SoundTouch, and
SBSMS effects), found by review of all uses of TrackList::Channels.

The first member of the pair of iterators returned by TrackList::Channels
does not necessarily deference to a null pointer when it is incremented to
the end of the range.
2019-03-29 11:45:28 -04:00
Paul Licameli f45300f032 This is only comments, in files where USE_ macros are tested...
... following the comment convention used in the preceding commit.
2019-03-22 12:38:30 -04:00
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 a0aa69a248 All tracks allocated with make_shared, no more make_unique...
... so that we can use Track::SharedPointer without undefined behavior even on
tracks that don't yet belong to any TrackList.

Also fix the return type of function template TrackList::Add and remove some
casts.
2019-03-16 13:11:33 -04:00
James Crook 7e5a716e65 Fix C4458 Warnings
C4458 is 'Declaration hides class member'
2018-10-10 19:46:25 +01:00
Paul Licameli 22c85dd99c Rewrite GetLink(ed) in SBSMS 2018-10-01 13:42:31 -04:00
Paul Licameli bb3aa00f50 Effect::CopyInputTracks was only called with two values...
So now it simply takes a bool.
2018-10-01 11:06:31 -04:00
Paul Licameli 1be3187b99 Use TrackIterRange::Visit 2018-10-01 10:59:24 -04:00
Paul Licameli c20aefc10f Save, later rethrow exceptions caught in callbacks from C libraries 2018-05-10 01:20:36 -04:00
Paul Licameli 0d7250578d Other methods of WaveTrack return void, will throw on failure instead 2017-03-31 18:26:52 -04:00
Paul Licameli 22a12c6852 Exception safety in: some effects and generators...
... Those that directly call WaveTrack functions in their Process() routines,
which might throw exceptions for disk space exhaustion.
2017-03-21 14:11:25 -04:00
Paul Licameli 8e5975b10d Report read exceptions met in SBSMS and Nyquist callbacks to user...
... without letting them propagate through the libraries.
2017-03-17 17:53:03 -04:00
Paul Licameli cab99f7234 Remove naked malloc (or similar) and free in: other effects 2017-03-17 17:52:53 -04:00
Paul Licameli 08b99c533b Remove Effect::mWarper, and stack-allocate warpers instead 2017-03-17 17:52:32 -04:00
Paul Licameli ad04187a41 Change sampleCount arguments, variables, return values to size_t...
... whenever they really describe the size of a buffer that fits in memory, or
of a block file (which is never now more than a megabyte and so could be fit in
memory all at once), or a part thereof.
2016-09-15 21:03:17 -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 99dca62cff Assert that sampleCount doesn't narrow converting to 3d party types 2016-09-15 21:02:31 -04:00
Paul Licameli 88611a4530 Fewer C-style pointer casts of tracks; comments justify static_cast 2016-09-15 12:12:43 -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 2949a080d2 More cautions in SBSMSEffect.cpp...
... The narrowings from sampleCount to long might be fixed, but it would
require changes in lib-src
2016-08-24 14:50:45 -04:00
Paul Licameli b5e410d987 Fix Windows build differently 2016-08-24 12:13:53 -04:00
James Crook 781de82d02 Workaround build breakers. Needs review.
These changes fix a broken build in Windows.
#include <algorithm> needed for min/max to be in std.
decltype(+name) was declaring a const variable, that could not be incremented.  Changed to auto.
2016-08-23 21:46:12 +01: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 26b94a447b change a variable name 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
Steve Daulton 90e400b0a7 Add SBSMS option to Change Pitch effect 2016-08-13 17:28:49 +01:00
Paul Licameli e599cfa6fa Effect::mOutputTracks is managed by smart pointer 2016-08-13 10:37:51 -04:00
Paul Licameli 6fec00149b Remove some naked new amd delete in: Built-in Effects 2016-08-08 07:51:25 -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
Paul Licameli 60bcd7aea2 Fix warnings for unused variables and functions 2016-02-26 14:56:26 -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
Steve Daulton 954bb0fd1c Fix for bug 955 from Clayton Otey 2016-01-26 18:19:19 +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
clayton.otey 87fb427603 TimeScale effect improvements, updating to sbsms 2, not including GUI changes (except removing obsolete transient sharpening option). See Bug 485. 2012-04-16 18:26:48 +00:00
v.audacity 458152070e Fix some problems with asserts in 11308. Further wording corrections. 2011-11-18 03:47:43 +00:00
v.audacity 59db8d4ad4 See http://bugzilla.audacityteam.org/show_bug.cgi?id=451#c31 and http://bugzilla.audacityteam.org/show_bug.cgi?id=451#c32. 2011-11-16 05:59:48 +00:00
clayton.otey 71dedc3d35 Revert r11214 (sbsms timescale effect update) & r11215 (mixed-radix-fft narrow/broaden spectrum menu items) to honor the feature freeze. 2011-07-06 09:49:59 +00:00
clayton.otey a17e741abc Major update to TimeScale effect, incorporating libsbsms-2.0.0, fixes to bug 172, changes to ui 2011-07-02 18:35:18 +00:00
mchinen 2a81f349b9 bug 172: hack to fix sbsms inverted pitch ratio and sampling rate issues 2010-12-15 16:54:13 +00:00
v.audacity 209a2b193d Consolidate multiple names for the same feature: sticky/linked/sync/synchro/grouped -> sync-lock. 2010-08-11 22:47:26 +00:00
clayton.otey@gmail.com 299c327a71 SBSMS library/effect changes. Apparently resolves bug #170. Incorporated optimizations with minor quality changes. Returned optimization flags to build (introduced in a patch). The audacity SBSMS branch is now a trimmed down version without associated programs. Includes (untested) changes to the windows .vcproj. 2010-06-07 06:41:32 +00:00