Mercurial > hg > svcore
comparison data/fileio/QuickTimeFileReader.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 | f3cda3280398 59e7fe1b1003 |
comparison
equal
deleted
inserted
replaced
391:5858cc462d0a | 392:183ee2a55fc7 |
---|---|
25 | 25 |
26 #include "base/Thread.h" | 26 #include "base/Thread.h" |
27 | 27 |
28 #include <set> | 28 #include <set> |
29 | 29 |
30 class QProgressDialog; | 30 class ProgressReporter; |
31 | 31 |
32 class QuickTimeFileReader : public CodedAudioFileReader | 32 class QuickTimeFileReader : public CodedAudioFileReader |
33 { | 33 { |
34 Q_OBJECT | |
35 | |
34 public: | 36 public: |
35 enum DecodeMode { | 37 enum DecodeMode { |
36 DecodeAtOnce, // decode the file on construction, with progress dialog | 38 DecodeAtOnce, // decode the file on construction, with progress |
37 DecodeThreaded // decode in a background thread after construction | 39 DecodeThreaded // decode in a background thread after construction |
38 }; | 40 }; |
39 | 41 |
40 QuickTimeFileReader(FileSource source, | 42 QuickTimeFileReader(FileSource source, |
41 DecodeMode decodeMode, | 43 DecodeMode decodeMode, |
42 CacheMode cacheMode, | 44 CacheMode cacheMode, |
43 size_t targetRate = 0); | 45 size_t targetRate = 0, |
46 ProgressReporter *reporter = 0); | |
44 virtual ~QuickTimeFileReader(); | 47 virtual ~QuickTimeFileReader(); |
45 | 48 |
46 virtual QString getError() const { return m_error; } | 49 virtual QString getError() const { return m_error; } |
47 virtual QString getLocation() const { return m_source.getLocation(); } | 50 virtual QString getLocation() const { return m_source.getLocation(); } |
48 virtual QString getTitle() const { return m_title; } | 51 virtual QString getTitle() const { return m_title; } |
56 | 59 |
57 virtual bool isUpdating() const { | 60 virtual bool isUpdating() const { |
58 return m_decodeThread && m_decodeThread->isRunning(); | 61 return m_decodeThread && m_decodeThread->isRunning(); |
59 } | 62 } |
60 | 63 |
64 public slots: | |
65 void cancelled(); | |
66 | |
61 protected: | 67 protected: |
62 FileSource m_source; | 68 FileSource m_source; |
63 QString m_path; | 69 QString m_path; |
64 QString m_error; | 70 QString m_error; |
65 QString m_title; | 71 QString m_title; |
66 | 72 |
67 class D; | 73 class D; |
68 D *m_d; | 74 D *m_d; |
69 | 75 |
70 QProgressDialog *m_progress; | 76 ProgressReporter *m_reporter; |
71 bool m_cancelled; | 77 bool m_cancelled; |
72 int m_completion; | 78 int m_completion; |
73 | 79 |
74 class DecodeThread : public Thread | 80 class DecodeThread : public Thread |
75 { | 81 { |