misc/openalbridge/openalbridge.h
changeset 3362 8d3b4d19ce27
parent 3360 717b4e46e855
child 3513 f589230fa21b
equal deleted inserted replaced
3361:cfc6cd502f85 3362:8d3b4d19ce27
    17  */
    17  */
    18 
    18 
    19 #ifndef _OALB_INTERFACE_H
    19 #ifndef _OALB_INTERFACE_H
    20 #define _OALB_INTERFACE_H
    20 #define _OALB_INTERFACE_H
    21 
    21 
       
    22 #include "openalbridge_t.h"
    22 
    23 
    23 #ifdef __CPLUSPLUS
    24 #ifdef __CPLUSPLUS
    24 extern "C" {
    25 extern "C" {
    25 #endif 
    26 #endif
    26     
    27 
    27     // init audio context and allocate memory
    28     // init audio context and allocate memory
    28     char openal_init              (char usehardware, int memorysize);
    29     int openal_init               (int memorysize);
    29 
    30 
    30     // close audio subsytem and free memory
    31     // close audio subsytem and free memory
    31     void openal_close             (void);
    32     void openal_close             (void);
    32 
    33 
    33     // check if openal_init has been called
    34     // check if openal_init has been called
    35 
    36 
    36     // load an audio file into memory and map it to abuffer
    37     // load an audio file into memory and map it to abuffer
    37     int  openal_loadfile          (const char *filename);
    38     int  openal_loadfile          (const char *filename);
    38 
    39 
    39     // play, pause, stop a single sound source
    40     // play, pause, stop a single sound source
    40     void openal_playsound         (unsigned int index);	
    41     void openal_playsound         (unsigned int index);
    41     void openal_pausesound        (unsigned int index);
    42     void openal_pausesound        (unsigned int index);
    42     void openal_stopsound         (unsigned int index);
    43     void openal_stopsound         (unsigned int index);
    43 
    44 
    44     // play a sound and set whether it should loop or not (0/1)
    45     // play a sound and set whether it should loop or not (0/1)
    45     void openal_playsound_loop    (unsigned int index, char loops);
    46     void openal_playsound_loop    (unsigned int index, char loops);
    57     void openal_setvolume         (unsigned int index, float gain);
    58     void openal_setvolume         (unsigned int index, float gain);
    58 
    59 
    59     // set volume for all sounds (gain interval is [0-1])
    60     // set volume for all sounds (gain interval is [0-1])
    60     void openal_setglobalvolume   (float gain);
    61     void openal_setglobalvolume   (float gain);
    61 
    62 
    62     // mute or unmute all sounds    
    63     // mute or unmute all sounds
    63     void openal_togglemute        (void);
    64     void openal_togglemute        (void);
    64 
    65 
    65     // fade effect, 
    66     // fade effect,
       
    67     void openal_fade              (unsigned int index, unsigned short int quantity, al_fade_t direction);
       
    68     void openal_fadein            (unsigned int index, unsigned short int quantity);
    66     void openal_fadeout           (unsigned int index, unsigned short int quantity);
    69     void openal_fadeout           (unsigned int index, unsigned short int quantity);
    67     void openal_fadein            (unsigned int index, unsigned short int quantity);
       
    68     void openal_fade              (unsigned int index, unsigned short int quantity, char direction);
       
    69 
    70 
    70 #define AL_FADE_IN 1
       
    71 #define AL_FADE_OUT -1
       
    72 
    71 
    73 #ifdef __CPLUSPLUS
    72 #ifdef __CPLUSPLUS
    74 }
    73 }
    75 #endif
    74 #endif
    76 
    75