comparison data/fileio/DecodingWavFileReader.cpp @ 935:f960d67ce842 tonioni

Merge from branch warnfix_no_size_t
author Chris Cannam
date Wed, 18 Jun 2014 13:42:01 +0100
parents d03b3d956358
children cc27f35aa75c
comparison
equal deleted inserted replaced
925:3efc20c59a94 935:f960d67ce842
22 #include <QFileInfo> 22 #include <QFileInfo>
23 23
24 DecodingWavFileReader::DecodingWavFileReader(FileSource source, 24 DecodingWavFileReader::DecodingWavFileReader(FileSource source,
25 ResampleMode resampleMode, 25 ResampleMode resampleMode,
26 CacheMode mode, 26 CacheMode mode,
27 size_t targetRate, 27 int targetRate,
28 bool normalised, 28 bool normalised,
29 ProgressReporter *reporter) : 29 ProgressReporter *reporter) :
30 CodedAudioFileReader(mode, targetRate, normalised), 30 CodedAudioFileReader(mode, targetRate, normalised),
31 m_source(source), 31 m_source(source),
32 m_path(source.getLocalFilename()), 32 m_path(source.getLocalFilename()),
62 connect(m_reporter, SIGNAL(cancelled()), this, SLOT(cancelled())); 62 connect(m_reporter, SIGNAL(cancelled()), this, SLOT(cancelled()));
63 m_reporter->setMessage 63 m_reporter->setMessage
64 (tr("Decoding %1...").arg(QFileInfo(m_path).fileName())); 64 (tr("Decoding %1...").arg(QFileInfo(m_path).fileName()));
65 } 65 }
66 66
67 size_t blockSize = 16384; 67 int blockSize = 16384;
68 size_t total = m_original->getFrameCount(); 68 int total = m_original->getFrameCount();
69 69
70 SampleBlock block; 70 SampleBlock block;
71 71
72 for (size_t i = 0; i < total; i += blockSize) { 72 for (int i = 0; i < total; i += blockSize) {
73 73
74 size_t count = blockSize; 74 int count = blockSize;
75 if (i + count > total) count = total - i; 75 if (i + count > total) count = total - i;
76 76
77 m_original->getInterleavedFrames(i, count, block); 77 m_original->getInterleavedFrames(i, count, block);
78 addBlock(block); 78 addBlock(block);
79 79
119 { 119 {
120 if (m_reader->m_cacheMode == CacheInTemporaryFile) { 120 if (m_reader->m_cacheMode == CacheInTemporaryFile) {
121 m_reader->startSerialised("DecodingWavFileReader::Decode"); 121 m_reader->startSerialised("DecodingWavFileReader::Decode");
122 } 122 }
123 123
124 size_t blockSize = 16384; 124 int blockSize = 16384;
125 size_t total = m_reader->m_original->getFrameCount(); 125 int total = m_reader->m_original->getFrameCount();
126 126
127 SampleBlock block; 127 SampleBlock block;
128 128
129 for (size_t i = 0; i < total; i += blockSize) { 129 for (int i = 0; i < total; i += blockSize) {
130 130
131 size_t count = blockSize; 131 int count = blockSize;
132 if (i + count > total) count = total - i; 132 if (i + count > total) count = total - i;
133 133
134 m_reader->m_original->getInterleavedFrames(i, count, block); 134 m_reader->m_original->getInterleavedFrames(i, count, block);
135 m_reader->addBlock(block); 135 m_reader->addBlock(block);
136 136