comparison data/model/WaveFileModel.cpp @ 921:2896b8872834 tonioni

Add normalise preference and take it into account in WaveFileModel
author Chris Cannam
date Fri, 13 Jun 2014 16:12:00 +0100
parents e802e550a1f2
children d03b3d956358
comparison
equal deleted inserted replaced
920:f3cda3280398 921:2896b8872834
18 #include "fileio/AudioFileReader.h" 18 #include "fileio/AudioFileReader.h"
19 #include "fileio/AudioFileReaderFactory.h" 19 #include "fileio/AudioFileReaderFactory.h"
20 20
21 #include "system/System.h" 21 #include "system/System.h"
22 22
23 #include "base/Preferences.h"
24
23 #include <QFileInfo> 25 #include <QFileInfo>
24 #include <QTextStream> 26 #include <QTextStream>
25 27
26 #include <iostream> 28 #include <iostream>
27 #include <unistd.h> 29 #include <unistd.h>
47 m_lastDirectReadStart(0), 49 m_lastDirectReadStart(0),
48 m_lastDirectReadCount(0) 50 m_lastDirectReadCount(0)
49 { 51 {
50 m_source.waitForData(); 52 m_source.waitForData();
51 if (m_source.isOK()) { 53 if (m_source.isOK()) {
54 bool normalise = Preferences::getInstance()->getNormaliseAudio();
52 m_reader = AudioFileReaderFactory::createThreadingReader 55 m_reader = AudioFileReaderFactory::createThreadingReader
53 (m_source, targetRate); 56 (m_source, targetRate, normalise);
54 if (m_reader) { 57 if (m_reader) {
55 SVDEBUG << "WaveFileModel::WaveFileModel: reader rate: " 58 SVDEBUG << "WaveFileModel::WaveFileModel: reader rate: "
56 << m_reader->getSampleRate() << endl; 59 << m_reader->getSampleRate() << endl;
57 } 60 }
58 } 61 }