changeset 215:79ea249689d9

* Merge fix from spectrogram-cache-rejig branch: save/restore FFTW wisdom
author Chris Cannam
date Mon, 19 Nov 2007 13:02:37 +0000
parents 9e396b8d7dfc
children 1fa0d271fd2c
files main/main.cpp
diffstat 1 files changed, 22 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/main/main.cpp	Fri Nov 09 17:46:58 2007 +0000
+++ b/main/main.cpp	Mon Nov 19 13:02:37 2007 +0000
@@ -36,6 +36,10 @@
 #include <iostream>
 #include <signal.h>
 
+#ifdef HAVE_FFTW3F
+#include <fftw3.h>
+#endif
+
 /*! \mainpage Sonic Visualiser
 
 \section interesting Summary of interesting classes
@@ -338,6 +342,14 @@
         }
     }
     
+#ifdef HAVE_FFTW3F
+    settings.beginGroup("FFTWisdom");
+    QString wisdom = settings.value("wisdom").toString();
+    if (wisdom != "") {
+        fftwf_import_wisdom_from_string(wisdom.toLocal8Bit().data());
+    }
+    settings.endGroup();
+#endif
 
 
 /*
@@ -353,5 +365,15 @@
     TempDirectory::getInstance()->cleanup();
     application.releaseMainWindow();
 
+#ifdef HAVE_FFTW3F
+    char *cwisdom = fftwf_export_wisdom_to_string();
+    if (cwisdom) {
+        settings.beginGroup("FFTWisdom");
+        settings.setValue("wisdom", cwisdom);
+        settings.endGroup();
+        fftwf_free(cwisdom);
+    }
+#endif
+
     return rv;
 }