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 #ifdef WIN32
00029 #include <QTML.h>
00030 #include <Movies.h>
00031 #else
00032 #include <QuickTime/QuickTime.h>
00033 #endif
00034
00035 #include <set>
00036
00037 class QProgressDialog;
00038
00039 class QuickTimeFileReader : public CodedAudioFileReader
00040 {
00041 public:
00042 enum DecodeMode {
00043 DecodeAtOnce,
00044 DecodeThreaded
00045 };
00046
00047 OggVorbisFileReader(QString path, DecodeMode decodeMode,
00048 CacheMode cacheMode);
00049 virtual ~OggVorbisFileReader();
00050
00051 virtual QString getError() const { return m_error; }
00052
00053 virtual QString getTitle() const { return m_title; }
00054
00055 static void getSupportedExtensions(std::set<QString> &extensions);
00056
00057 virtual int getDecodeCompletion() const { return m_completion; }
00058
00059 virtual bool isUpdating() const {
00060 return m_decodeThread && m_decodeThread->isRunning();
00061 }
00062
00063 protected:
00064 QString m_path;
00065 QString m_error;
00066 QString m_title;
00067
00068 MovieAudioExtractionRef m_extractionSessionRef;
00069 AudioBufferList* m_buffer;
00070 OSErr m_qtError;
00071 AudioStreamBasicDescription m_asbd;
00072 Movie m_movie;
00073
00074 bool m_cancelled;
00075 int m_completion;
00076
00077 class DecodeThread : public Thread
00078 {
00079 public:
00080 DecodeThread(OggVorbisFileReader *reader) : m_reader(reader) { }
00081 virtual void run();
00082
00083 protected:
00084 OggVorbisFileReader *m_reader;
00085 };
00086
00087 DecodeThread *m_decodeThread;
00088 };
00089
00090 #endif
00091 #endif
00092
00093 #endif