Mercurial > molko
annotate libmlk-core/mlk/core/sys_p.h @ 646:7e1eb7f6c049 default tip @
misc: remove .clang
author | David Demelier <markand@malikania.fr> |
---|---|
date | Sun, 04 Feb 2024 15:24:37 +0100 |
parents | 3761e33d429e |
children |
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 * |
445
773a082f0b91
misc: update copyright years
David Demelier <markand@malikania.fr>
parents:
436
diff
changeset
|
4 * Copyright (c) 2020-2023 David Demelier <markand@malikania.fr> |
379
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 |
432
38cf60f5a1c4
util: cleanup hierarchy
David Demelier <markand@malikania.fr>
parents:
431
diff
changeset
|
22 #include <mlk/util/util.h> |
411
d74f53299252
make: add basic GNU make support
David Demelier <markand@malikania.fr>
parents:
381
diff
changeset
|
23 |
379
67c1c46af2c8
core: replace SDL2_mixer with OpenAL, closes #2528 @3h
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
24 #include <stddef.h> |
67c1c46af2c8
core: replace SDL2_mixer with OpenAL, closes #2528 @3h
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
25 |
411
d74f53299252
make: add basic GNU make support
David Demelier <markand@malikania.fr>
parents:
381
diff
changeset
|
26 #if defined(MLK_OS_APPLE) |
d74f53299252
make: add basic GNU make support
David Demelier <markand@malikania.fr>
parents:
381
diff
changeset
|
27 # include <OpenAL/al.h> |
d74f53299252
make: add basic GNU make support
David Demelier <markand@malikania.fr>
parents:
381
diff
changeset
|
28 # include <OpenAL/alc.h> |
d74f53299252
make: add basic GNU make support
David Demelier <markand@malikania.fr>
parents:
381
diff
changeset
|
29 #else |
d74f53299252
make: add basic GNU make support
David Demelier <markand@malikania.fr>
parents:
381
diff
changeset
|
30 # include <al.h> |
d74f53299252
make: add basic GNU make support
David Demelier <markand@malikania.fr>
parents:
381
diff
changeset
|
31 # include <alc.h> |
d74f53299252
make: add basic GNU make support
David Demelier <markand@malikania.fr>
parents:
381
diff
changeset
|
32 #endif |
379
67c1c46af2c8
core: replace SDL2_mixer with OpenAL, closes #2528 @3h
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
33 |
471 | 34 extern ALCdevice *mlk__audio_dev; |
35 extern ALCcontext *mlk__audio_ctx; | |
379
67c1c46af2c8
core: replace SDL2_mixer with OpenAL, closes #2528 @3h
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
36 |
471 | 37 struct mlk__audiostream { |
380
31e2f6d35c34
core: fix sndfile distortion issue
David Demelier <markand@malikania.fr>
parents:
379
diff
changeset
|
38 short *samples; |
379
67c1c46af2c8
core: replace SDL2_mixer with OpenAL, closes #2528 @3h
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
39 ALsizei samplesz; |
67c1c46af2c8
core: replace SDL2_mixer with OpenAL, closes #2528 @3h
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
40 ALsizei samplerate; |
67c1c46af2c8
core: replace SDL2_mixer with OpenAL, closes #2528 @3h
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
41 ALuint buffer; |
67c1c46af2c8
core: replace SDL2_mixer with OpenAL, closes #2528 @3h
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
42 ALuint source; |
67c1c46af2c8
core: replace SDL2_mixer with OpenAL, closes #2528 @3h
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
43 ALenum format; |
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 |
436
df92d5b056ce
core: use err.h in sound|music
David Demelier <markand@malikania.fr>
parents:
432
diff
changeset
|
46 int |
471 | 47 mlk__audiostream_open(struct mlk__audiostream **, const char *); |
379
67c1c46af2c8
core: replace SDL2_mixer with OpenAL, closes #2528 @3h
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
48 |
436
df92d5b056ce
core: use err.h in sound|music
David Demelier <markand@malikania.fr>
parents:
432
diff
changeset
|
49 int |
471 | 50 mlk__audiostream_openmem(struct mlk__audiostream **, const void *, size_t); |
379
67c1c46af2c8
core: replace SDL2_mixer with OpenAL, closes #2528 @3h
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
51 |
67c1c46af2c8
core: replace SDL2_mixer with OpenAL, closes #2528 @3h
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
52 void |
471 | 53 mlk__audiostream_finish(struct mlk__audiostream *); |
379
67c1c46af2c8
core: replace SDL2_mixer with OpenAL, closes #2528 @3h
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
54 |
67c1c46af2c8
core: replace SDL2_mixer with OpenAL, closes #2528 @3h
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
55 #endif /* !MLK_CORE_SYS_P_H */ |