1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-11-23 17:30:17 +01:00

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
This commit is contained in:
Paul Licameli
2020-07-23 12:17:29 -04:00
committed by GitHub
parent d677bead7a
commit a8fd6c6ce8
13 changed files with 120 additions and 115 deletions

View File

@@ -36,7 +36,7 @@ public:
void Delete();
SampleBlockID GetBlockID() override;
SampleBlockID GetBlockID() const override;
size_t DoGetSamples(samplePtr dest,
sampleFormat destformat,
@@ -284,7 +284,7 @@ void SqliteSampleBlock::CloseLock()
mLocked = true;
}
SampleBlockID SqliteSampleBlock::GetBlockID()
SampleBlockID SqliteSampleBlock::GetBlockID() const
{
return mBlockID;
}