comparison data/fileio/QuickTimeFileReader.h @ 281:9c447d664275

* Add QuickTime file reader class -- totally untested, shouldn't even compile
author Chris Cannam
date Mon, 06 Aug 2007 14:37:59 +0000
parents
children e2fdcf9d35c5
comparison
equal deleted inserted replaced
280:daf89d31f45c 281:9c447d664275
1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
2
3 /*
4 Sonic Visualiser
5 An audio file viewer and annotation editor.
6 Centre for Digital Music, Queen Mary, University of London.
7 This file copyright 2006-2007 Chris Cannam and QMUL.
8
9 Based in part on QTAudioFile.h from SoundBite, copyright 2006
10 Chris Sutton and Mark Levy.
11
12 This program is free software; you can redistribute it and/or
13 modify it under the terms of the GNU General Public License as
14 published by the Free Software Foundation; either version 2 of the
15 License, or (at your option) any later version. See the file
16 COPYING included with this distribution for more information.
17 */
18
19 #ifndef _QUICKTIME_FILE_READER_H_
20 #define _QUICKTIME_FILE_READER_H_
21
22 #ifdef HAVE_QUICKTIME
23
24 #include "CodedAudioFileReader.h"
25
26 #include "base/Thread.h"
27
28 #include <set>
29
30 class QProgressDialog;
31
32 class QuickTimeFileReader : public CodedAudioFileReader
33 {
34 public:
35 enum DecodeMode {
36 DecodeAtOnce, // decode the file on construction, with progress dialog
37 DecodeThreaded // decode in a background thread after construction
38 };
39
40 QuickTimeFileReader(QString path, DecodeMode decodeMode,
41 CacheMode cacheMode);
42 virtual ~QuickTimeFileReader();
43
44 virtual QString getError() const { return m_error; }
45 virtual QString getTitle() const { return m_title; }
46
47 static void getSupportedExtensions(std::set<QString> &extensions);
48
49 virtual int getDecodeCompletion() const { return m_completion; }
50
51 virtual bool isUpdating() const {
52 return m_decodeThread && m_decodeThread->isRunning();
53 }
54
55 protected:
56 QString m_path;
57 QString m_error;
58 QString m_title;
59
60 class D;
61 D *m_d;
62
63 bool m_cancelled;
64 int m_completion;
65
66 class DecodeThread : public Thread
67 {
68 public:
69 DecodeThread(QuickTimeFileReader *reader) : m_reader(reader) { }
70 virtual void run();
71
72 protected:
73 QuickTimeFileReader *m_reader;
74 };
75
76 DecodeThread *m_decodeThread;
77 };
78
79 #endif
80
81 #endif