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