diff data/fileio/OggVorbisFileReader.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 268c5431936d
line wrap: on
line diff
--- a/data/fileio/OggVorbisFileReader.h	Thu Mar 13 14:06:03 2008 +0000
+++ b/data/fileio/OggVorbisFileReader.h	Fri Mar 14 17:14:21 2008 +0000
@@ -27,20 +27,23 @@
 
 #include <set>
 
-class QProgressDialog;
+class ProgressReporter;
 
 class OggVorbisFileReader : public CodedAudioFileReader
 {
+    Q_OBJECT
+
 public:
     enum DecodeMode {
-        DecodeAtOnce, // decode the file on construction, with progress dialog
+        DecodeAtOnce, // decode the file on construction, with progress 
         DecodeThreaded // decode in a background thread after construction
     };
 
     OggVorbisFileReader(FileSource source,
                         DecodeMode decodeMode,
                         CacheMode cacheMode,
-                        size_t targetRate = 0);
+                        size_t targetRate = 0,
+                        ProgressReporter *reporter = 0);
     virtual ~OggVorbisFileReader();
 
     virtual QString getError() const { return m_error; }
@@ -60,6 +63,9 @@
         return m_decodeThread && m_decodeThread->isRunning();
     }
 
+public slots:
+    void cancelled();
+
 protected:
     FileSource m_source;
     QString m_path;
@@ -69,7 +75,7 @@
 
     OGGZ *m_oggz;
     FishSound *m_fishSound;
-    QProgressDialog *m_progress;
+    ProgressReporter *m_reporter;
     size_t m_fileSize;
     size_t m_bytesRead;
     bool m_commentsRead;