Commit Graph

12409 Commits

Author SHA1 Message Date
James Crook f5e00e5b51 Fix typos in doxygen dependencies documentation page. 2020-09-08 15:47:34 +01:00
James Crook 3b235dd86d First go at a 'Dependencies' page for Audacity source code. 2020-09-08 14:40:31 +01:00
Paul Licameli 8a86fe139f Bug2531: need progress indication when discarding undo history...
... You may see this also when abandoning lots of redo history, and not only
when doing compaction.

If in compaction you discard much undo and also much redo, you may see two
progresses.

It's debatable whether this might have been better implemented by reuse of
ProjectFileIO::DeleteBlocks instead, putting callbacks to a progress indicator
in the function InSet().  But I wanted to avoid more dependency onto
ProjectFileIO.

Doing real work in DeleteBlocks() is supposed to happen only if there is a bug
elsewhere that allowed orphans.  So, still no progress indicator there.
2020-09-06 17:54:14 -04:00
Paul Licameli dfd313f8fa SqliteSampleBlock has back-pointer to its factory...
... and thence to its database connection, indirectly.
2020-09-06 17:09:51 -04:00
Paul Licameli a2e22dc17b TransactionScope for performance also when abandoning redo states 2020-09-06 17:05:33 -04:00
Paul Licameli 495b4afe46 Doxygen comments for TransactionScope 2020-09-06 17:04:47 -04:00
Paul Licameli 327ada3c46 Give a "yellow zone" warning for checkpoint failure without data loss 2020-09-06 12:58:48 -04:00
Leland Lucius 5342d980fb Bug 2367 - Change Pitch effect may create spurious clip at end
Fixes residual mentioned in Comment #11
2020-09-06 03:37:57 -05:00
Leland Lucius 90a69a0173 Bug 2535 - Audacity fails to build on 32-bit Linux 2020-09-06 03:13:16 -05:00
Paul Licameli 7c9e824943 Require UndoManager to have empty history when destroying it...
...which is a justified assumption now.

