public long ImportBsnesTraceLogs(string[] fileNames) { var importer = new BsnesTraceLogImporter(Project.Data.GetSnesApi()); // TODO: differentiate between binary-formatted and text-formatted files // probably look for a newline within 80 characters // call importer.ImportTraceLogLineBinary() var largeFilesReader = controllerFactory.GetLargeFileReaderProgressController(); // caution: trace logs can be gigantic, even a few seconds can be > 1GB // inside here, performance becomes critical. largeFilesReader.Filenames = new List <string>(fileNames); largeFilesReader.LineReadCallback = line => importer.ImportTraceLogLine(line); largeFilesReader.Run(); if (importer.CurrentStats.NumRomBytesModified > 0) { MarkChanged(); } return(importer.CurrentStats.NumRomBytesModified); }