Gnash  0.8.11dev
Public Member Functions | Public Attributes | List of all members
gnash::sound_sample Class Reference

An identifier for a sound sample managed by a sound_handler. More...

#include <sound_definition.h>

Inheritance diagram for gnash::sound_sample:
gnash::ref_counted

Public Member Functions

 sound_sample (int id, const RunResources &r)
 
 ~sound_sample ()
 
- Public Member Functions inherited from gnash::ref_counted
 ref_counted ()
 
 ref_counted (const ref_counted &)
 
void add_ref () const
 
void drop_ref () const
 
long get_ref_count () const
 

Public Attributes

int m_sound_handler_id
 
const RunResources_runResources
 

Additional Inherited Members

- Protected Member Functions inherited from gnash::ref_counted
virtual ~ref_counted ()
 

Detailed Description

An identifier for a sound sample managed by a sound_handler.

Definition tags will maintain a mapping between SWF-defined id of the sound and these identifiers. A sound_definition is used only by DefineSoundTags for embedded event sounds. These sounds can be started either through the AS sound class or using a StartSoundTag. sound_definitions are not used for:

Specifying an identifier for use by sound_handler would likely be claner, anyway this is what it is currently.

NOTE that the destructor of this identifier (thus becoming a "smart" identifier) requests the currently registered sound_handler removal of the identified sound_sample. This might be the reason why it is a ref-counted thing (hard to belive...).

Todo:
move definition to sound_handler.h and possibly nest inside sound_handler itself ?

This is ref_counted because it is an export. TODO: check whether it really needs to be ref counted.

Constructor & Destructor Documentation

§ sound_sample()

gnash::sound_sample::sound_sample ( int  id,
const RunResources r 
)
inline

References ~sound_sample().

§ ~sound_sample()

gnash::sound_sample::~sound_sample ( )

delete the actual sound sample from the currently registered sound handler.

References _runResources, gnash::sound::sound_handler::delete_sound(), m_sound_handler_id, gnash::key::s, and gnash::RunResources::soundHandler().

Referenced by sound_sample().

Member Data Documentation

§ _runResources

const RunResources& gnash::sound_sample::_runResources

This is necessary because at least some sound_samples are destroyed after the movie_root has been destroyed, so that access through the VM (which assumes movie_root exists) causes a segfault.

Referenced by ~sound_sample().

§ m_sound_handler_id

int gnash::sound_sample::m_sound_handler_id

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