gnash::media::active_sound Class Reference

Used to hold the info about active sounds. More...

#include <sound_handler_sdl.h>

List of all members.

Public Member Functions

 active_sound ()
 ~active_sound ()
void set_data (sound_data *newUndecodedData)
 Set the undecoded data pointer.
boost::uint8_t * get_data_ptr (unsigned long int pos)
boost::uint8_t * get_raw_data_ptr (unsigned long int pos)
void deleteDecodedData ()
 Release resources associated with decoded data, if any.
void appendDecodedData (boost::uint8_t *data, unsigned int size)
 Append size bytes to this raw data.
void setDecodedData (boost::uint8_t *data, unsigned int size)
 Set decoded data.
size_t rawDataSize () const
size_t dataSize () const

Public Attributes

AudioDecoderdecoder
 The decoder object used to convert the data into the playable format.
unsigned long position
 Current decoding position in the stream.
unsigned long raw_position
 Current playing position in the decoded stream.
long loop_count
unsigned int offset
 Offset to make playback start in-sync, only used with mp3 streams.
const std::vector
< sound_handler::sound_envelope > * 
envelopes
boost::uint32_t current_env
 Index of current envelope.
unsigned long samples_played
 Number of samples played so far.


Detailed Description

Used to hold the info about active sounds.

This class contains a pointer to the sound_data used for playing and an optional Buffer to use when decoding is needed.

When the Buffer is NULL we'll play the sound_data bytes directly (we assume they are decoded already)


Constructor & Destructor Documentation

gnash::media::active_sound::active_sound (  )  [inline]

gnash::media::active_sound::~active_sound (  )  [inline]


Member Function Documentation

void gnash::media::active_sound::set_data ( sound_data newUndecodedData  ) 

Set the undecoded data pointer.

Parameters:
newUndecodedData Pointer to a sound_data being the undecoded data Ownership will NOT be transferred.

boost::uint8_t * gnash::media::active_sound::get_data_ptr ( unsigned long int  pos  ) 

Returns the data pointer in the undecoded datastream for the given position. Boundaries are checked.

boost::uint8_t * gnash::media::active_sound::get_raw_data_ptr ( unsigned long int  pos  ) 

Returns the data pointer in the decoded datastream for the given position. Boundaries are checked.

void gnash::media::active_sound::deleteDecodedData (  ) 

Release resources associated with decoded data, if any.

After this call, the active_sound will have no decoded data buffer, thus any pointer to the decoded data will be fetched from the undecoded one.

void gnash::media::active_sound::appendDecodedData ( boost::uint8_t *  data,
unsigned int  size 
) [inline]

Append size bytes to this raw data.

Parameters:
data Data bytes, allocated with new[]. Ownership transferred.
size Size of the 'data' buffer.

void gnash::media::active_sound::setDecodedData ( boost::uint8_t *  data,
unsigned int  size 
) [inline]

Set decoded data.

Parameters:
data Data bytes, allocated with new[]. Ownership transferred.
size Size of the 'data' buffer.

size_t gnash::media::active_sound::rawDataSize (  )  const [inline]

size_t gnash::media::active_sound::dataSize (  )  const [inline]


Member Data Documentation

AudioDecoder* gnash::media::active_sound::decoder

The decoder object used to convert the data into the playable format.

unsigned long gnash::media::active_sound::position

Current decoding position in the stream.

unsigned long gnash::media::active_sound::raw_position

Current playing position in the decoded stream.

long gnash::media::active_sound::loop_count

Numbers of loops: -1 means loop forever, 0 means play once. For every loop completed, it is decremented.

unsigned int gnash::media::active_sound::offset

Offset to make playback start in-sync, only used with mp3 streams.

const std::vector<sound_handler::sound_envelope>* gnash::media::active_sound::envelopes

Sound envelopes for the current sound, which determine the volume level from a given position. Only used with sound events.

boost::uint32_t gnash::media::active_sound::current_env

Index of current envelope.

unsigned long gnash::media::active_sound::samples_played

Number of samples played so far.


The documentation for this class was generated from the following files:
Generated on Thu Mar 6 18:25:11 2008 for Gnash by  doxygen 1.5.4