20 #ifndef SOUND_EMBEDSOUND_H
21 #define SOUND_EMBEDSOUND_H
79 const std::uint8_t*
data()
const {
88 const std::uint8_t*
data(
size_t pos)
const {
89 assert(pos < _buf->
size());
90 return _buf->data()+pos;
141 unsigned int inPoint,
unsigned int outPoint,
180 std::unique_ptr<SimpleBuffer> _buf;
186 Instances _soundInstances;
190 mutable std::mutex _soundInstancesMutex;
196 #endif // SOUND_EMBEDSOUND_H
Definition of an embedded sound.
Definition: EmbedSound.h:49
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:56
EmbedSound(std::unique_ptr< SimpleBuffer > data, media::SoundInfo info, int volume)
Construct a sound with given data, info and volume.
Definition: EmbedSound.cpp:35
size_t numPlayingInstances() const
Return number of playing instances of this sound.
Definition: EmbedSound.cpp:104
void getPlayingInstances(std::vector< InputStream * > &to) const
Append to the given vector all playing instances of this sound def.
Definition: EmbedSound.cpp:118
const std::uint8_t * data() const
Return a pointer to the underlying buffer.
Definition: EmbedSound.h:79
std::unique_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
void clearInstances()
Drop all active sounds.
Definition: EmbedSound.cpp:46
std::vector< SoundEnvelope > SoundEnvelopes
A vector of SoundEnvelope objects.
Definition: SoundEnvelope.h:60
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:74
Definition: GnashKey.h:155
Instance of a defined sound (EmbedSound)
Definition: EmbedSoundInst.h:45
const std::uint8_t * data(size_t pos) const
Return a pointer to an offset in the underlying buffer.
Definition: EmbedSound.h:88
~EmbedSound()
Definition: EmbedSound.cpp:75
media::SoundInfo soundinfo
Object holding information about the sound.
Definition: EmbedSound.h:171
int volume
Definition: EmbedSound.h:175
size_t size() const
Return size of the data buffer.
Definition: EmbedSound.h:69
EmbedSoundInst * firstPlayingInstance() const
Return the first created instance of this sound.
Definition: EmbedSound.cpp:111