Main Page   Namespace List   Compound List   File List   Namespace Members   Compound Members   File Members  

/include/ZE_ZSound.h

Go to the documentation of this file.
00001 /*******************************************************************************
00002         This file is Part of the ZEngine Library for 2D game development.
00003                    Copyright (C) 2002, 2003 James Turk
00004 
00005                      Licensed under a BSD-style license.
00006 
00007     The maintainer of this library is James Turk (james@conceptofzero.net) 
00008      and the home of this Library is http://www.zengine.sourceforge.net
00009 *******************************************************************************/
00010 
00024 #ifndef __ze_zsound_h__
00025 #define __ze_zsound_h__
00026 
00027 #include "ZE_ZEngine.h"
00028 
00029 #ifdef USE_SDL_MIXER
00030 
00031 namespace ZE
00032 {
00033 
00039 class ZSound
00040 {
00041     protected:
00043         ZEngine* rEngine;
00045         Mix_Chunk* rSound;
00047         int rChannelID;
00048 
00049     public:
00051         static const int LoopInfinite;
00052 
00054         //Opening and Closing//
00056 
00062         ZSound();
00063 
00070         ZSound(string filename);
00071 
00077         virtual ~ZSound();
00078 
00085         void Open(string filename);
00086 
00092         void Release();
00093 
00095         //Play Controls//
00097 
00106         void Play(int loopNum=0, int fadeTime=0);
00107 
00113         void Pause() const;
00114 
00120         void Unpause() const;
00121 
00128         void Stop(int fadeTime=0) const;
00129 
00136         void SetVolume(int volume);
00137 
00139         //Accessors//
00141 
00148         bool IsLoaded() const;
00149 
00156         bool IsPlaying() const;
00157 
00164         bool IsPaused() const;
00165 
00172         int Volume() const;
00173 };
00174 
00175 
00176 }
00177 
00178 #endif //USE_SDL_MIXER
00179 
00180 #endif //__ze_zsound_h__

Generated on Sun Apr 27 18:14:01 2003 for ZEngine by doxygen1.3-rc2