Gnash  0.8.10
Public Member Functions
gnash::sound::Mkit_sound_handler Class Reference

Mkit media kit based sound_handler. More...

#include <sound_handler_mkit.h>

Inheritance diagram for gnash::sound::Mkit_sound_handler:
gnash::sound::sound_handler

List of all members.

Public Member Functions

 Mkit_sound_handler (media::MediaHandler *m)
 ~Mkit_sound_handler ()
virtual int create_sound (std::auto_ptr< SimpleBuffer > data, std::auto_ptr< media::SoundInfo > sinfo)
virtual StreamBlockId addSoundBlock (unsigned char *data, unsigned int data_bytes, unsigned int sample_count, int streamId)
virtual void stop_sound (int sound_handle)
virtual void delete_sound (int sound_handle)
 Discard the sound data for an embedded event sound.
virtual void reset ()
 Discard all sound inputs (slots and aux streamers) and clear scheduling.
virtual void stop_all_sounds ()
 Remove all scheduled request for playback of sound buffer slots.
virtual int get_volume (int sound_handle)
virtual void set_volume (int sound_handle, int volume)
 Sets the volume for a given event sound.
virtual media::SoundInfoget_sound_info (int soundHandle)
virtual void mute ()
 Call this to mute audio.
virtual void unmute ()
 Call this to unmute audio.
virtual bool is_muted () const
 Returns whether or not sound is muted.
virtual void pause ()
 gnash calls this to pause audio
virtual void unpause ()
 gnash calls this to unpause audio
virtual unsigned int get_duration (int sound_handle)
virtual unsigned int tell (int sound_handle)
void plugInputStream (std::auto_ptr< InputStream > in)
 Plug an InputStream to the mixer.
void fetchSamples (boost::int16_t *to, unsigned int nSamples)
 Fetch mixed samples.

Detailed Description

Mkit media kit based sound_handler.


Constructor & Destructor Documentation

gnash::sound::Mkit_sound_handler::Mkit_sound_handler ( media::MediaHandler m)
gnash::sound::Mkit_sound_handler::~Mkit_sound_handler ( )

Member Function Documentation

sound_handler::StreamBlockId gnash::sound::Mkit_sound_handler::addSoundBlock ( unsigned char *  data,
unsigned int  data_bytes,
unsigned int  sample_count,
int  streamId 
) [virtual]
int gnash::sound::Mkit_sound_handler::create_sound ( std::auto_ptr< SimpleBuffer data,
std::auto_ptr< media::SoundInfo sinfo 
) [virtual]
void gnash::sound::Mkit_sound_handler::delete_sound ( int  sound_handle) [virtual]

Discard the sound data for an embedded event sound.

Only embedded event sounds are deleted; this happens when the associated sound_sample is deleted.

Parameters:
sound_handleThe id for the event sound to be deleted

Reimplemented from gnash::sound::sound_handler.

void gnash::sound::Mkit_sound_handler::fetchSamples ( boost::int16_t *  to,
unsigned int  nSamples 
) [virtual]

Fetch mixed samples.

We run through all the plugged InputStreams fetching decoded audio blocks and mixing them into the given output stream.

Parameters:
toThe buffer to write mixed samples to. Buffer must be big enough to hold nSamples samples.
nSamplesThe amount of samples to fetch. NOTE: this number currently refers to "mono" samples due to some bad design decision. It is so expected that the user fetches 44100 * 2 samples which has to be interpreted as series of left,right channel couples. TODO: use actual number of samples so that it's expected to fetch 44100 per second and let expose a function to give interpretation of what comes back (how many bytes per channel, which format).

Reimplemented from gnash::sound::sound_handler.

References fill, gnash::sound::sound_handler::hasInputStreams(), and pause().

unsigned int gnash::sound::Mkit_sound_handler::get_duration ( int  sound_handle) [virtual]
media::SoundInfo * gnash::sound::Mkit_sound_handler::get_sound_info ( int  soundHandle) [virtual]
int gnash::sound::Mkit_sound_handler::get_volume ( int  sound_handle) [virtual]
bool gnash::sound::Mkit_sound_handler::is_muted ( ) const [virtual]

Returns whether or not sound is muted.

Returns:
true if muted, false if not

Reimplemented from gnash::sound::sound_handler.

void gnash::sound::Mkit_sound_handler::mute ( ) [virtual]

Call this to mute audio.

Reimplemented from gnash::sound::sound_handler.

void gnash::sound::Mkit_sound_handler::pause ( ) [virtual]

gnash calls this to pause audio

Reimplemented from gnash::sound::sound_handler.

References _.

Referenced by fetchSamples().

void gnash::sound::Mkit_sound_handler::plugInputStream ( std::auto_ptr< InputStream in) [virtual]

Plug an InputStream to the mixer.

Parameters:
inThe InputStream to plug, ownership transferred

Reimplemented from gnash::sound::sound_handler.

References unpause().

void gnash::sound::Mkit_sound_handler::reset ( ) [virtual]

Discard all sound inputs (slots and aux streamers) and clear scheduling.

Gnash calls this on movie restart.

The function should stop all sounds and get ready for a "parse from scratch" operation.

Reimplemented from gnash::sound::sound_handler.

References gnash::sound::sound_handler::delete_all_sounds(), and stop_all_sounds().

void gnash::sound::Mkit_sound_handler::set_volume ( int  sound_handle,
int  volume 
) [virtual]

Sets the volume for a given event sound.

Only used by the AS Sound class

Parameters:
sound_handleThe handle of the event sound to set volume for.
volumeA number from 0 to 100 representing a volume level. 100 is full volume and 0 is no volume. The default setting is 100.

Reimplemented from gnash::sound::sound_handler.

void gnash::sound::Mkit_sound_handler::stop_all_sounds ( ) [virtual]

Remove all scheduled request for playback of sound buffer slots.

Mixed functions: This applies both to streaming and event sounds.

Reimplemented from gnash::sound::sound_handler.

Referenced by reset().

void gnash::sound::Mkit_sound_handler::stop_sound ( int  sound_handle) [virtual]
unsigned int gnash::sound::Mkit_sound_handler::tell ( int  sound_handle) [virtual]
void gnash::sound::Mkit_sound_handler::unmute ( ) [virtual]

Call this to unmute audio.

Reimplemented from gnash::sound::sound_handler.

void gnash::sound::Mkit_sound_handler::unpause ( ) [virtual]

gnash calls this to unpause audio

Reimplemented from gnash::sound::sound_handler.

References gnash::sound::sound_handler::hasInputStreams(), and _.

Referenced by plugInputStream().


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