MCPcopy Create free account
hub / github.com/audacity/audacity / SaveFromTimerRecording

Method SaveFromTimerRecording

src/ProjectFileManager.cpp:755–786  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

753}
754
755bool ProjectFileManager::SaveFromTimerRecording(wxFileName fnFile)
756{
757 auto &project = mProject;
758 auto &projectFileIO = ProjectFileIO::Get( project );
759
760 // MY: Will save the project to a NEW location a-la Save As
761 // and then tidy up after itself.
762
763 wxString sNewFileName = fnFile.GetFullPath();
764
765 // MY: To allow SaveAs from Timer Recording we need to check what
766 // the value of mFileName is before we change it.
767 FilePath sOldFilename;
768 if (!projectFileIO.IsModified()) {
769 sOldFilename = projectFileIO.GetFileName();
770 }
771
772 // MY: If the project file already exists then bail out
773 // and send populate the message string (pointer) so
774 // we can tell the user what went wrong.
775 if (wxFileExists(sNewFileName)) {
776 return false;
777 }
778
779 auto success = DoSave(sNewFileName, true);
780
781 if (success) {
782 FileHistory::Global().Append( projectFileIO.GetFileName() );
783 }
784
785 return success;
786}
787
788void ProjectFileManager::CompactProjectOnClose()
789{

Callers 1

Calls 3

GetFunction · 0.85
IsModifiedMethod · 0.45
AppendMethod · 0.45

Tested by

no test coverage detected