view org/add-new-device.org @ 4:ed256a687dfe

removed very old crufty java program
author Robert McIntyre <rlm@mit.edu>
date Tue, 25 Oct 2011 13:17:37 -0700
parents f9476ff7637e
children 3caceef436ea
line wrap: on
line source
1 #+title: all the steps to add a device to open-al
2 #+author: Robert McIntyre
3 #+email: rlm@mit.edu
4 #+description: how to add a new device to open-al
5 #+SETUPFILE: ../../aurellem/org/setup.org
6 #+INCLUDE: ../../aurellem/org/level-0.org
9 * How to add a new backend device
11 * In Alc/backends/<your-device>.c
13 #+begin_src C
14 static const ALCchar <your-device>_device[] = <your-device-name>;
16 ALCboolean alc_<your-device>_init(BackendFuncs *func_list)
17 void alc_<your-device>_deinit(void)
19 static ALCboolean <your-device>_open_playback(ALCdevice *device, const ALCchar *deviceName)
20 static void <your-device>_close_playback(ALCdevice *device)
21 static ALCboolean <your-device>_reset_playback(ALCdevice *device)
22 static void <your-device>_stop_playback(ALCdevice *device)
23 #+end_src
25 #+begin_src C
26 void alc_<your-device>_probe(enum DevProbe type)
27 {
28 switch(type)
29 {
30 case DEVICE_PROBE:
31 AppendDeviceList(<your-device>Device);
32 break;
33 case ALL_DEVICE_PROBE:
34 AppendAllDeviceList(<your-device>Device);
35 break;
36 case CAPTURE_DEVICE_PROBE:
37 break;
38 }
39 }
40 #+end_src
42 #+begin_src C
43 static const BackendFuncs <your-device>_funcs = {
44 <your-device>_open_playback,
45 <your-device>_close_playback,
46 <your-device>_reset_playback,
47 <your-device>_stop_playback,
48 NULL,
49 NULL,
50 NULL,
51 NULL,
52 NULL,
53 NULL
54 };
55 #+end_src
58 * In OpenAL32/Include/alMain.h :
60 #+begin_src C
61 ALCboolean alc_<your-device>_init(BackendFuncs *func_list);
62 void alc_<your-device>_deinit(void);
63 void alc_<your-device>_probe(enum DevProbe type);
65 #+end_src
67 * In Alc/ALc.c :
68 #+begin_src C
69 { "<your-device>", alc_<your-device>_init,
70 alc_<your-device>_deinit, alc_<your-device>_probe, EmptyFuncs },
72 #+end_src
74 * In CMakeLists.txt
75 #+begin_src cmake
76 SET(ALC_OBJS Alc/ALc.c
77 Alc/ALu.c
78 Alc/alcConfig.c
79 Alc/alcDedicated.c
80 Alc/alcEcho.c
81 Alc/alcModulator.c
82 Alc/alcReverb.c
83 Alc/alcRing.c
84 Alc/alcThread.c
85 Alc/bs2b.c
86 Alc/helpers.c
87 Alc/hrtf.c
88 Alc/mixer.c
89 Alc/panning.c
90 # Default backends, always available
91 Alc/backends/loopback.c
92 Alc/backends/null.c
93 # : add <your-device> device
94 Alc/backends/<your-device>.c
95 )
96 #+end_src
99 * In ~/.alsoftrc
101 #+begin_src conf
102 drivers = <your-device>
103 #+end_src