Om  1.0.0
A universal framework for multimedia simulation
Public Member Functions | Protected Member Functions | List of all members
om::sound::base::SoundCallbackStream Class Reference

A class that wraps a function callback source of sound samples as a SoundInputStream. More...

#include <omSoundCallbackStream.h>

Inheritance diagram for om::sound::base::SoundCallbackStream:
om::sound::base::SoundInputStream

Public Member Functions

 SoundCallbackStream (const SoundCallback &newCallback)
 Create a new sound data input stream that wraps the specified sound stream and data stream. More...
 
const SoundCallbackgetCallback () const
 Return a reference to the function callback object that this stream is wrapping. More...
 
void setCallback (const SoundCallback &newCallback)
 Set a reference to the function callback object that this stream is wrapping. More...
 
virtual Bool canSeek () const
 Return whether or not seeking is allowed in this input stream. More...
 
virtual Bool canSeek (Int64 relativeSampleOffset) const
 Return whether or not this stream's current position can be moved by the specified signed sample offset. More...
 
virtual Int64 seek (Int64 relativeSampleOffset)
 Move the current sample frame position in the stream by the specified signed amount. More...
 
virtual SoundSize getSamplesRemaining () const
 Return the number of samples remaining in the sound input stream. More...
 
virtual SampleIndex getPosition () const
 Return the current position of the stream in samples relative to the start of the stream. More...
 
virtual Size getChannelCount () const
 Return the number of channels that are in the sound input stream. More...
 
virtual SampleRate getSampleRate () const
 Return the sample rate of the sound input stream's source audio data. More...
 
virtual SampleType getNativeSampleType () const
 Return the actual sample type used in the stream. More...
 
virtual Bool isValid () const
 Return whether or not the stream has a valid source of sound data. More...
 
- Public Member Functions inherited from om::sound::base::SoundInputStream
virtual ~SoundInputStream ()
 Destroy this sound input stream and release any resources associated with it. More...
 
SoundResult read (SoundBuffer &buffer, Size numSamples)
 Read the specified number of samples from the input stream into a sound buffer. More...
 
Bool hasSamplesRemaining () const
 Return whether or not this sound input stream has any samples remaining in the stream. More...
 

Protected Member Functions

virtual SoundResult readSamples (SoundBuffer &inputBuffer, Size numSamples)
 Read the specified number of samples from the callback into the output buffer. More...
 

Detailed Description

A class that wraps a function callback source of sound samples as a SoundInputStream.

This class is provided so that external sound systems can easily interface with the SoundInputStream interface. The callback stream does not support seeking within the stream.

Constructor & Destructor Documentation

om::sound::base::SoundCallbackStream::SoundCallbackStream ( const SoundCallback newCallback)
inline

Create a new sound data input stream that wraps the specified sound stream and data stream.

Member Function Documentation

const SoundCallback& om::sound::base::SoundCallbackStream::getCallback ( ) const
inline

Return a reference to the function callback object that this stream is wrapping.

void om::sound::base::SoundCallbackStream::setCallback ( const SoundCallback newCallback)
inline

Set a reference to the function callback object that this stream is wrapping.

virtual Bool om::sound::base::SoundCallbackStream::canSeek ( ) const
virtual

Return whether or not seeking is allowed in this input stream.

Reimplemented from om::sound::base::SoundInputStream.

virtual Bool om::sound::base::SoundCallbackStream::canSeek ( Int64  relativeSampleOffset) const
virtual

Return whether or not this stream's current position can be moved by the specified signed sample offset.

Reimplemented from om::sound::base::SoundInputStream.

virtual Int64 om::sound::base::SoundCallbackStream::seek ( Int64  relativeSampleOffset)
virtual

Move the current sample frame position in the stream by the specified signed amount.

Reimplemented from om::sound::base::SoundInputStream.

virtual SoundSize om::sound::base::SoundCallbackStream::getSamplesRemaining ( ) const
virtual

Return the number of samples remaining in the sound input stream.

Implements om::sound::base::SoundInputStream.

virtual SampleIndex om::sound::base::SoundCallbackStream::getPosition ( ) const
virtual

Return the current position of the stream in samples relative to the start of the stream.

Implements om::sound::base::SoundInputStream.

virtual Size om::sound::base::SoundCallbackStream::getChannelCount ( ) const
virtual

Return the number of channels that are in the sound input stream.

Implements om::sound::base::SoundInputStream.

virtual SampleRate om::sound::base::SoundCallbackStream::getSampleRate ( ) const
virtual

Return the sample rate of the sound input stream's source audio data.

Implements om::sound::base::SoundInputStream.

virtual SampleType om::sound::base::SoundCallbackStream::getNativeSampleType ( ) const
virtual

Return the actual sample type used in the stream.

Implements om::sound::base::SoundInputStream.

virtual Bool om::sound::base::SoundCallbackStream::isValid ( ) const
virtual

Return whether or not the stream has a valid source of sound data.

Implements om::sound::base::SoundInputStream.

virtual SoundResult om::sound::base::SoundCallbackStream::readSamples ( SoundBuffer inputBuffer,
Size  numSamples 
)
protectedvirtual

Read the specified number of samples from the callback into the output buffer.

Implements om::sound::base::SoundInputStream.


The documentation for this class was generated from the following file: