Steps to add a new Device to Open-AL

aurellem

Written by Robert McIntyre

Table of Contents

1 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
};

2 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);

3 In Alc/ALc.c :

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

4 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> herex
              Alc/backends/<your-device>.c
)

5 In ~/.alsoftrc

drivers = <your-device>

Date: 2012-02-11 11:28:47 UTC

Author: Robert McIntyre

Org version 7.7 with Emacs version 23

Validate XHTML 1.0