Main Page | Class Hierarchy | Alphabetical List | Data Structures | Directories | File List | Data Fields

sound.h

00001 /***************************************************************************
00002                           sound.h  -  description
00003                              -------------------
00004     begin                : Sat May 3 2003
00005     copyright            : (C) 2003 by Gabor Torok
00006     email                : cctorok@yahoo.com
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  *                                                                         *
00011  *   This program is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU General Public License as published by  *
00013  *   the Free Software Foundation; either version 2 of the License, or     *
00014  *   (at your option) any later version.                                   *
00015  *                                                                         *
00016  ***************************************************************************/
00017 
00018 #ifndef SOUND_H
00019 #define SOUND_H
00020 
00021 #include <string>
00022 #include <map>
00023 #include "constants.h"
00024 #include "rpg/character.h"
00025 #include "gui/window.h"
00026 #include "item.h"
00027 #include "userconfiguration.h"
00028 #include "rpg/spell.h"
00029 
00030 using namespace std;
00031 
00032 class Sound {
00033 private:
00034   bool haveSound;
00035 #ifdef HAVE_SDL_MIXER
00036   Mix_Music *menuMusic;
00037   Mix_Music *dungeonMusic;
00038   map<string, Mix_Chunk*> soundMap;
00039 #endif
00040 
00041 public:
00042   Sound(UserConfiguration *userConfiguration);
00043   virtual ~Sound();
00044   
00045   inline void playMusicMenu() {
00046 #ifdef HAVE_SDL_MIXER
00047     playMusic(menuMusic);
00048 #endif
00049   }
00050 
00051   inline void stopMusicMenu() {
00052 #ifdef HAVE_SDL_MIXER
00053     stopMusic(menuMusic);
00054 #endif
00055   }
00056 
00057   inline void playMusicDungeon() {
00058 #ifdef HAVE_SDL_MIXER
00059     playMusic(dungeonMusic);
00060 #endif
00061   }
00062 
00063   inline void stopMusicDungeon() {
00064 #ifdef HAVE_SDL_MIXER
00065     stopMusic(dungeonMusic);
00066 #endif
00067   }
00068 
00069   void loadSounds(UserConfiguration *userConfiguration);
00070   void loadMonsterSounds( char *monsterType, map<int, vector<string>*> *m, 
00071                                                   UserConfiguration *userConfiguration );
00072   void unloadMonsterSounds( char *monsterType, map<int, vector<string>*> *m );
00073 
00074   void storeSound(int type, const char *file);
00075   void unloadSound( int type, const char *file );
00076   void playSound(const char *file);
00077 
00078   void setMusicVolume(int volume);
00079   void Sound::setEffectsVolume(int volume);
00080 
00081 protected:
00082 #ifdef HAVE_SDL_MIXER
00083   void playMusic(Mix_Music *music);
00084   void stopMusic(Mix_Music *music);
00085 #endif
00086 };
00087 
00088 #endif

Generated on Thu Jun 16 21:50:43 2005 for scourge by  doxygen 1.4.0