Gnash  0.8.10
Public Member Functions | Public Attributes
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

List of all members.

Public Member Functions

 sound_sample (int id, const RunResources &r)
 ~sound_sample ()

Public Attributes

int m_sound_handler_id
const RunResources_runResources

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

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

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

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


Member Data Documentation

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().


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