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
qaudioengine_withplayer_p.h
Go to the documentation of this file.
1// Copyright (C) 2025 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_WITHPLAYER_P_H
5#define QAUDIOENGINE_WITHPLAYER_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
18#include <QtSpatialAudio/private/qtspatialaudioglobal_p.h>
19#include <QtSpatialAudio/private/qaudioengine_p.h>
20#include <QtMultimedia/qaudiodevice.h>
21
22namespace vraudio {
23class ResonanceAudio;
24} // namespace vraudio
25
26QT_BEGIN_NAMESPACE
27
28namespace QtMultimediaPrivate {
29class QRtAudioEngine;
30class QRtAudioEngineVoice;
31} // namespace QtMultimediaPrivate
32
34{
35public:
36 explicit QAudioEngineWithPlayer(int sampleRate);
39
40 void start() override;
41 void stop() override;
42 void setPaused(bool paused) override;
43 bool isPaused() const override;
44 void setOutputDevice(const QAudioDevice &device) override;
45 QAudioDevice outputDevice() const override;
46
47 void addSound(QAmbientSoundPrivate *sound) override;
48 void removeSound(QAmbientSoundPrivate *sound) override;
49 void setSoundPlaybackData(QAmbientSoundPrivate *, SharedPlaybackState) override;
50
53
54 QAudioFormat audioFormat() const { return m_format; }
55
56private:
57 using QRtAudioEngine = QtMultimediaPrivate::QRtAudioEngine;
58 using QRtAudioEngineVoice = QtMultimediaPrivate::QRtAudioEngineVoice;
59
61
62 QAudioDevice m_device;
63 QAudioFormat m_format;
64 std::shared_ptr<QRtAudioEngine> m_playbackEngine;
65 std::shared_ptr<QRtAudioEngineVoice> m_engineVoice;
66 bool m_paused = false;
67
68 std::map<QAmbientSoundPrivate *, SharedPlaybackState> playbackStates;
69};
70
71QT_END_NAMESPACE
72
73#endif
void addSound(QAmbientSoundPrivate *sound) override
void setSoundPlaybackData(QAmbientSoundPrivate *, SharedPlaybackState) override
void setPaused(bool paused) override
void setOutputMode(QAudioEngine::OutputMode) override
void setOutputDevice(const QAudioDevice &device) override
QAudioDevice outputDevice() const override
void removeSound(QAmbientSoundPrivate *sound) override
QResonanceAudioPlayer(QAudioEngineWithPlayer *player, VoiceId id)
void setOutputMode(QAudioEngine::OutputMode mode)
bool isActive() noexcept QT_MM_NONBLOCKING override
void setSoundPlaybackData(SourceId, SharedPlaybackState)
VoicePlayResult play(QSpan< float >) noexcept QT_MM_NONBLOCKING override
QRtAudioEngineVoice overrides.