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
qaudiosink.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
5#ifndef QAUDIOOUTPUT_H
6#define QAUDIOOUTPUT_H
7
8#include <QtCore/qiodevice.h>
9
10#include <QtMultimedia/qtmultimediaglobal.h>
11
12#include <QtMultimedia/qtaudio.h>
13#include <QtMultimedia/qaudioformat.h>
14#include <QtMultimedia/qaudiodevice.h>
15
16
18
19
20
22
23class Q_MULTIMEDIA_EXPORT QAudioSink : public QObject
24{
26
27public:
28 explicit QAudioSink(const QAudioFormat &format = QAudioFormat(), QObject *parent = nullptr);
29 explicit QAudioSink(const QAudioDevice &audioDeviceInfo, const QAudioFormat &format = QAudioFormat(), QObject *parent = nullptr);
31
32 bool isNull() const { return !d; }
33
34 QAudioFormat format() const;
35
36 void start(QIODevice *device);
38
39 void stop();
40 void reset();
41 void suspend();
42 void resume();
43
44 void setBufferSize(qsizetype bytes);
45 qsizetype bufferSize() const;
46
47 qsizetype bytesFree() const;
48
49 qint64 processedUSecs() const;
50 qint64 elapsedUSecs() const;
51
52 QtAudio::Error error() const;
53 QtAudio::State state() const;
54
55 void setVolume(qreal);
56 qreal volume() const;
57
59#if defined(Q_QDOC)
60 void stateChanged(QtAudio::State state);
61#else
62 // use QAudio here to keep string-based connections working
64#endif
65
66private:
67 Q_DISABLE_COPY(QAudioSink)
68
70};
71
73
74#endif // QAUDIOOUTPUT_H
IOBluetoothDevice * device
The QAudioDevice class provides an information about audio devices and their functionality.
The QAudioFormat class stores audio stream parameter information.
The QAudioSink class provides an interface for sending audio data to an audio output device.
Definition qaudiosink.h:24
void stateChanged(QAudio::State state)
This signal is emitted when the device state has changed.
bool isNull() const
Returns true is the QAudioSink instance is null, otherwise returns false.
Definition qaudiosink.h:32
\inmodule QtCore \reentrant
Definition qiodevice.h:34
\inmodule QtCore
Definition qobject.h:103
else opt state
[0]
State
Definition qaudio.h:29
Error
Definition qaudio.h:28
Combined button and popup list for selecting options.
DBusConnection const char DBusError * error
GLuint start
GLint GLsizei GLsizei GLenum format
GLboolean reset
#define Q_OBJECT
#define Q_SIGNALS
ptrdiff_t qsizetype
Definition qtypes.h:165
long long qint64
Definition qtypes.h:60
double qreal
Definition qtypes.h:187
future resume()
future suspend()