File: snd_3dras.h

package info (click to toggle)
darkplaces 0~20180412~beta1-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 18,200 kB
  • sloc: ansic: 176,886; makefile: 485; pascal: 455; perl: 372; objc: 245; sh: 102
file content (49 lines) | stat: -rw-r--r-- 1,774 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
//BSD

#ifndef SND_3DRAS_H
#define SND_3DRAS_H

#include "sound.h"

#define DEFAULT_SOUND_PACKET_VOLUME 255
#define DEFAULT_SOUND_PACKET_ATTENUATION 1.0

#define CHANNELFLAG_NONE		0
#define CHANNELFLAG_FORCELOOP	(1 << 0) // force looping even if the sound is not looped
#define CHANNELFLAG_LOCALSOUND	(1 << 1) // INTERNAL USE. Not settable by S_SetChannelFlag
#define CHANNELFLAG_PAUSED		(1 << 2)
#define CHANNELFLAG_FULLVOLUME	(1 << 3) // isn't affected by the general volume

#define SFXFLAG_NONE		0
//#define SFXFLAG_FILEMISSING	(1 << 0) // wasn't able to load the associated sound file
#define SFXFLAG_SERVERSOUND	(1 << 1) // the sfx is part of the server precache list
//#define SFXFLAG_STREAMED		(1 << 2) // informative only. You shouldn't need to know that
#define SFXFLAG_PERMANENTLOCK	(1 << 3) // can never be freed (ex: used by the client code)

typedef struct channel_s{
	struct channel_s* next;
	void* rasptr;//Sound Event // This is also used to indicate a unused slot (when it's pointing to 0)
	int   entnum;// to allow overriding a specific sound
	int   entchannel;
	unsigned int   id;
} channel_t;

typedef struct entnum_s{
	struct entnum_s *next;
	int       entnum;
	vec3_t    lastloc; //Since DP has no way of tracking the deletion, we will use this instead (great jumps indicate teleport or new ent
	void     *rasptr;//Sound Source // This is also used to indicate a unused slot (when it's pointing to 0)
} entnum_t;

struct sfx_s{
	struct sfx_s *next;
	char  name[MAX_QPATH];
	void* rasptr; //Sound Data// The sound data allocated in the lib
	
	int locks;
	unsigned int flags;       	// cf SFXFLAG_* defines
	//unsigned int loopstart;   	// in sample frames. equals total_length if not looped
	//unsigned int total_length;	// in sample frames
};

#endif