comparison data/fileio/WavFileReader.cpp @ 176:570794f6f6a7

* Some fixes to updating of writable wave file models
author Chris Cannam
date Tue, 03 Oct 2006 15:01:50 +0000
parents b0f4555b625e
children 89b05b679dc3
comparison
equal deleted inserted replaced
175:b0f4555b625e 176:570794f6f6a7
17 17
18 #include <iostream> 18 #include <iostream>
19 19
20 #include <QMutexLocker> 20 #include <QMutexLocker>
21 21
22 WavFileReader::WavFileReader(QString path) : 22 WavFileReader::WavFileReader(QString path, bool fileUpdating) :
23 m_file(0), 23 m_file(0),
24 m_path(path), 24 m_path(path),
25 m_buffer(0), 25 m_buffer(0),
26 m_bufsiz(0), 26 m_bufsiz(0),
27 m_lastStart(0), 27 m_lastStart(0),
28 m_lastCount(0) 28 m_lastCount(0),
29 m_updating(fileUpdating)
29 { 30 {
30 m_frameCount = 0; 31 m_frameCount = 0;
31 m_channelCount = 0; 32 m_channelCount = 0;
32 m_sampleRate = 0; 33 m_sampleRate = 0;
33 34
78 } 79 }
79 } 80 }
80 81
81 std::cerr << "WavFileReader::updateFrameCount: now " << m_fileInfo.frames << std::endl; 82 std::cerr << "WavFileReader::updateFrameCount: now " << m_fileInfo.frames << std::endl;
82 83
83 if (m_fileInfo.frames != prevCount) emit frameCountChanged(); 84 m_frameCount = m_fileInfo.frames;
85
86 if (m_frameCount != prevCount) emit frameCountChanged();
87 }
88
89 void
90 WavFileReader::updateDone()
91 {
92 updateFrameCount();
93 m_updating = false;
84 } 94 }
85 95
86 void 96 void
87 WavFileReader::getInterleavedFrames(size_t start, size_t count, 97 WavFileReader::getInterleavedFrames(size_t start, size_t count,
88 SampleBlock &results) const 98 SampleBlock &results) const