Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/openal-0.0.8/src/al_mixer.h @ 17

Last change on this file since 17 was 17, checked in by landauf, 16 years ago

added openal

File size: 2.8 KB
Line 
1/* -*- mode: C; tab-width:8; c-basic-offset:8 -*-
2 * vi:set ts=8:
3 *
4 * al_mixer.h
5 *
6 * Prototypes, macros and definitions related to the control and
7 * execution of the mixing "thread".
8 *
9 * The mixing "thread" is responsible for managing playing sources,
10 * applying the requisite filters, mixing in audio data from said sources,
11 * etc.
12 *
13 */
14#ifndef _AL_MIXER_H_
15#define _AL_MIXER_H_
16
17#include <AL/al.h>
18#include "al_siteconfig.h"
19
20/*
21 * Number of sources for which optimized mixing functions exist.
22 */
23#ifdef USE_LIGHT_GEN_MIXING
24#define GENMIXSOURCES 8
25#else
26#define GENMIXSOURCES 64
27#endif /* USE_LIGHT_GEN_MIXING */
28
29#ifdef __MMX__
30#define MMXMIXSOURCES 32
31#else
32#define MMXMIXSOURCES 0
33#endif /* __MMX__ */
34
35/* set MAXMIXSOURCES to MAX */
36#if GENMIXSOURCES<MMXMIXSOURCES
37#define MAXMIXSOURCES MMXMIXSOURCES
38#else
39#define MAXMIXSOURCES GENMIXSOURCES
40#endif
41
42
43/*
44 * our main mixing function.
45 */
46extern int (*mixer_iterate)( void *dummy );
47
48/*
49 * The mixing function checks this variable for equality with AL_TRUE.  When
50 * this is the case, it exits.  The default is AL_FALSE.
51 */
52extern volatile ALboolean time_for_mixer_to_die;
53
54/*
55 * Create and initialize data structures needed by the mixing function.
56 */
57ALboolean _alInitMixer( void );
58
59/*
60 * Inform the mixer that settings may have changed.  Data structures can
61 * be/are updated to reflect new settings in the current context.
62 *
63 * Synchronous, if AL_FALSE, causes a new thread to be launched.
64 */
65void _alSetMixer( ALboolean synchronous );
66
67/*
68 * Deallocate data allocated in _alInitMixer.
69 */
70void _alDestroyMixer( void );
71
72/*
73 * "play" the source named by sid.  If sid does not refer to a valid source,
74 * AL_INVALID_NAME is set.
75 */
76void _alAddSourceToMixer( ALuint sid );
77
78/*
79 * "stop" the source named by sid.  If sid does not refer to a valid source,
80 * AL_INVALID_NAME is set.
81 */
82ALboolean _alRemoveSourceFromMixer( ALuint sid );
83
84/*
85 * "start" the capture named by cpid.  If cpid does not refer to a valid
86 * capture, AL_INVALID_NAME is set.
87 */
88void _alAddCaptureToMixer( ALuint cpid );
89
90/*
91 * "stop" the capture named by cpid.  If cpid does not refer to a valid
92 * capture, AL_INVALID_NAME is set.
93 */
94void _alRemoveCaptureFromMixer( ALuint cpid );
95
96/*
97 * Lock the mixer mutex, handing fn and ln to _alLockPrintf
98 */
99void FL_alLockMixBuf( const char *fn, int ln );
100
101/*
102 * Unlock the mixer mutex, handing fn and ln to _alLockPrintf
103 */
104void FL_alUnlockMixBuf( const char *fn, int ln );
105
106/*
107 * functions to pause async mixer.  Oy Vey
108 */
109
110/*
111 * Lock the MixerPause mutex, which is use to "pause" the mixer.
112 */
113void _alLockMixerPause( void );
114
115/*
116 * Unlock the MixerPause mutex, which is use to "resume" the mixer.
117 */
118void _alUnlockMixerPause( void );
119
120/* macro madness */
121#define _alLockMixBuf()   FL_alLockMixBuf(__FILE__, __LINE__)
122#define _alUnlockMixBuf() FL_alUnlockMixBuf(__FILE__, __LINE__)
123
124#endif
Note: See TracBrowser for help on using the repository browser.