# HG changeset patch # User Chris Cannam # Date 1211278455 0 # Node ID 9554c19c42fd87405082d50438137d609fc83a8d # Parent 5dcbda490794318b6075dfdda9ec160ccdb7cb68 * Fix #1903059 "resample on import" not applied when reloading session diff -r 5dcbda490794 -r 9554c19c42fd framework/SVFileReader.cpp --- a/framework/SVFileReader.cpp Mon May 19 17:23:11 2008 +0000 +++ b/framework/SVFileReader.cpp Tue May 20 10:14:15 2008 +0000 @@ -19,6 +19,7 @@ #include "view/View.h" #include "base/PlayParameters.h" #include "base/PlayParameterRepository.h" +#include "base/Preferences.h" #include "data/fileio/AudioFileReaderFactory.h" #include "data/fileio/FileSource.h" @@ -456,7 +457,16 @@ } else { file.waitForData(); - model = new WaveFileModel(file); + + size_t rate = 0; + + if (!mainModel && + Preferences::getInstance()->getResampleOnLoad()) { + WaveFileModel *mm = m_document->getMainModel(); + if (mm) rate = mm->getSampleRate(); + } + + model = new WaveFileModel(file, rate); if (!model->isOK()) { delete model; model = 0;