comparison src/libmlk-core/core/sys_p.h @ 379:67c1c46af2c8

core: replace SDL2_mixer with OpenAL, closes #2528 @3h
author David Demelier <markand@malikania.fr>
date Wed, 05 Jan 2022 12:45:17 +0100
parents
children 31e2f6d35c34
comparison
equal deleted inserted replaced
378:460c78706989 379:67c1c46af2c8
1 /*
2 * sys_p.h -- libcore private definitions
3 *
4 * Copyright (c) 2020-2022 David Demelier <markand@malikania.fr>
5 *
6 * Permission to use, copy, modify, and/or distribute this software for any
7 * purpose with or without fee is hereby granted, provided that the above
8 * copyright notice and this permission notice appear in all copies.
9 *
10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 */
18
19 #ifndef MLK_CORE_SYS_P_H
20 #define MLK_CORE_SYS_P_H
21
22 #include <stddef.h>
23
24 #include <al.h>
25 #include <alc.h>
26
27 extern ALCdevice *audio_dev;
28 extern ALCcontext *audio_ctx;
29
30 struct audiostream {
31 ALshort *samples;
32 ALsizei samplesz;
33 ALsizei samplerate;
34 ALuint buffer;
35 ALuint source;
36 ALenum format;
37 };
38
39 struct audiostream *
40 audiostream_open(const char *);
41
42 struct audiostream *
43 audiostream_openmem(const void *, size_t);
44
45 void
46 audiostream_finish(struct audiostream *);
47
48 #endif /* !MLK_CORE_SYS_P_H */