Mercurial > audio-send
view org/add-new-device.org @ 0:f9476ff7637e
initial forking of open-al to create multiple listeners
author | Robert McIntyre <rlm@mit.edu> |
---|---|
date | Tue, 25 Oct 2011 13:02:31 -0700 |
parents | |
children | 3caceef436ea |
line wrap: on
line source
1 #+title: all the steps to add a device to open-al2 #+author: Robert McIntyre3 #+email: rlm@mit.edu4 #+description: how to add a new device to open-al5 #+SETUPFILE: ../../aurellem/org/setup.org6 #+INCLUDE: ../../aurellem/org/level-0.org9 * How to add a new backend device11 * In Alc/backends/<your-device>.c13 #+begin_src C14 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_src25 #+begin_src C26 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_src42 #+begin_src C43 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 NULL54 };55 #+end_src58 * In OpenAL32/Include/alMain.h :60 #+begin_src C61 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_src67 * In Alc/ALc.c :68 #+begin_src C69 { "<your-device>", alc_<your-device>_init,70 alc_<your-device>_deinit, alc_<your-device>_probe, EmptyFuncs },72 #+end_src74 * In CMakeLists.txt75 #+begin_src cmake76 SET(ALC_OBJS Alc/ALc.c77 Alc/ALu.c78 Alc/alcConfig.c79 Alc/alcDedicated.c80 Alc/alcEcho.c81 Alc/alcModulator.c82 Alc/alcReverb.c83 Alc/alcRing.c84 Alc/alcThread.c85 Alc/bs2b.c86 Alc/helpers.c87 Alc/hrtf.c88 Alc/mixer.c89 Alc/panning.c90 # Default backends, always available91 Alc/backends/loopback.c92 Alc/backends/null.c93 # : add <your-device> device94 Alc/backends/<your-device>.c95 )96 #+end_src99 * In ~/.alsoftrc101 #+begin_src conf102 drivers = <your-device>103 #+end_src