5 * Copyright (C) 2003, 2007, 2008 Thomas Perl <thp@perli.net>
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
27 #include "SDL_mixer.h"
29 #define FADE_OUT_MS 500
30 #define FADE_IN_MS 3000
32 typedef unsigned char sound_id
;
45 #define SOUND_RACKET_FIRST SOUND_RACKET1
46 #define SOUND_RACKET_LAST SOUND_RACKET2
47 #define SOUND_GROUND_FIRST SOUND_GROUND1
48 #define SOUND_GROUND_LAST SOUND_GROUND2
50 #define SOUND_GROUND (SOUND_GROUND_FIRST + rand()%(SOUND_GROUND_LAST-SOUND_GROUND_FIRST))
51 #define SOUND_RACKET (SOUND_RACKET_FIRST + rand()%(SOUND_RACKET_LAST-SOUND_RACKET_FIRST))
59 void play_sample_n(sound_id id
, int n
);
60 #define play_sample(id) play_sample_n(id,0)
61 #define play_sample_loop(id) play_sample_n(id,-1)
62 #define play_sample_background(id) play_sample_n(id,-2)
63 void stop_sample(sound_id id
);
64 void pan_sample(sound_id id
, float position
);
65 #define unpan_sample(id) pan_sample(id,0.5)