aurellem

all the steps to add a device to open-al

Written by Robert McIntyre

Table of Contents

1 How to add a new backend device

2 In Alc/backends/<your-device>.c

static const ALCchar <your-device>_device[] = <your-device-name>;

ALCboolean alc_<your-device>_init(BackendFuncs *func_list)
void alc_<your-device>_deinit(void)

static ALCboolean <your-device>_open_playback(ALCdevice *device, const ALCchar *deviceName)
static void <your-device>_close_playback(ALCdevice *device)
static ALCboolean <your-device>_reset_playback(ALCdevice *device)
static void <your-device>_stop_playback(ALCdevice *device)
void alc_<your-device>_probe(enum DevProbe type)
{
    switch(type)
    {
        case DEVICE_PROBE:
            AppendDeviceList(<your-device>Device);
            break;
        case ALL_DEVICE_PROBE:
            AppendAllDeviceList(<your-device>Device);
            break;
        case CAPTURE_DEVICE_PROBE:
            break;
    }
}
static const BackendFuncs <your-device>_funcs = {
    <your-device>_open_playback,
    <your-device>_close_playback,
    <your-device>_reset_playback,
    <your-device>_stop_playback,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL
};

3 In OpenAL32/Include/alMain.h :

ALCboolean alc_<your-device>_init(BackendFuncs *func_list);
void alc_<your-device>_deinit(void);
void alc_<your-device>_probe(enum DevProbe type);

4 In Alc/ALc.c :

     { "<your-device>", alc_<your-device>_init, 
         alc_<your-device>_deinit, alc_<your-device>_probe, EmptyFuncs },

5 In CMakeLists.txt

SET(ALC_OBJS  Alc/ALc.c
              Alc/ALu.c
              Alc/alcConfig.c
              Alc/alcDedicated.c
              Alc/alcEcho.c
              Alc/alcModulator.c
              Alc/alcReverb.c
              Alc/alcRing.c
              Alc/alcThread.c
              Alc/bs2b.c
              Alc/helpers.c
              Alc/hrtf.c
              Alc/mixer.c
              Alc/panning.c
              # Default backends, always available
              Alc/backends/loopback.c
              Alc/backends/null.c
              # : add <your-device> device
              Alc/backends/<your-device>.c
)

6 In ~/.alsoftrc

drivers = <your-device>

Date: 2011-10-20 15:48:47 MST

Author: Robert McIntyre

Org version 7.6 with Emacs version 23

Validate XHTML 1.0