Mercurial > hg > svcore
comparison data/model/WritableWaveFileModel.cpp @ 1582:70e172e6cc59 fix-static-analysis
Use nullptr throughout
author | Chris Cannam |
---|---|
date | Mon, 26 Nov 2018 14:33:41 +0000 |
parents | 954d0cf29ca7 |
children | 82d03c9661f9 |
comparison
equal
deleted
inserted
replaced
1581:ad5f892c0c4d | 1582:70e172e6cc59 |
---|---|
38 | 38 |
39 WritableWaveFileModel::WritableWaveFileModel(QString path, | 39 WritableWaveFileModel::WritableWaveFileModel(QString path, |
40 sv_samplerate_t sampleRate, | 40 sv_samplerate_t sampleRate, |
41 int channels, | 41 int channels, |
42 Normalisation norm) : | 42 Normalisation norm) : |
43 m_model(0), | 43 m_model(nullptr), |
44 m_temporaryWriter(0), | 44 m_temporaryWriter(nullptr), |
45 m_targetWriter(0), | 45 m_targetWriter(nullptr), |
46 m_reader(0), | 46 m_reader(nullptr), |
47 m_normalisation(norm), | 47 m_normalisation(norm), |
48 m_sampleRate(sampleRate), | 48 m_sampleRate(sampleRate), |
49 m_channels(channels), | 49 m_channels(channels), |
50 m_frameCount(0), | 50 m_frameCount(0), |
51 m_startFrame(0), | 51 m_startFrame(0), |
55 } | 55 } |
56 | 56 |
57 WritableWaveFileModel::WritableWaveFileModel(sv_samplerate_t sampleRate, | 57 WritableWaveFileModel::WritableWaveFileModel(sv_samplerate_t sampleRate, |
58 int channels, | 58 int channels, |
59 Normalisation norm) : | 59 Normalisation norm) : |
60 m_model(0), | 60 m_model(nullptr), |
61 m_temporaryWriter(0), | 61 m_temporaryWriter(nullptr), |
62 m_targetWriter(0), | 62 m_targetWriter(nullptr), |
63 m_reader(0), | 63 m_reader(nullptr), |
64 m_normalisation(norm), | 64 m_normalisation(norm), |
65 m_sampleRate(sampleRate), | 65 m_sampleRate(sampleRate), |
66 m_channels(channels), | 66 m_channels(channels), |
67 m_frameCount(0), | 67 m_frameCount(0), |
68 m_startFrame(0), | 68 m_startFrame(0), |
71 init(); | 71 init(); |
72 } | 72 } |
73 | 73 |
74 WritableWaveFileModel::WritableWaveFileModel(sv_samplerate_t sampleRate, | 74 WritableWaveFileModel::WritableWaveFileModel(sv_samplerate_t sampleRate, |
75 int channels) : | 75 int channels) : |
76 m_model(0), | 76 m_model(nullptr), |
77 m_temporaryWriter(0), | 77 m_temporaryWriter(nullptr), |
78 m_targetWriter(0), | 78 m_targetWriter(nullptr), |
79 m_reader(0), | 79 m_reader(nullptr), |
80 m_normalisation(Normalisation::None), | 80 m_normalisation(Normalisation::None), |
81 m_sampleRate(sampleRate), | 81 m_sampleRate(sampleRate), |
82 m_channels(channels), | 82 m_channels(channels), |
83 m_frameCount(0), | 83 m_frameCount(0), |
84 m_startFrame(0), | 84 m_startFrame(0), |
148 | 148 |
149 m_model = new ReadOnlyWaveFileModel(source, m_reader); | 149 m_model = new ReadOnlyWaveFileModel(source, m_reader); |
150 if (!m_model->isOK()) { | 150 if (!m_model->isOK()) { |
151 SVCERR << "WritableWaveFileModel: Error in creating wave file model" << endl; | 151 SVCERR << "WritableWaveFileModel: Error in creating wave file model" << endl; |
152 delete m_model; | 152 delete m_model; |
153 m_model = 0; | 153 m_model = nullptr; |
154 return; | 154 return; |
155 } | 155 } |
156 m_model->setStartFrame(m_startFrame); | 156 m_model->setStartFrame(m_startFrame); |
157 | 157 |
158 connect(m_model, SIGNAL(modelChanged()), this, SIGNAL(modelChanged())); | 158 connect(m_model, SIGNAL(modelChanged()), this, SIGNAL(modelChanged())); |
289 } | 289 } |
290 | 290 |
291 m_targetWriter->close(); | 291 m_targetWriter->close(); |
292 | 292 |
293 delete m_temporaryWriter; | 293 delete m_temporaryWriter; |
294 m_temporaryWriter = 0; | 294 m_temporaryWriter = nullptr; |
295 QFile::remove(m_temporaryPath); | 295 QFile::remove(m_temporaryPath); |
296 } | 296 } |
297 | 297 |
298 sv_frame_t | 298 sv_frame_t |
299 WritableWaveFileModel::getFrameCount() const | 299 WritableWaveFileModel::getFrameCount() const |