nw::snd::SoundPlayer::ForEachSound Member Function

Syntax

#include <nw/snd/snd_SoundPlayer.h>
template< class Function >
Function ForEachSound(
     Function function,
     bool reverse = false
);

Arguments

Name Description
in function Function pointer or function object
in reverse Specify TRUE to reverse the processing order.

Return Values

Returns a function pointer or function object specified as an argument

Description

Performs the processing for all sound currently playing on the player.

Calls

function( nw::snd::SoundHandle& handle )

for all playing sounds in the player. The sound handle associated with the played back sound, given by handle, is passed to function. This is a temporary handle, so this handle cannot be used again later.

function is called to play back sounds from the oldest to the newest. If TRUE is specified for reverse, the function is called to play back sounds from the newest to the oldest.

A function pointer or a function object is passed to function. An example of passing a function pointer is shown below:

void ReportSoundId( nw::snd::SoundHandle& handle ) { NN_LOG( "%d\n", handle.GetId() ); }
soundPlayer.ForEachSound( ReportSoundId );

See Also

SoundHandle Class
ForEachSoundPriorityOrder

Revision History

2010/10/15
Corrected errors (nw4r -> nw, OSReport -> NN_LOG)
2010/06/30
Initial version.

CONFIDENTIAL