1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-18 00:50:05 +02:00

85 Commits

Author SHA1 Message Date
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
Paul Licameli
e0fc7e7980 Bug2170: Crash using Trim twice with unchanged selection...
... bug resulted from Envelope rewrites in 2.2.0 and not recent restructurings.
2019-07-22 15:18:23 -04:00
Paul Licameli
63350d8573 TimeTrack drawing not dependent on EnvelopeEditor...
... after a static function is moved from EnvelopeEditor to Envelope
2019-06-19 11:35:47 -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
f6adeed47b Remove some unnecessary #include directives 2019-05-15 14:14:18 -04:00
Paul Licameli
3760db9dff Remove wx/wxchar.h from headers 2019-03-29 15:56:54 -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
4ebfbd9c50 Split class TrackArtist from namespace TrackArt...
... The first is just extended drawing context info, and the second has
functions that retrieve TrackArtist from TrackPanelDrawingContext as needed.
2018-11-05 09:16:50 -05:00
Paul Licameli
99106e3ed3 Carry more information in TrackPanelDrawingContext; fewer arguments 2018-11-05 09:12:45 -05:00
James Crook
0022e0c06c Bug 1844 - Nyquist effects move subsequent envelope points by selection's length
Also renamed Envelop::Paste to Envelope::PasteEnvelope, since it was hard to find
just its usages, given the many usages of WaveTrack::Paste.
2018-08-07 10:39:18 +01:00
Paul Licameli
52a7f2320d Re-fix some warnings about mixing signed and unsigned better...
... Assuming that large unsigned magnitudes with high order bit set are not
the problem, but signed negatives of small magnitude may be:

1) Always cast the unsigned to signed in comparisons, not the other way.

Also:

2) Cast unsigned TERM to signed by itself, before subtracting.  Don't cast
the result.

3) Rewrite some comparisons by moving subtracted term to other side.

See commits
d2fe7b1757d77d93d82d53685a118517a4d2e996
f463eda36c059236ecc168919c745eb687170c95
2018-01-23 18:51:53 -05:00
James Crook
d2fe7b1757 Clean up most remaining MSVC warnings. 2018-01-06 13:03:48 +00:00
Paul Licameli
4d978bcefb Use wxPrintf not printf 2017-12-16 11:54:32 -05:00
James Crook
f463eda36c Clean up some dead code and MSVC warnings.
- 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.
2017-12-08 15:20:39 +00:00
Paul Licameli
52d8dc1525 Bug1682, maybe: More careful treatment of some Envelope corner cases 2017-07-14 22:49:46 -04:00
Paul Licameli
7fb107e143 Highlighting of envelopes 2017-07-11 13:56:41 -04:00
Paul Licameli
ada4b6307d Pass more context information into drawing routines 2017-07-09 12:34:27 -04:00
Paul Licameli
bbab89b52c Cut then paste has no net effect on envelope in some more cases...
... whereas before, some incorrect disconituities could remain near the start
of the selection.

To find reproducible cases before this commit might involve varying the left
edge of the selection by small amounts, because this problem depended on
little roundoff errors.
2017-06-26 12:04:21 -04:00
Paul Licameli
333c9aa91d Fix the test for removability of envelope points...
... Which went wrong in some examples of an effect applied to part of an
envelope that contains only one point; the correct result should have
a level 1 in the selection and unchanged levels left and right of it, no
matter whether the sole point was before, in, or after the selection.

Simplification may still remove that sole point yet still leave the levels
outside the selection correct.
2017-06-08 14:37:15 -04:00
Paul Licameli
01450e8db0 Fix pasting into envelope with only one point...
... as reported by Steve, when applying a Nyquist effect.
2017-06-07 11:13:59 -04:00
Paul Licameli
1e7c51f1d4 Fix crash in Windows debug runtime 2017-06-07 09:16:22 -04:00
Paul Licameli
4c80a074d3 Bug835(cut-then-paste should be no-op): Rewrite Envelope::Paste...
... Simplify.  Don't assume e->mOffset is zero.  Check consistency afterward.

Do not leave responsibility for simplification of discontinuities to higher
level code.

Allow real discontinuities at the end of the insertion; no more readjustment of
times of points.
2017-05-29 13:53:25 -04:00
Paul Licameli
58e7a94264 Envelope::Paste takes a time tolerance argument 2017-05-29 13:53:25 -04:00
Paul Licameli
02fe963d23 Define consistency check for Envelope, to be used in Paste 2017-05-29 13:53:25 -04:00
Paul Licameli
bd4d2dc31d Rewrite Envelope::InsertSpace 2017-05-29 13:53:25 -04:00
Paul Licameli
0126918fb5 Simplify InsertOrReplaceRelative, always trim when to domain...
... Comment in it says that it does not check for discontinuities if it
replaces!

