comparison data/fileio/AudioFileReader.cpp @ 1038:cc27f35aa75c cxx11

Introducing the signed 64-bit frame index type, and fixing build failures from inclusion of -Wconversion with -Werror. Not finished yet.
author Chris Cannam
date Tue, 03 Mar 2015 15:18:24 +0000
parents 59e7fe1b1003
children 843f67be0ed9
comparison
equal deleted inserted replaced
1037:bf0e5944289b 1038:cc27f35aa75c
14 */ 14 */
15 15
16 #include "AudioFileReader.h" 16 #include "AudioFileReader.h"
17 17
18 void 18 void
19 AudioFileReader::getDeInterleavedFrames(int start, int count, 19 AudioFileReader::getDeInterleavedFrames(sv_frame_t start, sv_frame_t count,
20 std::vector<SampleBlock> &frames) const 20 std::vector<SampleBlock> &frames) const
21 { 21 {
22 SampleBlock interleaved; 22 SampleBlock interleaved;
23 getInterleavedFrames(start, count, interleaved); 23 getInterleavedFrames(start, count, interleaved);
24 24
25 int channels = getChannelCount(); 25 int channels = getChannelCount();
26 int rc = interleaved.size() / channels; 26 sv_frame_t rc = interleaved.size() / channels;
27 27
28 frames.clear(); 28 frames.clear();
29 29
30 for (int c = 0; c < channels; ++c) { 30 for (int c = 0; c < channels; ++c) {
31 frames.push_back(SampleBlock()); 31 frames.push_back(SampleBlock());
32 } 32 }
33 33
34 for (int i = 0; i < rc; ++i) { 34 for (sv_frame_t i = 0; i < rc; ++i) {
35 for (int c = 0; c < channels; ++c) { 35 for (int c = 0; c < channels; ++c) {
36 frames[c].push_back(interleaved[i * channels + c]); 36 frames[c].push_back(interleaved[i * channels + c]);
37 } 37 }
38 } 38 }
39 } 39 }