diff data/fileio/CSVFileReader.h @ 1491:1dc64d3d323c import-audio-data

Support progress reporter for data file loads
author Chris Cannam
date Fri, 29 Jun 2018 13:44:53 +0100
parents 53fa8d57b728
children fbe8afdfa8a6
line wrap: on
line diff
--- a/data/fileio/CSVFileReader.h	Thu Jun 28 15:52:30 2018 +0100
+++ b/data/fileio/CSVFileReader.h	Fri Jun 29 13:44:53 2018 +0100
@@ -27,6 +27,7 @@
 #include <QIODevice>
 
 class QFile;
+class ProgressReporter;
 
 class CSVFileReader : public DataFileReader
 {
@@ -36,7 +37,8 @@
      * path, with the given format.
      */
     CSVFileReader(QString path, CSVFormat format,
-                  sv_samplerate_t mainModelSampleRate);
+                  sv_samplerate_t mainModelSampleRate,
+                  ProgressReporter *reporter = 0);
 
     /**
      * Construct a CSVFileReader to read from the given
@@ -45,7 +47,8 @@
      * the CSVFileReader.
      */
     CSVFileReader(QIODevice *device, CSVFormat format,
-                  sv_samplerate_t mainModelSampleRate);
+                  sv_samplerate_t mainModelSampleRate,
+                  ProgressReporter *reporter = 0);
 
     virtual ~CSVFileReader();
 
@@ -62,6 +65,10 @@
     QString m_error;
     mutable int m_warnings;
     sv_samplerate_t m_mainModelSampleRate;
+    qint64 m_fileSize;
+    mutable qint64 m_readCount;
+    mutable int m_progress;
+    ProgressReporter *m_reporter;
 
     sv_frame_t convertTimeValue(QString, int lineno, sv_samplerate_t sampleRate,
                                 int windowSize) const;