Mercurial > hg > svcore
diff data/fileio/DataFileReaderFactory.cpp @ 1527:710e6250a401 zoom
Merge from default branch
author | Chris Cannam |
---|---|
date | Mon, 17 Sep 2018 13:51:14 +0100 |
parents | 1dc64d3d323c |
children | 70e172e6cc59 |
line wrap: on
line diff
--- a/data/fileio/DataFileReaderFactory.cpp Mon Dec 12 15:18:52 2016 +0000 +++ b/data/fileio/DataFileReaderFactory.cpp Mon Sep 17 13:51:14 2018 +0100 @@ -32,21 +32,28 @@ bool csv, MIDIFileImportPreferenceAcquirer *acquirer, CSVFormat format, - sv_samplerate_t mainModelSampleRate) + sv_samplerate_t mainModelSampleRate, + ProgressReporter *reporter) { QString err; DataFileReader *reader = 0; if (!csv) { - reader = new MIDIFileReader(path, acquirer, mainModelSampleRate); + reader = new MIDIFileReader(path, + acquirer, + mainModelSampleRate, + reporter); if (reader->isOK()) return reader; if (reader->getError() != "") err = reader->getError(); delete reader; } if (csv) { - reader = new CSVFileReader(path, format, mainModelSampleRate); + reader = new CSVFileReader(path, + format, + mainModelSampleRate, + reporter); if (reader->isOK()) return reader; if (reader->getError() != "") err = reader->getError(); delete reader; @@ -58,14 +65,15 @@ DataFileReader * DataFileReaderFactory::createReader(QString path, MIDIFileImportPreferenceAcquirer *acquirer, - sv_samplerate_t mainModelSampleRate) + sv_samplerate_t mainModelSampleRate, + ProgressReporter *reporter) { DataFileReader *reader = createReader - (path, false, acquirer, CSVFormat(), mainModelSampleRate); + (path, false, acquirer, CSVFormat(), mainModelSampleRate, reporter); if (reader) return reader; reader = createReader - (path, true, acquirer, CSVFormat(path), mainModelSampleRate); + (path, true, acquirer, CSVFormat(path), mainModelSampleRate, reporter); if (reader) return reader; return 0; @@ -74,11 +82,13 @@ Model * DataFileReaderFactory::load(QString path, MIDIFileImportPreferenceAcquirer *acquirer, - sv_samplerate_t mainModelSampleRate) + sv_samplerate_t mainModelSampleRate, + ProgressReporter *reporter) { DataFileReader *reader = createReader(path, acquirer, - mainModelSampleRate); + mainModelSampleRate, + reporter); if (!reader) return NULL; try { @@ -94,12 +104,14 @@ Model * DataFileReaderFactory::loadNonCSV(QString path, MIDIFileImportPreferenceAcquirer *acquirer, - sv_samplerate_t mainModelSampleRate) + sv_samplerate_t mainModelSampleRate, + ProgressReporter *reporter) { DataFileReader *reader = createReader(path, false, acquirer, CSVFormat(), - mainModelSampleRate); + mainModelSampleRate, + reporter); if (!reader) return NULL; try { @@ -114,10 +126,12 @@ Model * DataFileReaderFactory::loadCSV(QString path, CSVFormat format, - sv_samplerate_t mainModelSampleRate) + sv_samplerate_t mainModelSampleRate, + ProgressReporter *reporter) { DataFileReader *reader = createReader(path, true, 0, format, - mainModelSampleRate); + mainModelSampleRate, + reporter); if (!reader) return NULL; try {