Mercurial > audio-send
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-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.org8 * In Alc/backends/<your-device>.c10 #+begin_src C11 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_playback17 (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_src24 #+begin_src C25 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_src41 #+begin_src C42 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 NULL53 };54 #+end_src57 * In OpenAL32/Include/alMain.h :59 #+begin_src C60 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_src66 * In Alc/ALc.c :67 #+begin_src C68 { "<your-device>", alc_<your-device>_init,69 alc_<your-device>_deinit, alc_<your-device>_probe, EmptyFuncs },71 #+end_src73 * In CMakeLists.txt74 #+begin_src cmake75 SET(ALC_OBJS Alc/ALc.c76 Alc/ALu.c77 Alc/alcConfig.c78 Alc/alcDedicated.c79 Alc/alcEcho.c80 Alc/alcModulator.c81 Alc/alcReverb.c82 Alc/alcRing.c83 Alc/alcThread.c84 Alc/bs2b.c85 Alc/helpers.c86 Alc/hrtf.c87 Alc/mixer.c88 Alc/panning.c89 # Default backends, always available90 Alc/backends/loopback.c91 Alc/backends/null.c92 # : add <your-device> herex93 Alc/backends/<your-device>.c94 )95 #+end_src98 * In ~/.alsoftrc100 #+begin_src conf101 drivers = <your-device>102 #+end_src