Mercurial > hg > svapp
comparison framework/MainWindowBase.cpp @ 360:88bf6cc73275 tonioni
For Tony, resample all audio to 44100 on load
author | Chris Cannam |
---|---|
date | Fri, 13 Jun 2014 12:56:31 +0100 |
parents | 1f2a4ad79967 |
children | f1cab64363d7 |
comparison
equal
deleted
inserted
replaced
359:1f2a4ad79967 | 360:88bf6cc73275 |
---|---|
1217 | 1217 |
1218 m_openingAudioFile = true; | 1218 m_openingAudioFile = true; |
1219 | 1219 |
1220 size_t rate = 0; | 1220 size_t rate = 0; |
1221 | 1221 |
1222 if (Preferences::getInstance()->getResampleOnLoad()) { | 1222 if (Preferences::getInstance()->getFixedSampleRate() != 0) { |
1223 rate = Preferences::getInstance()->getFixedSampleRate(); | |
1224 } else if (Preferences::getInstance()->getResampleOnLoad()) { | |
1223 rate = m_playSource->getSourceSampleRate(); | 1225 rate = m_playSource->getSourceSampleRate(); |
1224 } | 1226 } |
1225 | 1227 |
1226 WaveFileModel *newModel = new WaveFileModel(source, rate); | 1228 WaveFileModel *newModel = new WaveFileModel(source, rate); |
1227 | 1229 |
3187 MainWindowBase::mainModelChanged(WaveFileModel *model) | 3189 MainWindowBase::mainModelChanged(WaveFileModel *model) |
3188 { | 3190 { |
3189 // SVDEBUG << "MainWindowBase::mainModelChanged(" << model << ")" << endl; | 3191 // SVDEBUG << "MainWindowBase::mainModelChanged(" << model << ")" << endl; |
3190 updateDescriptionLabel(); | 3192 updateDescriptionLabel(); |
3191 if (model) m_viewManager->setMainModelSampleRate(model->getSampleRate()); | 3193 if (model) m_viewManager->setMainModelSampleRate(model->getSampleRate()); |
3192 if (model && !m_playTarget && m_audioOutput) createPlayTarget(); | 3194 if (model && !m_playTarget && m_audioOutput) { |
3195 createPlayTarget(); | |
3196 } | |
3193 } | 3197 } |
3194 | 3198 |
3195 void | 3199 void |
3196 MainWindowBase::modelAboutToBeDeleted(Model *model) | 3200 MainWindowBase::modelAboutToBeDeleted(Model *model) |
3197 { | 3201 { |