26 public QSoundEffectPrivate
28 struct AudioSinkDeleter
30 void operator()(QAudioSink *sink)
const;
34 QSoundEffectPrivateSynchronous(QSoundEffect *q,
const QAudioDevice &audioDevice);
35 ~QSoundEffectPrivateSynchronous() override;
37 qint64 readData(
char *data, qint64 len) override;
38 qint64 writeData(
const char *data, qint64 len) override;
39 qint64 size()
const override;
40 qint64 bytesAvailable()
const override;
41 bool isSequential()
const override;
42 bool atEnd()
const override;
44 void setLoopsRemaining(
int loopsRemaining);
45 void setStatus(QSoundEffect::Status status);
46 void setPlaying(
bool playing);
47 bool updateAudioOutput();
50 void sampleReady(SharedSamplePtr);
52 int loopCount()
const override;
53 bool setLoopCount(
int loopCount) override;
55 int loopsRemaining()
const override;
56 float volume()
const override;
57 bool setVolume(
float volume) override;
59 bool muted()
const override;
60 bool setMuted(
bool muted) override;
65 bool playing()
const override;
67 bool setAudioDevice(QAudioDevice device) override;
69 bool setSource(
const QUrl &url, QSampleCache &sampleCache) override;
71 QSoundEffect::Status status()
const override;
72 QUrl url()
const override;
73 QAudioDevice audioDevice()
const override;
76 void stateChanged(QAudio::State);
79 QAudioDevice m_audioDevice;
82 int m_runningCount = 0;
83 bool m_playing =
false;
84 std::unique_ptr<QAudioSink, AudioSinkDeleter> m_audioSink;
85 SharedSamplePtr m_sample;
86 QAudioBuffer m_audioBuffer;
91 QFuture<
void> m_sampleLoadFuture;
93 QSoundEffect::Status m_status = QSoundEffect::Null;
94 bool m_sampleReady =
false;