Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qaudiodecoder.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QAUDIODECODER_H
5#define QAUDIODECODER_H
6
7#include <QtCore/qobject.h>
8#include <QtMultimedia/qmediaenumdebug.h>
9#include <QtMultimedia/qaudiobuffer.h>
10
12
14class Q_MULTIMEDIA_EXPORT QAudioDecoder : public QObject
15{
17 Q_PROPERTY(QUrl source READ source WRITE setSource NOTIFY sourceChanged)
18 Q_PROPERTY(bool isDecoding READ isDecoding NOTIFY isDecodingChanged)
19 Q_PROPERTY(QString error READ errorString)
20 Q_PROPERTY(bool bufferAvailable READ bufferAvailable NOTIFY bufferAvailableChanged)
21
22public:
32
33 explicit QAudioDecoder(QObject *parent = nullptr);
35
36 bool isSupported() const;
37 bool isDecoding() const;
38
39 QUrl source() const;
40 void setSource(const QUrl &fileName);
41
42 QIODevice* sourceDevice() const;
43 void setSourceDevice(QIODevice *device);
44
45 QAudioFormat audioFormat() const;
46 void setAudioFormat(const QAudioFormat &format);
47
48 Error error() const;
49 QString errorString() const;
50
51 QAudioBuffer read() const;
52 bool bufferAvailable() const;
53
54 qint64 position() const;
55 qint64 duration() const;
56
57public Q_SLOTS:
58 void start();
59 void stop();
60
64 void finished();
66
68
70
72
74 void durationChanged(qint64 duration);
75
76private:
77 Q_DISABLE_COPY(QAudioDecoder)
78 Q_DECLARE_PRIVATE(QAudioDecoder)
79
80 // ### Qt7: remove unused member
81 QT6_ONLY(void *unused = nullptr;) // for ABI compatibility
82};
83
85
87
88#endif // QAUDIODECODER_H
IOBluetoothDevice * device
\inmodule QtMultimedia
The QAudioDecoder class implements decoding audio.
void durationChanged(qint64 duration)
Signals that the estimated duration of the decoded data has changed.
Error
Defines a media player error condition.
void error(QAudioDecoder::Error error)
Signals that an error condition has occurred.
void bufferAvailableChanged(bool)
Signals the availability (if available is true) of a new buffer.
void sourceChanged()
Signals that the current source of the decoder has changed.
void positionChanged(qint64 position)
Signals that the current position of the decoder has changed.
void bufferReady()
Signals that a new decoded audio buffer is available to be read.
~QAudioDecoder()
Destroys the audio decoder object.
void isDecodingChanged(bool)
void finished()
Signals that the decoding has finished successfully.
void formatChanged(const QAudioFormat &format)
Signals that the current audio format of the decoder has changed to format.
The QAudioFormat class stores audio stream parameter information.
\inmodule QtCore \reentrant
Definition qiodevice.h:34
\inmodule QtCore
Definition qobject.h:103
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
\inmodule QtCore
Definition qurl.h:94
Combined button and popup list for selecting options.
class QT6_ONLY(Q_CORE_EXPORT) QChar
Definition qchar.h:44
DBusConnection const char DBusError * error
#define Q_MEDIA_ENUM_DEBUG(Class, Enum)
GLuint start
GLint GLsizei GLsizei GLenum format
GLsizei GLsizei GLchar * source
static qreal position(const QQuickItem *item, QQuickAnchors::Anchor anchorLine)
#define Q_ENUM(x)
#define Q_PROPERTY(...)
#define Q_OBJECT
#define Q_SLOTS
#define Q_SIGNALS
long long qint64
Definition qtypes.h:60
ReturnedValue read(const char *data)