FreeWRL / FreeX3D 4.3.0
sounds.h
1/*
2
3
4Sound engine client code
5
6*/
7
8/****************************************************************************
9 This file is part of the FreeWRL/FreeX3D Distribution.
10
11 Copyright 2009 CRC Canada. (http://www.crc.gc.ca)
12
13 FreeWRL/FreeX3D is free software: you can redistribute it and/or modify
14 it under the terms of the GNU Lesser Public License as published by
15 the Free Software Foundation, either version 3 of the License, or
16 (at your option) any later version.
17
18 FreeWRL/FreeX3D is distributed in the hope that it will be useful,
19 but WITHOUT ANY WARRANTY; without even the implied warranty of
20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 GNU General Public License for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with FreeWRL/FreeX3D. If not, see <http://www.gnu.org/licenses/>.
25****************************************************************************/
26
27
28#ifndef __FREEWRL_SOUND_CLIENT_H__
29#define __FREEWRL_SOUND_CLIENT_H__
30
31#ifdef HAVE_OPENAL
32#include <AL/al.h>
33#include <AL/alc.h>
34#include <AL/alext.h>
35#ifdef HAVE_ALUT
36#include <AL/alut.h>
37#endif
38#endif
39
40#define SNDMAXMSGSIZE 256
41
42/* states of the sound engine */
43#define SOUND_FAILED 2
44#define SOUND_STARTED 1
45#define SOUND_NEEDS_STARTING 3
46
47#define MAXSOUNDS 50
48
49typedef struct {
50 long mtype; /* message type */
51 char msg[SNDMAXMSGSIZE]; /* message data */
52} FWSNDMSG;
53
54
55void Sound_toserver(char *message);
56
57int SoundEngineInit(void);
58
59void waitformessage(void);
60
61void SoundEngineDestroy(void);
62
63int SoundSourceRegistered(int num);
64
65float SoundSourceInit(int num,
66 int loop,
67 double pitch,
68 double start_time,
69 double stop_time,
70 char *url);
71
72void SetAudioActive(int num, int stat);
73int haveSoundEngine();
74/* if a Sound {} can not be found... */
75#define BADAUDIOSOURCE -9999
76
77#endif /* __FREEWRL_SOUND_CLIENT_H__ */