1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-25 16:48:44 +02:00

178 Commits

Author SHA1 Message Date
James Crook
c28be778e2 Linty fixes
This commit fixes a number of warnings shown in compilation with MSVC.  No behavioral changes intended.  I did not fix signed/unsigned warnings.
2017-11-07 14:23:30 +00:00
James Crook
68897d8932 Some cppcheck fixes by David Binderman 2017-11-04 17:47:39 +00:00
James Crook
b48c6b0fd6 Clip (and track) colours now persists in .aup file. 2017-11-04 17:47:22 +00:00
James Crook
42c52de7f1 Coloured clips basics
These basics add a colour index to each clip and track, and allow for a choice of four colours to be set from the track menu drop down.  The additional wave colours (red, green and black) are not currently configurable, and the colour index is not currently saved.
2017-11-04 17:47:02 +00:00
Paul Licameli
bea1a089ff spelling 2017-10-21 11:23:55 -04:00
Paul Licameli
404eca84c8 Implement mayThrow argument of WaveTrackCache::Get properly...
... So that we don't get into a loop re-throwing exceptions while trying to
draw a corrupt project.

And so that we don't crash playing a corrupt project.
2017-10-21 10:39:39 -04:00
James Crook
1b4999d0d3 Bug 1290 - "Split New" clips cannot be dragged back into the track they came from.
Earlier fix was broken and allowed clips to overlap.  Updated code:
- Checks that the modified slide amount is legal, against ALL clips, not just against later clips in the array.
- Computes tolerance correctly.
- Typically uses tolerance just once.
- Moves selection with clip
- Only restarts sliding with a 'clean slate' IF there was room on the original track.

Previously the code could reject a move to a new track, and then mistakenly allow just the horizontal part of the move on the original track(s), even with a clip blocking the way.
2017-08-23 18:15:00 +01:00
James Crook
e984211cce Bug 1290 - "Split New" clips cannot be dragged back into the track they came from.
Fixed by giving some tolerance in how the dragged clip(s) are placed.
The tolerance is 1px, so it depends on the zoom.  Therefore if zoomed in your positioning is more precise.
2017-08-19 22:46:33 +01:00
James Crook
4d43d2273b Bug 1516 - Clips: Can't drag vertically if starting position of clip overlaps clip in target track 2017-08-19 17:53:50 +01:00
Paul Licameli
1ef235c21c Bug1661: Default audio track name not being translated...
... Problem was introduced in 2.1.3 at:
8a6edf3623662b6cb3eb90e794c34e44c283c33d
2017-07-21 17:29:52 -04:00
Paul Licameli
cb9d37f362 build fix 2017-07-09 14:09:33 -04:00
Paul Licameli
84b5fd6075 Compute default WaveTrack height analogously to NoteTrack...
... though in fact this comes to the same 150 pixels as before, given the
present layout table.
2017-06-06 22:39:30 -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
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
David Bailes
7900aa51ba Update for commands which interact with clips using the keyboard.
Changed the criterion for deciding when two clips are immediately next to each other, and made it into a function: WaveClip::SharesBoundaryWithNextClip.
2017-05-16 14:23:07 +01:00
David Bailes
b2d8f36969 Fix for bugs in keyboard clip commands due to rounding errors
When When two clips are immediately next to each other, the GetEndTime() of the first clip and the GetStartTime() of the second clip may not be exactly equal due to rounding errors. The existing code assumed they were equal, and this lead to the wrong clip boundaries or clips being found.

There are a number of ways of fixing this which could be explored. The current solution involves changing only the code for the keyboard interaction with clips.

