1 /************************************************************************* 2 3 "I Have No Tomatoes" 4 Copyright (c) 2004, Mika Halttunen 5 6 This software is provided 'as-is', without any express or implied 7 warranty. In no event will the authors be held liable for any damages 8 arising from the use of this software. 9 10 Permission is granted to anyone to use this software for any purpose, 11 including commercial applications, and to alter it and redistribute 12 it freely, subject to the following restrictions: 13 14 1. The origin of this software must not be misrepresented; you must 15 not claim that you wrote the original software. If you use this 16 software in a product, an acknowledgment in the product documentation 17 would be appreciated but is not required. 18 19 2. Altered source versions must be plainly marked as such, and must 20 not be misrepresented as being the original software. 21 22 3. This notice may not be removed or altered from any source 23 distribution. 24 25 26 Mika Halttunen <lsoft@mbnet.fi> 27 28 *************************************************************************/ 29 30 #ifndef SOUNDMUSIC_H 31 #define SOUNDMUSIC_H 32 33 #include "SDL.h" 34 #include "SDL_mixer.h" 35 36 // Current music module 37 extern Mix_Music *music_mod; 38 39 // Maximum number of music files 40 #define MAX_MUSIC 128 41 42 // Music files array 43 extern char music_files[MAX_MUSIC][256]; 44 extern int num_music_files; 45 extern int cur_music; 46 47 48 // Sound defines 49 #define SND_APPEAR 0 50 #define SND_BOMB 1 51 #define SND_EXPLO 2 52 #define SND_BONUS1 3 53 #define SND_BONUS2 4 54 #define SND_BONUS3 5 55 #define SND_DIE1 6 56 #define SND_DIE2 7 57 #define SND_DIE3 8 58 #define SND_DIE4 9 59 #define SND_DIE5 10 60 #define SND_DIE6 11 61 #define SND_LEVEL_TELEPORT 12 62 #define SND_WILDFIRE 13 63 #define SND_TELEPORT 14 64 #define SND_TRAP 15 65 #define SND_LIGHTNING 16 66 #define SND_WISP 17 67 #define SND_JUMP 18 68 #define SND_POTATOMAN 19 69 #define SND_POTATOMAN2 20 70 #define SND_TURN 21 71 #define SND_FLOWERPOWER 22 72 #define SND_KICK 23 73 #define SND_KILLED5 24 74 #define SND_MENU1 25 75 #define SND_MENU2 26 76 #define SND_FINISH 27 77 78 // Number of sounds 79 #define NUM_SOUNDS 28 80 81 // Sound array 82 extern Mix_Chunk *sounds[NUM_SOUNDS]; 83 84 85 // Initialize the Mixer 86 void init_mixer(); 87 88 // Play music 89 void play_music(char *file); 90 91 // Play a sound 92 void play_sound(int sound, bool random_freq); 93 94 // If the current music has finished, start playing another 95 void music_finished(); 96 97 98 #endif 99