Ignore:
Timestamp:
May 5, 2011, 5:36:53 AM (14 years ago)
Author:
Dmitry A. Kuminov
Message:

trunk: Merged in qt 4.7.2 sources from branches/vendor/nokia/qt.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/demos/spectrum/app/wavfile.h

    r769 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
     
    4747#include <QtMultimedia/qaudioformat.h>
    4848
    49 /**
    50  * Helper class for reading WAV files
    51  *
    52  * See https://ccrma.stanford.edu/courses/422/projects/WaveFormat/
    53  */
    54 class WavFile
     49class WavFile : public QFile
    5550{
    5651public:
    57     WavFile(const QAudioFormat &format = QAudioFormat(),
    58               qint64 dataLength = 0);
     52    WavFile(QObject *parent = 0);
    5953
    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;
    7657
    7758private:
    78     QAudioFormat m_format;
    79     qint64 m_dataLength;
     59    bool readHeader();
     60
     61private:
     62    QAudioFormat m_fileFormat;
     63    qint64 m_headerLength;
     64
    8065};
    8166
Note: See TracChangeset for help on using the changeset viewer.