mirror of
https://github.com/cookiengineer/audacity
synced 2025-06-15 15:49:36 +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:
parent
19542a4065
commit
47e5a2b80a
@ -114,7 +114,9 @@ BlockFile::~BlockFile()
|
|||||||
|
|
||||||
/// Returns the file name of the disk file associated with this
|
/// Returns the file name of the disk file associated with this
|
||||||
/// BlockFile. Not all BlockFiles store their sample data here,
|
/// 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()
|
wxFileName BlockFile::GetFileName()
|
||||||
{
|
{
|
||||||
return mFileName;
|
return mFileName;
|
||||||
|
@ -77,6 +77,8 @@ class BlockFile {
|
|||||||
virtual void SaveXML(XMLWriter &xmlFile) = 0;
|
virtual void SaveXML(XMLWriter &xmlFile) = 0;
|
||||||
|
|
||||||
/// Gets the filename of the disk file associated with this BlockFile
|
/// 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 wxFileName GetFileName();
|
||||||
virtual void SetFileName(wxFileName &name);
|
virtual void SetFileName(wxFileName &name);
|
||||||
|
|
||||||
|
@ -973,6 +973,11 @@ bool DirManager::HandleXMLTag(const wxChar *tag, const wxChar **attrs)
|
|||||||
|
|
||||||
bool DirManager::MoveToNewProjectDirectory(BlockFile *f)
|
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 newFileName;
|
||||||
wxFileName oldFileName=f->GetFileName();
|
wxFileName oldFileName=f->GetFileName();
|
||||||
AssignFile(newFileName,f->GetFileName().GetFullName(),FALSE);
|
AssignFile(newFileName,f->GetFileName().GetFullName(),FALSE);
|
||||||
@ -1025,6 +1030,10 @@ bool DirManager::MoveToNewProjectDirectory(BlockFile *f)
|
|||||||
|
|
||||||
bool DirManager::CopyToNewProjectDirectory(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 newFileName;
|
||||||
wxFileName oldFileName=f->GetFileName();
|
wxFileName oldFileName=f->GetFileName();
|
||||||
AssignFile(newFileName,f->GetFileName().GetFullName(),FALSE);
|
AssignFile(newFileName,f->GetFileName().GetFullName(),FALSE);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user