it represent an audio engine source
More...
#include <AudioEngine2.h>
|
| CAudioSource2 (const char *sName, IParaAudioSource *pSource=NULL) |
|
HRESULT | Stop (ParaAudioFlagsEnum dwFlags) |
| stop a wave file More...
|
|
void | SetSource (IParaAudioSource *pSource) |
| reset the source. More...
|
|
IParaAudioSource * | GetSource () |
|
void | SetName (const char *sName) |
| set the name
|
|
const std::string & | GetName () const |
| get the name
|
|
void | EnableCallback (bool bEnable=true) |
| this function must be called before the music is played. More...
|
|
bool | play () |
| Plays the source with the last set parameters. More...
|
|
bool | play2d (const bool &toLoop=false, bool bIgnoreIfPlaying=true) |
| Plays the source in 2D mode. More...
|
|
bool | play3d (const PARAVECTOR3 &position, const float &soundstr=1.0, const bool &toLoop=false) |
| Plays the source in 3D mode. More...
|
|
void | pause () |
| Pauses playback of the sound source.
|
|
void | stop () |
| Stops playback of the sound source.
|
|
void | loop (const bool &toLoop) |
| Controls whether the source should loop or not. More...
|
|
bool | IsAsyncLoadingWhileLoopPlaying () |
| weather it is the audio is still playing while being async loaded. More...
|
|
bool | IsWaveFileLoopPlaying () |
| whether the file should be loop playing. More...
|
|
bool | IsPlaying () |
| whether the file is playing or not. More...
|
|
virtual void | onUpdate () |
| This function is called when a source updates its buffers.
|
|
virtual void | onRelease () |
| This function is called when a source is released and soon to be deleted.
|
|
virtual void | onPlay () |
| This function is called when a source starts playing.
|
|
virtual void | onStop () |
| This function is called when a source stopped playback.
|
|
virtual void | onPause () |
| This function is called when a source is paused.
|
|
it represent an audio engine source
§ EnableCallback()
void ParaEngine::CAudioSource2::EnableCallback |
( |
bool |
bEnable = true | ) |
|
|
inline |
this function must be called before the music is played.
Otherwise you are at risk of thread-safety.
§ IsAsyncLoadingWhileLoopPlaying()
bool ParaEngine::CAudioSource2::IsAsyncLoadingWhileLoopPlaying |
( |
| ) |
|
weather it is the audio is still playing while being async loaded.
§ IsPlaying()
bool ParaEngine::CAudioSource2::IsPlaying |
( |
| ) |
|
whether the file is playing or not.
§ IsWaveFileLoopPlaying()
bool ParaEngine::CAudioSource2::IsWaveFileLoopPlaying |
( |
| ) |
|
whether the file should be loop playing.
§ loop()
void ParaEngine::CAudioSource2::loop |
( |
const bool & |
toLoop | ) |
|
Controls whether the source should loop or not.
- Parameters
-
toLoop | Whether to loop (restart) the audio when the end is reached. |
§ play()
bool ParaEngine::CAudioSource2::play |
( |
| ) |
|
Plays the source with the last set parameters.
- Returns
- True if the source is playing, false if not.
§ play2d()
bool ParaEngine::CAudioSource2::play2d |
( |
const bool & |
toLoop = false , |
|
|
bool |
bIgnoreIfPlaying = true |
|
) |
| |
Plays the source in 2D mode.
No automatic attenuation or panning will take place in this mode, but using setPosition will allow you to manually pan mono audio streams.
- Parameters
-
toLoop | Whether to loop (restart) the audio when the end is reached. |
bIgnoreIfPlaying | if true(default), we will only play if the audio is not currently playing. |
- Returns
- True if the source is playing, false if not.
§ play3d()
bool ParaEngine::CAudioSource2::play3d |
( |
const PARAVECTOR3 & |
position, |
|
|
const float & |
soundstr = 1.0 , |
|
|
const bool & |
toLoop = false |
|
) |
| |
Plays the source in 3D mode.
- Parameters
-
position | Position to start the sound off at. |
soundstr | Affects how the source attenuates due to distance. Higher values cause the source to stand out more over distance. |
toLoop | Whether to loop (restart) the audio when the end is reached. |
- Returns
- True if the source is playing, false if not.
§ SetSource()
§ Stop()
stop a wave file
- Parameters
-
szWavePath | Path to the wave file. |
dwFlags | Flags that affect how the wave is stopped:
- AUDIO_FLAG_STOP_RELEASE Plays the wave to completion, then stops. For looping waves, this flag plays the current iteration to completion, then stops (ignoring any subsequent iterations). In either case, any release (or tail) is played. To stop the wave immediately, use the XACT_FLAG_STOP_IMMEDIATE flag.
- AUDIO_FLAG_STOP_IMMEDIATE Stops the playback immediately.
|
- Returns
- Returns S_OK if successful. Otherwise, an error code.
§ m_bIsAsyncLoadingWhileLoopPlaying
bool ParaEngine::CAudioSource2::m_bIsAsyncLoadingWhileLoopPlaying |
this is true, if an audio resource is being loop played but without being downloaded yet.
The documentation for this class was generated from the following files:
- Client/trunk/ParaEngineClient/3dengine/AudioEngine2.h
- Client/trunk/ParaEngineClient/3dengine/AudioEngine2.cpp