The fix:
1. The test used for two clips being immediately next to each other is that GetEndSample() on the first clip is equal to to GetStartSample() on the second clip.
2. When searching for the start/end times of clips, the cases where GetEndTime() and GetStartTime() are not equal are taken into account. This is done in the two functions AudacityProject::AdjustForFindingStartTimes and AudacityProject::AdjustForFindingEndTimes.
2017-05-10 09:24:25 +01:00
Paul Licameli
327e5d8557 Correct envelope update for Join that includes a gap between clips 2017-05-09 09:22:07 -04:00
Paul Licameli
8c4dc38047 WaveTrack::SplitAt no longer needs to insert envelope points...
... because partial-copy construction of the new WaveClip, and CollapseRegion
within WaveClip::Clear, handle it.
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
5dfb47132e Interim fixes for Envelopes 2017-05-08 13:19:39 -04:00
James Crook
927c500acd Bug 1626 - Preview of non-RTP effects fails if all the track is selected
A length of zero for silence to insert is allowed.  It means 'do nothing'.
2017-05-07 19:09:37 +01:00
Paul Licameli
d2acf1f3e5 Bug842: rescale clip offsets, envelope times when setting track rate 2017-05-07 11:12:24 -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
8bfe4cc685 Fix more cases of Wave and Note track editing wrongly throwing 2017-05-01 04:48:14 -04:00
Paul Licameli
b2b9708b29 Fix possible assertion violations for cut, paste, trim 2017-04-29 15:41:18 -04:00
Paul Licameli
3aff330671 Fix compilation of EXPERIMENTAL_OUTPUT_DISPLAY; fix a warning in it 2017-04-23 07:58:11 -04:00
David Bailes
017990fac0 Added prefix std:: to my uses of find_if in recent commits 2017-04-04 11:16:10 +01:00
Paul Licameli
55439247ad All the catches are in place for BlockFile and other errors, now throw. 2017-04-03 23:32:40 -04:00
David Bailes
a7a4a70e5f Two commands added, neither on a menu:
Clip Left
Clip Right

If the cursor lies within a clip, the clip and the cursor is moved 1 pixel left/right.
If the cursor position is at both a clip end and a clip start, the second of these clips is moved.

The movement currently ignores the snap to setting on the selection bar, and there is no snapping to the clip boundaries of other clips.
Following the behaviour or shifting with the mouse, the distance moved is rounded to an integral number of samples, and the minimum distance moved is one sample.
2017-04-03 13:53:48 +01:00
James Crook
028ed19d90 Sync with DarkAudacity 2017-04-02 23:07:13 +01:00
Paul Licameli
5963f278f1 void returns from many WaveClip methods, comment safety guarantees 2017-04-02 12:49:47 -04:00
Paul Licameli
aa83c4cf29 Implement the more than weak guarantees needed for recording...
... in WaveClip and WaveTrack, to save as much recording as we can,
assuming the strong guarantees that Sequence will give.

Also comment that some other WaveTrack methods can give strong guarantee,
incidentally to making HandleClear give strong.
2017-04-02 12:46:47 -04:00
Paul Licameli
e3d4a8dcfe Comment the strength of guarantees of some WaveTrack methods 2017-04-02 12:43:21 -04:00
Paul Licameli
3db132f9b0 Fix WaveTrack::SplitAt 2017-04-02 12:43:21 -04:00
Paul Licameli
7195f9a3f4 fix windows build 2017-03-31 22:53:58 -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
e1473dfe76 void return, not boolean success, from some Track virtual functions...
... 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.
2017-03-31 18:26:52 -04:00
Paul Licameli
6b84dc1c1d Factory methods will return non-NULL or throw 2017-03-31 18:14:29 -04:00
Paul Licameli
608dcc9b3f Reimplement prohibitions on moving clips by throwing exceptions...
... Also comment some strong and weak guarantees
2017-03-31 17:47:19 -04:00
Paul Licameli
7bda40f656 Common functions read and write mute and solo in Wave and Note 2017-03-30 16:00:27 -04:00
Paul Licameli
c391a8f884 Define AudioTrack and PlayableTrack as common bases for Wave and Note 2017-03-29 13:27:22 -04:00
Paul Licameli
38b8e57e4e Specify whether to throw on bad read in Mixer and WaveTrackCache...
... Do throw when exporting or mixing-and-rendering; don't if playing back or
drawing a spectrogram, but then just use zeroes.
2017-03-21 17:23:35 -04: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
70d9e4bdc7 GetMinMax, GetRMS functions take a mayThrow argument, return numbers 2017-03-21 14:19:02 -04:00
Paul Licameli
b81cdee7e3 Comment where xml writing functions may throw 2017-03-18 11:45:05 -04:00
Paul Licameli
18be1bdad6 Remove naked new[] in: tracks 2017-03-17 17:52:47 -04:00
Paul Licameli
b4734ff790 Duplicate command copies cutlines 2017-03-17 17:52:40 -04:00
Paul Licameli
934a505e1a Changes in WaveClip construction...
... Eliminate CreateFromCopy, add new one-step constructor instead.
It was wasteful to create a copy only to re-create the Sequence at once.

Sequence::Copy is a factory returning a unique_ptr.

Some error checks are removed, but there will be exceptions instead later.
2017-03-17 17:52:39 -04:00
Paul Licameli
25619fb46e Don't create placeholder clips in Duplicate command ...
... when there is no clip at the right edge of the selection.
2017-03-17 17:52:39 -04:00