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
QAudioRoom Class Reference

\inmodule QtSpatialAudio More...

#include <qaudioroom.h>

+ Inheritance diagram for QAudioRoom:
+ Collaboration diagram for QAudioRoom:

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 ()
 
- Signals inherited from QObject
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
 
- Public Member Functions inherited from QObject
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< QStringbindableObjectName ()
 
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).
 
QThreadthread () const
 Returns the thread in which the object lives.
 
bool moveToThread (QThread *thread QT6_DECL_NEW_OVERLOAD_TAIL)
 Changes the thread affinity for this object and its children and returns true on success.
 
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::nanoseconds time, Qt::TimerType timerType=Qt::CoarseTimer)
 
void killTimer (int id)
 Kills the timer with timer identifier, id.
 
void killTimer (Qt::TimerId id)
 
template<typename T >
findChild (QAnyStringView aName, 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 (QAnyStringView 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 >
findChild (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.
 
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 QObjectListchildren () 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< QByteArraydynamicPropertyNames () const
 
QBindingStoragebindingStorage ()
 
const QBindingStoragebindingStorage () const
 
QObjectparent () 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.
 
- Properties inherited from QObject
QString objectName
 the name of this object
 

Friends

class QAudioRoomPrivate
 

Additional Inherited Members

- Public Slots inherited from QObject
void deleteLater ()
 \threadsafe
 
- Static Public Member Functions inherited from QObject
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)
 
- Protected Member Functions inherited from QObject
QObjectsender () 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)
 
- Protected Attributes inherited from QObject
QScopedPointer< QObjectDatad_ptr
 

Detailed Description

\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.

Member Enumeration Documentation

◆ 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

Enumerator
Transparent 
AcousticCeilingTiles 
BrickBare 
BrickPainted 
ConcreteBlockCoarse 
ConcreteBlockPainted 
CurtainHeavy 
FiberGlassInsulation 
GlassThin 
GlassThick 
Grass 
LinoleumOnConcrete 
Marble 
Metal 
ParquetOnConcrete 
PlasterRough 
PlasterSmooth 
PlywoodPanel 
PolishedConcreteOrTile 
Sheetrock 
WaterOrIceSurface 
WoodCeiling 
WoodPanel 
UniformMaterial 

Definition at line 30 of file qaudioroom.h.

◆ 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.

Constructor & Destructor Documentation

◆ QAudioRoom()

QAudioRoom::QAudioRoom ( QAudioEngine * engine)
explicit

Constructs a QAudioRoom for engine.

Definition at line 124 of file qaudioroom.cpp.

References engine, QAudioRoomPrivate::engine, QAudioEnginePrivate::get(), and Q_ASSERT.

+ Here is the call graph for this function:

◆ ~QAudioRoom()

QAudioRoom::~QAudioRoom ( )

Destroys the room.

Definition at line 136 of file qaudioroom.cpp.

References QAudioRoomPrivate::engine, and QAudioEnginePrivate::get().

+ Here is the call graph for this function:

Member Function Documentation

◆ dimensions()

QVector3D QAudioRoom::dimensions ( ) const

Definition at line 235 of file qaudioroom.cpp.

References QAudioRoomPrivate::engine, QAudioEnginePrivate::get(), and QAudioRoomPrivate::roomProperties.

+ Here is the call graph for this function:

◆ dimensionsChanged

void QAudioRoom::dimensionsChanged ( )
signal

Referenced by QQuick3DAudioRoom::QQuick3DAudioRoom(), and setDimensions().

+ Here is the caller graph for this function:

◆ position()

QVector3D QAudioRoom::position ( ) const

Definition at line 208 of file qaudioroom.cpp.

References QAudioRoomPrivate::engine, QAudioEnginePrivate::get(), pos, and QAudioRoomPrivate::roomProperties.

+ Here is the call graph for this function:

◆ positionChanged

void QAudioRoom::positionChanged ( )
signal

Referenced by setPosition().

+ Here is the caller graph for this function:

◆ reflectionGain()

float QAudioRoom::reflectionGain ( ) const

Definition at line 318 of file qaudioroom.cpp.

References QAudioRoomPrivate::roomProperties.

◆ reflectionGainChanged

void QAudioRoom::reflectionGainChanged ( )
signal

Referenced by QQuick3DAudioRoom::QQuick3DAudioRoom(), and setReflectionGain().

+ Here is the caller graph for this function:

◆ reverbBrightness()

float QAudioRoom::reverbBrightness ( ) const

Definition at line 392 of file qaudioroom.cpp.

References QAudioRoomPrivate::roomProperties.

◆ reverbBrightnessChanged

void QAudioRoom::reverbBrightnessChanged ( )
signal

Referenced by QQuick3DAudioRoom::QQuick3DAudioRoom(), and setReverbBrightness().

+ Here is the caller graph for this function:

◆ reverbGain()

float QAudioRoom::reverbGain ( ) const

Definition at line 344 of file qaudioroom.cpp.

References QAudioRoomPrivate::roomProperties.

◆ reverbGainChanged

void QAudioRoom::reverbGainChanged ( )
signal

Referenced by QQuick3DAudioRoom::QQuick3DAudioRoom(), and setReverbGain().

+ Here is the caller graph for this function:

◆ reverbTime()

float QAudioRoom::reverbTime ( ) const

Definition at line 369 of file qaudioroom.cpp.

References QAudioRoomPrivate::roomProperties.

◆ reverbTimeChanged

void QAudioRoom::reverbTimeChanged ( )
signal

Referenced by QQuick3DAudioRoom::QQuick3DAudioRoom(), and setReverbTime().

+ Here is the caller graph for this function:

◆ rotation()

QQuaternion QAudioRoom::rotation ( ) const

Definition at line 257 of file qaudioroom.cpp.

References QAudioRoomPrivate::roomProperties.

◆ rotationChanged

void QAudioRoom::rotationChanged ( )
signal

Referenced by QQuick3DAudioRoom::QQuick3DAudioRoom(), and setRotation().

+ Here is the caller graph for this function:

◆ setDimensions()

void QAudioRoom::setDimensions ( QVector3D dim)

Definition at line 224 of file qaudioroom.cpp.

References dimensionsChanged(), QAudioRoomPrivate::dirty, emit, QAudioRoomPrivate::engine, QAudioEnginePrivate::get(), and QAudioRoomPrivate::roomProperties.

Referenced by QQuick3DAudioRoom::setDimensions().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setPosition()

void QAudioRoom::setPosition ( QVector3D pos)

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setReflectionGain()

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setReverbBrightness()

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setReverbGain()

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setReverbTime()

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setRotation()

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setWallMaterial()

void QAudioRoom::setWallMaterial ( Wall wall,
Material material )

Sets wall to material.

Different wall materials have different reflection and reverb properties that influence the sound of the room.

See also
wallMaterial(), Material, QAudioRoom::Wall

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ wallMaterial()

QAudioRoom::Material QAudioRoom::wallMaterial ( Wall wall) const

returns the material being used for wall.

See also
setWallMaterial(), Material, QAudioRoom::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().

+ Here is the caller graph for this function:

◆ wallsChanged

void QAudioRoom::wallsChanged ( )
signal

Signals when the wall material changes.

Referenced by QQuick3DAudioRoom::QQuick3DAudioRoom(), and setWallMaterial().

+ Here is the caller graph for this function:

Friends And Related Symbol Documentation

◆ QAudioRoomPrivate

friend class QAudioRoomPrivate
friend

Definition at line 101 of file qaudioroom.h.

Property Documentation

◆ dimensions

QAudioRoom::dimensions
readwrite

Defines the dimensions of the room in 3D space.

Units are in centimeters by default.

See also
position, QAudioEngine::distanceScale

Definition at line 20 of file qaudioroom.h.

Referenced by QQuick3DAudioRoom::dimensions().

◆ position

QAudioRoom::position
readwrite

Defines the position of the center of the room in 3D space.

Units are in centimeters by default.

See also
dimensions, QAudioEngine::distanceScale

Definition at line 19 of file qaudioroom.h.

◆ reflectionGain

QAudioRoom::reflectionGain
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 22 of file qaudioroom.h.

Referenced by QQuick3DAudioRoom::reflectionGain().

◆ reverbBrightness

QAudioRoom::reverbBrightness
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 25 of file qaudioroom.h.

Referenced by QQuick3DAudioRoom::reverbBrightness().

◆ reverbGain

QAudioRoom::reverbGain
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 23 of file qaudioroom.h.

Referenced by QQuick3DAudioRoom::reverbGain().

◆ reverbTime

QAudioRoom::reverbTime
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 24 of file qaudioroom.h.

Referenced by QQuick3DAudioRoom::reverbTime().

◆ rotation

QAudioRoom::rotation
readwrite

Defines the orientation of the room in 3D space.

Definition at line 21 of file qaudioroom.h.


The documentation for this class was generated from the following files: