|
coastline 0.0.4
|
A buffer of samples the mixer plays, as a secondary buffer of DirectSound plays in the original. More...
#include <sdlmixer.h>
Public Member Functions | |
| void | Release () |
| Remove the buffer from the mix and delete it. | |
| 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 | Play (bool looping) |
| Start the buffer from its play cursor. | |
| void | Stop () |
| Stop the buffer, leaving its play cursor where it is. | |
| bool | IsPlaying () const |
| std::uint32_t | GetPlayCursor () const |
| bool | SetPlayCursor (std::uint32_t offset) |
| Move the play cursor. | |
| 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 | SetPan (LONG pan) |
| Change stereo pan within the device-compatible range; out-of-range requests are ignored. | |
| void | MixInto (float *mix, int frames) |
| Add the frames the buffer plays next to a mix. | |
Static Public Member Functions | |
| static EarSdlVoice * | Create (const EarWaveFormat &format, std::uint32_t bytes) |
| Create a silent, stopped buffer and add it to the mix. | |
A buffer of samples the mixer plays, as a secondary buffer of DirectSound plays in the original.
The volume and the pan take the units of DirectSound, hundredths of a decibel, and a value outside the range of DirectSound is rejected as DirectSound rejects it.
|
static |
Create a silent, stopped buffer and add it to the mix.
| format | The format of the samples, 8-bit or 16-bit PCM of one or two channels. |
| bytes | The bytes of the buffer. |
| void EarSdlVoice::Release | ( | ) |
Remove the buffer from the mix and delete it.
| void EarSdlVoice::Write | ( | std::uint32_t | offset, |
| const void * | data, | ||
| std::uint32_t | bytes ) |
Copy samples into the buffer, continuing at its start past its end.
| offset | The offset in the buffer, in bytes. |
| data | The samples. |
| bytes | The bytes of the samples. |
| void EarSdlVoice::Play | ( | bool | looping | ) |
Start the buffer from its play cursor.
| looping | Whether the buffer starts again at its end. |
| void EarSdlVoice::Stop | ( | ) |
Stop the buffer, leaving its play cursor where it is.
| bool EarSdlVoice::IsPlaying | ( | ) | const |
| std::uint32_t EarSdlVoice::GetPlayCursor | ( | ) | const |
| bool EarSdlVoice::SetPlayCursor | ( | std::uint32_t | offset | ) |
Move the play cursor.
| offset | The offset, in bytes. |
| void EarSdlVoice::SetFrequency | ( | std::uint32_t | frequency | ) |
Change playback frequency when the requested rate is within the device-compatible range.
Out-of-range requests preserve the previous frequency.
| frequency | The frames a second the buffer plays at, from 100 to 100000. |
| void EarSdlVoice::SetVolume | ( | LONG | volume | ) |
Change volume when the requested attenuation is within the device-compatible range.
Out-of-range requests preserve the previous volume.
| volume | The attenuation, from -10000 to 0 hundredths of a decibel. |
| void EarSdlVoice::SetPan | ( | LONG | pan | ) |
Change stereo pan within the device-compatible range; out-of-range requests are ignored.
| pan | The attenuation of the right side when negative, or of the left side when positive, from -10000 to 10000 hundredths of a decibel. |
| void EarSdlVoice::MixInto | ( | float * | mix, |
| int | frames ) |
Add the frames the buffer plays next to a mix.
| mix | The interleaved stereo mix. |
| frames | The frames of the mix. |