1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-05-01 08:09:41 +02:00

12458 Commits

Author SHA1 Message Date
Leland Lucius
176eb49a1e AUP3: Several little fixes
Handle bypassing of timetracks in AUP importer correctly
Add bypassing of timetracks in AUP3 importer
Move/add AUP3 in filter lists.
2020-07-15 07:57:20 -05:00
Leland Lucius
5bc3ae659c AUP3: Added AUP3 importer and improved progress dialogs 2020-07-15 01:32:48 -05:00
Leland Lucius
1ec7fd56c1 Re-add ASIO build option 2020-07-13 23:37:26 -05:00
Leland Lucius
0fbabb0e3f AUP3: Only vacuum if unused space is more than 20% 2020-07-13 13:01:36 -05:00
Leland Lucius
6f233cbff5 AUP3: Fix build issues 2020-07-13 09:48:37 -05:00
Leland Lucius
6193598b90 AUP3: Ensure that the update hook is removed 2020-07-13 09:08:31 -05:00
Leland Lucius
25d9e1c387 AUP3: Add better progress to AUP importer 2020-07-13 00:59:12 -05:00
Leland Lucius
e75ab6eaad AUP3: Fix last commit
I hate conflicts...I ALWAYS get them wrong.
2020-07-13 00:45:14 -05:00
Leland Lucius
0815344e5d AUP3: Reworked CopyTo() yet again
This time it has the potential to produce much smaller
output files since it ONLY copies the active blocks and
not all of the blocks related to undo history.  This is
done for "Save As" and "Backup Project".  Normal save
can't take advantage of this, but then it really doesn't
need it as it has to depend on vacuuming.

