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,
29 #include "SDL_mixer.h"
31 #define FADE_OUT_MS 500
32 #define FADE_IN_MS 3000
34 #define VOICE_QUEUE_MAX 10
36 extern int voice_finished_flag
;
38 typedef unsigned char sound_id
;
52 #ifdef HAVE_VOICE_FILES
64 VOICE_ADVANTAGE_PLAYER_ONE
,
65 VOICE_ADVANTAGE_PLAYER_TWO
,
84 VOICE_IN_THE_FIRST_SET
,
85 VOICE_IN_THE_SECOND_SET
,
86 VOICE_IN_THE_THIRD_SET
,
87 VOICE_IN_THE_FOURTH_SET
,
88 VOICE_IN_THE_FIFTH_SET
,
111 #define LAST_SOUNDEFFECT_ID SOUND_MOUSECLICK
113 /* Channel by id gives: 1-N (of 0-N) */
114 #define CHANNEL_BY_ID(id, numchannels) ((id)%numchannels+1)
115 #define CHANNEL_VOICE 0
117 #define SOUND_RACKET_FIRST SOUND_RACKET1
118 #define SOUND_RACKET_LAST SOUND_RACKET2
119 #define SOUND_GROUND_FIRST SOUND_GROUND1
120 #define SOUND_GROUND_LAST SOUND_GROUND2
121 #ifdef HAVE_VOICE_FILES
122 # define VOICE_QUIT_IT_FIRST VOICE_QUIT_IT1
123 # define VOICE_QUIT_IT_LAST VOICE_QUIT_IT4
124 # define VOICE_NEW_GAME_FIRST VOICE_NEW_GAME1
125 # define VOICE_NEW_GAME_LAST VOICE_NEW_GAME6
126 # define VOICE_LETS_GO_FIRST VOICE_LETS_GO1
127 # define VOICE_LETS_GO_LAST VOICE_LETS_GO4
130 #define SOUND_GROUND (SOUND_GROUND_FIRST + rand()%(SOUND_GROUND_LAST-SOUND_GROUND_FIRST+1))
131 #define SOUND_RACKET (SOUND_RACKET_FIRST + rand()%(SOUND_RACKET_LAST-SOUND_RACKET_FIRST+1))
132 #ifdef HAVE_VOICE_FILES
133 # define VOICE_QUIT_IT (VOICE_QUIT_IT_FIRST + rand()%(VOICE_QUIT_IT_LAST-VOICE_QUIT_IT_FIRST+1))
134 # define VOICE_NEW_GAME (VOICE_NEW_GAME_FIRST + rand()%(VOICE_NEW_GAME_LAST-VOICE_NEW_GAME_FIRST+1))
135 # define VOICE_LETS_GO (VOICE_LETS_GO_FIRST + rand()%(VOICE_LETS_GO_LAST-VOICE_LETS_GO_FIRST+1))
142 void init_sound(TennixArchive
& tnxar
);
144 void play_sample_n(sound_id id
, int n
);
145 #define play_sample(id) play_sample_n(id,0)
146 #define play_sample_loop(id) play_sample_n(id,-1)
147 #define play_sample_background(id) play_sample_n(id,-2)
148 void stop_sample(sound_id id
);
149 void sample_volume(sound_id id
, float volume
);
150 void sample_volume_group(sound_id first
, sound_id last
, float volume
);
151 void pan_sample(sound_id id
, float position
);
152 void pan_sample_group(sound_id first
, sound_id last
, float position
);
153 #define unpan_sample(id) pan_sample(id,0.5)
156 void voice_enqueue(sound_id id
);
158 void voice_say_list(int n
, ...);
159 void voice_channel_finished(int channel
);