| 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 | #ifndef QLISTENER_H |
| 4 | #define QLISTENER_H |
| 5 | |
| 6 | #include <QtSpatialAudio/qtspatialaudioglobal.h> |
| 7 | #include <QtCore/QObject> |
| 8 | #include <QtMultimedia/qaudioformat.h> |
| 9 | #include <QtGui/qvector3d.h> |
| 10 | #include <QtGui/qquaternion.h> |
| 11 | |
| 12 | QT_BEGIN_NAMESPACE |
| 13 | |
| 14 | class QAudioEngine; |
| 15 | |
| 16 | class QAudioListenerPrivate; |
| 17 | class Q_SPATIALAUDIO_EXPORT QAudioListener : public QObject |
| 18 | { |
| 19 | public: |
| 20 | explicit QAudioListener(QAudioEngine *engine); |
| 21 | ~QAudioListener() override; |
| 22 | |
| 23 | void setPosition(QVector3D pos); |
| 24 | QVector3D position() const; |
| 25 | void setRotation(const QQuaternion &q); |
| 26 | QQuaternion rotation() const; |
| 27 | |
| 28 | QAudioEngine *engine() const; |
| 29 | |
| 30 | private: |
| 31 | void setEngine(QAudioEngine *engine); |
| 32 | QAudioListenerPrivate *d = nullptr; |
| 33 | }; |
| 34 | |
| 35 | QT_END_NAMESPACE |
| 36 | |
| 37 | #endif |
| 38 | |