view org/add-new-device.org @ 33:3caceef436ea tip

formatting for web
author Robert McIntyre <rlm@mit.edu>
date Sat, 11 Feb 2012 12:25:55 -0700
parents f9476ff7637e
children
line wrap: on
line source
1 #+title: Steps to add a new 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
8 * In Alc/backends/<your-device>.c
10 #+begin_src C
11 static const ALCchar <your-device>_device[] = <your-device-name>;
13 ALCboolean alc_<your-device>_init(BackendFuncs *func_list)
14 void alc_<your-device>_deinit(void)
16 static ALCboolean <your-device>_open_playback
17 (ALCdevice *device,const ALCchar *deviceName)
18 static void <your-device>_close_playback(ALCdevice *device)
19 static ALCboolean <your-device>_reset_playback(ALCdevice *device)
20 static void <your-device>_stop_playback(ALCdevice *device)
22 #+end_src
24 #+begin_src C
25 void alc_<your-device>_probe(enum DevProbe type)
26 {
27 switch(type)
28 {
29 case DEVICE_PROBE:
30 AppendDeviceList(<your-device>Device);
31 break;
32 case ALL_DEVICE_PROBE:
33 AppendAllDeviceList(<your-device>Device);
34 break;
35 case CAPTURE_DEVICE_PROBE:
36 break;
37 }
38 }
39 #+end_src
41 #+begin_src C
42 static const BackendFuncs <your-device>_funcs = {
43 <your-device>_open_playback,
44 <your-device>_close_playback,
45 <your-device>_reset_playback,
46 <your-device>_stop_playback,
47 NULL,
48 NULL,
49 NULL,
50 NULL,
51 NULL,
52 NULL
53 };
54 #+end_src
57 * In OpenAL32/Include/alMain.h :
59 #+begin_src C
60 ALCboolean alc_<your-device>_init(BackendFuncs *func_list);
61 void alc_<your-device>_deinit(void);
62 void alc_<your-device>_probe(enum DevProbe type);
64 #+end_src
66 * In Alc/ALc.c :
67 #+begin_src C
68 { "<your-device>", alc_<your-device>_init,
69 alc_<your-device>_deinit, alc_<your-device>_probe, EmptyFuncs },
71 #+end_src
73 * In CMakeLists.txt
74 #+begin_src cmake
75 SET(ALC_OBJS Alc/ALc.c
76 Alc/ALu.c
77 Alc/alcConfig.c
78 Alc/alcDedicated.c
79 Alc/alcEcho.c
80 Alc/alcModulator.c
81 Alc/alcReverb.c
82 Alc/alcRing.c
83 Alc/alcThread.c
84 Alc/bs2b.c
85 Alc/helpers.c
86 Alc/hrtf.c
87 Alc/mixer.c
88 Alc/panning.c
89 # Default backends, always available
90 Alc/backends/loopback.c
91 Alc/backends/null.c
92 # : add <your-device> herex
93 Alc/backends/<your-device>.c
94 )
95 #+end_src
98 * In ~/.alsoftrc
100 #+begin_src conf
101 drivers = <your-device>
102 #+end_src