Mercurial > hg > svcore
comparison data/fileio/ResamplingWavFileReader.h @ 316:3a6725f285d6
* Make RemoteFile far more pervasive, and use it for local files as well
so that we can handle both transparently. Make it shallow copy with
reference counting, so it can be used by value without having to worry
about the cache file lifetime. Use RemoteFile for MainWindow file-open
functions, etc
author | Chris Cannam |
---|---|
date | Thu, 18 Oct 2007 15:31:20 +0000 |
parents | c022976d18e8 |
children | c324d410b096 |
comparison
equal
deleted
inserted
replaced
315:96ef9746c560 | 316:3a6725f285d6 |
---|---|
31 enum ResampleMode { | 31 enum ResampleMode { |
32 ResampleAtOnce, // resample the file on construction, with progress dialog | 32 ResampleAtOnce, // resample the file on construction, with progress dialog |
33 ResampleThreaded // resample in a background thread after construction | 33 ResampleThreaded // resample in a background thread after construction |
34 }; | 34 }; |
35 | 35 |
36 ResamplingWavFileReader(QString path, | 36 ResamplingWavFileReader(RemoteFile source, |
37 ResampleMode resampleMode, | 37 ResampleMode resampleMode, |
38 CacheMode cacheMode, | 38 CacheMode cacheMode, |
39 size_t targetRate = 0); | 39 size_t targetRate = 0); |
40 virtual ~ResamplingWavFileReader(); | 40 virtual ~ResamplingWavFileReader(); |
41 | 41 |
42 virtual QString getError() const { return m_error; } | 42 virtual QString getError() const { return m_error; } |
43 | |
44 static void getSupportedExtensions(std::set<QString> &extensions); | 43 static void getSupportedExtensions(std::set<QString> &extensions); |
44 static bool supportsExtension(QString ext); | |
45 static bool supportsContentType(QString type); | |
46 static bool supports(RemoteFile &source); | |
45 | 47 |
46 virtual int getDecodeCompletion() const { return m_completion; } | 48 virtual int getDecodeCompletion() const { return m_completion; } |
47 | 49 |
48 virtual bool isUpdating() const { | 50 virtual bool isUpdating() const { |
49 return m_decodeThread && m_decodeThread->isRunning(); | 51 return m_decodeThread && m_decodeThread->isRunning(); |
50 } | 52 } |
51 | 53 |
52 protected: | 54 protected: |
55 RemoteFile m_source; | |
53 QString m_path; | 56 QString m_path; |
54 QString m_error; | 57 QString m_error; |
55 bool m_cancelled; | 58 bool m_cancelled; |
56 size_t m_processed; | 59 size_t m_processed; |
57 int m_completion; | 60 int m_completion; |