Commit Graph

431 Commits

Author SHA1 Message Date
Paul Licameli cfbdd2d22e Type alias ManualPageID for wxString used in many places...
... eliminating many direct mentions of wxString.  A real type distinction will
be made next.
2021-07-01 13:33:04 -04:00
Dmitry Vedenko 690772ccb0 Use ShowExceptionDialog when we want to show ErrorReportDialog 2021-06-08 08:08:26 -07:00
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
Paul Licameli f1de843246 Use Settings for default sample rate and format...
... The first is an example of a Setting with a computed default value.

Also making a new file to hold them, separate from the GUI that changes them
in QualityPrefs; fewer things depend on QualityPrefs
2021-05-17 08:46:08 -04:00
Paul Licameli c5ebc396eb Audacity.h has shrunk to nothing, now remove it! 2021-05-10 00:05:23 -05:00
Paul Licameli e653b4aaf8 Eliminate Experimental.h, configure compile options instead...
... This makes it impossible to forget to include the EXPERIMENTAL definitions
(such as when cutting and pasting code) and so get unintended quiet changes of
behavior.

The EXPERIMENTAL flags are now specified instead in new file Experimental.cmake
2021-04-27 12:40:07 -04:00
JohnColket a3d9f41fb4
Bug 2582 - Enh: Repeat last Process, Part 2 (#734) 2021-02-03 11:02:49 +00:00
Paul Licameli 197ebc2994 Bug2583 residual: Re-placement of cutlines when generating sound 2021-01-25 12:06:24 -05:00
freddii 534359de6c
Fix minor typos (#720)
Co-authored-by: freddii <https://freddii@github.com>
2021-01-12 11:56:09 +00:00
Paul Licameli e7b3c2b99f Cut and paste TransactionScope into DBConnection.* files 2020-09-05 14:44:34 -04:00
Paul Licameli ddc2593282 TransactionScope only requires DBConnection not ProjectFileIO 2020-09-05 14:35:24 -04:00
Paul Licameli c17b804750
Dont delete sample blocks prematurely (#648)
* Revert "AUP3: Don't delete sample blocks prematurely"

This reverts commit c1884349d5.

* "Don't delete sample blocks prematurely" fixed otherwise...

... and very simply.

Problem was that, only for an interactive effect (like Bass and Treble), the
save point was created, rolled back, created again, then committed.

But (unlike with the non-savepoint commands, even if savepoint is outermost),
rolling back a savepoint really just rewinds it without removing it -- therefore
the second savepoint was inner, but the first (outer) was never committed, so
some changes failed to persist.

Solution:  add a commit after rollback of savepoint to implement destructor
of AutoCommitTransaction.

The reversion of c188434 also leaves AutoCommitTransaction as a better RAII
style operation.  Rollback changes by default -- keep changes only if
success is explicitly indicated.

* Rename AutoCommitTransaction as TransactionScope...

... More appropriately, since it's now the rollback that is automatic but
the commit that must be explicit
2020-08-28 15:38:38 -05:00
Paul Licameli 4ca3e7096f
Track factory cleanup (#646)
* Don't need TrackFactory to make LabelTrack

* Don't need TrackFactory to make NoteTrack

* Don't need TrackFactory to make TimeTrack, or ZoomInfo in the factory

* Remove some forward declarations

* Rename TrackFactory as WaveTrackFactory, move it out of Track.cpp
2020-08-22 18:44:49 -05:00
Leland Lucius e2d6e1cc24 AUP3: Update default/lastused path handling 2020-07-27 14:11:50 -05:00
Leland Lucius c1884349d5 AUP3: Don't delete sample blocks prematurely
The wrong sample blocks would be deleted at close in step 6:

1) New Project
2) Save and name
3) Import one stereo MP3 (about 6 minutes)
4) Save, close and re-open
5) Apply Bass and Treble to the track using real-time preview
6) Save, close and re-open
7) Message Failed to retrieve sample block
2020-07-25 20:03:23 -05:00
Paul Licameli a8fd6c6ce8
Preliminaries for grouped block deletion (#628)
* Change usage of AutoCommitTransaction::Rollback...

... It is the more useful pattern (as in many finally blocks) for the failure
path in the destructor (which rolls back) to be the default, but an explicit
call must inform it of success.

This corrects the early return paths in Effect::DoEffect().

Throw inconsistency exception if Commit() is called again after having been
called once, successfully

Also remove a friend declaration

* UndoManager's interface uses consistent 0-based indexing of states...

... Returned by GetCurrentState() and used by SetStateTo(),
GetLongDescription(), GetShortDescription()

* SampleBlock::GetBlockID is const

* Generalized function to visit sample blocks used in a TrackList...

... Eliminating some duplication; put it in WaveTrack, not Track, to avoid
a dependency cycle.

* Eliminate more repetition with BlockSpaceUsageAccumulator

* Function to delete all blocks of/not-of a given set in one command
2020-07-23 11:17:29 -05:00
Leland Lucius 7e9a3f49b8 AUP3: Wrap effect processing in a transaction
This is solely for performance reasons and has
nothing at all to do with recoverability.
2020-07-21 16:39:18 -05:00
Leland Lucius 84f363ee07 AUP3: Simplify checkpoing and add checkpoint progress dialog
Also move the project file closure out of the ProjectFileIO
destructor and does it before the project file window is
destroyed.
2020-07-20 11:10:31 -05:00
Leland Lucius d2b4a0e488 AUP3: Put checkpointing in a separate thread
This is highly experimental.  It's defers most checkpointing
to a separate thread to see if we get better throughput and
less choppiness when applying effects.
2020-07-19 03:28:02 -05:00
David Bailes c174b254a1 Bug 2487 - Playback meters and preview of non-real-time effect
Problem:
Playback meters do not respond during preview of non-real-time effect.

Commit ba6db6e added the meters into AudioIOStartStreamOptions.
However Effect::Preview(bool) was not modified to set the playback meter.

Fix:
In Effect::Preview(bool), use DefaultPlayOptions, which includes a playback meter.
2020-07-16 14:41:48 +01:00
Leland Lucius 5b41115bd0 AUP3: Mostly rework of CopyTo()
It now uses VACUUM INTO instead of the SQLite backup API
in hopes that the copies will be smaller. And VACUUM INTO
is "supposed" to be faster, but time will tell.  It's easy
to put the backup API usage back in.

This also fixes a bit I missed with redoing the orphan block
handling that was reported by Paul.

And finally, it renames the AutoRecovery.cpp/.h files and AutoSaveFile
class to ProjectSerializer since the AutoSaveFile class is being
used for regular project documents now and it doesn't write to a
file anymore.

If anyone has a better idea for a name other than ProjectSerializer
feel free to change it.  I hate naming things.
2020-07-10 00:50:52 -05:00
Leland Lucius cbf1bb558e AUP3: Removes OD code related to project file handling
This removes all of the OnDemand code embedded throughout
    the main codebase. Individual files related specifically
    to OD have been left in place, but removed from the build.
2020-07-01 01:14:05 -05:00
Paul Licameli 3542eb4ca0 Replace wxFileDialog with FileDialogWrapper in two places 2020-05-22 20:19:02 -04:00
SteveDaulton 29d1a7b7b1 Fix bug 2392
Commit 66fd95f3d6 reverted.
2020-04-20 11:26:57 +01:00
Paul Licameli 9f076b5179 Make changes to Change Tempo dialog during preview work as intended...
... See commits b22f6b59d2 and
19fa6d2833
2020-03-26 11:13:43 -04:00
Paul Licameli 85c34132f4 fix sync-lock adjustment in effects, see commit a93c447 2020-03-26 11:08:22 -04:00
Paul Licameli 491b1d40a3 Remove unused member of Effect 2020-03-26 11:02:53 -04:00
Paul Licameli 210fc28863 Bug 2368: Effects with clip boundaries differing across channels...
... Wrong results could happen in effects that don't compute the channels
independently, such as the built-in Reverb.

To fix it, always fetch same position of left & right channels when
computing effects.
2020-03-22 07:56:40 -04:00
Paul Licameli 8eee265c38 Fix error in generator code...
... see commit 5378b0a951

complete the change that was intended there, for both channels
2020-03-22 07:56:40 -04: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 37d730edfe Break dependency cycle of Effect and EffectManager 2020-03-08 16:21:28 -04:00
Paul Licameli a9658e6ef7 Alternative fix for Bug2346 without dependency cycles 2020-03-06 17:32:24 -05:00
James Crook f1b6843b9a Bug 2321 - Crash on editing ChangePitch parameters in a Macro
EffectChangePitch:: Don't use the inputTracks() when building the GUI
in Batch mode.

Repeat and NyquistEffect had the same problem as they could call
FindProject() which used inputTracks() on a closed project.  Fixed by a change in Effect::GetSelectionFormat().
2020-03-06 19:14:31 +00:00
James Crook 09883646ec Fix Linux builds (Case sensitive include paths) 2020-03-05 23:00:05 +00:00
James Crook 95bbe617b8 Bug 2343 - Presets: Effect Ids not the same in Presets as for Macros 2020-03-05 22:14:17 +00:00
Paul Licameli da2e02242f Bug2325: Don't hang exporting effect presets twice...
... or, what I saw in my Mac builds:  there wasn't a hang, but there was
incorrect behavior on alternate attempts to export presets.  Sometimes, instead
of (correctly) giving a file overwrite warning, there was instead a message
box about failure to open a non-existent file path, which had the last path
component duplicated.
2020-02-25 11:39:46 -05:00
James Crook 3653af42fc Bug 2326 - Further wording tweaks. 2020-02-25 11:41:36 +00:00
James Crook d70365ba2b Bug 2326 - Wording improvement (as requested). 2020-02-25 11:09:43 +00:00
James Crook 64811e49f9 Bug 2326 - Export settings from one effect can be attempted to be imported into another effect - silent fail, with no error message 2020-02-24 20:57:47 +00:00
James Crook 24e5c9bde9 Remove old printfs
These were introduced when working on import/export of presets.
2020-02-22 19:06:01 +00:00
James Crook a6699ed494 Bug 2283 - Crash on editing Nyquist Generator plug-in parameters in Macro
Big Thanks to Steve for finding this and writing clear steps to reproduce when logging this bug in Bugzilla.  Also thanks to Peter for confirming the same bug is present on Windows, i.e. is all platforms, not just Linux.
2020-02-17 16:31:40 +00:00
James Crook 83c294c844 Bug 2237 - Equalization effects have no Import or Export for curves
This is a minimal fix for this bug, and can be improved on in time.  There is almost no error checking in the file read and write, so if you use a bad presets file, you won't be told (yet).

It does provide import and export for all effects that have presets.
2020-02-17 11:59:40 +00:00
Paul Licameli 1c84932dfa EffectUIClientInterface::PopulateUI takes ShuttleGui & 2020-01-23 19:06:23 -05:00
Paul Licameli 46e99bb038 Move EffectPresetsDialog out of Effect.cpp 2020-01-23 15:23:46 -05:00
Paul Licameli e5625bfb89 Move EffectDialog out of Effect.cpp 2020-01-23 15:23:43 -05:00
Paul Licameli 66fd95f3d6 Rewrite the path through NyquistEffect, in the case that...
... you use the prompt, and you enter a complete script with control comments
that are reinterpreted to put up a second dialog.

This simplifies Effect::Delegate() and avoids mutual recursion of ShowInterface
with DoEffect.
2020-01-08 16:48:37 -05:00
Paul Licameli e8c8db8b33 Parent and dialog factory arguments of Effect::DoEffect are optional 2020-01-08 16:47:21 -05:00
SteveDaulton 8b1ecf03a4 Fix bug 2280 2020-01-07 16:47:50 +00:00
Paul Licameli 6a0aed3884 Eliminate uses of GetActiveProject in src/effects 2020-01-06 14:14:21 -05:00
Paul Licameli a93c4472f5 TrackList has back-pointer to project...
... and Track::GetOwner() is publicized, so that now you can find the
the AudacityProject, if any, that owns a given Track; this will help eliminate
some uses of GetActiveProject
2020-01-06 14:14:21 -05:00