Go to the documentation of this file.
20 #ifndef SOUND_EMBEDSOUNDINST_H
21 #define SOUND_EMBEDSOUNDINST_H
66 unsigned int inPoint,
unsigned int outPoint,
70 virtual bool eof()
const;
79 virtual size_t checkEarlierEnd(
size_t bytesAhead,
size_t pos)
const {
80 if (_outPoint < std::numeric_limits<unsigned long>::max()) {
81 const size_t toCustomEnd = _outPoint - pos;
82 return std::min(toCustomEnd, bytesAhead);
87 virtual bool moreData();
107 void applyEnvelopes(std::int16_t* samples,
unsigned int nSamples,
110 bool reachedCustomEnd()
const;
113 virtual bool decodingCompleted()
const {
114 return (decodingPosition >= _soundDef.
size());
120 virtual void decodeNextBlock();
123 unsigned long decodingPosition;
131 const unsigned long _outPoint;
138 std::uint32_t current_env;
153 #endif // SOUND_EMBEDSOUNDINST_H
virtual ~EmbedSoundInst()
Unregister self from the associated EmbedSound.
Definition: EmbedSoundInst.cpp:230
Instances::iterator eraseActiveSound(Instances::iterator i)
Drop an active sound (by iterator)
Definition: EmbedSound.cpp:53
Definition of an embedded sound.
Definition: EmbedSound.h:50
virtual bool eof() const
True if there is no more data ever.
Definition: EmbedSoundInst.cpp:222
void log_debug(StringType msg, Args... args)
Definition: log.h:301
@ i
Definition: GnashKey.h:155
Anonymous namespace for callbacks, local functions, event handlers etc.
Definition: dbus_ext.cpp:41
Instance of a defined sound (LiveSoundData)
Definition: LiveSound.h:47
void appendDecodedData(std::uint8_t *data, unsigned int size)
Definition: LiveSound.h:99
size_t size() const
Return size of the data buffer.
Definition: EmbedSound.h:69
void adjustVolume(T *start, T *end, float volume)
Volume adjustment.
Definition: SoundUtils.h:39
size_t playbackPosition() const
Definition: LiveSound.h:91
EmbedSoundInst(EmbedSound &def, media::MediaHandler &mh, unsigned int inPoint, unsigned int outPoint, const SoundEnvelopes *envelopes, int loopCount)
Create an embedded sound instance.
Definition: EmbedSoundInst.cpp:41
Instance of a defined sound (EmbedSound)
Definition: EmbedSoundInst.h:46
unsigned int decodedSamplesAhead() const
Definition: LiveSound.h:106
int volume
Definition: EmbedSound.h:175
media::AudioDecoder & decoder() const
Definition: LiveSound.h:95
void restart()
Start from the beginning again.
Definition: LiveSound.h:79
std::vector< SoundEnvelope > SoundEnvelopes
A vector of SoundEnvelope objects.
Definition: SoundEnvelope.h:60
const std::uint8_t * data() const
Return a pointer to the underlying buffer.
Definition: EmbedSound.h:79