Platform_Win32_Sound_SoundStream_DSound Class Reference

Public Member Functions | |
| Platform_Win32_Sound_SoundStream_DSound (IDirectSound *directSound, int channels, int frequency, int bitsPerSample, int size) | |
| virtual | ~Platform_Win32_Sound_SoundStream_DSound () |
| virtual void | Play () |
| virtual void | Stop () |
| virtual int | GetPosition () |
| virtual void | SetPosition (int position) |
| virtual void | CopySoundToBuffer (int bufferOffset, const void *soundData, int bytesToCopy) |
| virtual void | ClearBuffer (int bufferOffset, int bytesToClear) |
| virtual int | GetChannels () |
| virtual int | GetFrequency () |
| virtual int | GetBitsPerSample () |
| virtual int | GetSize () |
| virtual void | SetVolume (float level) |
| virtual float | GetVolume () |
Detailed Description
Definition at line 22 of file Platform_Win32_Sound_SoundStream_DSound.h.
Constructor & Destructor Documentation
| Platform_Win32_Sound_SoundStream_DSound::Platform_Win32_Sound_SoundStream_DSound | ( | IDirectSound * | directSound, | |
| int | channels, | |||
| int | frequency, | |||
| int | bitsPerSample, | |||
| int | size | |||
| ) |
Definition at line 19 of file Platform_Win32_Sound_SoundStream_DSound.cpp.
| Platform_Win32_Sound_SoundStream_DSound::~Platform_Win32_Sound_SoundStream_DSound | ( | ) | [virtual] |
Definition at line 58 of file Platform_Win32_Sound_SoundStream_DSound.cpp.
Member Function Documentation
| void Platform_Win32_Sound_SoundStream_DSound::Play | ( | ) | [virtual] |
Starts playing the sound stream, from whatever position it is currently at. The stream will keep playing and loop when it's reached the end, until the Stop method is called. The GetPosition method can be called to monitor the current position in the stream, and if looping is not desired, Stop should be called when the position have reached the end of the stream buffer.
Implements Platform_Sound_SoundStream.
Definition at line 67 of file Platform_Win32_Sound_SoundStream_DSound.cpp.
| void Platform_Win32_Sound_SoundStream_DSound::Stop | ( | ) | [virtual] |
Pause the playback, and keeps the position so that the next call to Play will resume from the last point.
Implements Platform_Sound_SoundStream.
Definition at line 78 of file Platform_Win32_Sound_SoundStream_DSound.cpp.
| int Platform_Win32_Sound_SoundStream_DSound::GetPosition | ( | ) | [virtual] |
Retrieves the current position in the sound stream buffer of the playback.
- Returns:
- The current position
Implements Platform_Sound_SoundStream.
Definition at line 89 of file Platform_Win32_Sound_SoundStream_DSound.cpp.
| void Platform_Win32_Sound_SoundStream_DSound::SetPosition | ( | int | position | ) | [virtual] |
Sets the playback position. Must be in the range from 0 to the size of the sound stream buffer. There is no need to call Stop/Play for it to take effect.
Implements Platform_Sound_SoundStream.
Definition at line 102 of file Platform_Win32_Sound_SoundStream_DSound.cpp.
| void Platform_Win32_Sound_SoundStream_DSound::CopySoundToBuffer | ( | int | bufferOffset, | |
| const void * | soundData, | |||
| int | bytesToCopy | |||
| ) | [virtual] |
Copies raw sound data to the sound streams buffer, starting at bufferOffset. The data is copied from the soundData pointer, for a total of bytesToCopy number of bytes. bufferOffset + bytesToClear should be less than the value returned by GetSize. The format of the data is interleaved raw sound samples, as specified by the combination of channels, frequency and bits per sample.
Implements Platform_Sound_SoundStream.
Definition at line 113 of file Platform_Win32_Sound_SoundStream_DSound.cpp.
| void Platform_Win32_Sound_SoundStream_DSound::ClearBuffer | ( | int | bufferOffset, | |
| int | bytesToClear | |||
| ) | [virtual] |
Clears the specified part of the sound streams buffer. bufferOffset + bytesToClear should be less than the value returned by GetSize
Implements Platform_Sound_SoundStream.
Definition at line 154 of file Platform_Win32_Sound_SoundStream_DSound.cpp.
| int Platform_Win32_Sound_SoundStream_DSound::GetChannels | ( | ) | [virtual] |
Retrieves the number of channels this sound stream was created with.
- Returns:
- The number of channels, 1=mono, 2=stereo
Implements Platform_Sound_SoundStream.
Definition at line 193 of file Platform_Win32_Sound_SoundStream_DSound.cpp.
| int Platform_Win32_Sound_SoundStream_DSound::GetFrequency | ( | ) | [virtual] |
Retrieves the frequency (samples per second) this sound stream was created with. Typical values for this is 11025 (11 kHz), 22050 (22 kHz) or 44100 (44 kHz, CD-quality).
- Returns:
- The number of samples per second
Implements Platform_Sound_SoundStream.
Definition at line 201 of file Platform_Win32_Sound_SoundStream_DSound.cpp.
| int Platform_Win32_Sound_SoundStream_DSound::GetBitsPerSample | ( | ) | [virtual] |
Retrieves the number of bits per sample which this sound stream was created with. This is typically 8 or 16 bits.
- Returns:
- The number of bits per sample (typically 8 or 16)
Implements Platform_Sound_SoundStream.
Definition at line 209 of file Platform_Win32_Sound_SoundStream_DSound.cpp.
| int Platform_Win32_Sound_SoundStream_DSound::GetSize | ( | ) | [virtual] |
Retrieves the number of bytes allocated for this sound streams buffer.
- Returns:
- The size of the sound stream buffer in bytes
Implements Platform_Sound_SoundStream.
Definition at line 217 of file Platform_Win32_Sound_SoundStream_DSound.cpp.
| void Platform_Win32_Sound_SoundStream_DSound::SetVolume | ( | float | level | ) | [virtual] |
Sets the current volume level, in the range 0 to 1. This is a linear volume level value, where 0 is silent and 1 is full volume.
Implements Platform_Sound_SoundStream.
Definition at line 239 of file Platform_Win32_Sound_SoundStream_DSound.cpp.
| float Platform_Win32_Sound_SoundStream_DSound::GetVolume | ( | ) | [virtual] |
Retrieves the current volume level, in the range 0 to 1. This is a linear volume level value, where 0 is silent and 1 is full volume.
- Returns:
- The current volume
Implements Platform_Sound_SoundStream.
Definition at line 252 of file Platform_Win32_Sound_SoundStream_DSound.cpp.
Reproduction/republishing of any material on this site without permission is strictly prohibited.
