Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qwasmaudiosource_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 QWASMAUDIOSOURCE_H
5#define QWASMAUDIOSOURCE_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
22QT_BEGIN_NAMESPACE
23
24class ALData;
25
27{
28 Q_OBJECT
29
30 ALData *aldata = nullptr;
31 QTimer *m_timer = nullptr;
32 QIODevice *m_device = nullptr;
33 qsizetype m_bufferSize;
34 bool m_running = false;
35 bool m_suspended = false;
36 bool m_pullMode;
37 char *m_tmpData = nullptr;
38 QElapsedTimer m_elapsedTimer;
39 int m_notifyInterval = 0;
40 quint64 m_processed = 0;
41
42 void writeBuffer();
43public:
44 QWasmAudioSource(QAudioDevice, const QAudioFormat &, QObject *parent);
45
46public:
47 void start(QIODevice *device) override;
48 QIODevice *start() override;
49 void start(bool mode);
50 void stop() override;
51 void reset() override;
52 void suspend() override;
53 void resume() override;
54 qsizetype bytesReady() const override;
55 void setBufferSize(qsizetype value) override;
56 qsizetype bufferSize() const override;
57 qint64 processedUSecs() const override;
58 QAudio::State state() const override;
59
61};
62
63QT_END_NAMESPACE
64
65#endif // QWASMAUDIOSOURCE_H
ALCcontext * context
ALCdevice * device
qint64 readData(char *data, qint64 maxlen) override
Reads up to maxSize bytes from the device into data, and returns the number of bytes read or -1 if an...
qint64 writeData(const char *data, qint64 len) override
Writes up to maxSize bytes from data to the device.
QWasmAudioSourceDevice(QWasmAudioSource *in)
qint64 processedUSecs() const override
QAudio::State state() const override
QIODevice * start() override
void suspend() override
qsizetype bufferSize() const override
void stop() override
void setBufferSize(qsizetype value) override
void start(QIODevice *device) override
QWasmAudioSource(QAudioDevice, const QAudioFormat &, QObject *parent)
void start(bool mode)
void reset() override
qsizetype bytesReady() const override
void resume() override
#define AL_FORMAT_STEREO_FLOAT32
#define AL_FORMAT_MONO_FLOAT32
constexpr unsigned int DEFAULT_BUFFER_DURATION