Changes to QAudioBuffer and QAudioDecoder (position and duration).
QAudioBuffer: - Allow to specify startTime in the constructor. QAudioDecoder: - Removed WaitingState. - New signals: finished(), positionChanged(), durationChanged(). - New methods: position(), duration(). - A parameter removed from read() method. Change-Id: Ifb71502d0756aa306abd0a6bf7873934029952c4 Reviewed-by: Dmytro Poplavskiy <dmytro.poplavskiy@nokia.com> Reviewed-by: Michael Goddard <michael.goddard@nokia.com>
This commit is contained in:
committed by
Qt by Nokia
parent
ea1037a7d0
commit
0b8c6115cd
@@ -189,7 +189,30 @@ QAudioDecoderControl::QAudioDecoderControl(QObject *parent):
|
||||
\sa audioFormat(), setAudioFormat
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn void QAudioDecoderControl::finished()
|
||||
|
||||
Signals that the decoding has finished successfully.
|
||||
If decoding fails, error signal is emitted instead.
|
||||
|
||||
\sa start(), stop(), error
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn void QAudioDecoderControl::positionChanged(qint64 position)
|
||||
|
||||
Signals that the current \a position of the decoder has changed.
|
||||
|
||||
\sa durationChanged
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn void QAudioDecoderControl::durationChanged(qint64 duration)
|
||||
|
||||
Signals that the estimated \a duration of the decoded data has changed.
|
||||
|
||||
\sa positionChanged
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn QAudioDecoderControl::audioFormat()
|
||||
@@ -215,6 +238,23 @@ QAudioDecoderControl::QAudioDecoderControl(QObject *parent):
|
||||
audio file, you can specify an invalid \a format.
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn QAudioDecoderControl::read()
|
||||
Read a buffer from the decoder. Returns invalid buffer on failure.
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn QAudioDecoderControl::position()
|
||||
Returns position (in milliseconds) of the last buffer read from
|
||||
the decoder or -1 if no buffers have been read.
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn QAudioDecoderControl::duration()
|
||||
Returns total duration (in milliseconds) of the audio stream
|
||||
or -1 if not available.
|
||||
*/
|
||||
|
||||
#include "moc_qaudiodecodercontrol_p.cpp"
|
||||
QT_END_NAMESPACE
|
||||
|
||||
|
||||
@@ -77,9 +77,12 @@ public:
|
||||
virtual QAudioFormat audioFormat() const = 0;
|
||||
virtual void setAudioFormat(const QAudioFormat &format) = 0;
|
||||
|
||||
virtual QAudioBuffer read(bool *ok) = 0;
|
||||
virtual QAudioBuffer read() = 0;
|
||||
virtual bool bufferAvailable() const = 0;
|
||||
|
||||
virtual qint64 position() const = 0;
|
||||
virtual qint64 duration() const = 0;
|
||||
|
||||
Q_SIGNALS:
|
||||
void stateChanged(QAudioDecoder::State newState);
|
||||
void formatChanged(const QAudioFormat &format);
|
||||
@@ -89,6 +92,10 @@ Q_SIGNALS:
|
||||
|
||||
void bufferReady();
|
||||
void bufferAvailableChanged(bool available);
|
||||
void finished();
|
||||
|
||||
void positionChanged(qint64 position);
|
||||
void durationChanged(qint64 duration);
|
||||
|
||||
protected:
|
||||
QAudioDecoderControl(QObject* parent = 0);
|
||||
|
||||
Reference in New Issue
Block a user