1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-15 15:49:36 +02:00

Fix bug 160: silent blockfiles not copied between projects

This commit is contained in:
BusinessmanProgrammerSteve 2010-05-05 23:41:27 +00:00
parent 787d033f4c
commit d664740a88

View File

@ -839,28 +839,38 @@ BlockFile *DirManager::CopyBlockFile(BlockFile *b)
return b; return b;
} }
wxFileName newFile = MakeBlockFileName(); // Copy the blockfile
BlockFile *b2;
// We assume that the new file should have the same extension if (b->GetFileName().GetName().IsEmpty()) {
// as the existing file // Block files with no filename (i.e. SilentBlockFile) just need an
newFile.SetExt(b->GetFileName().GetExt()); // in-memory copy
b2 = b->Copy(wxFileName());
//some block files such as ODPCMAliasBlockFIle don't always have
//a summary file, so we should check before we copy.
if(b->IsSummaryAvailable())
{
if( !wxCopyFile(b->GetFileName().GetFullPath(),
newFile.GetFullPath()) )
return NULL;
} }
else
{
wxFileName newFile = MakeBlockFileName();
BlockFile *b2 = b->Copy(newFile); // We assume that the new file should have the same extension
// as the existing file
newFile.SetExt(b->GetFileName().GetExt());
if (b2 == NULL) //some block files such as ODPCMAliasBlockFIle don't always have
return NULL; //a summary file, so we should check before we copy.
if(b->IsSummaryAvailable())
{
if( !wxCopyFile(b->GetFileName().GetFullPath(),
newFile.GetFullPath()) )
return NULL;
}
blockFileHash[newFile.GetName()]=b2; b2 = b->Copy(newFile);
aliasList.Add(newFile.GetFullPath());
if (b2 == NULL)
return NULL;
blockFileHash[newFile.GetName()]=b2;
aliasList.Add(newFile.GetFullPath());
}
return b2; return b2;
} }