Main Page   Class Hierarchy   Compound List   File List   Compound Members  

sound.h

00001 /*
00002  *  sound.h
00003  *  for perihelion
00004  *
00005  *  Created by jridenou on Tue May 14 2002.
00006  *  Copyright (c) 2002 Perihelion  All rights reserved.
00007  * This class contains all the sound routines for the game.
00008  */
00009 #ifndef _SOUND_
00010 #define _SOUND_
00011 
00012 //not sure if this stuff is necessary, but just to be safe
00013 #ifdef _MSC_VER // if the compiler is from Microsoft
00014   #pragma warning(disable:4786)
00015 #endif
00016 
00017 #include "world.h"
00018 #include <SDL.h>
00019 #include <SDL_mixer.h>
00020 
00021 // this line is optional with gcc but mandatory with VC++
00022 using namespace std;
00023 enum Sounds {BEEP, FOOTSTEP, NCHUNKS};
00024 class Sound {
00025  public:
00031   Sound();
00032 
00037   ~Sound();
00038 
00043   void playWorld(World & world);
00044 
00050   void playSound(int soundIdentifier);
00051 
00055   void playMusic();
00056 
00057   // BTW, I guess we want to give an argument to this... do we? (Pablo)
00062   void loadData();
00063 
00064 private:
00065   int audio_rate;
00066   Uint16 audio_format; /* 16-bit stereo */
00067   int audio_channels;
00068   int sound_effects;
00069   int audio_buffers;
00070   bool sound_on;
00071   
00075   Mix_Music *music;
00076   Mix_Chunk *chunk2;
00077   Mix_Chunk *chunk;//[NCHUNKS]; // not sure why i can't do this
00078 //Mix_Chunk *soundfiles[sound_effects];
00079 };
00080 
00081 #endif
00082 
00083 

Generated on Thu Jun 6 17:22:20 2002 for Perihelion by doxygen1.2.15