diff data/fileio/ResamplingWavFileReader.h @ 392:183ee2a55fc7

* More work to abstract out interactive components used in the data library, so that it does not need to depend on QtGui.
author Chris Cannam
date Fri, 14 Mar 2008 17:14:21 +0000
parents 700cd3350391
children
line wrap: on
line diff
--- a/data/fileio/ResamplingWavFileReader.h	Thu Mar 13 14:06:03 2008 +0000
+++ b/data/fileio/ResamplingWavFileReader.h	Fri Mar 14 17:14:21 2008 +0000
@@ -23,10 +23,11 @@
 #include <set>
 
 class WavFileReader;
-class QProgressDialog;
+class ProgressReporter;
 
 class ResamplingWavFileReader : public CodedAudioFileReader
 {
+    Q_OBJECT
 public:
     enum ResampleMode {
         ResampleAtOnce, // resample the file on construction, with progress dialog
@@ -36,7 +37,8 @@
     ResamplingWavFileReader(FileSource source,
                             ResampleMode resampleMode,
                             CacheMode cacheMode,
-                            size_t targetRate = 0);
+                            size_t targetRate = 0,
+                            ProgressReporter *reporter = 0);
     virtual ~ResamplingWavFileReader();
 
     virtual QString getError() const { return m_error; }
@@ -52,6 +54,9 @@
         return m_decodeThread && m_decodeThread->isRunning();
     }
 
+public slots:
+    void cancelled();
+
 protected:
     FileSource m_source;
     QString m_path;
@@ -61,7 +66,7 @@
     int m_completion;
 
     WavFileReader *m_original;
-    QProgressDialog *m_progress;
+    ProgressReporter *m_reporter;
 
     void addBlock(const SampleBlock &frames);