annotate src/libmlk-core/core/sys_p.h @ 430:1645433e008d

core: rename ERR_INTERNAL to ERR_SDL
author David Demelier <markand@malikania.fr>
date Sat, 15 Oct 2022 17:18:45 +0200
parents 7d2ebc334c8c
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
420
7d2ebc334c8c misc: rename core to util
David Demelier <markand@malikania.fr>
parents: 411
diff changeset
22 #include <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
67c1c46af2c8 core: replace SDL2_mixer with OpenAL, closes #2528 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
34 extern ALCdevice *audio_dev;
67c1c46af2c8 core: replace SDL2_mixer with OpenAL, closes #2528 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
35 extern ALCcontext *audio_ctx;
67c1c46af2c8 core: replace SDL2_mixer with OpenAL, closes #2528 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
36
67c1c46af2c8 core: replace SDL2_mixer with OpenAL, closes #2528 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
37 struct 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
67c1c46af2c8 core: replace SDL2_mixer with OpenAL, closes #2528 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
46 struct audiostream *
67c1c46af2c8 core: replace SDL2_mixer with OpenAL, closes #2528 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
47 audiostream_open(const char *);
67c1c46af2c8 core: replace SDL2_mixer with OpenAL, closes #2528 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
48
67c1c46af2c8 core: replace SDL2_mixer with OpenAL, closes #2528 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
49 struct audiostream *
67c1c46af2c8 core: replace SDL2_mixer with OpenAL, closes #2528 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
50 audiostream_openmem(const void *, size_t);
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
67c1c46af2c8 core: replace SDL2_mixer with OpenAL, closes #2528 @3h
David Demelier <markand@malikania.fr>
parents:
diff changeset
53 audiostream_finish(struct audiostream *);
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 */