diff options
author | Michael Goddard <michael.goddard@nokia.com> | 2012-07-10 14:26:58 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-07-11 08:01:45 +0200 |
commit | 4d13a15bae0e4ad978e7c455dc26650f6d879862 (patch) | |
tree | 196bd714b3bc5ebc355e88d48b220377dfaf9d37 /src/multimedia/audio/qaudioformat.h | |
parent | 68079a5e220d9ae76ca1ba7a3983dd98dae21634 (diff) |
Clarify API/docs by introducing the audio "frame", and add helpers.
The frame is the interleaved set of one sample for each channel. Add
some docs and some methods that make working with samples a bit more
convenient.
Adjusted QAudioBuffer to use these helper functions and terminology.
Change-Id: I96db48e659561972d6de2aa19893d29f9a828cd3
Reviewed-by: Dmytro Poplavskiy <dmytro.poplavskiy@nokia.com>
Diffstat (limited to 'src/multimedia/audio/qaudioformat.h')
-rw-r--r-- | src/multimedia/audio/qaudioformat.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/multimedia/audio/qaudioformat.h b/src/multimedia/audio/qaudioformat.h index 3bc5780d6..fccb206eb 100644 --- a/src/multimedia/audio/qaudioformat.h +++ b/src/multimedia/audio/qaudioformat.h @@ -91,6 +91,18 @@ public: void setSampleType(QAudioFormat::SampleType sampleType); QAudioFormat::SampleType sampleType() const; + // Helper functions + qint32 bytesForDuration(qint64 duration) const; + qint64 durationForBytes(qint32 byteCount) const; + + qint32 bytesForFrames(qint32 frameCount) const; + qint32 framesForBytes(qint32 byteCount) const; + + qint32 framesForDuration(qint64 duration) const; + qint64 durationForFrames(qint32 frameCount) const; + + int bytesPerFrame() const; + private: QSharedDataPointer<QAudioFormatPrivate> d; }; |