![]() |
Qt 6.x
The Qt SDK
|
\inmodule QtSpatialAudio More...
#include <qaudioroom.h>
Public Types | |
enum | Material { Transparent , AcousticCeilingTiles , BrickBare , BrickPainted , ConcreteBlockCoarse , ConcreteBlockPainted , CurtainHeavy , FiberGlassInsulation , GlassThin , GlassThick , Grass , LinoleumOnConcrete , Marble , Metal , ParquetOnConcrete , PlasterRough , PlasterSmooth , PlywoodPanel , PolishedConcreteOrTile , Sheetrock , WaterOrIceSurface , WoodCeiling , WoodPanel , UniformMaterial } |
Defines different materials that can be applied to the different walls of the room. More... | |
enum | Wall { LeftWall , RightWall , Floor , Ceiling , FrontWall , BackWall } |
An enum defining the 6 walls of the room. More... | |
Signals | |
void | positionChanged () |
void | dimensionsChanged () |
void | rotationChanged () |
void | wallsChanged () |
Signals when the wall material changes. | |
void | reflectionGainChanged () |
void | reverbGainChanged () |
void | reverbTimeChanged () |
void | reverbBrightnessChanged () |
![]() | |
void | destroyed (QObject *=nullptr) |
This signal is emitted immediately before the object obj is destroyed, after any instances of QPointer have been notified, and cannot be blocked. | |
void | objectNameChanged (const QString &objectName, QPrivateSignal) |
This signal is emitted after the object's name has been changed. | |
Public Member Functions | |
QAudioRoom (QAudioEngine *engine) | |
Constructs a QAudioRoom for engine. | |
~QAudioRoom () | |
Destroys the room. | |
void | setPosition (QVector3D pos) |
QVector3D | position () const |
void | setDimensions (QVector3D dim) |
QVector3D | dimensions () const |
void | setRotation (const QQuaternion &q) |
QQuaternion | rotation () const |
void | setWallMaterial (Wall wall, Material material) |
Sets wall to material. | |
Material | wallMaterial (Wall wall) const |
returns the material being used for wall. | |
void | setReflectionGain (float factor) |
float | reflectionGain () const |
void | setReverbGain (float factor) |
float | reverbGain () const |
void | setReverbTime (float factor) |
float | reverbTime () const |
void | setReverbBrightness (float factor) |
float | reverbBrightness () const |
![]() | |
Q_INVOKABLE | QObject (QObject *parent=nullptr) |
Constructs an object with parent object parent. | |
virtual | ~QObject () |
Destroys the object, deleting all its child objects. | |
virtual bool | event (QEvent *event) |
This virtual function receives events to an object and should return true if the event e was recognized and processed. | |
virtual bool | eventFilter (QObject *watched, QEvent *event) |
Filters events if this object has been installed as an event filter for the watched object. | |
QString | objectName () const |
Q_WEAK_OVERLOAD void | setObjectName (const QString &name) |
Sets the object's name to name. | |
void | setObjectName (QAnyStringView name) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
QBindable< QString > | bindableObjectName () |
bool | isWidgetType () const |
Returns true if the object is a widget; otherwise returns false . | |
bool | isWindowType () const |
Returns true if the object is a window; otherwise returns false . | |
bool | isQuickItemType () const |
Returns true if the object is a QQuickItem; otherwise returns false . | |
bool | signalsBlocked () const noexcept |
Returns true if signals are blocked; otherwise returns false . | |
bool | blockSignals (bool b) noexcept |
If block is true, signals emitted by this object are blocked (i.e., emitting a signal will not invoke anything connected to it). | |
QThread * | thread () const |
Returns the thread in which the object lives. | |
void | moveToThread (QThread *thread) |
Changes the thread affinity for this object and its children. | |
int | startTimer (int interval, Qt::TimerType timerType=Qt::CoarseTimer) |
This is an overloaded function that will start a timer of type timerType and a timeout of interval milliseconds. | |
int | startTimer (std::chrono::milliseconds time, Qt::TimerType timerType=Qt::CoarseTimer) |
void | killTimer (int id) |
Kills the timer with timer identifier, id. | |
template<typename T > | |
T | findChild (const QString &aName=QString(), Qt::FindChildOptions options=Qt::FindChildrenRecursively) const |
Returns the child of this object that can be cast into type T and that is called name, or \nullptr if there is no such object. | |
template<typename T > | |
QList< T > | findChildren (const QString &aName, Qt::FindChildOptions options=Qt::FindChildrenRecursively) const |
Returns all children of this object with the given name that can be cast to type T, or an empty list if there are no such objects. | |
template<typename T > | |
QList< T > | findChildren (Qt::FindChildOptions options=Qt::FindChildrenRecursively) const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
const QObjectList & | children () const |
Returns a list of child objects. | |
void | setParent (QObject *parent) |
Makes the object a child of parent. | |
void | installEventFilter (QObject *filterObj) |
Installs an event filter filterObj on this object. | |
void | removeEventFilter (QObject *obj) |
Removes an event filter object obj from this object. | |
QMetaObject::Connection | connect (const QObject *sender, const char *signal, const char *member, Qt::ConnectionType type=Qt::AutoConnection) const |
bool | disconnect (const char *signal=nullptr, const QObject *receiver=nullptr, const char *member=nullptr) const |
bool | disconnect (const QObject *receiver, const char *member=nullptr) const |
void | dumpObjectTree () const |
Dumps a tree of children to the debug output. | |
void | dumpObjectInfo () const |
Dumps information about signal connections, etc. | |
bool | setProperty (const char *name, const QVariant &value) |
Sets the value of the object's name property to value. | |
bool | setProperty (const char *name, QVariant &&value) |
QVariant | property (const char *name) const |
Returns the value of the object's name property. | |
QList< QByteArray > | dynamicPropertyNames () const |
QBindingStorage * | bindingStorage () |
const QBindingStorage * | bindingStorage () const |
QObject * | parent () const |
Returns a pointer to the parent object. | |
bool | inherits (const char *classname) const |
Returns true if this object is an instance of a class that inherits className or a QObject subclass that inherits className; otherwise returns false . | |
Properties | |
QVector3D | position |
Defines the position of the center of the room in 3D space. | |
QVector3D | dimensions |
Defines the dimensions of the room in 3D space. | |
QQuaternion | rotation |
Defines the orientation of the room in 3D space. | |
float | reflectionGain |
A gain factor for reflections generated in this room. | |
float | reverbGain |
A gain factor for reverb generated in this room. | |
float | reverbTime |
A factor to be applies to all reverb timings generated for this room. | |
float | reverbBrightness |
A brightness factor to be applied to the generated reverb. | |
![]() | |
QString | objectName |
the name of this object | |
Friends | |
class | QAudioRoomPrivate |
Additional Inherited Members | |
![]() | |
void | deleteLater () |
\threadsafe | |
![]() | |
static QMetaObject::Connection | connect (const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection) |
\threadsafe | |
static QMetaObject::Connection | connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type=Qt::AutoConnection) |
template<typename Func1 , typename Func2 > | |
static QMetaObject::Connection | connect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::ContextTypeForFunctor< Func2 >::ContextType *context, Func2 &&slot, Qt::ConnectionType type=Qt::AutoConnection) |
template<typename Func1 , typename Func2 > | |
static QMetaObject::Connection | connect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, Func2 &&slot) |
static bool | disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *member) |
\threadsafe | |
static bool | disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &member) |
static bool | disconnect (const QMetaObject::Connection &) |
Disconnect a connection. | |
template<typename Func1 , typename Func2 > | |
static bool | disconnect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::FunctionPointer< Func2 >::Object *receiver, Func2 slot) |
template<typename Func1 > | |
static bool | disconnect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const QObject *receiver, void **zero) |
![]() | |
QObject * | sender () const |
Returns a pointer to the object that sent the signal, if called in a slot activated by a signal; otherwise it returns \nullptr. | |
int | senderSignalIndex () const |
int | receivers (const char *signal) const |
Returns the number of receivers connected to the signal. | |
bool | isSignalConnected (const QMetaMethod &signal) const |
virtual void | timerEvent (QTimerEvent *event) |
This event handler can be reimplemented in a subclass to receive timer events for the object. | |
virtual void | childEvent (QChildEvent *event) |
This event handler can be reimplemented in a subclass to receive child events. | |
virtual void | customEvent (QEvent *event) |
This event handler can be reimplemented in a subclass to receive custom events. | |
virtual void | connectNotify (const QMetaMethod &signal) |
virtual void | disconnectNotify (const QMetaMethod &signal) |
QObject (QObjectPrivate &dd, QObject *parent=nullptr) | |
![]() | |
QScopedPointer< QObjectData > | d_ptr |
![]() | |
template< class T > T | qobject_cast (const QObject *object) |
Returns the given object cast to type T if the object is of type T (or of a subclass); otherwise returns \nullptr. | |
template< typename T > T | qFindChildqFindChildren (const QObject *obj, const QString &name)() |
template< typename T > QList< T > | qFindChildrenqFindChildren (const QObject *obj, const QString &name)() |
QObjectList | |
\macro Q_CLASSINFO(Name, Value) | |
\inmodule QtSpatialAudio
Defines a room for the spatial audio engine.
If the listener is inside a room, first order sound reflections and reverb matching the rooms properties will get applied to the sound field.
A room is always square and defined by its center position, its orientation and dimensions. Each of the 6 walls of the room can be made of different materials that will contribute to the computed reflections and reverb that the listener will experience while being inside the room.
If multiple rooms cover the same position, the engine will use the room with the smallest volume.
Definition at line 16 of file qaudioroom.h.
enum QAudioRoom::Material |
Defines different materials that can be applied to the different walls of the room.
\value Transparent The side of the room is open and won't contribute to reflections or reverb. \value AcousticCeilingTiles Acoustic tiles that suppress most reflections and reverb. \value BrickBare Bare brick wall. \value BrickPainted Painted brick wall. \value ConcreteBlockCoarse Raw concrete wall \value ConcreteBlockPainted Painted concrete wall \value CurtainHeavy Heavy curtain. Will mostly reflect low frequencies \value FiberGlassInsulation Fiber glass insulation. Only reflects very low frequencies \value GlassThin Thin glass wall \value GlassThick Thick glass wall \value Grass Grass \value LinoleumOnConcrete Linoleum floor \value Marble Marble floor \value Metal Metal \value ParquetOnConcrete Parquet wooden floor on concrete \value PlasterRough Rough plaster \value PlasterSmooth Smooth plaster \value PlywoodPanel Plywodden panel \value PolishedConcreteOrTile Polished concrete or tiles \value Sheetrock Rock \value WaterOrIceSurface Water or ice \value WoodCeiling Wooden ceiling \value WoodPanel Wooden panel \value UniformMaterial Artificial material giving uniform reflections on all frequencies
Definition at line 30 of file qaudioroom.h.
enum QAudioRoom::Wall |
An enum defining the 6 walls of the room.
\value LeftWall Left wall (negative x) \value RightWall Right wall (positive x) \value Floor Bottom wall (negative y) \value Ceiling Top wall (positive y) \value FrontWall Front wall (negative z) \value BackWall Back wall (positive z)
Enumerator | |
---|---|
LeftWall | |
RightWall | |
Floor | |
Ceiling | |
FrontWall | |
BackWall |
Definition at line 57 of file qaudioroom.h.
|
explicit |
Constructs a QAudioRoom for engine.
Definition at line 124 of file qaudioroom.cpp.
References engine, QAudioRoomPrivate::engine, QAudioEnginePrivate::get(), and Q_ASSERT.
QAudioRoom::~QAudioRoom | ( | ) |
Destroys the room.
Definition at line 136 of file qaudioroom.cpp.
References QAudioRoomPrivate::engine, and QAudioEnginePrivate::get().
QVector3D QAudioRoom::dimensions | ( | ) | const |
Definition at line 235 of file qaudioroom.cpp.
References QAudioRoomPrivate::engine, QAudioEnginePrivate::get(), and QAudioRoomPrivate::roomProperties.
|
signal |
Referenced by QQuick3DAudioRoom::QQuick3DAudioRoom(), and setDimensions().
QVector3D QAudioRoom::position | ( | ) | const |
Definition at line 208 of file qaudioroom.cpp.
References QAudioRoomPrivate::engine, QAudioEnginePrivate::get(), pos, and QAudioRoomPrivate::roomProperties.
|
signal |
float QAudioRoom::reflectionGain | ( | ) | const |
Definition at line 318 of file qaudioroom.cpp.
References QAudioRoomPrivate::roomProperties.
|
signal |
Referenced by QQuick3DAudioRoom::QQuick3DAudioRoom(), and setReflectionGain().
float QAudioRoom::reverbBrightness | ( | ) | const |
Definition at line 392 of file qaudioroom.cpp.
References QAudioRoomPrivate::roomProperties.
|
signal |
Referenced by QQuick3DAudioRoom::QQuick3DAudioRoom(), and setReverbBrightness().
float QAudioRoom::reverbGain | ( | ) | const |
Definition at line 344 of file qaudioroom.cpp.
References QAudioRoomPrivate::roomProperties.
|
signal |
Referenced by QQuick3DAudioRoom::QQuick3DAudioRoom(), and setReverbGain().
float QAudioRoom::reverbTime | ( | ) | const |
Definition at line 369 of file qaudioroom.cpp.
References QAudioRoomPrivate::roomProperties.
|
signal |
Referenced by QQuick3DAudioRoom::QQuick3DAudioRoom(), and setReverbTime().
QQuaternion QAudioRoom::rotation | ( | ) | const |
Definition at line 257 of file qaudioroom.cpp.
References QAudioRoomPrivate::roomProperties.
|
signal |
Referenced by QQuick3DAudioRoom::QQuick3DAudioRoom(), and setRotation().
Definition at line 224 of file qaudioroom.cpp.
References dimensionsChanged(), QAudioRoomPrivate::dirty, emit, QAudioRoomPrivate::engine, QAudioEnginePrivate::get(), and QAudioRoomPrivate::roomProperties.
Referenced by QQuick3DAudioRoom::setDimensions().
Definition at line 197 of file qaudioroom.cpp.
References QAudioRoomPrivate::dirty, emit, QAudioRoomPrivate::engine, QAudioEnginePrivate::get(), pos, positionChanged(), and QAudioRoomPrivate::roomProperties.
Referenced by QQuick3DAudioRoom::updatePosition().
void QAudioRoom::setReflectionGain | ( | float | factor | ) |
Definition at line 307 of file qaudioroom.cpp.
References QAudioRoomPrivate::dirty, emit, reflectionGainChanged(), and QAudioRoomPrivate::roomProperties.
Referenced by QQuick3DAudioRoom::setReflectionGain().
void QAudioRoom::setReverbBrightness | ( | float | factor | ) |
Definition at line 383 of file qaudioroom.cpp.
References QAudioRoomPrivate::dirty, emit, reverbBrightnessChanged(), and QAudioRoomPrivate::roomProperties.
Referenced by QQuick3DAudioRoom::setReverbBrightness().
void QAudioRoom::setReverbGain | ( | float | factor | ) |
Definition at line 333 of file qaudioroom.cpp.
References QAudioRoomPrivate::dirty, emit, reverbGainChanged(), and QAudioRoomPrivate::roomProperties.
Referenced by QQuick3DAudioRoom::setReverbGain().
void QAudioRoom::setReverbTime | ( | float | factor | ) |
Definition at line 358 of file qaudioroom.cpp.
References QAudioRoomPrivate::dirty, emit, reverbTimeChanged(), and QAudioRoomPrivate::roomProperties.
Referenced by QQuick3DAudioRoom::setReverbTime().
void QAudioRoom::setRotation | ( | const QQuaternion & | q | ) |
Definition at line 248 of file qaudioroom.cpp.
References QAudioRoomPrivate::dirty, emit, QAudioRoomPrivate::roomProperties, and rotationChanged().
Referenced by QQuick3DAudioRoom::updateRotation().
Sets wall to material.
Different wall materials have different reflection and reverb properties that influence the sound of the room.
Definition at line 275 of file qaudioroom.cpp.
References QAudioRoomPrivate::dirty, emit, QAudioRoomPrivate::roomProperties, Transparent, UniformMaterial, and wallsChanged().
Referenced by QQuick3DAudioRoom::setBackMaterial(), QQuick3DAudioRoom::setCeilingMaterial(), QQuick3DAudioRoom::setFloorMaterial(), QQuick3DAudioRoom::setFrontMaterial(), QQuick3DAudioRoom::setLeftMaterial(), and QQuick3DAudioRoom::setRightMaterial().
QAudioRoom::Material QAudioRoom::wallMaterial | ( | Wall | wall | ) | const |
returns the material being used for wall.
Definition at line 292 of file qaudioroom.cpp.
References QAudioRoomPrivate::roomProperties.
Referenced by QQuick3DAudioRoom::backMaterial(), QQuick3DAudioRoom::ceilingMaterial(), QQuick3DAudioRoom::floorMaterial(), QQuick3DAudioRoom::frontMaterial(), QQuick3DAudioRoom::leftMaterial(), and QQuick3DAudioRoom::rightMaterial().
|
signal |
Signals when the wall material changes.
Referenced by QQuick3DAudioRoom::QQuick3DAudioRoom(), and setWallMaterial().
|
friend |
Definition at line 101 of file qaudioroom.h.
|
readwrite |
Defines the dimensions of the room in 3D space.
Units are in centimeters by default.
Definition at line 105 of file qaudioroom.h.
Referenced by QQuick3DAudioRoom::dimensions().
|
readwrite |
Defines the position of the center of the room in 3D space.
Units are in centimeters by default.
Definition at line 105 of file qaudioroom.h.
|
readwrite |
A gain factor for reflections generated in this room.
A value from 0 to 1 will dampen reflections, while a value larger than 1 will apply a gain to reflections, making them louder.
The default is 1, a factor of 0 disables reflections. Negative values are mapped to 0.
Definition at line 105 of file qaudioroom.h.
Referenced by QQuick3DAudioRoom::reflectionGain().
|
readwrite |
A brightness factor to be applied to the generated reverb.
A positive value will increase reverb for higher frequencies and dampen lower frequencies, a negative value does the reverse.
The default is 0.
Definition at line 105 of file qaudioroom.h.
Referenced by QQuick3DAudioRoom::reverbBrightness().
|
readwrite |
A gain factor for reverb generated in this room.
A value from 0 to 1 will dampen reverb, while a value larger than 1 will apply a gain to the reverb, making it louder.
The default is 1, a factor of 0 disables reverb. Negative values are mapped to 0.
Definition at line 105 of file qaudioroom.h.
Referenced by QQuick3DAudioRoom::reverbGain().
|
readwrite |
A factor to be applies to all reverb timings generated for this room.
Larger values will lead to longer reverb timings, making the room sound larger.
The default is 1. Negative values are mapped to 0.
Definition at line 105 of file qaudioroom.h.
Referenced by QQuick3DAudioRoom::reverbTime().
|
readwrite |
Defines the orientation of the room in 3D space.
Definition at line 105 of file qaudioroom.h.