Public Member Functions

FIFE::SoundEmitter Class Reference

#include <soundemitter.h>

Inheritance diagram for FIFE::SoundEmitter:
Inheritance graph
[legend]
Collaboration diagram for FIFE::SoundEmitter:
Collaboration graph
[legend]

List of all members.

Public Member Functions

uint32_t getId () const
void setPositioning (bool relative)
void setRolloff (float rolloff)
void setSoundClip (SoundClipPtr soundclip)
SoundClipPtr getSoundClip ()
void setCallback (const type_callback &cb)
void reset (bool defaultall=false)
void release ()
void setLooping (bool loop)
void play ()
void stop ()
void pause ()
void setGain (float gain)
float getGain ()
bool isStereo ()
int16_t getBitResolution ()
uint64_t getSampleRate ()
uint64_t getDecodedLength ()
uint64_t getDuration ()
void setCursor (SoundPositionType type, float value)
float getCursor (SoundPositionType type)
void setPosition (float x, float y, float z)
void setVelocity (float x, float y, float z)

Detailed Description

The class for playing audio files

Definition at line 46 of file soundemitter.h.


Member Function Documentation

int16_t FIFE::SoundEmitter::getBitResolution (  )  [inline]

Returns the bit resolution

Definition at line 155 of file soundemitter.h.

Referenced by getDuration().

Here is the caller graph for this function:

float FIFE::SoundEmitter::getCursor ( SoundPositionType  type  ) 

Returns the cursor position in the audio file

Definition at line 243 of file soundemitter.cpp.

uint64_t FIFE::SoundEmitter::getDecodedLength (  )  [inline]

Returns the length of the decoded length in bytes

Definition at line 173 of file soundemitter.h.

Referenced by getDuration().

Here is the caller graph for this function:

uint64_t FIFE::SoundEmitter::getDuration (  )  [inline]

Returns the duration of the sound clip in milliseconds

Definition at line 183 of file soundemitter.h.

References getBitResolution(), getDecodedLength(), getSampleRate(), and isStereo().

float FIFE::SoundEmitter::getGain (  )  [inline]

Returns the gain of the emitter

Returns:
The gain value. 0=silence ... 1.0=normal loudness.

Definition at line 136 of file soundemitter.h.

uint32_t FIFE::SoundEmitter::getId (  )  const [inline]

Returns the emitter-id

Definition at line 55 of file soundemitter.h.

uint64_t FIFE::SoundEmitter::getSampleRate (  )  [inline]

Returns the sample rate

Definition at line 164 of file soundemitter.h.

Referenced by getDuration().

Here is the caller graph for this function:

SoundClipPtr FIFE::SoundEmitter::getSoundClip (  )  [inline]

Get the current sound clip used by this emitter.

Returns:
A SoundClipPtr of the sound clip.

Definition at line 85 of file soundemitter.h.

bool FIFE::SoundEmitter::isStereo (  )  [inline]

Tests if the audio data is stereo data or mono.

Returns:
Returns true if the audio data is stereo, false if mono.

Definition at line 146 of file soundemitter.h.

Referenced by getDuration().

Here is the caller graph for this function:

void FIFE::SoundEmitter::pause (  )  [inline]

Pauses playing the audio file

Definition at line 118 of file soundemitter.h.

void FIFE::SoundEmitter::play (  ) 

Plays the associated audio file.

Definition at line 173 of file soundemitter.cpp.

void FIFE::SoundEmitter::release (  ) 

Releases the emitter

Definition at line 92 of file soundemitter.cpp.

void FIFE::SoundEmitter::reset ( bool  defaultall = false  ) 

Reset the emitter, free all internal buffers

Parameters:
defaultall If set to true, emitter position, velocity, gain and type will be set to the default values

Definition at line 63 of file soundemitter.cpp.

void FIFE::SoundEmitter::setCallback ( const type_callback &  cb  ) 

Sets the callback to use when the STREAM has finished being played. NOTE: This only works with streaming audio.

Parameters:
cb function callback

Definition at line 103 of file soundemitter.cpp.

void FIFE::SoundEmitter::setCursor ( SoundPositionType  type,
float  value 
)

Sets the cursor position in the audio file

Definition at line 195 of file soundemitter.cpp.

void FIFE::SoundEmitter::setGain ( float  gain  )  [inline]

Sets the gain of the emitter

Parameters:
gain The gain value. 0=silence ... 1.0=normal loudness.

Definition at line 128 of file soundemitter.h.

void FIFE::SoundEmitter::setLooping ( bool  loop  ) 

Sets the playing mode

Definition at line 162 of file soundemitter.cpp.

void FIFE::SoundEmitter::setPosition ( float  x,
float  y,
float  z 
) [inline]

Sets the position of the SoundEmitter in the virtual audio space.

Definition at line 206 of file soundemitter.h.

void FIFE::SoundEmitter::setPositioning ( bool  relative  )  [inline]

Sets Positioning-Type Default is false

Parameters:
relative If set to true, the emitters position will be interpreted relative to the listener object

Definition at line 65 of file soundemitter.h.

void FIFE::SoundEmitter::setRolloff ( float  rolloff  )  [inline]

Sets the AL_ROLEOFF_FACTOR. Rolloff factor judges the strength of attenuation over distance.

Parameters:
rolloff Rolloff factor. You'll need to do a lot of testing to find a value which suits your needs.

Definition at line 73 of file soundemitter.h.

void FIFE::SoundEmitter::setSoundClip ( SoundClipPtr  soundclip  ) 

Sets the sound clip to be used by this emitter.

Parameters:
SoundClipPtr of the sound to be used.

Definition at line 96 of file soundemitter.cpp.

void FIFE::SoundEmitter::setVelocity ( float  x,
float  y,
float  z 
) [inline]

Sets the velocity of the SoundEmitter in the virtual audio space.

Definition at line 212 of file soundemitter.h.

void FIFE::SoundEmitter::stop (  ) 

Stops playing the audio file and rewinds to the beginning

Definition at line 182 of file soundemitter.cpp.


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