Mercurial > hg > svcore
comparison transform/RealTimeEffectModelTransformer.cpp @ 1096:4d9816ba0ebe simple-fft-model
Rework audio file reader API to prefer using std containers
author | Chris Cannam |
---|---|
date | Mon, 15 Jun 2015 12:19:47 +0100 |
parents | 9f4505ac9072 |
children | e994747fb9dd |
comparison
equal
deleted
inserted
replaced
1095:b66734b5f806 | 1096:4d9816ba0ebe |
---|---|
189 | 189 |
190 sv_frame_t got = 0; | 190 sv_frame_t got = 0; |
191 | 191 |
192 if (channelCount == 1) { | 192 if (channelCount == 1) { |
193 if (inbufs && inbufs[0]) { | 193 if (inbufs && inbufs[0]) { |
194 got = input->getData | 194 auto data = input->getData |
195 (m_input.getChannel(), blockFrame, blockSize, inbufs[0]); | 195 (m_input.getChannel(), blockFrame, blockSize); |
196 got = data.size(); | |
197 for (sv_frame_t i = 0; i < got; ++i) { | |
198 inbufs[0][i] = data[i]; | |
199 } | |
196 while (got < blockSize) { | 200 while (got < blockSize) { |
197 inbufs[0][got++] = 0.0; | 201 inbufs[0][got++] = 0.f; |
198 } | 202 } |
199 for (int ch = 1; ch < (int)m_plugin->getAudioInputCount(); ++ch) { | 203 for (int ch = 1; ch < (int)m_plugin->getAudioInputCount(); ++ch) { |
200 for (sv_frame_t i = 0; i < blockSize; ++i) { | 204 for (sv_frame_t i = 0; i < blockSize; ++i) { |
201 inbufs[ch][i] = inbufs[0][i]; | 205 inbufs[ch][i] = inbufs[0][i]; |
202 } | 206 } |
203 } | 207 } |
204 } | 208 } |
205 } else { | 209 } else { |
206 if (inbufs && inbufs[0]) { | 210 if (inbufs && inbufs[0]) { |
207 got = input->getMultiChannelData(0, channelCount - 1, | 211 auto data = input->getMultiChannelData |
208 blockFrame, blockSize, | 212 (0, channelCount - 1, blockFrame, blockSize); |
209 inbufs); | 213 if (!data.empty()) got = data[0].size(); |
214 for (int ch = 0; ch < channelCount; ++ch) { | |
215 for (sv_frame_t i = 0; i < got; ++i) { | |
216 inbufs[ch][i] = data[ch][i]; | |
217 } | |
218 } | |
210 while (got < blockSize) { | 219 while (got < blockSize) { |
211 for (int ch = 0; ch < channelCount; ++ch) { | 220 for (int ch = 0; ch < channelCount; ++ch) { |
212 inbufs[ch][got] = 0.0; | 221 inbufs[ch][got] = 0.0; |
213 } | 222 } |
214 ++got; | 223 ++got; |