Commit Graph

5 Commits

Author SHA1 Message Date
Paul Licameli 7e697d1d8f Replace many inclusions of Types.h with Identifier.h 2021-05-27 09:51:32 -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 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
Paul Licameli bb9a881c2a
Canonicalize integers in binary blob format, BREAKING COMPATIBILITY... (#616)
... with .aup3 projects saved earlier in 3.0.0 development, except for 32 bit
Windows builds.

Use fixed-width integer types when writing the binary format blobs, not
bool, short, int, size_t, ..., which might vary among machines and so make
.aup3 files non-portable.

Choose the widths to write whatever is narrowest among the four builds; this
makes a difference only for long and size_t which are 32 bits in the 32 bit
Windows build.  (long is also 32 bits on the 64 bit Windows build.)

Also normalize the endianness to little, in case that ever matters on other
future processors.

Didn't attempt the same for the floating point types.
2020-07-17 23:59:27 -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