5 * Copyright (C) 2003, 2007, 2008, 2009 Thomas Perl <thp@thpinfo.com>
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 #define VOICE_QUEUE_MAX 10
34 extern int voice_finished_flag
;
36 typedef unsigned char sound_id
;
50 #ifdef HAVE_VOICE_FILES
62 VOICE_ADVANTAGE_PLAYER_ONE
,
63 VOICE_ADVANTAGE_PLAYER_TWO
,
82 VOICE_IN_THE_FIRST_SET
,
83 VOICE_IN_THE_SECOND_SET
,
84 VOICE_IN_THE_THIRD_SET
,
85 VOICE_IN_THE_FOURTH_SET
,
86 VOICE_IN_THE_FIFTH_SET
,
109 #define LAST_SOUNDEFFECT_ID SOUND_MOUSECLICK
111 /* Channel by id gives: 1-N (of 0-N) */
112 #define CHANNEL_BY_ID(id, numchannels) ((id)%numchannels+1)
113 #define CHANNEL_VOICE 0
115 #define SOUND_RACKET_FIRST SOUND_RACKET1
116 #define SOUND_RACKET_LAST SOUND_RACKET2
117 #define SOUND_GROUND_FIRST SOUND_GROUND1
118 #define SOUND_GROUND_LAST SOUND_GROUND2
119 #ifdef HAVE_VOICE_FILES
120 # define VOICE_QUIT_IT_FIRST VOICE_QUIT_IT1
121 # define VOICE_QUIT_IT_LAST VOICE_QUIT_IT4
122 # define VOICE_NEW_GAME_FIRST VOICE_NEW_GAME1
123 # define VOICE_NEW_GAME_LAST VOICE_NEW_GAME6
124 # define VOICE_LETS_GO_FIRST VOICE_LETS_GO1
125 # define VOICE_LETS_GO_LAST VOICE_LETS_GO4
128 #define SOUND_GROUND (SOUND_GROUND_FIRST + rand()%(SOUND_GROUND_LAST-SOUND_GROUND_FIRST+1))
129 #define SOUND_RACKET (SOUND_RACKET_FIRST + rand()%(SOUND_RACKET_LAST-SOUND_RACKET_FIRST+1))
130 #ifdef HAVE_VOICE_FILES
131 # define VOICE_QUIT_IT (VOICE_QUIT_IT_FIRST + rand()%(VOICE_QUIT_IT_LAST-VOICE_QUIT_IT_FIRST+1))
132 # define VOICE_NEW_GAME (VOICE_NEW_GAME_FIRST + rand()%(VOICE_NEW_GAME_LAST-VOICE_NEW_GAME_FIRST+1))
133 # define VOICE_LETS_GO (VOICE_LETS_GO_FIRST + rand()%(VOICE_LETS_GO_LAST-VOICE_LETS_GO_FIRST+1))
142 void play_sample_n(sound_id id
, int n
);
143 #define play_sample(id) play_sample_n(id,0)
144 #define play_sample_loop(id) play_sample_n(id,-1)
145 #define play_sample_background(id) play_sample_n(id,-2)
146 void stop_sample(sound_id id
);
147 void sample_volume(sound_id id
, float volume
);
148 void sample_volume_group(sound_id first
, sound_id last
, float volume
);
149 void pan_sample(sound_id id
, float position
);
150 void pan_sample_group(sound_id first
, sound_id last
, float position
);
151 #define unpan_sample(id) pan_sample(id,0.5)
154 void voice_enqueue(sound_id id
);
156 void voice_say_list(int n
, ...);
157 void voice_channel_finished(int channel
);