... Start Audacity; generate some noise; shift clip with Time-Shift tool;
command+Q to exit; say No to save changes.
The scope of a GuardedCall needs to be expanded, because Conn() can throw,
so that no exceptions escape the destructor of SqliteSampleBlock.
But now there is an error dialog on exit instead of a crash.
The error icon was gone because we are now using the ErrorDialog, which didn't have it. So added back explicitly. I decided to go with wxART_WARNING rather than wxART_ERROR because nearly all of these present as warnings.
... Implemented giving the Multi-view choice the special implementation that it
needs.
The "multi" choice is always last in the preference and in the command editing
drop-down menus, but that could be changed.
Multi-view should not be treated as another registered kind of sub-view on par
with others. This would complicate the implementation in worse ways.
... 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.
... 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.
... 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.
* 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 d9047dfd254ecf92c0770c0cbda62a238c2fdd29.
* 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
* 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
... 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.
* 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