Changeset 846 for trunk/demos/spectrum/app/wavfile.h
- Timestamp:
- May 5, 2011, 5:36:53 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/vendor/nokia/qt/4.7.2 (added) merged: 845 /branches/vendor/nokia/qt/current merged: 844 /branches/vendor/nokia/qt/4.6.3 removed
- Property svn:mergeinfo changed
-
trunk/demos/spectrum/app/wavfile.h
r769 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 47 47 #include <QtMultimedia/qaudioformat.h> 48 48 49 /** 50 * Helper class for reading WAV files 51 * 52 * See https://ccrma.stanford.edu/courses/422/projects/WaveFormat/ 53 */ 54 class WavFile 49 class WavFile : public QFile 55 50 { 56 51 public: 57 WavFile(const QAudioFormat &format = QAudioFormat(), 58 qint64 dataLength = 0); 52 WavFile(QObject *parent = 0); 59 53 60 // Reads WAV header and seeks to start of data 61 bool readHeader(QIODevice &device); 62 63 // Writes WAV header 64 bool writeHeader(QIODevice &device); 65 66 // Read PCM data 67 qint64 readData(QIODevice &device, QByteArray &buffer, 68 QAudioFormat outputFormat = QAudioFormat()); 69 70 const QAudioFormat& format() const; 71 qint64 dataLength() const; 72 73 static qint64 headerLength(); 74 75 static bool writeDataLength(QIODevice &device, qint64 dataLength); 54 bool open(const QString &fileName); 55 const QAudioFormat &fileFormat() const; 56 qint64 headerLength() const; 76 57 77 58 private: 78 QAudioFormat m_format; 79 qint64 m_dataLength; 59 bool readHeader(); 60 61 private: 62 QAudioFormat m_fileFormat; 63 qint64 m_headerLength; 64 80 65 }; 81 66
Note:
See TracChangeset
for help on using the changeset viewer.