From 678dffa0125a49ddd240baaee49e2bdfa91ee633 Mon Sep 17 00:00:00 2001 From: James Crook Date: Tue, 20 Apr 2021 11:51:15 +0100 Subject: [PATCH] Bug 2743 - The first use of the "window" command in LOF files is ignored by Audacity --- src/import/ImportLOF.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/import/ImportLOF.cpp b/src/import/ImportLOF.cpp index cf5a386da..52fdd039c 100644 --- a/src/import/ImportLOF.cpp +++ b/src/import/ImportLOF.cpp @@ -151,7 +151,7 @@ private: AudacityProject *mProject{}; // In order to know whether or not to create a NEW window - bool windowCalledOnce{ false }; + int nFilesInGroup{ 0 }; // In order to zoom in, it must be done after files are opened bool callDurationFactor{ false }; @@ -315,15 +315,11 @@ void LOFImportFileHandle::lofOpenFiles(wxString* ln) // set any duration/offset factors for last window, as all files were called doDurationAndScrollOffset(); - if (windowCalledOnce) + if (nFilesInGroup > 0 ) // Cause a project to be created with the next import mProject = nullptr; - else - // Apply any offset and duration directives of the first "window" line - // to the previously open project, not a NEW one. - ; - windowCalledOnce = true; + nFilesInGroup = 0; while (tok.HasMoreTokens()) { @@ -382,7 +378,7 @@ void LOFImportFileHandle::lofOpenFiles(wxString* ln) else if (tokenholder.IsSameAs(wxT("file"), false)) { - + nFilesInGroup++; // To identify filename and open it tokenholder = temptok1.GetNextToken(); wxString targettoken = temptok1.GetNextToken();