diff data/fileio/ResamplingWavFileReader.cpp @ 327:1d656dcda8ef

* some tweaks to improve usability of these classes in a console application
author Chris Cannam
date Fri, 02 Nov 2007 16:50:31 +0000
parents c324d410b096
children 183ee2a55fc7
line wrap: on
line diff
--- a/data/fileio/ResamplingWavFileReader.cpp	Thu Nov 01 16:02:01 2007 +0000
+++ b/data/fileio/ResamplingWavFileReader.cpp	Fri Nov 02 16:50:31 2007 +0000
@@ -57,10 +57,12 @@
 
     if (resampleMode == ResampleAtOnce) {
 
-	m_progress = new QProgressDialog
-	    (QObject::tr("Resampling %1...").arg(QFileInfo(m_path).fileName()),
-	     QObject::tr("Stop"), 0, 100);
-	m_progress->hide();
+        if (dynamic_cast<QApplication *>(QCoreApplication::instance())) {
+            m_progress = new QProgressDialog
+                (QObject::tr("Resampling %1...").arg(QFileInfo(m_path).fileName()),
+                 QObject::tr("Stop"), 0, 100);
+            m_progress->hide();
+        }
 
         size_t blockSize = 16384;
         size_t total = m_original->getFrameCount();