rlm@0: #+title: all the steps to add a device to open-al rlm@0: #+author: Robert McIntyre rlm@0: #+email: rlm@mit.edu rlm@0: #+description: how to add a new device to open-al rlm@0: #+SETUPFILE: ../../aurellem/org/setup.org rlm@0: #+INCLUDE: ../../aurellem/org/level-0.org rlm@0: rlm@0: rlm@0: * How to add a new backend device rlm@0: rlm@0: * In Alc/backends/.c rlm@0: rlm@0: #+begin_src C rlm@0: static const ALCchar _device[] = ; rlm@0: rlm@0: ALCboolean alc__init(BackendFuncs *func_list) rlm@0: void alc__deinit(void) rlm@0: rlm@0: static ALCboolean _open_playback(ALCdevice *device, const ALCchar *deviceName) rlm@0: static void _close_playback(ALCdevice *device) rlm@0: static ALCboolean _reset_playback(ALCdevice *device) rlm@0: static void _stop_playback(ALCdevice *device) rlm@0: #+end_src rlm@0: rlm@0: #+begin_src C rlm@0: void alc__probe(enum DevProbe type) rlm@0: { rlm@0: switch(type) rlm@0: { rlm@0: case DEVICE_PROBE: rlm@0: AppendDeviceList(Device); rlm@0: break; rlm@0: case ALL_DEVICE_PROBE: rlm@0: AppendAllDeviceList(Device); rlm@0: break; rlm@0: case CAPTURE_DEVICE_PROBE: rlm@0: break; rlm@0: } rlm@0: } rlm@0: #+end_src rlm@0: rlm@0: #+begin_src C rlm@0: static const BackendFuncs _funcs = { rlm@0: _open_playback, rlm@0: _close_playback, rlm@0: _reset_playback, rlm@0: _stop_playback, rlm@0: NULL, rlm@0: NULL, rlm@0: NULL, rlm@0: NULL, rlm@0: NULL, rlm@0: NULL rlm@0: }; rlm@0: #+end_src rlm@0: rlm@0: rlm@0: * In OpenAL32/Include/alMain.h : rlm@0: rlm@0: #+begin_src C rlm@0: ALCboolean alc__init(BackendFuncs *func_list); rlm@0: void alc__deinit(void); rlm@0: void alc__probe(enum DevProbe type); rlm@0: rlm@0: #+end_src rlm@0: rlm@0: * In Alc/ALc.c : rlm@0: #+begin_src C rlm@0: { "", alc__init, rlm@0: alc__deinit, alc__probe, EmptyFuncs }, rlm@0: rlm@0: #+end_src rlm@0: rlm@0: * In CMakeLists.txt rlm@0: #+begin_src cmake rlm@0: SET(ALC_OBJS Alc/ALc.c rlm@0: Alc/ALu.c rlm@0: Alc/alcConfig.c rlm@0: Alc/alcDedicated.c rlm@0: Alc/alcEcho.c rlm@0: Alc/alcModulator.c rlm@0: Alc/alcReverb.c rlm@0: Alc/alcRing.c rlm@0: Alc/alcThread.c rlm@0: Alc/bs2b.c rlm@0: Alc/helpers.c rlm@0: Alc/hrtf.c rlm@0: Alc/mixer.c rlm@0: Alc/panning.c rlm@0: # Default backends, always available rlm@0: Alc/backends/loopback.c rlm@0: Alc/backends/null.c rlm@0: # : add device rlm@0: Alc/backends/.c rlm@0: ) rlm@0: #+end_src rlm@0: rlm@0: rlm@0: * In ~/.alsoftrc rlm@0: rlm@0: #+begin_src conf rlm@0: drivers = rlm@0: #+end_src