1#ifndef COASTLINE_EAR_SDLMIXER_H
2#define COASTLINE_EAR_SDLMIXER_H
98 EarSdlVoice() =
default;
112 bool playing =
false;
113 bool looping =
false;
std::uint32_t GetPlayCursor() const
void Release()
Remove the buffer from the mix and delete it.
void SetFrequency(std::uint32_t frequency)
Change playback frequency when the requested rate is within the device-compatible range.
void SetVolume(LONG volume)
Change volume when the requested attenuation is within the device-compatible range.
void Write(std::uint32_t offset, const void *data, std::uint32_t bytes)
Copy samples into the buffer, continuing at its start past its end.
void Stop()
Stop the buffer, leaving its play cursor where it is.
void Play(bool looping)
Start the buffer from its play cursor.
void MixInto(float *mix, int frames)
Add the frames the buffer plays next to a mix.
void SetPan(LONG pan)
Change stereo pan within the device-compatible range; out-of-range requests are ignored.
static EarSdlVoice * Create(const EarWaveFormat &format, std::uint32_t bytes)
Create a silent, stopped buffer and add it to the mix.
bool SetPlayCursor(std::uint32_t offset)
Move the play cursor.
constexpr int EAR_MIX_RATE
The frames a second EAR mixes at, the format it gives the primary buffer of DirectSound.
Definition sdlmixer.h:9
void EarSetSdlMixerEnabled(bool enabled)
Enable or suspend sound-effect mixing and playback updates without discarding voices.
bool EarSdlMixerEnabled()
void EarSetSdlMixerOffline(bool offline)
Select whether the mixer renders on request, through EarRenderSdlMixer(), rather than to the default ...
void EarRenderSdlMixer(std::int16_t *samples, int frames)
Mix frames of a mixer that renders on request, and advance its clock by their time.
void EarCloseSdlMixer()
Close the mixer and its device, and delete every buffer.
constexpr int EAR_MIX_CHANNELS
The channels EAR mixes, the format it gives the primary buffer of DirectSound.
Definition sdlmixer.h:11
bool EarOpenSdlMixer()
Open the mixer, and the default playback device unless it renders on request.
WAVEFORMATEX EarWaveFormat
Definition wavechunks.h:23