Platform_NULL_Sound_SoundStream Class Reference

Public Member Functions | |
| Platform_NULL_Sound_SoundStream (int channels, int frequency, int bitsPerSample, int size) | |
| 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 | Update () |
| virtual void | SetVolume (float level) |
| virtual float | GetVolume () |
Public Attributes | |
| int | channels_ |
| int | frequency_ |
| int | bitsPerSample_ |
| int | size_ |
Detailed Description
Definition at line 21 of file Platform_NULL_Sound_SoundStream.h.
Constructor & Destructor Documentation
| Platform_NULL_Sound_SoundStream::Platform_NULL_Sound_SoundStream | ( | int | channels, | |
| int | frequency, | |||
| int | bitsPerSample, | |||
| int | size | |||
| ) |
Definition at line 8 of file Platform_NULL_Sound_SoundStream.cpp.
Member Function Documentation
| void Platform_NULL_Sound_SoundStream::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 18 of file Platform_NULL_Sound_SoundStream.cpp.
| void Platform_NULL_Sound_SoundStream::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 25 of file Platform_NULL_Sound_SoundStream.cpp.
| int Platform_NULL_Sound_SoundStream::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 32 of file Platform_NULL_Sound_SoundStream.cpp.
| void Platform_NULL_Sound_SoundStream::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 40 of file Platform_NULL_Sound_SoundStream.cpp.
| void Platform_NULL_Sound_SoundStream::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 47 of file Platform_NULL_Sound_SoundStream.cpp.
| void Platform_NULL_Sound_SoundStream::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 54 of file Platform_NULL_Sound_SoundStream.cpp.
| int Platform_NULL_Sound_SoundStream::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 61 of file Platform_NULL_Sound_SoundStream.cpp.
| int Platform_NULL_Sound_SoundStream::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 69 of file Platform_NULL_Sound_SoundStream.cpp.
| int Platform_NULL_Sound_SoundStream::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 77 of file Platform_NULL_Sound_SoundStream.cpp.
| int Platform_NULL_Sound_SoundStream::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 85 of file Platform_NULL_Sound_SoundStream.cpp.
| virtual void Platform_NULL_Sound_SoundStream::Update | ( | ) | [virtual] |
| void Platform_NULL_Sound_SoundStream::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 93 of file Platform_NULL_Sound_SoundStream.cpp.
| float Platform_NULL_Sound_SoundStream::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 100 of file Platform_NULL_Sound_SoundStream.cpp.
Member Data Documentation
Definition at line 50 of file Platform_NULL_Sound_SoundStream.h.
Definition at line 51 of file Platform_NULL_Sound_SoundStream.h.
Definition at line 52 of file Platform_NULL_Sound_SoundStream.h.
Definition at line 53 of file Platform_NULL_Sound_SoundStream.h.
Reproduction/republishing of any material on this site without permission is strictly prohibited.
