1 /*
2 	QF/plugin/snd_render.h
3 
4 	Sound Renderer plugin data types
5 
6 	Copyright (C) 2001 Jeff Teunissen <deek@quakeforge.net>
7 
8 	This program is free software; you can redistribute it and/or
9 	modify it under the terms of the GNU General Public License
10 	as published by the Free Software Foundation; either version 2
11 	of the License, or (at your option) any later version.
12 
13 	This program is distributed in the hope that it will be useful,
14 	but WITHOUT ANY WARRANTY; without even the implied warranty of
15 	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16 
17 	See the GNU General Public License for more details.
18 
19 	You should have received a copy of the GNU General Public License
20 	along with this program; if not, write to:
21 
22 		Free Software Foundation, Inc.
23 		59 Temple Place - Suite 330
24 		Boston, MA  02111-1307, USA
25 
26 */
27 #ifndef __QF_plugin_snd_render_h_
28 #define __QF_plugin_snd_render_h_
29 
30 #include <QF/plugin.h>
31 #include <QF/qtypes.h>
32 
33 /*
34 	All sound plugins must export these functions
35 */
36 
37 struct sfx_s;
38 
39 typedef void (*P_S_Init) (void);
40 typedef void (*P_S_Shutdown) (void);
41 typedef void (*P_S_AmbientOff) (void);
42 typedef void (*P_S_AmbientOn) (void);
43 typedef void (*P_S_StartSound) (int entnum, int entchannel, struct sfx_s *sfx, const vec3_t origin, float fvol, float attenuation);
44 typedef void (*P_S_StaticSound) (struct sfx_s *sfx, const vec3_t origin, float vol, float attenuation);
45 typedef void (*P_S_StopSound) (int entnum, int entchannel);
46 typedef struct sfx_s * (*P_S_PrecacheSound) (const char *sample);
47 typedef void (*P_S_Update) (const vec3_t origin, const vec3_t v_forward, const vec3_t v_right, const vec3_t v_up, const byte *ambient_sound_level);
48 typedef void (*P_S_StopAllSounds) (void);
49 typedef void (*P_S_ExtraUpdate) (void);
50 typedef void (*P_S_LocalSound) (const char *s);
51 typedef void (*P_S_BlockSound) (void);
52 typedef void (*P_S_UnblockSound) (void);
53 typedef struct sfx_s *(*P_S_LoadSound) (const char *name);
54 typedef struct channel_s *(*P_S_AllocChannel) (void);
55 typedef void (*P_S_ChannelStop) (struct channel_s *chan);
56 
57 typedef struct snd_render_funcs_s {
58 	P_S_AmbientOff 		pS_AmbientOff;
59 	P_S_AmbientOn  		pS_AmbientOn;
60 	P_S_StaticSound		pS_StaticSound;
61 	P_S_StartSound		pS_StartSound;
62 	P_S_StopSound		pS_StopSound;
63 	P_S_PrecacheSound	pS_PrecacheSound;
64 	P_S_Update			pS_Update;
65 	P_S_StopAllSounds	pS_StopAllSounds;
66 	P_S_ExtraUpdate 	pS_ExtraUpdate;
67 	P_S_LocalSound		pS_LocalSound;
68 	P_S_BlockSound		pS_BlockSound;
69 	P_S_UnblockSound	pS_UnblockSound;
70 	P_S_LoadSound		pS_LoadSound;
71 	P_S_AllocChannel	pS_AllocChannel;
72 	P_S_ChannelStop     pS_ChannelStop;
73 } snd_render_funcs_t;
74 
75 typedef struct snd_render_data_s {
76 	double *host_frametime;
77 	int *viewentity;
78 
79 	unsigned int *soundtime;
80 	unsigned int *paintedtime;
81 	struct plugin_s *output;
82 } snd_render_data_t;
83 
84 #endif // __QF_plugin_snd_render_h_
85