The vacuuming at close has been adjusted to utilize CopyTo()
so it should produce similarly small files as long as the
vacuuming happens when the project is definitely closing.
2020-07-13 00:04:54 -05:00
Leland Lucius
a0008831e0 Revert "AUP3: Reworked CopyTo() yet again"
A bit more thought needs to do into this.
2020-07-12 10:55:54 -05:00
Leland Lucius
e3c5563d35 AUP3: Reworked CopyTo() yet again
This time it has the potential to produce much smaller
output files since it ONLY copies the active blocks and
not all of the blocks related to undo history.
2020-07-12 10:39:37 -05:00
Leland Lucius
5ffff72d35 AUP3: Fix includes 2020-07-09 14:08:21 -05:00
Leland Lucius
251da3bb3b AUP3: First go at the AUP importer
Near as I can tell, it's pretty much done. Feeding all manner of
.aup projects will definitely need to be done. It would be best
to feed it REAL projects, not the contrived ones I've been playing
with.
2020-07-12 03:53:25 -05:00
Paul Licameli
f34b9697c0 Oops, the once_flag must be static! 2020-07-11 23:44:20 -04:00
Paul Licameli
87d82e76c7
Char width info goes in the unique data dictionary only once per run (#613) 2020-07-11 13:10:58 -05:00
Paul Licameli
6eb6aab8f5 Commit autosave blobs during recording only as needed...
... when there really is at least one new sample block committed to the table,
which is typically only once in about every six seconds, with the default rate
and sample format.

Also renamed a callback function more aptly, since blocks are not files any
more.
2020-07-11 05:13:38 -04:00
Paul Licameli
047fa18afd Remove unused TrackPanel::MakeParentModifyState 2020-07-11 05:11:09 -04:00
Paul Licameli
cea658d9eb
Fix the reading of autosave files... (#610)
* Fix the reading of autosave files...

... problem was in recreating strings from buffers, but copying too many because
null terminators were lacking.

* Autosave during recording backs up all tracks correctly...

... whether to new track, or appending; and it doesn't lose the other tracks
besides the recording.

It is also unnecessary when just starting to record, so remove one call.
2020-07-11 00:49:37 -05:00
Paul Licameli
06f22e942b More exception-safety for recording...
... Do not call Autosave (which might fail) when recovering from exceptions in
recording, but rely on the last good Autosave that happened during recording.

If dropout labels are needed, then immediately modify the undo history item, but
we can accept it if that modification fails.

Also, be sure NOT to skip Autosave in all other places that push the undo
history.  Make Autosave the default unless otherwise specified.

Finally removed one unnecessary call to Autosave.
2020-07-10 13:46:21 -04:00
David Bailes
975ee0cc07 Bug 2496 - Label edit typing prepends selected text
Problem:
labelStruct, a copy of the label is initialized before call to RemoveSelectedText() which acts on the real label. So when the label is updated using labelStruct, the selected text has not been removed.

Fix:
Initialize labelStruct after the call to RemoveSelectedText().
2020-07-10 10:37:02 +01:00
Leland Lucius
b12fafbea0 AUP3: Fix stupied build failure 2020-07-10 01:32:56 -05: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
Paul Licameli
7ad8849d32 When saving new project, put correct file name into MRU submenu...
... bug was introduced at 590d8c6d09fa2989f1e35ad3125965c801ece506
2020-07-09 19:17:23 -04:00
Paul Licameli
70ab645647 Let ESC key in pencil tool reclaim abandoned sample blocks sooner 2020-07-09 16:30:37 -04:00
Leland Lucius
2ec3adf555 AUP3: Fix build failures 2020-07-09 13:46:38 -05:00
Leland Lucius
632ad6efcf AUP3: Better orphan block handling
This replaces my previous attempt since it didn't account
for all the situations where orphans blocks could occur.
2020-07-09 13:14:12 -05:00
Leland Lucius
2e4812b148 AUP3: Fix assertions in Benchmark on 64-bit Windows build
Since size_t is different on 64-bit vs 32-bit Windows builds
it was causing assertions when displaying the results.

You can also change the sample format now by adjusting the
defines at the start of the source.
2020-07-09 13:11:27 -05:00
David Bailes
5b4c9b3425 Bug 2498 - Loudness Normalization always displays LUFS on launch
Problem:
On opening, the units were always LUFS, and the "treat stereo as dual-mono" check box was always available.

Fix:
On opening, adjust the controls which depend on the value of the Normalize choice.
2020-07-09 15:48:01 +01:00
Leland Lucius
c31a034157 AUP3: Display SQLite errors for now 2020-07-08 01:11:38 -05:00
Paul Licameli
88ba35f520
Fix exception handling, as when trying to edit read-only database... (#607)
... Problem is that the delayed undo handling (in the lambda in AudacityApp ::
OnExceptionInMainLoop) should itself have only non-throwing steps.

But there was a redundant attempt at autosaving in ProjectHistory ::
RollbackState, which itself requires another data base write.

But when "rolling back" the in-memory structures to whatever the current state
of undo history is, we can assume that any required autosave was completed
before the current state of undo history was set.

So for rollback only, do not autosave again when discarding changes and
restoring the state.  (But do it still, throwing on failure, when moving around
in the undo history, among saved states.  We do want to keep the last autosave
consistent with the in-memory state.)
2020-07-08 00:44:41 -05:00
Leland Lucius
af6a23696b AUP3: Detect and delete orphan blocks at startup 2020-07-08 00:18:05 -05:00
Leland Lucius
f7d9513f8d AUP3: Moving VFS setting to initer 2020-07-07 15:47:23 -05:00
Paul Licameli
875e8e0984
Cross project copy data loss (#604)
* Need only CloseLock now, not old Lock and Unlock...

... which were for cross-project cut and paste, but they no longer work and we
need another solution.  So delete much old code.

* Fix dangling reference to AudacityProject completely! ...

... in SqliteSampleBlockFactory: retain ONLY the shared pointer to
ProjectFileIO, then pass that, not project, to constructors of blocks.

completing the work of 127696879dcc5ca687ec50a4ccef7acbed563926

* Restore part of the Bug2436 fix...

... which needs the non-default arguments to WaveTrack::EmptyCopy that got lost
at d39590cf41e1e1eac02fc52d88a1ad018824f77b

So that pasted WaveTracks refer to the correct SampleBlockFactory and database
for their project

But this is not yet a sufficient re-fix for the bug

* Complete the fix for cross-project copies and 2436...

... by duplicating sample blocks, in Sequence.cpp, when it is wrong just to
share them.

And to determine which case it is, see whether source and destination Sequences
have the same sample block factories when doing Copy or Paste.  Duplicate
when the factories are different.  Otherwise sharing is safe and more space
efficient.

This does the analogous to what DirManager::CopyBlockFile did before commit
d39590c.
2020-07-07 15:41:50 -05:00
Paul Licameli
590d8c6d09
Fail safe save as (#606)
* ProjectFileIO::SaveProject() won't close original db until done...

... So on the failure path, don't risk closing the original too early, failing
with the new database, and then failing to reopen the original.

Just keep the original open and a new connection open too, until it is
certain that the initial population of the new database is successful.

* Check return value from AutoSaveDelete when saving-as

* Fix the remaining unchecked sqlite3_bind* calls, which are in Autosave...

...similarly to checks in 8b3f9fa

* When saving-as or -copy, open the new database only once

* Check return value from sqlite_initialize
2020-07-07 15:41:33 -05:00
Paul Licameli
ba7ebbb032 Reviewed the ODLocks removed at cbf1bb5, restored just two of them...
... as std::mutex instead.

One is the mutex for the set of all files.

Another is in Profiler.h, which is now back into CMakeLists because the header
is included in one place.  Maybe this utility will find more use again.

Restored one other but commented out, as not necessary now, but need might be
found to put it back again.

The class ODLock was a misnamed thing not specific to the on-demand manager but
used more widely as a thread synchronization utility, functioning as a mutex
object.  It was a mistake to remove all uses of it along with the rest of the
on-demand system.
2020-07-07 16:34:25 -04:00
Leland Lucius
163dd719cc AUP3: Use the "unix-excl" VFS on Linux and Mac 2020-07-07 14:12:33 -05:00
David Bailes
25c1a0b280 Bug 2422 - Append Recording always scrolls vertically to bottom track
Fix:
Move the scrolling to ProjectAudioManager::DoRecord(), where it's known whether the recording is appending to existing tracks or not.
2020-07-07 16:32:33 +01:00
Paul Licameli
fff9e6a2e4 Fix another long long format argument 2020-07-07 02:03:51 -04:00
Paul Licameli
2c0c08f86a Prohibit copy construction of Sequence 2020-07-07 02:01:11 -04:00
Paul Licameli
558d4bbc3d Fix an error message 2020-07-07 01:28:05 -04:00
Paul Licameli
7e85fc9f9f Clear the clipboard when the project from which it was copied closes. 2020-07-07 00:20:25 -04:00
Leland Lucius
1405f3a41e AUP3: Add aup3 to the Info.plist for the Mac 2020-07-06 18:59:22 -05:00
Leland Lucius
0bea15077b AUP3: UP-15 - cannot update a project
At least the project file doesn't get deleted now.
2020-07-06 18:55:53 -05:00
Paul Licameli
4206e1ff6d
Sqlite open bugs (#603)
* Docs say: call sqlite3_close even when sqlite3_open returns error

* Be careful of possible failures of AutoSave...

... In ProjectHistory operations, do the AutoSave first and throw if there is
a failure.

Only then change UndoManager's state, confident that it remains consistent with
what was AutoSaved.

* Throw exceptions if lazy opening of project's database fails...

... because the calls to DB() as in Sqlite3SampleBlock may be in deeply nested
places that can't propagate the error codes; and besides, those functions
had been assuming non-null returns from DB(), which might have crashed before,
but now the assumption is correct when the throw didn't happen.

Note that this exception may also happen during attempted Autosave.  Uses of
Autosave were reviewed and some changes made in the previous commit.
2020-07-06 15:42:18 -05:00
Paul Licameli
0c92d1ed74 Better comments in WaveClip.* after commit 1276968 2020-07-06 16:08:36 -04:00
Leland Lucius
6c2cd2057c Maybe fix the Action build for Linux 2020-07-06 02:48:33 -05:00
Paul Licameli
bf9bad5a6e Fix typo in a message 2020-07-06 01:31:41 -04:00
Leland Lucius
f7db5043c5 AUP3: UP-17 - Projects can be larger on UP-3.0.0
Partial relief only.  This only addresses first symptom and it
will needs to have a progress dialog added.
2020-07-05 23:24:25 -05:00
Leland Lucius
2084c39046 Fix build Mac and Linux 2020-07-05 19:25:06 -05:00
Paul Licameli
3d0e86a8f8 Correct substitution of long long values into SQL queries...
... Reviewed all sqlite3_snprintf and only these had problems
2020-07-05 17:25:16 -04:00