comparison framework/MainWindowBase.cpp @ 552:8c11ca1ebc39 bqresample

Some fixes to sample rate management
author Chris Cannam
date Fri, 09 Dec 2016 13:46:34 +0000
parents b9d8c7a690d6
children 21e3aab6e3e7
comparison
equal deleted inserted replaced
551:b9d8c7a690d6 552:8c11ca1ebc39
1400 sv_samplerate_t rate = 0; 1400 sv_samplerate_t rate = 0;
1401 1401
1402 if (Preferences::getInstance()->getFixedSampleRate() != 0) { 1402 if (Preferences::getInstance()->getFixedSampleRate() != 0) {
1403 rate = Preferences::getInstance()->getFixedSampleRate(); 1403 rate = Preferences::getInstance()->getFixedSampleRate();
1404 } else if (Preferences::getInstance()->getResampleOnLoad()) { 1404 } else if (Preferences::getInstance()->getResampleOnLoad()) {
1405 rate = m_playSource->getSourceSampleRate(); 1405 if (getMainModel()) {
1406 rate = getMainModel()->getSampleRate();
1407 }
1406 } 1408 }
1407 1409
1408 ReadOnlyWaveFileModel *newModel = new ReadOnlyWaveFileModel(source, rate); 1410 ReadOnlyWaveFileModel *newModel = new ReadOnlyWaveFileModel(source, rate);
1409 1411
1410 if (!newModel->isOK()) { 1412 if (!newModel->isOK()) {
2159 connect(&dialog, SIGNAL(showing()), this, SIGNAL(hideSplash())); 2161 connect(&dialog, SIGNAL(showing()), this, SIGNAL(hideSplash()));
2160 2162
2161 if (getMainModel()) { 2163 if (getMainModel()) {
2162 rate = getMainModel()->getSampleRate(); 2164 rate = getMainModel()->getSampleRate();
2163 } else if (Preferences::getInstance()->getResampleOnLoad()) { 2165 } else if (Preferences::getInstance()->getResampleOnLoad()) {
2164 rate = m_playSource->getSourceSampleRate(); 2166 if (getMainModel()) {
2167 rate = getMainModel()->getSampleRate();
2168 }
2165 } 2169 }
2166 2170
2167 RDFImporter importer 2171 RDFImporter importer
2168 (QUrl::fromLocalFile(source.getLocalFilename()).toString(), rate); 2172 (QUrl::fromLocalFile(source.getLocalFilename()).toString(), rate);
2169 2173