mirror of
https://github.com/cookiengineer/audacity
synced 2025-11-23 17:30:17 +01:00
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.
This commit is contained in:
@@ -129,6 +129,8 @@ public:
|
||||
|
||||
~SqliteSampleBlockFactory() override;
|
||||
|
||||
SampleBlockIDs GetActiveBlockIDs() override;
|
||||
|
||||
SampleBlockPtr DoGet(SampleBlockID sbid) override;
|
||||
|
||||
SampleBlockPtr DoCreate(samplePtr src,
|
||||
@@ -171,6 +173,21 @@ SampleBlockPtr SqliteSampleBlockFactory::DoCreate(
|
||||
return sb;
|
||||
}
|
||||
|
||||
auto SqliteSampleBlockFactory::GetActiveBlockIDs() -> SampleBlockIDs
|
||||
{
|
||||
SampleBlockIDs result;
|
||||
for (auto end = mAllBlocks.end(), it = mAllBlocks.begin(); it != end;) {
|
||||
if (it->second.expired())
|
||||
// Tighten up the map
|
||||
it = mAllBlocks.erase(it);
|
||||
else {
|
||||
result.insert( it->first );
|
||||
++it;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
SampleBlockPtr SqliteSampleBlockFactory::DoCreateSilent(
|
||||
size_t numsamples, sampleFormat srcformat )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user