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