00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #if !defined( __ARSSOUND_H__ )
00016 #define __ARSSOUND_H__
00017
00018 namespace Ars
00019 {
00020 class Sounds {
00021 protected:
00022
00023 Mix_Chunk *wave;
00024
00025 int channel;
00026 int ticks;
00027 int loop;
00028 int id;
00029
00030 public:
00031
00032 Sounds( void );
00033
00034 ~Sounds( void );
00035
00036 const bool Load( const string &aSection , const string &akey , string aCfgFile = "" );
00037 const bool Load( const string &aFilename );
00038
00039 void Configure( const int channel = 0 , const int nr = 0 , const int ticks = -1 );
00040 void Play( const int channel = -2 , const int nr = -2 , const int ticks = -2 );
00041
00042 operator Mix_Chunk *( void ) { return wave; }
00043 const bool operator==( const Sounds &snd ) { return id == snd.id; }
00044 };
00045
00046 Sounds &GetSound( const icstring &name );
00047 Sounds &AddSound( const icstring &name , const string &aSection , const string &akey , string aCfgFile = "" );
00048 Sounds &AddSound( const icstring &name , const string &aFilename );
00049 void Preload( const icstring &aSection );
00050 void UnloadSounds( void );
00051 }
00052 #endif