comparison data/model/WritableWaveFileModel.cpp @ 1517:925d205c39b4 import-audio-data

Handle sample range specification for CSV import
author Chris Cannam
date Sat, 08 Sep 2018 20:43:14 +0100
parents cee1be4fb8c1
children 954d0cf29ca7
comparison
equal deleted inserted replaced
1516:ad46f6e80369 1517:925d205c39b4
36 36
37 //#define DEBUG_WRITABLE_WAVE_FILE_MODEL 1 37 //#define DEBUG_WRITABLE_WAVE_FILE_MODEL 1
38 38
39 WritableWaveFileModel::WritableWaveFileModel(sv_samplerate_t sampleRate, 39 WritableWaveFileModel::WritableWaveFileModel(sv_samplerate_t sampleRate,
40 int channels, 40 int channels,
41 QString path) : 41 QString path,
42 bool normaliseOnRead) :
42 m_model(0), 43 m_model(0),
43 m_writer(0), 44 m_writer(0),
44 m_reader(0), 45 m_reader(0),
45 m_sampleRate(sampleRate), 46 m_sampleRate(sampleRate),
46 m_channels(channels), 47 m_channels(channels),
70 return; 71 return;
71 } 72 }
72 73
73 FileSource source(m_writer->getPath()); 74 FileSource source(m_writer->getPath());
74 75
75 m_reader = new WavFileReader(source, true); 76 m_reader = new WavFileReader(source, true, normaliseOnRead);
76 if (!m_reader->getError().isEmpty()) { 77 if (!m_reader->getError().isEmpty()) {
77 SVCERR << "WritableWaveFileModel: Error in creating wave file reader" << endl; 78 SVCERR << "WritableWaveFileModel: Error in creating wave file reader" << endl;
78 delete m_reader; 79 delete m_reader;
79 m_reader = 0; 80 m_reader = 0;
80 return; 81 return;