Mercurial > hg > svcore
comparison data/fileio/CSVFileReader.h @ 1527:710e6250a401 zoom
Merge from default branch
author | Chris Cannam |
---|---|
date | Mon, 17 Sep 2018 13:51:14 +0100 |
parents | fbe8afdfa8a6 |
children | c01cbe41aeb5 |
comparison
equal
deleted
inserted
replaced
1324:d4a28d1479a8 | 1527:710e6250a401 |
---|---|
11 published by the Free Software Foundation; either version 2 of the | 11 published by the Free Software Foundation; either version 2 of the |
12 License, or (at your option) any later version. See the file | 12 License, or (at your option) any later version. See the file |
13 COPYING included with this distribution for more information. | 13 COPYING included with this distribution for more information. |
14 */ | 14 */ |
15 | 15 |
16 #ifndef _CSV_FILE_READER_H_ | 16 #ifndef SV_CSV_FILE_READER_H |
17 #define _CSV_FILE_READER_H_ | 17 #define SV_CSV_FILE_READER_H |
18 | 18 |
19 #include "DataFileReader.h" | 19 #include "DataFileReader.h" |
20 | 20 |
21 #include "CSVFormat.h" | 21 #include "CSVFormat.h" |
22 | 22 |
25 #include <QList> | 25 #include <QList> |
26 #include <QStringList> | 26 #include <QStringList> |
27 #include <QIODevice> | 27 #include <QIODevice> |
28 | 28 |
29 class QFile; | 29 class QFile; |
30 class ProgressReporter; | |
30 | 31 |
31 class CSVFileReader : public DataFileReader | 32 class CSVFileReader : public DataFileReader |
32 { | 33 { |
33 public: | 34 public: |
34 /** | 35 /** |
35 * Construct a CSVFileReader to read the CSV file at the given | 36 * Construct a CSVFileReader to read the CSV file at the given |
36 * path, with the given format. | 37 * path, with the given format. |
37 */ | 38 */ |
38 CSVFileReader(QString path, CSVFormat format, sv_samplerate_t mainModelSampleRate); | 39 CSVFileReader(QString path, CSVFormat format, |
40 sv_samplerate_t mainModelSampleRate, | |
41 ProgressReporter *reporter = 0); | |
39 | 42 |
40 /** | 43 /** |
41 * Construct a CSVFileReader to read from the given | 44 * Construct a CSVFileReader to read from the given |
42 * QIODevice. Caller retains ownership of the QIODevice: the | 45 * QIODevice. Caller retains ownership of the QIODevice: the |
43 * CSVFileReader will not close or delete it and it must outlive | 46 * CSVFileReader will not close or delete it and it must outlive |
44 * the CSVFileReader. | 47 * the CSVFileReader. |
45 */ | 48 */ |
46 CSVFileReader(QIODevice *device, CSVFormat format, sv_samplerate_t mainModelSampleRate); | 49 CSVFileReader(QIODevice *device, CSVFormat format, |
50 sv_samplerate_t mainModelSampleRate, | |
51 ProgressReporter *reporter = 0); | |
47 | 52 |
48 virtual ~CSVFileReader(); | 53 virtual ~CSVFileReader(); |
49 | 54 |
50 virtual bool isOK() const; | 55 virtual bool isOK() const; |
51 virtual QString getError() const; | 56 virtual QString getError() const; |
58 bool m_ownDevice; | 63 bool m_ownDevice; |
59 QString m_filename; | 64 QString m_filename; |
60 QString m_error; | 65 QString m_error; |
61 mutable int m_warnings; | 66 mutable int m_warnings; |
62 sv_samplerate_t m_mainModelSampleRate; | 67 sv_samplerate_t m_mainModelSampleRate; |
68 qint64 m_fileSize; | |
69 mutable qint64 m_readCount; | |
70 mutable int m_progress; | |
71 ProgressReporter *m_reporter; | |
63 | 72 |
64 sv_frame_t convertTimeValue(QString, int lineno, sv_samplerate_t sampleRate, | 73 sv_frame_t convertTimeValue(QString, int lineno, sv_samplerate_t sampleRate, |
65 int windowSize) const; | 74 int windowSize) const; |
75 | |
76 QString getConvertedAudioFilePath() const; | |
66 }; | 77 }; |
67 | 78 |
68 | 79 |
69 #endif | 80 #endif |
70 | 81 |