misc/libopenalbridge/openalbridge_t.h
author koda
Sat, 31 Jul 2010 10:52:43 +0200
changeset 3695 c11abf387a7d
parent 3691 34fe2149f75d
child 3744 543412536b7b
permissions -rw-r--r--
reverted stereo craziness - the experimental3D branch has been created for a reason
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
3695
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
     1
/*
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
     2
 * OpenAL Bridge - a simple portable library for OpenAL interface
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
     3
 * Copyright (c) 2009 Vittorio Giovara <vittorio.giovara@gmail.com>
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
     4
 *
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
     5
 * This program is free software; you can redistribute it and/or modify
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
     6
 * it under the terms of the GNU Lesser General Public License as published by
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
     7
 * the Free Software Foundation; version 2 of the License
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
     8
 *
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
     9
 * This program is distributed in the hope that it will be useful,
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    12
 * GNU Lesser General Public License for more details.
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    13
 *
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    14
 * You should have received a copy of the GNU Lesser General Public License
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    15
 * along with this program; if not, write to the Free Software
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    16
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    17
 */
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    18
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    19
#include <stdint.h>
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    20
#include "al.h"
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    21
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    22
#ifndef _OALB_INTERFACE_TYPES_H
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    23
#define _OALB_INTERFACE_TYPES_H
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    24
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    25
enum al_fade_enum {AL_FADE_IN, AL_FADE_OUT};
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    26
typedef enum al_fade_enum al_fade_t;
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    27
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    28
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    29
// data type to handle which source source is playing what
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    30
#pragma pack(1)
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    31
typedef struct _al_sound_t {
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    32
    const char *filename;       // name of the sound file
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    33
    ALuint buffer;              // actual sound content
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    34
    uint32_t source_index;      // index of the associated source
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    35
    ALboolean is_used;          // tells if the element can be overwritten
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    36
} al_sound_t;
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    37
#pragma pack()
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    38
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    39
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    40
// data type for passing data between threads
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    41
#pragma pack(1)
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    42
typedef struct _fade_t {
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    43
    uint32_t index;
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    44
    uint16_t quantity;
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    45
    al_fade_t type;
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    46
} fade_t;
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    47
#pragma pack()
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    48
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    49
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    50
// data type for WAV header
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    51
#pragma pack(1)
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    52
typedef struct _WAV_header_t {
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    53
    uint32_t ChunkID;
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    54
    uint32_t ChunkSize;
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    55
    uint32_t Format;
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    56
    uint32_t Subchunk1ID;
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    57
    uint32_t Subchunk1Size;
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    58
    uint16_t AudioFormat;
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    59
    uint16_t NumChannels;
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    60
    uint32_t SampleRate;
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    61
    uint32_t ByteRate;
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    62
    uint16_t BlockAlign;
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    63
    uint16_t BitsPerSample;
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    64
    uint32_t Subchunk2ID;
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    65
    uint32_t Subchunk2Size;
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    66
} WAV_header_t;
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    67
#pragma pack()
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    68
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    69
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    70
#ifdef __CPLUSPLUS
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    71
}
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    72
#endif
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    73
c11abf387a7d reverted stereo craziness - the experimental3D branch has been created for a reason
koda
parents: 3691
diff changeset
    74
#endif /*_OALB_INTERFACE_TYPES_H*/