changeset 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 5302c548adad
files framework/MainWindowBase.cpp framework/SVFileReader.cpp
diffstat 2 files changed, 10 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/framework/MainWindowBase.cpp	Fri Jun 13 10:37:04 2014 +0100
+++ b/framework/MainWindowBase.cpp	Fri Jun 13 12:56:31 2014 +0100
@@ -1219,7 +1219,9 @@
 
     size_t rate = 0;
 
-    if (Preferences::getInstance()->getResampleOnLoad()) {
+    if (Preferences::getInstance()->getFixedSampleRate() != 0) {
+        rate = Preferences::getInstance()->getFixedSampleRate();
+    } else if (Preferences::getInstance()->getResampleOnLoad()) {
         rate = m_playSource->getSourceSampleRate();
     }
 
@@ -3189,7 +3191,9 @@
 //    SVDEBUG << "MainWindowBase::mainModelChanged(" << model << ")" << endl;
     updateDescriptionLabel();
     if (model) m_viewManager->setMainModelSampleRate(model->getSampleRate());
-    if (model && !m_playTarget && m_audioOutput) createPlayTarget();
+    if (model && !m_playTarget && m_audioOutput) {
+        createPlayTarget();
+    }
 }
 
 void
--- a/framework/SVFileReader.cpp	Fri Jun 13 10:37:04 2014 +0100
+++ b/framework/SVFileReader.cpp	Fri Jun 13 12:56:31 2014 +0100
@@ -475,8 +475,10 @@
 
             size_t rate = 0;
 
-            if (!mainModel &&
-                Preferences::getInstance()->getResampleOnLoad()) {
+            if (Preferences::getInstance()->getFixedSampleRate() != 0) {
+                rate = Preferences::getInstance()->getFixedSampleRate();
+            } else if (!mainModel &&
+                       Preferences::getInstance()->getResampleOnLoad()) {
                 WaveFileModel *mm = m_document->getMainModel();
                 if (mm) rate = mm->getSampleRate();
             }