00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef _QUICKTIME_FILE_READER_H_
00020 #define _QUICKTIME_FILE_READER_H_
00021
00022 #ifdef HAVE_QUICKTIME
00023
00024 #include "CodedAudioFileReader.h"
00025
00026 #include "base/Thread.h"
00027
00028 #include <set>
00029
00030 class QProgressDialog;
00031
00032 class QuickTimeFileReader : public CodedAudioFileReader
00033 {
00034 public:
00035 enum DecodeMode {
00036 DecodeAtOnce,
00037 DecodeThreaded
00038 };
00039
00040 QuickTimeFileReader(FileSource source,
00041 DecodeMode decodeMode,
00042 CacheMode cacheMode,
00043 size_t targetRate = 0);
00044 virtual ~QuickTimeFileReader();
00045
00046 virtual QString getError() const { return m_error; }
00047 virtual QString getLocation() const { return m_source.getLocation(); }
00048 virtual QString getTitle() const { return m_title; }
00049
00050 static void getSupportedExtensions(std::set<QString> &extensions);
00051 static bool supportsExtension(QString ext);
00052 static bool supportsContentType(QString type);
00053 static bool supports(FileSource &source);
00054
00055 virtual int getDecodeCompletion() const { return m_completion; }
00056
00057 virtual bool isUpdating() const {
00058 return m_decodeThread && m_decodeThread->isRunning();
00059 }
00060
00061 protected:
00062 FileSource m_source;
00063 QString m_path;
00064 QString m_error;
00065 QString m_title;
00066
00067 class D;
00068 D *m_d;
00069
00070 QProgressDialog *m_progress;
00071 bool m_cancelled;
00072 int m_completion;
00073
00074 class DecodeThread : public Thread
00075 {
00076 public:
00077 DecodeThread(QuickTimeFileReader *reader) : m_reader(reader) { }
00078 virtual void run();
00079
00080 protected:
00081 QuickTimeFileReader *m_reader;
00082 };
00083
00084 DecodeThread *m_decodeThread;
00085 };
00086
00087 #endif
00088
00089 #endif