74class QSoundEffectPrivateWithPlayer
final :
public QObject,
public QSoundEffectPrivate
78 Q_DISABLE_COPY_MOVE(QSoundEffectPrivateWithPlayer)
79 ~QSoundEffectPrivateWithPlayer() override;
84 bool setSource(
const QUrl &, QSampleCache &)
override;
99 void play(std::shared_ptr<QSoundEffectVoice>);
100 void setStatus(QSoundEffect::Status status);
101 [[nodiscard]]
bool updatePlayer(
const SharedSamplePtr &sample);
102 std::optional<VoiceId> activeVoice()
const;
103 static bool formatIsSupported(
const QAudioFormat &);
104 void setResolvedAudioDevice(QAudioDevice device);
105 void resolveAudioDevice();
107 QSoundEffect *q_ptr{};
108 QAudioDevice m_audioDevice;
109 QAudioDevice m_resolvedAudioDevice;
110 std::shared_ptr<QRtAudioEngine> m_player;
111 QMetaObject::Connection m_voiceFinishedConnection;
112 std::set<std::shared_ptr<QSoundEffectVoice>, QRtAudioEngineVoiceCompare> m_voices;
114 void setLoopsRemaining(
int);
115 int m_loopsRemaining{ 0 };
117 std::optional<QFuture<
void>> m_sampleLoadFuture;
119 SharedSamplePtr m_sample;
120 float m_volume = 1.f;
121 bool m_muted =
false;
123 bool m_playPending =
false;
125 QSoundEffect::Status m_status{};
127 QMediaDevices m_mediaDevices;
128 QAudioDevice m_defaultAudioDevice;
129 QChronoTimer m_playerReleaseTimer{
130 std::chrono::seconds(2),