Gnash  0.8.11dev
Protected Member Functions | List of all members
gnash::sound::LiveSound Class Referenceabstract

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

Protected Member Functions

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

Additional Inherited Members

- Public Member Functions inherited from gnash::sound::InputStream
virtual ~InputStream ()
 

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

§ LiveSound()

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.

References gnash::media::CODEC_TYPE_FLASH, gnash::media::MediaHandler::createAudioDecoder(), data, decodedSamplesAhead(), getDecodedData(), gnash::media::SoundInfo::getFormat(), gnash::media::SoundInfo::getSampleRate(), gnash::media::SoundInfo::is16bit(), gnash::media::SoundInfo::isStereo(), and moreData().

Member Function Documentation

§ appendDecodedData()

void gnash::sound::LiveSound::appendDecodedData ( std::uint8_t *  data,
unsigned int  size 
)
inlineprotected

§ decodedSamplesAhead()

unsigned int gnash::sound::LiveSound::decodedSamplesAhead ( ) const
inlineprotected

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

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

§ decoder()

media::AudioDecoder& gnash::sound::LiveSound::decoder ( ) const
inlineprotected

§ eof()

virtual bool gnash::sound::LiveSound::eof ( ) const
protectedpure 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.

§ getDecodedData()

const std::int16_t* gnash::sound::LiveSound::getDecodedData ( unsigned long int  pos) const
inlineprotected

Referenced by LiveSound().

§ moreData()

virtual bool gnash::sound::LiveSound::moreData ( )
protectedpure 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.

Referenced by LiveSound().

§ playbackPosition()

size_t gnash::sound::LiveSound::playbackPosition ( ) const
inlineprotected

§ restart()

void gnash::sound::LiveSound::restart ( )
inlineprotected

Start from the beginning again.

Referenced by gnash::sound::EmbedSoundInst::EmbedSoundInst().

§ samplesFetched()

unsigned int gnash::sound::LiveSound::samplesFetched ( ) const
inlineprotectedvirtual

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: