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
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 () override
 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 isQmlObjectType () const
 Returns whether the object has been created by the QML engine or ownership has been explicitly set via QJSEngine::setObjectOwnership().
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

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 18 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 32 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 59 of file qaudioroom.h.

Constructor & Destructor Documentation

◆ QAudioRoom()

QAudioRoom::QAudioRoom ( QAudioEngine * engine)
explicit

Constructs a QAudioRoom for engine.

Definition at line 130 of file qaudioroom.cpp.

◆ ~QAudioRoom()

QAudioRoom::~QAudioRoom ( )
override

Destroys the room.

Definition at line 142 of file qaudioroom.cpp.

Member Function Documentation

◆ dimensions()

QVector3D QAudioRoom::dimensions ( ) const

Definition at line 244 of file qaudioroom.cpp.

◆ dimensionsChanged

void QAudioRoom::dimensionsChanged ( )
signal

◆ position()

QVector3D QAudioRoom::position ( ) const

Definition at line 215 of file qaudioroom.cpp.

◆ positionChanged

void QAudioRoom::positionChanged ( )
signal

◆ reflectionGain()

float QAudioRoom::reflectionGain ( ) const

Definition at line 338 of file qaudioroom.cpp.

◆ reflectionGainChanged

void QAudioRoom::reflectionGainChanged ( )
signal

◆ reverbBrightness()

float QAudioRoom::reverbBrightness ( ) const

Definition at line 423 of file qaudioroom.cpp.

◆ reverbBrightnessChanged

void QAudioRoom::reverbBrightnessChanged ( )
signal

◆ reverbGain()

float QAudioRoom::reverbGain ( ) const

Definition at line 367 of file qaudioroom.cpp.

◆ reverbGainChanged

void QAudioRoom::reverbGainChanged ( )
signal

◆ reverbTime()

float QAudioRoom::reverbTime ( ) const

Definition at line 396 of file qaudioroom.cpp.

◆ reverbTimeChanged

void QAudioRoom::reverbTimeChanged ( )
signal

◆ rotation()

QQuaternion QAudioRoom::rotation ( ) const

Definition at line 270 of file qaudioroom.cpp.

◆ rotationChanged

void QAudioRoom::rotationChanged ( )
signal

◆ setDimensions()

void QAudioRoom::setDimensions ( QVector3D dim)

Definition at line 232 of file qaudioroom.cpp.

◆ setPosition()

void QAudioRoom::setPosition ( QVector3D pos)

Definition at line 203 of file qaudioroom.cpp.

◆ setReflectionGain()

void QAudioRoom::setReflectionGain ( float factor)

Definition at line 325 of file qaudioroom.cpp.

◆ setReverbBrightness()

void QAudioRoom::setReverbBrightness ( float factor)

Definition at line 412 of file qaudioroom.cpp.

◆ setReverbGain()

void QAudioRoom::setReverbGain ( float factor)

Definition at line 354 of file qaudioroom.cpp.

◆ setReverbTime()

void QAudioRoom::setReverbTime ( float factor)

Definition at line 383 of file qaudioroom.cpp.

◆ setRotation()

void QAudioRoom::setRotation ( const QQuaternion & q)

Definition at line 259 of file qaudioroom.cpp.

◆ 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 290 of file qaudioroom.cpp.

◆ wallMaterial()

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

returns the material being used for wall.

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

Definition at line 309 of file qaudioroom.cpp.

◆ wallsChanged

void QAudioRoom::wallsChanged ( )
signal

Signals when the wall material changes.

Property Documentation

◆ dimensions

QVector3D 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 22 of file qaudioroom.h.

◆ position

QVector3D 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 21 of file qaudioroom.h.

◆ reflectionGain

float 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 24 of file qaudioroom.h.

◆ reverbBrightness

float 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 27 of file qaudioroom.h.

◆ reverbGain

float 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 25 of file qaudioroom.h.

◆ reverbTime

float 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 26 of file qaudioroom.h.

◆ rotation

QQuaternion QAudioRoom::rotation
readwrite

Defines the orientation of the room in 3D space.

Definition at line 23 of file qaudioroom.h.


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