Definition of an embedded sound. More...
#include <EmbedSound.h>
Public Types | |
| typedef std::list < EmbedSoundInst * > | Instances |
| Vector containing the active instances of this sounds being played. | |
Public Member Functions | |
| EmbedSound (std::auto_ptr< SimpleBuffer > data, const media::SoundInfo &info, int volume) | |
| Construct a sound with given data, info and volume. | |
| ~EmbedSound () | |
| size_t | size () const |
| Return size of the data buffer. | |
| bool | empty () const |
| Is the data buffer empty ? | |
| const boost::uint8_t * | data () const |
| Return a pointer to the underlying buffer. | |
| const boost::uint8_t * | data (size_t pos) const |
| Return a pointer to an offset in the underlying buffer. | |
| bool | isPlaying () const |
| Are there known playing instances of this sound ? | |
| size_t | numPlayingInstances () const |
| Return number of playing instances of this sound. | |
| void | getPlayingInstances (std::vector< InputStream * > &to) const |
| Append to the given vector all playing instances of this sound def. | |
| EmbedSoundInst * | firstPlayingInstance () const |
| Return the first created instance of this sound. | |
| std::auto_ptr< EmbedSoundInst > | createInstance (media::MediaHandler &mh, unsigned int inPoint, unsigned int outPoint, const SoundEnvelopes *envelopes, unsigned int loopCount) |
| Create an instance of this sound. | |
| void | clearInstances () |
| Drop all active sounds. | |
| Instances::iterator | eraseActiveSound (Instances::iterator i) |
| Drop an active sound (by iterator). | |
| void | eraseActiveSound (EmbedSoundInst *inst) |
| Drop an active sound (by pointer). | |
Public Attributes | |
| media::SoundInfo | soundinfo |
| Object holding information about the sound. | |
| int | volume |
Definition of an embedded sound.
| typedef std::list<EmbedSoundInst*> gnash::sound::EmbedSound::Instances |
Vector containing the active instances of this sounds being played.
NOTE: This class does NOT own the active sounds
| gnash::sound::EmbedSound::EmbedSound | ( | std::auto_ptr< SimpleBuffer > | data, | |
| const media::SoundInfo & | info, | |||
| int | volume | |||
| ) |
| gnash::sound::EmbedSound::~EmbedSound | ( | ) |
| void gnash::sound::EmbedSound::clearInstances | ( | ) |
Drop all active sounds.
Locks _soundInstancesMutex
References _buf.
Referenced by eraseActiveSound().
| std::auto_ptr< EmbedSoundInst > gnash::sound::EmbedSound::createInstance | ( | media::MediaHandler & | mh, | |
| unsigned int | inPoint, | |||
| unsigned int | outPoint, | |||
| const SoundEnvelopes * | envelopes, | |||
| unsigned int | loopCount | |||
| ) |
Create an instance of this sound.
The returned instance ownership is transferred
| 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 from the start of the specified blockId. | |
| outPoint | Offset in output samples this instance should stop playing at. These are post-resampling samples from the start of the specified blockId. | |
| envelopes | SoundEnvelopes to apply to this sound. May be 0 for none. | |
| loopCount | Number of times this instance should loop over the defined sound. |
| const boost::uint8_t* gnash::sound::EmbedSound::data | ( | size_t | pos | ) | const [inline] |
| const boost::uint8_t* gnash::sound::EmbedSound::data | ( | ) | const [inline] |
Return a pointer to the underlying buffer.
Referenced by gnash::sound::EmbedSoundInst::EmbedSoundInst().
| bool gnash::sound::EmbedSound::empty | ( | ) | const [inline] |
Is the data buffer empty ?
| EmbedSound::Instances::iterator gnash::sound::EmbedSound::eraseActiveSound | ( | Instances::iterator | i | ) |
Drop an active sound (by iterator).
Does *NOT* lock the _soundInstancesMutex
| void gnash::sound::EmbedSound::eraseActiveSound | ( | EmbedSoundInst * | inst | ) |
Drop an active sound (by pointer).
| inst | The active sound instance to unregister |
This is intended to be called by EmbedSoundInst destructor, which may be called by a separate thread so MUST be thread-safe
Does lock the _soundInstancesMutex
References clearInstances().
| EmbedSoundInst * gnash::sound::EmbedSound::firstPlayingInstance | ( | ) | const |
Return the first created instance of this sound.
Locks _soundInstancesMutex
| void gnash::sound::EmbedSound::getPlayingInstances | ( | std::vector< InputStream * > & | to | ) | const |
Append to the given vector all playing instances of this sound def.
| bool gnash::sound::EmbedSound::isPlaying | ( | ) | const |
Are there known playing instances of this sound ?
Locks _soundInstancesMutex
| size_t gnash::sound::EmbedSound::numPlayingInstances | ( | ) | const |
Return number of playing instances of this sound.
Locks _soundInstancesMutex
| size_t gnash::sound::EmbedSound::size | ( | ) | const [inline] |
Return size of the data buffer.
Referenced by data(), and gnash::sound::EmbedSoundInst::EmbedSoundInst().
Object holding information about the sound.
Referenced by gnash::sound::EmbedSoundInst::EmbedSoundInst().
Volume for AS-sounds, range: 0-100. It's the SWF range that is represented here.
Referenced by gnash::sound::EmbedSoundInst::EmbedSoundInst().
1.7.1