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

Update documentation and add checks surrounding block files

(since we now have silent block files with no disk file)
This commit is contained in:
BusinessmanProgrammerSteve 2010-05-08 00:58:23 +00:00
parent 19542a4065
commit 47e5a2b80a
3 changed files with 14 additions and 1 deletions

View File

@ -114,7 +114,9 @@ BlockFile::~BlockFile()
/// Returns the file name of the disk file associated with this
/// BlockFile. Not all BlockFiles store their sample data here,
/// but all BlockFiles have at least their summary data here.
/// but most BlockFiles have at least their summary data here.
/// (some, i.e. SilentBlockFiles, do not correspond to a file on
/// disk and have empty file names)
wxFileName BlockFile::GetFileName()
{
return mFileName;

View File

@ -77,6 +77,8 @@ class BlockFile {
virtual void SaveXML(XMLWriter &xmlFile) = 0;
/// Gets the filename of the disk file associated with this BlockFile
/// (can be empty -- some BlockFiles, like SilentBlockFile, correspond to
/// no file on disk)
virtual wxFileName GetFileName();
virtual void SetFileName(wxFileName &name);

View File

@ -973,6 +973,11 @@ bool DirManager::HandleXMLTag(const wxChar *tag, const wxChar **attrs)
bool DirManager::MoveToNewProjectDirectory(BlockFile *f)
{
// Check that this BlockFile corresponds to a file on disk
if (f->GetFileName().GetName().IsEmpty()) {
return true;
}
wxFileName newFileName;
wxFileName oldFileName=f->GetFileName();
AssignFile(newFileName,f->GetFileName().GetFullName(),FALSE);
@ -1025,6 +1030,10 @@ bool DirManager::MoveToNewProjectDirectory(BlockFile *f)
bool DirManager::CopyToNewProjectDirectory(BlockFile *f)
{
// Check that this BlockFile corresponds to a file on disk
if (f->GetFileName().GetName().IsEmpty()) {
return true;
}
wxFileName newFileName;
wxFileName oldFileName=f->GetFileName();
AssignFile(newFileName,f->GetFileName().GetFullName(),FALSE);