UFO: Alien Invasion
Doxygen documentation generating
s_main.h
Go to the documentation of this file.
1 
6 /*
7 All original material Copyright (C) 2002-2023 UFO: Alien Invasion.
8 
9 Original file from Quake 2 v3.21: quake2-2.31/client/sound.h
10 Copyright (C) 1997-2001 Id Software, Inc.
11 
12 This program is free software; you can redistribute it and/or
13 modify it under the terms of the GNU General Public License
14 as published by the Free Software Foundation; either version 2
15 of the License, or (at your option) any later version.
16 
17 This program is distributed in the hope that it will be useful,
18 but WITHOUT ANY WARRANTY; without even the implied warranty of
19 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
20 
21 See the GNU General Public License for more details.
22 
23 You should have received a copy of the GNU General Public License
24 along with this program; if not, write to the Free Software
25 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
26 
27 */
28 
29 #pragma once
30 
31 #include "../../shared/mathlib.h" /* for vec3_t */
32 
34 typedef enum {
38 
40 } stdsound_t;
41 
42 #define SND_VOLUME_DEFAULT 1.0f
43 #define SND_VOLUME_WEAPONS 1.0f
44 
45 void S_Init(void);
46 void S_Shutdown(void);
47 void S_Frame(void);
48 void S_Stop(void);
49 void S_PlayStdSample(const stdsound_t sId, const vec3_t origin, float atten, float volume);
50 void S_StartLocalSample(const char* s, float volume);
51 int S_LoadSampleIdx (const char* soundFile);
52 bool S_LoadAndPlaySample(const char* s, const vec3_t origin, float atten, float volume);
53 void S_SetSampleRepeatRate(int sampleRepeatRate);
54 void S_LoadSamples(void);
stdsound_t
These sounds are precached in S_LoadSamples.
Definition: s_main.h:34
int S_LoadSampleIdx(const char *soundFile)
Loads and registers a sound file for later use.
Definition: s_sample.cpp:105
bool S_LoadAndPlaySample(const char *s, const vec3_t origin, float atten, float volume)
does what the name implies in just one function to avoid exposing s_sample_t
Definition: s_main.cpp:314
voidpf uLong int origin
Definition: ioapi.h:45
void S_SetSampleRepeatRate(int sampleRepeatRate)
Controls the repeat rate for the same sample.
Definition: s_main.cpp:352
void S_Shutdown(void)
Definition: s_main.cpp:275
void S_StartLocalSample(const char *s, float volume)
Plays a sample without spatialization.
Definition: s_mix.cpp:184
void S_LoadSamples(void)
Wrapper for S_PrecacheSamples to avoid exposing it via s_sample.h.
Definition: s_main.cpp:359
void S_Init(void)
Definition: s_main.cpp:172
vec_t vec3_t[3]
Definition: ufotypes.h:39
void S_PlayStdSample(const stdsound_t sId, const vec3_t origin, float atten, float volume)
plays one of the precached samples
Definition: s_main.cpp:333
void S_Frame(void)
Definition: s_main.cpp:70
void S_Stop(void)
Stop all channels.
Definition: s_main.cpp:58