/************************************************************** * Name: Daniel S. Shue (dshue) * File: Sound.H * Asgn: sims * Date: Wed Mar 12 02:03:04 EST 2003 **************************************************************/ #ifndef Sound_Header #define Sound_Header #include "SDL_mixer.h" class Sound { public: Sound(); virtual ~Sound(); /* Here's the interface for the Logic to call: */ // plays background music (in a loop) virtual bool playMusic(int music_type); // stops background music virtual bool stopMusic(); /* Here's the interface for the GUI to call: */ virtual bool openAudioDevice(); // called before game starts virtual bool closeAudioDevice(); // called after game ends virtual bool mute(); // mutes audio output virtual bool resume(); // resumes audio output virtual bool setVolume(); // user adjusts volume level virtual int getVolume(); // GUI displays current volume level /* Here's the interface for both the Logic and GUI to call: */ // plays brief sound effects for game events virtual bool playSound(int sound_type); /* Here are the enums that list the music and sound types. NOTE: These lists are not comprehensive. Instead, they simply outline what we're trying to do.*/ enum MusicType { OPENING_THEME, GOOD_STATUS, IMPROVING_STATUS, WORSENING_STATUS, BAD_STATUS }; enum SoundType { VALID_CLICK, INVALID_CLICK, BUILD, BULDOZE, CHEER, BOO }; protected: private: int _audio_open; Mix_Music * _music; int _next_track; Mix_Chunk * _wave; // for testing purposes only void menu(); }; #endif