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