OpenMoHAA 0.82.0
Loading...
Searching...
No Matches
snd_public.h
1/*
2===========================================================================
3Copyright (C) 1999-2005 Id Software, Inc.
4
5This file is part of Quake III Arena source code.
6
7Quake III Arena source code is free software; you can redistribute it
8and/or modify it under the terms of the GNU General Public License as
9published by the Free Software Foundation; either version 2 of the License,
10or (at your option) any later version.
11
12Quake III Arena source code is distributed in the hope that it will be
13useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15GNU General Public License for more details.
16
17You should have received a copy of the GNU General Public License
18along with Quake III Arena source code; if not, write to the Free Software
19Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20===========================================================================
21*/
22
23#if defined(NO_MODERN_DMA) && NO_MODERN_DMA
24
25#ifdef __cplusplus
26extern "C" {
27#endif
28
29void S_Init( void );
30void S_Shutdown( void );
31
32// if origin is NULL, the sound will be dynamically sourced from the entity
33void S_StartSound( vec3_t origin, int entnum, int entchannel, sfxHandle_t sfx );
34void S_StartLocalSound( sfxHandle_t sfx, int channelNum );
35
36void S_StartBackgroundTrack( const char *intro, const char *loop );
37void S_StopBackgroundTrack( void );
38
39// cinematics and voice-over-network will send raw samples
40// 1.0 volume will be direct output of source samples
41void S_RawSamples(int stream, int samples, int rate, int width, int channels,
42 const byte *data, float volume, int entityNum);
43
44// stop all sounds and the background track
45void S_StopAllSounds( void );
46
47// all continuous looping sounds must be added before calling S_Update
48void S_ClearLoopingSounds( qboolean killall );
49void S_AddLoopingSound( int entityNum, const vec3_t origin, const vec3_t velocity, sfxHandle_t sfx );
50void S_AddRealLoopingSound( int entityNum, const vec3_t origin, const vec3_t velocity, sfxHandle_t sfx );
51void S_StopLoopingSound(int entityNum );
52
53// recompute the relative volumes for all running sounds
54// relative to the given entityNum / orientation
55void S_Respatialize( int entityNum, const vec3_t origin, vec3_t axis[3], int inwater );
56
57// let the sound system know where an entity currently is
58void S_UpdateEntityPosition( int entityNum, const vec3_t origin );
59
60void S_Update( void );
61
62void S_DisableSounds( void );
63
64void S_BeginRegistration( void );
65
66// RegisterSound will allways return a valid sample, even if it
67// has to create a placeholder. This prevents continuous filesystem
68// checks for missing files
69sfxHandle_t S_RegisterSound( const char *sample, qboolean compressed );
70
71void S_DisplayFreeMemory(void);
72
73void S_ClearSoundBuffer( void );
74
75void SNDDMA_Activate( void );
76
77void S_UpdateBackgroundTrack( void );
78
79
80#ifdef USE_VOIP
81void S_StartCapture(void);
82int S_AvailableCaptureSamples(void);
83void S_Capture(int samples, byte* data);
84void S_StopCapture(void);
85void S_MasterGain(float gain);
86#endif
87
88
89#ifdef __cplusplus
90}
91#endif
92
93#include "new/snd_public_new.h"
94
95#else
96
97#ifdef __cplusplus
98extern "C" {
99#endif
100
101void S_SoundInfo_f();
102void S_SoundDump_f();
103void S_Init(qboolean full_startup);
104void S_Shutdown(qboolean full_shutdown);
105qboolean S_NameExists(const char* name);
106void S_BeginRegistration();
107qboolean S_IsSoundRegistered(const char* name);
108sfxHandle_t S_RegisterSound(const char* name, int streamed, qboolean force_load);
109float S_GetSoundTime(sfxHandle_t handle);
110void S_EndRegistration();
111void S_UpdateEntity(int entityNum, const vec3_t origin, const vec3_t vel, qboolean use_listener);
112void S_SetGlobalAmbientVolumeLevel(float volume);
113void S_StartSound(const vec3_t origin, int entnum, int entchannel, sfxHandle_t sfxHandle, float volume, float min_dist, float pitch, float maxDist, int streamed);
114void S_StartLocalSound(const char* sound_name, qboolean force_load);
115void S_StartLocalSoundChannel(const char* sound_name, qboolean force_load, soundChannel_t channel);
116void S_StopAllSounds(qboolean stop_music);
117void S_ClearLoopingSounds();
118void S_AddLoopingSound(const vec3_t origin, const vec3_t velocity, sfxHandle_t sfxHandle, float volume, float min_dist, float max_dist, float pitch, int flags);
119void S_Respatialize(int entityNum, const vec3_t head, vec3_t axis[3]);
120void S_Update();
121void S_StopSound(int entnum, int channel);
122void S_SetReverb(int reverb_type, float reverb_level);
123void S_Play();
124void S_SoundList();
125
126qboolean S_IsSoundPlaying(int channel_number, const char* sfxName);
127void S_FadeSound(float fTime);
128
129qboolean MUSIC_LoadSoundtrackFile(const char* filename);
130qboolean MUSIC_SongValid(const char* mood);
131qboolean MUSIC_Loaded();
132void Music_Update();
133void MUSIC_SongEnded();
134void MUSIC_NewSoundtrack(const char* name);
135void MUSIC_UpdateMood(int current, int fallback);
136void MUSIC_UpdateVolume(float volume, float fade_time);
137void MUSIC_StopAllSongs();
138void MUSIC_FreeAllSongs();
139qboolean MUSIC_Playing();
140int MUSIC_FindSong(const char* name);
141void S_loadsoundtrack();
142const char* S_CurrentSoundtrack();
143void S_PlaySong();
144int MUSIC_CurrentSongChannel();
145void MUSIC_StopChannel(int channel_number);
146qboolean MUSIC_PlaySong(const char* alias);
147void MUSIC_UpdateMusicVolumes();
148void MUSIC_CheckForStoppedSongs();
149void S_TriggeredMusic_SetupHandle(const char* pszName, int iLoopCount, int iOffset, qboolean autostart);
150void S_TriggeredMusic_Start();
151void S_TriggeredMusic_StartLoop();
152void S_TriggeredMusic_Stop();
153void S_TriggeredMusic_Volume();
154void S_TriggeredMusic_Pause();
155void S_TriggeredMusic_Unpause();
156void S_TriggeredMusic_PlayIntroMusic();
157void S_StopMovieAudio();
158void S_SetupMovieAudio(const char* pszMovieName);
159int S_CurrentMoviePosition();
160
161const char* S_GetMusicFilename();
162int S_GetMusicLoopCount();
163unsigned int S_GetMusicOffset();
164
165#ifdef __cplusplus
166}
167#endif
168
169#endif
170
171
172#ifdef __cplusplus
173extern "C" {
174#endif
175
176#ifdef USE_VOIP
177void S_StartCapture( void );
178int S_AvailableCaptureSamples( void );
179void S_Capture( int samples, byte *data );
180void S_StopCapture( void );
181void S_MasterGain( float gain );
182#endif
183
184#ifdef __cplusplus
185}
186#endif