Introduction
Downloads
Documentation
Tutorials
Pixie Lite
Forum

Home

SoundInstance Class Reference
[Audio]

List of all members.


Public Member Functions

 SoundInstance (const Sound &sound, float priority, bool looping)
 ~SoundInstance ()
void Play ()
float GetPriority ()
void Stop ()
void Pause ()
bool IsPlaying ()
float GetLength ()
float GetPosition ()
void SetPosition (float position)
float GetVolume ()
void SetVolume (float level)
const SoundGetSound ()

Friends

class Audio

Detailed Description

Author:
Mattias Gustavsson

Definition at line 22 of file SoundInstance.h.


Constructor & Destructor Documentation

SoundInstance::SoundInstance ( const Sound sound,
float  priority,
bool  looping 
)

Constructor

Definition at line 16 of file SoundInstance.cpp.

SoundInstance::~SoundInstance (  ) 

Destructor

Definition at line 37 of file SoundInstance.cpp.


Member Function Documentation

void SoundInstance::Play (  ) 

Resumes (or starts) playback of the sound from the current position. Will request a sound stream from the Audio system, and it will receive one if there is one available. This might mean that a sound with lower or equal priority to this one will be cut off to make a sound stream available, but no sounds with higher priority will be cut off. If the audio system can't find, or make, a sound stream available, the sound will not be played. When the sound reaches the end, the assigned sound stream will be released for use by other sounds.

Definition at line 61 of file SoundInstance.cpp.

float SoundInstance::GetPriority (  ) 

Retrieves the priority value of the sound

Definition at line 45 of file SoundInstance.cpp.

void SoundInstance::Stop (  ) 

Stops the playback of the sound, and resets position to 0. This will also result in any assigned sound stream to be released for use by other sounds.

Definition at line 78 of file SoundInstance.cpp.

void SoundInstance::Pause (  ) 

Halts playback of the music, but doesn't reset position. This will also result in any assigned sound stream to be released for use by other sounds.

Definition at line 87 of file SoundInstance.cpp.

bool SoundInstance::IsPlaying (  ) 

Returns true if the music is currently playing, and false if it has been stopped (by calling the Stop method or by reaching the end if playing without looping)

float SoundInstance::GetLength (  ) 

Returns the length of the track in seconds

Definition at line 101 of file SoundInstance.cpp.

float SoundInstance::GetPosition (  ) 

Returns the current position of the track in seconds from the start

Definition at line 109 of file SoundInstance.cpp.

void SoundInstance::SetPosition ( float  position  ) 

Sets the current position of the track in seconds from the start

Definition at line 133 of file SoundInstance.cpp.

float SoundInstance::GetVolume (  ) 

Returns the current volume level in the range 0.0 to 1.0

Definition at line 280 of file SoundInstance.cpp.

void SoundInstance::SetVolume ( float  level  ) 

Sets the current volume level in the range 0.0 to 1.0

Definition at line 288 of file SoundInstance.cpp.

const Sound * SoundInstance::GetSound (  ) 

Definition at line 53 of file SoundInstance.cpp.


Friends And Related Function Documentation

friend class Audio [friend]

Definition at line 105 of file SoundInstance.h.



Pixie University and the Pixie Game Engine is created and managed by Mattias Gustavsson.
Reproduction/republishing of any material on this site without permission is strictly prohibited.