Gnash
0.8.10
|
An identifier for a sound sample managed by a sound_handler. More...
#include <sound_definition.h>
Public Member Functions | |
sound_sample (int id, const RunResources &r) | |
~sound_sample () | |
Public Attributes | |
int | m_sound_handler_id |
const RunResources & | _runResources |
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...).
This is ref_counted because it is an export. TODO: check whether it really needs to be ref counted.
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.
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().