int LOFImportFileHandle::Import(TrackFactory *trackFactory, Track ***outTracks, int *outNumTracks, Tags *tags) { wxASSERT(mTextFile->IsOpened()); if(mTextFile->Eof()) { mTextFile->Close(); return eImportFailed; } wxString line = mTextFile->GetFirstLine(); while (!mTextFile->Eof()) { lofOpenFiles(&line); line = mTextFile->GetNextLine(); } // for last line lofOpenFiles(&line); // set any duration/offset factors for last window, as all files were called doDuration(); doScrollOffset(); // exited ok if(mTextFile->Close()) return eImportSuccess; return eImportFailed; }
ProgressResult LOFImportFileHandle::Import(TrackFactory * WXUNUSED(trackFactory), TrackHolders &outTracks, Tags * WXUNUSED(tags)) { outTracks.clear(); wxASSERT(mTextFile->IsOpened()); if(mTextFile->Eof()) { mTextFile->Close(); return ProgressResult::Failed; } wxString line = mTextFile->GetFirstLine(); while (!mTextFile->Eof()) { lofOpenFiles(&line); line = mTextFile->GetNextLine(); } // for last line lofOpenFiles(&line); // set any duration/offset factors for last window, as all files were called doDuration(); doScrollOffset(); // exited ok if(mTextFile->Close()) return ProgressResult::Success; return ProgressResult::Failed; }
ProgressResult LOFImportFileHandle::Import( TrackFactory * WXUNUSED(trackFactory), TrackHolders &outTracks, Tags * WXUNUSED(tags)) { // Unlike other ImportFileHandle subclasses, this one never gives any tracks // back to the caller. // Instead, it recursively calls AudacityProject::Import for each file listed // in the .lof file. // Each importation creates a NEW undo state. // If there is an error or exception during one of them, only that one's // side effects are rolled back, and the rest of the import list is skipped. // The file may have "window" directives that cause NEW AudacityProjects // to be created, and the undo states are pushed onto the latest project. // If a project is created but the first file import into it fails, destroy // the project. outTracks.clear(); wxASSERT(mTextFile->IsOpened()); if(mTextFile->Eof()) { mTextFile->Close(); return ProgressResult::Failed; } wxString line = mTextFile->GetFirstLine(); while (!mTextFile->Eof()) { lofOpenFiles(&line); line = mTextFile->GetNextLine(); } // for last line lofOpenFiles(&line); if(!mTextFile->Close()) return ProgressResult::Failed; // set any duration/offset factors for last window, as all files were called doDurationAndScrollOffset(); return ProgressResult::Success; }