Mercurial > hg > svcore
diff data/fileio/MP3FileReader.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 | a4b8ad0f1a8f |
line wrap: on
line diff
--- a/data/fileio/MP3FileReader.h Thu Mar 13 14:06:03 2008 +0000 +++ b/data/fileio/MP3FileReader.h Fri Mar 14 17:14:21 2008 +0000 @@ -25,20 +25,23 @@ #include <set> -class QProgressDialog; +class ProgressReporter; class MP3FileReader : 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 }; MP3FileReader(FileSource source, DecodeMode decodeMode, CacheMode cacheMode, - size_t targetRate = 0); + size_t targetRate = 0, + ProgressReporter *reporter = 0); virtual ~MP3FileReader(); virtual QString getError() const { return m_error; } @@ -58,6 +61,9 @@ return m_decodeThread && m_decodeThread->isRunning(); } +public slots: + void cancelled(); + protected: FileSource m_source; QString m_path; @@ -74,7 +80,7 @@ float **m_samplebuffer; size_t m_samplebuffersize; - QProgressDialog *m_progress; + ProgressReporter *m_reporter; bool m_cancelled; struct DecoderData