comparison main/main.cpp @ 214:37847fc0b381 spectrogram-cache-rejig

* Save and restore FFTW plans
author Chris Cannam
date Tue, 13 Nov 2007 13:51:07 +0000
parents 9e396b8d7dfc
children a3011df6ddad ddbde90773b0
comparison
equal deleted inserted replaced
213:9e396b8d7dfc 214:37847fc0b381
33 #include <QSessionManager> 33 #include <QSessionManager>
34 #include <QDir> 34 #include <QDir>
35 35
36 #include <iostream> 36 #include <iostream>
37 #include <signal.h> 37 #include <signal.h>
38
39 #ifdef HAVE_FFTW3F
40 #include <fftw3.h>
41 #endif
38 42
39 /*! \mainpage Sonic Visualiser 43 /*! \mainpage Sonic Visualiser
40 44
41 \section interesting Summary of interesting classes 45 \section interesting Summary of interesting classes
42 46
336 (&gui, QMessageBox::tr("Failed to open file"), 340 (&gui, QMessageBox::tr("Failed to open file"),
337 QMessageBox::tr("File or URL \"%1\" could not be opened").arg(path)); 341 QMessageBox::tr("File or URL \"%1\" could not be opened").arg(path));
338 } 342 }
339 } 343 }
340 344
345 #ifdef HAVE_FFTW3F
346 settings.beginGroup("FFTWisdom");
347 QString wisdom = settings.value("wisdom").toString();
348 if (wisdom != "") {
349 fftwf_import_wisdom_from_string(wisdom.toLocal8Bit().data());
350 }
351 settings.endGroup();
352 #endif
341 353
342 354
343 /* 355 /*
344 TipDialog tipDialog; 356 TipDialog tipDialog;
345 if (tipDialog.isOK()) { 357 if (tipDialog.isOK()) {
351 363
352 cleanupMutex.lock(); 364 cleanupMutex.lock();
353 TempDirectory::getInstance()->cleanup(); 365 TempDirectory::getInstance()->cleanup();
354 application.releaseMainWindow(); 366 application.releaseMainWindow();
355 367
368 #ifdef HAVE_FFTW3F
369 char *cwisdom = fftwf_export_wisdom_to_string();
370 if (cwisdom) {
371 settings.beginGroup("FFTWisdom");
372 settings.setValue("wisdom", cwisdom);
373 settings.endGroup();
374 fftwf_free(cwisdom);
375 }
376 #endif
377
356 return rv; 378 return rv;
357 } 379 }