This will not matter in the uses of it internal to the Envelope class, which
will in fact always be proper insertions, having checked first for the presence
of a point.
2017-05-29 13:53:25 -04:00
Paul Licameli
5ff09c2a59 Cut from flat TimeTrack does not leave unnecessary points...
... And more generally, Envelope::CollapseRegion, should it be reused more
widely, is responsible for removing the points; WaveTrack code is relieved of
that.
2017-05-28 00:50:35 -04:00
Paul Licameli
2985d24656 Fix envelope editor 2017-05-28 00:50:34 -04:00
Paul Licameli
e428425c7d Change the drawing of wave track envelope at high zoom...
... The function defined by the envelope is evaluated exactly at the times of
samples, but not between samples -- instead there is a simple interpolation.

Therefore the curve might not go through the control points when they are not at
sample times.

The exact value of the function defined by the envelope has no influence on
rendering of the sound in between samples.  So this can make it clear that
the middle point has no influence at all in case three points are very close.

Drawing of other envelopes (Time track, Equalization curves) is not changed.
2017-05-26 14:51:50 -04:00
Paul Licameli
537ccfbc4f Change evaluation of envelope near discontinuities...
... So that even if the time is "slightly" (less than 1/2 sample interval) left
of the discontinuity, the right-hand limit is always used.

Thus this compensates for some roundoff errors when pasting one clip with
an envelope into another.

This overcomes the objections that were in a comment in Envelope::Paste
to making control points with exactly equal times.

And therefore Paste can be rewritten to do so, but that has not happened yet.

Envelope points at exactly equal time coordinates can already be made by
dragging points in the envelope editor.
2017-05-26 14:50:43 -04:00
Paul Licameli
9c7e236442 Prefer "sampleDur" to "sampleTime" for some variable names 2017-05-26 14:50:43 -04:00
Paul Licameli
bcc0bed29a Envelope::SetTrackLen adds a point only when none was present...
... And if points were present, keeps only the leftmost.
2017-05-25 08:15:45 -04:00
Paul Licameli
6c2c2733f9 More Envelope::GetValueRelative; add point for join only as needed 2017-05-25 08:15:45 -04:00
James Crook
c8b2cc9d31 Bug 641 - ASSERT when adding recording not at start of track.
Cause by testing the track length before setting the track length.
2017-05-14 17:26:33 +01:00
Paul Licameli
a9160cf803 Envelope::InsertSpace preserves limiting values of the split point 2017-05-09 09:22:06 -04:00
Paul Licameli
aba52bc79e Update envelope properly for TimeTrack and WaveTrack editing...
... Formerly this was done correctly only for cut and delete from WaveTrack,
paste into WaveTrack, and sync-lock adjustment of WaveTrack (either lengthening
or shortening).

Now also properly done for TimeTrack cut and paste, and also for:

Split cut
Split delete
Trim
2017-05-09 09:22:06 -04:00
Paul Licameli
2d84c65c94 When Envelope domain is shortened, evaluation inside won't change...
... It doesn't happen in practice yet, all present calls to SetTrackLen
make the track the same length or longer.  But this is for completeness.
2017-05-09 09:20:31 -04:00
Paul Licameli
945e411e2c Partial range copy of Envelope will not leave coincident points 2017-05-09 09:20:31 -04:00
Paul Licameli
f5a7e4ce7c Define private Envelope evaluator functions taking relative time...
... To be very sure we can avoid roundoff errors from adding mOffset and
subtracting it again; so that evaluation exactly at a control point time gives
the exact value of that point.
2017-05-09 09:20:31 -04:00
Paul Licameli
01b99f2849 Remove pointer back to Envelope from EnvPoint 2017-05-09 09:20:31 -04:00
Paul Licameli
2e7f806e90 Fix EqualRange for case of zero tolerance 2017-05-09 09:20:31 -04:00
Paul Licameli
ebd1de4ffc Interim fixes for envelopes 2017-05-09 09:19:01 -04:00
Paul Licameli
d2acf1f3e5 Bug842: rescale clip offsets, envelope times when setting track rate 2017-05-07 11:12:24 -04:00
Paul Licameli
7ad910c0a6 Simplify envelope binary search and uses of it 2017-05-07 11:00:55 -04:00
Paul Licameli
30e67bcb8e some reindentation 2017-05-07 11:00:55 -04:00
Paul Licameli
26c4d65bd4 Public Envelope methods all take & return ABSOLUTE time values...
... rather than some of them being relative to the Envelope's offset.

In case of the envelopes used in TimeTrack or Equalization, offset was
always zero, so this doesn't matter, except to make the contract of the
Envelope class more explicit and sensible in isolation.

In case of InsertSpace at least, this does fix an obscure bug, which could
only happen when you have a clip, with an envelope, that starts before zero,
and you select a region overlapping that clip and some other clip, with a void
between, and you use the Join command.

Aren't you relieved that's fixed now?
2017-05-07 11:00:55 -04:00
Paul Licameli
9c683a4f19 Rename some member functions of Envelope 2017-05-07 11:00:55 -04:00
Paul Licameli
4be19128c0 Better constructors for Envelope 2017-05-07 11:00:55 -04:00
Paul Licameli
5963f278f1 void returns from many WaveClip methods, comment safety guarantees 2017-04-02 12:49:47 -04:00
Paul Licameli
23dc35a18c Bug1614: fix crash duplicating a clip 2017-03-30 16:48:52 -04:00