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
qaudioengine_p.h
Go to the documentation of this file.
1// Copyright (C) 2022 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-3.0-only
3
4#ifndef QAUDIOENGINE_P_H
5#define QAUDIOENGINE_P_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 for the convenience
12// of other Qt classes. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
19#include <qaudioengine.h>
20#include <qaudiodevice.h>
21#include <qaudiodecoder.h>
22#include <qthread.h>
23#include <qmutex.h>
24#include <qurl.h>
25#include <qaudiobuffer.h>
26#include <qvector3d.h>
27#include <qfile.h>
28
29namespace vraudio {
30class ResonanceAudio;
31}
32
34
35class QSpatialSound;
36class QAmbientSound;
37class QAudioSink;
40class QAudioDecoder;
41class QAudioRoom;
42class QAudioListener;
43
45{
46public:
47 static QAudioEnginePrivate *get(QAudioEngine *engine) { return engine ? engine->d : nullptr; }
48
49 static constexpr int bufferSize = 128;
50
54 int sampleRate = 44100;
55 float masterVolume = 1.;
57 bool roomEffectsEnabled = true;
58
59 // Resonance Audio uses meters internally, while Qt Quick 3D and our API uses cm by default.
60 // To make things independent from the scale setting, we store all distances in meters internally
61 // and convert in the setters and getters.
62 float distanceScale = 0.01f;
63
66 QAtomicInteger<bool> paused = false;
67
69 std::unique_ptr<QAudioOutputStream> outputStream;
70
72 QList<QSpatialSound *> sources;
73 QList<QAmbientSound *> stereoSources;
74 QList<QAudioRoom *> rooms;
75 mutable bool listenerPositionDirty = true;
77
78 void addSpatialSound(QSpatialSound *sound);
80 void addStereoSound(QAmbientSound *sound);
82
83 void addRoom(QAudioRoom *room);
84 void removeRoom(QAudioRoom *room);
85 void updateRooms();
86
88};
89
91
92#endif
\inmodule QtSpatialAudio
The QAudioDecoder class implements decoding audio.
The QAudioDevice class provides an information about audio devices and their functionality.
std::unique_ptr< QAudioOutputStream > outputStream
vraudio::ResonanceAudio * resonanceAudio
void addRoom(QAudioRoom *room)
void addStereoSound(QAmbientSound *sound)
QAtomicInteger< bool > paused
QAudioRoom * currentRoom
QVector3D listenerPosition() const
void removeRoom(QAudioRoom *room)
void addSpatialSound(QSpatialSound *sound)
QAudioEngine::OutputMode outputMode
static QAudioEnginePrivate * get(QAudioEngine *engine)
QList< QAmbientSound * > stereoSources
QList< QSpatialSound * > sources
void removeStereoSound(QAmbientSound *sound)
void removeSpatialSound(QSpatialSound *sound)
QList< QAudioRoom * > rooms
QAudioListener * listener
static constexpr int bufferSize
\inmodule QtSpatialAudio
OutputMode
\value Surround Map the sounds to the loudspeaker configuration of the output device.
\inmodule QtSpatialAudio
\inmodule QtSpatialAudio
Definition qaudioroom.h:17
The QAudioSink class provides an interface for sending audio data to an audio output device.
Definition qaudiosink.h:24
\inmodule QtCore
Definition qmutex.h:281
\inmodule QtSpatialAudio
The QVector3D class represents a vector or vertex in 3D space.
Definition qvectornd.h:171
Combined button and popup list for selecting options.
QJSEngine engine
[0]