Do not call ClearStates().  Do not attempt to repopulate ConnectionPtr if the
project is being destroyed.
2020-09-05 16:08:15 -04:00
Paul Licameli 49fc197e42 Bug2531 mitigation: Reduce the pause without progress dialog...
... Do so by lowering the usage of TransactionScope into UndoManager, so that
deletion of blocks is more often grouped into a transaction, as when invoking
Compact via the menu item.
2020-09-05 15:45:08 -04:00
Paul Licameli e4319144c8 TransactionScope usable including only DBConnection not ProjectFileIO 2020-09-05 14:47:13 -04: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 eb7e67623e Demote error message storage from ProjectFileIO into DBConnection 2020-09-05 14:32:39 -04:00
Paul Licameli c9dec8f5a9 Factor ProjectFileIO::GetConnection (returning reference not pointer) 2020-09-05 14:30:34 -04:00
Paul Licameli 4742f4ce1c clang build won't quietly allow missing return statement 2020-09-05 14:23:35 -04:00
Paul Licameli 80cf77eb19 std::once_flag should be static 2020-09-05 11:59:46 -04:00
Paul Licameli 55bf357b8e Remove an assertion 2020-09-04 13:02:12 -04:00
binarywisdom a10a1b81aa fixed bug/enh 266 2020-09-04 11:39:11 -04:00
Paul Licameli d66ffaa4ce Bug2526: Switching projects should not disable label editing 2020-09-04 11:28:04 -04:00
Paul Licameli 8799d26335
Mac: avoid assertion violations from KeyboardCapture.cpp... (#658)
... when the NSEvent is not accessible
2020-09-03 12:33:59 -05:00
Paul Licameli 9129a19c8a Remove unnecessary assertion 2020-09-03 11:47:17 -04:00
Paul Licameli cca20f4e68 Bug2533: Optimize storage of silent blocks...
... This is a more adventurous fix.  It avoids changing the schema.

Use non-positive values of SqliteSampleBlock::mBlockID to store lengths of
blocks of silence.  Keep SqliteSampleBlock structures in memory (sharing where
possible for recurring block lengths) but do not make corresponding rows in
the database table.

Reviewed all uses of mBlockID, and of SqliteSampleBlock::GetBlockID() which
returns it, and of XML attribute "blockid" which persists it.
2020-09-02 21:43:20 -04:00
Paul Licameli 64c50e57da
Sample block cleanups (#657)
* Revert "[Bug 2533] New: Extreme space inefficiency importing silence from an AUP file"...

... It did not fix the symptoms.  Using a zero blob only gives temporary
in-memory space efficiency when adding a row to the database, not space savings
in the file.

This reverts commit d9047dfd25.

* Remove unused SampleBlockFactory::Get

* Eliminate some repetition and magic numbers

* Lower some common steps into GetSummary(); removed unused argument

* mSummary256Bytes and mSummary64kBytes not needed after initialization

* Satisfy sample and summary requests for silent blocks without using db
2020-09-02 13:11:30 -05:00
Paul Licameli b32670b0bc Remove Doxygen comments for nonexistent parameters 2020-09-02 10:53:32 -04:00
Paul Licameli a00fe789b9
More aup import review (#656)
* More format fixes on import: beware sequences with differing format...

... It could happen.  When collecting file information to be used in the
second pass, record the correct format for each.

Don't mistakenly use whatever was the format of the last read Sequence for all
files.

This only matters for the avoidance of unnecessary sample format conversions
when finally appending samples to tracks.  It won't affect the space ultimately
occupied in the database.

* Cautions against double throw in a finally block

* Fix some Doxygen in ImportAUP.cpp
2020-09-02 00:36:48 -05:00
Paul Licameli d5a4ed74d2 Bug2538: Fix persistence of Sequence format in imported .aup ...
... which may be important if the user saved 16 bit for space efficiency.
Don't lose that efficiency.
2020-09-01 22:25:55 -04:00
Paul Licameli a093f5b2cf Remove unused member 2020-09-01 13:36:41 -04:00
Paul Licameli 92d7ee38e5
Do orphan block checking differently... (#655)
... Don't have special knowledge of "blockid" in ProjectSerializer, which should
be very low-level.

Instead, we can deserialize the project first, and use the block ids collected
by the sample block factory since f137a1e.
2020-09-01 10:54:36 -05:00
Paul Licameli 1e3885730f
Aup import review (#654)
* Remove unused member

* I think you want to null the clip pointer when done with it?

* Simplify end tag handling

* Clear tracks in one place, but it may not matter...

... The file handle object is destroyed and not reused in any case

* Log messages can be English

* Let first error message override any mere warning; comments, assertion

* Remove unreachable code -- see the loop preceding it

* fix more unreachable code

* Correct unusual case of file names (is it used?)

* Re-use SFCall, in case we decide in future that the mutex does matter
2020-09-01 09:26:23 -05:00
Paul Licameli 77d0851a65 Remove class ImportXMLTagHandler...
... It became unused at d39590cf41

And remove some other complications in ProjectFileManager that were used only
in it
2020-09-01 09:03:43 -04:00
Paul Licameli 0785a82e2b
bug2537 addendum: XML block attributes are redundant... (#653)
... with database columns, so stop writing them and save some space.

This won't break loading of existing .aup3 files.

This required a bug fix in a SQL command too!
2020-08-31 20:30:59 -05:00
Paul Licameli f137a1ed3e
Bug2537: graph of sharing of block objects needs recreation on open (#652) 2020-08-31 19:30:47 -05:00
Paul Licameli e5c548f76d Fix spelling in comments 2020-08-31 15:04:42 -04:00
Leland Lucius d9047dfd25 [Bug 2533] New: Extreme space inefficiency importing silence from an AUP file 2020-08-30 21:21:45 -05:00
Paul Licameli 7294f7a8e0
Bug2532: should preserve sharing of sample blocks when importing AUP (#651) 2020-08-30 17:18:18 -05: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 1bb34e703e
Bug2529: don't lose data when closing without saving on small drive (#650) 2020-08-28 13:03:35 -05:00
Paul Licameli 29f3361746
Graceful failure saving to thumb drive... (#649)
... If renaming of the file (to a place on a different device) fails,
recover correctly before giving the warning message
2020-08-28 11:19:37 -05:00
Paul Licameli 22c00fab03 Fix misspelled file name in comments and add Doxygen 2020-08-27 22:18:27 -04:00
Paul Licameli 7d359a6640 Bug2515: When WAV export fails to write file, give better message 2020-08-27 22:02:40 -04:00
Paul Licameli 70175acaf4 Fix infinite loop of error messages trying to draw corrupt project...
... As reported by Steve.

Don't throw exceptions when trying only to display a track and the samples
can't be found in the database.
2020-08-26 21:49:39 -04:00
Paul Licameli 2389b191f6 Bug2513: Disk exhaustion error message should be as was pre-Unitary 2020-08-26 16:56:03 -04:00
Paul Licameli 0c4514efb0 Avoid some unexpected recursions because of yields to event loop...
... See code comments.

Not proved to be a cause of data loss bugs, but they caused surprises when
trying to step in the debugger.
2020-08-26 16:01:54 -04:00
Paul Licameli 11e924a49b ClientData 2020-08-26 01:36:48 -04:00
Leland Lucius 407c83ebf0 AUP3: I think we've progressed enough to remove my abort() 2020-08-26 00:23:48 -05:00
Leland Lucius 0bbf1792fa AUP3: Don't molest project file when applying macros
Cliff reported that if you apply a macro to "Files" and you had
a "saved project" open at the time, you would get the "not saved
properly" dialog when you next open that "saved project".

This should correct it...
2020-08-26 00:06:19 -05:00
Paul Licameli bbd893c891 audacity.dox generates complete graph information; added nograph.dox...
... All old contents of audacity.dox moved to audacity.dox.in;

audacity.dox includes it and changes some options, to be run in nightly updates
of web pages;

nograph.dox also includes it, and is now fit for local usage by the developer,
generating only the same information as audacity.dox before (in only half a
minute on my machine), but easily editable to turn on selected graphs.
2020-08-25 21:27:54 -04:00
Paul Licameli b006ec60cc Change type alias names to improve Doxygen...
... Specifically the inheritance diagram showing where ClientData::Site is used
2020-08-25 14:31:06 -04:00