Welcome Guest [Log In] [Register]
Welcome to Epee Engine. We hope you enjoy your visit.


You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.


Join our community!


If you're already a member please log in to your account to access all of our features:

Username:   Password:
Add Reply
Sound; Documentation on the Sound class
Topic Started: Mar 8 2007, 11:37 AM (290 Views)
Alan
Administrator
[ *  *  * ]
Sound: Is a object that can be passed to PlaySoundNow to play a sound or music file.
The Epee Engine supports all file formats supported by the SDL_Mixer library.

Inherits from: nothing

Function List:
see below and replies

public:
Sound(std::string _Name ,std::string _FileName,int _Channel=0,int _NumberOfTimesToLoop=0, int _Volume=MIX_MAX_VOLUME);
~Sound();
int GetVolume();
bool SetVolume(int _Volume);
bool LoadSound();
bool SetChannel(int _ChannelToSetTo);
int GetChannel();
bool SetNumberOfTimesToLoop(int _NumberOfTimesToLoop);
int GetNumberOfTimesToLoop();
std::string GetName();
Offline Profile Quote Post Goto Top
 
Alan
Administrator
[ *  *  * ]
Sound(std::string _Name ,
std::string _FileName,
int _Channel,
int _NumberOfTimesToLoop,
int _Volume)

Public function of the Sound Class

Description:
Constructor of the sound class

Notes:
Call create sound instead of creating a new instance.
Create sound will do this for you and insert the sound in to the sound list


Arguments:


Required:

std::string _Name
name of the sound used for the find sound funtion


std::string _FileName
file name of the audio file to load


Optional:

int _Channel
the channel to play the sound on
defaults to 0

int _NumberOfTimesToLoop
number of times to play the sound
defaults to 0 (loops for ever)

int _Volume
sets the volume of the channel
defaults to MIX_MAX_VOLUME


Return Value:
none
Offline Profile Quote Post Goto Top
 
Alan
Administrator
[ *  *  * ]
int GetVolume()

Public function of the Sound Class

Description:
gets the current volume that the sound will play at


Arguments:
None


Return Value:
returns the current volume of the sound
Offline Profile Quote Post Goto Top
 
Alan
Administrator
[ *  *  * ]
bool SetVolume(int _Volume)

Public function of the Sound Class

Description:
sets the volume that the sound will play at

Arguments:

Required:

int _Volume
volume to play at


Return Value:
returns true on success, false otherwise
Offline Profile Quote Post Goto Top
 
Alan
Administrator
[ *  *  * ]
bool LoadSound()

Public function of the Sound Class
this function will become protected at some point

Description:
loads the audio file (_FileName) into memory


Notes:
DO NOT call this function create sound will do it for you

Arguments:
None


Return Value:
returns true on success, false otherwise
Offline Profile Quote Post Goto Top
 
Alan
Administrator
[ *  *  * ]
bool SetChannel(int _ChannelToSetTo)

Public function of the Sound Class

Description:
sets the channel that the sound will play on

Arguments:

Required:

int _ChannelToSetTo
channel to play on.
must be greater that zero


Return Value:
returns true on success, false otherwise
Offline Profile Quote Post Goto Top
 
Alan
Administrator
[ *  *  * ]
int GetChannel();

Public function of the Sound Class

Description:
gets the current channel that the sound will on

Arguments:
None


Return Value:
returns the channel that the sound will play on
Offline Profile Quote Post Goto Top
 
Alan
Administrator
[ *  *  * ]
bool SetNumberOfTimesToLoop(int _NumberOfTimesToLoop)

Public function of the Sound Class

Description:
sets the number of times to loop the sound


Arguments:

Required:

int _NumberOfTimesToLoop
number of times to loop the sound
passing in zero cause the sound to loop forever
must be greater than zero


Return Value:
returns true on success, false otherwise
Offline Profile Quote Post Goto Top
 
Alan
Administrator
[ *  *  * ]
int GetNumberOfTimesToLoop();

Public function of the Sound Class

Description:
gets the number of times the sound will loop


Arguments:
None


Return Value:
returns the number of times the sound will loop
Offline Profile Quote Post Goto Top
 
Alan
Administrator
[ *  *  * ]
std::string GetName()

Public function of the Sound Class

Description:
Gets the name of the sound object

Arguments:
None

Return Value:
returns the name of the sound object
Offline Profile Quote Post Goto Top
 
« Previous Topic · Documentation · Next Topic »
Add Reply