sfSound Class Reference

#include <Sound.hpp>

List of all members.

Public Member Functions

 sfSound (const sfSoundBuffer *Buffer=NULL, bool Loop=false, float Pitch=1.f, float Volume=100.f, float X=0.f, float Y=0.f, float Z=0.f)
void Play ()
void Pause ()
void Stop ()
void SetBuffer (const sfSoundBuffer *Buffer)
void SetLoop (bool Loop)
void SetPitch (float Pitch)
void SetVolume (float Volume)
void SetPosition (float X, float Y, float Z)
const sfSoundBufferGetBuffer () const
bool GetLoop () const
float GetPitch () const
float GetVolume () const
void GetPosition (float &X, float &Y, float &Z) const
sfSoundStatus GetStatus () const
float GetPlayingOffset () const


Detailed Description

Base class for every class defining a sound (sample, music, streamed, ...). It defines the properties of the sound such as position, volume, pitch, etc.

Definition at line 43 of file Sound.hpp.


Constructor & Destructor Documentation

sfSound::sfSound ( const sfSoundBuffer Buffer = NULL,
bool  Loop = false,
float  Pitch = 1.f,
float  Volume = 100.f,
float  X = 0.f,
float  Y = 0.f,
float  Z = 0.f 
)

Construct the sound from its parameters

Parameters:
Buffer : Sound buffer to play (NULL by default)
Loop : Loop flag (false by default)
Pitch : Value of the pitch (1 by default)
Volume : Volume (100 by default)
X : X position (0 by default)
Y : Y position (0 by default)
Z : Z position (0 by default)

Definition at line 36 of file Sound.cpp.

References SetBuffer().


Member Function Documentation

void sfSound::Play (  ) 

Play the sound

Definition at line 53 of file Sound.cpp.

void sfSound::Pause (  ) 

Pause the sound

Definition at line 64 of file Sound.cpp.

void sfSound::Stop (  ) 

Stop the sound

Definition at line 75 of file Sound.cpp.

void sfSound::SetBuffer ( const sfSoundBuffer Buffer  ) 

Set the source buffer

Parameters:
Buffer : Pointer to the new sound buffer to bind to the sound

Definition at line 86 of file Sound.cpp.

References sfSoundBuffer::GetId().

Referenced by sfSound().

void sfSound::SetLoop ( bool  Loop  ) 

Set the sound loop state

Parameters:
Loop : True to play in loop, false to play once

Definition at line 99 of file Sound.cpp.

void sfSound::SetPitch ( float  Pitch  ) 

Set the sound pitch

Parameters:
Pitch : New pitch

Definition at line 110 of file Sound.cpp.

void sfSound::SetVolume ( float  Volume  ) 

Set the sound volume

Parameters:
Volume : Volume (in range [0, 100])

Definition at line 121 of file Sound.cpp.

void sfSound::SetPosition ( float  X,
float  Y,
float  Z 
)

Set the sound position

Parameters:
X : X position of the sound in the world
Y : Y position of the sound in the world
Z : Z position of the sound in the world

Definition at line 132 of file Sound.cpp.

const sfSoundBuffer * sfSound::GetBuffer (  )  const

Get the source buffer

Returns:
Sound buffer bound to the sound (can be NULL)

Definition at line 143 of file Sound.cpp.

bool sfSound::GetLoop (  )  const

Tell whether or not the sound is looping

Returns:
True if the sound is looping, false otherwise

Definition at line 152 of file Sound.cpp.

float sfSound::GetPitch (  )  const

Get the pitch

Returns:
Pitch value

Definition at line 164 of file Sound.cpp.

float sfSound::GetVolume (  )  const

Get the volume

Returns:
Volume value (in range [1, 100])

Definition at line 176 of file Sound.cpp.

void sfSound::GetPosition ( float &  X,
float &  Y,
float &  Z 
) const

Get the sound position

Parameters:
X : X position of the sound in the world
Y : Y position of the sound in the world
Z : Z position of the sound in the world

Definition at line 188 of file Sound.cpp.

sfSoundStatus sfSound::GetStatus (  )  const

Get the status of the sound (stopped, paused, playing)

Returns:
Current status of the sound

Definition at line 197 of file Sound.cpp.

float sfSound::GetPlayingOffset (  )  const

Get the current playing position of the sound

Returns:
Current playing position, expressed in seconds

Definition at line 217 of file Sound.cpp.


The documentation for this class was generated from the following files:
Generated for SFML by  doxygen 1.5.2