#include <ZE_ZSound.h>
Public Member Functions | |
ZSound () | |
Default Constructor. | |
ZSound (std::string filename) | |
Constructor that opens a sound effect file. | |
virtual | ~ZSound () |
Destructor, frees memory. | |
void | Open (std::string filename) |
Opens a sound effect file. | |
void | OpenFromZip (std::string zipname, std::string filename) |
Opens a sound effect file from within a zip archive. | |
void | Release () |
Release sound effect. | |
void | Play (int loopNum=0, int fadeTime=0) |
Play currently loaded sound effect. | |
void | Pause () const |
Pause sound. | |
void | Unpause () const |
Unpause sound. | |
void | Stop (int fadeTime=0) const |
Stop sound. | |
void | SetVolume (int volume) |
Change Volume. | |
bool | IsLoaded () const |
Check if file is loaded. | |
bool | IsPlaying () const |
Check if sound is Playing. | |
bool | IsPaused () const |
Check if sound is Paused. | |
int | Volume () const |
Find Current Volume of Sound Channel. | |
Static Public Attributes | |
const int | LoopInfinite |
Static Variable For Infinite loop of sound. (Defined as -1). | |
Protected Attributes | |
ZEngine * | rEngine |
Pointer to ZEngine Object. | |
Mix_Chunk * | rSound |
Pointer to music data. | |
int | rChannelID |
Channel ID Number from SDL_Mixer. |
|
Default Constructor, does nothing. |
|
Constructor simply calls ZSound::Open() with same filename. (WAV,MOD,MID,OGG)
|
|
Destructor calls ZSound::Release(). |
|
Open a music file to be used.
|
|
Open a sound effect file from within a zip archive using zlib and SDL_RWops.
|
|
Release memory held by sample data. |
|
Play sound effect, looping loopNum times. (use ZSound::LoopInfinite to loop forever.) If fade is not zero (which it defaults to) music will fade in over specified number of milliseconds.
|
|
Pause currently playing sound. |
|
Unpause currently playing sound. |
|
Stop currently playing sound, if fadeTime is not zero, fade out over specified time.
|
|
Change volume of currently playing sample.
|
|
Check if file is loaded and pointer to data is non-NULL.
|
|
Check if sound is playing, specifically if it is not stopped. (Paused state should be checked for by IsPaused)
|
|
Check if sound is "playing" but currently paused.
|
|
Get current volume of sound channel represented as a value from 0-128.
|