20 #ifndef SOUND_EMBEDSOUND_H
21 #define SOUND_EMBEDSOUND_H
26 #include <boost/thread/mutex.hpp>
27 #include <boost/scoped_ptr.hpp>
78 const boost::uint8_t*
data()
const {
87 const boost::uint8_t*
data(
size_t pos)
const {
88 assert(pos < _buf->
size());
89 return _buf->data()+pos;
140 unsigned int inPoint,
unsigned int outPoint,
179 boost::scoped_ptr<SimpleBuffer> _buf;
185 Instances _soundInstances;
189 mutable boost::mutex _soundInstancesMutex;
195 #endif // SOUND_EMBEDSOUND_H
Definition of an embedded sound.
Definition: EmbedSound.h:48
Anonymous namespace for callbacks, local functions, event handlers etc.
Definition: dbus_ext.cpp:40
std::list< EmbedSoundInst * > Instances
Vector containing the active instances of this sounds being played.
Definition: EmbedSound.h:55
size_t numPlayingInstances() const
Return number of playing instances of this sound.
Definition: EmbedSound.cpp:104
EmbedSound(std::auto_ptr< SimpleBuffer > data, const media::SoundInfo &info, int volume)
Construct a sound with given data, info and volume.
Definition: EmbedSound.cpp:35
void getPlayingInstances(std::vector< InputStream * > &to) const
Append to the given vector all playing instances of this sound def.
Definition: EmbedSound.cpp:118
const boost::uint8_t * data(size_t pos) const
Return a pointer to an offset in the underlying buffer.
Definition: EmbedSound.h:87
void clearInstances()
Drop all active sounds.
Definition: EmbedSound.cpp:46
std::vector< SoundEnvelope > SoundEnvelopes
A vector of SoundEnvelope objects.
Definition: SoundEnvelope.h:60
const boost::uint8_t * data() const
Return a pointer to the underlying buffer.
Definition: EmbedSound.h:78
bool isPlaying() const
Are there known playing instances of this sound ?
Definition: EmbedSound.cpp:97
Instances::iterator eraseActiveSound(Instances::iterator i)
Drop an active sound (by iterator)
Definition: EmbedSound.cpp:53
bool empty() const
Is the data buffer empty ?
Definition: EmbedSound.h:73
Definition: GnashKey.h:155
std::auto_ptr< EmbedSoundInst > createInstance(media::MediaHandler &mh, unsigned int inPoint, unsigned int outPoint, const SoundEnvelopes *envelopes, int loopCount)
Create an instance of this sound.
Definition: EmbedSound.cpp:60
Instance of a defined sound (EmbedSound)
Definition: EmbedSoundInst.h:45
~EmbedSound()
Definition: EmbedSound.cpp:75
media::SoundInfo soundinfo
Object holding information about the sound.
Definition: EmbedSound.h:170
int volume
Definition: EmbedSound.h:174
size_t size() const
Return size of the data buffer.
Definition: EmbedSound.h:68
EmbedSoundInst * firstPlayingInstance() const
Return the first created instance of this sound.
Definition: EmbedSound.cpp:111