25#ifndef SFML_SOUNDSTREAM_HPP
26#define SFML_SOUNDSTREAM_HPP
205 void initialize(
unsigned int channelCount,
unsigned int sampleRate);
261 bool fillAndPushBuffer(
unsigned int bufferNum);
291 mutable Mutex m_threadMutex;
292 Status m_threadStartState;
294 unsigned int m_buffers[BufferCount];
295 unsigned int m_channelCount;
296 unsigned int m_sampleRate;
299 Uint64 m_samplesProcessed;
300 bool m_endBuffers[BufferCount];
Blocks concurrent access to shared resources from multiple threads.
Status
Enumeration of the sound source states.
SoundSource(const SoundSource ©)
Copy constructor.
void stop()
Stop playing the audio stream.
unsigned int getChannelCount() const
Return the number of channels of the stream.
virtual ~SoundStream()
Destructor.
void setLoop(bool loop)
Set whether or not the stream should loop after reaching the end.
bool getLoop() const
Tell whether or not the stream is in loop mode.
Status getStatus() const
Get the current status of the stream (stopped, paused, playing).
SoundStream()
Default constructor.
unsigned int getSampleRate() const
Get the stream sample rate of the stream.
virtual void onSeek(Time timeOffset)=0
Change the current playing position in the stream source.
void pause()
Pause the audio stream.
virtual bool onGetData(Chunk &data)=0
Request a new chunk of audio samples from the stream source.
void initialize(unsigned int channelCount, unsigned int sampleRate)
Define the audio stream parameters.
Time getPlayingOffset() const
Get the current playing position of the stream.
void setPlayingOffset(Time timeOffset)
Change the current playing position of the stream.
void play()
Start or resume playing the audio stream.
Utility class to manipulate threads.
unsigned long long Uint64
Structure defining a chunk of audio data to stream.
const Int16 * samples
Pointer to the audio samples.
std::size_t sampleCount
Number of samples pointed by Samples.