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
qwasmaudiosink_p.h
Go to the documentation of this file.
1// Copyright (C) 2021 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 QWASMAUDIOSINK_H
5#define QWASMAUDIOSINK_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <private/qaudiosystem_p.h>
19#include <QTimer>
20#include <QElapsedTimer>
21
22class ALData;
23class QIODevice;
24
26
28{
30
31 QByteArray m_name;
32 ALData *aldata = nullptr;
33 QTimer *m_timer = nullptr;
34 QIODevice *m_device = nullptr;
35 QAudioFormat m_format;
37 bool m_running = false;
39 QAudio::State m_suspendedInState = QAudio::SuspendedState;
40 int m_bufferSize = 0;
41 quint64 m_processed = 0;
42 QElapsedTimer m_elapsedTimer;
43 int m_bufferFragmentsCount = 10;
44 int m_notifyInterval = 0;
45 char *m_tmpData = nullptr;
46 int m_bufferFragmentSize = 0;
47 int m_lastNotified = 0;
48 int m_tmpDataOffset = 0;
49 int m_bufferFragmentsBusyCount = 0;
50 bool m_pullMode;
51 qreal m_volume = 1;
52
53 void loadALBuffers();
54 void unloadALBuffers();
55 void nextALBuffers();
56
57private slots:
58 void updateState();
59 void setError(QAudio::Error);
60
61public:
64
65public:
66 void start(QIODevice *device) override;
67 QIODevice *start() override;
68 void start(bool mode);
69 void stop() override;
70 void reset() override;
71 void suspend() override;
72 void resume() override;
73 qsizetype bytesFree() const override;
74 void setBufferSize(qsizetype value) override;
75 qsizetype bufferSize() const override;
76 qint64 processedUSecs() const override;
77 QAudio::Error error() const override;
78 QAudio::State state() const override;
79 void setFormat(const QAudioFormat &fmt) override;
80 QAudioFormat format() const override;
81 void setVolume(qreal volume) override;
82 qreal volume() const override;
83
85};
86
88
89#endif // QWASMAUDIOSINK_H
IOBluetoothDevice * device
The QAudioFormat class stores audio stream parameter information.
\inmodule QtCore
Definition qbytearray.h:57
\inmodule QtCore
\inmodule QtCore \reentrant
Definition qiodevice.h:34
\inmodule QtCore
Definition qobject.h:103
QObject * parent() const
Returns a pointer to the parent object.
Definition qobject.h:346
\inmodule QtCore
Definition qtimer.h:20
void resume() override
void stop() override
qreal volume() const override
void setVolume(qreal volume) override
void suspend() override
void setFormat(const QAudioFormat &fmt) override
QWasmAudioSink(const QByteArray &device, QObject *parent)
QIODevice * start() override
QAudio::State state() const override
qsizetype bufferSize() const override
QAudio::Error error() const override
void setBufferSize(qsizetype value) override
qsizetype bytesFree() const override
qint64 processedUSecs() const override
QAudioFormat format() const override
void reset() override
State
Definition qaudio.h:29
@ StoppedState
Definition qaudio.h:29
@ SuspendedState
Definition qaudio.h:29
Error
Definition qaudio.h:28
@ NoError
Definition qaudio.h:28
Combined button and popup list for selecting options.
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
GLenum mode
#define Q_OBJECT
#define slots
unsigned long long quint64
Definition qtypes.h:61
ptrdiff_t qsizetype
Definition qtypes.h:165
long long qint64
Definition qtypes.h:60
double qreal
Definition qtypes.h:187
QVideoFrameFormat::PixelFormat fmt