64class QSoundEffectPrivateWithPlayer
final :
public QObject,
public QSoundEffectPrivate
68 Q_DISABLE_COPY_MOVE(QSoundEffectPrivateWithPlayer)
69 ~QSoundEffectPrivateWithPlayer() override;
74 bool setSource(
const QUrl &, QSampleCache &)
override;
89 void play(std::shared_ptr<QSoundEffectVoice>);
90 void setStatus(QSoundEffect::Status status);
91 [[nodiscard]]
bool updatePlayer();
92 std::optional<VoiceId> activeVoice()
const;
93 static bool formatIsSupported(
const QAudioFormat &);
94 void setResolvedAudioDevice(QAudioDevice device);
95 void resolveAudioDevice();
97 QSoundEffect *q_ptr{};
98 QAudioDevice m_audioDevice;
99 QAudioDevice m_resolvedAudioDevice;
100 std::shared_ptr<QRtAudioEngine> m_player;
101 QMetaObject::Connection m_voiceFinishedConnection;
102 std::set<std::shared_ptr<QSoundEffectVoice>, QRtAudioEngineVoiceCompare> m_voices;
104 void setLoopsRemaining(
int);
105 int m_loopsRemaining{ 0 };
107 QFuture<
void> m_sampleLoadFuture;
109 SharedSamplePtr m_sample;
110 float m_volume = 1.f;
111 bool m_muted =
false;
113 bool m_playPending =
false;
115 QSoundEffect::Status m_status{};
117 QMediaDevices m_mediaDevices;
118 QAudioDevice m_defaultAudioDevice;