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