lib-game-delta3d-sdk-examples-testSound-testsound.h / h
The Application class for this test. It handles the basic requirments for a dtABC::Application. In the constructor, this class will create and configure the dtAudio::AudioManager, pre-load some sound files (optional), and get a single sound object for use through out the durration of this app. The destructor, frees the single sound object and shuts down the dtAudio::AudioManager. The KeyPress function demonstrates two ways to play sounds. Any key other than the space-bar will play the one sound that this app is holding on to. If that one sound is currently playing, extra calls to it's play function will have no effect. Pressing the space bar will create as many transient sound objects as needed and play them. This app intentionally does not save pointers to those transient sound objects. The SoundStartedCB is just a window dressing callback to alert the user that a sound started playing. The SoundStoppedCB also alerts the user that a sound stopped, but is more important, in this case, because it also frees all the transient sounds that were not saved by this app when they were created. Both methods of sound managment are appropriate depending on the user's needs. If a small number of sounds are needed, holding pointers to them for the durration of the application may be the better choice. However, if large numbers of sound must be played, using the transient sound method is more efficient, since the dtAudio::AudioManager will recycle sound objects after they have been freed.
Default constructor.
parameter: configuration file name
Destructor.
KeyboardListener override Called when a key is pressed.
parameter: keyboard the source of the event
parameter: key the key pressed
parameter: character the corresponding character
Call back to know when a sound has started.
parameter: Sound pointer to the sound that started
parameter: void pointer to user data
Call back to know when a sound has stopped.
parameter: Sound pointer to the sound that stopped
parameter: void pointer to user data
Function that creates the label that explains keyboard inputs
Function that creates the text for the help label
A single sound this app holds onto for the duration.
The LabelActor that displays the keyboard functionality for this test
(C) Æliens 04/09/2009
You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.