comparison data/fileio/WavFileWriter.cpp @ 1429:48e9f538e6e9

Untabify
author Chris Cannam
date Thu, 01 Mar 2018 18:02:22 +0000
parents 87ae75da6527
children b837ccdd4946
comparison
equal deleted inserted replaced
1428:87ae75da6527 1429:48e9f538e6e9
132 sv_frame_t bs = 2048; 132 sv_frame_t bs = 2048;
133 133
134 for (MultiSelection::SelectionList::iterator i = 134 for (MultiSelection::SelectionList::iterator i =
135 selection->getSelections().begin(); 135 selection->getSelections().begin();
136 i != selection->getSelections().end(); ++i) { 136 i != selection->getSelections().end(); ++i) {
137 137
138 sv_frame_t f0(i->getStartFrame()), f1(i->getEndFrame()); 138 sv_frame_t f0(i->getStartFrame()), f1(i->getEndFrame());
139 139
140 for (sv_frame_t f = f0; f < f1; f += bs) { 140 for (sv_frame_t f = f0; f < f1; f += bs) {
141 141
142 sv_frame_t n = min(bs, f1 - f); 142 sv_frame_t n = min(bs, f1 - f);
143 floatvec_t interleaved(n * m_channels, 0.f); 143 floatvec_t interleaved(n * m_channels, 0.f);
144 144
145 for (int c = 0; c < int(m_channels); ++c) { 145 for (int c = 0; c < int(m_channels); ++c) {
146 auto chanbuf = source->getData(c, f, n); 146 auto chanbuf = source->getData(c, f, n);
161 161
162 if (ownSelection) delete selection; 162 if (ownSelection) delete selection;
163 163
164 return isOK(); 164 return isOK();
165 } 165 }
166 166
167 bool 167 bool
168 WavFileWriter::writeSamples(const float *const *samples, sv_frame_t count) 168 WavFileWriter::writeSamples(const float *const *samples, sv_frame_t count)
169 { 169 {
170 if (!m_file) { 170 if (!m_file) {
171 m_error = QString("Failed to write model to audio file '%1': File not open") 171 m_error = QString("Failed to write model to audio file '%1': File not open")