Mercurial > hg > svcore
comparison data/fileio/AudioFileReader.h @ 290:92e8dbde73cd
* Revert revision 713. We do like QStrings after all.
author | Chris Cannam |
---|---|
date | Fri, 24 Aug 2007 11:41:48 +0000 |
parents | 20028c634494 |
children | c022976d18e8 |
comparison
equal
deleted
inserted
replaced
289:3020904de772 | 290:92e8dbde73cd |
---|---|
14 */ | 14 */ |
15 | 15 |
16 #ifndef _AUDIO_FILE_READER_H_ | 16 #ifndef _AUDIO_FILE_READER_H_ |
17 #define _AUDIO_FILE_READER_H_ | 17 #define _AUDIO_FILE_READER_H_ |
18 | 18 |
19 #include <QObject> | 19 #include <QString> |
20 | 20 #include "model/Model.h" // for SampleBlock |
21 #include <string> | |
22 #include <vector> | |
23 | 21 |
24 class AudioFileReader : public QObject | 22 class AudioFileReader : public QObject |
25 { | 23 { |
26 Q_OBJECT | 24 Q_OBJECT |
27 | 25 |
28 public: | 26 public: |
29 virtual ~AudioFileReader() { } | 27 virtual ~AudioFileReader() { } |
30 | 28 |
31 typedef std::vector<float> SampleBlock; | |
32 | |
33 bool isOK() const { return (m_channelCount > 0); } | 29 bool isOK() const { return (m_channelCount > 0); } |
34 | 30 |
35 virtual std::string getError() const { return m_error; } | 31 virtual QString getError() const { return ""; } |
36 | 32 |
37 size_t getFrameCount() const { return m_frameCount; } | 33 size_t getFrameCount() const { return m_frameCount; } |
38 size_t getChannelCount() const { return m_channelCount; } | 34 size_t getChannelCount() const { return m_channelCount; } |
39 size_t getSampleRate() const { return m_sampleRate; } | 35 size_t getSampleRate() const { return m_sampleRate; } |
40 | 36 |
41 /** | 37 /** |
42 * Return the title of the work in the audio file, if known. This | 38 * Return the title of the work in the audio file, if known. This |
43 * may be implemented by subclasses that support file tagging. | 39 * may be implemented by subclasses that support file tagging. |
44 * This is not the same thing as the file name. | 40 * This is not the same thing as the file name. |
45 */ | 41 */ |
46 virtual std::string getTitle() const { return ""; } | 42 virtual QString getTitle() const { return ""; } |
47 | 43 |
48 /** | 44 /** |
49 * The subclass implementations of this function must be | 45 * The subclass implementations of this function must be |
50 * thread-safe -- that is, safe to call from multiple threads with | 46 * thread-safe -- that is, safe to call from multiple threads with |
51 * different arguments on the same object at the same time. | 47 * different arguments on the same object at the same time. |
64 | 60 |
65 protected: | 61 protected: |
66 size_t m_frameCount; | 62 size_t m_frameCount; |
67 size_t m_channelCount; | 63 size_t m_channelCount; |
68 size_t m_sampleRate; | 64 size_t m_sampleRate; |
69 | |
70 std::string m_error; | |
71 void setError(std::string text, std::string arg = ""); | |
72 void setError(std::string text, int arg); | |
73 }; | 65 }; |
74 | 66 |
75 #endif | 67 #endif |