#include <ZE_ZSound.h>
Inherits ZE::ZObject.
| Public Methods | |
| ZSound () | |
| Default Constructor. | |
| ZSound (string filename) | |
| Constructor that opens a sound effect file. | |
| ~ZSound () | |
| Destructor, frees memory. | |
| void | Open (string filename) | 
| Opens a sound effect file. | |
| void | Release () | 
| Release sound effect. | |
| void | Play (int loopNum=0, int fadeTime=0) | 
| Play currently loaded sound effect. | |
| void | Pause () | 
| Pause sound. | |
| void | Unpause () | 
| Unpause sound. | |
| void | Stop (int fadeTime=0) | 
| Stop sound. | |
| void | SetVolume (int volume) | 
| Change Volume. | |
| bool | IsLoaded () | 
| Check if file is loaded. | |
| bool | IsPlaying () | 
| Check if sound is Playing. | |
| bool | IsPaused () | 
| Check if sound is Paused. | |
| int | Volume () | 
| Find Current Volume of Sound Channel. | |
| Static Public Attributes | |
| const int | LoopInfinite | 
| Static Variable For Infinite loop of sound. (Defined as -1). | |
| Protected Attributes | |
| 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. 
 | 
| 
 | 
| 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. 
 | 
 1.3-rc2
1.3-rc2