Gnash  0.8.10
Protected Member Functions
gnash::sound::LiveSound Class Reference

Instance of a defined sound (LiveSoundData) More...

#include <LiveSound.h>

Inheritance diagram for gnash::sound::LiveSound:
gnash::sound::InputStream gnash::sound::EmbedSoundInst gnash::sound::StreamingSound

List of all members.

Protected Member Functions

 LiveSound (media::MediaHandler &mh, const media::SoundInfo &info, size_t inPoint)
 Create an embedded sound instance.
const boost::int16_t * getDecodedData (unsigned long int pos) const
virtual bool moreData ()=0
 Called when more decoded sound data is required.
virtual bool eof () const =0
 True if there is no more data ever.
void restart ()
 Start from the beginning again.
unsigned int samplesFetched () const
 How many samples have been fetched since the beginning.
size_t playbackPosition () const
media::AudioDecoderdecoder () const
void appendDecodedData (boost::uint8_t *data, unsigned int size)
unsigned int decodedSamplesAhead () const

Detailed Description

Instance of a defined sound (LiveSoundData)

This class contains a pointer to the LiveSoundData used for playing and a SimpleBuffer to use when decoding is needed.


Constructor & Destructor Documentation

gnash::sound::LiveSound::LiveSound ( media::MediaHandler mh,
const media::SoundInfo info,
size_t  inPoint 
) [protected]

Create an embedded sound instance.

Parameters:
mhThe MediaHandler to use for on-demand decoding
inPointOffset in output samples this instance should start playing from. These are post-resampling samples (44100 for one second of samples).
infoThe media::SoundInfo for this sound.

Member Function Documentation

void gnash::sound::LiveSound::appendDecodedData ( boost::uint8_t *  data,
unsigned int  size 
) [inline, protected]
unsigned int gnash::sound::LiveSound::decodedSamplesAhead ( ) const [inline, protected]

Return number of already-decoded samples available from playback position on

References gnash::SimpleBuffer::size(), and assert.

Referenced by gnash::sound::EmbedSoundInst::eof(), and gnash::sound::StreamingSound::eof().

media::AudioDecoder& gnash::sound::LiveSound::decoder ( ) const [inline, protected]
virtual bool gnash::sound::LiveSound::eof ( ) const [protected, pure virtual]

True if there is no more data ever.

The InputStream will be disconnected when this is true.

Implements gnash::sound::InputStream.

Implemented in gnash::sound::EmbedSoundInst, and gnash::sound::StreamingSound.

const boost::int16_t* gnash::sound::LiveSound::getDecodedData ( unsigned long int  pos) const [inline, protected]
virtual bool gnash::sound::LiveSound::moreData ( ) [protected, pure virtual]

Called when more decoded sound data is required.

This will be called whenever no more decoded data is available but decoding is not complete.

size_t gnash::sound::LiveSound::playbackPosition ( ) const [inline, protected]
void gnash::sound::LiveSound::restart ( ) [inline, protected]

Start from the beginning again.

unsigned int gnash::sound::LiveSound::samplesFetched ( ) const [inline, protected, virtual]

How many samples have been fetched since the beginning.

Note that this is reset on each loop.

Implements gnash::sound::InputStream.


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