ScummVM API documentation
Audio::QueuingAudioStream Class Referenceabstract

#include <audiostream.h>

Inheritance diagram for Audio::QueuingAudioStream:
Audio::AudioStream

Public Member Functions

virtual void queueAudioStream (Audio::AudioStream *audStream, DisposeAfterUse::Flag disposeAfterUse=DisposeAfterUse::YES)=0
 
void queueBuffer (byte *data, uint32 size, DisposeAfterUse::Flag disposeAfterUse, byte flags)
 
virtual void finish ()=0
 
virtual uint32 numQueuedStreams () const =0
 
- Public Member Functions inherited from Audio::AudioStream
virtual int readBuffer (int16 *buffer, const int numSamples)=0
 
virtual bool isStereo () const =0
 
virtual int getRate () const =0
 
virtual bool endOfData () const =0
 
virtual bool endOfStream () const
 

Detailed Description

A QueuingAudioStream class that allows for queuing multiple audio streams for playback.

Member Function Documentation

◆ queueAudioStream()

virtual void Audio::QueuingAudioStream::queueAudioStream ( Audio::AudioStream audStream,
DisposeAfterUse::Flag  disposeAfterUse = DisposeAfterUse::YES 
)
pure virtual

Queue an audio stream for playback.

This stream plays all queued streams, in the order in which they were queued. If disposeAfterUse is set to DisposeAfterUse::YES, then the queued stream is deleted after all data contained in it has been played.

◆ queueBuffer()

void Audio::QueuingAudioStream::queueBuffer ( byte *  data,
uint32  size,
DisposeAfterUse::Flag  disposeAfterUse,
byte  flags 
)

Queue a block of raw audio data for playback.

This stream plays all queued blocks, in the order in which they were queued. If disposeAfterUse is set to DisposeAfterUse::YES, then the queued block is released using free() after all data contained in it has been played.

Note
Make sure to allocate the data block with malloc(), not with new[].
Parameters
dataPointer to the audio data block.
sizeLength of the audio data block.
disposeAfterUseIf equal to DisposeAfterUse::YES, the block is released using free() after use.
flagsA bit-ORed combination of RawFlags describing the audio data format.

◆ finish()

virtual void Audio::QueuingAudioStream::finish ( )
pure virtual

Mark this stream as finished.

This is used to signal that no further data will be queued to the stream. The stream is only considered as ended after this has been done.

◆ numQueuedStreams()

virtual uint32 Audio::QueuingAudioStream::numQueuedStreams ( ) const
pure virtual

Return the number of streams still queued for playback (including the currently playing stream).


The documentation for this class was generated from the following file: