Gnash
0.8.10
|
Instance of a defined sound (LiveSoundData) More...
#include <LiveSound.h>
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::AudioDecoder & | decoder () const |
void | appendDecodedData (boost::uint8_t *data, unsigned int size) |
unsigned int | decodedSamplesAhead () const |
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.
gnash::sound::LiveSound::LiveSound | ( | media::MediaHandler & | mh, |
const media::SoundInfo & | info, | ||
size_t | inPoint | ||
) | [protected] |
Create an embedded sound instance.
mh | The MediaHandler to use for on-demand decoding |
inPoint | Offset in output samples this instance should start playing from. These are post-resampling samples (44100 for one second of samples). |
info | The media::SoundInfo for this sound. |
void gnash::sound::LiveSound::appendDecodedData | ( | boost::uint8_t * | data, |
unsigned int | size | ||
) | [inline, protected] |
References gnash::SimpleBuffer::append(), and data.
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] |
References assert, gnash::SimpleBuffer::size(), and gnash::SimpleBuffer::data().
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.